1. Introduction

A work unit is the atomic unit of agent activity in an Agential Semioverse Repository. The work-units-and-chains sketch defines work units as skill invocations with footprints and chains as partially ordered sets of work units whose outputs feed later inputs. This specification provides the full formal treatment: how work units are created, what structure they carry, how they transition through lifecycle states, how their effects are tracked and composed, and what invariants they must satisfy.

We assume familiarity with the base structures of the interactive semioverse and the agential semioverse: the complete Heyting algebra with modal closure and trace comonad ; the definable operator algebra ; fragments as finitely generated modal-temporal Heyting subalgebras; partial states ; the composite closure operator with least fixed point ; thing handles with semantic seeds ; footprints ; interaction operators as monotone endomorphisms of ; agent profiles ; internal agents ; the skill calculus with terms ; policy-restricted interpretation ; and the agential closure operator with its least fixed point .

We also reference the multi-agent coordination specification for regions, the skill manifests specification for manifest structure, the error envelopes specification for failure semantics, the petri-nets-and-lean specification for the Petri net model, and the closure operators as API contracts idea for the connection between skill invocation and closure.


2. Work-Unit Structure

Definition 2.1 (Work unit). A work unit is a tuple:

where:

  • is a unique identifier drawn from a countable set ;
  • is the executing agent, with profile ;
  • is a skill identifier from the agent’s skillset, referencing a manifest entry with id, input schema , and output schema ;
  • is a concrete value satisfying the skill’s input schema;
  • is the region the unit operates on, in the sense of Definition 2.1 of the multi-agent coordination specification (a downward-closed subset of the fragment lattice);
  • is a precondition: a downward-closed set of partial states in which the unit may fire;
  • is a postcondition: an upward-closed set of partial states guaranteed after successful execution;
  • is a provenance record (Section 5);
  • is the current lifecycle state.

Remark 2.2 (Precondition closure direction). The precondition is downward-closed: if the unit may fire in state and , then it may also fire in . This reflects the monotonicity of the base interaction operators — if a skill can act on a state, it can act on any state with less information. The postcondition is upward-closed: successful execution guarantees that the resulting state is at least as informative as the postcondition.

Remark 2.3 (Region constraint). The region constrains the work unit to modify only fragments within . This connects to the region-restricted skillset from the multi-agent coordination specification (Definition 3.1): the skill interpretation must act as the identity on all fragments .


3. Work-Unit Lifecycle States

Definition 3.1 (Lifecycle state machine). The lifecycle of a work unit is a finite state machine with states and transitions:

No other transitions are permitted. The terminal states are and .

Definition 3.2 (Transition rules). The transitions are governed by:

  1. Activation (): A work unit may transition from to when:

    • the current partial state (the precondition holds), and
    • the authorization context satisfies for the referenced skill, and
    • the policy holds (policy authorization is satisfied).
  2. Completion (): A work unit transitions from to when:

    • the skill interpretation terminates normally, producing , and
    • the resulting state (the postcondition holds), and
    • the effect report (Section 4) is well-formed.
  3. Failure (): A work unit transitions from to when:

    • the skill interpretation produces a failure value (returns with failure marks), or
    • the resulting state does not satisfy (postcondition violation), or
    • a tool call within the skill interpretation fails and the failure propagates to the top level.

Lemma 3.3 (Lifecycle determinism). The lifecycle state machine is deterministic given the skill interpretation: for a fixed initial state , input , and skill , exactly one of the transitions from fires.

Proof. The skill interpretation either terminates normally or produces a failure value. If it terminates normally, the postcondition either holds or it does not. These cases are exhaustive and mutually exclusive, so the transition from is determined by the interpretation.

Note that this determinism applies to state transitions, not to policy selection: the policy may return a set of admissible operators, introducing nondeterminism at the boundary. Once the skill and input are fixed and execution begins, the subsequent lifecycle is deterministic.


4. Effect Reports

Definition 4.1 (Effect report). Every work unit that reaches status must produce an effect report as part of . An effect report is a tuple:

where:

  • is the set of paths created by the work unit;
  • is the set of paths modified (but not created or deleted);
  • is the set of paths deleted;
  • maps each created or modified path to its (before, after) content hash pair;
  • maps each path with changed metadata to a structured diff of its frontmatter;
  • is the set of (source, target) link pairs added;
  • is the set of (source, target) link pairs removed.

The sets , , and are pairwise disjoint.

Definition 4.2 (State hash). For a partial state and a path , let denote the semantic content associated with in (the restriction of to the fragment generated by the thing handle at ). Two states differ at if .

Invariant 4.3 (Effect completeness). The effect report must account for every change to the partial state. For all paths :

In words: if the semantic content at path differs between the pre-execution state and the post-execution state , then the effect report declares as created, modified, or deleted.

Invariant 4.4 (Effect soundness). The effect report must not claim changes that did not occur. For all paths :

Lemma 4.5 (Effect reports characterize state differences). The completeness and soundness invariants together imply that is exactly the set of paths at which the state changed:

Proof. Completeness gives the direction; soundness gives the direction.

Remark 4.6 (Relationship to the Agential Semioverse). The Agential Semioverse specification (Section on Effect Reports and Artifacts) requires that every skill execution produce an effect report describing its interaction with . This section formalizes that requirement as the completeness and soundness invariants, giving them a precise characterization in terms of state hashes.


5. Provenance Traces

Definition 5.1 (Tool call record). A tool call record is a tuple:

where identifies the tool, and are the concrete values passed to and returned from the tool, is the wall-clock time of the call, and records whether the call succeeded.

Definition 5.2 (Provenance trace). A provenance trace for a work unit is a tuple:

where:

  • is the work unit’s identifier;
  • is the executing agent;
  • is the skill identifier;
  • are timestamps bounding the execution;
  • is the ordered sequence of tool calls made during execution;
  • records state hashes at selected points during execution;
  • references the chain (Section 6) containing this work unit, if any.

Lemma 5.3 (Trace as provenance history). The trace is an element of the provenance category for each fragment in the work unit’s region . Specifically, the sequence of tool calls in the trace refines into a provenance history in the sense of Section 9 of the interactive semioverse specification: each tool call corresponds to an introduction step (evaluation of an interaction term), and the sequence of tool calls records a finite sequence of construction steps for the semantic elements produced.

Proof sketch. Each tool call in the trace corresponds to an evaluation of an interaction term whose denotation is a semantic generator in . The ordered list of tool calls thus determines a provenance history. The state snapshots provide the refinement ordering: coarser snapshots refine into finer ones as execution proceeds. The result is a well-formed object in .

Lemma 5.4 (Functorial composition of traces). Trace construction is functorial: composing work units composes their traces. Given work units with preceding in a chain (Section 6):

where denotes concatenation in the provenance history category (Lemma 9.1 of the Interactive Semioverse specification: refinement morphisms respect concatenation because provenance histories compose functorially).


6. Work-Unit Chains

Definition 6.1 (Chain). A chain is a tuple:

where is a finite set of work units and is a partial order on that set. The relation means that must reach status before may transition from to .

The dependency relation encodes data flow: if the outputs of are among the inputs of , then .

Definition 6.2 (Well-formedness). A chain is well-formed if the dependency order is acyclic (equivalently, since it is a partial order by definition, well-formedness is automatically satisfied; the constraint here rules out the degenerate case of a cycle introduced by construction error in the implementation).

Definition 6.3 (Satisfiability). A chain is satisfiable if for each work unit in the chain, the conjunction of postconditions of all predecessors of implies the precondition of :

In words: the guarantees made by earlier work units are sufficient to enable later ones.

Definition 6.4 (Completeness). A chain is complete if every work unit in the chain eventually reaches a terminal status ( or ).

Remark 6.5 (Connection to sequential composition). A chain with a total dependency order is a sequential composition in the sense of Definition 6.2 of the multi-agent coordination specification, where each handoff predicate checks that ‘s postcondition holds. A chain with an antichain structure (no dependencies between units) corresponds to parallel composition , provided the regions are pairwise disjoint.


7. Chain Validation

Chain validation connects the work-unit lifecycle to the Petri net model from the petri-nets-and-lean specification.

Definition 7.1 (Petri net encoding of a chain). Given a chain , construct a Petri net as follows:

  • For each work unit , create a transition .
  • For each precondition element of (each resource or state property required), create an input place .
  • For each postcondition element of , create an output place .
  • For each dependency , add arcs from to (the output of becomes an input to ).
  • The initial marking places one token in each input place corresponding to externally provided resources.
  • The target marking places tokens in all output places of work units with no successors.

Theorem 7.2 (Chain validity as Petri net reachability). A chain is valid if and only if the target marking of is reachable from the initial marking.

Proof sketch. The forward direction: if the chain is valid, then each work unit fires in dependency order. In the Petri net, this corresponds to firing each transition when its input places have tokens (from externally provided resources or from outputs of predecessors). The firing sequence reaches the target marking. The reverse direction: if the target marking is reachable, there exists a firing sequence for all transitions. Each transition firing corresponds to a work unit completing with its precondition satisfied and its postcondition established.

Definition 7.3 (Conflict). Two work units in a chain conflict if they modify the same path:

and they do not have a dependency relation ( and ) and their regions are not disjoint ().

Lemma 7.4 (Conflict-free chains produce well-defined composite effects). A valid chain with no conflicts produces a composite effect report (Section 8) that is independent of the order in which concurrent work units are evaluated.

Proof. Concurrent work units (those without a dependency relation) either operate on disjoint regions (and hence commute by Theorem 4.1 of the multi-agent coordination specification) or are conflict-free by assumption. In both cases, the composite effect report is the same regardless of evaluation order.


8. Effect Composition

Effect reports compose in two ways, depending on whether the work units execute in parallel or in sequence.

Definition 8.1 (Parallel effect composition). Given two work units with disjoint regions (), define the parallel composite effect report:

where union is taken componentwise:

and similarly for metadata deltas, links added, and links removed. Disjointness of regions ensures the component maps have disjoint domains, so the unions are well-defined (no key collisions).

Definition 8.2 (Sequential effect composition). Given two work units with , define the sequential composite effect report:

where denotes sequential composition with the following rules:

  • If creates a path and modifies : the composite reports as created with content hash . The intermediate hash is absorbed.
  • If creates a path and deletes : the composite omits (net effect is no change).
  • If modifies a path and modifies : the composite reports as modified with content hash .
  • If modifies a path and deletes : the composite reports as deleted.
  • If deletes a path and creates : the composite reports as modified (content changed via delete-then-recreate).
  • In all other cases (paths touched by only one unit), the individual effect report entry passes through unchanged.

Lemma 8.3 (Composition preserves completeness and soundness). If and each satisfy the completeness and soundness invariants (Invariants 4.3 and 4.4), then and also satisfy both invariants.

Proof sketch. For parallel composition with disjoint regions: each path is affected by at most one work unit, so completeness and soundness transfer directly from the individual reports. For sequential composition: the case analysis in Definition 8.2 is exhaustive (it covers all combinations of create/modify/delete between the two units), and each case produces an effect entry if and only if the initial state differs from the final state. The “create then delete” case correctly produces no entry because the net state change is zero.


9. Idempotency and Re-execution

Definition 9.1 (Idempotent work unit). A work unit with skill and input is idempotent if executing it twice from the same initial state produces the same final state:

where projects to the state component.

Lemma 9.2 (Idempotency as closure). The idempotency of a work unit corresponds to the idempotency of the closure operator when restricted to the skill’s region. A skill invocation that computes a closure is idempotent by construction: once the fixed point is reached, re-applying the closure operator produces the same result.

Proof. Let be a skill whose interpretation computes (the closure operator restricted to region ). Then:

The second equality holds by idempotency of (every closure operator is idempotent). The first and third equalities hold by the assumption that the skill interprets as the restricted closure.

Remark 9.3 (Connection to closure operators as API contracts). The closure operators as API contracts idea proposes treating every skill invocation as computing a closure: a seed produces candidates, a law is applied until stable, and the fixed point is returned. Idempotent work units are the operational realization of this idea. When a skill is structured as a closure, the soundness guarantee (“output is closed under the law”) and the idempotency guarantee (“re-run returns the same fixed point”) follow from the closure properties. Re-executing an idempotent work unit is a no-op because the fixed point is already reached.

Remark 9.4 (Practical consequence). Not all skills are idempotent. A skill that appends a log entry or increments a counter is not idempotent. Skills that normalize content, check style, or enforce structural invariants are natural candidates for idempotent design. When designing skills, prefer idempotent formulations where the domain permits; this makes re-execution safe and simplifies error recovery (a failed chain can be restarted from the last successful work unit without undoing intermediate effects).


10. Audit Trail

Definition 10.1 (Audit trail). An audit trail for a sequence of work units is an ordered sequence of effect reports:

indexed by the order in which the work units completed (for sequential composition) or by a linearization consistent with the dependency order (for chains with parallel components).

Invariant 10.2 (Audit faithfulness). The sequential composition of all effect reports in the audit trail, applied to the initial state , produces the current state :

where is the sequential effect composition from Definition 8.2, applied from left to right.

Lemma 10.3 (Audit trail as provenance witness). The audit trail is a constructive witness that the current vault state was produced by admissible operations. Each entry in the trail corresponds to a completed work unit with a provenance trace (Section 5); the sequential composition of all traces forms a single provenance history in for every affected fragment .

Proof sketch. Each effect report satisfies the completeness and soundness invariants (Invariants 4.3 and 4.4), so it faithfully records the state change produced by its work unit. Each provenance trace is an element of (Lemma 5.3). By functorial composition (Lemma 5.4), the concatenation of traces is itself a provenance history. The audit trail therefore provides, for every fragment and every element in the current state, a construction record showing which agent applied which skill with which input to produce .

Remark 10.4 (Operational counterpart). The audit trail is the operational counterpart of the provenance category from the Interactive Semioverse. Where is defined abstractly as a small category of provenance histories with refinement morphisms, the audit trail is a concrete sequence of effect reports that an implementation can produce, store, and query. The faithfulness invariant ensures that the concrete trail is consistent with the abstract category.


11. Relationship to Other ASR Concepts

This section connects the work-unit lifecycle to other specifications in the Agential Semioverse Repository theory.

Multi-agent coordination. Work units are the atomic transitions that agents apply to the partial state. The multi-agent coordination specification defines how these transitions compose when multiple agents are active: region restriction (Definition 3.1 of that spec) constrains each work unit to a region; the non-interference theorem (Theorem 4.1) guarantees that work units on disjoint regions commute; and the coordination correctness conditions (Definition 10.1—10.4 of that spec) apply to chains of work units via the Petri net encoding (Section 7 of this spec).

Skill manifests. Each work unit references a skill by its manifest id. The manifest (as specified in the skill manifests spec) provides the input schema , the output schema , the runtime declaration, and the required scopes. The work unit’s field must decode against ; the effect report is part of ; and the authorization check at activation uses the manifest’s scopes.

Error envelopes. When a work unit transitions to , it produces an error envelope as part of . The envelope’s semantic code identifies the failure kind (e.g., , , ). The work unit’s status field is set to ; the trace records the tool call that produced the failure; and the chain can use the error envelope’s category to decide whether to abort, retry, or skip the failed unit.

Agent-skill interaction. The agent-skill interaction specification establishes the skill-first principle: agents act through skills, and skills are maintained as first-class artifacts. Work units operationalize this principle by wrapping each skill invocation in a structured lifecycle with preconditions, postconditions, effect reports, and provenance. The skill improvement process described in that specification (improving a skill in response to a gap) can itself be modeled as a work unit with a meta-skill that operates on the skill manifest.

Closure operators as API contracts. The closure operators as API contracts idea describes the mathematical structure of skill execution: each invocation computes a closure. Section 9 of this specification formalizes the connection: an idempotent work unit is one whose skill interpretation computes a closure, and re-execution is a no-op because the fixed point is already reached. The “closure contract” of a skill — soundness, minimality, monotonicity, idempotency — translates into invariants on the work unit’s effect report and postcondition.