packstruct 1.0.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 +48 -53
- package/bin/cli.mjs +97 -22
- package/conformance/cases/env-claims/public/env-claims-pack/entry.js +4 -0
- package/conformance/cases/env-claims/public/env-claims-pack/pack.json +16 -0
- package/conformance/cases/requires-claims/public/requires-pack/entry.js +4 -0
- package/conformance/cases/requires-claims/public/requires-pack/pack.json +8 -0
- package/package.json +23 -5
- package/profiles/check.md +7 -27
- package/profiles/memory.md +42 -0
- package/profiles/scenario.md +9 -24
- package/profiles/sync.md +45 -0
- package/spec/SPEC.md +104 -118
- package/src/audit.mjs +88 -2
- package/src/lint.mjs +281 -105
- package/src/new.mjs +79 -0
- package/src/run-capped.mjs +16 -10
package/README.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
# packstruct 1.
|
|
1
|
+
# packstruct 1.1.1
|
|
2
2
|
|
|
3
|
-
The shared `/packs` spec. **One manifest + entry + lifecycle contract, many
|
|
4
|
-
hosts**, currently [crashtest](https://github.com/dhaupin/crashtest)
|
|
5
|
-
(scenario profile) and [poststruct](https://github.com/dhaupin/poststruct)
|
|
6
|
-
(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).
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
time: a manifest declaring an entry file that doesn't actually ship
|
|
11
|
-
(crashtest#16). Every fleet repo uses the same core check.
|
|
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.
|
|
6
|
+
|
|
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.
|
|
12
8
|
|
|
13
9
|
## The directory contract
|
|
14
10
|
|
|
@@ -24,76 +20,75 @@ packs/
|
|
|
24
20
|
|
|
25
21
|
```bash
|
|
26
22
|
npx packstruct lint packs/ # human, exit 0 clean / 1 violations / 2 usage
|
|
27
|
-
npx packstruct lint packs/ --json # machine-readable: {schema, packsChecked, violations}
|
|
23
|
+
npx packstruct lint packs/ --json # machine-readable: {schema, packsChecked, localChecked, violations}
|
|
28
24
|
|
|
29
25
|
npx packstruct lint packs/ --deep # + entry import, default-export check, id census
|
|
30
26
|
npx packstruct lint packs/ --deep --json # adds mode, modulesProbed, idsCensused, libraryIds
|
|
31
27
|
npx packstruct lint packs/ --deep --against lib/ # + host-library id census (id-library-collision)
|
|
28
|
+
npx packstruct lint packs/ --local # + the gitignored local/ WIP lane (lane-tagged rows)
|
|
32
29
|
|
|
33
30
|
npx packstruct audit-conformance . \
|
|
34
31
|
--loader "node bin/load-packs.js {packs}" # audit a HOST loader (SPEC section 7)
|
|
32
|
+
|
|
33
|
+
npx packstruct new my-shapes # scaffold a conforming pack skeleton (packstruct#24)
|
|
35
34
|
```
|
|
36
35
|
|
|
37
|
-
The linter validates `schemaVersion === 1`, kebab-case name matching its
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
`armedByKey` string. Host-owned keys the engine also recognizes (`env`,
|
|
41
|
-
`plugins`, `package`) are acknowledged by name and never refused. Everything
|
|
42
|
-
else (extra manifest keys, snapshot files beside the entry) is
|
|
43
|
-
minimum-spec and left alone.
|
|
44
|
-
|
|
45
|
-
`audit-conformance` is the next half of conformance (SPEC section 7): it
|
|
46
|
-
materializes bundled verdict-claiming fixture packs (one clean bundle, one
|
|
47
|
-
per refusal norm, a name-collision pair) into scratch roots and runs YOUR
|
|
48
|
-
loader command over each - a conforming loader exits 0 on clean and exits
|
|
49
|
-
non-zero naming the pack on every violation (identity match, refusal wording
|
|
50
|
-
stays host-owned). The `implements: packstruct@1` pin becomes verifiable,
|
|
51
|
-
not honorary.
|
|
36
|
+
The linter validates `schemaVersion === 1`, kebab-case name matching its directory, dotted versions, non-empty description, relative entry paths, and that the entry file physically exists under the pack dir. Optional `armedByKey` string. Host-owned keys the engine also recognizes (`env`, `plugins`, `package`) are acknowledged by name and never refused. Everything else (extra manifest keys, snapshot files beside the entry) is minimum-spec and left alone.
|
|
37
|
+
|
|
38
|
+
`audit-conformance` is the next half of conformance (SPEC section 7): it materializes bundled verdict-claiming fixture packs (one clean bundle, one per refusal norm, a name-collision pair, and an `env-claims` bundle carrying the host-owned `env` block) into scratch roots and runs YOUR loader command over each - a conforming loader exits 0 on clean and exits non-zero naming the pack on every violation (identity match, refusal wording stays host-owned). `--claims` goes further on the `env-claims` bundle: the loader must echo the declared block, so a loader that silently ignores `env` is named instead of passing. The `implements: packstruct@1` pin becomes verifiable, not honorary.
|
|
52
39
|
|
|
53
40
|
## Profiles
|
|
54
41
|
|
|
55
|
-
The
|
|
56
|
-
the crashtest#19 ruling): [profiles/scenario.md](profiles/scenario.md)
|
|
57
|
-
(crashtest - links to the host-owned contract instead of copying it) and
|
|
58
|
-
[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.
|
|
59
43
|
|
|
60
44
|
## How the schema version was chosen
|
|
61
45
|
|
|
62
|
-
The baseline (formalized 2026-10-23) is exactly what crashtest's production
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
46
|
+
The baseline (formalized 2026-10-23) is exactly what crashtest's production packs already ship: `schemaVersion: 1` with the shared field set above. Therefore crashtest hosts v1 with **zero runtime changes**, and poststruct adopts v1 fresh. Neither host shares an implementation with the other. They share only this file convention.
|
|
47
|
+
|
|
48
|
+
## Family lanes (receipts, not asks)
|
|
49
|
+
|
|
50
|
+
Every consuming host keeps a receipt row here: engine, the exact source sha the row grates against, the lint result, and the cut date. The row is the receipt - `implements: packstruct@1` in a host README stops being honorary when the registry row is sha-pinned and cut before the consumer's publish wave. Bump a companion pin and the receipt moves in the same change, never silently (packstruct#25).
|
|
51
|
+
|
|
52
|
+
| Host | Pin (engine @ source sha) | Result | Cut |
|
|
53
|
+
|---|---|---|---|
|
|
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 |
|
|
67
63
|
|
|
68
|
-
|
|
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).
|
|
69
65
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
release that seeded the package); 1.0.0 and later flip on the CI publish
|
|
73
|
-
lane - tag v1.0.0 and publish.yml runs (refuses 0.x, verifies the tag
|
|
74
|
-
matches the version, and publishes with `--provenance`, so v1.0.0 carries
|
|
75
|
-
provenance by construction).
|
|
66
|
+
## Status (1.1.0)
|
|
67
|
+
|
|
68
|
+
Version ladder follows [prestruct](https://github.com/dhaupin/prestruct)'s convention: 0.9.x is the manual `npm publish` ladder (0.9.0 was the manual release that seeded the package); 1.0.0 and later flip on the CI publish lane - tag v1.0.0 and publish.yml runs (refuses 0.x, verifies the tag matches the version, and publishes with `--provenance`, so v1.0.0 carries provenance by construction).
|
|
76
69
|
|
|
77
70
|
## Related
|
|
78
71
|
|
|
79
72
|
- [crashtest](https://github.com/dhaupin/crashtest) (scenario-profile host)
|
|
80
73
|
- [poststruct](https://github.com/dhaupin/poststruct) (check-profile host)
|
|
81
|
-
- **The workshop** -> [Creadev.org](https://creadev.org) (the same home as the
|
|
82
|
-
docs, npm, and site surfaces above)
|
|
74
|
+
- **The workshop** -> [Creadev.org](https://creadev.org) (the same home as the docs, npm, and site surfaces above)
|
|
83
75
|
|
|
84
76
|
## Landing & docs
|
|
85
77
|
|
|
86
|
-
Landing: `packstruct.creadev.org` (Cloudflare Pages Git integration rooted at
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
Landing: `packstruct.creadev.org` (Cloudflare Pages Git integration rooted at `web/` - a Vite + React app prerendered by `prestruct build` into `web/dist/` per-route; Pages Functions under `web/functions/`). Docs: `docs.creadev.org/packstruct` (Jekyll + Pagefind + Freestruct via GitHub Actions; see `.github/workflows/docs.yml` and `docs/`).
|
|
79
|
+
|
|
80
|
+
Build the site locally: `cd web && npm install && npm run build` - `prestruct` runs the vite build, injects brand/SEO tags from `web/ssr.config.js`, and prerenders every route to static HTML (bots get HTML, the SPA hydrates for humans).
|
|
81
|
+
|
|
82
|
+
## Development
|
|
91
83
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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).
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm test # the lint + deep + audit + edge contract suite
|
|
88
|
+
npm run check # docs gates + lint:packs + conform:packs (the battery)
|
|
89
|
+
npx crashtest run # the dogfood: hostile manifests through the CLI wire
|
|
90
|
+
```
|
|
96
91
|
|
|
97
92
|
## Crashtest dogfood
|
|
98
93
|
|
|
99
|
-
`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.
|
|
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.
|
package/bin/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// bin/cli.mjs - the packstruct CLI, zero dependencies.
|
|
3
3
|
//
|
|
4
4
|
// packstruct lint <packs-dir> [--json] [--deep] [--against <path>]
|
|
5
|
-
// packstruct audit-conformance [<repo-dir>] --loader "<cmd> {packs}" [--json]
|
|
5
|
+
// packstruct audit-conformance [<repo-dir>] --loader "<cmd> {packs}" [--json] [--claims]
|
|
6
6
|
//
|
|
7
7
|
// The lint subcommand token is stripped when present, and a bare
|
|
8
8
|
// `packstruct <dir>` keeps working (the dir positionally implies lint; a
|
|
@@ -34,10 +34,21 @@
|
|
|
34
34
|
// 1 any case failed, 2 usage error - same ladder as lint.
|
|
35
35
|
import { lintPacks, deepLintPacks } from '../src/lint.mjs'
|
|
36
36
|
import { auditConformance } from '../src/audit.mjs'
|
|
37
|
+
import { newPack } from '../src/new.mjs'
|
|
38
|
+
import { readFileSync } from 'node:fs'
|
|
37
39
|
|
|
38
40
|
let args = process.argv.slice(2)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
// The version truth is package.json (the family rule): the publish lane's
|
|
42
|
+
// verify job probes the INSTALLED bin with --version, so the answer must
|
|
43
|
+
// come from the packaged tree, never a hardcoded literal that can drift.
|
|
44
|
+
if (args[0] === '--version') {
|
|
45
|
+
console.log(JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version)
|
|
46
|
+
process.exit(0)
|
|
47
|
+
}
|
|
48
|
+
const verb = args[0] === 'audit-conformance' ? 'audit-conformance'
|
|
49
|
+
: args[0] === 'new' ? 'new'
|
|
50
|
+
: 'lint'
|
|
51
|
+
if (args[0] === 'lint' || verb === 'audit-conformance' || verb === 'new') args = args.slice(1)
|
|
41
52
|
|
|
42
53
|
const exitUsage = (msg, usage) => {
|
|
43
54
|
if (msg) console.error(msg)
|
|
@@ -45,30 +56,85 @@ const exitUsage = (msg, usage) => {
|
|
|
45
56
|
process.exit(2)
|
|
46
57
|
}
|
|
47
58
|
|
|
59
|
+
// Usage strings, one per verb (the usage ladder's exit 2 surface).
|
|
60
|
+
const USAGE_LINT = 'packstruct lint <packs-dir> [--json] [--deep] [--local] [--against <library-path>]'
|
|
61
|
+
const USAGE_AUDIT = 'packstruct audit-conformance [<repo-dir>] --loader "<cmd> {packs}" [--json] [--claims]'
|
|
62
|
+
const USAGE_NEW = 'packstruct new <pack-name> [--dir <packs-root>] [--json]'
|
|
63
|
+
|
|
64
|
+
// Unknown-flag rejection (packstruct#18): a typo'd mode flag used to be
|
|
65
|
+
// silently ignored, so `--jso` ran text mode and `--dep` ran shallow - the
|
|
66
|
+
// wrong mode with no signal, the exact misfire class the tool exists to
|
|
67
|
+
// kill. Every leading-dash token must now be a recognized flag or the run
|
|
68
|
+
// refuses with the usage ladder's exit 2.
|
|
69
|
+
const rejectUnknownFlag = (a, have, usage) => exitUsage(`unknown flag "${a}" (have: ${have})`, usage)
|
|
70
|
+
|
|
71
|
+
// new (packstruct#24): generate a conforming pack skeleton at author time.
|
|
72
|
+
// The cheapest break class - a new author guessing the field list - dies
|
|
73
|
+
// even earlier if the starting point is generated correct. Refusals are
|
|
74
|
+
// the net; `new` is the trampoline. Its output is just another manifest
|
|
75
|
+
// the lint grades, so the lint stays the one truth.
|
|
76
|
+
if (verb === 'new') {
|
|
77
|
+
let dir
|
|
78
|
+
const dirIdx = args.indexOf('--dir')
|
|
79
|
+
if (dirIdx !== -1) {
|
|
80
|
+
dir = args[dirIdx + 1]
|
|
81
|
+
if (dir === undefined || dir.startsWith('-')) exitUsage('--dir needs a value (the packs root to write into)', USAGE_NEW)
|
|
82
|
+
}
|
|
83
|
+
const positional = []
|
|
84
|
+
for (let i = 0; i < args.length; i++) {
|
|
85
|
+
const a = args[i]
|
|
86
|
+
if (a === '--dir') { i++; continue }
|
|
87
|
+
if (a === '--json') continue
|
|
88
|
+
if (a.startsWith('-')) rejectUnknownFlag(a, '--dir <packs-root>, --json', USAGE_NEW)
|
|
89
|
+
positional.push(a)
|
|
90
|
+
}
|
|
91
|
+
const name = positional[0]
|
|
92
|
+
if (!name) exitUsage(undefined, USAGE_NEW)
|
|
93
|
+
if (positional.length > 1) exitUsage(`new takes one pack name (got ${positional.length})`, USAGE_NEW)
|
|
94
|
+
const r = newPack(name, { dir })
|
|
95
|
+
const json = args.includes('--json')
|
|
96
|
+
if (json) {
|
|
97
|
+
console.log(JSON.stringify({ schema: 1, mode: 'new', name, dir: r.dir, packDir: r.packDir, files: r.files, violations: r.violations }, null, 2))
|
|
98
|
+
} else {
|
|
99
|
+
if (r.violations.length) {
|
|
100
|
+
for (const v of r.violations) console.error(` REFUSED [${v.norm}]: ${v.message}`)
|
|
101
|
+
} else {
|
|
102
|
+
console.log(`packstruct new: created ${r.packDir}`)
|
|
103
|
+
for (const f of r.files) console.log(` created ${f}`)
|
|
104
|
+
console.log(` next: packstruct lint ${r.dir}`)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
process.exit(r.violations.length ? 1 : 0)
|
|
108
|
+
}
|
|
109
|
+
|
|
48
110
|
if (verb === 'audit-conformance') {
|
|
49
111
|
const loaderIdx = args.indexOf('--loader')
|
|
50
112
|
let loader
|
|
51
113
|
if (loaderIdx !== -1) {
|
|
52
114
|
loader = args[loaderIdx + 1]
|
|
53
115
|
if (loader === undefined || loader.startsWith('-')) {
|
|
54
|
-
exitUsage('--loader needs a value: --loader "<cmd> {packs}"',
|
|
116
|
+
exitUsage('--loader needs a value: --loader "<cmd> {packs}"', USAGE_AUDIT)
|
|
55
117
|
}
|
|
56
118
|
}
|
|
57
119
|
const positional = []
|
|
58
120
|
for (let i = 0; i < args.length; i++) {
|
|
59
|
-
|
|
60
|
-
if (
|
|
121
|
+
const a = args[i]
|
|
122
|
+
if (a === '--loader') { i++; continue }
|
|
123
|
+
if (a === '--json' || a === '--claims') continue
|
|
124
|
+
if (a.startsWith('-')) rejectUnknownFlag(a, '--loader <cmd>, --json, --claims', USAGE_AUDIT)
|
|
125
|
+
positional.push(a)
|
|
61
126
|
}
|
|
62
127
|
if (loader === undefined) {
|
|
63
|
-
exitUsage(undefined,
|
|
128
|
+
exitUsage(undefined, USAGE_AUDIT)
|
|
64
129
|
}
|
|
65
130
|
const repo = positional[0] ?? '.'
|
|
66
131
|
const json = args.includes('--json')
|
|
67
|
-
const
|
|
132
|
+
const claims = args.includes('--claims')
|
|
133
|
+
const r = await auditConformance({ loader, repo, json, claims })
|
|
68
134
|
if (json) {
|
|
69
|
-
console.log(JSON.stringify({ schema: 1, mode: 'audit', repo, cases: r.caseCount, honored: r.honored, violations: r.violations }, null, 2))
|
|
135
|
+
console.log(JSON.stringify({ schema: 1, mode: 'audit', repo, claims, cases: r.caseCount, honored: r.honored, violations: r.violations }, null, 2))
|
|
70
136
|
} else {
|
|
71
|
-
console.log(`packstruct audit-conformance: ${r.honored}/${r.caseCount} case(s) honored by the loader over ${repo}`)
|
|
137
|
+
console.log(`packstruct audit-conformance${claims ? ' --claims' : ''}: ${r.honored}/${r.caseCount} case(s) honored by the loader over ${repo}`)
|
|
72
138
|
for (const v of r.violations) console.log(` AUDIT ${v.pack} [${v.norm}]: ${v.message}`)
|
|
73
139
|
}
|
|
74
140
|
process.exit(r.violations.length ? 1 : 0)
|
|
@@ -80,34 +146,40 @@ let against
|
|
|
80
146
|
if (againstIdx !== -1) {
|
|
81
147
|
against = args[againstIdx + 1]
|
|
82
148
|
if (against === undefined || against.startsWith('-')) {
|
|
83
|
-
exitUsage(undefined,
|
|
149
|
+
exitUsage(undefined, USAGE_LINT)
|
|
84
150
|
}
|
|
85
151
|
}
|
|
86
152
|
const dirArgs = []
|
|
87
153
|
for (let i = 0; i < args.length; i++) {
|
|
88
|
-
|
|
89
|
-
|
|
154
|
+
const a = args[i]
|
|
155
|
+
if (a === '--against') { i++; continue }
|
|
156
|
+
if (a === '--deep' || a === '--json' || a === '--local') continue
|
|
157
|
+
if (a.startsWith('-')) rejectUnknownFlag(a, '--deep, --json, --local, --against <path>', USAGE_LINT)
|
|
158
|
+
dirArgs.push(a)
|
|
90
159
|
}
|
|
91
160
|
|
|
92
|
-
const dir = dirArgs
|
|
93
|
-
if (!dir) exitUsage(undefined,
|
|
94
|
-
const deep =
|
|
161
|
+
const dir = dirArgs[0]
|
|
162
|
+
if (!dir) exitUsage(undefined, USAGE_LINT)
|
|
163
|
+
const deep = args.includes('--deep')
|
|
164
|
+
const local = args.includes('--local')
|
|
95
165
|
if (against !== undefined && !deep) {
|
|
96
|
-
exitUsage('--against requires --deep (the host-library census runs on the deep pass)',
|
|
166
|
+
exitUsage('--against requires --deep (the host-library census runs on the deep pass)', USAGE_LINT)
|
|
97
167
|
}
|
|
98
168
|
|
|
99
169
|
const r = deep
|
|
100
|
-
? await deepLintPacks(dir, { against })
|
|
101
|
-
: lintPacks(dir)
|
|
102
|
-
if (
|
|
170
|
+
? await deepLintPacks(dir, { against, local })
|
|
171
|
+
: lintPacks(dir, { local })
|
|
172
|
+
if (args.includes('--json')) {
|
|
103
173
|
console.log(JSON.stringify({
|
|
104
174
|
schema: 1,
|
|
105
175
|
mode: deep ? 'deep' : 'manifest',
|
|
106
176
|
packsChecked: r.packsChecked,
|
|
177
|
+
localChecked: r.localChecked ?? 0,
|
|
107
178
|
modulesProbed: r.modulesProbed,
|
|
108
179
|
idsCensused: r.idsCensused,
|
|
109
180
|
libraryIds: r.libraryIds ?? 0,
|
|
110
181
|
violations: r.violations,
|
|
182
|
+
warnings: r.warnings ?? [],
|
|
111
183
|
}, null, 2))
|
|
112
184
|
process.exit(r.violations.length ? 1 : 0)
|
|
113
185
|
}
|
|
@@ -116,6 +188,9 @@ const probe = deep
|
|
|
116
188
|
? ` - ${r.modulesProbed} module(s) probed, ${r.idsCensused} id(s) censused` +
|
|
117
189
|
(against !== undefined ? `, ${r.libraryIds ?? 0} library id(s) seeded` : '')
|
|
118
190
|
: ''
|
|
119
|
-
|
|
120
|
-
|
|
191
|
+
const localNote = local ? `, ${r.localChecked ?? 0} local pack(s)` : ''
|
|
192
|
+
console.log(`packstruct ${mode}: ${r.packsChecked} pack(s) checked in ${dir}${localNote}${probe}`)
|
|
193
|
+
for (const v of r.violations) console.log(` VIOLATION ${v.pack}${v.lane === 'local' ? ' [local]' : ''} [${v.norm}]: ${v.message}`)
|
|
194
|
+
// Warnings are advisory: they never change the exit code (SPEC v1.1 section 2).
|
|
195
|
+
for (const w of r.warnings ?? []) console.log(` WARNING ${w.pack}${w.lane === 'local' ? ' [local]' : ''} [${w.norm}]: ${w.message}`)
|
|
121
196
|
process.exit(r.violations.length ? 1 : 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,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "env-claims-pack",
|
|
4
|
+
"description": "SPEC v1.1 conformance pack - declares the host-owned env block (d1/kv/routes/seed). The accept case for packstruct#71: the block 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
|
+
"env": {
|
|
8
|
+
"d1": { "DB": { "tables": ["charges"] } },
|
|
9
|
+
"kv": { "UPLOADS": {} },
|
|
10
|
+
"routes": ["charge"],
|
|
11
|
+
"seed": {
|
|
12
|
+
"kv": { "UPLOADS": { "canary": "seed-value" } },
|
|
13
|
+
"d1": { "DB": { "charges": { "rows": [{ "id": 1 }] } } }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -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.
|
|
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",
|
|
@@ -21,9 +21,22 @@
|
|
|
21
21
|
"LICENSE"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"test": "node test/run.mjs"
|
|
24
|
+
"test": "node test/run.mjs && node --test test/status.test.mjs test/refusal-matrix.test.mjs test/run-capped.test.mjs tests/ship-from-download.test.cjs tests/release-verify.test.cjs tests/check-action-pins.test.cjs && node --test tests/check-prestruct-pins.test.cjs",
|
|
25
|
+
"test:ship": "node --test tests/ship-from-download.test.cjs",
|
|
26
|
+
"lint:docs": "node scripts/check-docs-frontmatter.cjs && node scripts/check-docs-links.cjs && node scripts/check-docs-style.cjs && node scripts/check-jekyll-filters.cjs && node scripts/check-language.cjs",
|
|
27
|
+
"lint:pins": "node scripts/check-action-pins.cjs",
|
|
28
|
+
"lint:packs": "node bin/cli.mjs lint packs --deep",
|
|
29
|
+
"conform:packs": "node bin/cli.mjs audit-conformance . --loader \"node bin/cli.mjs lint {packs}\"",
|
|
30
|
+
"conform:claims": "node bin/cli.mjs audit-conformance . --loader \"node test/fixtures/audit/loader-claims.mjs {packs}\" --claims",
|
|
31
|
+
"check": "npm run lint:docs && npm run lint:pins && npm run lint:prestruct-pins && node scripts/check-legal.cjs && npm run matrix:check && npm run lint:packs && npm run conform:packs && npm run conform:claims",
|
|
32
|
+
"prepublishOnly": "npm test && npm run check",
|
|
33
|
+
"matrix:check": "node scripts/gen-refusal-matrix.mjs --check",
|
|
34
|
+
"matrix:gen": "node scripts/gen-refusal-matrix.mjs",
|
|
35
|
+
"lint:prestruct-pins": "node scripts/check-prestruct-pins.cjs"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
25
39
|
},
|
|
26
|
-
"engines": { "node": ">=20" },
|
|
27
40
|
"keywords": [
|
|
28
41
|
"packs",
|
|
29
42
|
"spec",
|
|
@@ -33,7 +46,12 @@
|
|
|
33
46
|
"ci",
|
|
34
47
|
"manifest"
|
|
35
48
|
],
|
|
36
|
-
"repository": {
|
|
37
|
-
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/dhaupin/packstruct.git"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/dhaupin/packstruct/issues"
|
|
55
|
+
},
|
|
38
56
|
"homepage": "https://github.com/dhaupin/packstruct#readme"
|
|
39
57
|
}
|
package/profiles/check.md
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
# The check profile
|
|
2
2
|
|
|
3
|
-
Declared per SPEC v1 section 3 (normative) and filed here once, per the
|
|
4
|
-
one-address ruling on [crashtest#19](https://github.com/dhaupin/crashtest).
|
|
3
|
+
Declared per SPEC v1 section 3 (normative) and filed here once, per the one-address ruling on [crashtest#19](https://github.com/dhaupin/crashtest).
|
|
5
4
|
|
|
6
|
-
This is the profile [poststruct](https://github.com/dhaupin/poststruct) will
|
|
7
|
-
load. Note the honest status line: poststruct is not shipping yet, so this
|
|
8
|
-
page declares the shape the spec froze - the engine-first rule (code first,
|
|
9
|
-
spec formalizes after) means any poststruct loader change that contradicts
|
|
10
|
-
this page updates the SPEC first, then here.
|
|
5
|
+
This is the profile [poststruct](https://github.com/dhaupin/poststruct) will load. Note the honest status line: poststruct is not shipping yet, so this page declares the shape the spec froze - the engine-first rule (code first, spec formalizes after) means any poststruct loader change that contradicts this page updates the SPEC first, then here.
|
|
11
6
|
|
|
12
7
|
## The module shape
|
|
13
8
|
|
|
14
|
-
An entry module under this profile is an ES module with a default export
|
|
15
|
-
carrying a `checks` array:
|
|
9
|
+
An entry module under this profile is an ES module with a default export carrying a `checks` array:
|
|
16
10
|
|
|
17
11
|
```js
|
|
18
12
|
export default {
|
|
@@ -26,25 +20,11 @@ export default {
|
|
|
26
20
|
|
|
27
21
|
## What the spec guarantees
|
|
28
22
|
|
|
29
|
-
- **No transport, no network by default.** A check pack reads the files the
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- **Config-is-the-arm.** There is no arming key ceremony in this profile:
|
|
33
|
-
being enumerated in the host's `packs:` config IS the arm (SPEC section 3).
|
|
34
|
-
A `pack.json` may still carry `armedByKey` - the shared manifest surface
|
|
35
|
-
never forks between profiles - and the poststruct loader will simply not
|
|
36
|
-
give it a ceremony: its presence is optional surface, its semantics here
|
|
37
|
-
are the host's default lifecycle (config enumeration).
|
|
38
|
-
- **Namespaced ids.** Check ids live in the pack-slug namespace inside the
|
|
39
|
-
host's id space; cross-namespace collision at load = refuse to start
|
|
40
|
-
(SPEC section 4).
|
|
23
|
+
- **No transport, no network by default.** A check pack reads the files the host points it at. That whole boundary is the profile's point: check packs prove claims about files; scenario packs attack systems.
|
|
24
|
+
- **Config-is-the-arm.** There is no arming key ceremony in this profile: being enumerated in the host's `packs:` config IS the arm (SPEC section 3). A `pack.json` may still carry `armedByKey` - the shared manifest surface never forks between profiles - and the poststruct loader will simply not give it a ceremony: its presence is optional surface, its semantics here are the host's default lifecycle (config enumeration).
|
|
25
|
+
- **Namespaced ids.** Check ids live in the pack-slug namespace inside the host's id space; cross-namespace collision at load = refuse to start (SPEC section 4).
|
|
41
26
|
- **Refusals** are instant, one-line, and name the pack (SPEC section 5).
|
|
42
27
|
|
|
43
28
|
## Boundary charter
|
|
44
29
|
|
|
45
|
-
The load-time boundary between the struct apps is on record:
|
|
46
|
-
[poststruct#2](https://github.com/dhaupin/poststruct/issues/2) - the
|
|
47
|
-
manifest shape validates ONCE (this spec, section 2), packstruct owns the
|
|
48
|
-
pack shape, poststruct owns the text shape. A conformance story for a check
|
|
49
|
-
pack is: packstruct lint says the manifest is v1; the poststruct loader
|
|
50
|
-
says the checks are check-shaped; neither pretends to speak for the other.
|
|
30
|
+
The load-time boundary between the struct apps is on record: [poststruct#2](https://github.com/dhaupin/poststruct/issues/2) - the manifest shape validates ONCE (this spec, section 2), packstruct owns the pack shape, poststruct owns the text shape. A conformance story for a check pack is: packstruct lint says the manifest is v1; the poststruct loader says the checks are check-shaped; neither pretends to speak for the other.
|
|
@@ -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.
|
package/profiles/scenario.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# The scenario profile
|
|
2
2
|
|
|
3
|
-
Declared per SPEC v1 section 3 (normative) and filed here once, per the
|
|
4
|
-
one-address ruling on [crashtest#19](https://github.com/dhaupin/crashtest).
|
|
3
|
+
Declared per SPEC v1 section 3 (normative) and filed here once, per the one-address ruling on [crashtest#19](https://github.com/dhaupin/crashtest).
|
|
5
4
|
|
|
6
5
|
This is the profile [crashtest](https://github.com/dhaupin/crashtest) loads.
|
|
7
6
|
|
|
8
7
|
## The module shape
|
|
9
8
|
|
|
10
|
-
An entry module under this profile is an ES module with a default export
|
|
11
|
-
carrying three things:
|
|
9
|
+
An entry module under this profile is an ES module with a default export carrying three things:
|
|
12
10
|
|
|
13
11
|
```js
|
|
14
12
|
export default {
|
|
@@ -27,33 +25,20 @@ export default {
|
|
|
27
25
|
}
|
|
28
26
|
```
|
|
29
27
|
|
|
30
|
-
- Attack and step names join the host's id space under the pack-slug
|
|
31
|
-
|
|
32
|
-
silent dedupe.
|
|
33
|
-
- Exporting both a `run` and a `steps` chain on one attack: the host owns
|
|
34
|
-
that ruling (SPEC section 3: host-cherry-picks territory).
|
|
28
|
+
- Attack and step names join the host's id space under the pack-slug namespace (SPEC section 4). Collision at load = refuse to start, never silent dedupe.
|
|
29
|
+
- Exporting both a `run` and a `steps` chain on one attack: the host owns that ruling (SPEC section 3: host-cherry-picks territory).
|
|
35
30
|
|
|
36
31
|
## The authoritative contract is the host's
|
|
37
32
|
|
|
38
|
-
The full module-shape contract - what `ctx` carries, verdict semantics,
|
|
39
|
-
exit rules, ledger output - is **host-owned**. This page links to it rather
|
|
40
|
-
than copying it: doc drift is worse than indirection, ruled on crashtest#19
|
|
41
|
-
(the `register(ctx)` default-export shape in earlier drafts here was stale
|
|
42
|
-
and was deleted against the engine truth at `fc93ca6`).
|
|
33
|
+
The full module-shape contract - what `ctx` carries, verdict semantics, exit rules, ledger output - is **host-owned**. This page links to it rather than copying it: doc drift is worse than indirection, ruled on crashtest#19 (the `register(ctx)` default-export shape in earlier drafts here was stale and was deleted against the engine truth at `fc93ca6`).
|
|
43
34
|
|
|
44
|
-
**Authoritative reference:** [crashtest's scenario contract](https://github.com/dhaupin/crashtest/blob/main/docs/reference/scenario-contract.md)
|
|
45
|
-
(mirrored at [docs.creadev.org/crashtest/reference/scenario-contract](https://docs.creadev.org/crashtest/reference/scenario-contract)).
|
|
35
|
+
**Authoritative reference:** [crashtest's scenario contract](https://github.com/dhaupin/crashtest/blob/main/docs/reference/scenario-contract.md) (mirrored at [docs.creadev.org/crashtest/reference/scenario-contract](https://docs.creadev.org/crashtest/reference/scenario-contract)).
|
|
46
36
|
|
|
47
37
|
## What the spec guarantees anyway
|
|
48
38
|
|
|
49
39
|
Under any conforming host:
|
|
50
40
|
|
|
51
|
-
- the manifest that declares the entry - `pack.json` per SPEC section 2 -
|
|
52
|
-
|
|
53
|
-
- `armedByKey` presence is the arming ceremony's manifest surface: the host
|
|
54
|
-
MAY require an arming key before activation. Absent = the host's default
|
|
55
|
-
lifecycle governs;
|
|
41
|
+
- the manifest that declares the entry - `pack.json` per SPEC section 2 - is validated against the frozen v1 table before the entry ever imports;
|
|
42
|
+
- `armedByKey` presence is the arming ceremony's manifest surface: the host MAY require an arming key before activation. Absent = the host's default lifecycle governs;
|
|
56
43
|
- refusals are instant, one-line, and name the pack (SPEC section 5);
|
|
57
|
-
- load isolation is the host's job: hostile scenarios run against the
|
|
58
|
-
host's fake transport and opt-out postures, never a live target unless
|
|
59
|
-
the host's runbook arms it.
|
|
44
|
+
- load isolation is the host's job: hostile scenarios run against the host's fake transport and opt-out postures, never a live target unless the host's runbook arms it.
|
package/profiles/sync.md
ADDED
|
@@ -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`).
|