Skip to content

docs(openspec): plan #3199 post pr check evidence comment - #3237

Merged
dan-petty merged 3 commits into
mainfrom
feat/3199-post-the-check-results-of-a
Nov 2, 2026
Merged

dan-petty merged 3 commits into
mainfrom
feat/3199-post-the-check-results-of-a

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Plans #3199

CONTRIBUTING.md requires check results and fail-to-pass evidence in a pull request comment, and forbids hand-typed counts. No command writes that comment, so agents typed numbers themselves. This change adds devops pr evidence <number>. It reads the check runs of the head commit from GitHub and posts one comment: the head commit, a table of checks with their conclusion and link, the fail-to-pass run link for a fix, and one line for each skipped check. A marker line lets it update its own comment on a new head, so a pull request never gets a second one. It takes no free text: every number comes from GitHub. --dry-run prints the planned requests, and --attribution adds an optional footer.

Change: openspec/changes/3199-post-the-check-results-of-a/

Copy link
Copy Markdown
Owner

Review of the plan for #3199.

CI: 18 checks, all green or skipped. Premise: the gap is real (no evidence command in src/devops_cli/commands/pr.py), but two parts of the design rest on code that does not exist or on a rule the plan breaks. The stage comment on #3199 lists one open model-review finding (group 1: no task says how the command decides "fix"), the plan still carries it (head sha = stage sha), and this PR is not a draft (#3264).

  1. Dry run breaks an existing requirement. openspec/specs/command-dry-run-class/spec.md:96-97 (pr-commands-request-plans): every pr command with the request-plan class makes "zero external requests during a dry run". tests/commands/test_pr_dry_run.py:53-60 replaces socket.socket with a refusal for each command of PR_COMMAND_CALLBACKS. The plan's dry run must read the check runs to print the comment text, and Feasibility says it "must print the comment". The issue's "as the other pr commands do" is false: no other pr dry run prints text built from a read. Fix: either print only the request plan (reads included) or change the rule, and then add a MODIFIED entry with the whole text of pr-commands-request-plans (the text names "seventeen" commands). [C2]
  2. Wrong capability. The ADDED requirements go to pull-request-form, whose Purpose (spec.md:4) is the title and body form, pr describe and the pr create check. Proposal says "New Capabilities: None". Fix: a new capability with a Purpose of 50+ characters (openspec/config.yaml:19). [C4]
  3. The attribution footer builder does not exist. design.md and tasks 1.2 say "reuse the attribution footer builder of pull_describe.py" and "agent attribution setting". In src/devops_cli/roadmap/pull_describe.py there is only the parameter attribution: Sequence[str] = () (line 139), a caller-given text; pr describe --attribution (pr.py:1149) is a free-text option. git grep -i "is_agent\|agent_mode\|CLAUDECODE" -- src finds no agent detection. Fix: say how the command knows an agent runs it, or drop the requirement. [C2]
  4. A second check-run reader. The plan says check runs are read "through run_gh, as fetch_pr_check_verdicts does". check_verdict.py:308-324 (_fetch_check_runs_from_rest) uses GitHubSession.paginate, and read_check_runs (line 374) and read_commit_checks (line 395) already return PRCheckItem(name, state, bucket, workflow, link) with the skip and replaced-cancel rules (line 225). Task 1.2 adds one run_gh GET with no pagination (30 per page) and a second skip rule. The docstring of read_check_runs says the Service holds an App token, so "the Service can import the builder" needs the session reader. Fix: build the text from PRCheckItem and reuse read_check_runs. [C3]
  5. Fix decision has no owner (the open stage finding). Task 1.2 builds the text "from the head SHA and the check runs", test 1.1 needs fix or feat, and no task reads the title (CONST_DEFECT_TITLE_PATTERN, constants.py:3877). The issue's rule "add the link only when the PR is a fix and the run exists" is not in the spec. Also .github/workflows/fail-to-pass.yml:3-9 says a skipped job still reports, and other skipped jobs of this PR show as check runs, so a feat PR that changes src/ probably has a skipped Fail-to-Pass Check run; a match by name alone would link it (inferred, not run). Fix: add the title input to the builder and one scenario for it. [C5]
  6. Marker design: pagination, spoof, scope. Task 2.2 reads "the issue comments" with no pagination, so a marker on page 2 gives a second POST, which the spec forbids. Anyone can write the marker line; the author match is rejected with a reason that does not hold, and the safe rule is marker plus the token's own author. No token permission for the write is named, and check names go into a markdown table with no escape of |. GitHubClient has create_issue_comment (client.py:444) but no list or PATCH method; say where they go. [C8]
  7. Registries and generated documents are missing. A new pr command needs an exposure choice in CONST_MCP_EXPOSURE_TABLE (constants.py:351-363) or an entry in both exclusion lists of tests/ai/mcp/test_mcp.py (("gh","pr",...) near line 491 and ("pr",...) near 562), or test_all_cli_commands_are_either_exposed_or_excluded fails; docs/MCP_TOOLS.md if exposed; PR_COMMAND_CALLBACKS in test_pr_dry_run.py; and the generated docs/CLI_REFERENCE.md and docs/commands/pr.md, which group 3 does not list. [C10]
  8. Help strings go to the wrong module. Task 2.2 puts them in lang/en/messages.py; command help lives in lang/en/help.py (HELP.pr.*, used at pr.py:1143). [C9]
  9. Task 3.2 repeats 3.1 and starts with bare file names ("CONTRIBUTING.md and README.md, run ..."). Delete it. [C5]
  10. Title and body. The title ends with ... (59 characters after the colon); title_problems refuses a summary that ends with ... (pull_form.py:129-131), and the folder slug ends -of-a. In the body "devops pr evidence " lost its <number>. The body is 827 characters with Plans #3199 and the Change: line (fine). [C7]
  11. Feasibility is partly future tense. The last bullet ("First checks ... must print", "which must list the new command") and "the module ... is to be created" are intent. It also says "read_file ... showed" while the stage comment says "The model made no tool call". The three cited facts are true (run_gh at rate_limiter.py:1862, the command list, the job name Fail-to-Pass Check). Add the output of the probes for findings 1, 3 and 4. [C2]
  12. Existing Tool Considered. The cost is there (60k tokens, 3 hours, copied from the issue). But "No open, maintained tool posts ..." is stated as fact, while the issue's refine block says "No alternatives check has run". Name the tool you checked. [C6]
  13. Dependencies. The proposal has no Dependencies. The issue's own question names feat(roadmap): a trace of every run, kept and shown in the PR comment and in explain #3032 (open; its plan is on main), and feat(pr): check-readiness warns when a pull request body passes 1,000 characters #2585 and fix(mcp): pr_check_readiness is read-only in the exposure table but can resolve threads #3235 touch the same PR checks and the MCP exposure of pr tools. Write them or "None" after a search. [C8]
  14. Design rationale. The first decision restates the issue; the nearest alternative (extend check_verdict.py / read_check_runs) is not named. Give one fact for why not. [C12]

Better than the earlier plans:

  • Verify form: every verify is uv run devops ci test <mirror path> with "fails on the base" in x.1 and "passes" in x.2, and the new tests are in the mirror folders.
  • ## Criteria maps all 7 criteria of the issue to a group; the spec requirements are short (84-192 characters) and the ADDED names are new.
  • Three Feasibility bullets quote real lines that are true, and the plan is not a placeholder.

Related issues: #3032 (trace in the PR comment), #2585 (check-readiness), #3235 (MCP exposure of pr tools), #3249 (staging_title cuts the title), #3264 (stage marks a plan ready despite its review finding), #3201 (plan-check command).

Verdict: hold until findings 1, 3 and 2 are settled (dry-run rule, footer source, capability) and findings 4 to 7 are in the tasks; 8 to 14 are small.


Generated by Claude Code

Plans #3199

CONTRIBUTING.md requires check results and fail-to-pass evidence in a pull request comment, and forbids hand-typed counts. No command writes that comment, so agents typed numbers themselves. This change adds `devops pr evidence <number>`. It reads the check runs of the head commit from GitHub and posts one comment: the head commit, a table of checks with their conclusion and link, the fail-to-pass run link for a fix, and one line for each skipped check. A marker line lets it update its own comment on a new head, so a pull request never gets a second one. It takes no free text: every number comes from GitHub. `--dry-run` prints the planned requests, and `--attribution` adds an optional footer.

Change: `openspec/changes/3199-post-the-check-results-of-a/`
@dan-petty dan-petty changed the title docs(openspec): plan #3199 post the check results of a pull request as a... docs(openspec): plan #3199 post pr check evidence comment Nov 2, 2026
@dan-petty

Copy link
Copy Markdown
Owner

Remediated the plan for #3199 to address all 14 review findings:

  1. Dry-run contract: Adheres to the request-plan dry-run class with zero external requests in dry run. Updates pr-commands-request-plans in command-dry-run-class to include pr evidence as the eighteenth command, keeping all 12 existing scenarios plus a new scenario.
  2. Capability: Replaced pull-request-form with a new capability pull-request-evidence (Purpose: "Formats and posts pull request check runs and fail-to-pass test results as a sticky pull request comment.").
  3. Attribution footer: Replaced automatic agent detection with an optional --attribution flag (matching devops pr describe --attribution).
  4. Check-run reader: Specified reusing read_check_runs from src/devops_cli/github/check_verdict.py and its normalized PRCheckItem records instead of hand-rolling REST queries.
  5. Fix classification: Passed pull request title to the builder to check CONST_DEFECT_TITLE_PATTERN, linking the fail-to-pass check run only for fix/defect PRs with passing runs.
  6. Marker design and table safety: Combined marker line <!-- devops-cli:pr-evidence --> with author identity matching. Added paginated list_issue_comments and update_issue_comment methods to GitHubClient. Escaped pipe characters in check names.
  7. Registries and generated docs: Registered MCP exclusions in tests/ai/mcp/test_mcp.py, registered callback in tests/commands/test_pr_dry_run.py, and added docs/CLI_REFERENCE.md and docs/commands/pr.md generation to Group 3.
  8. Help strings: Placed CLI help strings in src/devops_cli/lang/en/help.py (HELP.pr.*).
  9. Task 3.2: Deleted duplicated/malformed task 3.2.
  10. Title and body form: Shortened PR title to docs(openspec): plan #3199 post pr check evidence comment (58 chars, no trailing ellipsis). Restored <number> in body.
  11. Feasibility: Removed future-tense statements and cited verified code paths and spec definitions.
  12. Existing tools: Evaluated GitHub Actions (marocchino/sticky-pull-request-comment and actions/github-script) and justified the native CLI command.
  13. Dependencies: Added ## Order and Dependencies section referencing feat(roadmap): a trace of every run, kept and shown in the PR comment and in explain #3032, feat(pr): check-readiness warns when a pull request body passes 1,000 characters #2585, and fix(mcp): pr_check_readiness is read-only in the exposure table but can resolve threads #3235.
  14. Design rationale: Documented why pr evidence is a dedicated command separate from pr checks and pr check-readiness.

@dan-petty
dan-petty merged commit 760f2cb into main Nov 2, 2026
20 checks passed
@dan-petty
dan-petty deleted the feat/3199-post-the-check-results-of-a branch November 2, 2026 23:13
dan-petty added a commit that referenced this pull request Nov 8, 2026
…tions (#4112)

Plans #3296

A stage plan can add a `devops` command and leave out the registrations
that the project requires for it. The dry-run ratchet, the dry-run
callback test and the generated documents then fail after the merge.
#3237 hit this with `devops pr evidence`. This change adds a
`companions` gate to `check_proposal`, so the stage job and `devops
roadmap plan-recheck` report each missing companion registration in one
list. The gate reads the command module of the staged commit and treats
a command that the module does not register as new. The MCP requirement
of the issue is dropped: the merged #3204 test fails only on an exposure
entry that names no command, so a new command needs no entry.

Change: `openspec/changes/3296-check-new-commands-register-dry-run/`

---------

Co-authored-by: devops-cli-service[bot] <349441588+devops-cli-service[bot]@users.noreply.github.com>
Co-authored-by: Daniel Petty <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant