@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/machine-protocol.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The machine protocol's one description (docs/specs/
|
|
2
|
+
* The machine protocol's one description (docs/specs/consumer-cli-contract/README.md §1.2). For each Door operation:
|
|
3
3
|
* its purpose, parameter schema, result, refusals with a next action, and an example that returns `ok: true` on
|
|
4
|
-
* packages/compliance/fixtures/loop
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* table
|
|
4
|
+
* packages/compliance/fixtures/loop, or for `next`, as that fixture authors no @plan, on the delivery fixture
|
|
5
|
+
* packages/runtime/tests/fixtures/delivery/base laid over the conformance corpus. `ia <operation> --help` (the version
|
|
6
|
+
* 1 operations, which are the CLI's machine routes), the MCP door's tools/list and docs/reference/cli/machine-protocol.md
|
|
7
|
+
* are projections of this table. It describes the frozen wire format and changes none of it: the Door validates every
|
|
8
|
+
* request itself, and tests/select-door.test.ts, tests/door-read.test.ts, tests/next.test.ts,
|
|
9
|
+
* tests/door-position.test.ts and apps/cli/tests/cli.test.ts hold this table to what the Door admits and refuses. A
|
|
10
|
+
* later version only appends operations (`since`), so the version 1 rows stay byte-identical to 1.1.0's
|
|
11
|
+
* (tests/golden/machine-protocol-v1.json).
|
|
8
12
|
*/
|
|
9
13
|
import { COORDINATE_DOMAINS } from './coordinate.js';
|
|
14
|
+
import { SCOPE_KEY_CAPS } from './scope-key.js';
|
|
10
15
|
import { freeze } from './types.js';
|
|
11
16
|
const text = (description) => ({ type: 'string', description });
|
|
12
17
|
const strings = (description) => ({ type: 'array', items: { type: 'string' }, description });
|
|
@@ -122,13 +127,16 @@ const REQUESTED = [REQUEST_INVALID, SCOPE_UNAVAILABLE, REVISION_MISMATCH, COORDI
|
|
|
122
127
|
const EXAMPLE_IDENTITY = 'governance-system/definition/procedure/sample-procedure';
|
|
123
128
|
/** Frozen deeply, so a projection that shares its schema objects (the MCP tools) cannot change it. */
|
|
124
129
|
export const MACHINE_PROTOCOL = freeze({
|
|
125
|
-
version:
|
|
130
|
+
version: 2,
|
|
126
131
|
flow: [
|
|
127
132
|
'scope issues a token that bounds later reads by phase or identities, and by root only where sources declare a reach. It is optional: without within, a call reads the initial boundary.',
|
|
128
133
|
'context delivers the cited procedure cells and governance that apply to a coordinate; select chooses exactly one binding among candidates, or refuses.',
|
|
129
134
|
'get, records, resolve, search and traverse read admitted records inside the scope; pass within to stay inside a narrowed one.',
|
|
130
135
|
'A token lives as long as the process that issued it: one CLI invocation, or the MCP server process. A CLI invocation performs one operation, so its reads always cover the initial boundary; narrowing takes scope, then within, in one MCP session.',
|
|
131
136
|
"report is privileged inspection of the whole workspace's admission, served by the CLI only.",
|
|
137
|
+
'Version 2 adds read: the body behind one locator inside the scope, with its digest. The Door and the MCP door serve it; on the CLI the consumer verb ia read returns the same body and digest, and the machine routes stay the version 1 operations.',
|
|
138
|
+
"Version 2 also adds next: one plan's delivery view inside the scope, its tasks in prerequisite order with their verdicts, computed per call and never stored. The Door and the MCP door serve it, and on the CLI the consumer verb ia next prints the same view. Its refusals carry next, the one command to run, and the plans or the cycle they name.",
|
|
139
|
+
'Version 2 also adds position: body(K), what a scope key (seat, shape, phase, depth, budget, word) loads inside the scope, with its digest and a host note beside it. The body is a pure function of the key and the admitted revision, so one key reads one body and digest wherever the workspace is, and nothing text-driven runs. The Door and the MCP door serve it, and the machine routes stay the version 1 operations. A refusal of the key carries next, the one command to run.',
|
|
132
140
|
],
|
|
133
141
|
operations: [
|
|
134
142
|
{
|
|
@@ -302,6 +310,134 @@ export const MACHINE_PROTOCOL = freeze({
|
|
|
302
310
|
example: {},
|
|
303
311
|
mcp: null,
|
|
304
312
|
},
|
|
313
|
+
{
|
|
314
|
+
name: 'read',
|
|
315
|
+
summary: 'Read the body behind one locator inside the scope, with its digest.',
|
|
316
|
+
description: "Read the body behind one locator inside the scope: a cell's or requirement's text for a fragment, else the document the record's source locator names (the section under its markdown anchor), else the record's own body. digest is the SHA-256 of the body's UTF-8 bytes; a read certifies nothing. A locator outside the scope is refused without naming what lies outside it.",
|
|
317
|
+
params: object({
|
|
318
|
+
within: read.within,
|
|
319
|
+
locator: text('<identity>, <identity>#<phase>/<Primitive>, <identity>#<REQ-ID> or <path>:<line>, the path relative to the workspace root.'),
|
|
320
|
+
includeRuntime: {
|
|
321
|
+
type: 'boolean',
|
|
322
|
+
description: 'Read a record at runtime placement (band 0), which is refused otherwise; default false.',
|
|
323
|
+
},
|
|
324
|
+
}, ['locator']),
|
|
325
|
+
result: "The body: {locator, identity, kind, path?, digest, body, certified: false}. kind is record for a record's own body or a fragment's text, and document for the file its source locator names, at the workspace-relative path.",
|
|
326
|
+
refusals: [
|
|
327
|
+
REQUEST_INVALID,
|
|
328
|
+
SCOPE_UNAVAILABLE,
|
|
329
|
+
{
|
|
330
|
+
code: 'IA-RUNTIME-READ-UNADMITTED',
|
|
331
|
+
when: "No admitted record inside the scope answers the locator. In a scope narrower than the whole workspace the refusal names no path, line, identity or refused record; on the whole workspace's scope it says what the workspace's sources hold there, a record admission refused with its path, line and reason.",
|
|
332
|
+
next: 'Read a locator that records or search returns in this scope, or widen the scope.',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
code: 'IA-RUNTIME-READ-FRAGMENT',
|
|
336
|
+
when: 'The record has no cell at the phase/Primitive address, or no requirement with the id.',
|
|
337
|
+
next: 'Read a cell address or requirement id that get returns for the record, or the record without a fragment.',
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
code: 'IA-RUNTIME-READ-UNREACHABLE',
|
|
341
|
+
when: "The document the record's source locator names cannot be read: a URL, a path outside the workspace or the record's tree, an adopted mount bound to no directory, a nonportable path, a missing, linked or oversized file, bytes that are not UTF-8, or an anchor no markdown heading has.",
|
|
342
|
+
next: "Restore the file the refusal's path names, or correct the record's source locator, which get shows with its source line.",
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
code: 'IA-RUNTIME-READ-PLACEMENT',
|
|
346
|
+
when: 'The record is at runtime placement (band 0) and includeRuntime is not true.',
|
|
347
|
+
next: 'Pass includeRuntime: true to read it.',
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
example: { locator: `${EXAMPLE_IDENTITY}#act/Decision` },
|
|
351
|
+
mcp: 'ia_read',
|
|
352
|
+
since: 2,
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: 'next',
|
|
356
|
+
summary: "Read one plan's delivery view inside the scope: its tasks in order, each with a verdict.",
|
|
357
|
+
description: "Read one plan's delivery view inside the scope, computed per call and never stored: its milestones and tasks in one prerequisites-first order, each task with a basis line per requirement (its own and its milestone's), one verdict (exit evidence recorded, no declared blocker, or blocked), its work.status as self-declared, which is never a basis, and five state lines; then review items and the next task. Exit evidence is a success @observation on the task whose subject-revision is its current digest. What the scope does not read is never counted as met, and a relation row that carries a condition counts only where it holds at the coordinate the scope binds, as graph traversal decides it: a term that coordinate leaves undecided, such as a phase where none is bound or a severity the stating record's own does not decide, leaves the row conditional, its basis unknown, never met.",
|
|
358
|
+
params: object({
|
|
359
|
+
within: read.within,
|
|
360
|
+
seat: text("A @plan, @milestone or @task identity; the view is that plan's, or the plan of that milestone or task. Omitted, the only admitted @plan at authored placement (band 100)."),
|
|
361
|
+
}),
|
|
362
|
+
result: 'The view: {format: ia.delivery-view.v1, revision, plan, milestones, tasks, review, next, summary}. Each task is {identity, milestone, status, prerequisites, verdict, line, evidence?, states}; next is the command for the first task with no declared blocker, or null when every task has exit evidence or every other one is blocked, which summary says.',
|
|
363
|
+
refusals: [
|
|
364
|
+
REQUEST_INVALID,
|
|
365
|
+
SCOPE_UNAVAILABLE,
|
|
366
|
+
{
|
|
367
|
+
code: 'IA-RUNTIME-NEXT-SEAT',
|
|
368
|
+
when: 'seat is not an admitted record in the scope, or is not a @plan, @milestone or @task.',
|
|
369
|
+
next: "Run the command the refusal's next names: the view without a seat for a seat no admitted record answers (ia next, the first authored plan's, or ia next --help when none is authored), or the position of a record of another word.",
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
code: 'IA-RUNTIME-NEXT-NO-PLAN',
|
|
373
|
+
when: 'seat belongs to no admitted @plan, or no seat is given and no @plan is authored at band 100.',
|
|
374
|
+
next: "Author a @plan, @milestone records that name it in work.plan and @task records that name those in work.milestone; the refusal's next names the help that says so.",
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
code: 'IA-RUNTIME-NEXT-AMBIGUOUS',
|
|
378
|
+
when: 'No seat is given and several @plan records are authored at band 100; the refusal lists them in plans.',
|
|
379
|
+
next: "Pass one of plans as seat, as the refusal's next does with the first.",
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
code: 'IA-RUNTIME-NEXT-CYCLE',
|
|
383
|
+
when: "The plan's require rows form a cycle among its tasks, milestones or both, so no order exists; the refusal lists the cycle's declared rows in cycle.",
|
|
384
|
+
next: "Remove one of the require rows in cycle; the refusal's next names the position of its first task, or else its first milestone.",
|
|
385
|
+
},
|
|
386
|
+
],
|
|
387
|
+
example: {},
|
|
388
|
+
mcp: 'ia_next',
|
|
389
|
+
since: 2,
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: 'position',
|
|
393
|
+
summary: 'Read body(K), what a scope key loads inside the scope, with its digest and host note.',
|
|
394
|
+
description: "Read the position a scope key K = (seat, shape, phase, depth, budget, word) names inside the scope: body(K), the seat, the records the key loads in the shape's order, the blocking governance reserved outside the budget, pointers and their tallies, the rules and playbooks that apply by word with their tallies and the playbook cells they deliver, the mandates that govern the seat, the frontier one hop past it, what is unknown and the keys that widen it; its digest; and the host note beside it. A key naming no part is K0 (the repository's @workspace, context, orient, depth 0, budget 0); one naming any part takes context, the anchor phase of its shape's primitive, depth 1 and budget 16 for the rest. A relation row with a condition is followed only where the condition holds at the key's coordinate. The body is a pure function of the key and the admitted records the scope reads: it names no root path, token, time or capture, nothing text-driven runs, and no record body enters it, only the cells delivered; read fetches a body. A refusal of the key carries next, the one command to run.",
|
|
395
|
+
params: object({
|
|
396
|
+
within: read.within,
|
|
397
|
+
seat: {
|
|
398
|
+
anyOf: [
|
|
399
|
+
{ type: 'string' },
|
|
400
|
+
object({ path: text('Workspace-relative, or an absolute path inside the workspace root.') }, ['path'], 'A location.'),
|
|
401
|
+
],
|
|
402
|
+
description: "S: an identity the scope admits, or {path} for a location inside the workspace. Omitted, the repository's own @workspace.",
|
|
403
|
+
},
|
|
404
|
+
shape: {
|
|
405
|
+
type: 'string',
|
|
406
|
+
enum: COORDINATE_DOMAINS.shape,
|
|
407
|
+
description: 'H, the intent shape; omitted, context.',
|
|
408
|
+
},
|
|
409
|
+
phase: {
|
|
410
|
+
type: 'string',
|
|
411
|
+
enum: COORDINATE_DOMAINS.phase,
|
|
412
|
+
description: "P; omitted, the anchor phase of the shape's primitive.",
|
|
413
|
+
},
|
|
414
|
+
depth: {
|
|
415
|
+
type: 'integer',
|
|
416
|
+
minimum: 0,
|
|
417
|
+
maximum: SCOPE_KEY_CAPS.depth,
|
|
418
|
+
description: "d, the rows a body hops along the shape's predicate focus; omitted, 1, or 0 when no part is named (K0).",
|
|
419
|
+
},
|
|
420
|
+
budget: {
|
|
421
|
+
type: 'integer',
|
|
422
|
+
minimum: 0,
|
|
423
|
+
maximum: SCOPE_KEY_CAPS.budget,
|
|
424
|
+
description: 'n, the entries loaded beyond the seat, blocking governance reserved outside it; omitted, 16, or 0 when no part is named (K0).',
|
|
425
|
+
},
|
|
426
|
+
word: text('w, a word the closure registers: only records of it load, are pointers or are tallied as pointers or frontier; the reserved rules, the rules and playbooks that apply by word with their tallies and cells, and the mandates are listed whatever their word. Omitted, none.'),
|
|
427
|
+
}),
|
|
428
|
+
result: "The position: {body, digest, hostNote}. body is body(K) in the format ia.position-body.v1, its key the one resolved and its revision that of the view the scope reads; digest is the SHA-256 of the body's canonical JSON text; hostNote is {revision, capturedRevision?, previousRevision?, freshness, key}, host state never digested, freshness current, stale or no-capture against the last capture and key the key as completed.",
|
|
429
|
+
refusals: [
|
|
430
|
+
{
|
|
431
|
+
code: 'IA-RUNTIME-REQUEST-INVALID',
|
|
432
|
+
when: 'A parameter is unknown or within is not a string, or the key breaks a bound: a shape or phase outside its closed set, a depth outside 0..2 or a budget outside 0..64, a seat that is neither an identity nor {path}, one the scope does not admit or at runtime placement, a path outside the workspace, or a word the closure does not register.',
|
|
433
|
+
next: "Run the command a refusal of the key names as next: the part's closed set or cap, ia vocabulary for a word, or the position without the seat. Otherwise match the parameters to this operation's schema.",
|
|
434
|
+
},
|
|
435
|
+
SCOPE_UNAVAILABLE,
|
|
436
|
+
],
|
|
437
|
+
example: { seat: EXAMPLE_IDENTITY, shape: 'governance' },
|
|
438
|
+
mcp: 'ia_position',
|
|
439
|
+
since: 2,
|
|
440
|
+
},
|
|
305
441
|
],
|
|
306
442
|
differences: [
|
|
307
443
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine-protocol.js","sourceRoot":"","sources":["../src/machine-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAiCpC,MAAM,IAAI,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;AACxE,MAAM,OAAO,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;AACrG,MAAM,MAAM,GAAG,CAAC,UAAmC,EAAE,WAA8B,EAAE,EAAE,WAAoB,EAAE,EAAE,CAAC,CAAC;IAC/G,IAAI,EAAE,QAAQ;IACd,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACrD,UAAU;IACV,QAAQ;IACR,oBAAoB,EAAE,KAAK;CAC5B,CAAC,CAAC;AACH,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAC7B,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CACrG,CAAC;AACF,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,QAA4B,EAAE,EAAE,CAAC,CAAC;IACzE,IAAI,EAAE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ACT,+HAA+H;iBAClI;gBACD,IAAI,EAAE,IAAI,CACR,6QAA6Q,CAC9Q;aACF,CAAC;YACF,MAAM,EACJ,waAAwa;YAC1a,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,4BAA4B;oBAClC,IAAI,EAAE,mVAAmV;oBACzV,IAAI,EAAE,0MAA0M;iBACjN;gBACD,iBAAiB;aAClB;YACD,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,EAAE;YACxD,GAAG,EAAE,aAAa;YAClB,KAAK,EAAE,CAAC;SACT;KACF;IACD,WAAW,EAAE;QACX;YACE,KAAK,EAAE,QAAQ;YACf,GAAG,EAAE,mDAAmD;YACxD,GAAG,EAAE,iDAAiD;SACvD;QACD;YACE,KAAK,EAAE,YAAY;YACnB,GAAG,EAAE,4EAA4E;YACjF,GAAG,EAAE,qDAAqD;SAC3D;QACD;YACE,KAAK,EAAE,gBAAgB;YACvB,GAAG,EAAE,yHAAyH;YAC9H,GAAG,EAAE,8EAA8E;SACpF;QACD;YACE,KAAK,EAAE,WAAW;YAClB,GAAG,EAAE,sEAAsE;YAC3E,GAAG,EAAE,0DAA0D;SAChE;QACD;YACE,KAAK,EAAE,gBAAgB;YACvB,GAAG,EAAE,uCAAuC;YAC5C,GAAG,EAAE,0EAA0E;SAChF;QACD;YACE,KAAK,EAAE,UAAU;YACjB,GAAG,EAAE,yMAAyM;YAC9M,GAAG,EAAE,wGAAwG;SAC9G;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ReadHandle } from '@inventarch/db';
|
|
2
|
+
import type { RuntimeWhere } from './errors.js';
|
|
3
|
+
import type { HostHookDeclaration } from './packet-host.js';
|
|
4
|
+
import type { HookCode } from './steward.js';
|
|
5
|
+
/**
|
|
6
|
+
* The `@mandate` edit guard (milestone generation-binding, plan amendment C10; operator decision OD4): whether one file
|
|
7
|
+
* edit an authored `@hook` selects may proceed, decided from admitted records only. The caller (steward-hook's
|
|
8
|
+
* `--hook` mode) owns the event, the path's safety, the managed-state protection and the hook record's admission as a
|
|
9
|
+
* declaration; this module only reads the reader through the scope token, as evaluateSteward does for the retired
|
|
10
|
+
* steward guard.
|
|
11
|
+
*
|
|
12
|
+
* - A hook decides an edit only when its `hook.paths` select the file and its `hook.tools` name the event's tool (C10).
|
|
13
|
+
* Any other edit is allowed. A workspace protects its governing records (the `.ia/src` sources of its hooks, mandates
|
|
14
|
+
* and profiles) by selecting them in a hook, such as `paths [".ia/src/**"]`.
|
|
15
|
+
* - The actor (OD4) is resolved first: an event that carries `agent_id` is a subagent, which acts as the
|
|
16
|
+
* `composition.agent` of the one authored `@agent-profile` whose name is exactly its `agent_type`; a subagent no such
|
|
17
|
+
* profile names is refused at every path the hook selects, governed or not. Any other event is the main session, a
|
|
18
|
+
* session launched with `--agent` included: it acts as the default actor (OD1) of the workspace position seats the path
|
|
19
|
+
* in.
|
|
20
|
+
* - The mandates that govern a decided edit are C1's (`governingMandates`) for the path and that workspace, so a mandate
|
|
21
|
+
* scoped to the workspace governs every path a hook selects in it, beside those whose `authority.covers` claims the path.
|
|
22
|
+
* With none, an established actor (and the main session) is allowed: a mandate only adds restrictions.
|
|
23
|
+
* - The edit is allowed when C1's profile allows the author mode (Synthesis) for that actor: a governing mandate that binds
|
|
24
|
+
* it (its participant, or one that names no participant, which binds every established actor) grants Synthesis.
|
|
25
|
+
* Otherwise it is refused with the hook's message and the profile's one next command,
|
|
26
|
+
* `ia position --seat <mandate> --shape governance`.
|
|
27
|
+
*
|
|
28
|
+
* Excluded words are not judged: the guard sees file bytes, not records, and `ia author` and `ia preview` enforce them.
|
|
29
|
+
* Paths are matched in the G06c dialect (`selects`): `!`, `[` and every other character but `*`, `?` and `/` are
|
|
30
|
+
* literal. `fold` (db `pathKey`, which folds case on win32 and darwin whatever the volume) keys both a selection and
|
|
31
|
+
* the path, for `hook.paths` and `authority.covers` alike.
|
|
32
|
+
*/
|
|
33
|
+
export interface MandateGuardRequest {
|
|
34
|
+
/** The authored hook the registration names, as hook generation declares it. */
|
|
35
|
+
readonly hook: Pick<HostHookDeclaration, 'identity' | 'tools' | 'paths' | 'message'>;
|
|
36
|
+
/** The event's `tool_name`. */
|
|
37
|
+
readonly tool: string;
|
|
38
|
+
/** Every workspace-relative spelling the caller resolved for the edited file, the canonical one first. */
|
|
39
|
+
readonly paths: readonly string[];
|
|
40
|
+
/** The event's `agent_id`, as received; present marks a subagent. */
|
|
41
|
+
readonly agentId?: unknown;
|
|
42
|
+
/** The event's `agent_type`, as received. */
|
|
43
|
+
readonly agentType?: unknown;
|
|
44
|
+
/** A key applied to a selection and a path before they are matched: db `pathKey`, folding case on win32 and darwin. */
|
|
45
|
+
readonly fold?: (text: string) => string;
|
|
46
|
+
/**
|
|
47
|
+
* The workspace root the registration names, so that a next command that cannot find the root itself carries it:
|
|
48
|
+
* `ia report`, the version 1 machine route, opens its `--root` or the working directory, never an ancestor.
|
|
49
|
+
*/
|
|
50
|
+
readonly root?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface MandateGuardDecision {
|
|
53
|
+
readonly allowed: boolean;
|
|
54
|
+
/** Whether the hook decides the edit at all; an edit it does not select is allowed. */
|
|
55
|
+
readonly selected: boolean;
|
|
56
|
+
/** Present exactly when refused. */
|
|
57
|
+
readonly code?: HookCode;
|
|
58
|
+
readonly message: string;
|
|
59
|
+
/** The `@agent` the edit acts as, once established. */
|
|
60
|
+
readonly actor?: string;
|
|
61
|
+
/** The one next command a refusal names. */
|
|
62
|
+
readonly next?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Present when an IA-HOOK-MANDATE-UNAVAILABLE refusal concerns one `@mandate`: where it is authored, as the resolver
|
|
65
|
+
* located it (RuntimeError `where`).
|
|
66
|
+
*/
|
|
67
|
+
readonly where?: RuntimeWhere;
|
|
68
|
+
}
|
|
69
|
+
/** Whether the hook decides the edit: its tools name the tool and its paths select a spelling of the file (C10). */
|
|
70
|
+
export declare function mandateGuardSelects(request: MandateGuardRequest): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Decide one edit (see the module comment). A mandate whose authority cannot be read refuses a selected edit as
|
|
73
|
+
* IA-HOOK-MANDATE-UNAVAILABLE, naming its governance position; so, while any authored `@mandate` fails admission (lane
|
|
74
|
+
* D), does every selected edit, whoever acts, naming the mandate's `path:line` and `ia report` (`root` spelled when the
|
|
75
|
+
* request carries it). An edit the hook does not select is still allowed.
|
|
76
|
+
*/
|
|
77
|
+
export declare function evaluateMandateGuard(reader: ReadHandle, within: string, request: MandateGuardRequest): MandateGuardDecision;
|
|
78
|
+
/** Whether a known root can appear in a suggested shell command, double-quoted when it contains spaces. */
|
|
79
|
+
export declare function inertCommandRoot(root: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Lane D, review findings D-R1 and D-N2: the admission report command (`ia report`, the version 1 machine route no
|
|
82
|
+
* mandate gates) for a workspace root, spelled so no shell reads anything in it. `root` is printed, with forward slashes
|
|
83
|
+
* on win32, only when every character is inert unquoted (`INERT_ROOT`); otherwise no path is printed and `fromRoot` says
|
|
84
|
+
* the command is run from the workspace root, where `ia report` opens the working directory. A root is never wrapped in
|
|
85
|
+
* double quotes, where `$` and backticks stay live.
|
|
86
|
+
*/
|
|
87
|
+
export declare function admissionReport(root?: string): {
|
|
88
|
+
readonly command: string;
|
|
89
|
+
readonly fromRoot: boolean;
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=mandate-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mandate-guard.d.ts","sourceRoot":"","sources":["../src/mandate-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAShD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,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M,EAAE,MAAM,EACd,OAAO,EAAE,mBAAmB,GAC3B,oBAAoB,CAmFtB;AAGD,2GAA2G;AAC3G,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKtD;AACD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAKvG"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { selects } from '@inventarch/graph';
|
|
2
|
+
import { RuntimeError } from './errors.js';
|
|
3
|
+
import { defaultActor, governingMandates, isAdmissionRefusal, profileRefusal, seatedWorkspace, } from './mandate-modes.js';
|
|
4
|
+
import { freeze } from './types.js';
|
|
5
|
+
const LIMIT = 512;
|
|
6
|
+
const governance = (seat) => `ia position --seat ${seat} --shape governance`;
|
|
7
|
+
const order = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
8
|
+
/** Whether the hook decides the edit: its tools name the tool and its paths select a spelling of the file (C10). */
|
|
9
|
+
export function mandateGuardSelects(request) {
|
|
10
|
+
const fold = request.fold ?? ((text) => text);
|
|
11
|
+
if (!request.hook.tools.includes(request.tool))
|
|
12
|
+
return false;
|
|
13
|
+
return request.paths.some((path) => request.hook.paths.some((selection) => selects(fold(selection), fold(path))));
|
|
14
|
+
}
|
|
15
|
+
/** OD4's actor, through the scope token `within`; `workspace` is the workspace position seats the path in, if one. */
|
|
16
|
+
function acting(reader, within, request, workspace) {
|
|
17
|
+
const { agentId, agentType } = request;
|
|
18
|
+
if (agentId !== undefined) {
|
|
19
|
+
if (typeof agentId !== 'string' || agentId === '' || agentId.length > LIMIT)
|
|
20
|
+
return { refusal: 'the subagent event carries a malformed agent_id', subagent: true };
|
|
21
|
+
if (typeof agentType !== 'string' || agentType === '' || agentType.length > LIMIT)
|
|
22
|
+
return { refusal: 'the subagent event names no agent_type', subagent: true };
|
|
23
|
+
const profiles = reader
|
|
24
|
+
.records({ within })
|
|
25
|
+
.filter((node) => node.discriminator === 'agent-profile' && node.band === 100 && node.name === agentType);
|
|
26
|
+
if (profiles.length !== 1)
|
|
27
|
+
return {
|
|
28
|
+
refusal: `subagent ${agentType} matches no single authored @agent-profile of that name`,
|
|
29
|
+
subagent: true,
|
|
30
|
+
};
|
|
31
|
+
const profile = profiles[0].identity;
|
|
32
|
+
const agents = reader
|
|
33
|
+
.directedView(profile, { within })
|
|
34
|
+
.filter((row) => row.kind === 'field-ref' &&
|
|
35
|
+
row.direction === 'out' &&
|
|
36
|
+
row.field === 'composition.agent' &&
|
|
37
|
+
reader.get(row.counterpart, { within })?.discriminator === 'agent')
|
|
38
|
+
.map((row) => row.counterpart);
|
|
39
|
+
if (agents.length !== 1)
|
|
40
|
+
return { refusal: `${profile} names no admitted composition.agent`, subagent: true };
|
|
41
|
+
return { agent: agents[0], as: `subagent ${agentType} acts as ${agents[0]} (${profile})` };
|
|
42
|
+
}
|
|
43
|
+
if (workspace === undefined)
|
|
44
|
+
return { as: 'the main session has no default actor: no @workspace holds this path' };
|
|
45
|
+
const fallback = defaultActor(reader, within, workspace);
|
|
46
|
+
if (fallback.refusal !== undefined)
|
|
47
|
+
return { refusal: fallback.refusal.message, next: fallback.refusal.next, subagent: false };
|
|
48
|
+
return fallback.actor === undefined
|
|
49
|
+
? { as: `the main session has no default actor: ${fallback.reason}` }
|
|
50
|
+
: { agent: fallback.actor, as: `the main session acts as ${fallback.actor}` };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Decide one edit (see the module comment). A mandate whose authority cannot be read refuses a selected edit as
|
|
54
|
+
* IA-HOOK-MANDATE-UNAVAILABLE, naming its governance position; so, while any authored `@mandate` fails admission (lane
|
|
55
|
+
* D), does every selected edit, whoever acts, naming the mandate's `path:line` and `ia report` (`root` spelled when the
|
|
56
|
+
* request carries it). An edit the hook does not select is still allowed.
|
|
57
|
+
*/
|
|
58
|
+
export function evaluateMandateGuard(reader, within, request) {
|
|
59
|
+
const { hook } = request, paths = [...new Set(request.paths)];
|
|
60
|
+
if (!mandateGuardSelects({ ...request, paths }))
|
|
61
|
+
return freeze({ allowed: true, selected: false, message: `${hook.identity} does not select this edit` });
|
|
62
|
+
const deny = (code, why, next, actor) => freeze({
|
|
63
|
+
allowed: false,
|
|
64
|
+
selected: true,
|
|
65
|
+
code,
|
|
66
|
+
message: `${hook.message} (${hook.identity}: ${why}) Next: ${next}`,
|
|
67
|
+
next,
|
|
68
|
+
...(actor === undefined ? {} : { actor }),
|
|
69
|
+
});
|
|
70
|
+
try {
|
|
71
|
+
const workspace = seatedWorkspace(reader, within, paths[0]);
|
|
72
|
+
// C1 for the path and its workspace, over every spelling of the file; one row per mandate.
|
|
73
|
+
const locate = (actor) => {
|
|
74
|
+
const found = new Map();
|
|
75
|
+
for (const path of paths)
|
|
76
|
+
for (const mandate of governingMandates(reader, within, {
|
|
77
|
+
path,
|
|
78
|
+
...(workspace === undefined ? {} : { workspace }),
|
|
79
|
+
...(request.fold === undefined ? {} : { fold: request.fold }),
|
|
80
|
+
...(actor === undefined ? {} : { actor }),
|
|
81
|
+
}))
|
|
82
|
+
if (!found.has(mandate.identity))
|
|
83
|
+
found.set(mandate.identity, mandate);
|
|
84
|
+
return [...found.values()].sort((a, b) => order(a.identity, b.identity));
|
|
85
|
+
};
|
|
86
|
+
// The actor before anything else: an unknown subagent is refused at every selected path, governed or not.
|
|
87
|
+
const actor = acting(reader, within, request, workspace), governing = locate(), seat = governing[0]?.identity ?? workspace;
|
|
88
|
+
const first = seat === undefined ? 'ia position --shape governance' : governance(seat);
|
|
89
|
+
if (actor.refusal !== undefined && actor.subagent)
|
|
90
|
+
return deny('IA-HOOK-IDENTITY-UNAVAILABLE', actor.refusal, first);
|
|
91
|
+
if (governing.length === 0)
|
|
92
|
+
return freeze({
|
|
93
|
+
allowed: true,
|
|
94
|
+
selected: true,
|
|
95
|
+
message: `no authored @mandate governs ${paths[0]}, so ${hook.identity} restricts nothing there`,
|
|
96
|
+
...(actor.refusal === undefined && actor.agent !== undefined ? { actor: actor.agent } : {}),
|
|
97
|
+
});
|
|
98
|
+
if (actor.refusal !== undefined)
|
|
99
|
+
return deny('IA-HOOK-IDENTITY-UNAVAILABLE', actor.refusal, actor.next ?? first);
|
|
100
|
+
let verdict;
|
|
101
|
+
if (actor.agent === undefined) {
|
|
102
|
+
// No actor to bind: a mandate that names a participant cannot be satisfied, and only participant-less ones judge.
|
|
103
|
+
const named = governing.find((mandate) => mandate.participant !== undefined);
|
|
104
|
+
if (named !== undefined)
|
|
105
|
+
return deny('IA-HOOK-IDENTITY-UNAVAILABLE', `${actor.as}; ${named.identity} binds ${named.participant}`, governance(named.identity));
|
|
106
|
+
verdict = profileRefusal(governing, 'author');
|
|
107
|
+
}
|
|
108
|
+
else
|
|
109
|
+
verdict = profileRefusal(locate(actor.agent), 'author');
|
|
110
|
+
if (verdict.refusal !== undefined)
|
|
111
|
+
return deny('IA-HOOK-NOT-MANDATED', `${actor.as}; ${verdict.refusal.message}`, verdict.refusal.next, actor.agent);
|
|
112
|
+
return freeze({
|
|
113
|
+
allowed: true,
|
|
114
|
+
selected: true,
|
|
115
|
+
message: `${actor.as}, which a governing mandate allows to author here`,
|
|
116
|
+
...(actor.agent === undefined ? {} : { actor: actor.agent }),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
if (!(error instanceof RuntimeError))
|
|
121
|
+
throw error;
|
|
122
|
+
// Review D-R2: by its cause. A refused record a mandate resolution reads is shown by the admission report, not a
|
|
123
|
+
// position, which cannot seat at a refused record (or would seat at an admitted one of another band sharing its
|
|
124
|
+
// identity); `ia validate` and every other mandate-gated command refuse in that state. An admitted mandate whose
|
|
125
|
+
// authority the resolver cannot read is shown by its governance position.
|
|
126
|
+
const where = error.where, report = admissionReport(request.root), next = !isAdmissionRefusal(error) && where?.identity !== undefined ? governance(where.identity) : report.command, spelled = next === report.command && report.fromRoot ? `${next}, run from the workspace root` : next;
|
|
127
|
+
return freeze({
|
|
128
|
+
allowed: false,
|
|
129
|
+
selected: true,
|
|
130
|
+
code: 'IA-HOOK-MANDATE-UNAVAILABLE',
|
|
131
|
+
message: `${hook.message} (${hook.identity}: the mandates that govern this edit cannot be read: ${error.message}) Next: ${spelled}`,
|
|
132
|
+
next,
|
|
133
|
+
...(where === undefined ? {} : { where }),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** Characters a printed root may hold and stay inert unquoted in sh, PowerShell and cmd: letters, digits, `._-/:`. */
|
|
138
|
+
const INERT_ROOT = /^[\p{L}\p{N}._\-/:]+$/u;
|
|
139
|
+
/** Whether a known root can appear in a suggested shell command, double-quoted when it contains spaces. */
|
|
140
|
+
export function inertCommandRoot(root) {
|
|
141
|
+
// JSON-quoted UNC backslashes do not round-trip through native Windows shell argument handling.
|
|
142
|
+
if (root.startsWith('\\\\'))
|
|
143
|
+
return false;
|
|
144
|
+
const spelled = process.platform === 'win32' ? root.replaceAll('\\', '/') : root;
|
|
145
|
+
return /^[\p{L}\p{N}._\-/: ]+$/u.test(spelled);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Lane D, review findings D-R1 and D-N2: the admission report command (`ia report`, the version 1 machine route no
|
|
149
|
+
* mandate gates) for a workspace root, spelled so no shell reads anything in it. `root` is printed, with forward slashes
|
|
150
|
+
* on win32, only when every character is inert unquoted (`INERT_ROOT`); otherwise no path is printed and `fromRoot` says
|
|
151
|
+
* the command is run from the workspace root, where `ia report` opens the working directory. A root is never wrapped in
|
|
152
|
+
* double quotes, where `$` and backticks stay live.
|
|
153
|
+
*/
|
|
154
|
+
export function admissionReport(root) {
|
|
155
|
+
const spelled = root === undefined ? undefined : process.platform === 'win32' ? root.replaceAll('\\', '/') : root;
|
|
156
|
+
return spelled !== undefined && INERT_ROOT.test(spelled)
|
|
157
|
+
? freeze({ command: `ia report --root ${spelled}`, fromRoot: false })
|
|
158
|
+
: freeze({ command: 'ia report', fromRoot: true });
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=mandate-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mandate-guard.js","sourceRoot":"","sources":["../src/mandate-guard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAmEpC,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,sBAAsB,IAAI,qBAAqB,CAAC;AAC7F,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7E,oHAAoH;AACpH,MAAM,UAAU,mBAAmB,CAAC,OAA4B;IAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IACxE,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CA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