Skip to content

feat(engine): implementation runs follow the session binding - #19

Merged
hlubek merged 23 commits into
mainfrom
claude/d-cpt-9kv-landing-on-binding
Sep 24, 2026
Merged

hlubek merged 23 commits into
mainfrom
claude/d-cpt-9kv-landing-on-binding

Conversation

@hlubek

@hlubek hlubek commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Implements the first slice of 20260914-180822-d-cpt-9kv: the implementation procedure holds one branch fact, baseBranch; the work branch lives only in the session binding.

What changes

  • Procedure (d-prc-imp): workBranch and the workTarget step are gone; setup routes straight to the working junction and tells the agent to declare the session binding once the host is on the work branch. Dispatch seeds carry no branch, so captures during work and the closing done follow the binding. The landing unit states the order: merge, return to base, clear the binding, then report landed. The closeout no longer speaks of the binding. The work junction gains an abandon path that removes the marker on base (unwind → unmark when a marker exists).
  • Target rule: workBranch leaves the branch-field precedence registry, so the binding is the only branch fact after base; a stale value in an old session's store is ignored. A graph read that a state field sends to an unavailable branch now says so: reading the graph on branch "x", chosen by the captureBranch state field, failed: … instead of the bare mutation-target message.
  • Replay: a session bound to a branch whose checkout is gone could neither be resumed nor have its binding cleared, because replay resolved procedure specs on the bound branch. Spec resolution falls back to the project's default branch in that case; the entry-identity check still guards the procedure. This is what lets the two runs stuck at landing today be unbound and finished.
  • Tests: proctest worlds can drop a branch (World.DropBranch) the way the local runtime loses a checkout. New regressions: landing after the sole checkout returns to base (TestImplementation_LandsAfterTheSoleCheckoutReturnsToBase), the abandon path, and clearing a stale binding. The remaining implementation tests follow the new flow.

Already covered before this PR: the engine acquires no graph for a command that declares none (GraphIndependent, since 65aeca3).

Left for later slices

  • The declared coding-host session property (start_session declaration, template exposure, gating of the implementation move).
  • Remote branch delivery for a session host over an embedded graph.

Both stay open under d-cpt-9kv and will be named in the closing done.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no outstanding previous finding or new actionable defect was identified.

Summary

This PR makes implementation runs follow the session’s effective branch rather than storing procedure-owned branch fields.

  • Derives an unbound local session’s base from the serving checkout and exposes that source in session framing.
  • Routes marker, capture, document, and done writes through the session binding or derived base.
  • Makes replay tolerate retired fields and steps so older sessions can resume after procedure evolution.
  • Removes the explicit landing junction, releasing the marker alongside the done entry so both travel with the work.
  • Adds regression coverage for branch/worktree runs, stale bindings, removed checkouts, replay compatibility, and abandonment.
  • Replaces the Astro documentation action with an explicit pinned pnpm build and Pages artifact upload.

Reviews (3) · Last reviewed commit: "sdd: summarize 20260924-091500-s-tac-ien..."

hlubek and others added 2 commits September 23, 2026 16:45
The implementation procedure holds one branch fact, baseBranch; the work
branch lives only in the session binding, pushed on entering it and popped
on returning to base, so landing after the merge reads base. workBranch and
the workTarget step leave the procedure and the target precedence, the
landing unit states the order (merge, return to base, clear the binding,
report landed), the work junction gains an abandon path that removes the
marker on base, and a graph read a state field sends to an unavailable
branch names the read and the field.

Implements 20260914-180822-d-cpt-9kv; regression for landing after the sole
checkout returns to base (20260902-160151-s-tac-mtv).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replay resolved procedure specs on the session's bound branch, so a session
bound to a branch whose checkout is gone could neither be resumed nor have
its binding cleared, although the error told the agent to clear it. Spec
resolution now falls back to the project's default branch when the bound
branch cannot be acquired; replay's entry-identity check still guards the
procedure.

Refs 20260914-180822-d-cpt-9kv.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread internal/baseprocedures/entries/20260706-170000-d-prc-imp.md
Comment thread pkg/application/workflow.go
hlubek and others added 21 commits September 23, 2026 16:56
Runs recorded before the work branch moved into the session binding logged
a transition through workTarget and reports of workBranch; replay refuses an
unknown step and an undeclared field. The procedure keeps the step as a
pass-through to work and the field declared and optional, guarded by a test,
while such sessions may still be resumed. The stale-binding fallback for
procedure specs resolves the project's configured default branch rather than
the ambient current graph.

Review follow-up for PR #19; refs 20260914-180822-d-cpt-9kv.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SDD-Mutation: v1:28dd451c4c2f356f900ac33290def79b47ac9c6404b0e48b2133c769778e57e3
SDD-Mutation: v1:2067969c08a855669f3a5effca69dea3feb1acdc723bf277306d37aa42ef9a13
SDD-Mutation: v1:64e5ee294633a94912fe700d9aed78474f48231cc7d4b1be8d544bed3ba3849c
SDD-Mutation: v1:7d9b22e8307ae88b52d14eff86e2e3f091f5a17c640309eb20ae453e7cba0d8f
SDD-Mutation: v1:b7cd637595d043cc44a1e12148bda8f0bd7c415700a1484611ef01dfa82ec3dd
SDD-Mutation: v1:7de8cb002b385c0345680604db803da4254a0ef582c23abc2e9db500bd811d45
SDD-Mutation: v1:bee2b06ed038b997a9759cf4633d26e5633e775fe9c7b07dea5a7521495d0391
SDD-Mutation: v1:858ad440dabdc4ce4c92f4ba26ab211e987bd8893f8b87c04f5a46c34f28c1ad
SDD-Mutation: v1:3e17165c2ab771f223d447080cc8f148e205e8750790b70f7cf19600c28c1033
Replay drops fields the procedure no longer declares and passes through
steps it no longer has (20260923-230855-d-cpt-34w).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… step

The WIP marker is written and removed on the session's current branch;
the marker goes right after the closing done, so the merge carries both
to base. The base-target, work-target and landing steps and the
baseBranch, workBranch and worktreeMode fields leave the procedure
(20260923-230855-d-cpt-34w).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A local server takes the branch its serving checkout has checked out at
each read or write, a composition without a resolver takes the
configured default, and a checkout without a branch falls back to it.
The session framing names the base, the session shell tells the agent
when to declare a different branch, and a write whose branch has no
checkout names the remedies (20260923-233057-d-cpt-ekd).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…on main

Branch mode follows the derived base, worktree mode declares the work
branch; both merge and find the marker gone from main
(20260923-230855-d-cpt-34w).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
SDD-Mutation: v1:164a644258366cfbff535e2f8e047f3db84156132c2b8e09edc60ed75b315e90
SDD-Mutation: v1:b64fbbf0cae2347470da133a4084764b9d9ae1119ab7513dc7b62f4a1151a608
SDD-Mutation: v1:e5e386cf480e19c32a4a7962bbcecad3451c5c588b8689bccd64257fb33a8e96
SDD-Mutation: v1:35bd20598f8095a1d148b8e4ba81642ef46e047a05941b57bfe3061124c1de72
SDD-Mutation: v1:ab1255bbd410cc582c66218c9b5ec3521ffb245de9998dc62218505f501b2392
@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@hlubek
hlubek merged commit f6cdd99 into main Sep 24, 2026
4 checks passed
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