Repository navigation
Actors: std/actor wrapper and tests/actor, in Go - #310
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the actor design, which was proposal-only on this branch. Actors are a user-level layer on top of caos, so the design doc now lives with the tool as
std/actor/README.mdrather than underdesign/.std/actor: a single Go program onstd/go. Start reads the branch head, passes the state tree to the inner request and tail-calls it with itself as the callback. Finish mints the new commit withcaos put-commitand moves the branch with a compare-and-swap. A lost race fails the request, which is never cached, so the caller retries.std/actor/README.mdis the design doc (moved fromdesign/actors.md).tests/actor: a reference key-value inner plus a staged test covering put, get, idempotent re-apply, a forced lost race that fails uncached and succeeds on retry, 12 concurrent writers converging to a linear chain, the inner's lazy view of the state, and the inner's cache hit.tests/actor-ref: a spike that proves the write path described below.std/actor/README.md(spike results, open question 6, status),design/runner-protocol.md(status line, link to the actor README) andstd/README.md.How finish moves the branch
Finish does not use
git push. A push is a command<old> <new> <ref>plus a pack, and the pack can be empty when the server already has the new object, which it does aftercaos put-commit. So finish POSTs that one command and an empty pack to$CAOS_SERVER_URL/git-receive-packand the server does the compare-and-swap. This needs no scratch repository, no fetch of the parent and no history.git pushcannot do this. It resolves the new commit in a local repository and walks its ancestry to build a pack, which needs every ancestor commit (a deep checkout). A partial clone with a promisor remote does not avoid that: with a depth-1 promisor pack and theshallowfile removed, the push fails withCould not read <parent>. This is written up in open question 6 ofstd/actor/README.mdand in the header ofstd/actor/worker.go.Test plan
main(b57d285) cleanlycaos-testsuite on the merged tree: 53/53 pass, includingactor,actor-refandlintKnown gaps
tree:0fetch into a scratch repo; acaosverb could replace it.std/run-and-update-refand its tests, which predate this work.🤖 Generated with Claude Code
https://claude.ai/code/session_01TdKoYwiDbeZeVgVz12BFVS