Skip to content

Freeze checkout bases as commit SHAs and prepare owner workspaces - #137

Merged
oldsj merged 1 commit into
mainfrom
prep-slice3
Oct 9, 2026
Merged

oldsj merged 1 commit into
mainfrom
prep-slice3

Conversation

@oldsj

@oldsj oldsj commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Step 4 slice 3, plus the Mainloop half of slice 5. Gated by GIT_TRANSPORT_ENABLED and PUSH_GATE_ENABLED (off in prod); with either flag off nothing changes, including no extra GitHub calls (tested).

  • New services/github_checkout.py resolves a ref to a full commit SHA via the repository-scoped App client (contents: read). An empty ref uses GitHub's current default branch; branch, tag, HEAD and SHA inputs use /commits/{ref} with encoded path components.
  • Task provisioning and owner workspace creation (both project and repo routes) resolve before any project insert/touch, workspace row or create plan. Unresolvable refs are refused with nothing created.
  • Replays, lost CreateSession replies and runtime replacement reuse the stored SHA; successors keep the checkpoint's verified remote_sha through an internal path HTTP can't reach. The task branch stays the push target.
  • Owner (agent) bindings select kagent's agent preparation profile (pinned digest from feat: add agent workspace preparation profile kagent#21), still only from the binding role.

Real-PostgreSQL route tests cover stale stored vs remote defaults, refusal leaving project rows untouched, replay identity, and the bypass refusal.

With Git transport and the push gate enabled, task provisioning and owner
workspace creation resolve the checkout ref (or GitHub's current default
branch) to a verified commit SHA through the App with contents:read, before
any project, workspace or create plan is written. Replays, lost create replies
and runtime replacement reuse the frozen SHA; successors keep their verified
remote_sha. Unresolvable refs are refused with nothing created. Owner (agent)
bindings now select kagent's agent preparation profile. With either flag off
behaviour is unchanged.

Signed-off-by: James Olds <12104969+oldsj@users.noreply.github.com>
@oldsj
oldsj merged commit 65ea0e6 into main Oct 9, 2026
5 checks passed
@oldsj
oldsj deleted the prep-slice3 branch October 9, 2026 05:51
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