zone-census: default to this repo, not one author's worktree

check:no-abs-paths started failing the moment check-zone-census.mjs arrived
from main: line 24 fell back to
resolve('/home/lk10x/.../wt-packet') -- an absolute path into one author's
worktree. That gate's whole rule is "a clone must work on any machine", and
it sits inside build:unlocked, so main went red for every builder rather
than only for whoever lacked that directory.

The override was never the problem: DOXA_REPO still wins and is untouched.
Only the FALLBACK moved, to the idiom check-no-absolute-paths.mjs names in
its own failure text and every sibling script here already uses --
resolve(dirname(fileURLToPath(import.meta.url)), '..'). The data it reads,
plugin-designs/my-upg-100-list/data, is present in this repo, so the default
now resolves for anyone who clones it, and a caller pointing at a different
worktree still exports DOXA_REPO exactly as before.

VERIFIED both directions: check:no-abs-paths 0, and check:zone-census itself
0 running on the derived default rather than skipping.
This commit is contained in:
doxa-maps-88655c70 2026-09-24 04:18:24 +00:00
parent 5d5f162b1c
commit b45d35267e

View file

@ -17,11 +17,19 @@
//
// Usage: node internal/check-zone-census.mjs [postersDir]
import { readFileSync, existsSync, readdirSync } from 'node:fs'
import { resolve, join } from 'node:path'
import { pathToFileURL } from 'node:url'
import { resolve, join, dirname } from 'node:path'
import { pathToFileURL, fileURLToPath } from 'node:url'
// DOXA_REPO still wins, unchanged. Only the FALLBACK moved: it was an absolute path to one
// author's worktree (/home/…/wt-packet), which check:no-abs-paths rejects outright — "a clone must
// work on any machine" — and that gate is inside build:unlocked, so the whole build went red for
// every builder, not just for whoever lacked that directory.
// The replacement is the idiom check-no-absolute-paths.mjs names in its own failure text, and the
// one every sibling script here uses: resolve from this file. The data it reads
// (plugin-designs/my-upg-100-list/data) is present in this repo, so the default now resolves for
// anyone who clones it, and a caller pointing at a different worktree still exports DOXA_REPO.
const REPO = process.env.DOXA_REPO
|| resolve('/home/lk10x/Workspace/eco-dx/root-doxa-maps/wt-packet')
|| resolve(dirname(fileURLToPath(import.meta.url)), '..')
const DATA = join(REPO, 'plugin-designs', 'my-upg-100-list', 'data')
const POSTERS = resolve(process.argv[2]
|| join(REPO, 'library', 'scripts', 'posters', 'out', 'posters'))