Skip to content

Standardize human-attention labels and agent attribution - #732

Merged
justin808 merged 33 commits into
mainfrom
jg-codex/issue-731-human-attention-labels
Sep 13, 2026
Merged

justin808 merged 33 commits into
mainfrom
jg-codex/issue-731-human-attention-labels

Conversation

@justin808

@justin808 justin808 commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Why

GitHub is the canonical human-attention surface for Agent Workflows, but maintainers need portable walkthrough and merge states plus reliable agent attribution when an agent and human share one GitHub account.

Issue: #731

What changed

  • Added portable human-attention:walkthrough and human-attention:merge defaults with consumer policy overrides, exact-head fail-closed transitions, and a configured cross-repository desk.
  • Added one attribution envelope for top-level comments and inline review replies. Codex, Claude, and Cursor comments carry a visible agent prefix plus hidden runner, host, and task/run metadata.
  • Routed address-review, stale-assignment, verify-fix, and completed-batch audit comment paths through the attribution boundary.
  • Excluded current and shipped legacy agent comment formats from human approval, waiver, and merge-authority evidence.
  • Documented ownership transitions, asynchronous walkthrough behavior, degraded desk output, and consumer rollout.
  • Recovered the stale draft onto current main, re-triaged every review wave, and fixed the current-head validation failures.

Scope and deferrals

This is a 49-file, cross-cutting contract migration. The label state, attribution envelope, review fetch and post paths, autonomous merge evidence, audit receipt, copied workflow documentation, and compatibility tests need to change together so producers and consumers agree about comment authority and human-attention state.

How to review and verify

Start with .agents/agent-workflow.yml, skills/pr-batch/lib/human_attention.rb, and skills/pr-batch/lib/github_comment_envelope.rb. Then trace the address-review and closeout callers to confirm they use the shared boundaries. The regression suites cover exact-head label transitions, process cleanup, malformed policy, CRLF and legacy comments, and prevention of agent comments being accepted as human authority.

Test plan

  • Hosted full bin/validate passed at 6a8a3c2eeed166e73b609721394cc4e5126c803c (run 34748760849).
  • Hosted Lint passed; Claude Review attempt 2 passed after GitHub recovered from a 503 during the first token exchange.
  • ruby skills/pr-batch/bin/human-attention-test.rb: 38 runs, 238 assertions.
  • ruby skills/pr-batch/bin/human-attention-contract-test.rb: 9 runs, 118 assertions.
  • ruby skills/pr-batch/bin/github-comment-envelope-test.rb: 22 runs, 91 assertions.
  • ruby skills/pr-batch/bin/integration-closeout-contract-test.rb: 19 runs, 749 assertions, 1 intentional skip.
  • Relevant RuboCop checks and git diff --check passed.
  • Independent Sol medium exact-head review found no actionable issues.
  • Trusted review fetch found zero excluded interactions and zero unresolved threads. Security preflight found no untrusted participants or suspicious actionable content; GitHub did not expose the 359-item timeline node set through that endpoint.
Agent details
  • Runner: Codex
  • Host: Codex desktop
  • Task/run: 01a08d88-d2e1-7761-bfa0-ba0d15d28490
  • Batch: aw-sept7-closeout-01a08d88
  • Reviewed base: 44c9292926bc670b663825e0614384c989751d05
  • Reviewed head: 6a8a3c2eeed166e73b609721394cc4e5126c803c

Summary by CodeRabbit

  • New Features

    • Added a Human Attention desk and transition commands for managing PRs needing walkthroughs or merge review.
    • Added consistent attribution to automated GitHub comments, including runner and task context.
    • Added safeguards to distinguish agent-authored comments from human decisions.
    • Added support for fetching issue comments independently from review data.
  • Documentation

    • Updated review, closeout, and verification workflows to use attributed comment posting and Human Attention labels.
  • Bug Fixes

    • Improved handling of comment bodies and source checkpoints with attributed or legacy formats.

Note

High Risk
Changes how human merge/waiver/audit authority is inferred on GitHub and how PR attention labels are mutated, which are security- and workflow-critical paths.

Overview
Introduces a portable human-attention contract and a shared GitHub comment attribution boundary so towers and skills no longer apply raw queue labels or post comments directly.

Human attention. .agents/agent-workflow.yml gains human_attention defaults (walkthrough / merge labels plus configured repos). The new human-attention helper exposes desk (cross-repo queue) and transition (semantic walkthrough → merge → none with exact-head checks, fail-closed cleanup on conflicts, timeouts, and closed PRs). Seam doctor validates the policy; control-tower and closeout docs route through ${PR_BATCH_SKILL_DIR}/bin/human-attention transition instead of literal label names.

Agent attribution. New github-comment-envelope CLI/library wraps issue comments, edits, and review replies with a visible 🤖 Codex|Claude|Cursor line and a hidden agent-comment-attribution:v1 marker (AGENT_COMMENT_RUNNER, host, task/run). Address-review, stale-assignment sweep, manual-testing, verify-fix, and completed-batch audit receipts post through this path; review fetch adds payload_body and --issue-comments-only so workflow markers still work inside envelopes.

Trust / merge authority. Autonomous merge, hosted QA waivers, completed-batch publication preflight, and accepted-deferral logic treat agent-enveloped or prefixed comments as non-human so shared accounts cannot spoof maintainer decisions. cursor is added to trusted GitHub actors; mutating stale-assignment --apply now requires the same attribution env vars.

Extensive contract and regression tests are wired into bin/validate.

Reviewed by Cursor Bugbot for commit bc18c65. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The change adds a shared GitHub comment-attribution envelope, integrates envelope-aware address-review fetching and posting, adds Human Attention desk and transition commands, and updates comment producers, workflows, trust manifests, and validation tests.

Changes

Comment attribution and human attention

Layer / File(s) Summary
Comment envelope boundary
skills/pr-batch/lib/github_comment_envelope.rb, skills/pr-batch/bin/github-comment-envelope, skills/pr-batch/lib/autonomous_merge_decision.rb
Agent comments now use validated Codex or Claude envelopes. Autonomous merge decisions ignore agent-authored comments.
Human-attention queue operations
skills/pr-batch/lib/human_attention.rb, skills/pr-batch/bin/human-attention, workflows/pr-batch-integration-closeout.md, workflows/pr-processing.md
The new commands resolve attention labels, render a pull-request desk, and perform verified label transitions.
Address-review comment data flow
skills/address-review/..., workflows/address-review.md
Review data exposes payload_body, issue-comment-only fetching avoids unrelated endpoints, and posting uses the shared envelope helper.
Shared comment producers and validation
skills/post-merge-audit/..., skills/pr-batch/bin/stale-assignment-sweep, skills/verify-pr-fix/SKILL.md, bin/validate
Additional comment producers use envelope attribution. Tests, runtime manifests, documentation, and validation cover the new boundary.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: 🟡 Moderate · up to bb2c0

Operational workflows can lose required audit records, misroute comments, incorrectly advance source-review handling, or hide unaffected human-attention queue entries. These should be corrected before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 61 functions across 15 files. (16 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the two primary changes: human-attention labels and agent attribution.
Description check ✅ Passed The description includes the required Why, What changed, How to review and verify, and Test plan sections. It records scope, deferrals, test commands, results, and agent details. All checklist items a…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 61 functions across 15 files. (16 skipped: 16 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg-codex/issue-731-human-attention-labels

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread skills/pr-batch/bin/github-comment-envelope-test.rb
Comment thread skills/pr-batch/bin/github-comment-envelope-test.rb Outdated
@claude

claude Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review

Reviewed the new GitHubCommentEnvelope attribution module, its CLI, and the AutonomousMergeDecision exclusion wiring.

Overall: the parser/renderer design is solid for a security-sensitive gate — it uses an exact-match strict format (not regex-on-untrusted-content), and the VALUE_PATTERN (\A[A-Za-z0-9][A-Za-z0-9._:/-]*\z) correctly blocks >, whitespace, and newlines in runner/host/task_or_run, which prevents an attacker-controlled value from breaking out of the HTML comment boundary or injecting fake runner:/host:/task_or_run: lines. The duplicate-marker guard (body.scan(...).length == 1) is a nice touch against marker-smuggling.

Main finding (see inline comment): test_autonomous_human_authority_explicitly_excludes_agent_envelopes in github-comment-envelope-test.rb only asserts that autonomous_merge_decision.rb's source text contains the literal string GitHubCommentEnvelope.agent_authored?(comment["body"]). It never actually builds an enveloped comment and runs it through AutonomousMergeDecision.select to confirm the exclusion happens. For a check explicitly called out in the PR description as a human-authority security gate, this is a weak proxy — it wouldn't catch a real regression in the exclusion logic (e.g., the check present but unreachable, or bypassed by another code path), only a rename/refactor of that exact call site. I'd suggest a behavioral test that constructs a GitHubCommentEnvelope.render(...)-produced comment and asserts AutonomousMergeDecision.select returns "status" => "none" (or otherwise excludes it) for it.

Minor: require "json" and require "tempfile" in the new test file are unused.

Design note (non-blocking, informational): agent_authored? relies on an exact string/format match (emoji, em dash, computed display name) with no fuzziness or version negotiation. Since the PR description says the actual comment-posting path integration is still in progress, it's worth keeping in mind that any drift between the future poster's output and GitHubCommentEnvelope.render's exact output (e.g. a different renderer, manual posting, whitespace differences) would silently fail to be classified as agent-authored and fall through as an ordinary candidate. Not an issue in this PR itself, just a sharp edge to watch when the posting path is wired up.

No security issues, performance concerns, or correctness bugs found in github_comment_envelope.rb, the github-comment-envelope CLI, or the autonomous_merge_decision.rb diff itself.

Comment thread skills/address-review/references/templates.md
Comment thread skills/post-merge-audit/bin/completed-batch-audit-receipt Outdated
Comment thread skills/pr-batch/lib/github_comment_envelope.rb Outdated
Comment thread skills/address-review/references/actions.md
Comment thread skills/pr-batch/lib/human_attention.rb Outdated
@claude

claude Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review

Reviewed the GitHubCommentEnvelope attribution boundary, the human-attention label/queue helper, and their wiring into address-review, stale-assignment-sweep, and completed-batch-audit-receipt.

Overall: solid design for a security-sensitive gate. GitHubCommentEnvelope.parse uses exact-match structural validation (not regex-on-untrusted-content), VALUE_PATTERN blocks >, whitespace, and newlines from breaking out of the HTML-comment boundary, and autonomous_merge_decision.rb correctly excludes any agent_authored? comment before treating it as a human decision — good defense-in-depth for the human-authority gate this PR is building toward. HumanAttention.transition also does a post-edit readback to confirm the PR didn't move and the labels actually reached the requested state before returning success, which is the right instinct for a labeling operation with real consequences.

Two issues found (posted inline):

  1. skills/address-review/references/actions.md:283 (and the equivalent spots in templates.md and workflows/address-review.md) — AGENT_COMMENT_RUNNER, AGENT_COMMENT_HOST, and AGENT_COMMENT_TASK_OR_RUN are required via bash :? at every github-comment-envelope post-issue/post-reply call site, but nothing in the repo assigns, exports, or documents them. Other call sites (stale-assignment-sweep, completed-batch-audit-receipt) use ENV.fetch(..., default). As written, following the address-review doc literally without independently setting these three vars aborts every comment post.

  2. skills/pr-batch/lib/human_attention.rb:98 — desk raises a hard Error for the whole multi-repo mirror if any PR anywhere in the configured set carries both human-attention labels, instead of marking just that repo degraded the way it does for gh failures and malformed JSON. One mislabeled PR in a 10-repo set would hide every legitimate pending human decision across all 10 repos.

No security issues found in github_comment_envelope.rb itself — the marker/prefix matching is strict enough that I couldn't find a way to forge an unattributed comment as agent-authored or vice versa.

Comment thread skills/pr-batch/lib/human_attention.rb Outdated
Comment thread skills/pr-batch/bin/stale-assignment-sweep Outdated
Comment thread skills/pr-batch/bin/stale-assignment-sweep
Comment thread skills/address-review/bin/fetch-pr-review-data
Comment thread skills/pr-batch/lib/autonomous_merge_decision.rb
Comment thread skills/address-review/SKILL.md Outdated
Comment thread workflows/address-review.md
Comment thread skills/pr-batch/lib/github_comment_envelope.rb Outdated
Comment thread skills/pr-batch/lib/human_attention.rb Outdated
Comment thread skills/pr-batch/lib/human_attention.rb Outdated
Comment thread skills/pr-batch/lib/github_comment_envelope.rb Outdated
Comment thread skills/pr-batch/bin/stale-assignment-sweep Outdated
Comment thread skills/post-merge-audit/bin/completed-batch-audit-receipt Outdated
Comment thread skills/pr-batch/lib/human_attention.rb Outdated
Comment thread skills/pr-batch/lib/github_comment_envelope.rb Outdated
Comment thread skills/address-review/SKILL.md Outdated
Comment thread skills/pr-batch/bin/stale-assignment-sweep
Comment thread skills/pr-batch/bin/single_target_entrypoint_test.rb Outdated
Comment thread skills/pr-batch/lib/human_attention.rb Outdated
Comment thread skills/post-merge-audit/bin/completed-batch-audit-receipt-test.rb Outdated
Comment thread skills/pr-batch/bin/stale-assignment-sweep
Comment thread skills/pr-batch/bin/github-comment-envelope Outdated
@claude

claude Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review summary

Reviewed this cross-cutting PR (human-attention labels + comment-attribution envelope, ~3k additions across 45 files). Posted 8 inline comments; overview below.

Correctness

  • HumanAttention.transition/clear_attention_state! have two unrescued JSON.parse calls (reconcile-after-failed-edit, and post-cleanup verification) that fall through to a generic error and skip attempted cleanup on malformed gh output — the one path that is wrapped (final verify) is unit-tested, these two aren't.
  • bin/agent-workflow-seam-doctor's new repository-uniqueness check silently no-ops when a non-string repo key is mixed in with case-duplicate string keys.

Robustness

  • transition's gh pr view/gh pr edit calls use bare Open3.capture3 with no timeout, even though this same file already has capture3_bounded (built for exactly this, and used by desk) — a hung gh call during a transition blocks indefinitely instead of failing fast.

Security-adjacent (fail-safe, not exploitable)

  • GitHubCommentEnvelope.agent_authored?'s legacy visible-prefix fallback (bare 🤖 Codex/🤖 Claude first line, no marker) means a human comment that happens to start with that exact line gets misclassified as agent-authored and its authority silently discarded. Denies rather than grants authority, so not a spoofing hole, but worth knowing given how many call sites key off it.

Scope / duplication (matches the "smallest change" framing from the PR description)

  • bin/agent-workflow-seam-doctor's new human_attention_policy_issues/validate_human_attention_labels reimplement the label/repository validation rules that already live in skills/pr-batch/lib/human_attention.rb (global_labels/labels_for/repositories/validate_labels), including a second copy of the OWNER/REPO regex, instead of requiring and calling into that module. This is the main "could this have been smaller" finding — the two rule sets can drift independently.
  • The agent_authored? guard is pasted at 4 call sites (autonomous_merge_decision.rb, completed-batch-audit-receipt, completed-batch-publication-preflight x2) rather than centralized.
  • The "read 3 AGENT_COMMENT_* env vars → GitHubCommentEnvelope.render → wrap as domain error" helper is duplicated between stale-assignment-sweep and completed-batch-audit-receipt.

Minor performance

  • github-comment-envelope's attachment path makes an extra gh api .../pulls/NUMBER round trip purely to pre-validate something the subsequent gh pr comment --attach call already enforces on failure.

Otherwise: the envelope round-tripping (CRLF handling, HTML-comment injection guard on host, marker parsing) is well-tested, and I didn't find regressions in the payload_body/body marker-detection migration across fetch-pr-review-data/fetch.md/review-wave.md, or in the ordering of the new agent_authored?/attribution-preflight guards relative to the GitHub mutations they gate.

Comment thread skills/pr-batch/lib/human_attention.rb Outdated
Comment thread skills/pr-batch/lib/human_attention.rb
Comment thread skills/pr-batch/lib/human_attention.rb
@claude

claude Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review summary

This is a large but well-scoped cross-cutting migration (label state machine + comment attribution boundary), and it's already been through many review-fix rounds — the core logic (label transition fail-closed/verify/cleanup, envelope render/parse, trust exclusion at every evidence call site) held up well under scrutiny and is backed by proportionate test coverage for a merge/human-authority-critical feature.

Two concrete issues found, posted inline:

  1. capture3_bounded/terminate_process_group in skills/pr-batch/lib/human_attention.rb reimplements bounded subprocess + process-group termination, but without the WNOHANG re-reap / liveness check that a sibling implementation (stale-assignment-sweep's capture_process_group/reap_after_timeout) needed to add after hitting real pid-recycling races (referenced as issues Process-group timeout: preserve reaped child status and avoid signalling a recycled pgid (follow-up to #218) #229/stale-assignment-sweep: two unresolved #224 findings on the timeout termination path #246 in that file's comments). The new code can send TERM/KILL to a process group id the OS has already recycled if the child exits right around the timeout. Given this exact bug class already bit this codebase once, porting the existing defensive implementation seems safer than maintaining a second, less-hardened one.

  2. render_desk interpolates the raw PR title into the generated Markdown heading with no escaping. Since PR titles are free text controlled by the PR author, a crafted title can inject Markdown structure (fake headings/links) into the human-attention desk document maintainers use to decide what needs a walkthrough or merge review.

Nothing else stood out as a genuine bug — attribution envelope construction/parsing correctly rejects newline/-->-injection in host, the exclusion-from-human-evidence checks (agent_authored?) are applied consistently and conservatively at every call site, and the label transition fail-closed/cleanup paths look correct including the idempotent no-op case.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 110bcb1a67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/pr-batch/bin/github-comment-envelope
Comment thread skills/pr-batch/lib/human_attention.rb Outdated
@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_f6148c32-3675-4cb9-ae5d-d44a83d15898)

Comment thread .agents/trusted-github-actors.yml
@claude

claude Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review summary

I reviewed this in depth (core new libraries by hand, plus two parallel deep-dives into the envelope rollout across address-review/post-merge-audit and into the docs/tests/scope surface). Overall this is a carefully engineered, well-tested change, and the "authority hardening" goal — excluding agent-enveloped/prefixed comments from counting as human approval or merge authority — is applied consistently and correctly everywhere it needs to be:

  • GitHubCommentEnvelope (skills/pr-batch/lib/github_comment_envelope.rb): the visible-header + hidden-HTML-comment-marker design is sound. Value patterns block --> injection into the marker, render/parse/payload round-trip correctly including CRLF and edge cases (empty body, malformed/short envelope), and double-wrapping is rejected. Test coverage specifically probes the injection and multiline-host cases.
  • HumanAttention (skills/pr-batch/lib/human_attention.rb): the label state machine is fail-closed throughout — exact-head checks before and after mutation, verification after edit, and clear_attention_state! cleanup on any failure/timeout/mismatch path (including bounded process-group termination for hung gh calls). This is unusually careful correctness work and the tests exercise the failure paths (timeouts, conflicting labels, case-insensitive duplicates, comma-in-label-name, etc.), not just the happy path.
  • agent_authored? exclusion is wired into every human-evidence extraction site I could find: autonomous_merge_decision.rb, completed-batch-audit-receipt (accepted-deferral), completed-batch-publication-preflight (supporting-artifact and waiver comments), and hosted-QA waiver parsing — each with a regression test proving an enveloped/prefixed agent comment can no longer grant approval/waiver authority.
  • The producer/consumer schema changes (e.g. fetch-pr-review-data's new payload_body, --issue-comments-only) are migrated in lockstep with their jq/doc consumers (e.g. the .user.login → .user jq fix in workflows/address-review.md, matching the flattened schema fetch-pr-review-data already emits) — I didn't find a producer/consumer mismatch.
  • Docs and CLI behavior are consistent: I couldn't find a doc referencing a flag, subcommand, or env var that doesn't actually exist in the code, and the human-attention-contract-test.rb / single_target_entrypoint_test.rb string-assertion tests (an existing repo pattern) give this a regression guard.
  • All gh invocations I checked (github-comment-envelope, stale-assignment-sweep, human_attention.rb) use argv-array exec (Open3), not shell interpolation, so comment bodies/attachment paths can't inject shell commands.

One scope finding (left as an inline comment): .agents/trusted-github-actors.yml adds cursor to trusted_bots. This is a real, independent widening of the actor-trust boundary consumed broadly across the trust surface (github_actor_trust.rb and its many consumers), has no test, and isn't connected to anything else in the diff or to the PR's stated Why. It looks genuinely separable and would benefit from its own PR and rationale rather than riding along in this migration.

I didn't find correctness bugs, injection issues, or gaps in the fail-closed behavior in the core logic. Given the PR's own justification for bundling 45 files (producer/consumer schema changes that must move together), that claim holds up for everything except the cursor trust addition noted above.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab6f36d8b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/pr-batch/lib/github_comment_envelope.rb
Comment thread skills/pr-batch/lib/human_attention.rb
Comment thread skills/pr-batch/bin/github-comment-envelope Outdated
@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5fe66147-88b6-4d9d-befb-efea13ee6014)

@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_f2e1d2a0-3264-4b01-9555-af4e6a3b3e70)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc18c6557a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/pr-batch/lib/github_comment_envelope.rb Outdated
@claude

claude Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review summary

This is a large (3.3k+ line), 45-file cross-cutting change, but the PR body's justification for not splitting it (label state, attribution envelope, review fetch/post, merge-authority evidence, and audit receipts all need to move together) is reasonable given the coupling between producers and consumers of the new contract. I verified the changes directly rather than only relying on described intent; findings below are all confirmed against the actual code, not speculative.

Correctness (posted inline):

  • human_attention.rb's transition clears (removes) a human-attention label it just successfully applied if the immediately-following verification gh pr view fails transiently — a network blip can silently strip the "needs human review" signal from a PR.
  • labels_for discards the return value of self.repositories(config), which re-validates the entire configured repositories list on every call. This means a single malformed/duplicate entry for one repo can break transition/desk for unrelated, correctly-configured repos, and inside desk's loop it's O(n²) re-validation for n repos.

Duplication introduced by this PR (posted inline) — worth consolidating given the review's simplicity bar:

  • bin/agent-workflow-seam-doctor reimplements HumanAttention's label/repository validation rules from scratch (no require_relative), rather than calling into the library it's supposed to be validating against — the two can silently drift.
  • The bounded-subprocess-with-timeout/process-group-kill helper is implemented independently in both skills/pr-batch/lib/human_attention.rb and skills/pr-batch/bin/github-comment-envelope in this same PR (in addition to the pre-existing git_probe_env.rb). The two new copies have already diverged: the bin script's version doesn't handle Errno::EPERM, unlike the lib version.
  • stale-assignment-sweep and completed-batch-audit-receipt each independently invented the same "render a throwaway body to trigger GitHubCommentEnvelope's env-var validation" workaround, because the library has no dedicated validate_attribution!-style entry point.

Lower-severity correctness note (posted inline):

  • GitHubCommentEnvelope.agent_authored?'s legacy-format fallback matches any body that merely starts with "🤖 Codex/Claude/Cursor", so a human comment that happens to begin that way (e.g. quoting an agent) would be silently excluded from merge-approval/waiver/deferral evidence. This fails closed (can't grant false authority) but can swallow genuine human sign-off.

Everything else I checked — the cursor trust-boundary addition, the --attach doc/implementation consistency (I initially suspected a mismatch here but confirmed the docs and implementation agree), the jq/body-shape changes in fetch-pr-review-data and its callers, and the extensive new test coverage — held up under direct verification.

@justin808

Copy link
Copy Markdown
Member Author

Approved this exact revision for merge after reviewing the listed risk and rollback plan.

  • Commit: 6a8a3c2eeed166e73b609721394cc4e5126c803c
  • Risk requiring approval: Architectural product judgment (architectural-product-judgment), Autonomous merge policy change (autonomous-merge-policy-change), Changed files limit (changed-files-limit), Changed lines limit (changed-lines-limit), Commit count limit (commit-count-limit), Public compatibility (public-compatibility), Security auth privacy (security-auth-privacy)
  • Rollback: Code rollback and forward recovery were reviewed.

Ordinary merge checks still apply.

Approval receipt
---
head_sha: 6a8a3c2eeed166e73b609721394cc4e5126c803c
triggered_gates:
  - architectural-product-judgment
  - autonomous-merge-policy-change
  - changed-files-limit
  - changed-lines-limit
  - commit-count-limit
  - public-compatibility
  - security-auth-privacy
rollback_disposition: Code rollback and forward recovery were reviewed.
decision: approve
approved_by: justin808
source: direct-user-task
evidence: direct-user-task:01a08d88-d2e1-7761-bfa0-ba0d15d28490
...

@justin808
justin808 merged commit 2104a4c into main Sep 13, 2026
6 of 7 checks passed
@justin808
justin808 deleted the jg-codex/issue-731-human-attention-labels branch September 13, 2026 09:30
@justin808 justin808 removed the agent-claimed Active agent coordination claim; reconciled from private backend label Sep 13, 2026
justin808 added a commit that referenced this pull request Sep 13, 2026
…naged-snapshot

* origin/main:
  Standardize human-attention labels and agent attribution (#732)
justin808 added a commit that referenced this pull request Sep 13, 2026
…libration-utf8

* origin/main:
  Standardize human-attention labels and agent attribution (#732)
justin808 added a commit that referenced this pull request Sep 13, 2026
…rser-phases-v2

* origin/main:
  Align coordination backend preset vocabulary (#843)
  Complete replicate-ci run-history recipe (#842)
  Standardize human-attention labels and agent attribution (#732)
justin808 added a commit that referenced this pull request Sep 13, 2026
…rrent-main-rebuild

* origin/main:
  Align coordination backend preset vocabulary (#843)
  Complete replicate-ci run-history recipe (#842)
  Standardize human-attention labels and agent attribution (#732)
  address-review: bind automation reviewers to exact check names (#836)
  Align coordination manifest target forms (#834)
  Extract seam-doctor shell safety helpers (#837)
  Keep current PR walkthroughs visible during closeout (#831)
  test: cover dispatch approval after refresh (#835)
  test: add scheduler headroom to batch status timeouts (#838)
  Add Cursor as a third Agent Workflows host (#832)
  Separate optional quality candidates from admitted maintenance (#827)
  fix: authenticate terminal configured-review exceptions (#825)
  Prevent temporary-pack hardlink races in stack fixture clones (#824)
  Enforce actor trust at the review-data ingestion boundary (#799)
justin808 added a commit that referenced this pull request Sep 14, 2026
…ust-role-shapes

* origin/main:
  Follow-up: calibration GitHub reader needs UTF-8 and surrogate gates (#700)
  Make maintainer decision requests understandable (#849)
  Align coordination backend preset vocabulary (#843)
  Complete replicate-ci run-history recipe (#842)
  Standardize human-attention labels and agent attribution (#732)

# Conflicts:
#	skills/pr-batch/bin/stale-assignment-sweep
justin808 added a commit that referenced this pull request Sep 14, 2026
…sk-titles

* origin/main:
  Follow-up: calibration GitHub reader needs UTF-8 and surrogate gates (#700)
  Make maintainer decision requests understandable (#849)
  Align coordination backend preset vocabulary (#843)
  Complete replicate-ci run-history recipe (#842)
  Standardize human-attention labels and agent attribution (#732)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coderabbit:ready Triggers CodeRabbit's automatic review when a draft pull request becomes ready. complexity:complexify Adds enduring logic, modes, contracts or operational obligations; value is judged separately. P1 High priority: verified material impact; schedule ahead of speculative improvements triage:reconcile Check superseded, duplicate or partly completed work; avoid another implementation lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant