Repository navigation
Functions trigger durable runs, and an executor in any language can claim a run and replay its
steps through the engine (#209).
The ledger and control-plane formats change. Start 0.4 with a fresh data directory.
-
Release prep (#231). Foundation crates and the
ironflowxfacade share 0.4.0. The release includes the first packages ofironflowx-execution,ironflowx-doorsandironflowx-codegen, with MIT licences and crate READMEs. Binary releases come fromironflowx/ironflow. The release rehearsal builds the packaged HTTP door and wire-enabled proto in dependency order, withoutprotocorbuf. -
Runs close-out (#230). Tests cover execution request limits on the engine and through the door, repeats after lost lease replies, and waiting claims that take retries on the host clock or after a manual clock step. Wire tests cover all 23 operations on every protocol. The architecture and invariant tables describe the 0.4 implementation and its proofs.
-
Execution model (#228): seeded command histories check RUN-1 to RUN-11 against the ledger and compare run queries before and after rebuilding the read store. CI runs 8 histories per platform, and the soak runs 128 (D123).
-
FailRun validates step zero before the lease (#256). A
failed_stepof 0 sent alone answersInvalid,a step position is from 1, before the fence or the execution-over answer. The lookup of a positive position still follows both. -
Starting runs directly, and listing runs (#222), breaking:
StartRunRequestgainsinput, JSON text under event data's rules (nullwhen absent), andidempotency_key, 1–256 bytes with no NUL; a start checks both, then that the function exists, then the key. Start keys are a space of their own, beside events' keys, and last as long as the run: a start again with the same key and function answers the first run,duplicate: true, whatever the input; with another function it isConflict(D102). Execution rules'Command::StartRungainsinputandidempotency_key,EntrygainsStartKey(kind 19; kind 2 keeps its bytes),ExecutionViewgainsstartedandruns_before, andExecutionTablesstart_key.Operationsgainslist_runs(runs list, scoperead): runs newest first, filtered byfunction,statusandevent_id, asRunSummary, without input or output, with its body failures, and its error as aListedError, its code when it has one and the step it names, without its message: a run with an error lists one ({}for a failure of neither code nor step), told by its message as the read store tells it, and a run with none lists none; an event ID or function that names nothing, or an event ID that does not parse, is an empty page (D115). Execution rules gainlist_runs,RunFilter,RunPage,RunSummaryandListedError, and event rulescheck_key, the ledgerlist_runs. A lost start's hint says a retry with its key is safe, and that one without starts a second run. The page cursor's codec, once in event rules and execution rules, isironflowx_core::cursor.read.dbgainsstart_keysand indexes for the list, so a store from before is rebuilt at open. -
Failure and retries (#225), breaking:
FailStepandFailRunreport failures, with attempts per step and for the body. Retries use the current function policy and store an absolute due time. A final step failure is replayable, and a terminal run failure commits with its event.RunError.codeis optional, and the event's error object omits it when absent. Existing coded ledger entries and protobuf field values keep their encoding.GetRunincludesbody_failures. The operations requireexecuteand generateexecutions fail-stepandexecutions fail. -
Steps, replay and
once(#224), breaking:begin_stepanswers every case of the Steps table (D89, D91, D93, D110). A begin that names another step than the one recorded at its position fails the run withironflowx.step_order, naming the position and both names, andironflowx.run.failedin the same record (RUN-2, RUN-4); so doescomplete_runwith fewerstepsthan were begun, checked before the open step; step 1,001 fails the run withironflowx.too_many_steps. Each answersended. A step an earlier execution began and left open runs again, recorded for the new execution with its first begin's name,onceand input; aonceone is not begun again but fails withironflowx.unknown_outcome, its recorded outcome and the run's last error, and the execution goes on (RUN-5). A recorded failure is answered to every later begin and completion of the step, as an output is (RUN-3). On the wire and in Rust,BeginStepResponseandCompleteStepResponsegainFailed { error }(failed,StepFailed),RunErrorgainsstep: Option<StepRef { position, name }>, andRunEndgainserror, so a struct literal of either needs the field and a match on either answer the arm. Execution rules gainEntry::StepFailed(kind 12), aRunFailedthat names a step (kind 13; kinds 1 to 11 are written and read as before),Begun::Failed,Outcome::StepFailed,Step::errorandStep::resolved,RunError::step,StepRef,RunEnd::error, andExecutionTables::fail_step;begin_stepof a table takes a step the run counts, open, as begun again, andfoldrefuses a second outcome for a step, and a begin of one with an outcome, as the store's error.read.db'srunsandstepsgain columns, so one written before this is rebuilt at open. EXE-011, EXE-012, EXE-014 to EXE-018 (EXE-017's rows butfails step 2), EXE-034, EXE-044 and EXE-045 pass. -
Restarts, clocks and the open (#227), breaking: an open lapses no lease. The ledger notes the event time when it opens, the later of its clock and the last record, in memory only, and a claim takes a
runningrun only once its lease's deadline, and that open time plus the lease's length, have both been reached; a lapsed lease is due, for the claim's order and a waiting claim's wake, at the later of the two (RUN-18, D96). The open writes nothing: the deadline a run shows, the fence and the lost-lease count are unchanged, and a release still makes a run due at once. Execution rules'decidetakes the open time besidenow, andExecutionView::claimabletakes it besidenow, which a test view must implement; execution rules gainMAX_LEASE_SECONDS(900). EXE-053 and EXE-054 pass on the engine. -
Events create runs in their own record (#221), breaking: an emit, or a batch, creates one run of each function triggered by each new event's name, in function-name order, in the event's own record; an idempotent repeat, a refused batch item and the engine's own events create none, and an emit's answer is unchanged (D100, D104). The run stores the event's ID, and a claim of it carries the event whole (D101). Execution rules gain
trigger,Origin<E = EventId>(Event(E) | Input(Vec<u8>)) and the re-exportsEventandNewEvent;Run::inputandEntry::RunCreated::inputbecomeorigin: Origin,Claim::inputbecomesorigin: Origin<Event>, andExecutionViewgainstriggeredandrun_event, which a test view must implement.ironflowx-cellre-exportsOrigin. On the wire,Rungainsevent_idandClaimgainsevent, absent for a started run, whoseinputstays; a run an event created has noinput.ironflowx_proto::Rungainsevent_id: Option<EventId>andClaimevent: Option<Event>, so a struct literal of either needs the field. A run an event created is a record entry of a new kind, 11; kind 2, a run created with an input, is encoded as before, so a format-3 log written before reads the same.read.db'srunsholds an input or an event ID: aread.dbwritten before this is rebuilt at open. FUN-011 to FUN-014 pass on the engine and through the door. -
Leases and the fence (#223), breaking: a claim also takes a
runningrun whose lease's deadline has been reached, a lapsed lease due at its deadline, as the next execution held by the claiming key, and counts one lost lease; the tenth in a row fails the run withironflowx.executor_lostand appendsironflowx.run.failedin the claim's record, and the claim goes on to the next run, failing at most 100 (D97). A step's outcome sets the count back to 0; a lost lease spends no attempt. Every accepted call that appends renews its lease to now plus its length; a late executor whose run nobody took keeps it (D94).Operationsgainsheartbeat(Heartbeat,executions heartbeat), which renews 1–100 leases in one record and answers each on its own, a renewed deadline or its refusal, andrelease_run(ReleaseRun,executions release), which makes the run due now, counting nothing, and answers its due time, the same when sent again (D109); both needexecuteand meet the fence, so an implementation ofOperationsneeds the two methods, and a match onOperationthe two arms. Until the next claim supersedes it, a released execution's calls answerConflict, "this execution is over", but its release sent again, which answers the same due time, and a step's completion where the step has an output, which answers it.Rungainslost_leasesanderror(RunError { code, message }) on the wire and in Rust. Execution rules gainCommand::HeartbeatandRelease, the entriesLeaseRenewed,LeaseLost,ReleasedandRunFailed(kinds 7 to 10; private fields, made only bydecidewith its event),Outcome::RenewedandReleased,RunError, andRun::lease_seconds,lost_leasesanderror;ExecutionView::claimabletakes how many runs to skip, the ones a claim has failed so far;ExecutionTablesgainsrenew,lose_lease,releaseandfail_run, andclaimtakes the lease's length, whichfoldreads off a claim's deadline and record time, so a claim a log already holds reads the same.read.db'srunsgains columns, so one written before this is rebuilt at open. A lost claim's hint now says its run waits for its lease's deadline, and the proto client checks one heartbeat result per lease. EXE-002, EXE-010, EXE-030's rows but the two failures, EXE-032, EXE-033, EXE-035, EXE-037, EXE-038 and FUN-008's rows forHeartbeatandReleaseRunpass, and the one-execution replay check that stood in for EXE-010 is gone. -
The waiting claim, and drain (#226), breaking (a claim that names no wait now waits 20 s):
claim_runwaits up towait_seconds, 20 s when absent, for a run to be due (D90, D113). It reads first and submits only when one is due, so an idle claim appends nothing and never reaches the writer; it wakes at a commit, at the earliest due time of its runs, every 5 s, at the end of its wait, at a ledger fault and at a drain, and admits its key again before every submission, so a key revoked or expired mid-wait takes no run (Unauthenticated).Engine::begin_drain()ends claims: a new claim admitted after the drain began answersUnavailablewith no read. A waiting claim samples the drain before each read and considers any claimable run first. If it finds none, it answersUnavailableafter a read whose sample saw the drain. A drain that starts after the sample can cause another read. A claim returns any run the writer gives it. If the writer gives it no run, it continues the wait checks with the same pre-read sample. At the drain check, a drain already sampled ends the claim asUnavailable. A drain first seen after the sample causes another read. A host calls it first as it stops. A claim that waits needs the runtime's timer. The ledger gainschanges() -> Changes, which wakes once each commit is folded and at a failure, andclaimable(&Command, clock) -> Option<Duration>, when a run the claim may take is due by the event clock, read without waiting for a fold; execution rules gainclaim_pairs, which checks a claim asdecidedoes. A drain ends a claim after its admission, so a bad key is stillUnauthenticated.ironflowx-operationsturns on tokio'ssyncandtime. EXE-005 to EXE-008 pass on the engine and through the door. -
Definitions: every rule, replace, list (#220), breaking: a put follows every rule of a function:
max_attempts1–100,first_delay_seconds1–3,600,max_delay_seconds1–86,400 and not below the first delay when both are put, eachInvalid; at most 20 functions per event name,ResourceExhaustedwith a hint that names the event, and at most 1,000 per environment,ResourceExhausted(D100). An identical put still answerschanged: false, past a cap too, and a policy field is stored only if it was put (D99).Operationsgainslist_functions(ListFunctions,functions list, scoperead): functions in name order, 20 a page unless asked, at most 200, with a cursor checked as an events cursor is; an implementation ofOperationsneeds the method, and a match onOperationthe arm. The ledger gainslist_functions, execution ruleslist_functionsandFunctionPage, andExecutionViewtriggered_by,function_countandfunctions_after.ironflowx_events::Refusalgainsresource_exhausted. FUN-002 to FUN-007, FUN-008's row forListFunctionsand EXE-003 pass on the engine and through the door. -
Tracer: functions, runs, a claim, a step, a completed run (#219), breaking: a new pure crate,
ironflowx-execution(execution rules:Command,Entry,decide,fold,ExecutionView,ExecutionTables), with its own purity allowlist,clippy.tomlandwasm32-unknown-unknowncheck.Operationsgainsput_function,get_function,start_run,get_run,claim_run,begin_step,complete_stepandcomplete_run, and the proto three services,FunctionService,RunServiceandExecutionService, served by the door, called byClientand generated as commands; an implementation ofOperationsneeds the eight methods, and a match onOperationthe eight arms.put_functionandstart_runneedwrite, the two readsread, the restexecute.start_runtakes the function's name only, its run's input is JSONnull, and it answersduplicate: false;claim_runcheckswait_secondsand answers at once. Every call that names a lease meets the fence:NotFoundfor a lease that does not parse or names no run,Conflictfor one that is not the run's current execution or that another key holds, each with its hint (D95).complete_runappendsironflowx.run.completedin the record that completes the run (RUN-2, D103). The ledger'sSubmissionis nowEvents(EventSubmission) | Execution(Command)(events' own type is re-exported asEventSubmission),Committed::outcomeanOutcomeof either module, and it gainsget_functionandget_run; a record holds execution entries beside events, kinds 1 to 6 (D112), andread.dbgainsfunctions,triggers,runsandsteps: aread.dbwritten before this is rebuilt at open.ironflowx_events::Refusalgainsinvalid,not_foundandconflict, and no constructor takes anErrorKind; event rules exportcheck_nameandcheck_value.ironflowx_coregainsLeaseand the limitsMAX_FUNCTION_NAME_BYTES,MAX_STEP_NAME_BYTESandMAX_STEP_INPUT_BYTES.functions.featureandexecution.featurejoin the behaviors: FUN-001, FUN-008's rows for these operations, EXE-001, EXE-004, EXE-031 and EXE-039 pass on the engine and through the door, and the rest are@pending, run apart and failing the run if one passes. A record's execution entries read back asironflowx_execution::Stored, whichfoldapplies and from which noEntrycomes out, so a decoded completion joins no decision (RUN-2). The generator makes aoneOfof an answer'soneof, and anallOfof them for several. Pure crates may no longer callstd::env::vars_os,args,args_os,temp_dir,home_dir,current_exeorstd::process::id, andci/check-deps.shreads a pure crate's dependencies with all its features on, for this machine's target and for wasm32. -
The embedder's own call (#229), breaking:
Engine::embedder_call(name)gives the embedding process aCalladmitted as admin by any engine of the same environment and incarnation (a copy of the directory included, as for a key), with no key and no secret on disk, and attributedembedder:<name>: its emits record it, and a key it creates names it increated_by. It returns an error for a nameSubmitAs::embedderrefuses. No door can carry it: theCallholds a grant (Call::with_grant,Call::grant) whose type is private to the engine; another engine's grant, or any other, is refusedUnauthenticated"invalid grant". It is never revoked and never expires (D121). Breaking:Whoami::key_idisOption<KeyId>,Noneonly for an embedder's call, andWhoamiResponse.key_idisoptionalon the wire;KeyInfo::created_byandironflowx_store::KeyRow::created_byareOption<Emitter>, on the wire and incontrol.dba creating key's bare ID, as before, orembedder:<name>, which a 0.3 client fails to decode;ControlPlane::insert_keyandrevoke_keytake who makes the change as&Emitter. What a key's call sends and receives is byte for byte unchanged.describe keys listanddescribe keys createdocumentcreated_byas a key ID orembedder:<name>. New:Emitter::key_id,From<KeyId> for Emitter,ironflowx_authz::may_create_as_embedder.examples/embedemits as itself withembedder_callbeside its seed. -
Scope::ExecuteandErrorKind::Conflict(#218), breaking: a key may holdexecute, which no other scope implies and no operation needs yet (D107). Bootstrap, seed and recovered keys holdread,write,adminandexecute.control.db's format version moves to 2, and a format-1 file, as 0.2 and 0.3 wrote it, is refused at open withFormat(D47).ErrorKind::Conflict(D106) isconflictinErrorInfo,failed_preconditionon the wire, not retryable, exit code 9; no operation answers it yet. The proto client no longer reads a barefailed_preconditionwithoutErrorInfoasInvalid: it is a proxy's,Unknownof a call that changes state andUnavailableof a read (rule 2). A match onScopeorErrorKindneeds the new arm. -
The engine's own events, and hints on refusals (#217):
ironflowx_events::engine_event(EngineEvent) -> EngineEmitmakesironflowx.run.completedorironflowx.run.failed, with version 1, no metadata, no idempotency key and data{"run_id","function","code"}, plus"error":{"code","message"}for a failure;EngineEmitis opaque, andsequencegives engine events the next event sequences, one fresh ID each, refusing data that event rules would refuse from an emit (D118). A client's emit of either name is refused as any owned name still is. Clippy bansengine_eventin every crate butironflowx-execution, andci/no-engine-event.shbacks the ban up by name in every Rust and Markdown file outsideironflowx-events,ironflowx-executionand the docs, doctests, included files and code behind an off feature included, each with a fixture (RUN-14).ci/clippy-bans.shnow also reads.clippy.toml, and no longer counts a ban that is only in a comment, whole-line or trailing. Error codes that begin withironflowx.are the engine's (D111).ironflowx_core::RunIdnames a run, a UUIDv7.Refusalgainshint()andwith_hint(), and the engine copies the hint intoOpError::hint; no event rule gives one yet, so every answer is unchanged. Nothing appends an engine event yet. -
Every record has its own ID (#216), breaking: the ledger's log format moves to 3, and a directory written by 0.1, 0.2 or 0.3 is refused at open with
OpenError::Format(D8). A record is now its envelope (format version, incarnation token, record ID, emitter, time), then its ordered entries, each with its kind; so far every entry is an event (D112). The record ID is a UUIDv7 the writer draws at the append, so what two copies of a directory append after the copy never shares one.read.db'smetakeeps the last applied record's ID, and open compares it with the log's record at that position instead of the newest stored event, so a read store of a diverged copy is rebuilt whatever its last record holds (D117). Open still appends nothing. -
Size limits in one place, and
check_emit(#215):ironflowx_core::limits, re-exported asironflowx_proto::limits, holds the size limits of what a caller sends:MAX_EVENT_NAME_BYTES,MAX_DATA_BYTES,MAX_METADATA_BYTES,MAX_IDEMPOTENCY_KEY_BYTES,MAX_BATCH_EVENTS,MAX_BATCH_BYTES,MAX_KEY_LABEL_BYTESandMAX_EMBEDDER_NAME_BYTES, and the wire'sMAX_MESSAGE_BYTES(16 MiB), whichwire::MAX_MESSAGEnow names. Event rules, credentials, attribution, the door and the proto client read them from there.ironflowx_operations::check_emit(&EmitRequest)runs event rules' checks of one emit without a submit, and answers as event rules answer an emit that admission let through, andironflowx_events::check_emit(&Emit)is the item rules it runs, so an embedder or executor sizes a payload before sending it (D120). The values and every refusal's kind and message are unchanged.ci/no-engine-deps.shnow also checksironflowx-proto, with every feature. -
CI: the app ref (#214):
ci/app-refnames theironflowx/ironflowbranch theconformancejob checks out, asrefs/heads/<branch>, and readsmain. A PR that adds an operation, a scope or an error kind, which the app must follow, sets it to the app's matching branch, so the two land as a pair; the next foundation PR sets it back tomain. A malformed file, one with a trailing space, a CR or a BOM among them, fails the job, naming the file;ci/purity.shproves each refusal with a fixture.ci/check.shfetches the same ref. A PR that changes onlydocs/and Markdown still skips the suite.ci/README.md, "A change the app must follow", says how (D122). No crate changes. -
Docs (#197):
examples/embedkeeps access across a restart. It writes a seed fromgenerate_seed()to a mode-0600 file, synced, before the first open, and passes it to everyEngine::open, instead of taking its key fromOpened::minted, which only a bootstrapping open returns.architecture.md's Engine open says an embedder that restarts should do the same; an engine bootstrapped without a seed takes one at its next open. No behavior change. -
Named Ironflow X: the README, which every crate page on crates.io shows, opens on what foundation is, not as a rewrite of another engine; the keyword
ironflowbecomesironflowxon each crate that has keywords; theironflowxfacade's description reads "Ironflow X foundation crates in one dependency.", and the crates' authors are "Ironflow X contributors". -
Foundation builds no binary (#193), breaking:
ironflowx-binandironflowx-cliare gone, withserve.feature,cli.feature, the server crash test and the release archive pipeline. Theironflowxbinary, its CLI and their release archives are built inironflowx/ironflowfrom 0.4; releases up to 0.3.0 stay in this repository's GitHub releases. A release here publishes crates and a tag, with notes and no assets.ironflowx-doorsandironflowx-codegenstay here and are published from 0.4.0 (D85).events.featureandtenancy.featurestill run through the proto client, against a door over an engine served in the test. Aconformancejob runsironflowx/ironflow's suite against each PR, and awasmjob checks thatironflowx-core,ironflowx-eventsandironflowx-authzbuild forwasm32-unknown-unknown. -
segment-log-core 0.3.0: the ledger's log moves from
=0.2.1to=0.3.0. A writable open of a log with more than one segment now rewrites and flushes the second-newest segment's closing run, so a run found only in the page cache survives a power loss (segment-log ADR 0073); that costs one file open, one small read, one small write and onesync_allat each such open. A log that an older build already rolled past such a run is not repaired; after a power loss, run segment-log's repair tool. Foundation does not turn on segment-log's newsimulationfeature. -
segment-log-core 0.2.1 (#193): the ledger's log moves from
=0.2.0to=0.2.1, with its key-index fixes. -
The facade holds what apps use (#190), breaking:
ironflowxre-exports onlycore,proto,cellandoperations;ironflowx::store,ironflowx::authzandironflowx::eventsare gone (D83).ironflowx-cellre-exportsSubmission,Emit,Event,EventPage,ItemOutcomeandRefusal, so a direct ledger user reaches them asironflowx::cell::*. The three crates stay published. -
One key-expiry rule (#189):
KeyRecord::expired(now)inironflowx-authzdecides expiry for both admission'srecheckandlist_keys' status, so the two cannot disagree. -
Authorizedis private (#189), breaking:ironflowx_operations::Authorizedand itsgrant()are no longer exported. Nothing public took or returned one. TEN-1's compile-fail proof now shows that no other crate can name the type. -
The ledger answers its own reads (#188), breaking:
Ledger::get_eventandLedger::list_eventsreplaceLedger::read, which is now private, withReadStoreandironflowx_cell::StoreError. A caller's query no longer holds the read store's lock beside the writer, andlist_eventschecks a cursor with the ledger's own incarnation token. A direct caller losesevent_by_keyandlast_sequence. -
Ledger errors are Rust errors (#188):
SubmitError,ReadErrorandRefusalimplementDisplayandstd::error::Error, so?intoBox<dyn Error>works. A refusal shows its message. No error implementssource(): the inner error is inDisplay.