@shardworks/astrolabe-apparatus 0.1.246 → 0.1.248
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 +13 -13
- package/dist/astrolabe.d.ts.map +1 -1
- package/dist/astrolabe.js +5 -6
- package/dist/astrolabe.js.map +1 -1
- package/dist/engines/observation-lift.d.ts +32 -13
- package/dist/engines/observation-lift.d.ts.map +1 -1
- package/dist/engines/observation-lift.js +44 -17
- package/dist/engines/observation-lift.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@shardworks/astrolabe-apparatus`
|
|
2
2
|
|
|
3
|
-
The Astrolabe transforms patron briefs into structured work specifications and carries them through implementation. A single combined rig (`astrolabe.plan-and-ship`) runs the planning pipeline — inventory, analysis, optional Patron Anima pre-fill, patron review, specification writing — and then continues into draft → implement → review → revise → seal on the same
|
|
3
|
+
The Astrolabe transforms patron briefs into structured work specifications and carries them through implementation. A single combined rig (`astrolabe.plan-and-ship`) runs the planning pipeline — inventory, analysis, optional Patron Anima pre-fill, patron review, specification writing — and then continues into draft → implement → review → revise → seal on the same `mandate` writ. The mandate reaches `completed` only after the final seal engine finishes. It sits between the Clerk (writ lifecycle) and the Spider (rig execution), contributing kit pieces to both.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -52,11 +52,11 @@ interface AstrolabeApi {
|
|
|
52
52
|
|
|
53
53
|
### `PlanDoc`
|
|
54
54
|
|
|
55
|
-
A `PlanDoc` is keyed by the
|
|
55
|
+
A `PlanDoc` is keyed by the originating `mandate` writ ID and tracks the full planning lifecycle:
|
|
56
56
|
|
|
57
57
|
```typescript
|
|
58
58
|
interface PlanDoc {
|
|
59
|
-
id: string; //
|
|
59
|
+
id: string; // Originating mandate writ ID
|
|
60
60
|
codex: string; // Target codex
|
|
61
61
|
status: PlanStatus; // 'reading' | 'analyzing' | 'reviewing' | 'writing' | 'completed' | 'failed'
|
|
62
62
|
inventory?: string; // Markdown: affected files, types, interfaces, patterns
|
|
@@ -79,7 +79,7 @@ interface Observation {
|
|
|
79
79
|
}
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Each `Observation` names one concern — a refactoring opportunity, risk, convention drift, or bug — that the sage noticed but that sits outside the
|
|
82
|
+
Each `Observation` names one concern — a refactoring opportunity, risk, convention drift, or bug — that the sage noticed but that sits outside the originating mandate's scope. The `astrolabe.observation-lift` engine lifts each record into a draft child `mandate` writ under the originating mandate so a curator (human or automated) can promote it.
|
|
83
83
|
|
|
84
84
|
### `PlanFilters`
|
|
85
85
|
|
|
@@ -122,7 +122,7 @@ The Astrolabe declares one book in Stacks:
|
|
|
122
122
|
|
|
123
123
|
| Name | Description |
|
|
124
124
|
|---|---|
|
|
125
|
-
| `
|
|
125
|
+
| `piece` | An atomic task piece within a mandate, executed sequentially |
|
|
126
126
|
|
|
127
127
|
### Roles (contributed to Loom)
|
|
128
128
|
|
|
@@ -138,25 +138,25 @@ The Astrolabe declares one book in Stacks:
|
|
|
138
138
|
|
|
139
139
|
| Engine ID | Description |
|
|
140
140
|
|---|---|
|
|
141
|
-
| `astrolabe.plan-init` | Creates a PlanDoc from the
|
|
141
|
+
| `astrolabe.plan-init` | Creates a PlanDoc from the originating mandate writ; validates codex presence |
|
|
142
142
|
| `astrolabe.inventory-check` | Validates that the reader produced a non-empty inventory |
|
|
143
143
|
| `astrolabe.reader-analyst` | Selects the primer role at engine-run time from live guild config: `sage-primer-attended` when `astrolabe.patronRole` is non-empty (every decision gets pre-filled so the downstream patron-anima principle-checks them all), `sage-primer-solo` otherwise (the primer carries the razor itself and only leaves razor-matched decisions unset for the patron). Mirrors the `anima-session` surface — same givens (`prompt`, `cwd`, `writ`, `metadata`) minus the `role` given, which the engine chooses. Run-time selection (per writ, not per guild startup) means the patron can reconfigure `astrolabe.patronRole` mid-experiment and the next brief behaves according to the live config. |
|
|
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
|
-
| `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
|
|
147
|
-
| `astrolabe.observation-lift` | Walks `plan.observations` after `plan-finalize` has transitioned the plan to `completed` and calls `clerk.post({ type: '
|
|
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, 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
|
|
|
151
151
|
| Template | Mapped Writ Type | Engines |
|
|
152
152
|
|---|---|---|
|
|
153
|
-
| `astrolabe.plan-and-ship` | `
|
|
153
|
+
| `astrolabe.plan-and-ship` | `mandate` (default) | plan-init → draft → reader-analyst → inventory-check → patron-anima → decision-review → spec-writer → plan-finalize → observation-lift → implement → review → revise → seal |
|
|
154
154
|
|
|
155
|
-
The `resolutionEngine` is `seal` — the
|
|
155
|
+
The `resolutionEngine` is `seal` — the originating `mandate` writ reaches `completed` only after the final seal engine completes.
|
|
156
156
|
|
|
157
157
|
#### Rig Template Selection
|
|
158
158
|
|
|
159
|
-
The `
|
|
159
|
+
The `mandate` writ type maps to `astrolabe.plan-and-ship` by default whenever Astrolabe is installed alongside Spider. This single combined rig carries the mandate through planning and implementation on one writ — the `plan-finalize` engine hands the written spec directly to the downstream `implement` engine via `${yields.plan-finalize.spec}`, and no separate implementation-target writ is posted. The `reader-analyst` slot is driven by the astrolabe-owned `astrolabe.reader-analyst` engine, which selects between the `sage-primer-attended` and `sage-primer-solo` roles at engine-run time from live guild config. The optional `patron-anima` stage between `inventory-check` and `decision-review` consults the configured `patronRole` under a tailored operational prompt (see `patron-anima-prompt.md` packaged with the plugin) whenever `astrolabe.patronRole` is set. The anima principle-checks every decision the primer produced and confirms (including first-class `low`-confidence confirms when no principle speaks), overrides, fills in, or abstains. Abstention is narrow — reserved for *irresolvable principle conflict* and *broken decision frame* only. Abstained decisions are left unfilled and flow through to decision-review in the normal path.
|
|
160
160
|
|
|
161
161
|
### Tools
|
|
162
162
|
|
|
@@ -180,8 +180,8 @@ Write tools only update their artifact field plus `updatedAt`. Status transition
|
|
|
180
180
|
|
|
181
181
|
The Astrolabe page provides a list/detail dashboard for PlanDoc records:
|
|
182
182
|
|
|
183
|
-
- **List view** — filterable by status, paginated (20 per page), showing status badge, codex,
|
|
184
|
-
- **Detail view** — metadata card with plan ID, status, codex, cross-
|
|
183
|
+
- **List view** — filterable by status, paginated (20 per page), showing status badge, codex, originating mandate writ title, plan ID, and creation date.
|
|
184
|
+
- **Detail view** — metadata card with plan ID, status, codex, a cross-link to the originating mandate writ (linking to the Clerk writs page via `?writ=ID`), per-step AI cost breakdowns (input/output tokens and USD cost for each anima-session engine), and tabbed content sections for Inventory, Scope, Decisions, Observations, and Spec.
|
|
185
185
|
- **Observations tab** — renders the `Observation[]` array as a card-per-record list (id, title, markdown body). Card bodies flow through the same markdown renderer used by inventory and spec. An empty or absent array renders as an empty tab. A legacy prose-string payload renders as empty rather than corrupting the tab.
|
|
186
186
|
- **Deep linking** — supports `?plan=ID` query parameter to open directly to a plan's detail view.
|
|
187
187
|
|
package/dist/astrolabe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astrolabe.d.ts","sourceRoot":"","sources":["../src/astrolabe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,wBAAwB,CAAC;AAOrE,OAAO,KAAK,EAEV,eAAe,EAGhB,MAAM,YAAY,CAAC;AAgBpB,iBAAS,sBAAsB,IAAI,eAAe,CAEjD;AAED;;;;;;;;GAQG;AACH,iBAAS,iBAAiB,IAAI,MAAM,CAGnC;AAID,wBAAgB,eAAe,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"astrolabe.d.ts","sourceRoot":"","sources":["../src/astrolabe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,wBAAwB,CAAC;AAOrE,OAAO,KAAK,EAEV,eAAe,EAGhB,MAAM,YAAY,CAAC;AAgBpB,iBAAS,sBAAsB,IAAI,eAAe,CAEjD;AAED;;;;;;;;GAQG;AACH,iBAAS,iBAAiB,IAAI,MAAM,CAGnC;AAID,wBAAgB,eAAe,IAAI,MAAM,CAoSxC;AAGD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/astrolabe.js
CHANGED
|
@@ -73,9 +73,9 @@ export function createAstrolabe() {
|
|
|
73
73
|
name: 'plan-show',
|
|
74
74
|
description: 'Show full detail for a plan',
|
|
75
75
|
instructions: 'Returns the complete plan document including inventory, scope, decisions, ' +
|
|
76
|
-
'observations, and spec fields. The planId is the
|
|
76
|
+
'observations, and spec fields. The planId is the originating mandate writ ID.',
|
|
77
77
|
params: {
|
|
78
|
-
planId: z.string().describe('Plan id (same as the
|
|
78
|
+
planId: z.string().describe('Plan id (same as the originating mandate writ id)'),
|
|
79
79
|
},
|
|
80
80
|
permission: 'read',
|
|
81
81
|
handler: async ({ planId }) => {
|
|
@@ -182,8 +182,8 @@ export function createAstrolabe() {
|
|
|
182
182
|
'per atomic concern noticed during the planning pass. Each record has a plandoc-local ' +
|
|
183
183
|
'id (convention: obs-1, obs-2, ...), a one-line commission-title style title, and a ' +
|
|
184
184
|
'markdown body with tactical detail (file paths, symbols, preconditions). Downstream ' +
|
|
185
|
-
'the astrolabe.observation-lift engine creates one draft
|
|
186
|
-
'child of the originating
|
|
185
|
+
'the astrolabe.observation-lift engine creates one draft mandate writ per record as a ' +
|
|
186
|
+
'child of the originating mandate, ready for a curator to promote.',
|
|
187
187
|
params: {
|
|
188
188
|
planId: z.string().describe('Plan id'),
|
|
189
189
|
observations: z
|
|
@@ -223,7 +223,6 @@ export function createAstrolabe() {
|
|
|
223
223
|
plans: { indexes: ['status', 'codex', 'createdAt'] },
|
|
224
224
|
},
|
|
225
225
|
writTypes: [
|
|
226
|
-
{ name: 'brief', description: 'A patron brief triggering the planning pipeline' },
|
|
227
226
|
{ name: 'piece', description: 'An atomic task piece within a mandate, executed sequentially' },
|
|
228
227
|
],
|
|
229
228
|
roles: {
|
|
@@ -266,7 +265,7 @@ export function createAstrolabe() {
|
|
|
266
265
|
'plan-and-ship': planAndShipRigTemplate,
|
|
267
266
|
},
|
|
268
267
|
rigTemplateMappings: {
|
|
269
|
-
|
|
268
|
+
mandate: 'astrolabe.plan-and-ship',
|
|
270
269
|
},
|
|
271
270
|
tools: [
|
|
272
271
|
planShowTool,
|
package/dist/astrolabe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astrolabe.js","sourceRoot":"","sources":["../src/astrolabe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAGnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,wEAAwE;AAExE,SAAS,sBAAsB;IAC7B,OAAO,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC,SAAS,IAAI,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,iBAAiB;IACxB,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;IACxC,OAAO,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC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IAAoB;gBACxB,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC,SAAS,CAAY,QAAQ,CAAC,CAAC;gBACtD,SAAS,GAAG,MAAM,CAAC,IAAI,CAAU,WAAW,EAAE,OAAO,CAAC,CAAC;YACzD,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* observation-lift clockwork engine.
|
|
3
3
|
*
|
|
4
4
|
* Walks the plan's `observations` array once it has reached its final
|
|
5
|
-
* state and creates one draft
|
|
6
|
-
* originating
|
|
5
|
+
* state and creates one draft mandate writ per record as a child of the
|
|
6
|
+
* originating mandate. This turns the sage's "things we noticed but
|
|
7
7
|
* didn't action" output from an inert note into commissionable drafts
|
|
8
|
-
* visible in the same writ surfaces as any other
|
|
8
|
+
* visible in the same writ surfaces as any other mandate — a downstream
|
|
9
9
|
* curator (human or automated) promotes each draft to `open` by hand
|
|
10
10
|
* or via writ-publish.
|
|
11
11
|
*
|
|
@@ -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
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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
|
|
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"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* observation-lift clockwork engine.
|
|
3
3
|
*
|
|
4
4
|
* Walks the plan's `observations` array once it has reached its final
|
|
5
|
-
* state and creates one draft
|
|
6
|
-
* originating
|
|
5
|
+
* state and creates one draft mandate writ per record as a child of the
|
|
6
|
+
* originating mandate. This turns the sage's "things we noticed but
|
|
7
7
|
* didn't action" output from an inert note into commissionable drafts
|
|
8
|
-
* visible in the same writ surfaces as any other
|
|
8
|
+
* visible in the same writ surfaces as any other mandate — a downstream
|
|
9
9
|
* curator (human or automated) promotes each draft to `open` by hand
|
|
10
10
|
* or via writ-publish.
|
|
11
11
|
*
|
|
@@ -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
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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,11 +75,12 @@ export function createObservationLiftEngine(getPlansBook) {
|
|
|
56
75
|
const clerk = guild().apparatus('clerk');
|
|
57
76
|
const writIds = [];
|
|
58
77
|
for (const observation of observations) {
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
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
|
-
type: '
|
|
83
|
+
type: 'mandate',
|
|
64
84
|
title: observation.title,
|
|
65
85
|
body: observation.body,
|
|
66
86
|
codex: plan.codex,
|
|
@@ -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":"AAAA
|
|
1
|
+
{"version":3,"file":"observation-lift.js","sourceRoot":"","sources":["../../src/engines/observation-lift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAM/C,MAAM,UAAU,2BAA2B,CAAC,YAAiC;IAC3E,OAAO;QACL,EAAE,EAAE,4BAA4B;QAEhC,KAAK,CAAC,GAAG,CACP,MAA+B,EAC/B,QAA0B;YAE1B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAgB,CAAC;YACvC,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;YAE5B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,SAAS,MAAM,cAAc,CAAC,CAAC;YACjD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W;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.
|
|
3
|
+
"version": "0.1.248",
|
|
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.
|
|
24
|
-
"@shardworks/
|
|
25
|
-
"@shardworks/
|
|
26
|
-
"@shardworks/
|
|
27
|
-
"@shardworks/
|
|
28
|
-
"@shardworks/animator-apparatus": "0.1.
|
|
29
|
-
"@shardworks/
|
|
23
|
+
"@shardworks/stacks-apparatus": "0.1.248",
|
|
24
|
+
"@shardworks/clerk-apparatus": "0.1.248",
|
|
25
|
+
"@shardworks/fabricator-apparatus": "0.1.248",
|
|
26
|
+
"@shardworks/spider-apparatus": "0.1.248",
|
|
27
|
+
"@shardworks/tools-apparatus": "0.1.248",
|
|
28
|
+
"@shardworks/animator-apparatus": "0.1.248",
|
|
29
|
+
"@shardworks/loom-apparatus": "0.1.248"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "25.5.0",
|
|
33
|
-
"@shardworks/nexus-core": "0.1.
|
|
33
|
+
"@shardworks/nexus-core": "0.1.248"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|