@inventarch/runtime 3.1.0 → 3.2.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/LANGUAGE.md +2 -2
- package/README.md +64 -14
- package/SPEC.md +35 -35
- package/dist/door.d.ts +1 -2
- package/dist/door.d.ts.map +1 -1
- package/dist/door.js +1 -1
- package/dist/door.js.map +1 -1
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/index.js +1 -2
- package/dist/editor/index.js.map +1 -1
- package/dist/errors.d.ts +3 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/locator.d.ts +5 -6
- package/dist/locator.d.ts.map +1 -1
- package/dist/locator.js +5 -6
- package/dist/locator.js.map +1 -1
- package/dist/machine-protocol.js +1 -1
- package/dist/mandate-guard.d.ts +18 -19
- package/dist/mandate-guard.d.ts.map +1 -1
- package/dist/mandate-guard.js +14 -10
- package/dist/mandate-guard.js.map +1 -1
- package/dist/mandate-modes.d.ts +48 -48
- package/dist/mandate-modes.d.ts.map +1 -1
- package/dist/mandate-modes.js +44 -43
- package/dist/mandate-modes.js.map +1 -1
- package/dist/next.d.ts +9 -9
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +6 -6
- package/dist/next.js.map +1 -1
- package/dist/packet-host.d.ts +26 -28
- package/dist/packet-host.d.ts.map +1 -1
- package/dist/packet-host.js +9 -10
- package/dist/packet-host.js.map +1 -1
- package/dist/packet.d.ts +20 -20
- package/dist/packet.d.ts.map +1 -1
- package/dist/packet.js +10 -10
- package/dist/packet.js.map +1 -1
- package/dist/position.d.ts +19 -21
- package/dist/position.d.ts.map +1 -1
- package/dist/position.js +15 -15
- package/dist/position.js.map +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +1 -1
- package/dist/scope-key.d.ts +4 -4
- package/dist/scope-key.d.ts.map +1 -1
- package/dist/scope-key.js +8 -8
- package/dist/scope-key.js.map +1 -1
- package/dist/steward.d.ts +4 -5
- package/dist/steward.d.ts.map +1 -1
- package/dist/steward.js +4 -5
- package/dist/steward.js.map +1 -1
- package/package.json +4 -4
package/LANGUAGE.md
CHANGED
|
@@ -22,7 +22,7 @@ Spec source locators do not load documents. Resource capture and disclosure requ
|
|
|
22
22
|
| @convention | governance-system | Declares a convention in the shared governance shape. |
|
|
23
23
|
| @decision | work-system | Represents a choice that is needed or has been made: the question, options and decider, and once made, the choice and rationale. |
|
|
24
24
|
| @dimension | taxonomy | Defines a supported record dimension used by conditions and lookup. |
|
|
25
|
-
| @distribution | workspace-system | Declares root records from which a distributable closure is selected. |
|
|
25
|
+
| @distribution | workspace-system | Declares root records from which a distributable closure is selected, and optionally the host plugin product it describes. |
|
|
26
26
|
| @execution-binding | agent-composition-system | Connects a native target to a host-installed entry or operation descriptor. |
|
|
27
27
|
| @harness | agent-composition-system | Composes profiles and execution bindings in a workspace under a host contract. |
|
|
28
28
|
| @hook | hook-authoring-system | Represents a host event, tool/path selection and guard message. Registration and executing a guard require a host adapter. |
|
|
@@ -40,7 +40,7 @@ Spec source locators do not load documents. Resource capture and disclosure requ
|
|
|
40
40
|
| @placement | taxonomy | Defines source authority and reach metadata. |
|
|
41
41
|
| @plan | work-system | Represents an arrangement of milestones toward an intent; it heads the work hierarchy and has no parent. Plans do not nest. |
|
|
42
42
|
| @playbook | governance-system | Represents a procedure as phase/primitive cells. Cell delivery is generic; the authored method belongs to its author. |
|
|
43
|
-
| @predicate | taxonomy | Defines a directed relationship and its
|
|
43
|
+
| @predicate | taxonomy | Defines a directed relationship, its inverse spelling and its present phrase. |
|
|
44
44
|
| @primitive | taxonomy | Defines a cognitive primitive coordinate; a cell is selected using its phase and primitive. |
|
|
45
45
|
| @principle | governance-system | Declares a governing rationale in the shared governance shape. |
|
|
46
46
|
| @run | session-system | Represents a governed run identity, declared phase, status and owner. Declaration does not start execution. |
|
package/README.md
CHANGED
|
@@ -1,28 +1,78 @@
|
|
|
1
1
|
# @inventarch/runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@inventarch/runtime) [](https://github.com/inventarch/ia/actions/workflows/platform-quality.yml) [](LICENSE) [](package.json)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> `@inventarch/runtime` turns scoped [`@inventarch/db`](../db/README.md) reads into what agents and hosts consume: position bodies, plan delivery views, record bodies, the position packet for Claude Code and Codex, mandate resolution and the Door machine protocol. `ia position`, `ia next` and `ia read`, the MCP server and the VS Code extension are built on it.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## ⚡ Quick start
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```sh
|
|
10
|
+
npm install @inventarch/db @inventarch/runtime
|
|
11
|
+
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Read a position and a plan's delivery view from the workspace in the [root README quick start](../../README.md#-quick-start). These reads do not execute the task:
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
```js
|
|
16
|
+
import { open } from '@inventarch/db';
|
|
17
|
+
import { deliveryView, position } from '@inventarch/runtime';
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
const workspace = open('path/to/your-project', { cache: false });
|
|
20
|
+
try {
|
|
21
|
+
const { token } = workspace.resolveScope();
|
|
22
|
+
const { body } = position(workspace, token, {
|
|
23
|
+
seat: 'work-system/definition/task/write-schema',
|
|
24
|
+
shape: 'sequence',
|
|
25
|
+
});
|
|
26
|
+
console.log(body.key.phase, body.loaded.map(({ identity }) => identity));
|
|
27
|
+
const delivery = deliveryView(workspace, token, 'work-system/definition/plan/public-api');
|
|
28
|
+
if (delivery.ok) console.log(delivery.view.next);
|
|
29
|
+
} finally {
|
|
30
|
+
workspace.close();
|
|
31
|
+
}
|
|
32
|
+
```
|
|
16
33
|
|
|
17
|
-
|
|
34
|
+
```text
|
|
35
|
+
plan [
|
|
36
|
+
'work-system/definition/task/write-schema',
|
|
37
|
+
'work-system/definition/task/review-schema'
|
|
38
|
+
]
|
|
39
|
+
ia position --seat work-system/definition/task/write-schema --shape sequence
|
|
40
|
+
```
|
|
18
41
|
|
|
19
|
-
`
|
|
42
|
+
`position` completes a partial scope key (the `sequence` shape implies the `plan` phase, with depth 1 and budget 16 by default) and returns `{body, digest, hostNote}`. The body and its digest are a pure function of the key and the admitted records; the host note carries the revisions and capture freshness outside the digest. `deliveryView` returns `{ok: true, view}`, or a refusal that names the one command to run next. `open` admits `@check` records strictly by default, as `ia position` and `ia next` do, so the script reads what those commands print.
|
|
20
43
|
|
|
21
|
-
|
|
22
|
-
# Editor and authoring consumers
|
|
44
|
+
## 🧭 What it does
|
|
23
45
|
|
|
24
|
-
|
|
46
|
+
| Export | Use it for |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `position`, `positionBody`, `normalizeScopeKey`, `resolveScopeKey`, `K0`, `SCOPE_KEY_CAPS` | The body `ia position` prints for a scope key of seat, shape, phase, depth, budget and word. |
|
|
49
|
+
| `deliveryView`, `NEXT_CODES` | The plan view `ia next` prints: tasks in prerequisite order, each with a verdict from recorded exit evidence, and the next `ia position` command. |
|
|
50
|
+
| `readBody`, `parseLocator` | The body behind an identity, cell, requirement or source locator, with its SHA-256, as `ia read` prints it. |
|
|
51
|
+
| `Door`, `MACHINE_PROTOCOL` | The structured read protocol behind the CLI's machine commands and the MCP server: nine version 1 operations, plus `read`, `next` and `position` since version 2. `new Door(root, options)` owns a handle; `door.request({operation, params})` returns `{ok: true, result}` or a refusal, and `door.close()` ends it. |
|
|
52
|
+
| `RuntimeError`, `RUNTIME_CODES` | Thrown refusals. Each has a `code` from `RUNTIME_CODES`; a scope-key refusal adds `next`, the one command to run, and a mandate refusal adds `where`. `readBody` and `deliveryView` return their own refusals as `{ok: false, code, message, …}` values, the Door returns every refusal that way, and a token failure keeps its `IA-DB-*` code. |
|
|
53
|
+
| `context`, `select`, `prepareCoordinate`, `classify` | Coordinate-based context packets that reserve blocking governance first, and selection among explicit candidates. |
|
|
54
|
+
| `renderPacket`, `renderHost`, `PACKET_MARKER` | Build the host-neutral position packet and render it for `claude` or `codex` as files and a receipt. |
|
|
55
|
+
| `governingMandates`, `defaultActor`, `profileRefusal`, `evaluateMandateGuard`, `MOVES`, `MODE_MOVES` | Resolve the `@mandate` records that govern an actor, and judge a command mode or a guarded edit against them. |
|
|
56
|
+
| `preparePublication`, `inspectPublication`, `validateCandidate` | Publish generated drafts create-only on a local Windows NTFS volume, and validate candidate files against the sources a host disclosed. `qualifyPublicationRoot` checks a root first; every other platform or filesystem refuses with `IA-PUBLICATION-UNAVAILABLE`. |
|
|
57
|
+
| `@inventarch/runtime/editor` | `EditorWorkspace` for editors (overlays, diagnostics, completion and source actions), with language's single-record edit helpers. |
|
|
58
|
+
| `@inventarch/runtime/authoring` | Version 1 remote authoring request, proposal, receipt, event and chat contracts, and a bounded HTTPS client. |
|
|
59
|
+
| `@inventarch/runtime/authoring-execution` | Guarded dispatch of authoring operations from a fixed catalog the host supplies. |
|
|
60
|
+
| `@inventarch/runtime/entry` | `isEntry`, which a package binary calls to tell whether it is the process entry. |
|
|
25
61
|
|
|
26
|
-
|
|
62
|
+
The `./internal/*` subpaths serve specific toolchain consumers and are not a stable contract.
|
|
27
63
|
|
|
28
|
-
|
|
64
|
+
## ⚖️ What it does not do
|
|
65
|
+
|
|
66
|
+
- **It writes no source.** `position`, `deliveryView`, `readBody`, `renderPacket` and `renderHost` write nothing; the CLI writes projection files. Publication is the one writer: create-only files under a host-selected `.ia/work/generated/<id>` directory, staged in `.ia/work/generated/.stage-*` under a per-destination SQLite lock in `.ia/work/publication-locks/`, never `.ia/src`.
|
|
67
|
+
- **Its reads run nothing.** The Door makes no source writes, model calls, sessions or capability dispatch. A delivery view reads verdicts from recorded evidence and never executes a task, and what a scope does not read never counts as met. Only `./authoring-execution` calls the handlers a host's catalog supplies, `gitFiles` runs `git ls-files`, `qualifyPublicationRoot` runs a PowerShell volume probe, and `./authoring` makes HTTPS requests to the service a host configures.
|
|
68
|
+
- **A position takes no free text.** Request text is refused as a scope key part, so nothing text-driven decides what a position loads.
|
|
69
|
+
- **Mandates are cooperative restrictions.** Mandate resolution reads authored declarations; it authenticates no one and grants no host permission. A `@mandate` that fails admission fails every mandate-gated decision closed.
|
|
70
|
+
- **Remote authoring needs a separate service.** `./authoring` validates and transports messages; the service owns authentication, authorization, persisted runs and model execution, and the application owns credentials and effects.
|
|
71
|
+
- **Publication locks coordinate cooperating processes.** They are not a sandbox against malicious changes by the same user.
|
|
72
|
+
|
|
73
|
+
## 📚 Learn more
|
|
74
|
+
|
|
75
|
+
- [SPEC.md](SPEC.md): the runtime contract, including scope keys, position bodies, delivery views, the Door protocol and host packets.
|
|
76
|
+
- [LANGUAGE.md](LANGUAGE.md): the public vocabulary this release carries.
|
|
77
|
+
- The [root README](../../README.md) and the [architecture reference](../../docs/reference/architecture/README.md).
|
|
78
|
+
- Related packages and apps: [`@inventarch/db`](../db/README.md), [`@inventarch/workspace-runtime`](../workspace-runtime/README.md), the [CLI guide](../../apps/cli/README.md) and the [MCP server](../../apps/mcp-door/README.md).
|