Repository navigation
v0.2.0
The second release, 0.2 Tenancy (#64): every call carries a scoped key, and the engine knows who exists. It adds three crates, ironflowx-operations, ironflowx-authz and ironflowx-store, and the facade re-exports them as operations, authz and store. examples/embed bootstraps an engine, emits an event, reads it back with a read key and sees that key's emit refused. A 0.1 ledger directory is refused, not migrated (D39).
- Admin-key recovery (#98):
recover_admin_keystores a fresh admin key in a data directory and returns its secret, once: all three scopes, no expiry, originRecovered, labelledrecovered. It is a host's function, not an operation: reaching the directory is the authority. It blocks, takes no engine lock and works beside a running engine, whose next call accepts the key. On a directory never bootstrapped, or whose bootstrap its transaction finds unmarked, it answersRecoverError::NotReadyand stores no key; acontrol.dbof another format, or a failure to read or write it, isRecoverError::Store. Revoking the last admin key needs no guard (D34). - Open safety (#97): every refused or failed open has a defined outcome, and the engine never deletes a ledger (D32, D40, D41).
EngineErrorgainsNotAnEngineRoot(a bare ledger's directory),Format(acontrol.dbof another format),Orphaned(the control plane was lost) andLedgerMissing(the ledger was lost). A bootstrapping open that fails before its ledger is in place undoes itself. An open that finds a committed but unmarked bootstrap and succeeds finishes it: a minted key, whose secret no open returned, is revoked andOpened::lost_secretset, and, without a seed, a replacement is returned. A seeded bootstrap has no such key. The ledger gainsopen_blockingandopen_existing_blocking, which answers the newOpenError::Missinginstead of creating a ledger. - Everything runs through the engine (#95):
LocalOperations,ironflowx-cell'sOperationsadapter over a bare ledger, is removed, andEngineimplementsOperations, which gainswhoamiandlist_environments, soOperationsalways means credentialed (D36). Import the trait to call the engine's operations. An embedder without keys callsLedger::submitandread. A failed ledger's hint says to reopen the engine. The events scenarios, the crash test (D23) andexamples/embedrun through an engine. - Seeds (#96):
Engine::opentakes an optional seed, a key the host supplies to be the bootstrap key, and then mints none. On a later open, a seed with a new key ID revokes the current seed and takes its place, leaving other keys alone; a revoked seed opens and stays revoked.Opened::seedreportsSeedState::CurrentorRevoked. A malformed seed isEngineError::MalformedSeed, before anything is read; one whose key ID is already another key's isSeedConflict, and no key changes (D33). Each write of an open holds the root's lock until it ends, even when the open is cancelled. - Expiry sticks, and the key cap (#94): a key refused as expired has its expiry recorded, and from then on is never accepted again, whatever the clock does later, across restarts too. If recording fails, the refusal is the same, but a clock set back can accept the key until a later refusal records it (D42). At most 1,000 created keys per environment hold a slot, until each is revoked or its expiry is recorded; at the cap
create_keyanswers the newErrorKind::ResourceExhausted, retryable after a revoke (D44). - List and revoke keys (#93):
list_keyspages newest first, 100 keys by default and 1,000 at most, with each key's label, scopes, origin, creator, times and status, never a secret.revoke_keykeeps the row, and the key is refused from its next call (D35). A key change whose calling key was revoked or expired meanwhile isUnauthenticatedand changes no key, except that a calling key that only expired has its expiry recorded (D42, D43). A failed control-plane read or write isUnavailable, retryable at once, except a failure to record an expiry (D44); the engine stays open, and key operations work while the ledger isUnavailable. - Scoped keys (#92):
create_keytakes scopes (readunless asked otherwise), an optional expiry and an optional label, and returns the secret once, in aCreatedKey, whoseKeyInfosays what the key is, itsKeyOrigin(in core) included. A key holds no scope its creator lacks and expires no later than its creator (D27, D28). Every operation's scope comes from one exhaustiverequired_scope(D37); without it a call is the newErrorKind::PermissionDenied, and its hint names the scope (D31). A key is refused from its expiry on, by the ledger's clock. - Bad keys (#108): no key, or an empty one, is
Unauthenticated"authentication required". A malformed key is "invalid API key", with a hint naming the key format. An unknown key, a wrong secret and another engine's key get one identical answer with no hint, as a revoked or expired key does; a key of another environment or incarnation is refused by both the lookup andverify(D29, D30). - Emit and read with a key (#107): the engine's
emit,emit_batch,get_eventandlist_eventsadmit the key on every call, with no cache. Each event records the key that emitted it, askey:<key-id>, taken from the verified grant; a lint confinesGrant::submit_asto the engine (D36). - Fixed: secrets in freed memory (#124): parsing and minting a key leave no copy of its secret in freed heap memory (TEN-3). Which keys are accepted does not change.
- Engine tracer (#91): three new crates.
ironflowx-operationsholds the engine.Engine::openlocks the root, bootstraps a fresh data directory in one control-plane transaction, builds the ledger in staging and renames it into place, and returns the bootstrap key's secret once.ironflowx-authzholds the credentials: theixk_key format, its SHA-256KeyDigestcompared in constant time, andverify.ironflowx-storeis the control plane,control.db. A call carrying the key is admitted (parse, look up, verify) and can askwhoamiandlist_environments. Core gainsTenantId,ProjectId,Scope,Address,Secret(zeroed on drop, not printable or cloneable),ErrorKind::Unauthenticatedandretryable().Call::with_keyarrives andCalllosesClone;OpErrorgainshint. The behaviors runner runs every feature file and checks each file's count;tenancy.featurelands with ACC-001, 002, 003 and 009 running. D38, D45 and D46. - Attribution (#90): every event records who emitted it. Core gains
KeyId,EmitterandSubmitAs;Ledger::submittakes aSubmitAsbeside the unchangedSubmission,ironflowx_events::foldtakes the record'sEmitter, and both event types gainemitted_by(D36). The ledger format moves to 2, so a 0.1 directory answersFormat(D39). A lint confinesSubmitAs::keyto the credentials crate. - README and crate pages (#63, #102): the README states the purpose and what 0.2 is, and shows the architecture with the crate and emit-then-read diagrams. Its links and images are absolute, so they work on crates.io; 0.1.0's example link there is broken. The emit-then-read diagram shows the committed head and applied position as
p + 1, as the code does.ironflowx-core's andironflowx-proto's pages name what they gain. - Ledger (#65): at most 16 submissions wait for the writer; more callers wait for a slot (D24).
opentakes a new<dir>/ledger.lock(D25), so a sealed log, whose own lock is released, still answersLockedto a second opener. A read store whose newest event disagrees with the log is rebuilt. With an empty log, a read store whose applied position cannot be read answersIoand is kept, and one with recorded progress answersCorruptbefore genesis is written.opensyncs the parent of each directory it creates. If the writer dies, a submission queued or being decided answersUnavailable, notUnknown; only one whose append began answersUnknown. - Docs: the C3 and restart diagrams no longer show a pending view or a rollback, and the restart diagram writes the applied position as one past the record. The
Corruptrunbook adds the case where the ledger refuses a record, and narrows when segment-log'srepair truncaterefuses a class F plan. A sealed log's first append makes readsUnavailabletoo. The emit-read diagram's fold runs after the ack, not asynchronously.invariants.md: the public-API check covers every workspace crate, and__fault-pointsis an opt-in no published crate enables, not one no build can enable. - Crash test (#89): the fault hook and
FaultPointmove intoironflowx-core, behind its own__fault-points, whichironflowx-cell's forwards to; no behavior change.ci/no-fault-points.shallows a published crate to turn on a dependency's__fault-pointsonly from its own feature of that name (D23). - Crash test (#99): kills inside a bootstrap, its undo, a finishing open and a seed rotation, each with one defined outcome (TEN-9, TEN-11, TEN-12); the child opens with the parent's seed, and tells it each key it is about to store over a socket of their own (D23). Every event's emitter is checked.
ironflowx-storeandironflowx-operationsgain the hidden__fault-points; no behavior change. - Crash test (#100): kills before and after the commits of
create_key,revoke_keyand a recorded expiry, and once each is answered (TEN-11, TEN-13). A created key is told to the parent before its commit, so that exact key is proven listed, or not; with__fault-points, the hook is told its secret too (TEN-3's stated exception). No behavior change. - Tenancy close-out (#101): a test searches an engine's data directory, while it runs and after close, and all its process prints, and finds no secret (TEN-3).
control.db's format is 1, its schema pinned by a test (D47). The check that no error type holds aSecretreads rustdoc's JSON, private fields included, and the API checks of LED-9, TEN-4 and TEN-8 see through public aliases, callables and generics. No behavior change. - Docs gaps: the facade is in the modules table;
Ledger::openandreadshow theirSend + 'staticbounds and runtime panics, and the Interfaces section points atpublic-api/for the full API. Documented: cancelling an admitted submit can still commit; a panickingreadquery fails the ledger; IDs and tokens parse only in canonical lowercase; a cursor past every sequence lists from the newest; the ledger format version; thearbitrary_precisionkey (D12). D8 names the environment ID; D25 records whyledger.lockexists. Two Open-table rows, each with a new test: a record that does not decode, and a log without a genesis record. The 0.1 coverage sweep leavesdocs/for a pinned link. - Dependencies (D26):
tokio,rusqliteandgetrandomare caret ranges, not exact pins, so an embedder can use a later compatible release.serde_jsonandsegment-log-corestay exact. - Glossary: defines submission, writer, read store, fold, sealed log, idempotency key, environment reference and fault point; Cell is marked not built in 0.1; the event clock stamps every record after the genesis record. The docs say "record" and "position" for the ledger's own, keeping "log record" and "log offset" for the segment log's, and "fault point" replaces "kill point".