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 {