Skip to content

v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Nov 17:06
· 50 commits to main since this release
1225d65

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 ironflowx facade share 0.4.0. The release includes the first packages of ironflowx-execution, ironflowx-doors and ironflowx-codegen, with MIT licences and crate READMEs. Binary releases come from ironflowx/ironflow. The release rehearsal builds the packaged HTTP door and wire-enabled proto in dependency order, without protoc or buf.

  • 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_step of 0 sent alone answers Invalid, 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: StartRunRequest gains input, JSON text under event data's rules (null when absent), and idempotency_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 is Conflict (D102). Execution rules' Command::StartRun gains input and idempotency_key, Entry gains StartKey (kind 19; kind 2 keeps its bytes), ExecutionView gains started and runs_before, and ExecutionTables start_key. Operations gains list_runs (runs list, scope read): runs newest first, filtered by function, status and event_id, as RunSummary, without input or output, with its body failures, and its error as a ListedError, 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 gain list_runs, RunFilter, RunPage, RunSummary and ListedError, and event rules check_key, the ledger list_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, is ironflowx_core::cursor. read.db gains start_keys and indexes for the list, so a store from before is rebuilt at open.

  • Failure and retries (#225), breaking: FailStep and FailRun report 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.code is optional, and the event's error object omits it when absent. Existing coded ledger entries and protobuf field values keep their encoding. GetRun includes body_failures. The operations require execute and generate executions fail-step and executions fail.

  • Steps, replay and once (#224), breaking: begin_step answers 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 with ironflowx.step_order, naming the position and both names, and ironflowx.run.failed in the same record (RUN-2, RUN-4); so does complete_run with fewer steps than were begun, checked before the open step; step 1,001 fails the run with ironflowx.too_many_steps. Each answers ended. A step an earlier execution began and left open runs again, recorded for the new execution with its first begin's name, once and input; a once one is not begun again but fails with ironflowx.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, BeginStepResponse and CompleteStepResponse gain Failed { error } (failed, StepFailed), RunError gains step: Option<StepRef { position, name }>, and RunEnd gains error, so a struct literal of either needs the field and a match on either answer the arm. Execution rules gain Entry::StepFailed (kind 12), a RunFailed that names a step (kind 13; kinds 1 to 11 are written and read as before), Begun::Failed, Outcome::StepFailed, Step::error and Step::resolved, RunError::step, StepRef, RunEnd::error, and ExecutionTables::fail_step; begin_step of a table takes a step the run counts, open, as begun again, and fold refuses a second outcome for a step, and a begin of one with an outcome, as the store's error. read.db's runs and steps gain columns, so one written before this is rebuilt at open. EXE-011, EXE-012, EXE-014 to EXE-018 (EXE-017's rows but fails 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 running run 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' decide takes the open time beside now, and ExecutionView::claimable takes it beside now, which a test view must implement; execution rules gain MAX_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-exports Event and NewEvent; Run::input and Entry::RunCreated::input become origin: Origin, Claim::input becomes origin: Origin<Event>, and ExecutionView gains triggered and run_event, which a test view must implement. ironflowx-cell re-exports Origin. On the wire, Run gains event_id and Claim gains event, absent for a started run, whose input stays; a run an event created has no input. ironflowx_proto::Run gains event_id: Option<EventId> and Claim event: 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's runs holds an input or an event ID: a read.db written 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 running run 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 with ironflowx.executor_lost and appends ironflowx.run.failed in 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). Operations gains heartbeat (Heartbeat, executions heartbeat), which renews 1–100 leases in one record and answers each on its own, a renewed deadline or its refusal, and release_run (ReleaseRun, executions release), which makes the run due now, counting nothing, and answers its due time, the same when sent again (D109); both need execute and meet the fence, so an implementation of Operations needs the two methods, and a match on Operation the two arms. Until the next claim supersedes it, a released execution's calls answer Conflict, "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. Run gains lost_leases and error (RunError { code, message }) on the wire and in Rust. Execution rules gain Command::Heartbeat and Release, the entries LeaseRenewed, LeaseLost, Released and RunFailed (kinds 7 to 10; private fields, made only by decide with its event), Outcome::Renewed and Released, RunError, and Run::lease_seconds, lost_leases and error; ExecutionView::claimable takes how many runs to skip, the ones a claim has failed so far; ExecutionTables gains renew, lose_lease, release and fail_run, and claim takes the lease's length, which fold reads off a claim's deadline and record time, so a claim a log already holds reads the same. read.db's runs gains 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 for Heartbeat and ReleaseRun pass, 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_run waits up to wait_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 answers Unavailable with no read. A waiting claim samples the drain before each read and considers any claimable run first. If it finds none, it answers Unavailable after 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 as Unavailable. 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 gains changes() -> Changes, which wakes once each commit is folded and at a failure, and claimable(&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 gain claim_pairs, which checks a claim as decide does. A drain ends a claim after its admission, so a bad key is still Unauthenticated. ironflowx-operations turns on tokio's sync and time. 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_attempts 1–100, first_delay_seconds 1–3,600, max_delay_seconds 1–86,400 and not below the first delay when both are put, each Invalid; at most 20 functions per event name, ResourceExhausted with a hint that names the event, and at most 1,000 per environment, ResourceExhausted (D100). An identical put still answers changed: false, past a cap too, and a policy field is stored only if it was put (D99). Operations gains list_functions (ListFunctions, functions list, scope read): functions in name order, 20 a page unless asked, at most 200, with a cursor checked as an events cursor is; an implementation of Operations needs the method, and a match on Operation the arm. The ledger gains list_functions, execution rules list_functions and FunctionPage, and ExecutionView triggered_by, function_count and functions_after. ironflowx_events::Refusal gains resource_exhausted. FUN-002 to FUN-007, FUN-008's row for ListFunctions and 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.toml and wasm32-unknown-unknown check. Operations gains put_function, get_function, start_run, get_run, claim_run, begin_step, complete_step and complete_run, and the proto three services, FunctionService, RunService and ExecutionService, served by the door, called by Client and generated as commands; an implementation of Operations needs the eight methods, and a match on Operation the eight arms. put_function and start_run need write, the two reads read, the rest execute. start_run takes the function's name only, its run's input is JSON null, and it answers duplicate: false; claim_run checks wait_seconds and answers at once. Every call that names a lease meets the fence: NotFound for a lease that does not parse or names no run, Conflict for one that is not the run's current execution or that another key holds, each with its hint (D95). complete_run appends ironflowx.run.completed in the record that completes the run (RUN-2, D103). The ledger's Submission is now Events(EventSubmission) | Execution(Command) (events' own type is re-exported as EventSubmission), Committed::outcome an Outcome of either module, and it gains get_function and get_run; a record holds execution entries beside events, kinds 1 to 6 (D112), and read.db gains functions, triggers, runs and steps: a read.db written before this is rebuilt at open. ironflowx_events::Refusal gains invalid, not_found and conflict, and no constructor takes an ErrorKind; event rules export check_name and check_value. ironflowx_core gains Lease and the limits MAX_FUNCTION_NAME_BYTES, MAX_STEP_NAME_BYTES and MAX_STEP_INPUT_BYTES. functions.feature and execution.feature join 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 as ironflowx_execution::Stored, which fold applies and from which no Entry comes out, so a decoded completion joins no decision (RUN-2). The generator makes a oneOf of an answer's oneof, and an allOf of them for several. Pure crates may no longer call std::env::vars_os, args, args_os, temp_dir, home_dir, current_exe or std::process::id, and ci/check-deps.sh reads 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 a Call admitted 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 attributed embedder:<name>: its emits record it, and a key it creates names it in created_by. It returns an error for a name SubmitAs::embedder refuses. No door can carry it: the Call holds a grant (Call::with_grant, Call::grant) whose type is private to the engine; another engine's grant, or any other, is refused Unauthenticated "invalid grant". It is never revoked and never expires (D121). Breaking: Whoami::key_id is Option<KeyId>, None only for an embedder's call, and WhoamiResponse.key_id is optional on the wire; KeyInfo::created_by and ironflowx_store::KeyRow::created_by are Option<Emitter>, on the wire and in control.db a creating key's bare ID, as before, or embedder:<name>, which a 0.3 client fails to decode; ControlPlane::insert_key and revoke_key take who makes the change as &Emitter. What a key's call sends and receives is byte for byte unchanged. describe keys list and describe keys create document created_by as a key ID or embedder:<name>. New: Emitter::key_id, From<KeyId> for Emitter, ironflowx_authz::may_create_as_embedder. examples/embed emits as itself with embedder_call beside its seed.

  • Scope::Execute and ErrorKind::Conflict (#218), breaking: a key may hold execute, which no other scope implies and no operation needs yet (D107). Bootstrap, seed and recovered keys hold read, write, admin and execute. 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 with Format (D47). ErrorKind::Conflict (D106) is conflict in ErrorInfo, failed_precondition on the wire, not retryable, exit code 9; no operation answers it yet. The proto client no longer reads a bare failed_precondition without ErrorInfo as Invalid: it is a proxy's, Unknown of a call that changes state and Unavailable of a read (rule 2). A match on Scope or ErrorKind needs the new arm.

  • The engine's own events, and hints on refusals (#217): ironflowx_events::engine_event(EngineEvent) -> EngineEmit makes ironflowx.run.completed or ironflowx.run.failed, with version 1, no metadata, no idempotency key and data {"run_id","function","code"}, plus "error":{"code","message"} for a failure; EngineEmit is opaque, and sequence gives 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 bans engine_event in every crate but ironflowx-execution, and ci/no-engine-event.sh backs the ban up by name in every Rust and Markdown file outside ironflowx-events, ironflowx-execution and the docs, doctests, included files and code behind an off feature included, each with a fixture (RUN-14). ci/clippy-bans.sh now also reads .clippy.toml, and no longer counts a ban that is only in a comment, whole-line or trailing. Error codes that begin with ironflowx. are the engine's (D111). ironflowx_core::RunId names a run, a UUIDv7. Refusal gains hint() and with_hint(), and the engine copies the hint into OpError::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's meta keeps 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 as ironflowx_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_BYTES and MAX_EMBEDDER_NAME_BYTES, and the wire's MAX_MESSAGE_BYTES (16 MiB), which wire::MAX_MESSAGE now 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, and ironflowx_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.sh now also checks ironflowx-proto, with every feature.

  • CI: the app ref (#214): ci/app-ref names the ironflowx/ironflow branch the conformance job checks out, as refs/heads/<branch>, and reads main. 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 to main. A malformed file, one with a trailing space, a CR or a BOM among them, fails the job, naming the file; ci/purity.sh proves each refusal with a fixture. ci/check.sh fetches the same ref. A PR that changes only docs/ and Markdown still skips the suite. ci/README.md, "A change the app must follow", says how (D122). No crate changes.

  • Docs (#197): examples/embed keeps access across a restart. It writes a seed from generate_seed() to a mode-0600 file, synced, before the first open, and passes it to every Engine::open, instead of taking its key from Opened::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 ironflow becomes ironflowx on each crate that has keywords; the ironflowx facade'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-bin and ironflowx-cli are gone, with serve.feature, cli.feature, the server crash test and the release archive pipeline. The ironflowx binary, its CLI and their release archives are built in ironflowx/ironflow from 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-doors and ironflowx-codegen stay here and are published from 0.4.0 (D85). events.feature and tenancy.feature still run through the proto client, against a door over an engine served in the test. A conformance job runs ironflowx/ironflow's suite against each PR, and a wasm job checks that ironflowx-core, ironflowx-events and ironflowx-authz build for wasm32-unknown-unknown.

  • segment-log-core 0.3.0: the ledger's log moves from =0.2.1 to =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 one sync_all at 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 new simulation feature.

  • segment-log-core 0.2.1 (#193): the ledger's log moves from =0.2.0 to =0.2.1, with its key-index fixes.

  • The facade holds what apps use (#190), breaking: ironflowx re-exports only core, proto, cell and operations; ironflowx::store, ironflowx::authz and ironflowx::events are gone (D83). ironflowx-cell re-exports Submission, Emit, Event, EventPage, ItemOutcome and Refusal, so a direct ledger user reaches them as ironflowx::cell::*. The three crates stay published.

  • One key-expiry rule (#189): KeyRecord::expired(now) in ironflowx-authz decides expiry for both admission's recheck and list_keys' status, so the two cannot disagree.

  • Authorized is private (#189), breaking: ironflowx_operations::Authorized and its grant() 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_event and Ledger::list_events replace Ledger::read, which is now private, with ReadStore and ironflowx_cell::StoreError. A caller's query no longer holds the read store's lock beside the writer, and list_events checks a cursor with the ledger's own incarnation token. A direct caller loses event_by_key and last_sequence.

  • Ledger errors are Rust errors (#188): SubmitError, ReadError and Refusal implement Display and std::error::Error, so ? into Box<dyn Error> works. A refusal shows its message. No error implements source(): the inner error is in Display.