@inventarch/runtime 1.2.0 → 3.0.0
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 +18 -2
- package/SPEC.md +41 -7
- package/dist/authoring-execution/execution.d.ts.map +1 -1
- package/dist/authoring-execution/execution.js +4 -2
- package/dist/authoring-execution/execution.js.map +1 -1
- package/dist/authoring-execution/inventory.d.ts.map +1 -1
- package/dist/authoring-execution/inventory.js +2 -0
- package/dist/authoring-execution/inventory.js.map +1 -1
- package/dist/authoring-execution/types.d.ts +2 -0
- package/dist/authoring-execution/types.d.ts.map +1 -1
- package/dist/context.d.ts +10 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +14 -5
- package/dist/context.js.map +1 -1
- package/dist/coordinate.d.ts +9 -2
- package/dist/coordinate.d.ts.map +1 -1
- package/dist/coordinate.js +14 -0
- package/dist/coordinate.js.map +1 -1
- package/dist/door.d.ts +17 -0
- package/dist/door.d.ts.map +1 -1
- package/dist/door.js +104 -5
- package/dist/door.js.map +1 -1
- package/dist/editor/index.d.ts +3 -1
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js +4 -1
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/workspace.d.ts.map +1 -1
- package/dist/editor/workspace.js +11 -2
- package/dist/editor/workspace.js.map +1 -1
- package/dist/errors.d.ts +20 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +16 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +15 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/locator.d.ts +22 -2
- package/dist/locator.d.ts.map +1 -1
- package/dist/locator.js +290 -26
- package/dist/locator.js.map +1 -1
- package/dist/machine-protocol.d.ts +5 -0
- package/dist/machine-protocol.d.ts.map +1 -1
- package/dist/machine-protocol.js +142 -6
- package/dist/machine-protocol.js.map +1 -1
- package/dist/mandate-guard.d.ts +91 -0
- package/dist/mandate-guard.d.ts.map +1 -0
- package/dist/mandate-guard.js +160 -0
- package/dist/mandate-guard.js.map +1 -0
- package/dist/mandate-modes.d.ts +251 -4
- package/dist/mandate-modes.d.ts.map +1 -1
- package/dist/mandate-modes.js +426 -18
- package/dist/mandate-modes.js.map +1 -1
- package/dist/next.d.ts +154 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +724 -0
- package/dist/next.js.map +1 -0
- package/dist/packet-host.d.ts +208 -0
- package/dist/packet-host.d.ts.map +1 -0
- package/dist/packet-host.js +244 -0
- package/dist/packet-host.js.map +1 -0
- package/dist/packet.d.ts +172 -0
- package/dist/packet.d.ts.map +1 -0
- package/dist/packet.js +211 -0
- package/dist/packet.js.map +1 -0
- package/dist/position.d.ts +284 -0
- package/dist/position.d.ts.map +1 -0
- package/dist/position.js +531 -0
- package/dist/position.js.map +1 -0
- package/dist/render.d.ts +6 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +12 -0
- package/dist/render.js.map +1 -1
- package/dist/scope-key.d.ts +101 -0
- package/dist/scope-key.d.ts.map +1 -0
- package/dist/scope-key.js +175 -0
- package/dist/scope-key.js.map +1 -0
- package/dist/steward.d.ts +8 -1
- package/dist/steward.d.ts.map +1 -1
- package/dist/steward.js +10 -0
- package/dist/steward.js.map +1 -1
- package/package.json +28 -4
package/dist/packet.d.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { Band, Category, CompiledField, CompiledRecord, CompiledValue, Kind, Lane, Phase, Predicate, Primitive, Shape } from '@inventarch/language';
|
|
2
|
+
import type { ReadHandle } from '@inventarch/db';
|
|
3
|
+
import type { Mode, Move } from './mandate-modes.js';
|
|
4
|
+
import type { HostNote } from './position.js';
|
|
5
|
+
/**
|
|
6
|
+
* The position packet: position-and-projection §4 and items 11 and 12; plan amendments B1 to B5 and B8 (milestone
|
|
7
|
+
* position-packet). One host-neutral packet a host adapter renders: body(K0)'s digest, the seat, the participants and
|
|
8
|
+
* their mandates, the N system pointer lines, the captured-record tallies, the intent and phase tables, the command
|
|
9
|
+
* catalog the caller passes in, the three SPEC lines and provenance. The host note sits beside it, never digested.
|
|
10
|
+
*
|
|
11
|
+
* It is a pure function of the admitted records the scope token reads and the catalog: like body(K) it carries no
|
|
12
|
+
* absolute path, token, time, capture state or CLI version, and nothing is written. Every read goes through `within`,
|
|
13
|
+
* position's K0 included, and a record at runtime placement (band 0) is no part of it, as it is no part of a body (R15).
|
|
14
|
+
*/
|
|
15
|
+
/** One command of the catalog (B5): the CLI passes them in, as data, from its COMMANDS rows. */
|
|
16
|
+
export interface PacketCatalogRow {
|
|
17
|
+
/** `ia <verb>`. */
|
|
18
|
+
readonly command: string;
|
|
19
|
+
readonly mode: Mode;
|
|
20
|
+
/** The move its mode maps to (MODE_MOVES, design item 13). */
|
|
21
|
+
readonly move: Move;
|
|
22
|
+
/** A one-line summary of the command's main refusal. */
|
|
23
|
+
readonly refuses: string;
|
|
24
|
+
/** The one command that refusal names (design row 27). */
|
|
25
|
+
readonly next: string;
|
|
26
|
+
}
|
|
27
|
+
/** The seat line: the repository's own @workspace, K0's seat. */
|
|
28
|
+
export interface PacketSeat {
|
|
29
|
+
/** Absent when no admitted @workspace is declared at the repository root (K0's seat unknown, R14). */
|
|
30
|
+
readonly identity?: string;
|
|
31
|
+
/** Its `composition.sources` entries as authored, `<root> @<placement>`. */
|
|
32
|
+
readonly sources: readonly string[];
|
|
33
|
+
/** N, the systems its `composition.systems` names: one system pointer line each. */
|
|
34
|
+
readonly systems: number;
|
|
35
|
+
/** Its `composition.steward` when it states one: the @agent the reference resolves to, or the reference as authored. */
|
|
36
|
+
readonly steward?: string;
|
|
37
|
+
/** Present exactly when no participant is rendered (P = 0, B3): no refusal. */
|
|
38
|
+
readonly participants?: 'none (no authored @mandate names an @agent)';
|
|
39
|
+
}
|
|
40
|
+
/** An authored @agent that an authored @mandate of `mandates` names as its `authority.participant` (B3). */
|
|
41
|
+
export interface PacketParticipant {
|
|
42
|
+
readonly identity: string;
|
|
43
|
+
/** Its `meaning.says`. */
|
|
44
|
+
readonly says?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* An authored @mandate of body(K0)'s `mandates` whose participant resolves to an authored @agent (B3), each optional
|
|
48
|
+
* field present exactly when the record states its key, as authored.
|
|
49
|
+
*/
|
|
50
|
+
export interface PacketMandate {
|
|
51
|
+
readonly identity: string;
|
|
52
|
+
/** The participant @agent's identity. */
|
|
53
|
+
readonly participant: string;
|
|
54
|
+
/** `authority.moves`; absent, the mandate restricts no move. */
|
|
55
|
+
readonly moves?: readonly Move[];
|
|
56
|
+
/** `authority.scope`: each @workspace the reference resolves to, or the reference as authored. */
|
|
57
|
+
readonly scope: readonly string[];
|
|
58
|
+
/** `authority.excluded-words`. */
|
|
59
|
+
readonly excludedWords?: readonly string[];
|
|
60
|
+
/** `authority.covers`, the path selections it claims. */
|
|
61
|
+
readonly covers?: readonly string[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* One system pointer line (B4) per `composition.systems` reference of the seat: the admitted @system it resolves to,
|
|
65
|
+
* the words its discriminators lower, its band, its steward and the key that seats at it; or, for a reference no
|
|
66
|
+
* admitted record answers, the reference as authored with `unresolved` in place of the words and steward.
|
|
67
|
+
*/
|
|
68
|
+
export type PacketSystem = {
|
|
69
|
+
readonly identity: string;
|
|
70
|
+
/** The words the record's `discriminators` lowering rows register, sorted. */
|
|
71
|
+
readonly words: readonly string[];
|
|
72
|
+
readonly band: Band;
|
|
73
|
+
/** Its `head.steward`, when it resolves to an admitted record. */
|
|
74
|
+
readonly steward?: string;
|
|
75
|
+
/** `ia position --seat <identity>`. */
|
|
76
|
+
readonly reach: string;
|
|
77
|
+
} | {
|
|
78
|
+
readonly identity: string;
|
|
79
|
+
readonly words: 'unresolved';
|
|
80
|
+
readonly steward: 'unresolved';
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A captured-record tally: the band-100 capture members of one word under the seat's own declared roots, none while
|
|
84
|
+
* it declares none (R15's capture members, not its fallback closure).
|
|
85
|
+
*/
|
|
86
|
+
export interface PacketTally {
|
|
87
|
+
readonly word: string;
|
|
88
|
+
readonly count: number;
|
|
89
|
+
}
|
|
90
|
+
/** One row of the intent table: a SHAPE_ROWS shape, in table order. */
|
|
91
|
+
export interface PacketIntent {
|
|
92
|
+
readonly shape: Shape;
|
|
93
|
+
readonly category: Category;
|
|
94
|
+
readonly primitive: Primitive;
|
|
95
|
+
/** PRIMITIVE_ANCHORS of the primitive: the phase a key that names the shape alone takes. */
|
|
96
|
+
readonly phase: Phase;
|
|
97
|
+
readonly kinds: readonly Kind[];
|
|
98
|
+
readonly lanes: readonly Lane[];
|
|
99
|
+
readonly predicates: readonly Predicate[];
|
|
100
|
+
readonly priming: readonly Predicate[];
|
|
101
|
+
/** The registered words a position seeds under the shape: those whose lowered kind or lane is in its focus. */
|
|
102
|
+
readonly words: readonly string[];
|
|
103
|
+
}
|
|
104
|
+
/** One row of the phase table: a phase, in cycle order. */
|
|
105
|
+
export interface PacketPhase {
|
|
106
|
+
readonly phase: Phase;
|
|
107
|
+
/** The primitives PRIMITIVE_ANCHORS anchors at it. */
|
|
108
|
+
readonly primitives: readonly Primitive[];
|
|
109
|
+
/** What `--phase` changes. */
|
|
110
|
+
readonly changes: string;
|
|
111
|
+
}
|
|
112
|
+
export interface PacketProvenance {
|
|
113
|
+
/** The packet's revision, body(K0)'s authored one. */
|
|
114
|
+
readonly revision: string;
|
|
115
|
+
/** The seat @workspace's name (decision identity-namespace: the repository slug lives here, not in identities). */
|
|
116
|
+
readonly slug?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface PositionPacket {
|
|
119
|
+
readonly format: 'ia.position-packet.v1';
|
|
120
|
+
/**
|
|
121
|
+
* The authored revision of the view the scope reads, body(K0)'s (db `Snapshot.authoredRevision`), which no
|
|
122
|
+
* runtime-band source moves.
|
|
123
|
+
*/
|
|
124
|
+
readonly revision: string;
|
|
125
|
+
/** The digest of body(K0), position(K0)'s `digest`. */
|
|
126
|
+
readonly body: string;
|
|
127
|
+
readonly seat: PacketSeat;
|
|
128
|
+
readonly participants: readonly PacketParticipant[];
|
|
129
|
+
readonly mandates: readonly PacketMandate[];
|
|
130
|
+
readonly systems: readonly PacketSystem[];
|
|
131
|
+
readonly tallies: readonly PacketTally[];
|
|
132
|
+
readonly intents: readonly PacketIntent[];
|
|
133
|
+
readonly phases: readonly PacketPhase[];
|
|
134
|
+
readonly commands: readonly PacketCatalogRow[];
|
|
135
|
+
readonly lines: readonly string[];
|
|
136
|
+
readonly provenance: PacketProvenance;
|
|
137
|
+
}
|
|
138
|
+
/** position's host note (R16) and the installed state, which no join checks before milestone generation-binding. */
|
|
139
|
+
export interface PacketHostNote extends HostNote {
|
|
140
|
+
readonly installed: 'unknown (no join checked here)';
|
|
141
|
+
}
|
|
142
|
+
/** The packet, its digest and the host note: printed together, never merged. */
|
|
143
|
+
export interface PacketOutput {
|
|
144
|
+
readonly packet: PositionPacket;
|
|
145
|
+
/** Graph's codec digest of `packet`, its canonical JSON text's SHA-256. */
|
|
146
|
+
readonly digest: string;
|
|
147
|
+
readonly hostNote: PacketHostNote;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The fields `node` states unconditionally at `field`, a `section.key` path. Exported on `./internal/packet` with
|
|
151
|
+
* `valuesAt`, `textsAt` and `stated`, the one copy of these readers workspace-runtime's host generators read records
|
|
152
|
+
* with (guard review finding G-N9).
|
|
153
|
+
*/
|
|
154
|
+
export declare function fieldsAt(node: CompiledRecord, field: string): readonly CompiledField[];
|
|
155
|
+
/** The values `node` states unconditionally at `field`, a list's items one by one. */
|
|
156
|
+
export declare const valuesAt: (node: CompiledRecord, field: string) => readonly CompiledValue[];
|
|
157
|
+
export declare const textsAt: (node: CompiledRecord, field: string) => readonly string[];
|
|
158
|
+
/** Whether `node` states `field` at all: a declared empty list is stated, an absent key is not. */
|
|
159
|
+
export declare const stated: (node: CompiledRecord, field: string) => boolean;
|
|
160
|
+
/**
|
|
161
|
+
* R19: the position packet through the scope token `within`, with its digest and host note. It calls position once,
|
|
162
|
+
* at K0, and reads the rest through the same token. `catalog` is copied in its order, each row's five fields only. A
|
|
163
|
+
* workspace with no participant renders none (B3). The refusals are position's alone: the packet renders the records
|
|
164
|
+
* admission admitted and gates none of them (design §4, LS-30).
|
|
165
|
+
*/
|
|
166
|
+
export declare function renderPacket(handle: ReadHandle, within: string, catalog: readonly PacketCatalogRow[]): PacketOutput;
|
|
167
|
+
/**
|
|
168
|
+
* B1: the packet's entries, design §4's formula. P participants + M mandates + 1 seat + N system lines + T tallies + 5
|
|
169
|
+
* intent rows + 4 phase rows + C catalog rows + 1 provenance + 3 SPEC lines; the host note is no entry.
|
|
170
|
+
*/
|
|
171
|
+
export declare function entryCount(packet: PositionPacket): number;
|
|
172
|
+
//# sourceMappingURL=packet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packet.d.ts","sourceRoot":"","sources":["../src/packet.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACN,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI9C;;;;;;;;;GASG;AAEH,gGAAgG;AAChG,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACp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AAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE,CAMtF;AACD,sFAAsF;AACtF,eAAO,MAAM,QAAQ,GAAI,MAAM,cAAc,EAAE,OAAO,MAAM,KAAG,SAAS,aAAa,EACQ,CAAC;AAC9F,eAAO,MAAM,OAAO,GAAI,MAAM,cAAc,EAAE,OAAO,MAAM,KAAG,SAAS,MAAM,EACI,CAAC;AAClF,mGAAmG;AACnG,eAAO,MAAM,MAAM,GAAI,MAAM,cAAc,EAAE,OAAO,MAAM,KAAG,OAA2C,CAAC;AAmBzG;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,YAAY,CAgKnH;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAazD"}
|
package/dist/packet.js
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { FLOOR_REGISTRATIONS, PHASES, PRIMITIVE_ANCHORS, PRIMITIVES, SHAPES, SHAPE_ROWS, isKind, } from '@inventarch/language';
|
|
2
|
+
import { digest, laneOf } from '@inventarch/graph';
|
|
3
|
+
import { MOVES } from './mandate-modes.js';
|
|
4
|
+
import { position } from './position.js';
|
|
5
|
+
import { statedText, valueText } from './render.js';
|
|
6
|
+
import { freeze } from './types.js';
|
|
7
|
+
const NO_PARTICIPANT = 'none (no authored @mandate names an @agent)';
|
|
8
|
+
const UNRESOLVED = 'unresolved';
|
|
9
|
+
const INSTALLED = 'unknown (no join checked here)';
|
|
10
|
+
const PHASE_CHANGES = '--phase selects the playbook cell delivered and decides conditional relation rows (decision conditional-relations-in-delivery)';
|
|
11
|
+
/** Design §4's three SPEC-owned lines, `ia scope` read as `ia position` (decision scope-verb-dispatch). */
|
|
12
|
+
const LINES = [
|
|
13
|
+
'run ia position; if it refuses, run the command it names',
|
|
14
|
+
'state intent to the CLI as shape + optional phase + optional seat + optional word; the CLI never receives free text',
|
|
15
|
+
"when a word's owner is not this workspace, delegate by re-seating at the owning system; a steward pointer is readable, not an invocation",
|
|
16
|
+
];
|
|
17
|
+
const LOWERS = /^lowers to ([a-z]+)$/;
|
|
18
|
+
const order = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
19
|
+
/**
|
|
20
|
+
* The fields `node` states unconditionally at `field`, a `section.key` path. Exported on `./internal/packet` with
|
|
21
|
+
* `valuesAt`, `textsAt` and `stated`, the one copy of these readers workspace-runtime's host generators read records
|
|
22
|
+
* with (guard review finding G-N9).
|
|
23
|
+
*/
|
|
24
|
+
export function fieldsAt(node, field) {
|
|
25
|
+
const [section, key] = field.split('.');
|
|
26
|
+
return node.sections
|
|
27
|
+
.filter((s) => s.name === section)
|
|
28
|
+
.flatMap((s) => s.fields)
|
|
29
|
+
.filter((f) => 'key' in f && f.key === key && f.when === undefined);
|
|
30
|
+
}
|
|
31
|
+
/** The values `node` states unconditionally at `field`, a list's items one by one. */
|
|
32
|
+
export const valuesAt = (node, field) => fieldsAt(node, field).flatMap((f) => (f.value.kind === 'list' ? f.value.items : [f.value]));
|
|
33
|
+
export const textsAt = (node, field) => valuesAt(node, field).flatMap((value) => ('text' in value ? [value.text] : []));
|
|
34
|
+
/** Whether `node` states `field` at all: a declared empty list is stated, an absent key is not. */
|
|
35
|
+
export const stated = (node, field) => fieldsAt(node, field).length > 0;
|
|
36
|
+
const isMove = (text) => MOVES.includes(text);
|
|
37
|
+
/** The `discriminators` rows a @system record states: each word, the kind it lowers to and its facets. */
|
|
38
|
+
function loweringsOf(node) {
|
|
39
|
+
return node.sections
|
|
40
|
+
.filter((s) => s.name === 'discriminators')
|
|
41
|
+
.flatMap((s) => s.fields)
|
|
42
|
+
.flatMap((f) => {
|
|
43
|
+
if (!('key' in f) || f.value.kind !== 'scalar')
|
|
44
|
+
return [];
|
|
45
|
+
const kind = LOWERS.exec(f.value.text)?.[1];
|
|
46
|
+
if (kind === undefined || !isKind(kind))
|
|
47
|
+
return [];
|
|
48
|
+
const facets = (f.fields ?? [])
|
|
49
|
+
.filter((child) => 'key' in child && child.key === 'facets')
|
|
50
|
+
.flatMap((child) => (child.value.kind === 'list' ? child.value.items : [child.value]))
|
|
51
|
+
.flatMap((value) => ('text' in value ? [value.text] : []));
|
|
52
|
+
return [{ word: f.key, kind, facets }];
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* R19: the position packet through the scope token `within`, with its digest and host note. It calls position once,
|
|
57
|
+
* at K0, and reads the rest through the same token. `catalog` is copied in its order, each row's five fields only. A
|
|
58
|
+
* workspace with no participant renders none (B3). The refusals are position's alone: the packet renders the records
|
|
59
|
+
* admission admitted and gates none of them (design §4, LS-30).
|
|
60
|
+
*/
|
|
61
|
+
export function renderPacket(handle, within, catalog) {
|
|
62
|
+
const k0 = position(handle, within), body = k0.body, read = { within }, snapshot = handle.snapshot(read), records = snapshot.records.filter((node) => node.placement.kind !== 'runtime'), nodes = new Map(records.map((node) => [node.identity, node]));
|
|
63
|
+
const viewed = new Map();
|
|
64
|
+
const rowsOf = (identity) => {
|
|
65
|
+
let rows = viewed.get(identity);
|
|
66
|
+
if (rows === undefined)
|
|
67
|
+
viewed.set(identity, (rows = handle.directedView(identity, read).filter((row) => nodes.has(row.counterpart))));
|
|
68
|
+
return rows;
|
|
69
|
+
};
|
|
70
|
+
/** The admitted records `identity`'s typed field references at `field` resolve to. */
|
|
71
|
+
const targetsOf = (identity, field) => rowsOf(identity)
|
|
72
|
+
.filter((row) => row.kind === 'field-ref' && row.direction === 'out' && row.field === field)
|
|
73
|
+
.map((row) => row.counterpart);
|
|
74
|
+
/** Each reference `node` states at `field`, once: the admitted record it resolves to, or the reference as authored. */
|
|
75
|
+
const refsAt = (node, field) => {
|
|
76
|
+
const targets = targetsOf(node.identity, field);
|
|
77
|
+
return [
|
|
78
|
+
...new Set(valuesAt(node, field).flatMap((value) => value.kind !== 'ref'
|
|
79
|
+
? []
|
|
80
|
+
: [
|
|
81
|
+
targets.find((target) => {
|
|
82
|
+
const counterpart = nodes.get(target);
|
|
83
|
+
return (counterpart.discriminator === value.discriminator && counterpart.name === value.name.toLowerCase());
|
|
84
|
+
}) ?? valueText(value),
|
|
85
|
+
])),
|
|
86
|
+
];
|
|
87
|
+
};
|
|
88
|
+
const seatId = body.seat.identity, seat = seatId === undefined ? undefined : nodes.get(seatId);
|
|
89
|
+
// Participants and mandates (B3): the authored mandates body(K0) lists whose participant resolves to an authored
|
|
90
|
+
// @agent, each read through the same token; an @agent once however many mandates name it. Each authority field is
|
|
91
|
+
// rendered as admitted, never judged: a declared `moves []` is `moves: []`, an absent key no field, and a reference
|
|
92
|
+
// with a fragment the record it resolves to.
|
|
93
|
+
const mandates = [], agents = new Map();
|
|
94
|
+
for (const pointer of body.mandates) {
|
|
95
|
+
const node = nodes.get(pointer.identity), participant = targetsOf(node.identity, 'authority.participant')[0], agent = participant === undefined ? undefined : nodes.get(participant);
|
|
96
|
+
if (node.band !== 100 || agent?.discriminator !== 'agent' || agent.band !== 100)
|
|
97
|
+
continue;
|
|
98
|
+
const says = statedText(agent, 'meaning.says');
|
|
99
|
+
mandates.push({
|
|
100
|
+
identity: node.identity,
|
|
101
|
+
participant: agent.identity,
|
|
102
|
+
...(stated(node, 'authority.moves') ? { moves: textsAt(node, 'authority.moves').filter(isMove) } : {}),
|
|
103
|
+
scope: refsAt(node, 'authority.scope'),
|
|
104
|
+
...(stated(node, 'authority.excluded-words') ? { excludedWords: textsAt(node, 'authority.excluded-words') } : {}),
|
|
105
|
+
...(stated(node, 'authority.covers') ? { covers: textsAt(node, 'authority.covers') } : {}),
|
|
106
|
+
});
|
|
107
|
+
agents.set(agent.identity, { identity: agent.identity, ...(says === undefined ? {} : { says }) });
|
|
108
|
+
}
|
|
109
|
+
mandates.sort((a, b) => order(a.identity, b.identity));
|
|
110
|
+
const participants = [...agents.values()].sort((a, b) => order(a.identity, b.identity));
|
|
111
|
+
// System pointer lines (B4): one per `composition.systems` reference of the seat, by identity.
|
|
112
|
+
const systems = (seat === undefined ? [] : refsAt(seat, 'composition.systems'))
|
|
113
|
+
.map((identity) => {
|
|
114
|
+
const node = nodes.get(identity);
|
|
115
|
+
if (node === undefined)
|
|
116
|
+
return { identity, words: UNRESOLVED, steward: UNRESOLVED };
|
|
117
|
+
const steward = targetsOf(identity, 'head.steward')[0];
|
|
118
|
+
return {
|
|
119
|
+
identity,
|
|
120
|
+
words: [...new Set(loweringsOf(node).map((row) => row.word))].sort(order),
|
|
121
|
+
band: node.band,
|
|
122
|
+
...(steward === undefined ? {} : { steward }),
|
|
123
|
+
reach: `ia position --seat ${identity}`,
|
|
124
|
+
};
|
|
125
|
+
})
|
|
126
|
+
.sort((a, b) => order(a.identity, b.identity));
|
|
127
|
+
const steward = seat === undefined ? undefined : refsAt(seat, 'composition.steward')[0];
|
|
128
|
+
// Captured-record tallies, per word: the band-100 capture members (db D02a) under the seat's own declared roots, as
|
|
129
|
+
// position composes a workspace seat's (R15). A seat that declares no root has none, which body(K0)'s `sources`
|
|
130
|
+
// unknown says; its fallback closure is what position may enter, not what the workspace captures.
|
|
131
|
+
const roots = handle.roots(read), own = new Set(roots.filter((r) => r.workspace === seatId).map((r) => r.root));
|
|
132
|
+
const counts = new Map();
|
|
133
|
+
for (const row of snapshot.membership) {
|
|
134
|
+
const node = nodes.get(row.identity);
|
|
135
|
+
if (node?.band !== 100 || !own.has(row.root))
|
|
136
|
+
continue;
|
|
137
|
+
counts.set(node.discriminator, (counts.get(node.discriminator) ?? 0) + 1);
|
|
138
|
+
}
|
|
139
|
+
const tallies = [...counts].map(([word, count]) => ({ word, count })).sort((a, b) => order(a.word, b.word));
|
|
140
|
+
// The intent table: the five shapes, each with the registered words it seeds, read from the floor's two
|
|
141
|
+
// registrations and the admitted @system records' lowering rows (the first by identity, should two lower one word).
|
|
142
|
+
const registered = new Set(handle.words(read)), lowered = new Map(FLOOR_REGISTRATIONS.map((r) => [r.keyword, { word: r.keyword, kind: r.kind, facets: r.facets }]));
|
|
143
|
+
for (const node of [...records].sort((a, b) => order(a.identity, b.identity)))
|
|
144
|
+
if (node.discriminator === 'system')
|
|
145
|
+
for (const row of loweringsOf(node))
|
|
146
|
+
if (!lowered.has(row.word))
|
|
147
|
+
lowered.set(row.word, row);
|
|
148
|
+
const words = [...lowered.values()].filter((row) => registered.has(row.word)).sort((a, b) => order(a.word, b.word));
|
|
149
|
+
const intents = SHAPES.map((shape) => {
|
|
150
|
+
const row = SHAPE_ROWS[shape], kinds = row.kinds, lanes = row.lanes;
|
|
151
|
+
return {
|
|
152
|
+
shape,
|
|
153
|
+
category: row.category,
|
|
154
|
+
primitive: row.primitive,
|
|
155
|
+
phase: PRIMITIVE_ANCHORS[row.primitive],
|
|
156
|
+
// Copies: the packet is frozen whole, and the kernel's rows are not this packet's to freeze.
|
|
157
|
+
kinds: [...kinds],
|
|
158
|
+
lanes: [...lanes],
|
|
159
|
+
predicates: [...row.predicates],
|
|
160
|
+
priming: [...row.priming],
|
|
161
|
+
words: words
|
|
162
|
+
.filter(({ kind, facets }) => kinds.includes(kind) ||
|
|
163
|
+
(facets.length > 0 ? facets : ['']).some((facet) => lanes.includes(laneOf({ kind, facet }))))
|
|
164
|
+
.map(({ word }) => word),
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
const phases = PHASES.map((phase) => ({
|
|
168
|
+
phase,
|
|
169
|
+
primitives: PRIMITIVES.filter((primitive) => PRIMITIVE_ANCHORS[primitive] === phase),
|
|
170
|
+
changes: PHASE_CHANGES,
|
|
171
|
+
}));
|
|
172
|
+
const packet = {
|
|
173
|
+
format: 'ia.position-packet.v1',
|
|
174
|
+
revision: body.revision,
|
|
175
|
+
body: k0.digest,
|
|
176
|
+
seat: {
|
|
177
|
+
...(seatId === undefined ? {} : { identity: seatId }),
|
|
178
|
+
sources: seat === undefined ? [] : textsAt(seat, 'composition.sources'),
|
|
179
|
+
systems: systems.length,
|
|
180
|
+
...(steward === undefined ? {} : { steward }),
|
|
181
|
+
...(participants.length === 0 ? { participants: NO_PARTICIPANT } : {}),
|
|
182
|
+
},
|
|
183
|
+
participants,
|
|
184
|
+
mandates,
|
|
185
|
+
systems,
|
|
186
|
+
tallies,
|
|
187
|
+
intents,
|
|
188
|
+
phases,
|
|
189
|
+
commands: catalog.map(({ command, mode, move, refuses, next }) => ({ command, mode, move, refuses, next })),
|
|
190
|
+
lines: [...LINES],
|
|
191
|
+
provenance: { revision: body.revision, ...(seat === undefined ? {} : { slug: seat.name }) },
|
|
192
|
+
};
|
|
193
|
+
return freeze({ packet, digest: digest(packet), hostNote: { ...k0.hostNote, installed: INSTALLED } });
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* B1: the packet's entries, design §4's formula. P participants + M mandates + 1 seat + N system lines + T tallies + 5
|
|
197
|
+
* intent rows + 4 phase rows + C catalog rows + 1 provenance + 3 SPEC lines; the host note is no entry.
|
|
198
|
+
*/
|
|
199
|
+
export function entryCount(packet) {
|
|
200
|
+
return (packet.participants.length +
|
|
201
|
+
packet.mandates.length +
|
|
202
|
+
1 +
|
|
203
|
+
packet.systems.length +
|
|
204
|
+
packet.tallies.length +
|
|
205
|
+
packet.intents.length +
|
|
206
|
+
packet.phases.length +
|
|
207
|
+
packet.commands.length +
|
|
208
|
+
1 +
|
|
209
|
+
packet.lines.length);
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=packet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packet.js","sourceRoot":"","sources":["../src/packet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,MAAM,EACN,UAAU,EACV,MAAM,GACP,MAAM,sBAAsB,CAAC;AAc9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CA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