From 316716e00145d229b41c87a578f5e432aa609de5 Mon Sep 17 00:00:00 2001 From: slaguru666 <111923774+slaguru666@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:58:29 +0100 Subject: [PATCH] Bump GENERATOR_VERSION to 0.2.0; let the tests run from anywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- DESIGN.md | 8 +++++++- core/delve.mjs | 8 +++++++- core/test.mjs | 5 ++++- foundry-module/module/core/delve.mjs | 8 +++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index e93e432..009b306 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -34,7 +34,13 @@ one that matters. | Module | 0.6.0 | | Requires | VANITY **0.10.4+** — the release the seams landed in | | 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. --- diff --git a/core/delve.mjs b/core/delve.mjs index 8656964..2830bb2 100644 --- a/core/delve.mjs +++ b/core/delve.mjs @@ -9,7 +9,13 @@ import { buildArea, fallbackRoute } from './beat.mjs'; import { Pressure } from './pressure.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 = {}) { const { diff --git a/core/test.mjs b/core/test.mjs index 94f05c6..e2163af 100644 --- a/core/test.mjs +++ b/core/test.mjs @@ -1,9 +1,12 @@ import { readFileSync } from 'fs'; +import { fileURLToPath } from 'url'; +import { dirname, join } from 'path'; import { Rng } from './rng.mjs'; import { generateDelve } from './delve.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; const t = (name, cond, detail = '') => { cond ? pass++ : fail++; console.log(`${cond ? ' ok ' : 'FAIL'} ${name}${detail ? ' — ' + detail : ''}`); }; diff --git a/foundry-module/module/core/delve.mjs b/foundry-module/module/core/delve.mjs index 8656964..2830bb2 100644 --- a/foundry-module/module/core/delve.mjs +++ b/foundry-module/module/core/delve.mjs @@ -9,7 +9,13 @@ import { buildArea, fallbackRoute } from './beat.mjs'; import { Pressure } from './pressure.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 = {}) { const {