Skip to content

0.1.2 TM11: init merges the brain PR on a companion it just created, so a public repository needs one merge #2417

Closed

Description

@jparker2006

Parent

Ticket TM11 of spec #2322 (0.1.2), one merge for a public repository too. Size: S.

What to build

For a public repository, openwiz init puts the brain in a private companion it creates, and proposes the brain files there in a pull request. With TM4's setting pull request in the code repository, the user merges twice. The default first fleet uses a demo repository, which may be public, so the 10 minutes (TM9) pays for the second merge.

The one change: when init creates the companion in this same apply, it also merges its own brain pull request on that companion, under the same explicit authorization, right after opening it and reading it back. The pull request stays as the visible proposal and record. An existing companion, a private repository's in-repository brain, and any repeat init keep today's behaviour: the pull request is opened for the user.

Contract first, in this ticket: setup-onboard.v1 gains the effect merge_pull_request (companion created in the same apply only), with first-hour.v1's effect fields, and the init result reports the brain pull request as merged. Everything else in the contract is unchanged.

Owned paths

  • contracts/setup-onboard.v1.md (shared: only the Visible proposals and Effects once lines)
  • contracts/setup-onboard.v1.schema.json (shared: only the effect kind list)
  • tools/install/setup/init.py
  • tools/install/tests/init/test_init.py
  • tools/install/tests/setup-onboard-contract/fixtures/cases.json (shared: one new case)
  • tools/install/tests/setup-onboard-contract/check.py (shared: only the effect checks)
  • crates/cli/src/init.rs (shared: only the effect label)
  • changes/2417.md

Relies on: nothing

Links

none

Acceptance criteria

  • With the fake GitHub, an apply on a public repository that creates its companion opens the brain pull request, reads it back and merges it, once, and reports merged and one merge_pull_request effect.
  • An existing companion, a private repository and a repeated init open the pull request for the user as today, with no merge.
  • The contract fixtures and checker accept the new case and still refuse a merge for any other case.

Proof

P4 (one setup PR, also for a public repository): test_init.py and the contract checker, red first.

Activity

  1. added this to the 0.1.2 milestone on Nov 22, 2026
  2. added
    ready-for-agent
    on Nov 22, 2026
  3. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: started (the 0.1.2 lead's direct start; Opus 5.5 Medium builder). Hand checks: open, only ready-for-agent, no claim, builder or pull request yet, no blockers, no owned-path clash with an open pull request.

  4. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    agent: builder
    state: done
    harness: claude-code
    model: claude-opus-5-5
    skills: build-ticket@0.2.2
    step: Fixed review R1 and R2 at 916e2ff and answered on the PR; CI running.
    time: 2026-11-22T23:19:39Z
    pr: #2420

  5. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    Builder question: crates/cli/src/init.rs (the effect label)

    Found: open pull request #2310 (#2289, 0.1.1 polish C) changes crates/cli/src/init.rs, including the create_label label line right next to where the new merge_pull_request label goes. The rule for this build is to leave alone any file an open 0.1.1 pull request is changing, and an adjacent-line edit would also conflict with it.

    Without the label, openwiz init's text output (not --json) prints the new merge effect as a second "Open the brain's pull request" line, because the match falls through to that default. The JSON result, the contract and the checker are all correct.

    Options:

    1. Open the pull request now without init.rs. Once #2289: 0.1.1 polish C: contract wording (fleet, fleet-tick, cli, install, open development) #2310 merges, merge main into the branch and add the one line Some("merge_pull_request") => "Merge the brain's pull request",, before this pull request merges (it waits for the 0.1.1 cut anyway).
    2. Leave init.rs to a follow-up ticket.
    3. Edit init.rs now and accept the conflict with #2289: 0.1.1 polish C: contract wording (fleet, fleet-tick, cli, install, open development) #2310.

    My pick: 1. The pull request I open now says that this line is still to come.

  6. added
    needs-info
    on Nov 22, 2026
  7. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    Lead answer to the builder question above: option 1. Open the pull request now without crates/cli/src/init.rs, and say in it that its one effect-label line is still to come. After #2310 merges, merge main into the branch and add only that line, before the final review.

  8. removed
    needs-info
    on Nov 22, 2026
  9. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    Builder question: supporting edit grant for tools/install/tests/init/fake_gh.py

    The owned-paths CI check on #2420 fails on one path: tools/install/tests/init/fake_gh.py. That path isn't owned. I used fleet.md's standing kind 4 (synthetic answers to a test fake this change breaks, with no assertion change), but the check only accepts the standing kinds it knows (evidence, changelog) or an explicit F4 grant.

    The edit: the fake gh now answers GET repos/{o}/{r}/pulls/{n} and PUT repos/{o}/{r}/pulls/{n}/merge, 16 added lines and nothing else. Init now reads back and merges the brain pull request. It supports tools/install/setup/init.py and test_init.py for acceptance criterion 1.

    Options:

    1. Grant it: a record-author comment with "F4 supporting edit granted" naming tools/install/tests/init/fake_gh.py.
    2. I move those answers into test_init.py, which would wrap the fake with a second script. That's more code and a less honest fake.

    My pick: 1. A grant can't come from the builder, so this needs the lead.

  10. added
    needs-info
    on Nov 22, 2026
  11. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    F4 supporting edit granted (planner), for #2417:
    tools/install/tests/init/fake_gh.py

    Only the fake answers for reading back and merging a pull request (GET repos/{o}/{r}/pulls/{n} and PUT repos/{o}/{r}/pulls/{n}/merge), with no assertion change. Same pull request, #2420.

  12. removed
    needs-info
    on Nov 22, 2026
  13. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    Builder question: widen the F4 grant on tools/install/tests/init/fake_gh.py for R1 and R2 of #2420

    The fixes the review asks for tie the auto-merge to this operation's own confirmed creations. That means the companion's immutable repository id from its create reply (R2), and the pull request's head sha from its create reply (R1). Init then checks both before merging. Today the fake gh returns neither, so the fixes can't be tested.

    The exact additions, synthetic answers only, with no assertion change:

    1. A repository the fake creates gets a synthetic integer id, and the repository read returns it.
    2. A pull request the fake creates stores a head sha. Its create reply and GET pulls/{n} return head.sha, and the merge call checks the pinned sha against it (today it compares with a constant).

    Options:

    1. Widen the grant to these answers on the same path.
    2. Fix both without the id and sha: merge only after a create reply that this operation itself confirmed, without binding the repository and revision. That only partly meets the review's fix.

    My pick: 1. I'm building against it meanwhile and won't push until a grant is recorded.

  14. added
    needs-info
    on Nov 22, 2026
  15. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    F4 supporting edit granted (planner), for #2417:
    tools/install/tests/init/fake_gh.py

    Widens the earlier grant for R1 and R2 of #2420: synthetic answers only, with no assertion change. A repository the fake creates gets a synthetic integer id that its read returns; a pull request the fake creates stores a head sha that its create reply and its read return, and the merge call checks the pinned sha against it. Same pull request, #2420.

  16. added 3 commits that reference this issue on Nov 22, 2026
  17. removed
    needs-info
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions