@shardworks/astrolabe-apparatus 0.1.266 → 0.1.267
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 +9 -2
- package/dist/astrolabe.d.ts.map +1 -1
- package/dist/astrolabe.js +16 -2
- package/dist/astrolabe.js.map +1 -1
- package/dist/engines/observation-lift.d.ts +54 -37
- package/dist/engines/observation-lift.d.ts.map +1 -1
- package/dist/engines/observation-lift.js +114 -48
- package/dist/engines/observation-lift.js.map +1 -1
- package/dist/plan-and-ship.d.ts +10 -4
- package/dist/plan-and-ship.d.ts.map +1 -1
- package/dist/plan-and-ship.js +10 -4
- package/dist/plan-and-ship.js.map +1 -1
- package/dist/types.d.ts +13 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/sage-primer-attended.md +1 -1
- package/sage-primer-scoping.md +1 -1
- package/sage-primer-solo.md +1 -1
package/README.md
CHANGED
|
@@ -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 originating mandate's scope. The `astrolabe.observation-lift` engine lifts each record into a draft
|
|
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 top-level `mandate` writ (never a child of the originating mandate), attaching an `astrolabe.lifted-from` provenance edge back to the originating mandate so the lineage is filterable and auditable. When a plan yields two or more observations, the engine also creates a top-level `observation-set` container that parents the draft mandates and carries the `astrolabe.lifted-from` edge on behalf of the batch. A curator (human or automated) promotes each draft to open status before the Spider picks it up.
|
|
83
83
|
|
|
84
84
|
### `PlanFilters`
|
|
85
85
|
|
|
@@ -123,6 +123,13 @@ The Astrolabe declares one book in Stacks:
|
|
|
123
123
|
| Name | Description |
|
|
124
124
|
|---|---|
|
|
125
125
|
| `piece` | An atomic task piece within a mandate, executed sequentially |
|
|
126
|
+
| `observation-set` | A non-dispatchable container grouping writs lifted from a single planning run. Spider never dispatches this type (no `rigTemplateMappings` entry); it exists so curators can triage related lifted observations as a batch. Created by `astrolabe.observation-lift` when a plan yields two or more observations. |
|
|
127
|
+
|
|
128
|
+
### Link Kinds (contributed to Clerk)
|
|
129
|
+
|
|
130
|
+
| ID | Description |
|
|
131
|
+
|---|---|
|
|
132
|
+
| `astrolabe.lifted-from` | The source writ was lifted from the planning run of the target writ. Provenance edge: marks the originating mandate whose plan-and-ship rig produced this writ via the `observation-lift` engine. Created on the lifted `mandate` itself in flat mode, and on the `observation-set` container in grouped mode. |
|
|
126
133
|
|
|
127
134
|
### Roles (contributed to Loom)
|
|
128
135
|
|
|
@@ -144,7 +151,7 @@ The Astrolabe declares one book in Stacks:
|
|
|
144
151
|
| `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. In attended mode the primer contractually pre-fills `selected` on every decision; this engine reviews them all, 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 the plan has no decisions. Unparseable output, invalid verdicts, and abstained decisions have `Decision.selected` and `Decision.patronOverride` cleared — decision-review's `selected === undefined` filter surfaces the remainder to the patron in the normal flow. |
|
|
145
152
|
| `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
153
|
| `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
|
|
154
|
+
| `astrolabe.observation-lift` | Walks `plan.observations` after `plan-finalize` has transitioned the plan to `completed` and creates draft writs at the top level (never as children of the originating mandate — a parent-child edge would require the children to complete before the parent, which inverts the intended relationship). Provenance instead rides on the kit-registered `astrolabe.lifted-from` link kind (source = lifted writ, target = originating mandate). The engine selects one of two modes by a fixed threshold of two records. **Flat mode** (single observation): posts a top-level draft `mandate` and installs two outbound edges to the originating mandate — `astrolabe.lifted-from` (provenance) and `spider.follows` (precedence gate). **Grouped mode** (two or more observations): first posts a top-level draft `observation-set` container carrying only `astrolabe.lifted-from`, then posts each observation record as a draft `mandate` with `parentId` set to the container, each carrying only `spider.follows`. The `spider.follows` edges enlist 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`); the `observation-set` container is non-dispatchable by type and therefore carries no `spider.follows` edge. 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` or `clerk.link` error — already-created writs and links persist, leaving a coherent prefix for curator reconciliation. Does not mutate the plan — the two link kinds together form the audit trail. Yields `{ writIds }` — one id per observation record, in record order; the `observation-set` container id (when one exists) is *not* included. Wired unconditionally into the plan-and-ship rig template. |
|
|
148
155
|
|
|
149
156
|
### Rig Templates (contributed to Spider)
|
|
150
157
|
|
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,CAqTxC;AAGD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/astrolabe.js
CHANGED
|
@@ -182,8 +182,12 @@ 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
|
|
186
|
-
'child of the originating mandate
|
|
185
|
+
'the astrolabe.observation-lift engine lifts each record into a draft top-level ' +
|
|
186
|
+
'mandate writ (never a child of the originating mandate); each lifted writ carries an ' +
|
|
187
|
+
'astrolabe.lifted-from provenance edge back to the originating mandate. When the plan ' +
|
|
188
|
+
'yields two or more observations, the engine additionally groups them under a top-level ' +
|
|
189
|
+
'observation-set container that parents the draft mandates. A curator then promotes ' +
|
|
190
|
+
'each draft to open status.',
|
|
187
191
|
params: {
|
|
188
192
|
planId: z.string().describe('Plan id'),
|
|
189
193
|
observations: z
|
|
@@ -224,6 +228,16 @@ export function createAstrolabe() {
|
|
|
224
228
|
},
|
|
225
229
|
writTypes: [
|
|
226
230
|
{ name: 'piece', description: 'An atomic task piece within a mandate, executed sequentially' },
|
|
231
|
+
{
|
|
232
|
+
name: 'observation-set',
|
|
233
|
+
description: 'A non-dispatchable container grouping writs lifted from a single planning run. Spider never dispatches this type (no rig-template mapping); it exists so curators can triage related lifted observations as a batch.',
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
linkKinds: [
|
|
237
|
+
{
|
|
238
|
+
id: 'astrolabe.lifted-from',
|
|
239
|
+
description: 'The source writ was lifted from the planning run of the target writ. Provenance edge: marks the originating mandate whose plan-and-ship rig produced this writ via the observation-lift engine.',
|
|
240
|
+
},
|
|
227
241
|
],
|
|
228
242
|
roles: {
|
|
229
243
|
'sage-primer-reader': {
|
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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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,12 +2,46 @@
|
|
|
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 mandate
|
|
7
|
-
* didn't action" output from an
|
|
8
|
-
* visible in the same writ
|
|
9
|
-
*
|
|
10
|
-
* or via writ-publish.
|
|
5
|
+
* state and creates one draft writ per record, placed as top-level
|
|
6
|
+
* siblings of the originating mandate rather than as its children. This
|
|
7
|
+
* turns the sage's "things we noticed but didn't action" output from an
|
|
8
|
+
* inert note into commissionable drafts visible in the same writ
|
|
9
|
+
* surfaces as any other mandate — a downstream curator (human or
|
|
10
|
+
* automated) promotes each draft to `open` by hand or via writ-publish.
|
|
11
|
+
*
|
|
12
|
+
* The engine runs in one of two modes, selected by record count:
|
|
13
|
+
*
|
|
14
|
+
* - Flat mode (exactly one observation record):
|
|
15
|
+
* * Post a single top-level draft mandate writ (no `parentId`).
|
|
16
|
+
* * Install two outbound edges from that writ → originating
|
|
17
|
+
* mandate:
|
|
18
|
+
* - `astrolabe.lifted-from` (label "lifted from") carrying
|
|
19
|
+
* the provenance relationship, and
|
|
20
|
+
* - `spider.follows` (label "depends on") carrying the
|
|
21
|
+
* precedence-dependency gate.
|
|
22
|
+
*
|
|
23
|
+
* - Grouped mode (two or more observation records):
|
|
24
|
+
* * Post a single top-level draft writ of type `observation-set`
|
|
25
|
+
* whose title embeds the originating mandate's title
|
|
26
|
+
* (`Observations from "{title}"`) and whose body is a short
|
|
27
|
+
* preamble naming the originating writ followed by a numbered
|
|
28
|
+
* list of the child titles.
|
|
29
|
+
* * Install exactly one outbound `astrolabe.lifted-from` edge
|
|
30
|
+
* from the group parent → originating mandate. The group parent
|
|
31
|
+
* carries no `spider.follows` edge (it is non-dispatchable by
|
|
32
|
+
* type, so a precedence edge on it would be dead data).
|
|
33
|
+
* * For each observation record in record order, post a draft
|
|
34
|
+
* mandate writ with `parentId` set to the group parent's id and
|
|
35
|
+
* install exactly one outbound `spider.follows` edge from that
|
|
36
|
+
* child → originating mandate. Children do not carry
|
|
37
|
+
* `astrolabe.lifted-from`; their provenance is implied by the
|
|
38
|
+
* group parent's edge plus the parent-child relationship.
|
|
39
|
+
*
|
|
40
|
+
* Both modes preserve the existing `spider.follows` gate: the
|
|
41
|
+
* originating mandate is still the blocker, so Spider's `trySpawn` gate
|
|
42
|
+
* will hold each lifted writ (flat) or each child (grouped) until the
|
|
43
|
+
* mandate reaches a terminal state (release on completed/cancelled,
|
|
44
|
+
* cascade to stuck on failed).
|
|
11
45
|
*
|
|
12
46
|
* Behavior:
|
|
13
47
|
* - Validates that the plan exists and its status is `completed`.
|
|
@@ -15,40 +49,23 @@
|
|
|
15
49
|
* observation-lift runs after plan-finalize, which transitions the
|
|
16
50
|
* plan to `completed`.)
|
|
17
51
|
* - Silently no-ops if `plan.observations` is not an array (legacy
|
|
18
|
-
* string-shaped plandocs) or is an empty array
|
|
19
|
-
*
|
|
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).
|
|
52
|
+
* string-shaped plandocs) or is an empty array, yielding
|
|
53
|
+
* `{ writIds: [] }`.
|
|
37
54
|
* - Fails fast on the first error from either `clerk.post` or
|
|
38
|
-
* `clerk.link`. Already-created
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* - Does not mutate the plandoc — the
|
|
46
|
-
*
|
|
47
|
-
* together form the audit trail.
|
|
55
|
+
* `clerk.link`. Already-created writs and links persist; rollback
|
|
56
|
+
* is not attempted. The loud failure is itself the signal for
|
|
57
|
+
* curator reconciliation.
|
|
58
|
+
* - In grouped mode, the per-record post-then-link pattern is
|
|
59
|
+
* preceded by a group-first post-then-link for the container, so a
|
|
60
|
+
* mid-loop failure leaves a coherent prefix (group parent + its
|
|
61
|
+
* edge + zero or more fully-wired children) behind.
|
|
62
|
+
* - Does not mutate the plandoc — the persisted writs and links form
|
|
63
|
+
* the audit trail.
|
|
48
64
|
*
|
|
49
65
|
* Yields:
|
|
50
|
-
* `{ writIds }` — the ids of the draft writs created, in
|
|
51
|
-
* order as the observation records.
|
|
66
|
+
* `{ writIds }` — the ids of the draft observation writs created, in
|
|
67
|
+
* the same order as the observation records. The group parent id
|
|
68
|
+
* (when one exists) is NOT included. Empty when the engine no-ops.
|
|
52
69
|
*/
|
|
53
70
|
import type { EngineDesign } from '@shardworks/fabricator-apparatus';
|
|
54
71
|
import type { Book } from '@shardworks/stacks-apparatus';
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;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;AAwBxD,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,YAAY,CAkH3F"}
|
|
@@ -2,12 +2,46 @@
|
|
|
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 mandate
|
|
7
|
-
* didn't action" output from an
|
|
8
|
-
* visible in the same writ
|
|
9
|
-
*
|
|
10
|
-
* or via writ-publish.
|
|
5
|
+
* state and creates one draft writ per record, placed as top-level
|
|
6
|
+
* siblings of the originating mandate rather than as its children. This
|
|
7
|
+
* turns the sage's "things we noticed but didn't action" output from an
|
|
8
|
+
* inert note into commissionable drafts visible in the same writ
|
|
9
|
+
* surfaces as any other mandate — a downstream curator (human or
|
|
10
|
+
* automated) promotes each draft to `open` by hand or via writ-publish.
|
|
11
|
+
*
|
|
12
|
+
* The engine runs in one of two modes, selected by record count:
|
|
13
|
+
*
|
|
14
|
+
* - Flat mode (exactly one observation record):
|
|
15
|
+
* * Post a single top-level draft mandate writ (no `parentId`).
|
|
16
|
+
* * Install two outbound edges from that writ → originating
|
|
17
|
+
* mandate:
|
|
18
|
+
* - `astrolabe.lifted-from` (label "lifted from") carrying
|
|
19
|
+
* the provenance relationship, and
|
|
20
|
+
* - `spider.follows` (label "depends on") carrying the
|
|
21
|
+
* precedence-dependency gate.
|
|
22
|
+
*
|
|
23
|
+
* - Grouped mode (two or more observation records):
|
|
24
|
+
* * Post a single top-level draft writ of type `observation-set`
|
|
25
|
+
* whose title embeds the originating mandate's title
|
|
26
|
+
* (`Observations from "{title}"`) and whose body is a short
|
|
27
|
+
* preamble naming the originating writ followed by a numbered
|
|
28
|
+
* list of the child titles.
|
|
29
|
+
* * Install exactly one outbound `astrolabe.lifted-from` edge
|
|
30
|
+
* from the group parent → originating mandate. The group parent
|
|
31
|
+
* carries no `spider.follows` edge (it is non-dispatchable by
|
|
32
|
+
* type, so a precedence edge on it would be dead data).
|
|
33
|
+
* * For each observation record in record order, post a draft
|
|
34
|
+
* mandate writ with `parentId` set to the group parent's id and
|
|
35
|
+
* install exactly one outbound `spider.follows` edge from that
|
|
36
|
+
* child → originating mandate. Children do not carry
|
|
37
|
+
* `astrolabe.lifted-from`; their provenance is implied by the
|
|
38
|
+
* group parent's edge plus the parent-child relationship.
|
|
39
|
+
*
|
|
40
|
+
* Both modes preserve the existing `spider.follows` gate: the
|
|
41
|
+
* originating mandate is still the blocker, so Spider's `trySpawn` gate
|
|
42
|
+
* will hold each lifted writ (flat) or each child (grouped) until the
|
|
43
|
+
* mandate reaches a terminal state (release on completed/cancelled,
|
|
44
|
+
* cascade to stuck on failed).
|
|
11
45
|
*
|
|
12
46
|
* Behavior:
|
|
13
47
|
* - Validates that the plan exists and its status is `completed`.
|
|
@@ -15,42 +49,44 @@
|
|
|
15
49
|
* observation-lift runs after plan-finalize, which transitions the
|
|
16
50
|
* plan to `completed`.)
|
|
17
51
|
* - Silently no-ops if `plan.observations` is not an array (legacy
|
|
18
|
-
* string-shaped plandocs) or is an empty array
|
|
19
|
-
*
|
|
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).
|
|
52
|
+
* string-shaped plandocs) or is an empty array, yielding
|
|
53
|
+
* `{ writIds: [] }`.
|
|
37
54
|
* - Fails fast on the first error from either `clerk.post` or
|
|
38
|
-
* `clerk.link`. Already-created
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* - Does not mutate the plandoc — the
|
|
46
|
-
*
|
|
47
|
-
* together form the audit trail.
|
|
55
|
+
* `clerk.link`. Already-created writs and links persist; rollback
|
|
56
|
+
* is not attempted. The loud failure is itself the signal for
|
|
57
|
+
* curator reconciliation.
|
|
58
|
+
* - In grouped mode, the per-record post-then-link pattern is
|
|
59
|
+
* preceded by a group-first post-then-link for the container, so a
|
|
60
|
+
* mid-loop failure leaves a coherent prefix (group parent + its
|
|
61
|
+
* edge + zero or more fully-wired children) behind.
|
|
62
|
+
* - Does not mutate the plandoc — the persisted writs and links form
|
|
63
|
+
* the audit trail.
|
|
48
64
|
*
|
|
49
65
|
* Yields:
|
|
50
|
-
* `{ writIds }` — the ids of the draft writs created, in
|
|
51
|
-
* order as the observation records.
|
|
66
|
+
* `{ writIds }` — the ids of the draft observation writs created, in
|
|
67
|
+
* the same order as the observation records. The group parent id
|
|
68
|
+
* (when one exists) is NOT included. Empty when the engine no-ops.
|
|
52
69
|
*/
|
|
53
70
|
import { guild } from '@shardworks/nexus-core';
|
|
71
|
+
/**
|
|
72
|
+
* Fixed threshold above which observation-lift produces a grouped
|
|
73
|
+
* output (one top-level `observation-set` container with N draft
|
|
74
|
+
* mandate children). Below the threshold the engine posts a single
|
|
75
|
+
* flat top-level draft mandate. Kept as a module-local constant — not
|
|
76
|
+
* exposed via AstrolabeConfig — because no second consumer demands
|
|
77
|
+
* configurability.
|
|
78
|
+
*/
|
|
79
|
+
const GROUPING_THRESHOLD = 2;
|
|
80
|
+
/**
|
|
81
|
+
* Builds the group parent's body: a short preamble naming the
|
|
82
|
+
* originating mandate, followed by a numbered list of child titles.
|
|
83
|
+
*/
|
|
84
|
+
function buildGroupBody(originatingTitle, originatingId, observations) {
|
|
85
|
+
const preamble = `Lifted from the planning run of "${originatingTitle}" (${originatingId}). ` +
|
|
86
|
+
`Each numbered observation below is a draft mandate ready for curator promotion.`;
|
|
87
|
+
const lines = observations.map((obs, i) => `${i + 1}. ${obs.title}`);
|
|
88
|
+
return `${preamble}\n\n${lines.join('\n')}\n`;
|
|
89
|
+
}
|
|
54
90
|
export function createObservationLiftEngine(getPlansBook) {
|
|
55
91
|
return {
|
|
56
92
|
id: 'astrolabe.observation-lift',
|
|
@@ -73,27 +109,57 @@ export function createObservationLiftEngine(getPlansBook) {
|
|
|
73
109
|
};
|
|
74
110
|
}
|
|
75
111
|
const clerk = guild().apparatus('clerk');
|
|
112
|
+
// In grouped mode, we need the originating mandate's title for
|
|
113
|
+
// the container title. Fetch it once here; a single extra read
|
|
114
|
+
// against Clerk is cheap and keeps the group parent's title
|
|
115
|
+
// accurate if the mandate was renamed after the plan was primed.
|
|
116
|
+
let groupParentId;
|
|
117
|
+
if (observations.length >= GROUPING_THRESHOLD) {
|
|
118
|
+
const originating = await clerk.show(planId);
|
|
119
|
+
const originatingTitle = originating.title;
|
|
120
|
+
const groupParent = await clerk.post({
|
|
121
|
+
type: 'observation-set',
|
|
122
|
+
title: `Observations from "${originatingTitle}"`,
|
|
123
|
+
body: buildGroupBody(originatingTitle, planId, observations),
|
|
124
|
+
codex: plan.codex,
|
|
125
|
+
draft: true,
|
|
126
|
+
});
|
|
127
|
+
groupParentId = groupParent.id;
|
|
128
|
+
// Provenance edge: group parent → originating mandate. This is
|
|
129
|
+
// the single lifted-from anchor for the entire batch; children
|
|
130
|
+
// inherit provenance through their parentId + the group's edge.
|
|
131
|
+
await clerk.link(groupParent.id, planId, 'lifted from', 'astrolabe.lifted-from');
|
|
132
|
+
}
|
|
76
133
|
const writIds = [];
|
|
77
134
|
for (const observation of observations) {
|
|
78
135
|
// Per-record: post then link before the next iteration. Errors
|
|
79
136
|
// from either call propagate immediately. Already-created
|
|
80
|
-
// drafts (and their links) persist
|
|
81
|
-
//
|
|
82
|
-
const
|
|
137
|
+
// drafts (and their links) persist — rollback is not attempted;
|
|
138
|
+
// a curator reconciles by hand if needed.
|
|
139
|
+
const postRequest = {
|
|
83
140
|
type: 'mandate',
|
|
84
141
|
title: observation.title,
|
|
85
142
|
body: observation.body,
|
|
86
143
|
codex: plan.codex,
|
|
87
|
-
parentId: planId,
|
|
88
144
|
draft: true,
|
|
89
|
-
}
|
|
145
|
+
};
|
|
146
|
+
if (groupParentId !== undefined) {
|
|
147
|
+
postRequest.parentId = groupParentId;
|
|
148
|
+
}
|
|
149
|
+
const writ = await clerk.post(postRequest);
|
|
90
150
|
writIds.push(writ.id);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
151
|
+
if (groupParentId === undefined) {
|
|
152
|
+
// Flat mode: the single lifted writ also carries the
|
|
153
|
+
// provenance edge. (In grouped mode the group parent alone
|
|
154
|
+
// carries lifted-from; children trace back via parentId.)
|
|
155
|
+
await clerk.link(writ.id, planId, 'lifted from', 'astrolabe.lifted-from');
|
|
156
|
+
}
|
|
157
|
+
// Precedence-dependency edge back to the originating mandate
|
|
158
|
+
// so the Spider's `trySpawn` gate holds the lifted writ until
|
|
159
|
+
// the mandate reaches a terminal state. In grouped mode only
|
|
160
|
+
// children carry this edge — the group parent is
|
|
161
|
+
// non-dispatchable by type, so a spider.follows edge on it
|
|
162
|
+
// would be dead data.
|
|
97
163
|
await clerk.link(writ.id, planId, 'depends on', 'spider.follows');
|
|
98
164
|
}
|
|
99
165
|
return {
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAM/C;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B;;;GAGG;AACH,SAAS,cAAc,CAAC,gBAAwB,EAAE,aAAqB,EAAE,YAA2B;IAClG,MAAM,QAAQ,GACZ,oCAAoC,gBAAgB,MAAM,aAAa,KAAK;QAC5E,iFAAiF,CAAC;IACpF,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;IACrE,OAAO,GAAG,QAAQ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,YAAiC;IAC3E,OAAO;QACL,EAAE,EAAE,4BAA4B;QAEhC,KAAK,CAAC,GAAG,CACP,MAA+B,EAC/B,QAA0B;YAE1B,MAAM,MAAM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MAAM,EACN,YAAY,EACZ,gBAAgB,CACjB,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,MAAM,EAAE,WAAW;gBACnB,MAAM,EAAE,EAAE,OAAO,EAAE;aACpB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/plan-and-ship.d.ts
CHANGED
|
@@ -14,10 +14,16 @@
|
|
|
14
14
|
*
|
|
15
15
|
* The `observation-lift` engine runs after `plan-finalize` has transitioned
|
|
16
16
|
* the plan to `completed` but while the brief writ itself is still `open`.
|
|
17
|
-
* It lifts each record in `plan.observations` into a draft
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* It lifts each record in `plan.observations` into a draft top-level
|
|
18
|
+
* `mandate` writ (never a child of the originating mandate); each lifted
|
|
19
|
+
* writ carries an `astrolabe.lifted-from` provenance edge and a
|
|
20
|
+
* `spider.follows` precedence edge back to the originating mandate. When
|
|
21
|
+
* the plan yields two or more observations, the engine additionally groups
|
|
22
|
+
* the drafts under a top-level `observation-set` container that carries the
|
|
23
|
+
* provenance edge on behalf of the batch. A curator (human or overseer)
|
|
24
|
+
* promotes each draft to open status later. The engine internally no-ops
|
|
25
|
+
* on empty or legacy-string observations, so it is wired unconditionally
|
|
26
|
+
* (no `when:` guard).
|
|
21
27
|
*
|
|
22
28
|
* The `reader-analyst` slot uses the astrolabe-owned
|
|
23
29
|
* `astrolabe.reader-analyst` engine, which selects the primer role at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-and-ship.d.ts","sourceRoot":"","sources":["../src/plan-and-ship.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plan-and-ship.d.ts","sourceRoot":"","sources":["../src/plan-and-ship.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,eAAO,MAAM,sBAAsB,EAAE,WA4GpC,CAAC"}
|
package/dist/plan-and-ship.js
CHANGED
|
@@ -14,10 +14,16 @@
|
|
|
14
14
|
*
|
|
15
15
|
* The `observation-lift` engine runs after `plan-finalize` has transitioned
|
|
16
16
|
* the plan to `completed` but while the brief writ itself is still `open`.
|
|
17
|
-
* It lifts each record in `plan.observations` into a draft
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* It lifts each record in `plan.observations` into a draft top-level
|
|
18
|
+
* `mandate` writ (never a child of the originating mandate); each lifted
|
|
19
|
+
* writ carries an `astrolabe.lifted-from` provenance edge and a
|
|
20
|
+
* `spider.follows` precedence edge back to the originating mandate. When
|
|
21
|
+
* the plan yields two or more observations, the engine additionally groups
|
|
22
|
+
* the drafts under a top-level `observation-set` container that carries the
|
|
23
|
+
* provenance edge on behalf of the batch. A curator (human or overseer)
|
|
24
|
+
* promotes each draft to open status later. The engine internally no-ops
|
|
25
|
+
* on empty or legacy-string observations, so it is wired unconditionally
|
|
26
|
+
* (no `when:` guard).
|
|
21
27
|
*
|
|
22
28
|
* The `reader-analyst` slot uses the astrolabe-owned
|
|
23
29
|
* `astrolabe.reader-analyst` engine, which selects the primer role at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-and-ship.js","sourceRoot":"","sources":["../src/plan-and-ship.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"plan-and-ship.js","sourceRoot":"","sources":["../src/plan-and-ship.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAIH,MAAM,CAAC,MAAM,sBAAsB,GAAgB;IACjD,OAAO,EAAE;QACP;YACE,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,qBAAqB;YAC/B,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC5B;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AAE,eAAe;YACnB,QAAQ,EAAE,yBAAyB;YACnC,QAAQ,EAAE,CAAC,aAAa,CAAC;YACzB,MAAM,EAAE,EAAE,MAAM,EAAE,4BAA4B,EAAE;SACjD;QACD;YACE,EAAE,EAAE,kBAAkB;YACtB,QAAQ,EAAE,4BAA4B;YACtC,QAAQ,EAAE,CAAC,eAAe,CAAC;YAC3B,MAAM,EAAE,EAAE,MAAM,EAAE,4BAA4B,EAAE;SACjD;QACD;YACE,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,CAAC,kBAAkB,CAAC;YAC9B,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,cAAc;gBACpB,MAAM,EAAE,8BAA8B;aACvC;SACF;QACD;YACE,EAAE,EAAE,QAAQ;YACZ,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,CAAC,WAAW,CAAC;YACvB,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,UAAU;gBAChB,YAAY,EAAE,sBAAsB;gBACpC,WAAW,EAAE,qBAAqB;aACnC;SACF;QACD;YACE,EAAE,EAAE,QAAQ;YACZ,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE;SAClD;QACD;YACE,EAAE,EAAE,MAAM;YACV,QAAQ,EAAE,MAAM;YAChB,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,MAAM,EAAE,EAAE;SACX;KACF;IACD,gBAAgB,EAAE,MAAM;CACzB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -19,9 +19,13 @@ export interface PlanDoc {
|
|
|
19
19
|
* Primer observations: refactoring opportunities, risks, conventions.
|
|
20
20
|
*
|
|
21
21
|
* Each entry is an atomic, commissionable concern — the
|
|
22
|
-
* `astrolabe.observation-lift` engine lifts each record into a
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* `astrolabe.observation-lift` engine lifts each record into a draft
|
|
23
|
+
* top-level `mandate` writ (never a child of the originating mandate),
|
|
24
|
+
* attaching an `astrolabe.lifted-from` provenance edge back to the
|
|
25
|
+
* originating mandate. When the plan yields two or more observations,
|
|
26
|
+
* the engine additionally groups the drafts under a top-level
|
|
27
|
+
* `observation-set` container. A curator (human or automated) then
|
|
28
|
+
* promotes each draft to open status.
|
|
25
29
|
*/
|
|
26
30
|
observations?: Observation[];
|
|
27
31
|
/** Scope items: what's in and what's out. */
|
|
@@ -52,8 +56,12 @@ export interface ScopeItem {
|
|
|
52
56
|
* Each observation names one concern — a refactoring opportunity,
|
|
53
57
|
* risk, convention drift, or bug — that the sage noticed but that
|
|
54
58
|
* is outside the brief's scope. Observations flow downstream into
|
|
55
|
-
* the `astrolabe.observation-lift` engine, which
|
|
56
|
-
*
|
|
59
|
+
* the `astrolabe.observation-lift` engine, which lifts each record
|
|
60
|
+
* into a draft top-level `mandate` writ (never a child of the
|
|
61
|
+
* originating mandate). The provenance relationship rides on the
|
|
62
|
+
* kit-registered `astrolabe.lifted-from` link kind. When a plan
|
|
63
|
+
* yields two or more observations, the engine additionally groups
|
|
64
|
+
* the drafts under a top-level `observation-set` container.
|
|
57
65
|
*
|
|
58
66
|
* Fields are deliberately minimal (D1 in the commission spec):
|
|
59
67
|
* - `id` — plandoc-local identifier assigned by the sage (e.g. `obs-1`).
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAIpG,MAAM,WAAW,OAAO;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,uC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,CAAC,CAAC;IACvC,yEAAyE;IACzE,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAChD,kFAAkF;IAClF,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shardworks/astrolabe-apparatus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.267",
|
|
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/tools-apparatus": "0.1.
|
|
25
|
-
"@shardworks/clerk-apparatus": "0.1.
|
|
26
|
-
"@shardworks/fabricator-apparatus": "0.1.
|
|
27
|
-
"@shardworks/spider-apparatus": "0.1.
|
|
28
|
-
"@shardworks/
|
|
29
|
-
"@shardworks/
|
|
23
|
+
"@shardworks/stacks-apparatus": "0.1.267",
|
|
24
|
+
"@shardworks/tools-apparatus": "0.1.267",
|
|
25
|
+
"@shardworks/clerk-apparatus": "0.1.267",
|
|
26
|
+
"@shardworks/fabricator-apparatus": "0.1.267",
|
|
27
|
+
"@shardworks/spider-apparatus": "0.1.267",
|
|
28
|
+
"@shardworks/animator-apparatus": "0.1.267",
|
|
29
|
+
"@shardworks/loom-apparatus": "0.1.267"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "25.5.0",
|
|
33
|
-
"@shardworks/nexus-core": "0.1.
|
|
33
|
+
"@shardworks/nexus-core": "0.1.267"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|
package/sage-primer-attended.md
CHANGED
|
@@ -192,7 +192,7 @@ Accumulate a punch list of things noticed during your pass that are outside the
|
|
|
192
192
|
- **Doc/code discrepancies** found during inventory
|
|
193
193
|
- **Potential bugs or risks** noticed in adjacent code
|
|
194
194
|
|
|
195
|
-
Each observation is **one record per atomic concern**. Downstream, the `astrolabe.observation-lift` engine
|
|
195
|
+
Each observation is **one record per atomic concern**. Downstream, the `astrolabe.observation-lift` engine lifts each record into a draft top-level `mandate` writ (never a child of the originating mandate); each lifted writ carries an `astrolabe.lifted-from` provenance edge back to the originating mandate, plus a `spider.follows` edge that holds dispatch until the mandate has terminated. When the plan yields two or more observations, the engine additionally groups them under a top-level `observation-set` container that parents the draft mandates and carries the `astrolabe.lifted-from` edge on behalf of the batch. A curator (human or automated) promotes each draft to open status. Your job is to package the concerns; you do not decide which ones get promoted.
|
|
196
196
|
|
|
197
197
|
Atomicity guidance has not changed from prior practice — if two noticings would be addressed by the same follow-up commission, they belong in one record; if they would be addressed by two different commissions, they are two records.
|
|
198
198
|
|
package/sage-primer-scoping.md
CHANGED
|
@@ -188,7 +188,7 @@ Accumulate a punch list of things noticed during analysis that are outside the b
|
|
|
188
188
|
- **Doc/code discrepancies** found during inventory
|
|
189
189
|
- **Potential bugs or risks** noticed in adjacent code
|
|
190
190
|
|
|
191
|
-
Each observation is **one record per atomic concern**. Downstream, the `astrolabe.observation-lift` engine
|
|
191
|
+
Each observation is **one record per atomic concern**. Downstream, the `astrolabe.observation-lift` engine lifts each record into a draft top-level `mandate` writ (never a child of the originating mandate); each lifted writ carries an `astrolabe.lifted-from` provenance edge back to the originating mandate, plus a `spider.follows` edge that holds dispatch until the mandate has terminated. When the plan yields two or more observations, the engine additionally groups them under a top-level `observation-set` container that parents the draft mandates and carries the `astrolabe.lifted-from` edge on behalf of the batch. A curator (human or automated) promotes each draft to open status. Your job is to package the concerns; you do not decide which ones get promoted.
|
|
192
192
|
|
|
193
193
|
Atomicity guidance has not changed from prior practice — if two noticings would be addressed by the same follow-up commission, they belong in one record; if they would be addressed by two different commissions, they are two records.
|
|
194
194
|
|
package/sage-primer-solo.md
CHANGED
|
@@ -223,7 +223,7 @@ Accumulate a punch list of things noticed during your pass that are outside the
|
|
|
223
223
|
- **Doc/code discrepancies** found during inventory
|
|
224
224
|
- **Potential bugs or risks** noticed in adjacent code
|
|
225
225
|
|
|
226
|
-
Each observation is **one record per atomic concern**. Downstream, the `astrolabe.observation-lift` engine
|
|
226
|
+
Each observation is **one record per atomic concern**. Downstream, the `astrolabe.observation-lift` engine lifts each record into a draft top-level `mandate` writ (never a child of the originating mandate); each lifted writ carries an `astrolabe.lifted-from` provenance edge back to the originating mandate, plus a `spider.follows` edge that holds dispatch until the mandate has terminated. When the plan yields two or more observations, the engine additionally groups them under a top-level `observation-set` container that parents the draft mandates and carries the `astrolabe.lifted-from` edge on behalf of the batch. A curator (human or automated) promotes each draft to open status. Your job is to package the concerns; you do not decide which ones get promoted.
|
|
227
227
|
|
|
228
228
|
Atomicity guidance has not changed from prior practice — if two noticings would be addressed by the same follow-up commission, they belong in one record; if they would be addressed by two different commissions, they are two records.
|
|
229
229
|
|