packstruct 1.1.0 → 1.1.1

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 CHANGED
@@ -1,6 +1,8 @@
1
- # packstruct 1.1.0
1
+ # packstruct 1.1.1
2
2
 
3
- The shared `/packs` spec. **One manifest + entry + lifecycle contract, many hosts**, currently [crashtest](https://github.com/dhaupin/crashtest) (scenario profile) and [poststruct](https://github.com/dhaupin/poststruct) (check profile).
3
+ The shared `/packs` spec. **One manifest + entry + lifecycle contract, many hosts**: [crashtest](https://github.com/dhaupin/crashtest) (scenario), [poststruct](https://github.com/dhaupin/poststruct) (check), plus two profiles bound to the host-owned [memstruct](https://github.com/dhaupin/memstruct) standard - [`memory`](profiles/memory.md) (vant's markdown store) and [`sync`](profiles/sync.md) (gistory's merge).
4
+
5
+ **New here?** The site speaks to three audiences: [start here](https://packstruct.creadev.org/start) (absolute beginner - what a pack is, in plain words), [extend](https://packstruct.creadev.org/extend) (hobbyist - write a pack a host will run), and [fleet & enterprise](https://packstruct.creadev.org/enterprise) (many repos, conformance as a CI gate). The [showcase](https://packstruct.creadev.org/showcase) lists every host that ships a `packs/` directory.
4
6
 
5
7
  This repo ships the normative spec ([spec/SPEC.md](spec/SPEC.md)) plus a zero-dependency lint CLI that kills the worst pack-authoring class at author time: a manifest declaring an entry file that doesn't actually ship (crashtest#16). Every fleet repo uses the same core check.
6
8
 
@@ -37,7 +39,7 @@ The linter validates `schemaVersion === 1`, kebab-case name matching its directo
37
39
 
38
40
  ## Profiles
39
41
 
40
- The two entry profiles are declared once, with the spec (one address per the crashtest#19 ruling): [profiles/scenario.md](profiles/scenario.md) (crashtest - links to the host-owned contract instead of copying it) and [profiles/check.md](profiles/check.md) (poststruct).
42
+ The entry profiles are declared once, with the spec (one address per the crashtest#19 ruling): [profiles/scenario.md](profiles/scenario.md) (crashtest - links to the host-owned contract instead of copying it), [profiles/check.md](profiles/check.md) (poststruct), and the two memstruct-bound profiles [profiles/memory.md](profiles/memory.md) (vant's store) and [profiles/sync.md](profiles/sync.md) (gistory's merge). The `memory`/`sync` pages LINK to [memstruct](https://github.com/dhaupin/memstruct) for the record grammar and the merge contract, so the standard lives in one place.
41
43
 
42
44
  ## How the schema version was chosen
43
45
 
@@ -49,10 +51,15 @@ Every consuming host keeps a receipt row here: engine, the exact source sha the
49
51
 
50
52
  | Host | Pin (engine @ source sha) | Result | Cut |
51
53
  |---|---|---|---|
52
- | crashtest | `crashtest@1.1.0` @ `2d1fe79` (npm tag v1.1.0) | 8/8 packs clean shallow + deep, 44 ids, 63 library ids, zero collisions (`labs/corpus-receipt.md`) | 2026-10-29 |
53
- | crashtest (dogfood) | `crashtest@1.1.0` @ `2d1fe79` | `crashtest run`: 53/53 catalog findings REFUSED (4 from `packstruct-lint-shapes`), 0 EXPLOITED, 0 BOUNDED (`labs/crashledger.json`) | 2026-10-29 |
54
- | eyestruct | `eyestruct@1.0.0` @ `4b979c0` (tag v1.0.0) | 5/5 packs (eye-adapter, eye-bundle, eye-ci-gate, eye-shapes, eye-text-leg) clean shallow + deep through the packstruct@1 lane | 2026-10-29 |
55
- | poststruct | staging in flight | row reserved - activates when it settles (honest absence, not padding) | - |
54
+ | crashtest | `crashtest@1.3.0` @ `8738287` (npm tag v1.3.0) | 9/9 packs clean shallow + deep, 47 ids, 66 library ids, zero collisions (`labs/corpus-receipt.md`) | 2026-11-06 |
55
+ | crashtest (dogfood) | `crashtest@1.3.0` @ `8738287` | `crashtest run`: 56/56 catalog findings REFUSED (4 from `packstruct-lint-shapes`), 0 EXPLOITED, 0 BOUNDED (`labs/crashledger.json`) | 2026-11-06 |
56
+ | eyestruct | `eyestruct@1.1.0` | 6/6 packs (eye-adapter, eye-bundle, eye-ci-gate, eye-shapes, eye-spa-dist, eye-text-leg) clean shallow + deep through the packstruct@1 lane | 2026-11-07 |
57
+ | poststruct | `poststruct@1.1.0` | 12/12 packs clean shallow + deep (11 baked-site shape packs + `eyes-reference`) | 2026-11-07 |
58
+ | govstruct | `govstruct@1.1.0` | 14/14 check packs clean shallow + deep, 42 ids | 2026-11-07 |
59
+ | monoforge | `monoforge@1.1.0` | `forge-shapes` clean shallow + deep, 6 ids; carries `implements: packstruct@1` | 2026-11-07 |
60
+ | vant | `vant@0.8.6` | 24/24 packs clean shallow + deep, 290 ids (one entry-import violation in `vant-carriers`, a vant-side path, not a spec issue) | 2026-11-07 |
61
+ | gistory | `gistory@1.1.0` | `sync-relay-shapes` clean shallow + deep, 15 ids | 2026-11-07 |
62
+ | prestruct | `prestruct@1.3.0` | `prestruct-proxy` clean shallow + deep, 6 ids | 2026-11-07 |
56
63
 
57
64
  The registry is the natural home for companion-pin bump receipts (SPEC v1.1 section 8 row 5) and the checkable form of a traveler's onboarding (SPEC v1.1 section 10): a host exists when it holds a row, not when a session transcript mentions it. A non-additive schema event must update the affected rows (SPEC v1.1 section 11).
58
65
 
@@ -74,7 +81,7 @@ Build the site locally: `cd web && npm install && npm run build` - `prestruct` r
74
81
 
75
82
  ## Development
76
83
 
77
- Zero runtime dependencies. The gate is `npm test && npm run check` - `check` composes the docs gates, a deep lint of the repo's own shipped pack, and the 9/9 conformance audit (the same command `prepublishOnly` runs, so a publish cannot ship an unverified SPEC or pack surface).
84
+ Zero runtime dependencies. The gate is `npm test && npm run check` - `check` composes the docs gates, a deep lint of the repo's own shipped pack, and the 10/10 conformance audit (the same command `prepublishOnly` runs, so a publish cannot ship an unverified SPEC or pack surface).
78
85
 
79
86
  ```bash
80
87
  npm test # the lint + deep + audit + edge contract suite
@@ -84,4 +91,4 @@ npx crashtest run # the dogfood: hostile manifests through the CLI wire
84
91
 
85
92
  ## Crashtest dogfood
86
93
 
87
- `crashtest run` from the repo root drives `packs/public/packstruct-lint-shapes`: hostile pack.json corpora through an in-process lint double (the same CLI wire CI uses), asserting the SPEC v1 section 5 contract - instant nameable refusal, no crashes, no deep stacks, and strict tolerance for spec-allowed shapes. Pinned to dhaupin/crashtest v1.1.0.
94
+ `crashtest run` from the repo root drives `packs/public/packstruct-lint-shapes`: hostile pack.json corpora through an in-process lint double (the same CLI wire CI uses), asserting the SPEC v1 section 5 contract - instant nameable refusal, no crashes, no deep stacks, and strict tolerance for spec-allowed shapes. Pinned to dhaupin/crashtest v1.3.0.
@@ -0,0 +1,4 @@
1
+ // Inert conformance fixture entry for the env-claims case - imports cleanly,
2
+ // declares nothing to run. The point of this case is the MANIFEST: it carries
3
+ // the host-owned `env` block (SPEC section 2) and must be accepted.
4
+ export default { name: 'env-claims-pack' }
@@ -0,0 +1,8 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "name": "requires-pack",
4
+ "description": "SPEC v1.3 conformance pack - declares the host-owned requires key (capability tokens the pack needs from a run root). The accept case: the key is spec'd, so a conforming loader must NOT refuse a pack for carrying it.",
5
+ "version": "1.0.0",
6
+ "entry": "entry.js",
7
+ "requires": ["wordpress", "d1"]
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "packstruct",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "The shared /packs spec: one manifest, entry, and lifecycle contract for crashtest and poststruct packs - plus a zero-dependency lint CLI that kills broken pack manifests at author time.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -0,0 +1,42 @@
1
+ # The memory profile
2
+
3
+ Declared per SPEC v1.2 section 3 (normative) and filed here once, per the one-address ruling on [crashtest#19](https://github.com/dhaupin/crashtest).
4
+
5
+ This is the profile [vant](https://github.com/dhaupin/vant) loads. The record grammar is HOST-OWNED by the [memstruct](https://github.com/dhaupin/memstruct) standard, so this page LINKS to it rather than copying it - the same rule the `scenario` profile follows for crashtest's contract (doc drift is worse than indirection).
6
+
7
+ ## The module shape
8
+
9
+ An entry module under this profile is an ES module with a default export carrying a `records` array:
10
+
11
+ ```js
12
+ export default {
13
+ records: [
14
+ // Durable memory records: id, createdAt, an optional updatedAt/deletedAt
15
+ // envelope, and a host-owned body (typically markdown). The envelope is
16
+ // memstruct's; the body vocabulary is the host's.
17
+ ],
18
+ }
19
+ ```
20
+
21
+ ## The record grammar is memstruct
22
+
23
+ The envelope is not packstruct's to define. [memstruct](https://github.com/dhaupin/memstruct) SPEC section 3 owns it:
24
+
25
+ - `id` - REQUIRED, stable, opaque to the format.
26
+ - `createdAt` - REQUIRED integer (epoch ms).
27
+ - `updatedAt` - OPTIONAL integer; the merge clock.
28
+ - `deletedAt` - OPTIONAL integer or null; the tombstone (a delete is not an erase).
29
+ - `kind`, `scope`, `body`, `links`, `provenance`, `ttl`, `meta` - host-owned, carried through, never refused.
30
+
31
+ The store is `{ "memstruct": 1, "records": [...] }`. A memory pack's store validates with `npx memstruct lint <store.json>`.
32
+
33
+ ## What the spec guarantees
34
+
35
+ - **No transport, no network by default.** A memory pack reads and writes the records the host points it at. Git (or a database, or a directory) is the substrate; memstruct is silent on it by design.
36
+ - **Config-is-the-arm.** Being enumerated in the host's `packs:` config IS the arm, as in the `check` profile. A `pack.json` may still carry `armedByKey` (the shared manifest surface never forks), and the loader gives it the default lifecycle.
37
+ - **Namespaced ids.** Pack ids live in the pack-slug namespace; cross-namespace collision at load refuses to start (SPEC section 4).
38
+ - **Refusals** are instant, one-line, and name the pack (SPEC section 5).
39
+
40
+ ## Boundary charter
41
+
42
+ The `memory` profile is the store tier; the replicated tier is the [`sync` profile](https://github.com/dhaupin/packstruct/blob/main/profiles/sync.md), which binds gistory's merge. Both ride the same memstruct grammar, so a store written under `memory` merges under `sync` without a translation layer. The engine receipt for this profile is vant's markdown brain store (`models/public/<brain>/`, `models/private/<brain>/`) and its MCP door.
@@ -0,0 +1,45 @@
1
+ # The sync profile
2
+
3
+ Declared per SPEC v1.2 section 3 (normative) and filed here once, per the one-address ruling on [crashtest#19](https://github.com/dhaupin/crashtest).
4
+
5
+ This is the profile [gistory](https://github.com/dhaupin/gistory) loads. The merge contract is HOST-OWNED by the [memstruct](https://github.com/dhaupin/memstruct) standard, so this page LINKS to it rather than copying it.
6
+
7
+ ## The module shape
8
+
9
+ An entry module under this profile is an ES module with a default export carrying a `merge` function:
10
+
11
+ ```js
12
+ export default {
13
+ // Reconcile two memstruct stores into one. Pure: no I/O, no clock, no
14
+ // randomness. The winner per id is decided by the merge contract below.
15
+ merge(local, remote) {
16
+ return { memstruct: 1, records: [/* ... */] }
17
+ },
18
+ }
19
+ ```
20
+
21
+ ## The merge contract is memstruct
22
+
23
+ memstruct SPEC section 4 owns it. A conforming merge satisfies four observable properties:
24
+
25
+ 1. **Convergence** - the same records merge to the same result on every replica, in any order.
26
+ 2. **Determinism** - merge is a pure function of its inputs.
27
+ 3. **Tombstone semantics** - a delete hides a record unless it was updated after the deletion, in which case the update resurrects it.
28
+ 4. **Monotonicity** - an older version never displaces a newer one.
29
+
30
+ The **reference algorithm** is last-write-wins plus tombstones over a total order of `(clock, contentHash)`, `clock = max(updatedAt ?? createdAt, deletedAt ?? 0)`. The properties are normative; the algorithm is the reference, not the requirement, so a CRDT-class merge conforms if it satisfies all four.
31
+
32
+ ## How a sync pack is graded
33
+
34
+ The language-neutral case kind is `memstruct audit-merge` (memstruct SPEC section 6): each case carries `local.json`, `remote.json`, and `expected.json`, and the harness runs the merge **both ways** and asserts each equals the expected store - the order-independence leg, which names a non-deterministic merge instead of passing it. Because the case kind is pure data in and pure data out, it grades a Python or Go merge identically to the JS reference.
35
+
36
+ ## What the spec guarantees
37
+
38
+ - **No transport, no network by default.** The merge is a pure function; the substrate (a git repo, a relay, a database) is the host's, not the profile's.
39
+ - **Config-is-the-arm.** Being enumerated in the host's `packs:` config IS the arm. A `pack.json` may still carry `armedByKey`; the loader gives it the default lifecycle.
40
+ - **Namespaced ids.** Cross-namespace collision at load refuses to start (SPEC section 4).
41
+ - **Refusals** are instant, one-line, and name the pack (SPEC section 5).
42
+
43
+ ## Boundary charter
44
+
45
+ The `sync` profile is the replicated tier; the store tier is the [`memory` profile](https://github.com/dhaupin/packstruct/blob/main/profiles/memory.md), which binds vant's store. Both ride the same memstruct grammar. The engine receipt for this profile is gistory's merge (`src/sync/merge.ts`, pure, deterministic, tombstone-aware) over its record shape (`src/lib/models.ts`).
package/spec/SPEC.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  One `/packs` system, many hosts. This document is normative for any app that loads packs from a `packs/` directory and for anyone authoring a pack.
4
4
 
5
- **Revision history.** v1.0.0 froze the manifest table against crashtest's production reality. v1.1.0 is the additive-first patch section 6 promises: five rows, every one citing an ENGINE receipt (behavior at least one host loader already holds), none moving `schemaVersion` and none changing a conforming host's behavior. See section 8 for the adopted rows.
5
+ **Revision history.** v1.0.0 froze the manifest table against crashtest's production reality. v1.1.0 is the additive-first patch section 6 promises: five rows, every one citing an ENGINE receipt (behavior at least one host loader already holds), none moving `schemaVersion` and none changing a conforming host's behavior. See section 8 for the adopted rows. v1.2.0 adds two profile rows (`memory`, `sync`), both binding the host-owned [memstruct](https://github.com/dhaupin/memstruct) standard rather than re-typing it; no manifest field changes and no `schemaVersion` move. v1.3.0 adds one host-owned manifest key (`requires`) and one lifecycle norm (the skip-before-import relevance rule), both citing crashtest's loader as the engine receipt; again no `schemaVersion` move and no change to a conforming host that declares nothing.
6
6
 
7
7
  **Schema base (verified 2026-10-24, crashtest#19 receipts):** every crashtest production pack ships schemaVersion 1 with exactly the shared field set (8/8 conform, nothing drifted since the 2026-10-23 audit). The id space is clean: 44 pack ids across the 8 packs, zero collisions pack-vs-pack and pack-vs-library. v1 formalizes that reality; hosts either already conform (crashtest) or adopt it fresh (poststruct). Baseline watch: if a host fleet bumps its manifests, the spec formalizes the new number - the spec tags whatever the fleet ships. Ordering ruled on crashtest#19: code first, spec formalizes after; nothing schema-changing is hidden on the engine side.
8
8
 
@@ -26,15 +26,17 @@ packs/public/<pack-name>/
26
26
  | `version` | dotted MAJOR.MINOR[.PATCH] |
27
27
  | `entry` | relative path inside the pack dir, MUST exist (missing entry = instant, nameable refusal - the crashtest#16 lesson is a norm now). "Inside the pack dir" is PHYSICAL, not merely lexical: an entry whose resolved target escapes the pack (via `..`, an absolute path, or a symlink pointing outside) refuses |
28
28
  | `armedByKey` | OPTIONAL string. Present: the host MAY run its arming-key ceremony before activation - presence semantics only, so an EMPTY value is "present, not yet armed" (folded from the crashtest#25 matrix fold: the engine treats empty as valid, so a non-empty rule would be a check the SPEC never promised). Absent: the host's own default lifecycle governs |
29
+ | `requires` | OPTIONAL array of kebab-case capability tokens the pack needs from its run root (added v1.3.0, section 8 row 9). The VOCABULARY is host-owned and free-form - the spec never forks a shared capability list; `packstruct lint` shape-checks tokens (kebab-case, non-empty, unique) and assigns them no meaning. A conforming loader that declares what its target provides SKIPS a pack whose `requires` is unmet, before import (section 4, the relevance norm). Absent = the pack is always relevant, byte-identical to pre-v1.3.0 behavior |
29
30
 
30
31
  **Lint-assist key.** `armedCoverage` (added v1.1.0, section 8 row 6) is OPTIONAL: a pack's own declaration of the relative path to its armed end-to-end row - the test that runs the pack against a stub target with its vocabulary armed. It is NOT a shared fact: no conforming loader assigns it meaning. It exists for `packstruct lint`, which CONFIRMS the declared file ships inside the pack dir (a declaration naming a missing or escaping path refuses as `armed-coverage` - the vacuous-green class made loud) and never RUNS the row; runs are the host's business. Absent is the quiet default and never colors a verdict (packstruct#27).
31
32
 
32
- **Host-owned acknowledged keys.** The table above is the shared-facts column: fields every conforming loader assigns meaning to. Some hosts additionally carry their own optional manifest keys with host-side shape validation. For v1, three are acknowledged by name because crashtest's loader already validates them (ruled on crashtest#19); a fourth joined in v1.1.0 (section 8 row 1):
33
+ **Host-owned acknowledged keys.** The table above is the shared-facts column: fields every conforming loader assigns meaning to. Some hosts additionally carry their own optional manifest keys with host-side shape validation. For v1, three are acknowledged by name because crashtest's loader already validates them (ruled on crashtest#19); a fourth joined in v1.1.0 (section 8 row 1), and a fifth in v1.3.0 (section 8 row 9):
33
34
 
34
35
  - `env` - the env-claims block (`d1`/`kv`/`routes`, plus optional `env.seed`)
35
36
  - `plugins` - bundled plugin imports, resolved against the pack dir
36
37
  - `package` - optional npm name for the pack
37
38
  - `implements` - optional string acknowledging the spec the pack builds against, formatted `packstruct@<MAJOR>` or an exact pin `packstruct@1.0.0` (added v1.1.0, section 8 row 1). `packstruct lint` validates FORMAT ONLY and reports a non-conforming shape as a WARNING, never a refusal; absence is the quiet default and never colors a verdict.
39
+ - `requires` - optional array of kebab-case capability tokens the pack needs from its run root (added v1.3.0, section 8 row 9). `packstruct lint` shape-checks the tokens and never assigns them meaning; the loader that declares `provides` skips an unmet pack before import (section 4).
38
40
 
39
41
  These are **acknowledged, not shared facts**: the spec documents that they may appear and that the HOST owns their semantics and shape rules. Their presence is never a spec violation, `packstruct lint` must never refuse a pack for carrying them, and a future host naming a fourth host-owned key extends this list in a patch revision, not a schemaVersion bump.
40
42
 
@@ -56,16 +58,21 @@ Extra manifest keys and extra files beside the entry are allowed as minimum-spec
56
58
 
57
59
  An entry is an ES module with a default export. The manifest/dir/entry surface never forks between hosts; execution semantics are declared as profiles:
58
60
 
59
- - **`scenario` profile (crashtest):** default export = a module object carrying `name`, `description`, and an `attacks[]` array (attack names kebab-case, each with a `run` function or a `steps` chain). Contains hostile scenarios executed against a transport; hosts of this profile provide isolation (fake transport, opt-out postures) and support the `armedByKey` ceremony. The module-shape contract is HOST-OWNED in full: it lives with the host (crashtest's `reference/scenario-contract`); `profiles/scenario.md` links to it rather than copying it - doc drift is worse than indirection (ruled on crashtest#19; the `register(ctx)` shape in earlier drafts of this section was stale, deleted against the engine truth at `fc93ca6` per the engine-first rule). The canonical profile pages live with the spec (one address, same ruling): `profiles/scenario.md` and `profiles/check.md`.
61
+ - **`scenario` profile (crashtest):** default export = a module object carrying `name`, `description`, and an `attacks[]` array (attack names kebab-case, each with a `run` function or a `steps` chain). Contains hostile scenarios executed against a transport; hosts of this profile provide isolation (fake transport, opt-out postures) and support the `armedByKey` ceremony. The module-shape contract is HOST-OWNED in full: it lives with the host (crashtest's `reference/scenario-contract`); `profiles/scenario.md` links to it rather than copying it - doc drift is worse than indirection (ruled on crashtest#19; the `register(ctx)` shape in earlier drafts of this section was stale, deleted against the engine truth at `fc93ca6` per the engine-first rule). The canonical profile pages live with the spec (one address, same ruling): `profiles/scenario.md`, `profiles/check.md`, `profiles/memory.md`, and `profiles/sync.md`.
60
62
  - **`check` profile (poststruct):** default export = `{ checks: [Check] }`. Declarative pure-reading verifiers over files on disk. No transport, no network by default. Arming defaults to config enumeration: being listed in the host's `packs:` config IS the arm; no separate key ceremony.
63
+ - **`memory` profile (vant):** default export = `{ records: [Record] }`, a durable memory store. The record grammar is HOST-OWNED by the [memstruct](https://github.com/dhaupin/memstruct) standard (the envelope `id`/`createdAt`/`updatedAt`/`deletedAt`; the body host-owned), so `profiles/memory.md` LINKS to memstruct rather than copying it - the same one-address rule the `scenario` profile follows. No transport, no network by default; git (or any substrate) is the host's choice. Arming defaults to config enumeration.
64
+ - **`sync` profile (gistory):** default export = `{ merge(local, remote) }`, a pure reconciliation of two memstruct stores. The merge contract is HOST-OWNED by [memstruct](https://github.com/dhaupin/memstruct) section 4 (four normative properties: convergence, determinism, tombstone semantics, monotonicity), so `profiles/sync.md` LINKS to memstruct. A sync pack is graded by the language-neutral `memstruct audit-merge` case kind, not by any packstruct lane.
61
65
 
62
66
  A host declares which profile(s) it loads. A pack never changes its own semantics based on the host.
63
67
 
68
+ **Profiles are an extension point, not a fixed pair.** The spec declares the four family profiles (`scenario`, `check`, `memory`, `sync`); a host may extend with an app-namespaced fifth. A new profile adds a row here and a page in `profiles/`; it never forks the manifest grammar (section 10).
69
+
64
70
  ## 4. Lifecycle norms (all hosts)
65
71
 
66
72
  - **Explicit loads only.** A pack runs because the host's config enumerates it. Remote/npm sources are NOT part of v1; adding them requires an explicit spec version bump and stays no-auto-download.
67
73
  - **Namespaced ids.** Pack check/scenario ids live in a pack-slug namespace in the host's id space. Cross-namespace collision at load time = refuse to start, never silent dedupe.
68
74
  - **Self-audit fixtures.** Every pack ships `test/fixtures/` proving its contents do what they claim. A pack whose fixtures fail fails its own CI host-first. (Crashtest backfill note: fixtures are the one norm its production packs do not ship yet; it is a lifecycle requirement, not a manifest field, so schemaVersion does not move for it.)
75
+ - **Relevance (the skip-before-import norm, added v1.3.0).** A pack may not declare its own relevance (section 3: "A pack never changes its own semantics based on the host"), so relevance is split across the two ends. The PACK declares `requires` - what it needs from a run root (section 2). The RUN ROOT declares `provides` - what its target offers - and MAY declare an explicit `ignore` deny-list. A conforming loader that has a non-empty `provides` MUST skip, BEFORE import, any pack whose `requires` is not a subset of `provides`, and any pack named in `ignore`; `ignore` wins over relevance. The skip MUST be reportable (the loader names the skipped pack and the reason - an unmet-requires skip is never a silent green), and a run root that declares no `provides` and no `ignore` MUST load every pack exactly as before. This is the honest inverse of a deny-list: a deny-list fails OPEN (a newly shipped pack runs everywhere until someone remembers to deny it), while `requires` fails CLOSED (a pack naming an unmet capability skips itself, with no per-root upkeep), travels WITH the pack (a manifest field, so `packstruct lint` sees it), and is host-owned vocabulary (the spec never forks a shared capability list). Engine receipt: crashtest's loader `src/packs/relevance.js` + the skip wiring in `src/packs/loader.js` / `src/cli.js` (dhaupin/crashtest#104).
69
76
 
70
77
  ## 5. Errors (nameable, instant)
71
78
 
@@ -84,9 +91,9 @@ A conforming loader refuses with a one-line error naming the pack and the broken
84
91
  - `packstruct lint <packs-dir> --deep`: the same shallow pass, plus the section-3/4/5 norms at author time - import each declared entry in an isolated child (an entry that fails to import or carries no default export refuses as `entry-import`/`entry-default-export`) and census the declared ids (a duplicate within a pack, a cross-pack name/id collision, or a collision against a `--against <lib>` host library refuses as `id-duplicate`/`id-collision`/`id-library-collision`). These are the spec's own load-time refusals surfaced early, never new norms; a hostile entry is killed on a timeout or output cap and refused nameably, never run in the linter's own process.
85
92
  - `packstruct audit-conformance <repo-dir> --loader "<cmd> {packs}"`: the conformance harness. Bundled verdict-claiming cases (one clean bundle, one per section-5 refusal norm, plus a name-collision pair, plus one `env-claims` bundle carrying the section-2 host-owned `env` block) are materialized into scratch roots and the HOST's own loader command runs over each. A conforming loader exits 0 on the clean bundle and exits non-zero AND names the offending pack on every violation bundle (section 5: nameable refusals; identity matches, refusal wording stays host-owned). The `env-claims` bundle is an ACCEPT case: a pack that merely declares claims is conforming, so a loader must never refuse it. `--claims` additionally requires the loader to ECHO the declared block (one `packstruct:env-claims <claims-json>` stdout line) on that case - a loader that silently ignores `env` is named instead of passing, and one that refuses the spec'd key is named as such (packstruct#71). Same exit ladder: 0 all cases honored / 1 any case failed / 2 usage.
86
93
 
87
- ## 8. v1.1.0 - the additive rows (adopted 2026-10-29)
94
+ ## 8. The additive rows (v1.1.0, v1.2.0, v1.3.0)
88
95
 
89
- Six rows, each citing an ENGINE receipt, none moving `schemaVersion` and none changing a conforming host's behavior. Full proposal (byte-pinned at `dd05454` in dhaupin/gistory): `labs/` receipts and issue dhaupin/packstruct#19.
96
+ Six v1.1.0 rows, each citing an ENGINE receipt, none moving `schemaVersion` and none changing a conforming host's behavior. Full proposal (byte-pinned at `dd05454` in dhaupin/gistory): `labs/` receipts and issue dhaupin/packstruct#19.
90
97
 
91
98
  1. **`implements`** - the optional host-owned acknowledgement key (section 2). FORMAT ONLY: `packstruct@<MAJOR>` or an exact pin `packstruct@1.0.0`; a non-conforming shape is a lint WARNING, never a refusal; absence is the quiet default. Receipt: eyestruct and poststruct both carry `packstruct@1.0.0` as an exact devDependency, so the pin discipline exists but had no manifest surface.
92
99
  2. **The `--loader` template contract, formalized.** `{packs}` substitutes the materialized case pack's DIRECTORY path (never a tarball, never a URL). The loader command runs with CWD = the audited repo root. Exit contract: 0 on the clean bundle; non-zero AND a stderr line naming the offending pack on every violation bundle. The loader runs with NO network and NO implicit host config. A loader that TIMES OUT or crashes is verdict "1 any case failed", never 0, and the harness names which loader failed. Receipt: both live harnesses (poststruct's `run-packs.mjs`, eyestruct's `run-packs.cjs`) hold every clause.
@@ -95,6 +102,21 @@ Six rows, each citing an ENGINE receipt, none moving `schemaVersion` and none ch
95
102
  5. **Companion-pin receipts.** Hosts carry the packstruct pin they conform to as an EXACT devDependency, bumped deliberately and receipted per host. A host may lag another host's pin; its `implements` row and CI battery reveal the state. Nothing forces synced bumps - it forces the SYNCHRONIZED RECEIPT when a bump happens.
96
103
  6. **`armedCoverage` - the pack-lane coverage declaration (section 2).** OPTIONAL string: the relative path to the pack's armed end-to-end row. `packstruct lint` CONFIRMS the declared file ships inside the pack dir (a declaration naming a missing or escaping path refuses as `armed-coverage` - the vacuous-green class made loud); it never RUNS the row. Absent is the quiet default and never colors a verdict. Receipt: packstruct#27 - crashtest walk rounds 18-20 found pack defects invisible to shape lint (oracle bugs that only fire on a real wire), so the row exists to make "declared armed coverage that isn't there" nameable at author time. This row makes SPEC §2 promise the `armed-coverage` refusal `src/lint.mjs` already emitted - before it, the linter shipped a check the SPEC never promised.
97
104
 
105
+ ### v1.2.0 - the two memstruct profile rows (adopted 2026-11-08)
106
+
107
+ Two profile rows (section 3), both bound to a HOST-OWNED standard rather than re-typed here. Neither moves `schemaVersion` nor adds a manifest field; both are the additive-first kind section 6 promises.
108
+
109
+ 7. **`memory` profile** - default export = `{ records: [Record] }`, a durable memory store. The record grammar is owned by [memstruct](https://github.com/dhaupin/memstruct) (envelope `id`/`createdAt`/`updatedAt`/`deletedAt`; body host-owned and carried, never refused), so `profiles/memory.md` LINKS to memstruct, the same one-address rule the `scenario` profile applies to crashtest's contract. Engine receipt: vant's markdown brain store (`models/public/<brain>/`, `models/private/<brain>/`, "git history becomes the memory lineage"). The store tier.
110
+ 8. **`sync` profile** - default export = `{ merge(local, remote) }`, a pure reconciliation of two memstruct stores. The merge contract is owned by [memstruct](https://github.com/dhaupin/memstruct) section 4 (four normative properties: convergence, determinism, tombstone semantics, monotonicity), so `profiles/sync.md` LINKS to memstruct. A sync pack is graded by the language-neutral `memstruct audit-merge` case kind, not by any packstruct lane (the packstruct harness proves the manifest; memstruct proves the merge). Engine receipt: gistory's merge (`src/sync/merge.ts`, pure, deterministic, tombstone-aware) over its record shape (`src/lib/models.ts`). The replicated tier.
111
+
112
+ The binding is separation of concerns: packstruct owns the pack (manifest + entry + lifecycle), memstruct owns the record grammar and the merge contract, and the `memory`/`sync` profiles are where the two meet. A host declares one; the profile page links the other standard rather than copying it, so a memstruct edit can never silently fork packstruct's copy.
113
+
114
+ ### v1.3.0 - the relevance row (adopted 2026-11-03)
115
+
116
+ One row: a host-owned manifest key plus the lifecycle norm that gives it meaning. It does not move `schemaVersion` and changes nothing for a host that declares no `provides` - the additive-first kind section 6 promises.
117
+
118
+ 9. **`requires` - the relevance key (sections 2 and 4).** OPTIONAL array of kebab-case capability tokens a pack needs from its run root (e.g. `"requires": ["wordpress"]`). The VOCABULARY is host-owned and free-form: the spec never forks a shared capability list, so a WordPress token in crashtest and one in another host mean whatever that host says. `packstruct lint` shape-checks the tokens (kebab-case, non-empty, unique) and assigns them no meaning. The lifecycle norm (section 4) is where the meaning lands: a conforming loader whose run root declares a non-empty `provides` MUST skip, before import, any pack whose `requires` is not a subset of `provides`, and any pack named in an explicit `ignore` deny-list (`ignore` wins); the skip is reportable and a run root declaring neither is unchanged. The mechanism is deliberately the honest INVERSE of a `.packignore` deny-list, and it keeps the two things a deny-list cannot: it fails CLOSED (a newly shipped pack naming an unmet capability skips itself, with no per-run-root upkeep), and it travels WITH the pack (a manifest field, so lint sees it). The dev/hobbyist escape hatch is the loader-side `ignore`/`.packignore` deny-list, which covers the one case relevance cannot express - "my target COULD serve this, but I do not want it here". Engine receipt: crashtest's loader - `src/packs/relevance.js` (`relevanceSkip`, `validateRequires`, `globMatch`, `parsePackignore`) plus the skip wiring in `src/packs/loader.js` / `src/cli.js` / `src/plans.js`, six shipped packs carrying `requires` (`wp-*` -> `wordpress`, `next-middleware-shapes` -> `next`, `vite-dev-shapes` -> `vite`, `qs-shapes` -> `qs`), and `test/pack-relevance.test.js` pinning the skip-before-import (dhaupin/crashtest#104).
119
+
98
120
  ## 9. The walk-exit (promotion) rule (v1.1.0)
99
121
 
100
122
  A manual walk is not done until nothing it found is uncommissioned: a walk is not finished while any finding it produced is still unrecorded. Every finding must be promoted, in the same session that found it, to one of:
@@ -109,7 +131,7 @@ The failure mode this closes is the one-mortem: a probe that got described in pr
109
131
 
110
132
  A new engine ("traveler") joins the grammar by answering the three questions this spec already structures, in this order - never by forking the manifest:
111
133
 
112
- 1. **What does the manifest see?** The frozen v1 field table (section 2) and the host-owned acknowledged keys (`env`, `plugins`, `package`, `implements`). Nothing to fork; nothing to re-declare.
134
+ 1. **What does the manifest see?** The frozen v1 field table (section 2) and the host-owned acknowledged keys (`env`, `plugins`, `package`, `implements`, `requires`). Nothing to fork; nothing to re-declare.
113
135
  2. **What does the lint see?** The same `packstruct lint` / `audit-conformance` lanes. A new profile only extends the CASES it reports, never the manifest grammar. All profile-bearing engines to date gate clean through the same packstruct@1 lane.
114
136
  3. **What does run mean?** This is the only new thing a traveler owns: a profile row (execution semantics declared by the host), an engine receipt per adopted behavior, and cases in `audit-conformance` keyed to its profile id.
115
137
 
package/src/audit.mjs CHANGED
@@ -40,6 +40,17 @@ export const CASES_DIR = fileURLToPath(new URL('../conformance/cases/', import.m
40
40
  export const ENV_CLAIM_CASES = new Set(['env-claims'])
41
41
  const CLAIM_MARKER = 'packstruct:env-claims '
42
42
 
43
+ // Cases that carry the host-owned `requires` relevance key (SPEC section 2,
44
+ // added v1.3.0) and exist to prove a loader does not REFUSE a pack for
45
+ // declaring the capabilities it needs. Accept cases: the key is spec'd, so a
46
+ // conforming loader must tolerate it (a loader that does not implement
47
+ // relevance still loads the pack - it just never skips it). The SKIP behavior
48
+ // itself is host-owned (a run root's `provides`/`ignore` are the host's
49
+ // vocabulary and channel, which the language-neutral harness cannot supply),
50
+ // so it is graded by the host's own suite - crashtest's
51
+ // test/pack-relevance.test.js is the engine receipt.
52
+ export const REQUIRES_CLAIM_CASES = new Set(['requires-claims'])
53
+
43
54
  // The bundled cases: <case>/public/<pack-dir>/, each with a verdict claim.
44
55
  // clean expects exit 0; every other case expects a refusing loader.
45
56
  export function listCases() {
@@ -104,10 +115,12 @@ export async function auditConformance(opts = {}) {
104
115
  const violations = []
105
116
  let honored = 0
106
117
  for (const c of cases) {
107
- // Accept cases: the clean bundle and the env-claims bundle (a pack that
118
+ // Accept cases: the clean bundle, the env-claims bundle (a pack that
108
119
  // merely carries the spec-allowed `env` block is conforming - SPEC
109
- // section 2). Every other case claims a refusal.
110
- const acceptCase = c === 'clean' || ENV_CLAIM_CASES.has(c)
120
+ // section 2), and the requires-claims bundle (a pack that declares the
121
+ // spec-allowed `requires` relevance key is conforming too - SPEC section
122
+ // 2, added v1.3.0). Every other case claims a refusal.
123
+ const acceptCase = c === 'clean' || ENV_CLAIM_CASES.has(c) || REQUIRES_CLAIM_CASES.has(c)
111
124
  const expect = acceptCase ? 'accept' : 'refuse'
112
125
  const tmp = mkdtempSync(join(tmpdir(), 'packstruct-audit-'))
113
126
  try {
package/src/lint.mjs CHANGED
@@ -128,6 +128,20 @@ function manifestViolations(packDir, name) {
128
128
  if (m.armedByKey !== undefined && typeof m.armedByKey !== 'string') {
129
129
  violations.push({ pack: name, norm: 'armedByKey', message: `armedByKey, when present, must be a string (got ${typeof m.armedByKey})` })
130
130
  }
131
+ // requires (SPEC v1.3.0 section 2): OPTIONAL array of host-owned capability
132
+ // tokens the pack needs from a run root (e.g. ["wordpress"]). Shape-checked
133
+ // only - the VOCABULARY is host-owned and free-form (the spec never forks a
134
+ // shared fact), so the lint validates kebab-case tokens, non-empty and
135
+ // unique, and never assigns them meaning. The engine receipt is crashtest's
136
+ // loader (src/packs/relevance.js), which skips a pack whose requires the
137
+ // target does not provide.
138
+ if (m.requires !== undefined) {
139
+ if (!Array.isArray(m.requires) || m.requires.some((t) => typeof t !== 'string' || !/^[a-z0-9][a-z0-9-]*$/.test(t))) {
140
+ violations.push({ pack: name, norm: 'requires', message: `requires, when present, must be an array of kebab-case capability tokens (got ${JSON.stringify(m.requires)})` })
141
+ } else if (new Set(m.requires).size !== m.requires.length) {
142
+ violations.push({ pack: name, norm: 'requires', message: `requires lists a token twice (got ${JSON.stringify(m.requires)})` })
143
+ }
144
+ }
131
145
  // implements (SPEC v1.1 section 2): OPTIONAL host-owned acknowledgement of
132
146
  // the spec the pack builds against, formatted `packstruct@<MAJOR>` or an
133
147
  // exact `packstruct@1.0.0`. FORMAT ONLY, and format drift is a WARNING,
@@ -203,18 +217,30 @@ export function lintPacks(dir, opts = {}) {
203
217
  return { packsChecked, localChecked, violations, warnings }
204
218
  }
205
219
 
206
- // Ids ONE default export carries (generic over the two house profiles:
207
- // scenario `attacks[]/steps[]`, check `checks[]` - host shapes stay
208
- // host-owned, this never assigns shared meaning to them). Runs in-process
209
- // ONLY on inert data (JSON libraries); code modules are probed in a child
210
- // process via childProbe below - their top-level code must never run inside
211
- // the linter (it could exit() the CLI or spin it forever).
220
+ // The default-export keys that carry declared ids, per house profile:
221
+ // scenario `attacks[]/steps[]`, check `checks[]`, memory `records[]`
222
+ // (memstruct@1 - a store's record ids). ONE source of truth for BOTH the
223
+ // in-process probeIds walk and the child probe script below, so a new
224
+ // profile's key is added once and the two enumerations can never drift.
225
+ // They drifted once: `records` was missing from both, so a memory pack's
226
+ // duplicate record ids and cross-pack record collisions were invisible to
227
+ // --deep (the SPEC section 7 census promise). Fixed, and pinned by
228
+ // test/fixtures/deep/bad/packs/public/memstruct-dup.
229
+ const ID_BEARING_KEYS = ['attacks', 'checks', 'scenarios', 'records']
230
+
231
+ // Ids ONE default export carries (generic over the house profiles:
232
+ // scenario `attacks[]/steps[]`, check `checks[]`, memory `records[]` -
233
+ // host shapes stay host-owned, this never assigns shared meaning to them).
234
+ // Runs in-process ONLY on inert data (JSON libraries); code modules are
235
+ // probed in a child process via childProbe below - their top-level code
236
+ // must never run inside the linter (it could exit() the CLI or spin it
237
+ // forever).
212
238
  function probeIds(def, pack) {
213
239
  const out = []
214
240
  const push = (id, at) => { if (typeof id === 'string' && id) out.push({ id, pack, at }) }
215
241
  if (!def || typeof def !== 'object') return out
216
242
  push(def.name, 'module name')
217
- for (const key of ['attacks', 'checks', 'scenarios']) {
243
+ for (const key of ID_BEARING_KEYS) {
218
244
  const arr = def[key]
219
245
  if (!Array.isArray(arr)) continue
220
246
  for (const item of arr) {
@@ -253,7 +279,7 @@ try {
253
279
  const push = (id, at) => { if (typeof id === 'string' && id) out.ids.push({ id, at }) };
254
280
  if (d && typeof d === 'object') {
255
281
  push(d.name, 'module name');
256
- for (const key of ['attacks', 'checks', 'scenarios']) {
282
+ for (const key of ${JSON.stringify(ID_BEARING_KEYS)}) {
257
283
  const arr = d[key];
258
284
  if (!Array.isArray(arr)) continue;
259
285
  for (const item of arr) {