# tay v0.7.0 - Table of Contents

> Public-preview single-node durable job engine with fail-closed recovery

## Pages

- [Tay](readme.md)
- [Changelog](changelog.md)
- [Commercial licensing](commercial-licensing.md)
- [Local executor protocol v1](protocol.md)
- [Storage and recovery contract](storage.md)
- [Operations](operations.md)
- [Compatibility and limits](compatibility.md)

## Modules

- [Tay](Tay.md): An embedded background job engine with an authoritative append-only log.
Start an Engine explicitly; application startup only validates configuration
and starts an empty supervisor. The log is authoritative, while ETS indexes
and execution state are disposable projections rebuilt after full recovery.
- [Tay.Application](Tay.Application.md): Starts Tay's storage-free supervision foundation.
- [Tay.Config](Tay.Config.md): Loads and validates Tay's foundation configuration without storage I/O.
- [Tay.Diagnostics](Tay.Diagnostics.md): Locked, existing-only offline physical and Event replay diagnostics.
- [Tay.Engine](Tay.Engine.md): One generation's semantic command owner and sole private-index owner.
The log is authoritative. Live producers use the same pure Event transition
model as recovery; callback execution never runs in this process.

- [Tay.Engine.Admission](Tay.Engine.Admission.md): Fixed-slot, fixed-byte-quota cooperative client admission. No payload is sent
before a monitored reservation is granted. Submitted slots outlive callers.
The public ETS table holds only reservation/status metadata, never job state.
It is not a security boundary against hostile code in the same VM.

- [Tay.Engine.CompactionConfig](Tay.Engine.CompactionConfig.md): Finite validated automatic compaction policy.
- [Tay.Engine.CompactionEstimate](Tay.Engine.CompactionEstimate.md): Conservative volatile policy accounting; never filesystem authority or free space.
At most 128 oldest hourly terminal buckets survive. Discarding contributions
only reduces known expiry and thus increases the candidate upper bound.

- [Tay.Engine.CompactionEvents](Tay.Engine.CompactionEvents.md): Bounded, payload-free structured compaction events emitted through Logger.
- [Tay.Engine.CompactionPolicy](Tay.Engine.CompactionPolicy.md): One per-Engine asynchronous evaluator. It owns no storage capability and never
replays history. A single tokenized timer is rearmed only after a result; a
generation notification invalidates an outstanding estimate, not a publication.

- [Tay.Engine.CompactionReplay](Tay.Engine.CompactionReplay.md): Derives volatile V1 terminal times during the existing locked startup replay.
- [Tay.Engine.Config](Tay.Engine.Config.md): Validated, non-persisted Engine configuration. No storage is opened here.
- [Tay.Error](Tay.Error.md): Bounded API error. Unknown outcomes carry the stable job ID and the captured
administrative revision, never args or storage handles. A revision is runtime
context for explicit reconciliation, not permission to retry automatically.

- [Tay.Event](Tay.Event.md): Production Event v1 semantic codec. The runtime Event struct is not serialized;
only the approved six exact string-keyed payload schemas are encoded. State
and registry-independent decoding implements the Phase 3 EventDecoder boundary.

- [Tay.Event.Value](Tay.Event.Value.md): Canonical inert Event v1 values. `{:bytes, binary}` is an internal tag-07
carrier, not a general tuple encoding; Event schemas restrict its placement.
Measurement validates/budgets input before materializing output. Decoding
detaches retained strings from their backing frame and consumes exactly once.

- [Tay.Execution.Clock](Tay.Execution.Clock.md): Runtime clock boundary. Wall time determines eligibility; monotonic time only
measures callback deadlines and bounded wakeups. Neither is called by replay.
A trusted test provider may implement the same two zero-argument callbacks.

- [Tay.Execution.LocalFence](Tay.Execution.LocalFence.md): VM-local exclusion between execution generations of the same STORE_ID.
- [Tay.Execution.Outcome](Tay.Execution.Outcome.md): Constant-size classification and construction of the single atomic finish
Event. Raw callback results, exit reasons and exception objects are discarded;
this module never invokes Inspect, Exception callbacks or user serialization.
The Engine applies the existing pure transition validator before every append.

- [Tay.Execution.Registry](Tay.Execution.Registry.md): Resolves an inert persisted worker key through the trusted runtime map only.
Resolution never converts text to atoms, loads code, or participates in replay.
A missing mapping or currently unloaded callback blocks dispatch, not history.

- [Tay.Execution.Retry](Tay.Execution.Retry.md): Live Event v1 retry producer. Draws unbiased bounded integer jitter once;
the resulting absolute due time is persisted, never redrawn during replay.
Entropy exhaustion/failure is an infrastructure error, never a worker outcome.

- [Tay.Executor.Protocol](Tay.Executor.Protocol.md): Small, transport-neutral codec for the public Executor Protocol v1.
- [Tay.Executor.SocketPath](Tay.Executor.SocketPath.md): Deterministic local Executor Protocol v1 socket discovery.
- [Tay.Job](Tay.Job.md): A runtime job description, never a persisted representation.
- [Tay.JobID](Tay.JobID.md): Stable 128-bit random job identity; never a storage sequence or clock.
- [Tay.State.Projection](Tay.State.Projection.md): Private disposable indexes. Only the owning Engine may read or update them.
- [Tay.State.Transition](Tay.State.Transition.md): The sole pure Event v1 lifecycle model, shared by live commands and replay.
Prepare performs all business validation; apply binds only a validated physical
position. There is no time, randomness, registry, ETS or I/O in this module.
Candidate limits are operational accounting budgets, not format validity/RSS.

- [Tay.Storage](Tay.Storage.md): Explicit administrative initialization; ordinary Engine recovery never bootstraps.
- [Tay.Storage.CRC32C](Tay.Storage.CRC32C.md): Internal, pure reference CRC-32C / Castagnoli implementation.
- [Tay.Storage.ColdCopy](Tay.Storage.ColdCopy.md): Exclusive whole-store cold backup and restore.
- [Tay.Storage.Native](Tay.Storage.Native.md): Internal, versioned filesystem Port protocol. Calls run only in the Port owner.
Every uncertain operation poisons this connection; it is never retried.
The helper is the sole holder of locks and writable descriptors.

- [Tay.Storage.Reader](Tay.Storage.Reader.md): Physical store discovery and topology validation. No repair or projection.
- [Tay.Storage.Record](Tay.Storage.Record.md): Pure Tay v1 physical framing and integrity codec.
- [Tay.Storage.Recovery](Tay.Storage.Recovery.md): Non-destructive recovery of existing initialized v1 stores.
- [Tay.Storage.Recovery.Error](Tay.Storage.Recovery.Error.md): Bounded recovery diagnostics. No error authorizes repair or prefix publication.
- [Tay.Storage.Recovery.EventDecoder](Tay.Storage.Recovery.EventDecoder.md): Explicit semantic capability boundary for recovery, not a physical Record codec.
- [Tay.Storage.Segment](Tay.Storage.Segment.md): Physical v1 segment container. See the Phase 2 segment RFC for the byte contract.
- [Tay.Storage.V2.Authority](Tay.Storage.V2.Authority.md): Pure Store-v2 authority metadata. These bytes do not by themselves authorize
publication; the native owner must durably create and revalidate the files.

- [Tay.Storage.V2.Codec](Tay.Storage.V2.Codec.md): Pure Store-v2 payload codec. Record-v1 framing supplies the type/schema,
sequence and CRC; this module defines only the bounded semantic payloads.

- [Tay.Storage.V2.Epoch](Tay.Storage.V2.Epoch.md): Pure Store-v2 epoch construction and semantic replay over supplied bytes.
Filesystem ownership, digest pinning and CURRENT publication are deliberately
outside this module; callers must supply fully pinned segment contents.

- [Tay.Storage.V2.Publisher](Tay.Storage.V2.Publisher.md): Stop-the-world Store-v2 candidate construction and publication inside the
sole Writer/native-owner process. The source remains pinned and never loses
bytes to make candidate space. A return after CURRENT publication is verified
by an independent Store-v2 replay.

- [Tay.Storage.V2.Reader](Tay.Storage.V2.Reader.md): Store-v2 recovery through the lock-owning native session. No path is opened
through File; every read is pinned, positional, bounded and revalidated.

- [Tay.Storage.V2.Reclaimer](Tay.Storage.V2.Reclaimer.md): Best-effort post-CURRENT reclamation. Only the predecessor named by the
independently recovered current manifest (or its exact adoption intent) is
passed to the native helper. Failure is deferred, never a pointer rollback.

- [Tay.Storage.V2.Reducer](Tay.Storage.V2.Reducer.md): Pure Store-v2 logical replay. Physical positions are deliberately absent from
revision, cycle, execution and availability state.

- [Tay.Storage.V2.Retention](Tay.Storage.V2.Retention.md): Shared normative schema-1 terminal-retention validation and time arithmetic.
- [Tay.Storage.V2.Snapshot](Tay.Storage.V2.Snapshot.md): Pure canonical snapshot planning. No storage operation occurs here.
- [Tay.Storage.V2.V1Migration](Tay.Storage.V2.V1Migration.md): Pure V1-to-V2 semantic projection for a completely validated V1 record stream.
It retains the V1 reducer alongside V2 as an exact per-step oracle. Physical
sequence is checked but never reused as a V2 logical revision or FIFO value.

- [Tay.Storage.Writer](Tay.Storage.Writer.md): Internal physical storage session with a supervised native Port.
- [Tay.Supervisor](Tay.Supervisor.md): The deliberately empty root supervisor for Tay's application.
- [Tay.Worker](Tay.Worker.md): The callback contract for a worker that accepts a `Tay.Job`.

## Mix Tasks

- [mix tay.storage.backup](Mix.Tasks.Tay.Storage.Backup.md): Creates an exclusive cold backup of a stopped Tay store.
- [mix tay.storage.init](Mix.Tasks.Tay.Storage.Init.md)
- [mix tay.storage.inspect](Mix.Tasks.Tay.Storage.Inspect.md)
- [mix tay.storage.restore](Mix.Tasks.Tay.Storage.Restore.md): Restores a cold backup after verifying its external SHA-256 catalog.

