Releases: davccavalcante/alkaline
Releases · davccavalcante/alkaline
[PUBLISHED ON NPMJS] @takk/alkaline@1.0.0
STATUS: PUBLISHED ON NPMJS. This version was published to the npm registry on 2026-06-18T17:54:34Z with provenance attestation. View on npm: https://www.npmjs.com/package/@takk/alkaline/v/1.0.0
[1.0.0] - 2026-06-18T14:11:10Z
Initial stable release. Embeddable, zero-runtime-dependency durable execution for Massive Intelligence (IM) agents and non-human entities (NHEs): the durable workflow kernel you import instead of operate.
Added
Durable runtime
createRuntime(options)anddefineWorkflow(definition): an in-process, event-sourced engine that runs a workflow to a terminal state or a stable suspension and survives a crash between any two ticks.ctx.step(name, fn, options): a memoized step. On replay the recorded result is returned without re-running the effect; the successful outcome is therefore exactly-once.- Deterministic clock reads
ctx.now(),ctx.random(),ctx.uuid(), recorded and replayed verbatim, plus an injectableClockand a seededmanualClockfor reproducible runs. ctx.setStateand per-workflowqueriesfor read-only inspection of a live or suspended execution.
Opt-in retry policy
- A zero-dependency
RetryPolicy(maxAttempts,backoffMs,factor,maxBackoffMs) and aretryablepredicate, configurable per step, per workflow, or per runtime. - Retry gives at-least-once execution of a step's effect while the memoized result keeps the successful outcome exactly-once. The default is a single attempt so a non-idempotent step never repeats by surprise. The attempt count is recorded in the step's history event, and the backoff delay is injectable for deterministic tests.
Loop prevention
- Native graph cycle detection via depth headers: a workflow that re-enters its own ancestry fails with
ERR_CYCLE_DETECTED, and a child chain past the configured depth fails withERR_DEPTH_EXCEEDED. - An enforced token budget:
ctx.spend(tokens, label)halts the execution withERR_BUDGET_EXCEEDEDthe moment a charge would pass the declared budget.
Signals, queries, lifecycle, and continue-as-new
ctx.waitForSignal,runtime.signal,runtime.query,runtime.pause,runtime.resume, andruntime.cancel.- Child workflows via
ctx.child, with a re-entrancy-guarded scheduler that blocks a parent on a suspended child and wakes it on completion. ctx.continueAsNew(input): ends and restarts the same execution id with fresh input and an empty history, bounding long-horizon runs that would otherwise saturate a workflow log.
Swappable, rechargeable state cells (the battery)
- A
StateStorecontract with four shipping cells, all zero-dependency:createMemoryStore(universal),createSqliteStore(built-innode:sqlite, Node 22.5+), and the dependency-injectedcreatePostgresStoreandcreateRedisStore, which take the client you already use and bundle no driver. runtime.swapStorehot-swaps the cell andmigrateStorerecharges contents from one cell into another.
Multi-agent task board
createBoard(subpath@takk/alkaline/board): the NPM-standalone equivalent of the Hermes Agent Kanban. Tasks with explicit states (todo,in_progress,blocked,done,failed), claim and heartbeat, lease-based zombie reclaim, a cycle-checked dependency link graph, comments, and an append-only event log.
Entry points and tooling
- Nine library entry points: core,
./store,./sqlite,./postgres,./redis,./board,./replay,./mcp,./edge. The edge entry omits the SQLite cell and imports no Node built-in. ./replay:inspectExecution,formatTrace,summarizeHistory, andhistoryDivergencefor reading and debugging a durable trace../mcp:durableToolandcallTool, wrapping a Model Context Protocol tool call as a memoized, budget-charged step.- CLI
alkaline(list,show) over a durable store.
Quality
- 69 tests across 13 suites passing under Vitest 4, green on Node 20, 22, and 24.
- Coverage: statements 88%, lines 88%, functions 93%, branches 73%.
- TypeScript strict mode at maximum under TypeScript 6, lint and format clean under Biome 2,
publintclean,are-the-types-wrongclean across all nine entry points. - All four state-store cells pass a shared conformance suite plus a suspend-and-resume workflow; the Postgres and Redis cells run against faithful in-memory client fakes.
- The core, edge, board, replay, store, postgres, and redis bundles are verified free of any Node built-in; only the SQLite cell references
node:sqlite, lazily.
Security
- Published with
--provenance(SLSA attestation by GitHub Actions). Consumers can verify vianpm view @takk/alkaline --json | jq .dist.attestations. - The durable
FailureInfodrops error stack traces. The Postgres and Redis cells issue only parameterized commands. See SECURITY.md.
Honest scope
- Alkaline gives deterministic replay with divergence detection, not a sandbox: keep non-determinism inside the context and replay is faithful. It follows a single-writer model, the SQLite of durable workflows; distributed multi-writer leasing and a real-server Postgres and Redis integration matrix are on the roadmap.
Licensing
- Licensed under the Apache License, Version 2.0. The
NOTICEfile ships in the tarball alongsideLICENSE.
Engines
- Node
>=20.0.0. Tested on Node 20, 22, and 24.