owenloop 0.5.13 → 0.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project are documented here. The format is based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.5.14](https://github.com/typicalday/owenloop/compare/v0.5.13...v0.5.14) (2026-08-21)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **engine:** let a sealed collection be consumed without deadlocking a multi-step def ([#269](https://github.com/typicalday/owenloop/issues/269)) ([e3be862](https://github.com/typicalday/owenloop/commit/e3be8627a227a9e5fc134306e935ec816eafcb00))
13
+
7
14
  ## [0.5.13](https://github.com/typicalday/owenloop/compare/v0.5.12...v0.5.13) (2026-08-21)
8
15
 
9
16
 
package/README.md CHANGED
@@ -226,7 +226,9 @@ A step can emit any number of elements at runtime; a `map` step runs once per
226
226
  element, and a `reduce` step runs once after they're all in (or, with a
227
227
  suffixed reduce, once every element's own per-element output is in). See
228
228
  [`docs/authoring.md`](docs/authoring.md#consume--produce-grammar) and
229
- [`research.yaml`](examples/workflows/research.yaml).
229
+ [`research.yaml`](examples/workflows/research.yaml). A rejected collection
230
+ seal can be re-emitted and resealed; rejected members are recovered by an
231
+ authorized retract, as described in the authoring guide.
230
232
 
231
233
  ### Composition — `include:` and `calls:`
232
234
 
package/dist/src/model.js CHANGED
@@ -654,6 +654,52 @@ export function memberRetractFirings(def, arts) {
654
654
  }
655
655
  return firings;
656
656
  }
657
+ /**
658
+ * Return the bare collection member that would be terminally removed by
659
+ * retracting an indexed debt. A bare member maps to itself; a suffixed map
660
+ * child maps back to its bare member, whose retraction cascades to that child.
661
+ * Non-indexed debts, including collection seals, have no member-retract
662
+ * recovery path.
663
+ */
664
+ function retractableMemberPath(path) {
665
+ const element = parseElement(path);
666
+ return element ? elementPath(element.stem, element.index) : undefined;
667
+ }
668
+ /** Whether a modeled authority retraction can clear this stalled debt. */
669
+ function retractClearsDebt(path, retractFirings) {
670
+ const memberPath = retractableMemberPath(path);
671
+ return memberPath !== undefined && retractFirings.some((firing) => firing.outputs[0] === memberPath);
672
+ }
673
+ /**
674
+ * A remaining output of the stalled debt's own producer or of an upstream
675
+ * producer is not unrelated-line progress. One worker may separately commit
676
+ * singleton and collection outputs, but that does not make a downstream
677
+ * schema-stalled sibling output `stuck`.
678
+ */
679
+ function progressMovesAnotherBranch(def, path, arts, progressFirings) {
680
+ const producer = arts.get(path)?.producer;
681
+ if (producer === undefined)
682
+ return progressFirings.length > 0;
683
+ const sameLine = new Set([producer]);
684
+ const pending = [producer];
685
+ while (pending.length > 0) {
686
+ const stepName = pending.pop();
687
+ const step = def.steps.find((candidate) => candidate.name === stepName);
688
+ if (!step)
689
+ continue;
690
+ for (const consume of step.consumes) {
691
+ for (const candidate of def.steps) {
692
+ if (!candidate.produces.some((produce) => produce.stem === consume.stem))
693
+ continue;
694
+ if (!sameLine.has(candidate.name)) {
695
+ sameLine.add(candidate.name);
696
+ pending.push(candidate.name);
697
+ }
698
+ }
699
+ }
700
+ }
701
+ return progressFirings.some((firing) => !sameLine.has(firing.step));
702
+ }
657
703
  /**
658
704
  * Every firing eligible *right now* — inputs satisfied AND an owed/rejected
659
705
  * output to discharge. This is the scheduling gate (§11.4): necessary, not
@@ -1995,8 +2041,12 @@ function eligibleOutcomes(def, arts, firing) {
1995
2041
  const el = parseElement(outPath);
1996
2042
  const isMember = !!el && el.suffix === '';
1997
2043
  const outcomes = [];
1998
- if (stem && !el) {
1999
- // collection producer (plain step with collection output) — emit-seal path
2044
+ // A mixed producer commits its singleton outputs separately before it emits
2045
+ // and seals its collection. `plainOutputs()` intentionally orders those
2046
+ // singletons before the seal, so only the seal is the collection verb; the
2047
+ // runtime still permits a consumer to judgment-reject that green seal.
2048
+ if (stem && !el && outPath === sealPath(stem)) {
2049
+ // collection producer's actual seal output — emit-seal path
2000
2050
  outcomes.push('emit-seal');
2001
2051
  return outcomes;
2002
2052
  }
@@ -2407,7 +2457,11 @@ export function modelCheck(def, opts = {}) {
2407
2457
  // a worker firing. It is separate from eligibleFirings so a rejected map
2408
2458
  // input still has the later retract move the runtime permits.
2409
2459
  const retractFirings = memberRetractFirings(def, node.arts);
2410
- const firings = [...status.eligible, ...callsFirings, ...retractFirings];
2460
+ // Member retractions remain real successor transitions, including in the
2461
+ // zero-move branch below. They are recovery authority actions, though, not
2462
+ // ordinary worker/calls progress on another branch for `stuck` reporting.
2463
+ const progressFirings = [...status.eligible, ...callsFirings];
2464
+ const firings = [...progressFirings, ...retractFirings];
2411
2465
  // Non-done state with no eligible firings: classify by recomputing
2412
2466
  // eligibility as if every freeze/stall were lifted and idle time had
2413
2467
  // elapsed. If retry or time would make a producer eligible, this is an
@@ -2424,11 +2478,15 @@ export function modelCheck(def, opts = {}) {
2424
2478
  }
2425
2479
  continue;
2426
2480
  }
2427
- // The state HAS eligible firings (the line can still move). If a brake tripped
2428
- // on some *other* branch, record it as an informational stuck state. A no-moves
2429
- // stall state never reaches here (it `continue`d above), so no state is ever
2430
- // listed in both `stuck` and `stallStates`/`deadlocks`.
2431
- if (status.debts.some((d) => d.stalled)) {
2481
+ // A state is stuck only if ordinary work (or a machine child discharge) can
2482
+ // still progress while another debt is irrecoverably stalled. A retract-only
2483
+ // transition is intentionally explored but is authority recovery, not
2484
+ // unrelated-branch progress; likewise a stalled indexed debt that an
2485
+ // authorized member retract clears is recoverable rather than stranded.
2486
+ // A no-moves state never reaches here, so it is never also a stall/deadlock.
2487
+ if (status.debts.some((debt) => debt.stalled
2488
+ && !retractClearsDebt(debt.path, retractFirings)
2489
+ && progressMovesAnotherBranch(def, debt.path, node.arts, progressFirings))) {
2432
2490
  report.stuck.push({ path: node.path });
2433
2491
  }
2434
2492
  // Respect maxDepth
package/docs/authoring.md CHANGED
@@ -894,6 +894,13 @@ suffixed reduce (`src[*].child`) can fan in on a map's per-element output
894
894
  instead of the bare elements. See [`research.yaml`](../examples/workflows/research.yaml)
895
895
  for a runnable example.
896
896
 
897
+ Recovery is deliberate: a consumer of `src[*]` can judgment-reject a green
898
+ seal, re-offering the producer to emit more items and seal again. If a bare
899
+ member itself is rejected, it is not regenerated at that index; a consumer
900
+ authorized by its consume edge should `retract` it instead, which also removes
901
+ its indexed children. See [the collection design](design.md#11-collections)
902
+ for the lifecycle details.
903
+
897
904
  ## Artifact values are JSON, and secrets don't belong in them
898
905
 
899
906
  An artifact's `value` is always a JSON object (`Record<string, unknown>`,
package/docs/design.md CHANGED
@@ -231,6 +231,13 @@ order-independent — re-running `settle()` on a healthy graph yields no ops.
231
231
  - **§11.8** — the forward cascade (above).
232
232
  - **§11.9** — the three reject kinds (above): judgment, validation (§19), structural.
233
233
 
234
+ A green seal is a normal artifact for authority purposes: a consumer of
235
+ `src[*]` may judgment-reject it. That reopens the collection producer, which
236
+ may emit additional members and seal again; `emit` only refuses while the seal
237
+ is currently green. A judgment-rejected bare member is different: its index is
238
+ not rebuilt, so an authorized consumer `retract`s it to remove it from the
239
+ surviving set. Retraction cascades to indexed map children.
240
+
234
241
  ## §12 Concurrency
235
242
 
236
243
  - **§12.1 versions** — each artifact carries a monotonic version; a green bumps it.
@@ -1043,6 +1050,14 @@ read-only context never grants member-retract authority. Applying it terminally
1043
1050
  retracts the member and lets the normal cascade retract its indexed map
1044
1051
  children, removing them from a reduce's surviving-member set.
1045
1052
 
1053
+ Retract transitions remain in the reachability graph, including when they are
1054
+ the only move that prevents a deadlock. They do not, by themselves, make a
1055
+ stalled debt an unrelated-branch `stuck` state: a retract-only state is
1056
+ authority recovery, and an indexed stalled debt clearable by an authorized
1057
+ member retract is recoverable rather than stranded. Ordinary worker progress
1058
+ on another branch can still report `stuck`; scalar parallel-workflow controls
1059
+ remain subject to that finding.
1060
+
1046
1061
  **Stall states vs true deadlocks.** A reachable, non-done state with zero
1047
1062
  available transitions is classified into exactly ONE of two mutually exclusive
1048
1063
  buckets, by recomputing eligibility with every freeze lifted and with an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "description": "Deterministic rails for agentic workflows. Declare steps and dependencies; the engine guarantees order, redoes what changes invalidate, and stops what keeps failing — instead of hoping the agent follows through.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "typicalday",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "description": "Claude Code driver for owenloop — cross-harness shift and conduct skills driven by the owenloop CLI, plus one hub control-plane MCP server backing an author skill and a fallback worker, for conducting and authoring workflows against your hosted owenloop server.",
5
5
  "author": {
6
6
  "name": "Typical Day"
@@ -7,7 +7,7 @@
7
7
  "mcp"
8
8
  ],
9
9
  "env": {
10
- "OWENLOOP_PLUGIN_VERSION": "0.5.13"
10
+ "OWENLOOP_PLUGIN_VERSION": "0.5.14"
11
11
  }
12
12
  }
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owenloop",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "description": "Codex plugin for the owenloop workflow engine.",
5
5
  "skills": "./skills/",
6
6
  "mcpServers": "./.mcp.json"
@@ -6,7 +6,7 @@
6
6
  "mcp"
7
7
  ],
8
8
  "env": {
9
- "OWENLOOP_PLUGIN_VERSION": "0.5.13"
9
+ "OWENLOOP_PLUGIN_VERSION": "0.5.14"
10
10
  },
11
11
  "env_vars": [
12
12
  "HOME",