Skip to content

fix(takeover): publish complete leases and type permit failures - #312

Merged
ElbertePlinio merged 3 commits into
mainfrom
fix/295-298-lease-publish-reporting
Oct 8, 2026
Merged

ElbertePlinio merged 3 commits into
mainfrom
fix/295-298-lease-publish-reporting

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

This PR splits the stable #298 and #295 fixes out of #305. The #213 teardown gate is left out and will get its own PR.

#298: a human lease is now written to a temp file and hard-linked into place. A peer that loses the race always reads a complete lease, so it reports HumanLeaseHeldError instead of StaleHumanLeaseError.

#295: permit failures before input now have a type. acquireAgentPermit wraps non-takeover failures in AgentPermitUnavailableError. withAgentPermit releases the permit and throws a typed error when the pre-action recheck fails. CLI pointer evidence and MCP input evidence record these failures as not-attempted. Errors from the action itself still propagate unwrapped.

Closes #298
Closes #295

Requirement Verified by Scenario Result Evidence
#298 publish lease by temp file and link Automated test (takeover.test.ts), QA Peer reads the lease at the publish step; 30 rounds of two concurrent claims Peer never reads a partial lease; 30 acquired, 30 HumanLeaseHeldError, 0 stale qa-split/race.json
#298 test that a peer never reads a partial lease Automated test Deterministic seam, no timing luck Pass CI
#295 refused permit is not-attempted in CLI pointer evidence Automated test, QA desktop click and desktop drag while a human lease is held inputState: not-attempted, exit 1 qa-split/actions-*.jsonl
#295 typed permit acquisition failures, reported not-attempted Automated tests (core, MCP), QA Permits directory made read-only, then restored EACCES click records not-attempted; next click completes qa-split/click-storage-fail.json
Action errors stay unwrapped Automated test Action throws inside withAgentPermit Original error propagates CI
Normal input still works QA Click before the lease and after release completed qa-split/actions-*.jsonl

Checks: lint, typecheck, build, GSK_RENDERER=cairo bun run test:coverage (3,011 passed, 6 skipped, thresholds unchanged), PickCheck clean.

QA evidence lives outside the repo in the batch 5 artifacts folder (qa-split). The pass used an isolated PICKFORGE_HOME and a product-created desktop session.

@ElbertePlinio
ElbertePlinio merged commit 3485d53 into main Oct 8, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/295-298-lease-publish-reporting branch October 8, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant