@shardworks/astrolabe-apparatus 0.1.247 → 0.1.249

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/README.md CHANGED
@@ -144,7 +144,7 @@ The Astrolabe declares one book in Stacks:
144
144
  | `astrolabe.patron-anima` | Consults a configured Patron Anima to principle-check every decision the primer produced, under a tailored operational prompt that encodes the engine's mode discipline — one option per decision, principle-structural confidence calibration (`high` = one principle fires cleanly; `med` = multiple principles conflict and the anima resolves; `low` = no principle speaks, confirm the primer), narrow abstention by omission reserved for *irresolvable principle conflict* and *broken decision frame* only, and an explicit out-of-lane prohibition on codebase audit work. Reads the plan's reviewable decisions (those without `selected` already set — empty when the attended primer ran, non-empty when the solo primer surfaced razor matches), launches the configured `patronRole` via a single-pass anima session, parses a single structured emission, and applies each valid verdict to `Decision.selected` (plus records the full verdict — confirm / override / fill-in with selection, confidence, rationale — on `Decision.patron`). No-ops when `astrolabe.patronRole` is unset or empty, or when no reviewable decisions remain. Unparseable output, invalid verdicts, and abstained decisions are left unfilled — decision-review surfaces the remainder to the patron in the normal flow. |
145
145
  | `astrolabe.decision-review` | Two-pass engine: blocks for patron review, then reconciles answers. Decisions with `selected` already pre-set by the primer or the patron anima are auto-accepted — they are excluded from the InputRequestDoc, and if nothing remains reviewable the engine fast-paths to `writing` without opening the gate. |
146
146
  | `astrolabe.plan-finalize` | Transitions the plan to `completed` and yields the written `spec` downstream. Does not post any writ. Used inside `plan-and-ship` to hand the spec off to the implement engine on the same mandate rig. |
147
- | `astrolabe.observation-lift` | Walks `plan.observations` after `plan-finalize` has transitioned the plan to `completed` and calls `clerk.post({ type: 'mandate', title, body, codex, parentId, draft: true })` once per record. Each created writ enters `new` (draft) phase, invisible to the Spider until a curator publishes it. Silently no-ops when `observations` is empty, absent, or a legacy string; fails fast on the first `clerk.post` error. Does not mutate the plan — the parent-child relationship on the Clerk side is the sole audit trail. Wired unconditionally into the plan-and-ship rig template. |
147
+ | `astrolabe.observation-lift` | Walks `plan.observations` after `plan-finalize` has transitioned the plan to `completed` and, per record, calls `clerk.post({ type: 'mandate', title, body, codex, parentId, draft: true })` and then `clerk.link(newWritId, planId, 'depends on', 'spider.follows')`. The post creates a draft mandate writ as a child of the originating mandate (parent-child edge for provenance); the link installs a `spider.follows` precedence-dependency edge from the lifted writ back to the originating mandate, enlisting the Spider's `trySpawn` gate to hold each lifted writ until the originating mandate reaches a terminal state (release on `completed`/`cancelled`, cascade to `stuck` on `failed`). Each created writ enters `new` (draft) phase, invisible to the Spider until a curator publishes it; the precedence edge then takes effect. Silently no-ops when `observations` is empty, absent, or a legacy string; fails fast on the first `clerk.post` or `clerk.link` error — already-created post+link pairs persist under the mandate, and on a `clerk.link` failure the current observation's writ persists as a draft without the dependency edge for curator reconciliation. Does not mutate the plan — the parent-child edge and the `spider.follows` edge together form the audit trail. Wired unconditionally into the plan-and-ship rig template. |
148
148
 
149
149
  ### Rig Templates (contributed to Spider)
150
150
 
@@ -16,16 +16,35 @@
16
16
  * plan to `completed`.)
17
17
  * - Silently no-ops if `plan.observations` is not an array (legacy
18
18
  * string-shaped plandocs) or is an empty array.
19
- * - Otherwise, iterates the array in order and calls
20
- * `clerk.post({ type: 'mandate', title, body, codex, parentId, draft })`
21
- * once per record. The originating mandate writ must still be in a
22
- * non-terminal phase at this point the engine runs before seal,
23
- * which is what finally transitions the mandate to `completed`.
24
- * - Fails fast on the first `clerk.post` error. Already-created
25
- * drafts persist as `new`-status writs under the mandate; they are
26
- * invisible to the Spider until a curator publishes them.
27
- * - Does not mutate the plandoc — the parentId relationship on the
28
- * created writs is the sole audit trail.
19
+ * - Otherwise, iterates the array in order and, per record:
20
+ * 1. Calls `clerk.post({ type: 'mandate', title, body, codex,
21
+ * parentId, draft })` to create a draft mandate writ as a
22
+ * child of the originating mandate. The mandate writ must
23
+ * still be in a non-terminal phase at this point — the engine
24
+ * runs before seal, which is what finally transitions the
25
+ * mandate to `completed`.
26
+ * 2. Calls `clerk.link(newWritId, planId, 'depends on',
27
+ * 'spider.follows')` to install a precedence-dependency edge
28
+ * from the newly posted draft back to the originating mandate.
29
+ * The lifted observations describe concerns that presume the
30
+ * originating mandate has shipped; this link enlists the
31
+ * Spider's `trySpawn` gate to hold each lifted writ until the
32
+ * originating mandate reaches a terminal state (release on
33
+ * `completed`/`cancelled`, cascade to `stuck` on `failed`).
34
+ * - Emits two complementary edges per observation: the parent-child
35
+ * edge from `clerk.post` (provenance / audit trail) and the
36
+ * `spider.follows` edge from `clerk.link` (precedence gating).
37
+ * - Fails fast on the first error from either `clerk.post` or
38
+ * `clerk.link`. Already-created post+link pairs persist under the
39
+ * mandate; if the failure is in `clerk.link`, the writ for the
40
+ * current observation persists as a draft without the dependency
41
+ * edge — the loud failure is itself the signal for curator
42
+ * reconciliation. Drafts persist as `new`-status writs under the
43
+ * mandate; they are invisible to the Spider until a curator
44
+ * publishes them, and the precedence edge then takes effect.
45
+ * - Does not mutate the plandoc — the parent-child edge from
46
+ * `clerk.post` and the `spider.follows` edge from `clerk.link`
47
+ * together form the audit trail.
29
48
  *
30
49
  * Yields:
31
50
  * `{ writIds }` — the ids of the draft writs created, in the same
@@ -1 +1 @@
1
- {"version":3,"file":"observation-lift.d.ts","sourceRoot":"","sources":["../../src/engines/observation-lift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,kCAAkC,CAAC;AACxG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,YAAY,CAuD3F"}
1
+ {"version":3,"file":"observation-lift.d.ts","sourceRoot":"","sources":["../../src/engines/observation-lift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,kCAAkC,CAAC;AACxG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,YAAY,CAgE3F"}
@@ -16,16 +16,35 @@
16
16
  * plan to `completed`.)
17
17
  * - Silently no-ops if `plan.observations` is not an array (legacy
18
18
  * string-shaped plandocs) or is an empty array.
19
- * - Otherwise, iterates the array in order and calls
20
- * `clerk.post({ type: 'mandate', title, body, codex, parentId, draft })`
21
- * once per record. The originating mandate writ must still be in a
22
- * non-terminal phase at this point the engine runs before seal,
23
- * which is what finally transitions the mandate to `completed`.
24
- * - Fails fast on the first `clerk.post` error. Already-created
25
- * drafts persist as `new`-status writs under the mandate; they are
26
- * invisible to the Spider until a curator publishes them.
27
- * - Does not mutate the plandoc — the parentId relationship on the
28
- * created writs is the sole audit trail.
19
+ * - Otherwise, iterates the array in order and, per record:
20
+ * 1. Calls `clerk.post({ type: 'mandate', title, body, codex,
21
+ * parentId, draft })` to create a draft mandate writ as a
22
+ * child of the originating mandate. The mandate writ must
23
+ * still be in a non-terminal phase at this point — the engine
24
+ * runs before seal, which is what finally transitions the
25
+ * mandate to `completed`.
26
+ * 2. Calls `clerk.link(newWritId, planId, 'depends on',
27
+ * 'spider.follows')` to install a precedence-dependency edge
28
+ * from the newly posted draft back to the originating mandate.
29
+ * The lifted observations describe concerns that presume the
30
+ * originating mandate has shipped; this link enlists the
31
+ * Spider's `trySpawn` gate to hold each lifted writ until the
32
+ * originating mandate reaches a terminal state (release on
33
+ * `completed`/`cancelled`, cascade to `stuck` on `failed`).
34
+ * - Emits two complementary edges per observation: the parent-child
35
+ * edge from `clerk.post` (provenance / audit trail) and the
36
+ * `spider.follows` edge from `clerk.link` (precedence gating).
37
+ * - Fails fast on the first error from either `clerk.post` or
38
+ * `clerk.link`. Already-created post+link pairs persist under the
39
+ * mandate; if the failure is in `clerk.link`, the writ for the
40
+ * current observation persists as a draft without the dependency
41
+ * edge — the loud failure is itself the signal for curator
42
+ * reconciliation. Drafts persist as `new`-status writs under the
43
+ * mandate; they are invisible to the Spider until a curator
44
+ * publishes them, and the precedence edge then takes effect.
45
+ * - Does not mutate the plandoc — the parent-child edge from
46
+ * `clerk.post` and the `spider.follows` edge from `clerk.link`
47
+ * together form the audit trail.
29
48
  *
30
49
  * Yields:
31
50
  * `{ writIds }` — the ids of the draft writs created, in the same
@@ -56,9 +75,10 @@ export function createObservationLiftEngine(getPlansBook) {
56
75
  const clerk = guild().apparatus('clerk');
57
76
  const writIds = [];
58
77
  for (const observation of observations) {
59
- // Fail-fast: any clerk.post error propagates immediately.
60
- // Previously-created drafts persist (invisible to Spider) and
61
- // a curator can reconcile manually rollback is not attempted.
78
+ // Per-record: post then link before the next iteration. Errors
79
+ // from either call propagate immediately. Already-created
80
+ // drafts (and their links) persist under the mandate rollback
81
+ // is not attempted; a curator reconciles by hand if needed.
62
82
  const writ = await clerk.post({
63
83
  type: 'mandate',
64
84
  title: observation.title,
@@ -68,6 +88,13 @@ export function createObservationLiftEngine(getPlansBook) {
68
88
  draft: true,
69
89
  });
70
90
  writIds.push(writ.id);
91
+ // Install the precedence-dependency edge back to the
92
+ // originating mandate so the Spider's `trySpawn` gate holds the
93
+ // lifted writ until the mandate reaches a terminal state. The
94
+ // newly posted draft is the precedence-successor (source); the
95
+ // originating mandate is the blocker (target). A failure here
96
+ // is surfaced loudly — the gate is the whole point of the lift.
97
+ await clerk.link(writ.id, planId, 'depends on', 'spider.follows');
71
98
  }
72
99
  return {
73
100
  status: 'completed',
@@ -1 +1 @@
1
- {"version":3,"file":"observation-lift.js","sourceRoot":"","sources":["../../src/engines/observation-lift.ts"],"names":[],"mappings":"AAA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,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9D,wDAAwD;gBACxD,OAAO;oBACL,MAAM,EAAE,WAAW;oBACnB,MAAM,EAAE,EAAE,OAAO,EAAE,EAAc,EAAE;iBACpC,CAAC;YACJ,CAAC;YAED,MAAM,KAAK,GAAG,KAAK,EAAE,CAAC,SAAS,CAAW,OAAO,CAAC,CAAC;YACnD,MAAM,OAAO,GAAa,EAAE,CAAC;YAE7B,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;gBACvC,+DAA+D;gBAC/D,0DAA0D;gBAC1D,gEAAgE;gBAChE,4DAA4D;gBAC5D,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC;oBAC5B,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,WAAW,CAAC,KAAK;oBACxB,IAAI,EAAE,WAAW,CAAC,IAAI;oBACtB,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,QAAQ,EAAE,MAAM;oBAChB,KAAK,EAAE,IAAI;iBACZ,CAAC,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAEtB,qDAAqD;gBACrD,gEAAgE;gBAChE,8DAA8D;gBAC9D,+DAA+D;gBAC/D,8DAA8D;gBAC9D,gEAAgE;gBAChE,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;YACpE,CAAC;YAED,OAAO;gBACL,MAAM,EAAE,WAAW;gBACnB,MAAM,EAAE,EAAE,OAAO,EAAE;aACpB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shardworks/astrolabe-apparatus",
3
- "version": "0.1.247",
3
+ "version": "0.1.249",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,17 +20,17 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "zod": "4.3.6",
23
- "@shardworks/stacks-apparatus": "0.1.247",
24
- "@shardworks/tools-apparatus": "0.1.247",
25
- "@shardworks/clerk-apparatus": "0.1.247",
26
- "@shardworks/spider-apparatus": "0.1.247",
27
- "@shardworks/fabricator-apparatus": "0.1.247",
28
- "@shardworks/loom-apparatus": "0.1.247",
29
- "@shardworks/animator-apparatus": "0.1.247"
23
+ "@shardworks/tools-apparatus": "0.1.249",
24
+ "@shardworks/clerk-apparatus": "0.1.249",
25
+ "@shardworks/stacks-apparatus": "0.1.249",
26
+ "@shardworks/fabricator-apparatus": "0.1.249",
27
+ "@shardworks/spider-apparatus": "0.1.249",
28
+ "@shardworks/loom-apparatus": "0.1.249",
29
+ "@shardworks/animator-apparatus": "0.1.249"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "25.5.0",
33
- "@shardworks/nexus-core": "0.1.247"
33
+ "@shardworks/nexus-core": "0.1.249"
34
34
  },
35
35
  "files": [
36
36
  "dist",