Repository navigation
actions: orchestrator Tier 1 (serve, event mapper, trigger/promote/finish/check) - #57
Open
calvin-archastro wants to merge 1 commit into
Open
calvin-archastro wants to merge 1 commit into
calvin-archastro wants to merge 1 commit into
Conversation
…nish/check) pail-actions serve: pail events as a wake flag, push/pull_request/dispatch mapping with the base branch's workflows for PRs, a pure decide() over an _actions snapshot, and one guarded pail put per tick (--expect, --if-absent, read-only records guarded by an identical rewrite). _checks projection with reconcile. Tier 2 intents are left behind the Tier2View/Pass seams. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Orchestrator T1.1-T1.3 (Decision D2: Go, calling
pailas a subprocess):pail-actions serve --store URL [--replica NAME]. Stateless; any number of replicas.What it does
pail events --branch '*' --prefix actions/ --cursor bucket:actions/cursors/<replica> --safety-poll 10; every line sets a wake flag, plus a 10 s timer (a lapsed lease emits nothing). One tick answers all pending wakes.push,pull_request(opened/synchronize/reopened/closed from_meta:prs/<n>.jsondiffs and PR-branch moves) andworkflow_dispatch(behindTier2View, stubbed). GitHub-shaped payloads stored on the run. PR events andpr/*pushes plan the base branch's workflows (D7; the event does not carry the writer, so everypr/*is treated as untrusted). Schedule: not built.Decide(snapshot, input)is pure, over a snapshot of_actions; passes: trigger, promote, finish (T1.4 adds passes).runs/<id>,claims/<key>, jobs,numbers/<wf>/<n>,concurrency/<g>CAS, cancels the previous holder whencancel-in-progress.in_progresswhen a job is._checks:<sha>/ci.<job>.json, reconciled every tick.pail put _actionsper tick. Written+existed ->--expect, created ->--expect absent, read-only -> identical rewrite with--expect(pail putonly accepts--expecton paths it writes). Exit 4 -> re-read, decide again.Left for T1.4
orchestrator.Tier2View(today:Dispatches,Ack; TODO listsQueuedEntries/Leases/Results) andPass func(*Decider)indecide.go. No tier2 package here. Leader lease: not done (optimisation).Contract changes (docs/actions.md, same PR)
payload;cancel_in_progressis a boolean. Job:job_id; file name is the escaped instance id; static-falseifjobs createdcompleted/skipped.reopened/closedgets a/<type>suffix (else a close at the pushed head collides with that push's claim).${{ github.* }}filled in, escaped; no serialising for groups withoutcancel-in-progress._checks.statemapping; the check commit cannot guard the run (another ref).Model vs doc
_checksis another ref. The model has one shared state.--expect" is not expressible inpail put; done as identical rewrite.numbers/,idx/,if-skipped-at-creation,timed_out, runstatus; all additive.idx/not written.Tests
decide_test.go(pure): push -> run/jobs/claim/number/group; duplicate event and repeated tick -> no second run; needs chain and gate; failed need skips; finish; cancel-in-progress (mirrorssupersedeRun), two replicas racing (mirrorsconcurrentPushesRun), trigger guards;_checksprojection.integration_test.go: real pail on afile://store (skips withoutPAIL_BIN/target/release/pail): push tick, repeat/restart, forced conflict between read and commit -> retry, no double trigger, supersede, PR from base workflows.actionsjob now builds pail so these run.🤖 Generated with Claude Code