Skip to content

A check refuses naming a Role to open pull requests while open_pull_request has no writer (#808, record 0215) - #819

Merged
don-petry merged 4 commits into
mainfrom
claude/opening-role-writer-808
Nov 14, 2026
Merged

don-petry merged 4 commits into
mainfrom
claude/opening-role-writer-808

Conversation

@don-petry

@don-petry don-petry commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #808

A configuration can no longer name a Role to open pull requests until the Effect open_pull_request has its writer. This holds #295's limit by a check rather than by memory. With the Role null, as config/defaults.json has it today, the check passes, so config/defaults.json is untouched and no hand PR is needed.

What

The check. tools/check_authority.py opening_problems refuses a configuration whose issues.intents["open-pull-request"] is not null unless the code has a writer. The writer is three marks, read from the code's syntax, never by importing it:

  1. An opening adapter. An adapters/ function builds request(...) with method POST and path /repos/%s/pulls and nothing after it. Both the method and the path are read as text. A literal counts, and so does:
    • one formatted with %;
    • an f-string;
    • a name bound once to one of those in the function or at the module's top;
    • an argument given by place or by keyword.
  2. A step that reaches it. A harness/ module that tools/check_writes.py's CALLERS lists as reaching that function. Because check_writes holds CALLERS true, the check can rely on it.
  3. A record of the Run. That same module calls harness/apply.py's opened, which records the Run that opened the pull request (decision 0097). It can be imported in any of these ways:
    • by name, or under another name;
    • relatively;
    • with harness.apply imported whole, as a module or under another name;
    • spelt out as harness.apply.opened, but only where import harness.apply binds it.

The refusal names the first mark missing. #342's writer is the change that makes all three true.

Counter-example. examples/invalid/config.an-opening-role-with-no-writer.json is refused by tools/check_examples.py through the check, and for that alone.

Record 0215, numbered by the Factory Builder, amends decision 0068's row "The Run record" and decision 0047's row "The known limit". It restates #295's limit as "before any Role is named to open pull requests, or any contract is in force". It also names what remains:

  • nothing checks that no contract is in force;
  • the marks are syntax: a step could call opened and reach the opener in separate flows;
  • a writer written in a form the check does not read stays red. It fails closed, and the refusal names the mark it lacks.

Held by

  • The test: tests/test_tools.py::test_a_role_named_to_open_pull_requests_waits_on_its_writer.
    • Today's configuration passes. A named Role is refused in the repo as it stands, and its counter-example is refused.
    • In a scratch tree, the full writer passes, and each mark missing in turn is named.
    • A read of the pulls, a write to them other than POST, a write to one pull request, a call that builds no request, and a method or path not written as text are not an opening. Neither is a name bound twice.
    • A caller outside the Harness, and a step that reaches another writer, do not reach the opening.
    • A step that calls no opened, another module's opened, or harness.apply.opened without the import records nothing.
  • Mutants: 27 new, each killed by the test. All 107 mutants of tools/check_authority.py and tools/check_examples.py are killed.
  • make checks: red on one check alone. Record 0215 opens a gap until records 0212 to 0214 merge. Then I merge main into this branch and push.

Diff: about 36,000 characters.

Second readers

Reader Head Result
Carbon (Gemini 4 Carbon) a4eac6c not run (quota), owed
Muse a4eac6c 1 major and 2 minors, all fixed in 70cd0b5. Major: harness.apply.opened counted with nothing importing harness.apply. Minors: the plain from harness.apply import opened form was untested, and any write verb to the pulls counted, though only POST opens
Astra (gpt-6-astra) a4eac6c 2 majors, fixed in 70cd0b5: the same import gap, and the untested plain import
Claude + security a4eac6c no blocker and no security finding. 2 minors, fixed in 70cd0b5: only an inline positional path was read, so a real writer in the style of adapters/effects.py would stay red; and opened by its own name in harness/apply.py had no test

The fixes in 70cd0b5 came after the readers; none of them re-read that head.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

don-petry and others added 3 commits November 12, 2026 23:37
…equest has no writer (#808)

tools/check_authority.py reads the writer from the code's syntax: an adapter that sends a write to a repo's
pulls, a step of the Harness that tools/check_writes.py's CALLERS lists as reaching it, and that step's call of
harness/apply.py's opened. It names the first part missing; with the Role null, as today, it passes.
tools/check_examples.py refuses the counter-example examples/invalid/config.an-opening-role-with-no-writer.json
through it. Fifteen mutants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…equest has its writer (#808)

It restates issue 295's limit as before any Role is named to open pull requests, or any contract is in force,
amends decisions 0068 and 0047, and names the check and its residual: nothing checks that no contract is in force.
A call that builds no request is shown to open nothing; two removal mutants keep their block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ST opens, and harness.apply.opened needs its import

The Claude review: a path held in a name bound once, a module's constant, a keyword or an f-string is read, and
apply is imported relatively from the Harness too; opened by its own name counts in harness/apply.py alone, tested.
Astra and Muse: harness.apply.opened spelt out counts only where import harness.apply binds it; opened imported by
its plain name is tested. Muse: a write to the pulls other than POST opens nothing. Record 0215 says so; twelve
mutants more, four re-anchored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner November 13, 2026 05:55
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codeant-ai

codeant-ai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #9656a Incremental review completed 0aa60a0 Nov 14, 2026 · 00:36 00:48
✅  #42e67 Reviewed your PR 70cd0b5 Nov 13, 2026 · 05:55 06:08

@codeant-ai

codeant-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@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: 70cd0b5f0b

ℹ️ 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 tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T00:39:51.155048Z 0aa60a0 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
@sonarqubecloud

Copy link
Copy Markdown

@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: 0aa60a03f9

ℹ️ 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 tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
Comment thread tools/check_authority.py Resolved
@codeant-ai

codeant-ai Bot commented Nov 14, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt Nitpicks

1 code suggestion

1. ast.walk(fn) includes nested helper bodies, so an unused inner function's matching request() call is attributed to open_pull_request and satisfies the writer mark.

Logic error · tools/check_authority.py:93-95

@codeant-ai

codeant-ai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟡  Medium Risk

  • The PR needs attention before merging because its writer check can accept a path that would not open a pull request.
  • In tools/check_authority.py, a literal %s route and formatted paths with conversions can pass without matching the actual request path.
  • The Run-record check can also accept a shadowed imported name, allowing a stub call to satisfy the check.

Assessed commit: 0aa60a03f9d7

@combsmith-sf-pr-review combsmith-sf-pr-review 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.

No gating findings: the opening check, its counter-example, test and mutants hold to issue 808.

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.

A check refuses naming a Role to open pull requests while open_pull_request has no writer (#295's limit, restated)

2 participants