Bump GENERATOR_VERSION to 0.2.0; let the tests run from anywhere

GENERATOR_VERSION had sat at 0.1.0 while the emitted object gained the
authored layer and the content model moved under it, so a delve file
claimed a generator that no longer existed — both samples say 0.1.0 and
only one of them has an authored layer. Nothing gates on the stamp, so
this is informational only and old files still load. The comment on it
now says what it tracks and when to bump it, which is what stopped it
being bumped before.

test.mjs read ./content/barrow.json relative to the working directory, so
it only ran from inside core/ and crashed from the repo root. It now
resolves from the module file, matching build-index.mjs and
validate-pack.mjs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
slaguru666
2026-08-05 22:58:29 +01:00
co-authored by Claude Opus 5
parent 246a5f607d
commit 316716e001
4 changed files with 25 additions and 4 deletions
+7 -1
View File
@@ -34,7 +34,13 @@ one that matters.
| Module | 0.6.0 | | Module | 0.6.0 |
| Requires | VANITY **0.10.4+** — the release the seams landed in | | Requires | VANITY **0.10.4+** — the release the seams landed in |
| Foundry | v13 minimum, verified 14.365 | | Foundry | v13 minimum, verified 14.365 |
| Generator stamp | `GENERATOR_VERSION` 0.1.0 — written into every delve file, **not** the module version | | Generator stamp | `GENERATOR_VERSION` **0.2.0** — written into every delve file, **not** the module version |
`GENERATOR_VERSION` had sat at 0.1.0 while the emitted object gained the `authored` layer and the
content model moved under it, so files claimed a generator that no longer existed — the two
samples in [`samples/`](samples/) are both stamped 0.1.0 and only one of them has an `authored`
layer. It tracks the *shape of the delve file and what a seed yields*, and the comment on it now
says when to bump it. Old files still load.
--- ---
+7 -1
View File
@@ -9,7 +9,13 @@ import { buildArea, fallbackRoute } from './beat.mjs';
import { Pressure } from './pressure.mjs'; import { Pressure } from './pressure.mjs';
import { baneBeatFor } from './director.mjs'; import { baneBeatFor } from './director.mjs';
export const GENERATOR_VERSION = '0.1.0'; /**
* Stamped into every delve file and shown on both surfaces, so a file says which generator made
* it. Bump it when the shape of the emitted object changes or when content selection changes
* enough that the same seed no longer yields the same delve — not when the module version moves.
* 0.2.0: the `authored` layer, motif-scoped decisions/temptations/features, areas as situations.
*/
export const GENERATOR_VERSION = '0.2.0';
export function generateDelve(params = {}) { export function generateDelve(params = {}) {
const { const {
+4 -1
View File
@@ -1,9 +1,12 @@
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { Rng } from './rng.mjs'; import { Rng } from './rng.mjs';
import { generateDelve } from './delve.mjs'; import { generateDelve } from './delve.mjs';
import { renderMarkdown } from './render.mjs'; import { renderMarkdown } from './render.mjs';
const pack = JSON.parse(readFileSync('./content/barrow.json', 'utf8')); const dir = join(dirname(fileURLToPath(import.meta.url)), 'content');
const pack = JSON.parse(readFileSync(join(dir, 'barrow.json'), 'utf8'));
let pass = 0, fail = 0; let pass = 0, fail = 0;
const t = (name, cond, detail = '') => { cond ? pass++ : fail++; console.log(`${cond ? ' ok ' : 'FAIL'} ${name}${detail ? ' — ' + detail : ''}`); }; const t = (name, cond, detail = '') => { cond ? pass++ : fail++; console.log(`${cond ? ' ok ' : 'FAIL'} ${name}${detail ? ' — ' + detail : ''}`); };
+7 -1
View File
@@ -9,7 +9,13 @@ import { buildArea, fallbackRoute } from './beat.mjs';
import { Pressure } from './pressure.mjs'; import { Pressure } from './pressure.mjs';
import { baneBeatFor } from './director.mjs'; import { baneBeatFor } from './director.mjs';
export const GENERATOR_VERSION = '0.1.0'; /**
* Stamped into every delve file and shown on both surfaces, so a file says which generator made
* it. Bump it when the shape of the emitted object changes or when content selection changes
* enough that the same seed no longer yields the same delve — not when the module version moves.
* 0.2.0: the `authored` layer, motif-scoped decisions/temptations/features, areas as situations.
*/
export const GENERATOR_VERSION = '0.2.0';
export function generateDelve(params = {}) { export function generateDelve(params = {}) {
const { const {