Pull Request Review¶
The pull-request-review capability helps a user review open and recently
merged pull requests one by one by turning public GitHub PR metadata into a
guided review queue. Its command packet remains versioned as
pr_review_command_v0 and is exposed through /loopx-pr-review and
loopx pr-review.
The reviewed repository is the caller's current GitHub project by default, as
resolved by gh, or the explicit --repo owner/repo target. LoopX's own
repository may be used for dogfood and public fixtures, but the command is not
LoopX-repo-specific.
The default command is read-only. An explicit --observation-state-file
writes only its local public-safe checkpoint. Neither mode approves reviews,
posts PR comments, merges, pushes, spends LoopX quota, or completes LoopX todos.
The built-in pull-request-review capability adds an optional autonomous
observation to this same command. It reuses the existing GitHub scan and
normalized review queue; it does not introduce a second crawler or a new write
authority.
Configure direction in Dashboard → capability center → device defaults or a
selected Goal → Pull-request review. Goal settings list every registered
Agent, each with Inherit Goal / Forward / Reverse. Preview, apply and readback
use the existing revision-locked configuration writer. Agent direction is
stored in the Goal's pull_request_review.agent_orders; it is not host prose.
An unset Agent inherits the complete Goal override, then the live machine
namespace, then the capability default forward. Setting only Agent directions
keeps the global direction and CI policy inherited from the live machine; it
does not create a global Goal override.
loopx configure-goal --goal-id GOAL --pr-review-order forward \
--pr-review-agent-order reviewer-a=forward \
--pr-review-agent-order reviewer-b=reverse --execute
loopx configure-goal --goal-id GOAL
loopx pr-review --goal-id GOAL --agent-id reviewer-b --repo owner/repo --format json
The last command needs no direction flag. A verified current Codex thread
binding also supplies the Agent when --agent-id is omitted. Conflicting or
unregistered identities fail before scanning. An unbound caller can omit the
Agent to read the Goal default; it does not impersonate a registered lane.
request.review_order, request.review_order_source and request.agent_id
show the effective choice. Explicit --review-order wins over Agent, Goal and
machine settings. --pr-review-agent-order reviewer-b=inherit clears only that
Agent's override; --clear-pr-review-configuration clears the complete Goal
review override. Removing the machine namespace restores forward.
These settings change scheduling only. They grant no GitHub review/comment, Todo, push, merge, cross-Agent write or scheduler authority, and do not alter review depth or the configured CI policy.
Queue owner accounts / 队列所有者账号¶
By default, only the authenticated request.reviewer_login is an owner. Configure
additional explicit GitHub logins in the same Capability Center (device defaults
or a single Goal), under Additional owner accounts / 额外所有者账号:
loopx configure-goal --goal-id GOAL --pr-review-owner-login maintainer \
--pr-review-owner-login automation-account --execute
loopx configure-goal --goal-id GOAL
loopx pr-review --goal-id GOAL --agent-id reviewer-a --repo owner/repo --format json
owner_logins replaces the additional list, matches case-insensitively, and
deduplicates account names. An omitted Goal list inherits live device defaults;
an explicit empty list uses only the authenticated reviewer. Clear just the
additional accounts with --clear-pr-review-owner-logins --execute; clear the
complete Goal override to inherit device defaults. Remove owner_logins from
Goal and device configuration before downgrading to a version without this field.
The scheduling policy reads back the effective union. owner_authored is derived
queue membership; the legacy authenticated_developer_owned lane id is retained.
author_owned still means the author is the actual signed-in reviewer, including
GitHub's formal self-review restriction. Neither list membership nor the repository
namespace infers organization membership, trust, authentication or merge authority.
Forward visits non-owners first; reverse inverts that same whole actionable queue.
默认仅当前登录的审阅账号计入 owner。可在能力中心的设备默认值或单个 Goal 中填写
额外所有者账号,也可重复使用上面的 CLI 参数;配置一次即可,无须每轮传参。
Goal 未配置时沿用设备列表,空列表恢复仅登录账号,清除全部 Goal 配置恢复设备继承。
账号匹配忽略大小写并去重;排序回读显示实际账号集合。owner 分组不改变 GitHub
身份、自审限制或审阅/合并权限,也不从仓库命名空间推断成员。降级前从 Goal 与
设备配置移除 owner_logins。正向先审非 owner,反向将同一完整可执行队列倒序。
The capability also owns the review-depth contract. The shared
agent_response_contract.review_execution_contract defines required evidence,
completion, freshness, finding, and verdict rules. Each actionable PR carries a
compact review_plan that binds those rules to one exact head and marks
code-symbol and negative-walkthrough applicability. Inventory-only rows expose
no executable review artifacts. Host skills route and publish this packet; they
must not maintain a second explanation checklist.
Policy revision 21 adds optional visual explanation guidance to that same contract and each actionable PR's five-section template. Use a small Mermaid diagram or table when it clarifies a before/after behavior, branching flow, state transition, dependency or authority boundary; simple edits can stay in prose. Place it in 改动思路, explain it briefly, and bind its caption and source links to the exact reviewed head. Recheck it when the head changes. Source-derived diagrams are illustrative, not test evidence. Inspect rendered labels and branches before publication; use a prose/table fallback with the rendering limitation when necessary. No image service, new setting, result field or diagram completion gate is introduced. The complete bilingual review, findings, source coverage, section floors and merge checks still apply.
同一能力合同与每个可执行 PR 的五段模板现在提供按需图示指导:复杂的前后行为、 分支流程、状态迁移、依赖和权限边界可用一张小 Mermaid 图或表格说明;简单改动 保持简洁文字。图放在「改动思路」,附短解释、实际审查 head 和源码链接,改后重新 核对。源码推导图标为示意,不能充当测试证据;发布前检查真实渲染,无法核验时改用 文字或表格并说明缺口。该指导不新增设置、图生成服务、结果字段或配图门禁,完整 双语评审、发现、来源读取和合并资格仍沿用原合同。
Architecture judgment is part of change_proportionality.architecture_assessment,
not a second review checklist. Policy revision 19 asks the reviewer to separate
the PR's behavior-bearing mechanisms into invariants, optional policies,
provider IO, projections or local helpers. For each, identify the current and
recommended owner, activation/default scope, failure/recovery consequence and
the accepted contract, current maintainer direction or demonstrated risk behind
that placement. Feature-off compatibility does not establish whether a core
guarantee belongs behind an opt-in or an expensive strategy should be default.
Judge both choices without inventing a requirement to widen defaults.
Declare retain, simplify_now, follow_up, not_yet_proven, or a scoped
not_applicable. Required simplification and material unknowns block APPROVE
even when the surrounding proportionality label says proportionate, all tests
pass and the latest bug is fixed. An unaccepted preference or future extension
stays non-blocking. Publish the decisive reason and current_pr_boundary in
the architecture or overall-evaluation section: name the useful current outcome,
smallest repair and safely deferred owner/acceptance. A cohesive prerequisite can
be approved without delivering its parent roadmap; an empty registry/schema
cannot claim that outcome. Tightly coupled stages should be combined.
Both published fields must contain visible text after ordinary Markdown
normalization; empty link labels and formatting alone do not count. Formatted
visible wording remains accepted without imposing a new prose style.
架构判断进入既有比例评估:逐项说明核心保证、可选策略、provider IO 和投影的 owner、默认范围及失败恢复,再决定当前 PR 交付边界。关闭态兼容通过不代表 默认策略合理,最新 bug 修好也不消除已声明的必要架构收敛。必须现在修复或仍有 关键未知时不能批准;未经接受的偏好保留为非阻塞建议。公开正文须带出决定性理由 和本阶段结果,允许可独立验证的前置阶段,不要求补完全部父级 roadmap。 两个公开字段归一化后须有可见文字;空链接或格式符号不能代替说明,正常格式文字仍可通过。
The checker validates typed declarations, verdict consistency and publication;
it cannot discover architectural insight or prove the review's truth. Paired
architecture probes in test_pr_review_behavior.py exercise a coupled bundle,
separate base/optional strategy, a legitimate opt-in, duplicate authority and
distinct observer/required phases. They require explicit live qualification;
offline consistency tests and skipped probes do not establish model improvement
or justify a target rejection rate.
Request intake precedes generic queue selection. The capability's
decision_procedure.establish_goal receives current-session requests from other
agents within an already authorized review assignment. Agent/thread provenance
is distinct from GitHub account ownership: shared accounts do not make all PRs
the receiving agent's own work. Current user priorities select a bounded batch
through the existing repeatable --target-exact-head entrypoint. Each row still
owns its action eligibility and exact-head idempotency. Incoming claims do not
prove tests or transfer publication, dismissal, merge or messaging authority;
those judgments stay separate. This is review workflow guidance, not a new
admission gate, inbox store or cross-thread transport.
Compatibility review replaces the old free-text justification inside
code_volume with compatibility_assessment. Reviewers identify actual callers,
their deployment boundary, the separately persisted contract, a simpler
alternative, and validation evidence. Keeping historical receipts does not by
itself justify retaining an old transient request decoder; deploying callers
together does not justify deleting a reader for durable queued requests.
The declared decision is retain, simplify_now, follow_up, not_yet_proven,
or not_applicable. A required simplification or material unknown cannot support
APPROVE; an evidenced non-blocking follow-up can. Unrelated changes need only a
scoped not-applicable reason. The checker enforces these declarations, not their
truth: real caller inspection and old-data/mixed-version readback still belong
to the reviewer. Policy revision 10 requires fresh evidence rather than relabeling
an older result. It does not add a new wire schema or a new review authority.
The primary product judgment lives in problem_context.outcome_impact: can
useful work continue over later invocations, and can users still reach their
intended outcome through the affected surface? Assess long_horizon and
user_experience before implementation narration. Local feature acceptance or
green CI cannot override a regression or a material unproven claim in either
dimension. Follow bounded real journeys appropriate to the diff: durable
continuation, retry/restart, competing work, truthful status, intervention cost
and correction/recovery. Reuse walkthroughs and validation references rather
than producing a second report or requiring a soak for every change.
Policy revision 12 makes that journey comparison concrete within the existing
fields: compare required steps with the shortest valid authorized path, justify
each mandatory question/confirmation, inspect populated whole-view composition,
and distinguish fixture, packaged and installed evidence. No new result field,
UI-only capability or second review authority is added. The checker still
validates declarations rather than usability; the reviewer must execute and
inspect the evidence. The paired frontend cases in test_pr_review_behavior.py
challenge unnecessary forms, misleading recency and scope-confused settings,
with positive controls preserving legitimate consent. These reasoning probes
run only for release qualification; offline checks do not certify model quality.
LoopX authors use the frontend delivery workflow;
reviews of other repositories follow their own product contracts.
Legitimate safety, budget and dependency waits can be an accepted_tradeoff
with an independent acceptance basis and bounded cost/recovery. Do not weaken
authority to manufacture progress. A scoped not_applicable still names the
inspected path. These assessments also apply to user-facing instructions and
defaults; they are not limited to state-machine code or visible UI diffs.
The narrower observable_semantics.scope_coverage assessment is required for
behavior-bearing reviews. First establish whether the touched path owns or
retains a gate; a scoped not_applicable reason is sufficient otherwise. For a
gate, distinguish activation authority, covered subjects and binding readiness.
Validate covered work, independent work in the same container, new work after
activation, mutable-field escape and recovery back to useful execution. Global
coverage is valid when explicitly authorized; feature-off parity alone does not
prove enabled-but-out-of-scope isolation. A blocker receipt or replan ACK does
not establish recovery. These are reviewer-executed counterfactuals, not semantic
facts inferred by the checker.
Save the exact final Markdown in the result's review_body before --check-result.
Policy revision 16 also makes reviewer attribution observable. For actionable
live packets invoked inside a bound Codex session, reviewer_execution reads
only that exact thread in its selected CODEX_HOME, using read-only SQLite
discovery and bounded host-record metadata. It never searches sibling homes or
uses mutable model preferences as execution evidence. The result template
preserves the recorded model, public provider, effort and opaque observation id.
The published Reviewer: line names the model/provider plus runtime_reported
and the effort; missing effort is effort_unavailable. No session id, transcript,
path, endpoint or account enters this public attribution.
loopx pr-review --check-result RESULT --packet PACKET rereads the invoking
session: stale model/effort declarations, an altered snapshot or a different
recorded Turn cannot qualify for publication. An unavailable host record remains
an explicit gap; use an honest family declaration marked self_reported, not a
configured preference or an invented exact build. This is a reviewer publication
error, not a PR-author finding. Inventory-only and fixture scans do not read host
metadata. Offline saved-packet checking proves consistency only. The bounded
reader may retain recorded identity with active_turn_verified=false when the
opening event is outside its window; neither metadata nor this marker proves
backend weights, review independence, host delivery, liveness or merge authority.
The same body validator is used for published review readback and merge readiness.
Behavior-bearing reviews also fill the existing
observable_semantics.decision_text_assessment: inspect agent-consumed prose
even when fields, commands and enums are unchanged. Changed instructions need
clause comparisons and passed real-caller counterfactuals covering ordering,
evidence, modality, scope, continuation and stop conditions. Missing evidence or
semantic drift blocks approval; an intentional change needs its authorization
basis, declared as fields_by_verdict.intentional_change_validated in the same
assessment contract. equivalent adds no authorization field; a reasoned
not_applicable needs only the common fields. This is part of the
existing evidence judgment, not a new receipt or automatic meaning detector.
Character budgets are cost guards: a justified increase is preferable to
discarding useful control-plane meaning. Model comprehension remains unverified
unless separately tested.
For behavior-bearing changes, the five sections require respectively 40, 80, 180, 120 and 60 explanatory letters/numbers; reviews without executable or policy changes use 20, 30, 50, 30 and 20. Headings, code blocks, URL targets, commit hashes and repeated lines within a section do not count. These modest floors reject empty shells; they do not prove correct reasoning or replace evidence. Explain concrete symbols, decisions, counterexamples and results rather than padding. A sufficiently long body with unverified scope evidence still cannot support approval. Existing short reviews on open heads must be expanded and checked before they qualify again; queue ordering and explicit post-merge audit selection remain unchanged.
The historical review corpus exercises these checks with substantial public reviews and exact-commit source excerpts. Model probes receive code and bounded observations without the review or expected verdict. Historical validation reports stay explicitly historical; neither a long body nor a recorded approval supplies present-day evidence.
Codex agents should use the dedicated loopx-pr-review skill for this slash
command. Do not route /loopx-pr-review through the broader loopx-project
workflow or the merge-focused loopx-pr-merge skill.
Command¶
| Command | CLI reference | Intent |
|---|---|---|
/loopx-pr-review |
loopx pr-review [--repo owner/repo] [--target-exact-head NUMBER@HEAD_OID] [--state open\|merged\|all] [--review-order forward\|reverse] [--since ISO] [--fresh-audit-exact-head NUMBER@HEAD_OID] |
Review a small explicit batch with repeatable --target-exact-head, or list a lifecycle queue when no target is supplied. Both paths provide concrete main-regression analysis and the five-block review contract. Forward visits other authors first; reverse inverts the entire actionable queue. Saved Agent settings apply automatically. --fresh-audit-exact-head separately forces new evidence for an unchanged concluded head. |
| pre-merge readback | loopx pr-review [--goal-id GOAL] --repo owner/repo --check-merge-readiness NUMBER@HEAD_OID |
Immediately before merge, fail closed unless the remote PR is still open at the reviewed head, its standalone conclusion approves that head, all checks are successful or skipped, review-thread pagination is complete with no unresolved thread, and merge state is compatible. Standalone checks require no Goal and write no Goal state. Add --goal-id GOAL for existing Goal-managed work to retain its CI policy and record a compact public-safe observation; this read grants no merge authority. |
The slash command must run the CLI first. Agentloop must not reconstruct the
review window by manually calling gh pr view / gh pr list for every PR. The
CLI packet's review_groups.unmerged, review_groups.merged, and
review_sequence are the authoritative executable queue. Non-null
pull_requests[].review_template and evidence_commands are for the second
step: reading one selected actionable PR deeply.
Use the JSON form for the first pass so the response contract and per-PR blank
templates enter the model context:
The ordinary queue defaults to open PRs. Use --state merged or --state all
explicitly only for a lifecycle or post-merge audit; named exact targets remain
lifecycle-neutral when --state is omitted.
When the user explicitly names one or a few PRs, resolve each current head and request only those exact heads. This direct path is complete for the named targets and must not be expanded into a historical queue merely to satisfy queue completeness:
loopx --format json pr-review --repo owner/repo \
--target-exact-head 4868@0123456789abcdef0123456789abcdef01234567
The option is repeatable. A remote head mismatch fails closed. Use
--fresh-audit-exact-head in addition only when an unchanged target already has
a valid conclusion and the user explicitly requests new evidence.
The live source scan keeps the list query lightweight and enriches each PR's
nested commits, reviews, and checks with a bounded pool of concurrent
gh pr view reads (at most eight at a time). Results are reassembled in list
order, and a failed detail read still remains visible as an incomplete source
scan, so the latency improvement does not change queue ordering or freshness
semantics. The scan does not use a stale cache: rerunning the command always
re-reads the requested GitHub window.
When GitHub's paginated file API is capped at 3000 entries, a PR declaring
more files can recover its inventory from already available exact Git objects
in the caller's checkout. The origin must identify the requested GitHub
repository. LoopX compares the unique merge base to the exact head, folds only
API-confirmed rename pairs, and requires the resulting file count and whole-diff
addition/deletion totals to match fresh GitHub metadata. Head, base and totals
are fenced before pagination and after recovery. This is source completeness,
not review evidence or approval of the recovered PR.
The source provider's recovered file rows identify source as github or
git. Known API per-file statistics are retained, including 0/0 for omitted
or generated diffs. Unobserved Git binary rows retain unknown per-file counts
(null); Git's textual totals exclude binary lines. Mixed display values need
not sum to the independently verified whole-diff totals. Ordinary complete GraphQL/REST reads keep their
existing shape. No object fetch, clone, checkout, external diff or textconv is
performed. A wrong repository, missing objects, ambiguous rename or
malformed statistics, total mismatch or remote version change remains an
incomplete source. Callers without a versioned snapshot (including approval
closeout) retain their complete-API requirement; inventory recovery grants no
additional closeout, publication or merge authority.
GitHub 文件 API 达到 3000 项上限时,调用方当前 checkout 中已有的精确 Git 对象 可用于恢复更大 PR 的文件清单。必须核对 origin 仓库、唯一 merge base 与精确 head, 仅折叠 API 明确确认的 rename,并让文件数和全 diff 增删量与远端 metadata 一致。 分页前及恢复后校验 head、base 和总量。保留 API 已知行的统计值;恢复行的 Git 来源 不等于已完成 review。Git 二进制行不贡献文本行数,未被 API 观测的逐行统计保留 null, 不会假定为 API 的 0/0。不会自动抓取对象、切分支或执行外部 diff/textconv;缺对象、 统计格式损坏、rename 歧义、总量不符或版本变化继续明确返回 incomplete。没有精确快照 的 approval closeout 仍要求完整 API 读回,不扩大撤回 review 或合并权限。
For an autonomous maintainer monitor, request the complete open queue while persisting its compact cursor in an ignored local checkpoint:
loopx --format json pr-review --repo owner/repo --state open \
--autonomous-observation \
--observation-state-file .local/pr-review-monitor.json
The same command reuses that checkpoint on later Codex tasks. Its atomic local
write grants no GitHub, Todo, push, or merge authority.
--previous-observation-json remains available for stateless callers and is
mutually exclusive with --observation-state-file:
loopx --format json pr-review --repo owner/repo --state open \
--autonomous-observation \
--previous-observation-json previous.json
After the selected candidate has been durably materialized as a Todo, acknowledge that projection explicitly:
loopx --format json pr-review --repo owner/repo --state open \
--autonomous-observation \
--observation-state-file .local/pr-review-monitor.json \
--projected-exact-head 2768@0123456789abcdef0123456789abcdef01234567
Supply --projected-exact-head only after the candidate's exact target key has
been durably materialized as a Todo. Candidate emission is a preview, not a
projection acknowledgement. Without that explicit ACK, repeated complete polls
replay the same candidate so a failed or interrupted Todo write cannot strand
the PR. The option is repeatable and may only acknowledge the prior candidate
or an already persisted projection cursor.
After the selected candidate has an externally verifiable review or merge-readiness result at that exact head, advance the queue with an explicit handled cursor:
loopx --format json pr-review --repo owner/repo --state open \
--autonomous-observation \
--observation-state-file .local/pr-review-monitor.json \
--handled-exact-head 2768@0123456789abcdef0123456789abcdef01234567
--handled-exact-head is repeatable and uses NUMBER@HEAD_OID. The observation
persists these public-safe cursors in handled_exact_heads. Candidate emission
alone is not a completion receipt: callers must add the cursor only after
review-result readback proves that exact head was handled. A newly supplied
cursor must match the prior packet's candidate or one of its
projected_candidate_exact_heads; a caller cannot skip an unselected PR by
naming it handled. A new head is a new candidate even when the prior head was
handled.
pending_candidate_exact_head preserves the last selected but unhandled exact
head across unchanged and incomplete polls. It is a scheduling cursor only;
callers still deduplicate Todo creation by exact target key and must not treat
the cursor as evidence that a review happened.
projected_candidate_exact_heads persists every candidate whose durable Todo
projection has been explicitly acknowledged but not yet completed. An unchanged
poll skips those acknowledged exact heads and selects the next unprojected,
unhandled PR in the capability-ranked review sequence. Legacy v0 observations treated
emission as projection; v1 deliberately replays their candidates so stale
emission cursors cannot strand unreviewed PRs. Todo target-key deduplication
keeps this recovery idempotent.
When every actionable PR has already been projected, candidate is None and
pending_candidate_exact_head remains the last pending cursor. A material
transition on an already projected exact head still re-selects that head.
review_backlog gives the monitor a compact workload cadence hint. It counts
open, non-draft PRs whose exact head is actionable and not yet recorded in
handled_exact_heads, and returns recommended_poll_interval_minutes. While at
least one unhandled PR remains, the recommendation is 3; once the actionable
backlog is empty, it drops to 15. The hint is scheduling evidence only: it
does not grant Todo, review, comment, or merge authority, and callers still
advance the queue with an explicit handled cursor after exact-head review
readback.
pull_request_review_queue_observation_v1 has exactly three observation
states:
not_observed: the source or packet slice was incomplete. Preserve the previous baseline and do not claim the queue is unchanged.observed_unchanged: a complete observation has the same queue fingerprint. An unacknowledged packet candidate is replayed. After the caller supplies its projection ACK, the packet selects the next unprojected, unhandled backlog PR so the queue keeps rotating. An acknowledged unhandled candidate remains inprojected_candidate_exact_headsuntil the caller supplies its completion cursor.material_transition: a complete observation changed an exact head, review conclusion, check state, draft state, mergeability, or open-queue membership. A new head followingREQUEST_CHANGESmay use one fast-feedback slot; check-only activity does not preempt older review-ready work.
The repository-scoped fingerprint contains only compact public PR metadata.
Persisted items carry the PR number, fingerprint, exact head, decision, and
next action; they never carry review bodies.
pull_request_review_scheduling_policy_v1 owns the stable queue order:
- Forward visits other-author feedback and aged backlog first, then remaining other-author work, then the authenticated reviewer's own actionable heads. Ties use review-ready time, creation time, then PR number ascending.
- Reverse inverts that complete actionable forward queue, including author tiers, timestamps and PR-number ties, before applying the batch limit.
- Concluded, draft, merged and closed inventory retains its forward order and stays non-executable. Exact-head acknowledgments retain their meaning.
Packet order and autonomous candidate selection use the same typed direction owner. A direction change is a material queue transition. With a direction selected, the first unhandled/unprojected actionable head wins; no independent author filter or fast-feedback preemption can replace that order.
Compatibility: stored v0 review_priority and the deprecated
--review-priority flag remain readable: other-developers-first maps to
forward, owner-first to reverse. New writes use review_order.
This deliberately changes legacy owner-first time ordering to newest-first;
previously it changed only author tiers. Both fields/flags together are rejected.
The legacy Python API without review_order retains its historical scheduling
behavior; the native CLI uses direction consistently for packets and observation.
No-config CLI packets preserve forward ordering; autonomous own-only approval
transitions now follow that same queue instead of an independent preemption.
Community feedback and aged backlog share one age-fair tier. On a material
transition, at most one newly pushed community response head may take a bounded
fast-feedback slot after the mode-selected actionable group. updatedAt does
not define readiness because comments and checks must not make old code look
new. Only an explicit PR selection in the current user request may override the
next item's ordering for that request; it does not override the selected row's
review_action_kind or exact-head idempotency. Todo text, monitor notes, and
one-off author filters must not replace the capability policy. Projected
candidates remain skipped until handled or their exact head materially changes.
The command packet keeps inventory and execution queues distinct.
pull_requests and each group's pr_numbers retain every row in the requested
window for compact conclusion readback. Top-level and group review_sequence
contain only rows whose review_action_kind is non-null. A merged exact head
without a valid conclusion receives audit_merged_pull_request_exact_head; a
merged or open exact head whose valid conclusion is not an approval remains
inventory-only and cannot become the recommended first PR. An open exact head
with a valid approval owes qualify_pull_request_merge_readiness until the Goal
has observed its current readiness material state. An unchanged observation
suppresses duplicate qualification work; exact-head, base, review conclusion,
configured CI, review-thread, merge-state, or draft-state changes reopen it.
This preserves the typed readiness verdict rather than relying on GitHub's
review state: the platform blocks self-approval, so an author-owned approval is
recorded as COMMENTED and a state-based rule could otherwise count a
still-unmerged head as concluded even after it goes behind, conflicts, loses
its checks or is blocked. The summary's attention counts are derived from this
same actionable set. Inventory-only rows set review_plan and
review_template to null and evidence_commands to an empty list so hosts
cannot mistake readback metadata for execution authority.
Draft PRs remain inventory-only until the author submits them for review. Follow author submission for completed proposals: missing review or held CI/merge qualification must not prevent an authorized author from marking the PR ready. Read back the unchanged head and regenerate the packet after that transition. Reviewer action authority and exact-head merge qualification remain separate; this rule grants neither a reviewer permission to change another author's Draft nor permission to merge.
It emits a
pull_request_review_todo_preview_v0 bound to its exact head. The preview may
route to initial review, re-review after changes, or merge-readiness
qualification. It grants no Todo write, GitHub review/comment, push, or merge
authority; callers must use normal LoopX Todo authority, loopx-pr-review, and
loopx-pr-merge policy for those actions.
Do not pipe that first packet through jq or another projection that only
keeps .summary and .review_sequence; that drops
agent_response_contract, scheduling_policy, review_groups, and the
non-null pull_requests[].review_template, pull_requests[].review_plan, and
pull_requests[].evidence_commands, which are the fields that make an
actionable row a guided review instead of a statistics table.
Capability-Owned Review Execution¶
pull_request_review_execution_contract_v2 is shared once per packet to avoid
duplicating a large prompt for every PR in a 100-item queue. It requires these
typed evidence groups before a verdict:
- problem context and active caller;
- architecture and ownership flow;
- repository reuse for behavior-bearing changes: search base and exact-head code, including unchanged siblings, by caller outcome/resource rather than only new filenames. Record revisions, queries, paths and candidate callers; compare scope/filters, ordering/paging, authority/sanitization and state/retry ownership. Prefer the nearest existing owner; justify independent boundaries with evidence, not green CI or conflict-free coexistence. For alternative views of one resource, validate consumer switching and concurrent updates where relevant. Before accepting introduced or newly enforced state, classify it as an authoritative fact, irreducible intent, derived projection or diagnostic hint. Trace whether existing canonical state can derive the outcome before adding another declaration to maintain. Require the actual producer, triggering workflow, authoring discovery and update/retirement owner; a generic JSON writer plus a hand-filled fixture proves transport, not an ordinary workflow. Intent such as consent or an alternative relation cannot be invented from unrelated records. Repeat the comparison after base integration or head changes;
- caller-observable semantic parity for every behavior-bearing change, whether or not its title says refactor or migration. Inventory legacy caller branches, then run the same synthetic fixture through the public entrypoint and affected backend at an immutable baseline and the exact head. Record replayable commands, revisions, fixture and observation fingerprints, exit status, full diagnostics, persisted readback, authority/effect outcomes, and only the normalization rules needed for documented nondeterminism. The sensitivity case must make the real path fail on the historical defect or a deliberate dropped-field/detail or stronger-precondition mutation, then pass at the fixed head. New-rule provider conformance and prose-only claims do not establish before/after compatibility. When state/projections drive behavior, vary only redundant annotations, display order/pagination and unrelated-item count beyond display caps, holding authoritative facts fixed. Admission must not change merely because a record falls off a diagnostic page. Check completed, superseded and archived references against the actual acceptance/lifecycle contract; source incompleteness is not proven absence. Do not confuse a real intent or priority change with a presentation-only counterfactual;
- exact changed-line classification across production, tests/fixtures, docs, generated output, and mechanical moves;
- a 2-5 item exact-head symbol map for code-changing PRs, including caller, state, branch, side effect, consumer, and failure ownership;
- positive and applicable negative execution walkthroughs;
- validation tied to changed invariants and failure cases;
- strongest regression path, blast radius, recovery, minimum repair, and regression test;
- code-volume necessity and the highest-value behavior-preserving simplification;
- change proportionality: compare the verified frequency, severity, blast
radius, and recovery cost of the original problem with the production
mechanism, new state/contracts/CLI/callers, migration, and long-term
maintenance surface. Correctness, green CI, and resolution of earlier
findings do not override a
disproportionateornot_yet_provenblocker; - default-off isolation: for an opt-in change, trace every shared schema,
prompt, accepted-input, projection, scheduling, and effect surface. Include
installed or automatically loaded skills, agent instructions, prompt
templates, help, schemas, install bundles, and provider setup guidance:
runtime
default=falseis insufficient when one of those baseline surfaces already changes model or user behavior. Separate availability signals such as installation, discovery, provider readiness, accepted input, and resolver success from activation authority. For scoped capabilities, prove that the intended scope and every required subject are enabled before projecting capability-specific guidance or effects, then run a paired counterfactual proving that disabled behavior still matches the pre-change contract; - authority semantics: make public protocol ids and symbols match the real actor lifecycle and authority, distinguishing ephemeral sub-agents from registered peers and durable multi-agent coordination.
Every materially expanded re-review resets proportionality from the original problem and evaluates the full exact head. Reviewer-requested additions are not progress toward approval by themselves; the reviewer should request the smallest viable fix, deletion, split, or hold when the benefit does not justify the accumulated mechanism.
Goal-oriented delivery and product impact¶
Every actionable review now extends the existing problem_context evidence
with goal_basis and a typed verdict. This applies to code, docs, maintenance
and test-only changes. Resolve the current user request, issue/task, accepted
contract or demonstrated regression before accepting the author's narrowed
scope. A public roadmap id is optional; do not copy private goal content or
require another repository to use LoopX's S/G/R identifiers.
| Delivery verdict | Meaning and additional evidence | Approval effect |
|---|---|---|
goal_achieved |
Existing before/after, observable outcome and non-goals prove the named task's acceptance; no invented successor required | May approve when sustained progress and user experience also qualify, without claiming the parent program complete |
justified_increment |
Useful delivered delta, plus remaining_gap, next_step (owner/dependency) and boundary_reason for independent review, verification and rollback |
May approve a prerequisite, research, docs or maintenance increment without shipping the entire feature |
off_goal / fragmented / not_yet_proven |
reason and minimum_repair explain the mismatch, avoidable premature stop or missing evidence |
Blocks APPROVE even when other evidence and checks pass |
Reuse problem_context.observable_outcome, walkthroughs and
validation_matrix instead of writing another evidence report. Small diffs are
not fragmentation; a new field or sent message is not proof of a promised
end-to-end user journey. For collaboration, follow the required dependency,
receiver adoption, artifact acceptance and return through real callers.
Independent prerequisites and characterization remain valid when their boundary
and real successor are justified. Do not reward larger diffs or fabricated
follow-ups. The checker validates declared evidence consistency, not whether a
reviewer's semantic judgment is true, and it never settles a Goal.
The current policy adds the two outcome_impact judgments to this existing
delivery assessment. A local success cannot excuse a material regression in
either dimension. Rebuild older results from the current packet; do not relabel
them. Queue selection, scheduler and runtime permissions are unchanged. The
five public sections retain the bounded prose floors documented above; reuse
evidence and do not pad. Invoking review uses the installed capability policy.
Reviewer provenance and specification basis¶
Policy revision 14 makes two publication requirements mandatory for every new
result; neither changes queue selection, merge authority or how already
published GitHub reviews are recognized (check_review_body is unchanged).
result.reviewer(reviewer_declaration) namesactor_kind(model_agentorhuman_operator) anddeclaration_source(runtime_reportedorself_reported); an agent addsdeclared_modelanddeclared_providerin product-family wording. The body repeats them on exactly one visibleReviewer:line, each value as a whole token. This is provenance, not a credential: it authenticates nothing and adds no weight.problem_context.spec_basis(spec_basis_assessment) ismapped,no_specornot_yet_proven.mappedgives textspec_ref,spec_revision(a full commit id foraccepted_rfcandaccepted_contract_doc) and one criterion row per material acceptance criterion;not_metandnot_yet_provenblock approval. The reference, revision and everycriterion_idmust appear as whole tokens in the visible body, because another operator reads only the published review.
--check-result reports a missing or inconsistent declaration or unpublished
reference as an error, and a spec-basis gap as an approval blocker. Regenerate
results made under revision 13 rather than adding these fields to them.
Semantic alignment and CI constraint recovery¶
The semantic triage introduced in policy revision 5 replaces universal detailed
semantic review with bounded triage for code and behavior-bearing policy changes. The required row starts
with checked_scope, impact_reason, and verdict (plus the standard evidence
status). Review the full diff and relevant definitions/callers, then stop at
not_applicable if no shared contract is affected. No candidate value, separate
report subsection, full RFC read, or hypothetical repair is needed on this path.
A changed-file preview or an unchanged registry alone cannot establish no impact.
| Verdict | Additional evidence | Approval effect |
|---|---|---|
not_applicable |
None; scope and reason explain the absence of shared contract impact | No semantic blocker |
aligned / new_semantics_justified |
candidate_decision, affected_contract, evidence_refs to existing review evidence |
No semantic blocker |
advisory |
candidate_decision, analysis_limit; the impact reason explains why no affected current obligation lacks required evidence |
Reports a bounded-analysis gap, without claiming safety or blocking on that gap alone |
not_yet_proven / violated |
candidate_decision, affected_contract, trigger, observed_evidence, minimum_repair, validation_commands |
Blocks approval for an affected current obligation with missing required evidence or a concrete violation |
For shared states, owners, consumer domains, projections or persistence changes,
read only the affected base/head contracts. Reuse repository_reuse,
observable_semantics, and validation_matrix evidence instead of repeating
it. Docs-only reviews may supply the same row when they find contract impact;
a supplied row is checked even when not required by the plan. A generated
inventory change alone does not require a detailed semantic review.
The generic capability does not infer impact from repository-specific paths or inject a repository's check names into another repository's packet. Resolve obligations from the target repository's current policy and use the existing validation matrix. Observed check runs do not establish which checks are required. Green CI proves only the checks that ran, not whole-program convergence.
The repair map below is a LoopX repository example, not a policy for every
--repo. In LoopX, verify required checks against .github/GOVERNANCE.md and the
current CI configuration: Sign-off and merge-gate are the documented checks;
the semantic smoke runs through Python tests. Full Public Smokes is a
post-merge/scheduled surface. These facts are not copied into generic packets.
Use this repair map when a check fails:
| Failure family | What it means | Minimum repair | Do not repair by |
|---|---|---|---|
Sign-off |
One commit in the PR range lacks a valid DCO trailer | Add Signed-off-by to every affected commit with git commit --amend -s or an equivalent history repair; verify the full range |
Signing only the newest commit |
| semantic smoke: unregistered value | A recognised carrier/field form introduced a value outside the registry | Reuse the existing owner value, or add the value with its owner, slot, scope, tests, and RFC evidence | Registering an unrelated string to silence the error |
| optional inventory report: stale or missing | A developer-requested export differs from the current tree; semantic CI does not read it | Rerun uv run python scripts/generate_semantic_inventory.py --output <path> if the report is needed; semantic failures require fixing the reported rule |
Committing the census, editing counts by hand, or replacing the full-tree scan with a diff-only scan |
| semantic smoke: owner/parity | A defining symbol or Python/TypeScript value set diverged | Restore the single owner or deliberately update both runtime owners with parity evidence | Adding a second silent authority |
| semantic smoke: projection | A source value is unmapped, mapped to the wrong target, or should be rejected explicitly | Update the declared mapping and executable owner together, then test the boundary case | Deleting a source value without compatibility analysis |
| semantic smoke: budget/anchor | Measured debt grew or the guard was weakened | Fix the underlying duplicate/coverage issue and lower a budget only when the measured debt really fell | Raising the budget, narrowing the scan root, or renaming to hide drift |
merge-gate |
A required upstream CI job failed, was skipped unexpectedly, or has incomplete qualification | Inspect needs and the failing job, fix the owning path, and rerun at the same head |
Treating a local smoke as proof that the remote gate is complete |
A blocker must connect the exact-head change to an existing obligation and a
replayable failure or missing required validation. An untraceable dynamic value
alone is an advisory, not not_yet_proven and not proof of safety. Removing a
persisted value without required old-state readback is not_yet_proven; a failed
required projection check is violated. Neither can be downgraded to advisory
to bypass CI or a concrete blocking finding. Do not turn future or advisory RFC
properties into current merge obligations. Result checking validates declared
consistency, not the truth of a reviewer's classification.
中文边界: 普通改动只填检查范围、影响理由与结论,无共享契约影响时用
not_applicable 结束,无需虚构候选值或补齐整张证据表。影响共享状态、owner、
消费者、投影或持久化时,按受影响契约检查并引用已有证据。扫描器能力不足用
advisory 报告;本次修改缺少现行契约要求的验证用 not_yet_proven,明确违规用
violated,后二者阻断批准并给出契约、触发修改、观察证据、最小修复与复验命令。
其他仓库使用自己的 CI 与契约规则,不能继承 LoopX 的检查名。
A matched model evaluation should preselect ordinary edits, legal contract extensions, and real contract defects; fix tasks, model/version, tools, seeds where supported, and total budgets across policies. Count review and repair within that budget. Compare independently accepted completions, tokens, elapsed time, false blocks and missed defects; report uncertainty and repeat stochastic runs. Deterministic consistency fixtures establish the boundary, not model benchmark uplift or non-regression.
The per-actionable-PR pull_request_review_plan_v1 records the exact target,
applicability, required evidence ids, and an initially unverified
pull_request_review_result_v1 skeleton. Metadata, labels, file counts, risk
hints, and green CI cannot upgrade evidence to verified. A stale-head verdict
is prohibited. Missing evidence remains unverified with a reason instead of
being replaced by confident prose.
repository_reuse starts unverified in every applicable plan. Its conclusions
are reused, separation_justified, no_existing_candidate,
unjustified_duplication, or not_yet_proven. A negative search must name its
scope and limitations; an empty candidate list is not proof of absence.
Unjustified duplication or missing evidence requires a request-changes
conclusion, including missing state derivation, producer/trigger or completeness
proof in state_model_assessment. The same existing gate applies; there is no
second semantic classifier. Similar-looking code with distinct invariants or
compatibility needs may legitimately remain separate. Ordinary docs retain their existing
review path; smoke-only changes retain durable_smoke_value coverage review.
This is a reviewer-executed contract projected by the packet, not an automatic
repository search or a semantic validator of published prose. Tests establish
packet applicability and verdict policy, not guaranteed model compliance.
When --state all is used, the command must preserve both lifecycle groups.
The --limit value is applied per group so a busy open queue cannot consume the
whole packet and make review_groups.merged empty while merged PRs exist in the
window. The default is 100 PRs per selected group. Every packet carries
result_completeness; exhaustive requests must require complete=true and
rerun with its recommended_limit when the source scan or packet slice was
truncated. Live GitHub reads should fetch open and closed/merged windows
separately before constructing the grouped packet.
The agent response must not stop at a queue table. For /loopx-pr-review, the
queue is only the preface; the final answer should review selected PRs one by
one with five sections: 动机, 改动思路, 具体改动, 对主干的风险, and
我的整体评价. A stats/list-only response is valid only when the user
explicitly asks for stats or a list without review. When the visible message
starts with /loopx-pr-review, words such as open, closed, merged,
today, or a time window are filters on the review queue, not permission to
skip the review. Downgrade only for explicit opt-out phrases such as 只统计,
只列出, stats only, list only, 不要 review, or 不用分析.
The published review is a full-PR review primarily in Chinese: five complete
sections covering every changed surface, key symbol, positive and negative path,
and validation, plus one concise English machine verdict
(APPROVE, REQUEST_CHANGES, or the author-owned COMMENTED fallback). The
body carries the depth and evidence; the English verdict carries the
machine-readable state and validation summary. Prefer 动机 / Motivation,
改动思路 / Approach, 具体改动 / Changes, 对主干的风险 / Risks and
我的整体评价 / Verdict. These map to the same Chinese canonical section ids;
existing headings and evidence floors remain valid. Older installed parsers use
the canonical Chinese headings; the body's primary language stays Chinese.
Use connected Chinese prose for the main narrative, problem analysis, evidence and conclusion. Keep finding titles informative and short; optional Problem / Evidence / Impact / Fix labels introduce Chinese explanations. Retain accurate English technical terms, symbols and commands where useful, explaining unfamiliar terms once. Mark validation PASS / FAIL / UNVERIFIED, using compact tables for actual comparisons. Do not expand English labels into long English passages, duplicate the analysis in both languages, impose a language ratio or delete evidence to make the text shorter. This is writing guidance, not a new language gate. A findings-only or blocker-only body is incomplete.
The opening 动机 must stand alone for a reader unfamiliar with the repository:
who encounters the problem, one triggering task and concrete before/after
example, the old failure's practical cost, the proposed improvement, and this
PR's scope. Define necessary terms when they first appear. Keep symbols,
specification criteria, test counts and the detailed verdict in the later
sections; they support the explanation rather than replace it.
Reuse problem_context.affected_caller_or_operator, before_after_scenario,
observable_outcome and non_goals as concise public-safe sentences and publish
their wording in 动机. For justified_increment, also publish remaining_gap.
For example: a maintainer retries an interrupted export; previously a lost
response caused duplicate rows and manual cleanup; the proposed change returns
the saved result; automatic scheduling remains outside the command repair.
Separate intended behavior from reviewer-verified behavior and remaining
defects. --check-result rejects explanations confined to structured evidence,
HTML comments, code fences or later sections, while allowing ordinary Markdown
emphasis and line wrapping. Read the remote body back into the same result and
rerun the check. Matching proves visibility and consistency; the reviewer still
judges whether the scenario is supported and the explanation understandable.
Each complete PR review must also include whole-PR interpretation depth: per-file responsibility mapping, 2-5 key symbol explanations with exact-head references, one positive runtime walkthrough, one negative/fail-closed walkthrough, per-surface validation, and an overall judgment for the entire PR.
Source Reads¶
Implementations may read compact public PR surfaces:
- pull request title, number, URL, branch, author, lifecycle state, merge time, and review decision;
- PR body summary;
- changed-file list and diff scale;
- status-check rollup;
- merge-state metadata;
- current-head commit timestamps and review metadata used to derive
review_ready_atand validate a standalone exact-head conclusion.
Raw review bodies are used only for the format/exact-head decision and are not
returned or persisted. A valid latest conclusion names the exact head, contains
all five Chinese sections plus a line-starting English verdict: APPROVE or
English verdict: REQUEST_CHANGES, and keeps that verdict aligned with formal
APPROVED/CHANGES_REQUESTED state. Because GitHub blocks every self-review
state transition, author-owned conclusions use COMMENTED plus one exact title:
Approval conclusion (author-owned PR; GitHub blocks formal self-approval) or
Request changes conclusion (author-owned PR; GitHub blocks formal self-review).
The saved-result check and published-review readback apply the same literal,
visible title rule. A near match, the opposite verdict's title, a hidden comment
or a fenced example cannot supply that conclusion. Independent reviews retain
their formal-state requirements. These checks establish publication consistency,
not evidence truth or merge authority.
提交前的结果检查与发布后的读回使用同一条可见的精确标题规则。近似标题、 相反结论的标题、隐藏注释或代码块示例均不能代替作者结论;独立评审仍遵循 原正式状态要求。这只校验发布一致性,不证明证据真实或授予合并权限。
The compact result is versioned as pull_request_review_conclusion_v0 and
reports a typed verdict and invalid-reason codes. Queue selection and approval
closeout share the typed owner for each reviewer's latest submitted opinion.
A brief approval by another reviewer cannot hide a complete exact-head approval.
A reviewer's newer formal opinion retires their own previous opinion, including
when it is dismissed or lacks the required body. Current-head requests for
changes remain visible even without that format, and ordinary comments or
pending reviews cannot restore a retired approval. A changed head still requires
fresh evidence. This corrects default queue/readiness classification; it neither
relaxes body qualification nor grants dismissal or merge authority.
队列与 closeout 复用同一 TypeScript 历史选择规则:另一评审者的简短批准不会 遮住完整的精确 head 批准;同一评审者的新正式意见会替换自己的旧意见,撤回或 格式不完整也不会复活旧批准。当前 head 的阻塞意见保留,普通评论及待提交评审 不改变已有正式意见,head 变化仍需新证据。本修复改变默认队列和 readiness 分类,不放宽正文校验,也不授予撤回评审或合并权限。
The default queue also avoids duplicating a submitted independent review. A
complete, paginated GitHub history can establish independent_review when a
non-author, non-bot account with OWNER, MEMBER, COLLABORATOR or CONTRIBUTOR
association submitted COMMENTED, APPROVED or CHANGES_REQUESTED on the current
head. These are formal review events, including inline-only reviews, not issue
comments. The typed history owner uses each reviewer's latest submitted event;
pending reviews do not erase prior activity, and dismissal retires that actor's
coverage. Missing actor/association metadata, incomplete reads or a new head
cannot establish coverage. The live provider rechecks head/base after history.
Covered rows remain in inventory with the reviewer, review URL/state and exact
head, a null action, null plan/template and no evidence commands. Read that
record once and continue the queue; the contributor need not write this agent's
bilingual format. This is work coverage, not a qualified approval or merge
permission. Existing dissent, strict approval-body qualification, closeout,
validation and merge-readiness gates remain. An explicit authorized
--fresh-audit-exact-head NUMBER@HEAD_OID can request new evidence despite
coverage. No reviewer-name whitelist, new configuration or automatic write is
introduced.
默认队列也跳过已有独立评审覆盖的重复全文审查:完整分页的 GitHub 记录证明,
当前提交已由非作者、非机器人且身份为 OWNER、MEMBER、COLLABORATOR 或
CONTRIBUTOR 的账号提交 COMMENTED、APPROVED 或 CHANGES_REQUESTED。这里指正式
review(包括只有行内意见的评审),不包括普通 issue 评论。复用同一 TypeScript
历史 owner,按每个评审者最近的已提交记录判断;待提交不会抹去旧记录,撤销只
撤回该账号的覆盖。身份未知、来源不完整或换头时不跳过,读取后还须核对 head/base。
载荷的 independent_review 给出评审者、原记录链接、状态和精确提交;该行仍在
inventory,但不生成可执行计划或证据命令。第三方无需使用本 agent 的双语格式。
跳过重复工作不授予批准或合并资格,不清除阻塞意见;原批准正文、closeout、验证
和 merge-readiness 门保留。明确要求重新取证时,沿原精确头 fresh-audit 入口执行。
不新增人名白名单、配置或自动外部写入。
After a published exact-head APPROVE is read back, the capability-owned
review_execution_contract.approval_closeout requires effective-review
reconciliation. This also works for an existing approval without a duplicate audit:
The read-only command paginates GitHub review history and uses the latest submitted
opinion per reviewer; a comment/pending review does not erase a blocker, and a
dismissed review does not resurrect older history. Its typed TS read model reports
clear, verification_required, or hold; these are not merge decisions.
Review age or a different commit only identifies a finding to inspect, never proof
of resolution. The host independently verifies every old finding and inline comment,
checks owner authorization and GitHub/branch dismissal permissions, rechecks the
head/approval/target immediately before GitHub's native dismissal, and reads back
DISMISSED, retained approval, unchanged head, and any remaining blockers.
Unresolved/unverified reviews stay intact; a failed closeout does not revoke an
earned approval. The command never dismisses, deletes, fetches CI, or merges, and
raw review bodies remain transient. No new setting, UI, or automatic GitHub authority
is introduced; normal review/merge policy is unchanged except this post-approval step.
pull_request_merge_readiness_v0 is a separate, read-only last-mile gate. It
re-reads the named PR instead of trusting a saved review packet. In particular,
GitHub may retain or reassociate an approval after an update-from-base commit;
the gate still requires the public review body to name the observed exact head.
For check-runs with a reliable workflow/job identity and start time, it evaluates
only the latest attempt and reports raw and superseded counts; ambiguous rows are
retained so the gate fails closed. It also rejects missing, pending, failed, or
unknown effective checks and incomplete or unresolved review threads. A branch
update is not required merely because GitHub reports BEHIND: the gate also
reads GitHub's independent mergeable result and permits a conflict-free
MERGEABLE head when every other check passes. CONFLICTING or DIRTY still
requires repair; BEHIND with missing or unknown mergeability remains unverified.
Branch protection may still require a separately authorized admin bypass. An
explicit maintainer admin bypass may override a ready=false readiness or
GitHub policy hold, including GitHub's author-owned self-review limitation. It
does not make missing exact-head review, required validation, unresolved review
threads or findings, a changed head, or an unmergeable conflict optional, and
it never supplies merge authority by itself.
The admin_bypass_overrides_this_gate authority field describes whether every
blocker on this exact observation is in that override scope; it is false when
non-bypassable review, thread, head, or mergeability evidence is missing.
pull_request_merge_readiness_observation_v0 is the Goal-scoped scheduling
receipt for that gate. It persists only the exact-head material fingerprint and
compact public-safe readiness result under the local Goal runtime. It excludes
review bodies, raw logs, credentials, private payloads, and local paths. Queue
construction consumes the observation only when every readiness input still
matches; a changed head, base, review conclusion, CI policy/result, review
thread, draft flag, merge state, mergeability, or PR state fails open to a fresh
qualification.
Live queue details request headRefOid and baseRefOid together with the
computed merge fields, matching the versioned readiness read. An unversioned
GitHub detail request can return UNKNOWN despite a known exact-head merge
state, repeatedly reopening an unchanged observation. Head/base drift between
the list and detail reads makes the source incomplete; rerun discovery before
selecting work. A genuinely unknown state still requires fresh qualification,
and the immediately-before-merge gate remains mandatory.
完整队列的详情请求同时读取 head/base OID 和合并状态;缺少版本的 GitHub
详情读取可能返回 UNKNOWN,误使已核验项目反复排入队首。列表与详情之间的
版本漂移会使来源不完整,须重新发现后再选择工作。真实未知状态仍需核验,
合并前的精确版本检查和独立授权要求保持。
They must not include raw logs, private connector payloads, credentials, local absolute paths, private source bodies, or hidden CI artifacts.
Response Shape¶
loopx_pr_review_command_response_v0:
{
"schema_version": "loopx_pr_review_command_response_v0",
"request": {
"schema_version": "loopx_pr_review_command_request_v0",
"command": "/loopx-pr-review",
"cli_command": "loopx pr-review [--repo owner/repo] [--state open|merged|all] [--review-priority other-developers-first|owner-first] [--since ISO]",
"repository": "owner/repo",
"limit": 100,
"state_filter": "all",
"since": "2026-06-28T00:00:00Z",
"review_priority": "other-developers-first",
"window": {"state_filter": "all", "since": "2026-06-28T00:00:00Z"},
"source": "github_cli",
"privacy_mode": "public_safe_github_metadata",
"dry_run": true
},
"result_completeness": {
"schema_version": "pr_review_result_completeness_v0",
"complete": true,
"truncated": false,
"limit": 100,
"source_scan_complete": true,
"recommended_limit": null,
"rerun_cli_args": []
},
"scheduling_policy": {
"schema_version": "pull_request_review_scheduling_policy_v1",
"identity_basis": "request.reviewer_login",
"review_priority": "other-developers-first",
"owner_first_active": false,
"other_developers_first_active": true,
"community_backlog_age_hours": 24.0,
"ordered_tiers": [
{"tier": 0, "id": "other_developer_feedback_and_aged_backlog"},
{"tier": 1, "id": "other_developer_remaining"},
{"tier": 2, "id": "authenticated_developer_owned"}
]
},
"summary": {
"headline": "8 PR(s) in review window: 3 open, 5 merged; 8 need review attention.",
"total_pr_count": 8,
"open_pr_count": 3,
"merged_pr_count": 5,
"review_attention_count": 8,
"post_merge_review_count": 5,
"draft_count": 0,
"recommended_first_pr": {
"rank": 1,
"number": 773,
"review_depth": "docs_and_smoke_review"
}
},
"review_sequence": [
{
"rank": 1,
"number": 773,
"title": "docs: add newcomer command path",
"url": "https://github.com/owner/repo/pull/773",
"state": "OPEN",
"review_depth": "docs_and_smoke_review",
"risk_hint_level": "low",
"main_risk_level": "low",
"scheduling_lane": "authenticated_developer_owned",
"scheduling_tier": 0,
"why_now": "Open and awaiting reviewer decision."
}
],
"review_groups": {
"unmerged": {
"schema_version": "pr_review_group_v0",
"group_id": "unmerged",
"title": "Unmerged PRs",
"intent": "Review before merge: decide approve, request changes, defer, or wait for checks.",
"count": 3,
"pr_numbers": [773, 775, 771],
"review_sequence": []
},
"merged": {
"schema_version": "pr_review_group_v0",
"group_id": "merged",
"title": "Merged PRs",
"intent": "Post-merge audit: check outcome, regression risk, and follow-up quality without blocking already-merged work.",
"count": 5,
"pr_numbers": [770],
"review_sequence": []
}
},
"pull_requests": [
{
"number": 773,
"head_oid": "0123456789abcdef0123456789abcdef01234567",
"review_template": {
"schema_version": "pr_review_five_block_template_v0",
"purpose": "Empty scaffold only; agentloop fills it after reading PR body and diff.",
"sections": [
{
"label": "动机",
"word_hint": "按证据需要;无最低字数",
"content": "",
"agent_instruction": "解释旧行为、具体痛点、受影响的用户或调用方、目标结果与必要性;说明不合并会继续付出什么代价,以及需求来自活跃调用方还是未来设想。"
},
{
"label": "改动思路",
"word_hint": "按证据需要;无最低字数",
"content": "",
"agent_instruction": "解释所选架构、改动前后的控制流或数据流、所有权边界、关键不变量和替代方案取舍;为不熟悉子系统的读者给出一条正向运行链路。"
},
{
"label": "具体改动",
"word_hint": "按证据需要;无最低字数",
"content": "",
"agent_instruction": "把关键文件和符号映射到行为,覆盖接口、配置或状态、兼容路径、测试与文档;说明各部分如何协作,并给出一个具体输入到输出的例子。"
},
{
"label": "对主干的风险",
"word_hint": "按证据需要;无最低字数",
"content": "",
"agent_instruction": "按严重度列出有文件或符号证据的发现,评估爆炸半径、兼容性、权限、默认副作用、失败与回滚、可观测性和缺失覆盖;策略或生命周期改动必须解释一条负向链路。"
},
{
"label": "我的整体评价",
"word_hint": "按证据需要;无最低字数",
"content": "",
"agent_instruction": "权衡价值与复杂度,列出实际检查或运行的验证,注明审阅的 head SHA,并给出精确结论;若阻塞,说明最小修复和复审所需证据。"
}
],
"review_order": ["docs/guides/newcomer-command-path.md", "docs/README.md"],
"output_hint": "Write for a reader unfamiliar with the PR: explain context, architecture, implementation, validation, necessity, and risk with concrete evidence. Follow each section's range as a depth signal, not filler."
},
"motivation": "Adds a newcomer command path...",
"scale": {"changed_files": 3, "additions": 90, "deletions": 4},
"areas": {"public_docs": 3},
"checks": {"summary": "2 successful check(s)."},
"metadata_risk_hint": {
"schema_version": "pr_metadata_risk_hint_v0",
"level": "low",
"basis": ["areas=公开文档 3", "scale=3 files +90/-4", "checks=2 pass"],
"disclaimer": "Metadata-only hint for queue ordering; agentloop must read the PR diff before judging main risk."
},
"main_regression_analysis": {
"schema_version": "main_regression_analysis_v0",
"risk_level": "low",
"risk_summary": "低 main regression risk across 公开文档 3; 3 file(s), +90/-4; checks=2 pass.",
"potential_regressions": [
"Runtime regression risk is low, but public guidance or smoke expectations can drift from shipped behavior."
],
"bug_risks": [
"Docs-only or smoke-only changes can bless stale contracts if examples no longer match the real command path."
],
"verification_focus": [
"Run `git diff --check` and the touched smoke; compare command examples with current CLI help when syntax is involved."
],
"post_merge_review": false
},
"risk_notes": [],
"evidence_commands": [
"gh pr view 773 --json title,body,files,commits,headRefOid,updatedAt",
"gh pr diff 773 --name-only",
"gh pr diff 773 --patch",
"gh pr view 773 --json headRefOid,updatedAt"
]
}
],
"agent_response_contract": {
"schema_version": "pr_review_agent_response_contract_v0",
"table_only_response_allowed": false,
"slash_prefix_dominates_intent": true,
"stats_only_requires_explicit_opt_out": true,
"queue_table_role": "preface_only",
"required_packet_fields_to_preserve": [
"agent_response_contract",
"agent_response_contract.review_execution_contract",
"result_completeness",
"review_groups",
"pull_requests[review_action_kind!=null].review_plan",
"pull_requests[review_action_kind!=null].review_template",
"pull_requests[review_action_kind!=null].evidence_commands"
],
"required_final_sections": [
"动机",
"改动思路",
"具体改动",
"对主干的风险",
"我的整体评价"
],
"explanation_depth_contract": {
"schema_version": "pr_review_explanation_depth_v0",
"reader_profile": "A technically curious reader who may not know this PR or subsystem.",
"evidence_layers": ["problem", "architecture", "implementation", "validation"],
"freshness": "Record and recheck the remote head SHA before the verdict."
}
},
"boundary": {
"raw_logs_recorded": false,
"credential_values_recorded": false,
"absolute_paths_recorded": false
}
}
Review Flow¶
Follow review_execution_contract.decision_procedure before writing the review:
challenge whether the design should ship, falsify its strongest material claim,
inspect the whole implementation, then reconcile the verdict. The goal is justified
acceptance, not more rejections. Read the target repository's architecture rules;
do not export LoopX-specific kernel/provider or TypeScript placement to other repos.
Before those evidence steps, apply
pr_review_selection_execution_contract_v0. A generic re-review,
重新review, or 复审 request selects and orders the named PR but does not force
a duplicate audit. When review_action_kind is null, perform only a compact
exact-head conclusion readback. A fresh audit despite a null action requires an
explicit request or concrete new concern/evidence invalidation encoded as
--fresh-audit-exact-head NUMBER@HEAD_OID; the regenerated actionable row must
still satisfy the complete execution contract.
A re-review has two scopes: the latest corrective diff and the complete base-to-head PR. Reuse observations only after checking their revisions and assumptions against changed callers, platforms, dependencies and promises. Prior approval is not reusable evidence. In particular, replacing an OS test with a deterministic mock must not erase the real lifecycle invariant the test was meant to prove.
After filling the existing result template, run:
This opt-in local check performs no network reads, GitHub writes, state changes or
merge operations. It rebuilds requirements from the installed capability, matches
the saved exact head, and rejects an APPROVE inconsistent with required evidence or
blocking findings. A successful check is not proof of factual evidence, review
quality, current remote head, or merge permission. Re-read the head and publish the
human-readable evidence separately. Existing queue/monitor behavior is unchanged;
omit these two flags to use normal queue discovery. An older saved packet may need
fresh review evidence when the installed contract has advanced. The execution
contract now carries policy_revision, distinct from its stable wire schema;
results bind review_policy_revision. Missing or mismatched policy revisions
cannot certify approval. Regenerate the packet and perform the current plan,
not merely relabel old evidence. The skill rejects approval from incompatible
packets produced by expired development-runtime overrides. It may still publish
a conservative REQUEST_CHANGES only when that verdict explicitly identifies
the incompatible-policy evidence gap; a later approval requires regeneration.
For retained or parallel implementations, repository_reuse.rule_ownership
maps business rules across both reachable paths, including unchanged files.
Keeping a legacy storage writer does not justify keeping its independent
eligibility, retention, ordering or successor rules. Name actual retired rules
and justified compatibility/effect code, not a net-deletion quota. A positive
twin with shared decisions and necessary extra adapter code must remain
approvable. Verified evidence rows must fill their declared fields and structured
shapes. symbol_map.items obeys the declared count and item fields;
walkthroughs.positive plus any applicable walkthroughs.negative fill their
declared fields; validation_matrix.items[].case_id proves coverage of the
packet's typed required cases. The checker validates this completeness only,
never the truth of their contents.
Behavioral qualification lives in tests/capabilities/test_pr_review_behavior.py:
paired synthetic cases include valid designs as well as counterexamples. The optional
live no-tools test uses the existing Doubao transport with a runtime-injected key:
The default model is doubao-seed-evolving; LOOPX_MODEL_BEHAVIOR_MODEL can
explicitly select another allowlisted model for comparative qualification.
It sends only public synthetic cases, never repository contents or credentials in the prompt. Ordinary tests never contact the provider. These bounded decision tests do not establish model-wide reliability or replace a real repository review.
The packet should let a reviewer move through PRs in order:
- Start from
review_groups.unmergedfor PRs that can still affect merge decisions. - Then use
review_groups.mergedfor post-merge audit and follow-up quality. - For a non-null action, use
evidence_commands, key files, changed-file scale, and checks to open the actual PR body and diff. For a null action, stop after compact exact-head conclusion readback. - Execute the actionable PR's
review_planagainstagent_response_contract.review_execution_contract; keep unavailable evidence explicitly unverified. - Read
main_regression_analysisbefore filling risk prose. It is the CLI's concrete, generated view of potential main regressions, bug risks, and focused validation. - Render the verified structured result through the blank five-block template:
动机,改动思路,具体改动,对主干的风险,我的整体评价. Use each section's range as a depth signal for a reader unfamiliar with the subsystem, not as filler. - Treat
metadata_risk_hintonly as queue-ordering metadata. It must not be copied as the final risk judgement. - Recheck the exact head, then decide
approve,request changes,defer, ormerge after checks. Immediately before merge, runloopx pr-review --check-merge-readiness NUMBER@HEAD_OIDand record its result. Add--goal-id GOALonly for already Goal-managed work; standalone delivery requires no registration or binding.ready=truepermits the normal path. Explicit maintainer authorization may use admin bypass to override aready=falsereadiness or GitHub policy hold, but never missing exact-head review, required validation, unresolved findings or threads, a changed head, an unmergeable conflict, or absent merge authority.
A response that only lists Open and Merged PRs, scale, and recommended next
order is incomplete for /loopx-pr-review; it should continue into the
per-PR five-block review cards after reading evidence.
Similarly, a response that says it ran loopx pr-review but used a command like
loopx --format json pr-review ... | jq '.summary, .review_sequence' is still
incomplete: the tool call happened, but the contract/template fields were
discarded before the agent planned its answer.
Acceptance Checks¶
A first implementation is acceptable when:
loopx slash-commandsexposes/loopx-pr-review;loopx pr-reviewreturnsloopx_pr_review_command_response_v0;- default live reads use the caller's current
ghrepository, while--repo owner/repocan review another GitHub project; - omitted
--stateand explicit--state openkeep the ordinary queue open-only;--state allincludes merged PRs in the same packet, applies--limitper lifecycle group, and keepsreview_groups.mergednon-empty when merged PRs exist in the requested window; pull_requestsremains the full bounded inventory while everyreview_sequencecontains only rows with a non-nullreview_action_kind; valid concluded exact heads are never recommended for duplicate work and carry null plan/template plus empty evidence commands;--fresh-audit-exact-head NUMBER@HEAD_OIDis the only packet-level way to turn an unchanged valid conclusion into an actionable fresh audit, and malformed, absent, or already-actionable targets fail closed;--check-merge-readiness NUMBER@HEAD_OIDworks without a Goal or Goal writes and rejects head drift, stale review prose, non-approval conclusions, red/pending/unknown checks, incomplete or unresolved review-thread evidence, and incompatible merge state; adding--goal-id GOALretains Goal policy and records the compact observation used to suppress only unchanged requalification;- the default limit is 100, and exhaustive requests only proceed when
result_completeness.complete=true; truncated packets provide a largerrecommended_limitfor the next read; --sincecan bound an overnight or release-window review without relying on private chat memory;- the response includes review sequence, changed-file scope, status checks,
key files, risk notes, metadata-only risk hints, concrete
main_regression_analysis, evidence commands, explicitreview_groups.unmerged/review_groups.merged, and a blank five-block review template; - the shared
pull_request_review_execution_contract_v2owns typed evidence, completion, freshness, findings-first, and verdict policy, while every actionable PR has a compact exact-headpull_request_review_plan_v1with an unverified result skeleton; - the packet includes
agent_response_contract.table_only_response_allowed=falseandagent_response_contract.required_packet_fields_to_preserveso slash-command agents know a table-only chat answer is incomplete; - the slash-command catalog marks
/loopx-pr-reviewasmust_run_cli_firstandslash_prefix_dominates_intent, and says manualghcalls are only per-PR deep-read commands after the CLI packet selects a PR; - each actionable PR includes
review_template.sectionsfor动机,改动思路,具体改动,对主干的风险, and我的整体评价; inventory-only rows do not; - each review template section carries a section-specific depth range, and the packet's explanation-depth contract requires problem, architecture, implementation, validation, necessity, and risk evidence instead of a generic long answer;
- live packets expose and recheck
headRefOidso a review verdict is bound to the remote revision actually inspected; - autonomous packets honor
request.review_orderand saved Agent overrides; reverse inverts the complete actionable queue before limiting, while inactive inventory and handled/projected exact-head acknowledgments stay non-executable; scheduling_policyis preserved as packet authority; Todo/monitor prose and one-off author filters cannot replace it;--observation-state-fileatomically carries observation and handled cursors across Codex tasks without returning a local path or granting external writes;- template sections must leave
contentempty so agentloop reads the real PR before writing the review; metadata_risk_hintmust be repository-generic and must not special-case LoopX files or domains;main_regression_analysismust be repository-generic, must includepotential_regressions,bug_risks, andverification_focus, and must not be replaced by a blank template;- live GitHub reads and fixture-based smokes share the same schema;
- no raw logs, private payloads, credentials, local paths, or private source bodies are recorded.
Configure CI waiting / 配置是否等待 CI¶
pull_request_review.wait_for_ci defaults to true. Machine defaults use the
existing capability editor. A Goal may override the complete review namespace;
clearing that override restores live machine defaults. Local required validation
and exact-head review/thread gates apply in both modes. CI completion, success
and exhaustive failure attribution are not approval prerequisites. Unknown,
failed, skipped, cancelled or pending remote jobs remain diagnostic rows with
required=false when independent current evidence establishes the affected
invariants. Preserve an unknown cause as unresolved; do not invent baseline or
infrastructure attribution, demand CI logs solely to approve, or require the PR
to repair unrelated jobs. A confirmed pr_regression blocks approval even if
its row is marked diagnostic. Missing necessary review evidence and material
instability remain blockers: name the current invariant and smallest decisive
check instead of using “CI evidence unknown” as the finding.
Claim that failed required review validation is unrelated only with the same failure reproduced on the immutable base and exact head, or independent evidence of an external outage, and separate passing coverage of the changed invariant. Record the red check and its owner; approval does not make a blocked merge ready. An unresolved required review validation still blocks approval. The matrix assesses the reviewed head. Keep relevant older failures in existing result/evidence text with their source and explain why current independent evidence covers the exposed invariant and conditions. An unknown historical cause alone is not a veto, nor does current passing evidence prove that cause was fixed. A selected green rerun cannot dismiss material intermittency or a missing negative case: record the current gap as failed/unverified and name the smallest discriminating check. An explicit accepted contract may still require causal attribution. No new result schema, review-dismissal authority or merge exception is introduced.
CI completion is a separate merge decision. With wait_for_ci=true, observe
available CI and retain the configured merge gate, but do not require every
remote job to finish or succeed before approving independently verified code.
repository_required_checks records decisive repository validation for the
review; each matrix row's required flag means review evidence, not GitHub
branch protection. Record remote CI observations as diagnostic rows with
required=false when current independent coverage establishes their relevant
invariants. If a queued job is the only decisive coverage, leave that invariant
required and unverified. Pending CI alone never justifies REQUEST_CHANGES;
missing relevant evidence, current regressions and material instability still
do. An earned approval may coexist with ready=false, and changing the CI
waiting configuration requires the existing owner's authorization.
Disabling CI waiting also removes CI requests and waiting instructions; legacy supplied summaries are diagnostic only. It grants no publication, merge, or admin-bypass authority.
loopx configure-goal --goal-id GOAL --no-pr-review-wait-for-ci --execute
loopx configure-goal --goal-id GOAL
loopx pr-review --goal-id GOAL --state all --format json
loopx pr-review --goal-id GOAL --check-merge-readiness NUMBER@HEAD_OID --format json
loopx configure-goal --goal-id GOAL --clear-pr-review-configuration --execute
The Dashboard capability editor exposes Wait for CI in machine and Goal scopes. Save a Goal override to affect only that Goal; use inherit/reset to restore machine defaults. The CLI packet echoes the resolved configuration. A Goal namespace is atomic (including review priority); partial updates retain its existing values, and a new namespace uses capability defaults.
wait_for_ci 默认开启,保留既有 CI 验证行为。Dashboard 的机器/目标 capability
编辑器提供“等待 CI”开关。以上命令只关闭指定 Goal 的等待,读取配置和评审载荷
可确认生效;清除完整目标覆盖后恢复机器默认。目标覆盖是完整 namespace(包括
审阅优先级),部分修改保留既有目标值,新覆盖使用 capability 默认值。关闭时不
查询、轮询或等待 CI;本地必需验证、当前提交评审、评论及权限检查仍然适用。
GitHub BLOCKED 只提示另需管理员授权,不授予合并权限。
Repository experience for opted-in review Agents¶
The existing Reward Memory experiment can deliver Git-versioned procedural
advice in actionable review packets. Enable the registered Agent, automatic
recall and the explicit pull_request_review.review surface in its existing
configuration. See operation, readback and disable.
The #5944 comparison is the first stored
case. Historical verdicts are outside retrieval; packet delivery proves neither
adoption nor utility. Base/off paths, queue selection and review authority retain
their existing contracts; the native file reader writes no provider.
已开启的 review Agent 可通过现有 Reward Memory 实验,在可执行 review packet 中
收到 Git 版本化的过程经验。须启用已注册 Agent、自动 recall,并在原配置中明确指定
pull_request_review.review surface,参见操作、回读与关闭。
#5944 判断对照是第一条案例。
历史 verdict 不进入检索,packet 投递不证明采用或效用。关闭路径、选工和评审权限
仍遵循现有合同;内置文件 reader 不写 provider。