@inventarch/graph 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 +69 -2
- package/SPEC.md +15 -15
- package/dist/claims.d.ts +7 -9
- package/dist/claims.d.ts.map +1 -1
- package/dist/claims.js +7 -9
- package/dist/claims.js.map +1 -1
- package/dist/revision.d.ts +8 -8
- package/dist/revision.js +8 -8
- package/package.json +2 -2
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,5 +1,72 @@
|
|
|
1
1
|
# @inventarch/graph
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@inventarch/graph) [](https://github.com/inventarch/ia/actions/workflows/platform-quality.yml) [](LICENSE) [](package.json)
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
> The typed graph over compiled IA records. It chooses the winning occurrence of each identity, resolves references, rechecks relationship consent, and lets you traverse relationships, inspect claims, conditions and record digests, and search record text.
|
|
6
|
+
>
|
|
7
|
+
> It sits between [`@inventarch/language`](../language/README.md), which compiles the records, and [`@inventarch/compliance`](../compliance/README.md), which checks the graph.
|
|
8
|
+
|
|
9
|
+
## ⚡ Quick start
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @inventarch/language @inventarch/graph
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { buildRegistry, compile, KERNEL_DIGEST, KERNEL_SOURCES, LANGUAGE_VERSION, parse } from '@inventarch/language';
|
|
17
|
+
import { directedView, load } from '@inventarch/graph';
|
|
18
|
+
|
|
19
|
+
// The caller supplies every input; this example loads the language floor that the language package embeds.
|
|
20
|
+
const location = { placement: { kind: 'floor', band: 10, reach: '' }, provenance: 'bootstrap' };
|
|
21
|
+
const sources = KERNEL_SOURCES.map((source) => ({ ...source, location }));
|
|
22
|
+
const parsed = sources.map((source) => ({ ...parse(source.text, source.path), location }));
|
|
23
|
+
const { registry } = buildRegistry(parsed);
|
|
24
|
+
const records = parsed.flatMap((source) => compile(source.ast, registry, location, []).records);
|
|
25
|
+
|
|
26
|
+
const graph = load(records, registry, {
|
|
27
|
+
sources,
|
|
28
|
+
languageVersion: LANGUAGE_VERSION,
|
|
29
|
+
kernelDigest: KERNEL_DIGEST,
|
|
30
|
+
location: '',
|
|
31
|
+
});
|
|
32
|
+
console.log(graph.diagnostics.length); // 0
|
|
33
|
+
|
|
34
|
+
for (const row of directedView(graph, 'floor/contract/head/kernel-phase'))
|
|
35
|
+
console.log(row.kind, row.spelling, row.counterpart);
|
|
36
|
+
// inverse grounded-by floor/definition/system/taxonomy
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`load` reads nothing itself: it takes compiled records, the registry that compiled them and the revision inputs. `options` holds the revision inputs (`sources`, `languageVersion`, `kernelDigest`), the view `location` and an optional `phase`. Every record's source must be in `sources` at the same placement and provenance; otherwise `load` throws a `TypeError`. To read a workspace on disk, use [`@inventarch/db`](../db/README.md), which discovers the sources and builds the graph.
|
|
40
|
+
|
|
41
|
+
## 🧭 What it does
|
|
42
|
+
|
|
43
|
+
| Area | Exports |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| Load | `load(records, registry, options)` returns an immutable `Graph`: one winner per identity (the highest band; a tie at that band refuses every tied occurrence), shadows, resolved and dangling edges, indexes and diagnostics. `serialize(graph)` writes it in a stable order that input order does not affect. |
|
|
46
|
+
| Resolve | `resolve(reference, pool, registry)` returns `{ ok: true, identity, fragment? }`, or `{ ok: false, code }` with `IA-GRAPH-TARGET-MISSING` or `IA-GRAPH-TARGET-AMBIGUOUS`; candidate order never breaks a tie. |
|
|
47
|
+
| Relationships | `directedView(graph, identity)` lists every relationship from that record's side, declared or derived inverse, plus typed field references. `traverse(graph, options)` walks breadth-first from `start` identities. It follows the verbs in `follow` (any kernel spelling), or every edge in `direction` (`out`, `in` or `both`, the default), to a `depth` of 0 to 8 (default 1), with optional `scope`, `filter` and `coordinate`, and `maxNodes`/`maxEdges` bounds that mark a result `truncated`. |
|
|
48
|
+
| Claims | `claimants(graph, path, scope?)` names the records whose path selections in `CLAIM_FIELDS` (`authority.covers`, `subject.covers`, `work.covers`, `hook.paths`, `check.covers`) select a path. `selects(selection, path)` and `isSelection(selection)` implement the one path-selection dialect. |
|
|
49
|
+
| Conditions | `validateCoordinate`, `conditionHolds`, `selectors`, `variants`, `cell`, `effectiveSeverity` and `laneOf` evaluate conditions, selector groups and variant and cell selection for a coordinate. |
|
|
50
|
+
| Search | `search(graph, text, scope?)` ranks decoded record text with BM25, computing its statistics over the allowed scope only. |
|
|
51
|
+
| Revisions and digests | `revisionOf` hashes the sources, registry, language version and kernel digest. `authoredRevisionOf` leaves out sources at runtime placement, so runtime-band evidence does not move it. Each node carries `digest` from `recordDigest(record)`, which covers what a record says, not where it was read. |
|
|
52
|
+
| Canonical JSON | `canonical`, `digest` and `copy` give byte-stable canonical JSON and its SHA-256. Each refusal is a `CodecError` with a stable `code`. |
|
|
53
|
+
| Paths | `canonicalRoot(root)` normalizes a corpus-relative reach or view root, and `reaches(reach, location)` says whether a reach covers a location. |
|
|
54
|
+
|
|
55
|
+
Load diagnostics use the `GRAPH_CODES` (`IA-GRAPH-*`). Invalid query input, such as an unknown coordinate value or a traversal depth outside 0 to 8, throws `GraphUsageError`. The `./internal/*` subpaths are published for IA's own toolchain; use the root entry point.
|
|
56
|
+
|
|
57
|
+
## ⚖️ What it does not do
|
|
58
|
+
|
|
59
|
+
- **No I/O or execution.** It reads no files, clock or default registry, parses no source text, keeps no cache and calls no model or tool. It depends only on `@inventarch/language` and uses `node:crypto` for SHA-256.
|
|
60
|
+
- **A dangling reference is not a pass.** It stays a warning edge (`IA-GRAPH-TARGET-MISSING`). A fragment is kept but not checked; [`@inventarch/compliance`](../compliance/README.md) decides whether the cell or requirement it names exists.
|
|
61
|
+
- **Derived rows are views.** An inverse row from `directedView` is never written back to source or merged into `edges`.
|
|
62
|
+
- **A claim is not an edge.** It carries no predicate and grants nothing. A `@check`'s `check.scope` never claims a path.
|
|
63
|
+
- **A truncated traversal is not the whole graph.** Report a `truncated` result as partial.
|
|
64
|
+
- **No scopes or packets.** Scope tokens and caches belong to [`@inventarch/db`](../db/README.md), and position views and host packets to [`@inventarch/runtime`](../runtime/README.md).
|
|
65
|
+
|
|
66
|
+
## 📚 Learn more
|
|
67
|
+
|
|
68
|
+
- [SPEC.md](SPEC.md): the package contract (G01 to G13), including the directed view, claimant index and canonical codec
|
|
69
|
+
- [LANGUAGE.md](LANGUAGE.md): the packaged summary of the words this release ships
|
|
70
|
+
- [Architecture reference](../../docs/reference/architecture/README.md#which-package-to-use)
|
|
71
|
+
- Neighbours in the dependency direction: [`@inventarch/language`](../language/README.md) before it; [`@inventarch/compliance`](../compliance/README.md) and [`@inventarch/db`](../db/README.md) after it
|
|
72
|
+
- [Root README](../../README.md)
|
package/SPEC.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# Graph specification
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Status: G01–G11 implemented under the graph plan; G12 states the canonical codec re-homed here from session-system; G13 adds the per-record digest; G01a adds the authored revision; G06b adds the directed view; G06c adds the claimant index and the path-selection dialect. Shared concepts: graph/matrix design. Pure Node-compatible package depending only on @inventarch/language; no filesystem, clock, default registry or source-text lexer. Task-delivery paragraphs below retain historical counts and next steps; current readiness covers the completed downstream consumers.
|
|
3
|
+
Status: G01–G13 implemented. G01a adds the authored revision; G06a the typed field-reference index; G06b the directed view; G06c the claimant index and the path-selection dialect; G07a the cross-input floor citation; G10a bounded traversal; G12 states the canonical codec re-homed here from session-system; G13 adds the per-record digest. Pure Node-compatible package depending only on @inventarch/language; no filesystem, clock, default registry or source-text lexer. Delivery paragraphs below retain historical counts and next steps.
|
|
6
4
|
|
|
7
5
|
## Construction and revision
|
|
8
6
|
|
|
9
7
|
G01. `load(records, registry, options)` returns an immutable Graph containing source diagnostics. Options explicitly supply revision sources, language version, kernel digest, view location and optional phase. A revision source has path, text and Location. `revisionOf` SHA-256 hashes sorted canonical source paths/raw text/placement/provenance, stable registry serialization, language version and kernel digest. Any byte or semantic input change affects the revision. Location/phase identify a view and do not change corpus revision. Duplicate source paths and inconsistent caller-supplied registration/identity/placement are TypeErrors, not authored syntax diagnostics.
|
|
10
8
|
|
|
11
|
-
G01a. The authored revision (2026-10-09
|
|
9
|
+
G01a. The authored revision (2026-10-09). `authoredRevisionOf(registry, inputs, derived?)`, exported beside `revisionOf`, is `revisionOf`'s SHA-256 over the same canonical form without each source at runtime placement (`placement.kind` `runtime`, band 0), so runtime-band evidence, admitted below authored and never part of what agents are given, leaves it unchanged. A runtime-placed input whose canonical path `derived` names stays: a derived revision-only input that no record compiles from, such as db's `.ia/.db-inputs.json` (db D03: the folder inventory, floor origin, admission version, authored roots and activation), so a folder or activation change still moves it; named or not, every source is canonicalized and checked as `revisionOf` checks it (a malformed location or a duplicate canonical path is a TypeError, a runtime-placed one included). The registry, language version and kernel digest are hashed as `revisionOf` hashes them, so a change to any of them, or to the bytes, path, placement or provenance of a source not at runtime placement, moves it, and a source moved to runtime placement drops out of it, as its records leave what agents are given. With no source at runtime placement but the named derived inputs it equals `revisionOf(registry, inputs)`, so a workspace with none keeps every revision it had. It is no `load` input: a graph's `revision` stays `revisionOf`'s, and `load` still requires every record's source among the full inputs. `tests/primitives.test.ts` pins the equality, order independence, a runtime-placed source added or edited moving only `revisionOf`, a source moved to runtime placement hashed as if absent, the derived input, registry, kernel, version and bytes moving it, an unnamed metadata input counted as runtime-placed, and the checks.
|
|
12
10
|
|
|
13
11
|
G02. Graph snapshots all inputs and exposes read-only collection views backed by inaccessible copies; casting a ReadonlyMap to Map must not make mutation possible. Nested record/schema/registry arrays and objects are frozen copies. `serialize(graph)` has total stable ordering independent of source, record and map insertion order. Object keys sort by code point, maps by serialized key, sets by serialized value. Source text is revision input, never re-lexed here. SHA-256 uses the pure deterministic node:crypto hash API.
|
|
14
12
|
|
|
@@ -18,15 +16,15 @@ G03. Canonical reach/location roots are corpus-relative paths using language can
|
|
|
18
16
|
|
|
19
17
|
G04. Filter occurrences by reach and optional phase before authority. For phase applicability, any selector group without a phase term admits every phase; otherwise the record admits the union of its groups' phase values. No selectors or an omitted phase imposes no phase filter. At each identity the unique highest-band applicable occurrence wins. A highest-band tie refuses every tied participant with IDENTITY-TIE and admits no lower fallback. Differing overlapping reaches do not break ties. Retain all source occurrences, explicit shadows and ties separately; nodes is a winners-only identity map. Out-of-reach/phase occurrences remain inspectable but unindexed.
|
|
20
18
|
|
|
21
|
-
G05. Build byName, byDiscriminator, byKind, bySystem, byCategory and
|
|
19
|
+
G05. Build byName, byDiscriminator, byKind, bySystem, byCategory, byLane and byArtifactSet postings from winners; category comes from the registration and lane from the validated kernel kind mapping (contract@authority maps authority), which the package root exports as `laneOf(record)`, the one definition of a lane: the index posts each winner under it, and runtime readers that order or seed by lane call it. Index cells at phase/primitive, selector axis/value groups and all condition terms from cells/edges/variants/requirements. Classification is an optional single head artifact-set field, a scalar/string closed value. Severity is an optional single governance.severity scalar/string closed value. Unknown, malformed or repeated dimension declarations refuse that record with DIMENSION-UNKNOWN. Provenance is the compiled loader-supplied value. Prose/gloss fields never supply routing coordinates.
|
|
22
20
|
|
|
23
21
|
G06. Resolve every authored edge through language.resolveTarget against winners, including formerly dangling edges. Normalize inverse direction into active endpoints; retain author identity, typed reference, fragment, condition subject (the author), spans and source assertions, each assertion keeping the verb `spelling` its author wrote while the edge's endpoints stay active (a registration-generated ground assertion carries `ground`; under language S07 it absorbs an equivalent unconditioned, fragmentless ground line written on the same system record in either outbound spelling, `ground` or `grounds`; any other ground line, such as `grounded-by @system <name>` on the schema, keeps its spelling and ordinary consent under G07). A missing endpoint is null: ordinary edges remain under out[author], inverse edges under in[author]. Both forms remain in dangling and a byDanglingReference index. More than one candidate refuses the edge with TARGET-AMBIGUOUS; zero retains it with TARGET-MISSING warning. Resolve API reports these graph codes without candidate-order selection. The directed view (G06b) reads each resolved assertion from both endpoints, as declared on its author and as a derived inverse on the other side; a dangling assertion has no row there.
|
|
24
22
|
|
|
25
23
|
G06a. Derive `references`, a typed field-reference index beside the edges, from every typed ref value a winner holds in its head or sections, list items and nested fields included. Each `FieldReference` carries `from` (the holder), `to` (the resolved winner), `field` (the compiler's field path: `head.steward`, `composition.mandate`, `binding.target`, or the bare section name for a section-level item), the authored `reference` and the holder's source span. Targets resolve through the same resolve API as edges; an unresolved or ambiguous ref is omitted without a graph diagnostic, because compliance reports it (IA-COMP-FIELD-REF-MISSING). The `relationships` section is skipped by name, so a consent-refused assertion never reappears as a reference, and a ref inside the span of an edge the compiler already lowered (a floor `@system` `discriminators` entry's `ground`) is skipped, so no authored ref is both an edge and a reference. A field reference carries no predicate and is never consent-, cardinality- or COMP-checked; `edges`, `in`, `out`, `dangling`, diagnostics and revision are unchanged by it. `referencedBy` keys `references` by target and `referencesFrom` keys them by holder, each list in `references` order, both built once at load. Ordering is total over from, field, to, source path/line and the serialized reference, independent of input order; equal entries are stored once. The directed view (G06b) lists each reference from both ends as a derived `field-ref` row, so the index is navigable from its holder as well as its target.
|
|
26
24
|
|
|
27
|
-
G06b. `directedView(graph, identity)` returns the identity's directed view
|
|
25
|
+
G06b. `directedView(graph, identity)` returns the identity's directed view: a frozen list of every row the graph holds at that identity, read from its side. Each resolved edge the identity is an endpoint of gives one row per assertion per side it occupies, carrying the edge's `predicate`, the `direction` the identity reads it in (`out` at the active source, `in` at the active target), the `counterpart` (the other endpoint), `declaredOn` (the assertion's author), `declaredBy` (`source` for an outbound assertion, `target` for an inverse one, the same from either side: the `declared by source` or `declared by target` label), the assertion's `source` lines, and the edge's `fragment` and `condition` when it has them; the fragment addresses the record the declaration references. On the side its author stands the row is `kind: 'edge'`, `derived: false`, with `spelling` the verb the author wrote. On the other side it is `kind: 'inverse'`, `derived: true`, with `spelling` the kernel's for that side: the active predicate at the source, and at the target its language `INVERSE_OF` spelling, one of the eighteen (governed-by, enforced-by, grounded-by, constrained-by, implemented-by, produced-by, consumed-by, lineage-recorded-by, access-granted-by, run-after, triggered-by, cited-by, superseded-by, required-by, used-by, forbidden-by, routed-by, landed-by). An edge asserted from both ends keeps both assertions (G07), so each side holds its own declared row and the derived inverse of the other's; a self-relation is read from both of its sides. Each G06a field reference the identity holds or is named by gives one `kind: 'field-ref'`, `derived: true` row with its `field` path, `declaredOn` the holder and no predicate or spelling. A derived row is a view and is never authoritative over the declared row it reads: nothing is written back to source, merged into `edges` or re-spelled there. Dangling (G06), ambiguous and consent-refused (G07) assertions are findings, not rows: a dangling one stays in diagnostics, `dangling` and `byDanglingReference`, an ambiguous or refused one in diagnostics only, and neither endpoint has a row for it. An identity that is not an admitted winner has no rows. Rows order by kind (edge, inverse, field-ref), direction (out, in), predicate or field, counterpart, declaring record, source path and line, then the serialized row: a total order independent of input order. The view is computed on read from the load-time `out`, `in`, `referencesFrom` and `referencedBy` indexes, so a call reads only the identity's own entries and never scans `references`; reading it adds no index, diagnostic or revision input and leaves `serialize(graph)` unchanged. `tests/directed.test.ts` pins both spellings from both sides, both-sided assertions, self-relations, fragments, conditions, findings, field references and the order within one kind and direction, and that over the native corpus each resolved assertion and each field reference is read exactly once from each end, a record's held references exactly as a scan of `references` finds them.
|
|
28
26
|
|
|
29
|
-
G06c. Claimant index and path selections (
|
|
27
|
+
G06c. Claimant index and path selections (`covers` stays a field of text path selections, neither a predicate nor a ref). `claims` is a derived index built once at load: one frozen `Claim` `{from, field, selection, source}` for each text value a winner holds in a claimant field, a list's items in authored order. The claimant fields, exported as `CLAIM_FIELDS`, are `authority.covers` (`@mandate`), `subject.covers` (`@law`, `@convention`), `work.covers` (`@spec`), `hook.paths` (`@hook`) and `check.covers` (`@check`), each a top-level field of its section, read by path on any winner that holds it; schema admission keeps an undeclared one out of an admitted view. A nested field, a ref value and a `covers` in any other section are not claims. Equal (holder, field, selection) claims are stored once, and claims order by holder identity, then as the record states them. A claim is not an edge: it carries no predicate, is never consent-checked and is not a revision input. `selects(selection, path)` is the one path-selection dialect. Both read `\` as `/`. The path is canonicalized as a scope root (G03: `.` and empty segments dropped, `..` resolved), and an absolute path or one escaping the workspace is selected by nothing. A selection is `/`-separated workspace-relative segments: a whole-segment `**` matches zero or more segments, `*` any run of characters within one segment, `?` exactly one character (one code point), and every other character itself, case-sensitively. A trailing `/` stands for `/**`, so `docs/` selects `docs` and everything below it, while `docs` selects only that path. There are no braces, classes, escapes or negation, a leading dot is not special, and an empty or absolute selection, or one with an empty, `.` or `..` segment, selects nothing; `isSelection(selection)` says whether the dialect reads a selection at all, so a host can name one that selects nothing where it is authored (db D02b `inertDeclarations`). A `@check`'s `check.scope` is never a claimant field: it stays text, such as "every admitted native record" or the whole-workspace token `*`, that selects the verdicts the check binds to (db D13), and claims no path. A check claims paths only through its optional `check.covers` list, and claiming a path changes nothing about which verdicts it selects. Matching keeps one backtrack point per level, so it takes at most pattern × path steps. `claimants(graph, path, scope?)` reads the index, never the records: each winner with a claim that selects the path, holders outside `scope` pruned, as a frozen `Claimant` `{identity, band, matches}` listing every matching `{field, selection}` in index order, ordered band descending then identity ascending. `tests/claims.test.ts` pins the dialect, the index over probe and native records, permutation stability, pruning and the order.
|
|
30
28
|
|
|
31
29
|
G07. Check both word owners' consent on each resolved edge in active direction, reporting only the first refusing side as EDGE-UNCONSENTED. The exact unconditioned, fragmentless system-to-registered-schema ground assertion generated by registration bypasses ledgers as specified by language S07; no other ground edge is exempt. Store equivalent unconditioned edges once, retaining every source assertion. Conditioned edges also key by condition subject, because equal terms authored on different records may see different dimensions. Sort edges by endpoints/predicate/fragment/condition/author/source for a total order.
|
|
32
30
|
|
|
@@ -40,9 +38,11 @@ G08. A graph coordinate is a partial mapping of closed routing axes plus severit
|
|
|
40
38
|
|
|
41
39
|
G09. selectors(record, coordinate) reports matched, neutral or disqualified. Groups are OR; terms within a group are AND. A fully supplied matching group establishes matched with its maximum term count. No selectors or an uncontradicted group with missing values yields neutral; all groups contradicted by at least one supplied value yields disqualified. This affects retrieval, never parses a meaning gloss. variants selects the highest-specificity applicable clause in each key family; equal maxima report VARIANT-AMBIGUOUS and select none for that family. A conditional exact cell that does not apply cannot suppress a valid primary fallback. Cell selection returns exact, primary or absent for one record/coordinate.
|
|
42
40
|
|
|
43
|
-
G10. traverse(graph, options) performs breadth-first traversal from a declared start list. follow verbs use the exact language table and imply direction; direction is consulted only if follow is absent. Depth is an integer 0..8, otherwise TRAVERSAL-INVALID. Unknown verb is VERB-UNKNOWN. Scope is an allowed identity set and prunes starts, endpoints and traversal; an out-of-scope intermediary cannot expose its descendants. A filter prunes nodes by kind/discriminator/system using typed data. Missing starts yield no walk. Cycles terminate. With a coordinate, false conditions go to gated and are not crossed/returned as followed; without one, conditioned edges may be traversed with their conditions retained. Expose dangling separately. Nodes order by depth/identity, via by from/predicate/direction/target, edges by G07's total order.
|
|
41
|
+
G10. traverse(graph, options) performs breadth-first traversal from a declared start list. follow verbs use the exact language table and imply direction; direction is consulted only if follow is absent. Direction defaults to both; an explicit empty follow list crosses no edges. Depth is an integer 0..8, default 1, otherwise TRAVERSAL-INVALID. Unknown verb is VERB-UNKNOWN. Scope is an allowed identity set and prunes starts, endpoints and traversal; an out-of-scope intermediary cannot expose its descendants. A filter prunes nodes by kind/discriminator/system using typed data. Missing starts yield no walk. Cycles terminate. With a coordinate, false conditions go to gated and are not crossed/returned as followed; without one, conditioned edges may be traversed with their conditions retained. Expose dangling separately. Nodes order by depth/identity, via by from/predicate/direction/target, edges by G07's total order.
|
|
42
|
+
|
|
43
|
+
G10a. Bounded traversal: optional `maxNodes`/`maxEdges`, each a positive integer (otherwise TRAVERSAL-INVALID), retain normal authority, scope, direction and condition behavior while bounding emitted records and edge examination. A bounded result reports `truncated`; callers must not describe it as a complete graph. Calls without limits preserve the G10 contract.
|
|
44
44
|
|
|
45
|
-
G11. search(graph, text, scope?) is graph-owned BM25 over decoded names, field/item text, references and semantic products without indexing the same body text twice.
|
|
45
|
+
G11. search(graph, text, scope?) is graph-owned BM25 over decoded names, field/item text, references and semantic products without indexing the same body text twice. Fold text with NFKC, lowercase, NFD and mark removal. Split it into Unicode letter/digit runs, drop runs shorter than 2 characters, truncate the rest to 64 and drop the stopwords listed in `src/text.ts`. Score with k1=1.2 and b=.75. Query terms deduplicate. Statistics N/df/average length are computed over the allowed scope, never hidden records. Return positive scores sorted descending then identity. Text tokenization is over decoded prose/query strings, not IA source syntax. Expose no mutable postings.
|
|
46
46
|
|
|
47
47
|
## Canonical codec
|
|
48
48
|
|
|
@@ -52,14 +52,14 @@ G13. Every Node carries `digest`, its per-record digest, computed once per occur
|
|
|
52
52
|
|
|
53
53
|
## Diagnostics, evidence and boundaries
|
|
54
54
|
|
|
55
|
-
Graph source codes use IA-GRAPH-IDENTITY-TIE, TARGET-MISSING, TARGET-AMBIGUOUS, EDGE-UNCONSENTED and DIMENSION-UNKNOWN. Query errors
|
|
55
|
+
Graph source codes use IA-GRAPH-IDENTITY-TIE, TARGET-MISSING, TARGET-AMBIGUOUS, EDGE-UNCONSENTED and DIMENSION-UNKNOWN. Query usage errors throw `GraphUsageError` with IA-GRAPH-COORDINATE-VALUE-UNKNOWN, VERB-UNKNOWN or TRAVERSAL-INVALID; root normalization throws it with SCOPE-INVALID. `variants` returns IA-GRAPH-VARIANT-AMBIGUOUS in its `diagnostics` and selects none for that family. Codec refusals use IA-SESSION-INPUT-INVALID and IA-SESSION-LIMIT-EXCEEDED (G12). Source diagnostic shape matches language with the graph namespace; errors refuse their stated subject, warnings retain evidence. Fragments are retained but compliance owns existence. Graph performs no scenario execution, caching, scope-token issuance, ranking into runtime packets or model/tool dispatch. Public evidence must distinguish these boundaries.
|
|
56
56
|
|
|
57
|
-
Each
|
|
57
|
+
Each delivery records native success/refusal, permutation/immutability and public-consumer evidence here. Native taxonomy/system records, the authoring playbook, law and check provide the normal path; overlays and malformed coordinates provide adversarial cases. Central exact-cell/primary examples use separate records to avoid double-delivery. Raising severity uses an advisory fixture, because a blocking subject is already blocking without a request override.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Revision and coordinate APIs delivered: public revision, root/reach and coordinate/dimension APIs; internal immutable snapshots and stable typed collection serialization. 39 graph tests cover native inputs, source/registry/placement/provenance/kernel/version revision changes, mutation resistance, invalid coordinates and scope escape variants. Workspace tests/typecheck/build passed; graph load, indexes and queries were still pending.
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Graph load and indexes delivered: immutable graph load, winner-only indexes with retained occurrences/shadows/ties, active-direction relationships, dangling references and consent rechecks. 57 graph tests and the complete 1401-test workspace suite pass, with typecheck/build/kernel check. Native graph: 153 records, 26 structural grounds, zero diagnostics. Contextual queries and text search were still pending.
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Queries and traversal delivered: conditions, selectors, variants, cell selection and breadth-first traversal. Traversal defaults to depth 1 and both directions when follow is absent; an explicit empty follow list crosses no edges. Via entries describe shortest-path hops, while followed edges retain cycles without revisiting nodes. Scope and typed filters prune before any edge emission, including gated edges. Query results are immutable. 86 graph tests and 1430 workspace tests/45 files pass with typecheck/build/kernel check.
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Text search delivered: immutable decoded-text postings and scoped BM25. The name is indexed once using displayName, along with the discriminator, nested compiled field/item/list/reference values and semantic text not already represented at its source line. Field keys and source syntax are not lexed. Search results preserve query-term order, deduplicate terms and exclude nonexistent scope identities from statistics. 92 graph tests; 1440 workspace tests/47 files, typecheck/build, native/kernel and dependency checks pass. The emitted-declaration/built-runtime consumer admits all 153 native nodes and exercises exact cells, variants, inverse gating, scoped search and immutable views. Graph G01–G11 are delivered; scenario execution, scoped capability tokens, caches and runtime packet assembly retain their downstream owners.
|
package/dist/claims.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { Band } from '@inventarch/language';
|
|
2
2
|
import type { Claim, Graph, Node } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* G06c: the claimant fields, each a section field whose text values are path selections (
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* check
|
|
10
|
-
* verdicts the check binds to, and claims no path; `check.covers` is the check's claimant field, and claiming a path
|
|
11
|
-
* changes nothing about which verdicts the check selects.
|
|
4
|
+
* G06c: the claimant fields, each a section field whose text values are path selections (db D02b; `covers` stays a
|
|
5
|
+
* field, not a predicate): `covers` in a @mandate's `authority`, a @law's or @convention's `subject`, a @spec's `work`
|
|
6
|
+
* and a @check's `check`, and a @hook's `hook.paths`. A field is read by its path on any winner that holds it; schema
|
|
7
|
+
* admission keeps undeclared ones out. A @check's `check.scope` is never one: it stays text, such as "every admitted
|
|
8
|
+
* native record" or `*`, that selects the verdicts the check binds to, and claims no path; `check.covers` is the
|
|
9
|
+
* check's claimant field, and claiming a path changes nothing about which verdicts the check selects.
|
|
12
10
|
*/
|
|
13
11
|
export declare const CLAIM_FIELDS: readonly string[];
|
|
14
12
|
/**
|
|
@@ -43,7 +41,7 @@ export interface Claimant {
|
|
|
43
41
|
}
|
|
44
42
|
/**
|
|
45
43
|
* G06c: the winners whose claims select `path`, holders outside `scope` pruned, ordered band descending then identity
|
|
46
|
-
* ascending (
|
|
44
|
+
* ascending (db D02b). Reads the load-time claimant index; nothing is rescanned per query.
|
|
47
45
|
*/
|
|
48
46
|
export declare function claimants(graph: Graph, path: string, scope?: ReadonlySet<string>): readonly Claimant[];
|
|
49
47
|
//# sourceMappingURL=claims.d.ts.map
|
package/dist/claims.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAMxC,CAAC;AAEH;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,EAAE,CAsBvD;AASD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEtD;AAkDD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAIhE;AAED,uGAAuG;AACvG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AACD,sGAAsG;AACtG,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CACzC;AACD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,QAAQ,EAAE,CAiBtG"}
|
package/dist/claims.js
CHANGED
|
@@ -2,14 +2,12 @@ import { snapshot } from './immutable.js';
|
|
|
2
2
|
import { canonicalRoot } from './paths.js';
|
|
3
3
|
import { compare, stableSerialize } from './revision.js';
|
|
4
4
|
/**
|
|
5
|
-
* G06c: the claimant fields, each a section field whose text values are path selections (
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* check
|
|
11
|
-
* verdicts the check binds to, and claims no path; `check.covers` is the check's claimant field, and claiming a path
|
|
12
|
-
* changes nothing about which verdicts the check selects.
|
|
5
|
+
* G06c: the claimant fields, each a section field whose text values are path selections (db D02b; `covers` stays a
|
|
6
|
+
* field, not a predicate): `covers` in a @mandate's `authority`, a @law's or @convention's `subject`, a @spec's `work`
|
|
7
|
+
* and a @check's `check`, and a @hook's `hook.paths`. A field is read by its path on any winner that holds it; schema
|
|
8
|
+
* admission keeps undeclared ones out. A @check's `check.scope` is never one: it stays text, such as "every admitted
|
|
9
|
+
* native record" or `*`, that selects the verdicts the check binds to, and claims no path; `check.covers` is the
|
|
10
|
+
* check's claimant field, and claiming a path changes nothing about which verdicts the check selects.
|
|
13
11
|
*/
|
|
14
12
|
export const CLAIM_FIELDS = Object.freeze([
|
|
15
13
|
'authority.covers',
|
|
@@ -116,7 +114,7 @@ export function selects(selection, path) {
|
|
|
116
114
|
}
|
|
117
115
|
/**
|
|
118
116
|
* G06c: the winners whose claims select `path`, holders outside `scope` pruned, ordered band descending then identity
|
|
119
|
-
* ascending (
|
|
117
|
+
* ascending (db D02b). Reads the load-time claimant index; nothing is rescanned per query.
|
|
120
118
|
*/
|
|
121
119
|
export function claimants(graph, path, scope) {
|
|
122
120
|
const target = pathSegments(path);
|
package/dist/claims.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGzD
|
|
1
|
+
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../src/claims.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAsB,MAAM,CAAC,MAAM,CAAC;IAC3D,kBAAkB;IACl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E,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9D,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,QAAQ,CACb,CAAC,GAAG,KAAK,CAAC;SACP,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SAC/F,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CACtE,CAAC;AACJ,CAAC"}
|
package/dist/revision.d.ts
CHANGED
|
@@ -14,14 +14,14 @@ export declare const compare: (a: string, b: string) => number;
|
|
|
14
14
|
export declare function stableSerialize(value: unknown): string;
|
|
15
15
|
export declare function revisionOf(registry: FrozenRegistry, inputs: RevisionInputs): string;
|
|
16
16
|
/**
|
|
17
|
-
* The authored revision (
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
17
|
+
* The authored revision (G01a): `revisionOf` over the same inputs without the sources at runtime placement (band 0),
|
|
18
|
+
* so runtime-band evidence, admitted below authored, moves it no more than it moves what agents are given. A
|
|
19
|
+
* runtime-placed input whose path `derived` names stays: a derived revision-only input that no record compiles from,
|
|
20
|
+
* such as db's `.ia/.db-inputs.json` (its folder inventory, floor origin, authored roots and activation), so those
|
|
21
|
+
* still move it. The registry, language version and kernel digest stay as `revisionOf` hashes them, and every source
|
|
22
|
+
* is checked as `revisionOf` checks it. With no other source at runtime placement it is `revisionOf(registry, inputs)`
|
|
23
|
+
* itself. It is no `load` input: a graph's `revision` stays `revisionOf`'s, and `load` still needs every record's
|
|
24
|
+
* source among the full inputs.
|
|
25
25
|
*/
|
|
26
26
|
export declare function authoredRevisionOf(registry: FrozenRegistry, inputs: RevisionInputs, derived?: readonly string[]): string;
|
|
27
27
|
/**
|
package/dist/revision.js
CHANGED
|
@@ -62,14 +62,14 @@ export function revisionOf(registry, inputs) {
|
|
|
62
62
|
return hashOf(registry, inputs, canonicalSources(inputs));
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* The authored revision (
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
65
|
+
* The authored revision (G01a): `revisionOf` over the same inputs without the sources at runtime placement (band 0),
|
|
66
|
+
* so runtime-band evidence, admitted below authored, moves it no more than it moves what agents are given. A
|
|
67
|
+
* runtime-placed input whose path `derived` names stays: a derived revision-only input that no record compiles from,
|
|
68
|
+
* such as db's `.ia/.db-inputs.json` (its folder inventory, floor origin, authored roots and activation), so those
|
|
69
|
+
* still move it. The registry, language version and kernel digest stay as `revisionOf` hashes them, and every source
|
|
70
|
+
* is checked as `revisionOf` checks it. With no other source at runtime placement it is `revisionOf(registry, inputs)`
|
|
71
|
+
* itself. It is no `load` input: a graph's `revision` stays `revisionOf`'s, and `load` still needs every record's
|
|
72
|
+
* source among the full inputs.
|
|
73
73
|
*/
|
|
74
74
|
export function authoredRevisionOf(registry, inputs, derived = []) {
|
|
75
75
|
const kept = new Set(derived.map(canonicalPath));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inventarch/graph",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"LANGUAGE.md"
|
|
72
72
|
],
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@inventarch/language": "3.
|
|
74
|
+
"@inventarch/language": "3.2.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/node": "^22.19.0",
|