Skip to content

Spec: Go vertical-slice prototype and comparison against the Rust binary - #1847

Merged
JacobStephens2 merged 22 commits into
mainfrom
issue-1830
Nov 7, 2026
Merged

JacobStephens2 merged 22 commits into
mainfrom
issue-1830

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Build an isolated Go prototype of the unattended Ticket and Pickup flows, with a measured comparison against the production Rust runner. Closes #1830.

prototype/go/
├── Ticket run → Claim → Worktree + embedded Factory skills → streamed Harness
├── Delivery → Base branch reconciliation → CI watch → bounded Repair
├── Pickup → Ready selection → origin reservation → Ticket run → leased release
├── tests → CLI fixtures, state exhaustiveness, bounded reservation model
└── benchmark.py → fresh Worktrees → Go/Rust measurements → research report

The Linux prototype builds with CGO_ENABLED=0, embeds the Factory skills, validates Origin match and trusted issue context, and supervises the streaming JSON Harness with process-group signal escalation. Ticket runs retain failed work and complete Claim ending after interruption. Delivery captures one PR, checks its published head, reconciles the Base branch and performs bounded Repairs.

Pickup selects the lowest-numbered Ready issue, creates ADR-0017's parentless origin reservation with an empty lease, rechecks Claim generation before dispatch, and releases only its own token. The bounded BFS checks both dispatch invariants and retains counterexamples for the unguarded protocols. Typed state enums have a test-time exhaustiveness check. Go has its own module, CI job and affected-test routing.

The comparison report and measured artifact record cold/incremental builds, test compilation/execution, static binary size, source counts, subprocess ergonomics, exhaustiveness and model-checking trade-offs. The two measured samples are pinned to 82cc4dc2; the Rust executable and tests cover a larger product, so the report does not infer a complete rewrite's speedup. ADR-0001 remains unchanged. Specs, other run types, additional Harnesses and production continuation/re-run policies remain outside this prototype's support.

The whole-Spec review also fixed rejected acquisition incorrectly ending another actor's Claim, shared GitHub CI classification, and consolidated the two incomplete-CI readiness regressions.

Evidence

Execution evidence

  • Before: cd prototype/go && PATH=/usr/local/go/bin:$PATH go test -run '^TestSpecStaleClaimMustNotReleaseSomeoneElsesClaim$' -count=1 -v exited 1: labels = map[enhancement:true ready-for-agent:true], want [enhancement ready-for-agent in-progress].
    After: the same command exits 0: --- PASS: TestSpecStaleClaimMustNotReleaseSomeoneElsesClaim (0.66s); package ok in 1.268s. A rejected acquisition now leaves the incoming Claim intact; cleanup still runs after an uncertain or interrupted PUT.
  • cd prototype/go && PATH=/usr/local/go/bin:$PATH go test -run '^(TestInterruptedClaimMutationStillEndsClaim|TestPickupRefusesClaimWhenGateLabelAppearsAfterRead)$' -count=1 -v: PASS.
  • python3 -m unittest discover -s scripts -p 'test_*.py': 37 tests, OK. python3 prototype/go/bundle-skills.py --check: exit 0. go vet ./... and gofmt checks: PASS.
  • Final PATH=/usr/local/go/bin:$PATH scripts/affected-tests main: PASS; go test ./... passed in 160.22s and the full cargo test suite passed in 2394.68s, without retries.

Test seams: the compiled prototype CLI against temporary Git repositories and fake gh/Harness executables; the benchmark CLI against stand-in compiler tools; the state-exhaustiveness checker and bounded Pickup model.

Unaddressed findings

Standards

None. All three findings were addressed: Claim ownership, repeated CI classification, and duplicated readiness assertions.

Spec

None. The single finding was the same Claim ownership defect and was reproduced and fixed.

Security

None.

Security review outcome

No unaddressed introduced findings.

Review coverage

Both independent reviewers read all changed code, tests, documentation, workflow and benchmark artifacts, plus the review fixes. No unexplained unread changed files remain. Intentionally not read: generated prototype/go/factory-skills.json (414,908 bytes). Both reviewers accepted its exclusion after reviewing bundle-skills.py, skills.go and the CLI assertions; python3 prototype/go/bundle-skills.py --check proved byte equivalence to skills/**, and go test -run '^(TestTicketRunLinksEmbeddedSkillsAndStreamsSession|TestBinaryIsStaticLinux)$' -count=1 -v passed for embedded content, skill links, Git exclusions and static ELF behavior. Each axis's complete files-read list and exclusion evidence are recorded in the Session review reports.

Merge Danger

Door: two-way

The prototype is isolated; ADR-0001 remains unchanged.

Blast Radius: prototype

Affected-test selection and a separate Go CI workflow change how prototype checks run. The experimental executable mutates labels, origin refs and pull requests when deliberately run on a repository.

Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh

Tickets

A base-branch checkout can already contain .thirdshift-issue.md as a
symlink. The prototype opened that path with truncation and replaced the
link's target outside the Worktree, then started the Harness. Refuse the
link and keep the regression that plants one at a local canary.
Go prototype: embedded skills and supervised Ticket-run session
A passing check during the registration grace was treated as green, so Delivery marked the pull request ready before a check that registers a moment later could fail. Keep polling through that grace for an empty or passing listing.
A fast successful check was enough to mark the pull request ready while a workflow run on that same commit was still open, or had finished failed without publishing a job. Pending wins until that run completes, and a completed failure stays red.
Pickup built its whole-label PUT from the issue snapshot taken before history and trust checks. A gate label applied in that window was left out of the replacement, so the PUT deleted it and the Harness still started. Re-read at the PUT, skip the claim when that read shows the gate closed, and keep every other label from the new read.
A fork pull request with the same head branch name was treated as this repository's pull request, so Delivery and salvage stopped before pushing. Skip cross-repository results and open or reuse the same-repository pull request.
Add Go Pickup and bounded reservation model checking
Combine Pickup reservations and atomic Claim label updates with Delivery and bounded Repairs. Pass the Repair limit through shared Ticket runs and retain one Harness fixture record per session. Cover Pickup Delivery, CI and conflict Repairs, salvage, and Repair limits with CLI regressions.
Go prototype: deliver Ticket runs and repair failing heads
Benchmark the Go prototype against Rust
A fork pull request can reuse the issue branch name. Claim ending treated any open pull request with that name as this repository's work, so a run that published nothing left the issue in-progress. Filter isCrossRepository, as discovery already does.
@JacobStephens2
JacobStephens2 marked this pull request as ready for review November 7, 2026 02:13
Preserve independent affected-test routing for both Go and TypeScript prototypes, combine their regression coverage, and document both boundaries.
@JacobStephens2
JacobStephens2 merged commit 4fca2d0 into main Nov 7, 2026
17 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1830 branch November 7, 2026 03:18
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.

Spec: Go vertical-slice prototype and comparison against the Rust binary

1 participant