@shardworks/spider-apparatus 0.1.270 → 0.1.272

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.
Files changed (70) hide show
  1. package/README.md +58 -25
  2. package/dist/block-types/animator-paused.d.ts.map +1 -1
  3. package/dist/block-types/animator-paused.js +15 -10
  4. package/dist/block-types/animator-paused.js.map +1 -1
  5. package/dist/engines/anima-session.d.ts.map +1 -1
  6. package/dist/engines/anima-session.js +4 -0
  7. package/dist/engines/anima-session.js.map +1 -1
  8. package/dist/engines/implement-loop.d.ts +6 -6
  9. package/dist/engines/implement-loop.js +26 -26
  10. package/dist/engines/implement-loop.js.map +1 -1
  11. package/dist/engines/implement.d.ts.map +1 -1
  12. package/dist/engines/implement.js +3 -0
  13. package/dist/engines/implement.js.map +1 -1
  14. package/dist/engines/index.d.ts +1 -1
  15. package/dist/engines/index.d.ts.map +1 -1
  16. package/dist/engines/index.js +1 -1
  17. package/dist/engines/index.js.map +1 -1
  18. package/dist/engines/review.d.ts.map +1 -1
  19. package/dist/engines/review.js +3 -0
  20. package/dist/engines/review.js.map +1 -1
  21. package/dist/engines/revise.d.ts.map +1 -1
  22. package/dist/engines/revise.js +3 -0
  23. package/dist/engines/revise.js.map +1 -1
  24. package/dist/engines/step-session.d.ts +32 -0
  25. package/dist/engines/step-session.d.ts.map +1 -0
  26. package/dist/engines/{piece-session.js → step-session.js} +70 -62
  27. package/dist/engines/step-session.js.map +1 -0
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/rig-view.d.ts +5 -0
  32. package/dist/rig-view.d.ts.map +1 -1
  33. package/dist/rig-view.js +11 -2
  34. package/dist/rig-view.js.map +1 -1
  35. package/dist/spider-test-fixture.d.ts +116 -0
  36. package/dist/spider-test-fixture.d.ts.map +1 -0
  37. package/dist/spider-test-fixture.js +386 -0
  38. package/dist/spider-test-fixture.js.map +1 -0
  39. package/dist/spider.d.ts.map +1 -1
  40. package/dist/spider.js +913 -540
  41. package/dist/spider.js.map +1 -1
  42. package/dist/tools/crawl-continual.d.ts +10 -0
  43. package/dist/tools/crawl-continual.d.ts.map +1 -1
  44. package/dist/tools/crawl-continual.js +24 -9
  45. package/dist/tools/crawl-continual.js.map +1 -1
  46. package/dist/tools/index.d.ts +1 -0
  47. package/dist/tools/index.d.ts.map +1 -1
  48. package/dist/tools/index.js +1 -0
  49. package/dist/tools/index.js.map +1 -1
  50. package/dist/tools/rig-list.d.ts +2 -1
  51. package/dist/tools/rig-list.d.ts.map +1 -1
  52. package/dist/tools/rig-list.js +9 -2
  53. package/dist/tools/rig-list.js.map +1 -1
  54. package/dist/tools/rig-show.d.ts +9 -3
  55. package/dist/tools/rig-show.d.ts.map +1 -1
  56. package/dist/tools/rig-show.js +84 -5
  57. package/dist/tools/rig-show.js.map +1 -1
  58. package/dist/tools/writ-rescue-stuck.d.ts +40 -0
  59. package/dist/tools/writ-rescue-stuck.d.ts.map +1 -0
  60. package/dist/tools/writ-rescue-stuck.js +362 -0
  61. package/dist/tools/writ-rescue-stuck.js.map +1 -0
  62. package/dist/types.d.ts +233 -92
  63. package/dist/types.d.ts.map +1 -1
  64. package/package.json +9 -9
  65. package/src/static/index.html +6 -5
  66. package/src/static/spider-ui.test.ts +437 -28
  67. package/src/static/spider.js +238 -80
  68. package/dist/engines/piece-session.d.ts +0 -32
  69. package/dist/engines/piece-session.d.ts.map +0 -1
  70. package/dist/engines/piece-session.js.map +0 -1
package/README.md CHANGED
@@ -2,7 +2,14 @@
2
2
 
3
3
  The Spider is the guild's rig execution engine. It spawns rigs for open writs, drives engine pipelines to completion, and transitions writs via the Clerk when rigs finish. Each rig is an ordered pipeline of engine instances; the Spider's `crawl()` loop advances that pipeline one step at a time.
4
4
 
5
- The Spider maintains bidirectional CDC cascades between writs and rigs: when a rig reaches a terminal or `stuck` state, the associated writ is transitioned to match; when a writ is cancelled, the associated rig is cancelled (writs transitioning to `completed` or `failed` do not cancel the rig). Engine failures cascade the rig to `stuck` (a non-terminal "needs attention" state) and the writ to `stuck`, preserving the obligation for future retry. Guards in both handlers break the circular cascade path so that a writ cancellation that triggers a rig cancellation does not attempt to re-transition the already-terminal writ.
5
+ The Spider's state model is:
6
+
7
+ - **`EngineStatus`** — `'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'skipped'`. Holds (rate-limit, block-type, retry back-off) are **pending-plus-metadata**, not a distinct state: `status='pending'` + `holdReason` / `holdUntil` / `holdCondition` on the engine instance. `holdReason` is either a registered BlockType id (e.g. `'animator-paused'` — the rate-limit gate) or the sentinel `'retry-backoff'` for purely timer-driven retry holds (no BlockType; cleared when `holdUntil` elapses).
8
+ - **`RigStatus`** — `'running' | 'completed' | 'failed' | 'cancelled'`. Rig status is a **pure projection** of the engine set: running if any engine is non-terminal, failed if any terminal-failed with no running, completed if all terminal-success with at least one completed, cancelled if `cancelledAt` is set. It is never written independently — every engine-state-change goes through a patch-wrapper (`patchRigWithRollup`) that recomputes the status and writes both fields in one transaction.
9
+ - **Retry** — opt-in on engine designs via a nested `retry: { maxAttempts, backoff }` block. Transient failures (session crash, engine throw) retry in place on the same rig up to the design's budget, with exponential back-off. Rate-limit is a hold (no budget consumed); definitional failures (invalid graft, unknown design, non-serializable yields) fail terminally on first observation. Legacy rigs persisted with `'stuck'` / `'blocked'` statuses remain in place — readers tolerate them; no migration.
10
+ - **Attempts** — every engine dispatch appends a row to `attempts[]` carrying `startedAt`, `endedAt`, terminal `status`, optional `error`, `sessionId`, and `yields`. Scalar engine-level `startedAt` / `completedAt` / `error` / `sessionId` / `yields` fields **do not exist** — `attempts[-1]` is authoritative.
11
+
12
+ The Spider maintains bidirectional CDC cascades between writs and rigs: when a rig reaches a terminal state, the associated writ is transitioned to match; when a writ is cancelled, the associated rig is cancelled (writs transitioning to `completed` or `failed` do not cancel the rig). Engine-failure retry now lives inside the rig — only terminal retry exhaustion routes the rig to `failed`, which cascades the writ directly to `phase='failed'`. Guards in both handlers break the circular cascade path so that a writ cancellation that triggers a rig cancellation does not attempt to re-transition the already-terminal writ.
6
13
 
7
14
  Depends on `@shardworks/stacks-apparatus` for rig persistence, `@shardworks/fabricator-apparatus` to look up engine designs, `@shardworks/clerk-apparatus` to transition writs, and `@shardworks/animator-apparatus` to launch quick-engine sessions. Recommends `@shardworks/loom-apparatus` so the Spider's support kit can contribute the `mender` role used by the seal-engine recovery tail.
8
15
 
@@ -31,9 +38,9 @@ const spider = guild().apparatus<SpiderApi>('spider');
31
38
 
32
39
  ### `crawl(): Promise<CrawlResult | null>`
33
40
 
34
- Execute one step of the crawl loop. The Spider evaluates pending work in priority order — collect > processGrafts > checkBlocked > **pause gate** > run > autoUnstick > spawn — and returns a description of the action taken, or `null` if no work was available.
41
+ Execute one step of the crawl loop. The Spider evaluates pending work in priority order — collect > processGrafts > run > autoUnstick > spawn (guarded by the Animator-paused gate) — and returns a description of the action taken, or `null` if no work was available.
35
42
 
36
- The **pause gate** consults the Animator's rate-limit status (via `AnimatorApi.getStatus()`) and short-circuits the `tryRun` and `trySpawn` phases when the Animator is paused AND the persisted `pausedUntil` window has not elapsed. The earlier phases (`tryCollect`, `tryProcessGrafts`, `tryCheckBlocked`) still run so the triggering rate-limit signal is ingested and the `animator-paused` block-type checker can drive auto-resume. When the gate suppresses both dispatch phases and no other phase produced work, `crawl()` returns `null` (today's "no work" signal no new CrawlResult variant).
43
+ Dispatch (inside `tryRun`) is governed by a single **dispatch predicate** that composes four checks per pending engine: status is `'pending'`, every upstream is terminal-success, `holdUntil` is absent or in the past, and if `holdReason` names a registered `BlockType` the BlockType's `check()` returns `'cleared'` (honouring its `pollIntervalMs` against the engine's `lastCheckedAt` stamp). The top-level `isAnimatorPaused()` gate now only guards `trySpawn`; `tryRun` is handled uniformly by the per-engine predicate.
37
44
 
38
45
  ```typescript
39
46
  const result = await spider.crawl();
@@ -49,38 +56,61 @@ CrawlResult variants:
49
56
  | `'rig-spawned'` | Created a new rig for an open writ |
50
57
  | `'engine-started'` | Launched a quick engine's session |
51
58
  | `'engine-completed'` | An engine finished; rig still running |
52
- | `'engine-blocked'` | Engine entered blocked status |
53
- | `'engine-unblocked'` | A blocked engine's condition cleared |
59
+ | `'engine-held'` | Engine transitioned to `'pending'` with a hold (rate-limit, block-type gate) |
60
+ | `'engine-retrying'` | A retryable failure was observed; engine is pending with a back-off `holdUntil` and `attemptCount` was incremented |
54
61
  | `'engine-skipped'` | Engine (and any downstream-only dependents) was skipped due to `when` condition |
55
62
  | `'engine-grafted'` | Engine injected additional engines into the pipeline |
56
- | `'rig-completed'` | Rig reached terminal or stuck state (completed, stuck, failed, or cancelled) |
57
- | `'rig-blocked'` | All forward progress stalled; rig entered blocked status |
58
- | `'gated'` | Spawn was deferred — the writ has outbound `spider.follows` blockers (includes the case where a blocker reached `failed` and the writ was cascaded to `stuck`) |
63
+ | `'rig-completed'` | Rig reached terminal state (`completed`, `failed`, or `cancelled`) |
59
64
  | `'writ-unstuck'` | `autoUnstick` phase returned a previously-Spider-stuck writ to `open` because its recorded blockers resolved |
60
65
 
66
+ A `null` return means no dispatchable candidate was found this tick — either the queue is empty, or every candidate writ was gated on non-terminal blockers. Gate state lives on the writ substrate (`phase` + `status.spider`), not in the `CrawlResult`.
67
+
61
68
  ### Dispatch gating via `spider.follows`
62
69
 
63
70
  Spider contributes a `spider.follows` link kind and consults outbound `spider.follows` links when deciding whether to spawn a rig for an open writ. The gate is evaluated in `trySpawn` before any rig is created:
64
71
 
65
- - If any direct outbound `spider.follows` target is still `new`, `open`, or `stuck` — the writ is held. `trySpawn` emits a `'gated'` result and the writ stays `open` until a later poll.
66
- - If any direct outbound target is `failed` — the writ is cascaded to `stuck`. A `status.spider` record is written with `stuckCause: 'failed-blocker'` and the ids of every failed blocker. The resolution text is `Blocked by failed dependency: <short-id>` (or `Blocked by failed dependencies: …` when plural).
67
- - If the full transitive `spider.follows` walk from the writ visits a cycle — the writ is cascaded to `stuck` with `stuckCause: 'cycle'` and the cycle members as blockers. The resolution text is `Detected spider.follows cycle: <id> <id> <id>`.
72
+ - If any direct outbound `spider.follows` target is still `new`, `open`, or `stuck` — the writ is held. The scan continues to the next candidate so a later, unblocked writ can still dispatch this tick; the gated writ stays `open` and no status is persisted.
73
+ - If any direct outbound target is `failed` — the writ is cascaded to `stuck`. A `status.spider` record is written with `stuckCause: 'failed-blocker'` and the ids of every failed blocker. The resolution text is `Blocked by failed dependency: <short-id>` (or `Blocked by failed dependencies: …` when plural). The scan then continues with the next candidate.
74
+ - If the full transitive `spider.follows` walk from the writ visits a cycle — every cycle member is cascaded to `stuck` with `stuckCause: 'cycle'` and the cycle members as blockers. The resolution text is `Cycle detected in spider.follows graph`. The scan then continues with the next candidate.
68
75
  - Only when every direct outbound target is in a terminal-success state (`completed`, or `cancelled`) does the writ proceed to rig spawn.
69
76
 
70
- Before `trySpawn`, each crawl tick runs an `autoUnstick` pass that re-evaluates every writ whose `status.spider.stuckCause` is one of the dependency-recovery causes (`failed-blocker` or `cycle`). When the recorded cause resolves (all `failed-blocker` ids are now `completed`/`cancelled`, or any `cycle` member has moved out of `open`/`stuck`), the writ is returned to `open` and emits a `'writ-unstuck'` result. Writs stuck with other causes — including `engine-failure` writs (see below) and operator-stuck writs with no `status.spider` slot — are left alone; their recovery is owned by a separate retry clockwork, not by `autoUnstick`.
77
+ Before `trySpawn`, each crawl tick runs an `autoUnstick` pass that re-evaluates every writ whose `status.spider.stuckCause` is one of the dependency-recovery causes (`failed-blocker` or `cycle`). When the recorded cause resolves (all `failed-blocker` ids are now `completed`/`cancelled`, or any `cycle` member has moved out of `open`/`stuck`), the writ is returned to `open` and emits a `'writ-unstuck'` result. Writs stuck without a `status.spider` slot (operator-flagged stucks) are left alone their recovery is owned by the operator, not by `autoUnstick`.
78
+
79
+ ### Engine-level retry (in-place within the rig)
80
+
81
+ Engine designs may declare an opt-in retry policy:
82
+
83
+ ```typescript
84
+ const myEngine: EngineDesign = {
85
+ id: 'my-engine',
86
+ retry: { maxAttempts: 2, backoff: { initialMs: 30_000, maxMs: 600_000, factor: 2 } },
87
+ async run(givens, ctx) { /* … */ },
88
+ };
89
+ ```
90
+
91
+ When an engine observes a retryable failure (session crash, engine throw, `collect()` throw) and the design has remaining budget, the unified failure handler:
92
+
93
+ 1. Finalizes the in-flight `attempts[-1]` row with `status='failed'` and the error message.
94
+ 2. Increments `engine.attemptCount`.
95
+ 3. Sets `engine.status='pending'` with `holdReason='retry-backoff'` and `holdUntil` computed from the back-off policy.
96
+ 4. Leaves downstream engines pending (no cascade-cancel).
71
97
 
72
- ### Engine-failure stuck payload
98
+ The dispatch predicate picks the engine up again once `holdUntil` elapses; a fresh attempt row is appended to `attempts[]`, and the sequence repeats until the attempt succeeds or the budget is exhausted.
73
99
 
74
- When an engine failure takes a rig to `stuck` via the `failEngine` path (session crash, engine throw, graft validation failure, unknown design, unknown block type, invalid block condition, non-JSON-serializable yields), Spider publishes an observability payload to the writ's `status.spider` sub-slot alongside the standard rig → writ CDC transition:
100
+ Retry is **opt-in**. Engine designs without a `retry` block default to `maxAttempts: 0` the first retryable failure is terminal. Definitional failures (invalid graft, unknown design, unknown block type, non-JSON-serializable yields) fail terminally regardless of budget.
75
101
 
76
- - `stuckCause: 'engine-failure'` the single bucket for every engine-cascade failure. Sub-taxonomy lives in `detail`, not in the enum.
77
- - `retryable: boolean` — classified at the `failEngine` call site. `true` for transient failures (session crashes, engine threw an unexpected error) where a fresh attempt may succeed. `false` for definitional failures (invalid graft, unknown design/block type, bad schema, non-JSON-serializable yields) where the same code would reproduce the same failure.
78
- - `detail: string` — freeform human-readable description of the specific failure. Surfaces to the patron UI and analytics, and is the designated place for case-by-case context.
79
- - `observedAt: string` — ISO timestamp of the transition.
102
+ Designs shipping with retry enabled in this commission: `anima-session`, `implement`, `review`, `revise`, `astrolabe.reader-analyst`, `astrolabe.patron-anima`, `astrolabe.decision-review`. All others (including `draft`, `seal`, `manual-merge`, `step-session`, `implement-loop`, `astrolabe.plan-init`, `astrolabe.inventory-check`, `astrolabe.plan-finalize`, `astrolabe.observation-lift`) default to no retry.
80
103
 
81
- The `retryable` flag is informational in this plugin — nothing here acts on it. The retry clockwork (a separate commission) is the sole load-bearing consumer. Dependency-recovery stucks (`failed-blocker` / `cycle`) do not write `retryable` or `detail`; they carry `blockerIds` instead and are serviced by `autoUnstick`.
104
+ ### Terminal engine-failure cascade
82
105
 
83
- `failEngine` writes the rig patch (`status: 'stuck'`) and the writ's `status.spider` payload inside a single `stacks.transaction`. Both land in the same post-commit event batch, so any Phase 2 observer (the retry clockwork in particular) sees a writ stuck transition whose status slot is already fully populated. Producers must not split these two writes across transactions — that would expose a window where a stuck observer reads a slot with stale data.
106
+ When an engine exhausts its retry budget (or observes a definitional failure), the unified failure handler:
107
+
108
+ 1. Finalizes the in-flight attempts[] row.
109
+ 2. Sets `engine.status='failed'`.
110
+ 3. Cascade-cancels every non-terminal engine (both plain pending and pending-with-hold) in one pass.
111
+ 4. The `patchRigWithRollup` wrapper projects `rig.status='failed'` as the natural derivation.
112
+
113
+ The existing rigs→writs CDC handler translates `rig.status='failed'` directly to `writ.phase='failed'` — no intermediate stuck state. The writ's `status.spider` slot is **not written on the engine-failure path**: that slot is reserved for dependency-recovery causes (`failed-blocker`, `cycle`). Engine-level retry has fully absorbed the retry budget that legacy versions of Spider exposed via stuck-with-`retryable=true`.
84
114
 
85
115
  ### `show(id): Promise<RigDoc>`
86
116
 
@@ -213,6 +243,7 @@ A config-level template named `default` overrides the plugin-contributed `spider
213
243
  | `rigTemplateMappings` | `Record<string, string>` | plugin default `{ mandate: 'default' }` | Writ type → template name. Config-level entries override plugin-contributed mappings for the same writ type. Two kits contributing a mapping for the same writ type is a hard error at guild startup; resolve by removing one kit mapping or by overriding here in config (config always wins). |
214
244
  | `maxConcurrentEngines` | `number` | `3` | Maximum number of engines running concurrently across all rigs. When the limit is reached, runnable engines stay in `pending` and new rigs are not spawned until a slot frees. |
215
245
  | `maxConcurrentEnginesPerRig` | `number` | `1` | Maximum number of engines running concurrently within a single rig. Prevents race conditions with rig-local resources. |
246
+ | `engineRetryOverrides` | `Record<string, Partial<EngineRetryConfig>>` | — | Per-design overrides for engine retry policy, keyed by `EngineDesign.id`. The override layers on top of the design's declared `retry`, which in turn layers on top of the kit's built-in defaults (`override > design.retry > built-in defaults`). Validated fail-loud at startup: an unknown `designId` or any malformed field (negative `maxAttempts`, `maxMs < initialMs`, `factor <= 1`, etc.) throws before any engines are scheduled. The map is re-read live from guild config on each retry decision, so guild.json edits take effect on the next retry without restarting the daemon. An override on a design with no declared `retry` block is permitted — it enables retry on a previously fail-fast engine. See `docs/architecture/apparatus/spider.md` for the full shape, validation rules, and a worked example. |
216
247
 
217
248
  ## Rig Templates
218
249
 
@@ -330,9 +361,10 @@ Two kits contributing overlapping entries to a merge registry refuse to start th
330
361
 
331
362
  - `rigTemplateMappings` — two kits mapping the same writ type (including Spider's own plugin-default `mandate → default`)
332
363
  - `blockTypes` — two kits contributing the same block-type id
333
- - Clerk `writTypes` — two kits contributing the same writ type
334
364
  - Fabricator `engines` — two kits contributing the same engine-design id
335
365
 
366
+ (Writ types are no longer kit-merged — every plugin registers its own writ types via `ClerkApi.registerWritType` from its own apparatus's `start()`. A second registration of the same name throws at registration time with `[clerk] registerWritType: duplicate writ type "<name>"`.)
367
+
336
368
  When a collision is detected the guild fails to start with an error naming both contributing plugins and the conflicting key. Operators resolve by removing one of the kit contributions, or — for the Spider sites that support it — by declaring a config-level override in `guild.json["spider"]` (config always wins over any kit contribution, silently). The winner is never selected by kit load order.
337
369
 
338
370
 
@@ -350,10 +382,11 @@ The Spider contributes books, tools, engines, and a role for rig inspection and
350
382
 
351
383
  | Tool | Permission | Description |
352
384
  |---|---|---|
353
- | `rig-list` | `read` | List rigs with optional status/limit filters (returns enriched `RigView[]`) |
354
- | `rig-show` | `read` | Show full detail for a rig by id (returns enriched `RigView`) |
355
- | `rig-resume` | `write` | Manually clear a block on a specific engine |
356
- | `rig-cancel` | `write` | Cancel a running, blocked, or stuck rig |
385
+ | `rig-list` | `read` | List rigs with optional status/limit filters (returns enriched `RigView[]`). `--status` accepts the four current values (`running`/`completed`/`failed`/`cancelled`) **plus** the deprecated legacy values `stuck` and `blocked` for inspecting rigs that predate the engine-level retry reshape. |
386
+ | `rig-show` | `read` | Show full detail for a rig by id. Default `--format text` renders a human-readable CLI view surfacing per-engine attempt count, hold state (`holdReason` / `holdUntil` / `lastCheckedAt`), and the latest attempt's error — the minimum bar the engine-level retry commission calls for. Pass `--format json` for the raw enriched `RigView`. |
387
+ | `rig-resume` | `write` | Manually clear a hold on a specific pending engine |
388
+ | `rig-cancel` | `write` | Cancel a running rig (also tolerates legacy `'stuck'` / `'blocked'` rigs) |
389
+ | `writ-rescue-stuck` | `write` | List, and with `--apply` requeue, writs still stuck under the legacy `engine-failure` cause that predate the engine-level-retry commission. Default lists candidates without mutating; `--apply` transitions each match `stuck → open`, clears its `status.spider` slot, and cancels every legacy `'stuck'` / `'blocked'` rig for that writ. Operator-stuck writs (no `status.spider` slot) and dependency-cause stucks (`failed-blocker` / `cycle`) are never touched. Pass `--id` to scope to a single writ; `--format json` for machine-readable output. |
357
390
  | `crawl` | `write` | Execute a single crawl step |
358
391
  | `crawl-continual` | `write` | Poll `crawl()` in a loop until no work remains |
359
392
 
@@ -1 +1 @@
1
- {"version":3,"file":"animator-paused.d.ts","sourceRoot":"","sources":["../../src/block-types/animator-paused.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,aAAa,CAAC;AAO1D,QAAA,MAAM,uBAAuB,EAAE,SA0B9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"animator-paused.d.ts","sourceRoot":"","sources":["../../src/block-types/animator-paused.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,aAAa,CAAC;AAe1D,QAAA,MAAM,uBAAuB,EAAE,SAwB9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -14,10 +14,19 @@
14
14
  */
15
15
  import { z } from 'zod';
16
16
  import { guild } from '@shardworks/nexus-core';
17
- const conditionSchema = z.object({
17
+ import { isDispatchable } from '@shardworks/animator-apparatus';
18
+ // The outer object is `.optional()` so legacy engines persisted under
19
+ // the pre-`attempts[]` schema — `holdReason: 'animator-paused'` with no
20
+ // `holdCondition` — resolve quietly through `check()` instead of
21
+ // throwing a ZodError that the dispatch predicate's catch logs as a
22
+ // warning. Populated conditions still validate against the inner shape;
23
+ // malformed payloads (e.g. `{ sessionId: 42 }`) are still rejected.
24
+ const conditionSchema = z
25
+ .object({
18
26
  /** Session id that triggered the pause — informational. */
19
27
  sessionId: z.string().optional(),
20
- });
28
+ })
29
+ .optional();
21
30
  const animatorPausedBlockType = {
22
31
  id: 'animator-paused',
23
32
  conditionSchema,
@@ -38,14 +47,10 @@ const animatorPausedBlockType = {
38
47
  return { status: 'pending' };
39
48
  }
40
49
  const status = await animator.getStatus();
41
- if (status.state === 'running')
42
- return { status: 'cleared' };
43
- if (!status.pausedUntil)
44
- return { status: 'cleared' };
45
- if (new Date(status.pausedUntil).getTime() <= Date.now()) {
46
- return { status: 'cleared' };
47
- }
48
- return { status: 'pending' };
50
+ // Delegate to the canonical predicate from the animator package so
51
+ // this checker stays in lockstep with the back-off machine, the
52
+ // crawl-gate, and the Oculus banner.
53
+ return { status: isDispatchable(status) ? 'cleared' : 'pending' };
49
54
  },
50
55
  };
51
56
  export default animatorPausedBlockType;
@@ -1 +1 @@
1
- {"version":3,"file":"animator-paused.js","sourceRoot":"","sources":["../../src/block-types/animator-paused.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAI/C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,2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kC,CAAC;AAIrE,QAAA,MAAM,kBAAkB,EAAE,YAgCzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"anima-session.d.ts","sourceRoot":"","sources":["../../src/engines/anima-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIrE,QAAA,MAAM,kBAAkB,EAAE,YAqCzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -12,6 +12,10 @@
12
12
  import { guild } from '@shardworks/nexus-core';
13
13
  const animaSessionEngine = {
14
14
  id: 'anima-session',
15
+ // Retry budget — transient session crashes retry in-place. This is
16
+ // the design used by the plan-and-ship template's `spec-writer` slot
17
+ // (and any other rig template that summons a generic anima session).
18
+ retry: { maxAttempts: 2 },
15
19
  async run(givens, context) {
16
20
  // Validate required givens
17
21
  if (typeof givens.role !== 'string' || givens.role.length === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"anima-session.js","sourceRoot":"","sources":["../../src/engines/anima-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAK/C,MAAM,kBAAkB,GAAiB;IACvC,EAAE,EAAE,eAAe;IAEnB,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO;QACvB,2BAA2B;QAC3B,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChE,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;QACpF,CAAC;QACD,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpE,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACtF,CAAC;QACD,IAAI,O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,CAAC,CAAC,EAAE;YACvE,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;YAC9E,uEAAuE;YACvE,sEAAsE;YACtE,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAC7D,CAAC;CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,20 +1,20 @@
1
1
  /**
2
2
  * Implement-loop engine — clockwork.
3
3
  *
4
- * Orchestrates sequential execution of piece writs under a mandate.
4
+ * Orchestrates sequential execution of step writs under a mandate.
5
5
  *
6
6
  * On run:
7
- * 1. Queries all open child piece writs of the mandate.
8
- * 2. If pieces exist, grafts piece-session engines for each piece
7
+ * 1. Queries all open child step writs of the mandate.
8
+ * 2. If steps exist, grafts step-session engines for each step
9
9
  * (in mandate child order) with sequential upstream dependencies.
10
- * 3. If no pieces exist, falls through to legacy single-session behavior
10
+ * 3. If no steps exist, falls through to legacy single-session behavior
11
11
  * identical to the original implement engine.
12
12
  *
13
13
  * The engine itself completes immediately with a graft (clockwork engine
14
14
  * returning { status: 'completed', yields, graft }). The grafted
15
- * piece-session engines are then processed sequentially by the Spider.
15
+ * step-session engines are then processed sequentially by the Spider.
16
16
  *
17
- * For the legacy fallback (no pieces), it launches an anima session
17
+ * For the legacy fallback (no steps), it launches an anima session
18
18
  * directly, same as the original implement engine.
19
19
  */
20
20
  import type { EngineDesign } from '@shardworks/fabricator-apparatus';
@@ -1,20 +1,20 @@
1
1
  /**
2
2
  * Implement-loop engine — clockwork.
3
3
  *
4
- * Orchestrates sequential execution of piece writs under a mandate.
4
+ * Orchestrates sequential execution of step writs under a mandate.
5
5
  *
6
6
  * On run:
7
- * 1. Queries all open child piece writs of the mandate.
8
- * 2. If pieces exist, grafts piece-session engines for each piece
7
+ * 1. Queries all open child step writs of the mandate.
8
+ * 2. If steps exist, grafts step-session engines for each step
9
9
  * (in mandate child order) with sequential upstream dependencies.
10
- * 3. If no pieces exist, falls through to legacy single-session behavior
10
+ * 3. If no steps exist, falls through to legacy single-session behavior
11
11
  * identical to the original implement engine.
12
12
  *
13
13
  * The engine itself completes immediately with a graft (clockwork engine
14
14
  * returning { status: 'completed', yields, graft }). The grafted
15
- * piece-session engines are then processed sequentially by the Spider.
15
+ * step-session engines are then processed sequentially by the Spider.
16
16
  *
17
- * For the legacy fallback (no pieces), it launches an anima session
17
+ * For the legacy fallback (no steps), it launches an anima session
18
18
  * directly, same as the original implement engine.
19
19
  */
20
20
  import { guild } from '@shardworks/nexus-core';
@@ -25,15 +25,15 @@ const implementLoopEngine = {
25
25
  const clerk = guild().apparatus('clerk');
26
26
  const writ = givens.writ;
27
27
  const draft = context.upstream['draft'];
28
- // Query all open child piece writs of the mandate
29
- const pieces = await clerk.list({
28
+ // Query all open child step writs of the mandate
29
+ const steps = await clerk.list({
30
30
  parentId: writ.id,
31
- type: 'piece',
31
+ type: 'step',
32
32
  phase: 'open',
33
33
  limit: 100,
34
34
  });
35
- if (pieces.length === 0) {
36
- // ── Legacy fallback: no pieces → single-session implement ──
35
+ if (steps.length === 0) {
36
+ // ── Legacy fallback: no steps → single-session implement ──
37
37
  const animator = guild().apparatus('animator');
38
38
  const prompt = `${writ.body}\n${EXECUTION_EPILOGUE}`;
39
39
  const handle = animator.summon({
@@ -45,23 +45,23 @@ const implementLoopEngine = {
45
45
  });
46
46
  return { status: 'launched', sessionId: handle.sessionId };
47
47
  }
48
- // ── Piece-aware path: graft piece-session engines ──
49
- // Sort pieces by createdAt to maintain manifest order
50
- const sortedPieces = [...pieces].sort((a, b) => a.createdAt.localeCompare(b.createdAt));
51
- // Build a chain of piece-session engines with sequential dependencies.
52
- // Each piece-session depends on the previous one (or on this engine for the first).
48
+ // ── Step-aware path: graft step-session engines ──
49
+ // Sort steps by createdAt to maintain manifest order
50
+ const sortedSteps = [...steps].sort((a, b) => a.createdAt.localeCompare(b.createdAt));
51
+ // Build a chain of step-session engines with sequential dependencies.
52
+ // Each step-session depends on the previous one (or on this engine for the first).
53
53
  const graft = [];
54
54
  let previousEngineId = context.engineId; // 'implement-loop' or whatever the instance id is
55
- for (let i = 0; i < sortedPieces.length; i++) {
56
- const piece = sortedPieces[i];
57
- const engineId = `piece-${i}`;
55
+ for (let i = 0; i < sortedSteps.length; i++) {
56
+ const step = sortedSteps[i];
57
+ const engineId = `step-${i}`;
58
58
  graft.push({
59
59
  id: engineId,
60
- designId: 'piece-session',
60
+ designId: 'step-session',
61
61
  upstream: [previousEngineId],
62
62
  givens: {
63
63
  writ: '${writ}',
64
- piece: piece, // Pass the piece WritDoc directly as a literal value
64
+ step: step, // Pass the step WritDoc directly as a literal value
65
65
  role: givens.role,
66
66
  cwd: `\${yields.draft.path}`,
67
67
  },
@@ -70,16 +70,16 @@ const implementLoopEngine = {
70
70
  }
71
71
  // Return as a SpiderEngineRunResult with graft.
72
72
  // graftTail tells Spider that any engine downstream of implement-loop
73
- // should also wait for the last grafted piece-session to complete.
74
- const lastPieceEngineId = `piece-${sortedPieces.length - 1}`;
73
+ // should also wait for the last grafted step-session to complete.
74
+ const lastStepEngineId = `step-${sortedSteps.length - 1}`;
75
75
  const result = {
76
76
  status: 'completed',
77
77
  yields: {
78
- pieceCount: sortedPieces.length,
79
- pieceIds: sortedPieces.map(p => p.id),
78
+ stepCount: sortedSteps.length,
79
+ stepIds: sortedSteps.map(p => p.id),
80
80
  },
81
81
  graft,
82
- graftTail: lastPieceEngineId,
82
+ graftTail: lastStepEngineId,
83
83
  };
84
84
  return result;
85
85
  },
@@ -1 +1 @@
1
- {"version":3,"file":"implement-loop.js","sourceRoot":"","sources":["../../src/engines/implement-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;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MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,MAAM,MAAM,GAA0B;YACpC,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE;gBACN,SAAS,EAAE,WAAW,CAAC,MAAM;gBAC7B,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACpC;YACD,KAAK;YACL,SAAS,EAAE,gBAAgB;SAC5B,CAAC;QAEF,OAAO,MAAyB,CAAC;IACnC,CAAC;CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"implement.d.ts","sourceRoot":"","sources":["../../src/engines/implement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAKrE;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,usBASuB,CAAC;AAEhD,QAAA,MAAM,eAAe,EAAE,YA4BtB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"implement.d.ts","sourceRoot":"","sources":["../../src/engines/implement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAKrE;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,usBASuB,CAAC;AAEhD,QAAA,MAAM,eAAe,EAAE,YAgCtB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,eAAe,eAAe,CAAC"}
@@ -36,6 +36,9 @@ If the specification above contains a <task-manifest>, follow these execution ru
36
36
  Commit all changes before ending your session.`;
37
37
  const implementEngine = {
38
38
  id: 'implement',
39
+ // Retry budget — transient session crashes / animator hiccups retry
40
+ // in-place on the same rig. Terminal exhaustion fails the writ directly.
41
+ retry: { maxAttempts: 2 },
39
42
  async run(givens, context) {
40
43
  const animator = guild().apparatus('animator');
41
44
  const writ = givens.writ;
@@ -1 +1 @@
1
- {"version":3,"file":"implement.js","sourceRoot":"","sources":["../../src/engines/implement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAM/C;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG;;;;;;;;;+CASoB,CAAC;AAEhD,MAAM,eAAe,GAAiB;IACpC,EAAE,EAAE,WAAW;IAEf,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO;QACvB,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC,SAAS,CAAc,UAAU,CAAC,CAAC;QAC5D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAe,CAAC;QACpC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB,CAAC;QAEvD,mEAAmE;QACnE,wEAAwE;QACxE,uEAAuE;QACvE,iEAAiE;QACjE,8CAA8C;QAC9C,MAAM,IAAI,GAAG,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACxE,CAAC,CAAC,MAAM,CAAC,MAAM;YACf,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACd,MAAM,MAAM,GAAG,GAAG,IAAI,KAAK,kBAAkB,EAAE,CAAC;QAEhD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC7B,IAAI,EAAE,MAAM,CAAC,IAAc;YAC3B,MAAM;YACN,GAAG,EAAE,KAAK,CAAC,IAAI;YACf,WAAW,EAAE,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,EAAE,cAAc,EAAE;YAC3D,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;SAC1D,CAAC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WAAW,EAAE,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,EAAE,cAAc,EAAE;YAC3D,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;SAC1D,CAAC,CAAC;QAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAC7D,CAAC;CACF,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,eAAe,eAAe,CAAC"}
@@ -3,7 +3,7 @@ export { default as draftEngine } from './draft.ts';
3
3
  export { default as implementEngine, EXECUTION_EPILOGUE } from './implement.ts';
4
4
  export { default as implementLoopEngine } from './implement-loop.ts';
5
5
  export { default as manualMergeEngine } from './manual-merge.ts';
6
- export { default as pieceSessionEngine, PIECE_EXECUTION_EPILOGUE } from './piece-session.ts';
6
+ export { default as stepSessionEngine, STEP_EXECUTION_EPILOGUE } from './step-session.ts';
7
7
  export { default as reviewEngine } from './review.ts';
8
8
  export { default as reviseEngine } from './revise.ts';
9
9
  export { default as sealEngine } from './seal.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC"}
@@ -3,7 +3,7 @@ export { default as draftEngine } from "./draft.js";
3
3
  export { default as implementEngine, EXECUTION_EPILOGUE } from "./implement.js";
4
4
  export { default as implementLoopEngine } from "./implement-loop.js";
5
5
  export { default as manualMergeEngine } from "./manual-merge.js";
6
- export { default as pieceSessionEngine, PIECE_EXECUTION_EPILOGUE } from "./piece-session.js";
6
+ export { default as stepSessionEngine, STEP_EXECUTION_EPILOGUE } from "./step-session.js";
7
7
  export { default as reviewEngine } from "./review.js";
8
8
  export { default as reviseEngine } from "./revise.js";
9
9
  export { default as sealEngine } from "./seal.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/engines/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAiGrE,QAAA,MAAM,YAAY,EAAE,YAgDnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/engines/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAiGrE,QAAA,MAAM,YAAY,EAAE,YAoDnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -104,6 +104,9 @@ Produce your findings as your final message in the format above.`;
104
104
  }
105
105
  const reviewEngine = {
106
106
  id: 'review',
107
+ // Retry budget — transient session crashes retry in-place. Terminal
108
+ // exhaustion fails the writ directly.
109
+ retry: { maxAttempts: 2 },
107
110
  async run(givens, context) {
108
111
  const animator = guild().apparatus('animator');
109
112
  const writ = givens.writ;
@@ -1 +1 @@
1
- {"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/engines/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAO/C,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,KAAK,UAAU,QAAQ,CAAC,IAAsB,EAAE,OAAe,EAAE,GAAW;IAC1E,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,EAAE,MAAM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C,IAAc;YAC3B,MAAM;YACN,GAAG,EAAE,KAAK,CAAC,IAAI;YACf,QAAQ,EAAE;gBACR,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,gBAAgB,EAAE,MAAM;aACzB;SACF,CAAC,CAAC;QAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,SAAiB;QAC7B,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC,SAAS,CAAY,QAAQ,CAAC,CAAC;QACtD,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAa,UAAU,EAAE,UAAU,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,gBAAgB,GAAI,OAAO,EAAE,QAAQ,EAAE,gBAAsC,IAAI,EAAE,CAAC;QAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC3D,CAAC;CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"revise.d.ts","sourceRoot":"","sources":["../../src/engines/revise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AA8DrE,QAAA,MAAM,YAAY,EAAE,YAuBnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"revise.d.ts","sourceRoot":"","sources":["../../src/engines/revise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AA8DrE,QAAA,MAAM,YAAY,EAAE,YA2BnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -67,6 +67,9 @@ Commit all changes before ending your session.`;
67
67
  }
68
68
  const reviseEngine = {
69
69
  id: 'revise',
70
+ // Retry budget — transient session crashes retry in-place. Terminal
71
+ // exhaustion fails the writ directly.
72
+ retry: { maxAttempts: 2 },
70
73
  async run(givens, context) {
71
74
  const animator = guild().apparatus('animator');
72
75
  const writ = givens.writ;
@@ -1 +1 @@
1
- {"version":3,"file":"revise.js","sourceRoot":"","sources":["../../src/engines/revise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAM/C,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,KAAK,UAAU,SAAS,CAAC,GAAW;IAClC,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,GAAW;IAC3C,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACzE,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH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MAAM,EAAE,IAAI,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC7B,IAAI,EAAE,MAAM,CAAC,IAAc;YAC3B,MAAM;YACN,GAAG,EAAE,KAAK,CAAC,IAAI;YACf,WAAW,EAAE,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,EAAE,cAAc,EAAE;YAC3D,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;SAC1D,CAAC,CAAC;QAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IAC7D,CAAC;CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Step-session engine — quick (Animator-backed).
3
+ *
4
+ * Launches an anima session for a single step writ. The prompt combines
5
+ * the mandate body with the step body and step-specific execution
6
+ * instructions.
7
+ *
8
+ * Custom collect():
9
+ * - On session completion → transitions the step writ to 'completed'.
10
+ * - After collecting, checks for dynamically added child steps of the
11
+ * mandate and grafts new step-session engines for them.
12
+ *
13
+ * Note on failure: Spider's tryCollect() calls failEngine() directly for
14
+ * failed/timeout sessions and never invokes collect(). Step writ failure
15
+ * relies on Clerk's parent/child cascade when the mandate reaches a
16
+ * terminal state (stuck → child steps get cancelled).
17
+ *
18
+ * Givens:
19
+ * - writ: WritDoc (the mandate writ)
20
+ * - step: WritDoc (the step writ for this task)
21
+ * - role: string
22
+ * - cwd: string (draft worktree path)
23
+ */
24
+ import type { EngineDesign } from '@shardworks/fabricator-apparatus';
25
+ /**
26
+ * Execution instructions for step sessions. Focuses the anima on a single
27
+ * task — no manifest traversal, commit-per-step guidance.
28
+ */
29
+ export declare const STEP_EXECUTION_EPILOGUE = "\nYou are working on a single task from a larger mandate. Focus exclusively on this task.\n\nInstructions:\n1. Complete the task described in the <task> element below the specification.\n2. If the task has a <verify> command, run it after completing the work and confirm the <done> criterion is met.\n3. The <files> element (if present) is the planner's predicted blast radius \u2014 useful for orientation, but verify scope independently.\n4. If you discover additional work needed beyond this task, use the step-add tool to create new tasks rather than doing them inline.\n5. Commit all changes before ending your session.";
30
+ declare const stepSessionEngine: EngineDesign;
31
+ export default stepSessionEngine;
32
+ //# sourceMappingURL=step-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-session.d.ts","sourceRoot":"","sources":["../../src/engines/step-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,kCAAkC,CAAC;AAiCvF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,qnBAQc,CAAC;AAEnD,QAAA,MAAM,iBAAiB,EAAE,YA0JxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}