@wildshard/engine 0.1.19 → 0.1.21
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/CHANGELOG.md +16 -0
- package/lint/engine-sides.json +5 -0
- package/package.json +5 -2
- package/scripts/app-build/gen.ts +11 -0
- package/scripts/cell-mem-bench.mjs +2 -0
- package/scripts/chaos-proxy-core.mjs +14 -1
- package/scripts/chaos-proxy-proof.mjs +22 -0
- package/scripts/check-devserver.mjs +1 -1
- package/scripts/failmode-cases.d.mts +8 -0
- package/scripts/failmode-cases.mjs +97 -0
- package/scripts/failmode-proof.mjs +532 -0
- package/scripts/grid-crossing-nightly.mjs +5 -4
- package/scripts/grid-crossing-report.mjs +5 -2
- package/scripts/grid-crossing-tour.mjs +36 -12
- package/scripts/grid-crossing-walk-proof.mjs +4 -2
- package/scripts/hover-speed-probe.mjs +136 -0
- package/scripts/land.mjs +2 -1
- package/scripts/loading-flow/benchmax.mjs +34 -11
- package/scripts/loading-flow/deskbench.mjs +276 -0
- package/scripts/loading-flow/stalls.d.mts +17 -3
- package/scripts/loading-flow/stalls.mjs +82 -3
- package/scripts/net-lag-proof.mjs +3 -2
- package/scripts/nightly-model.ts +9 -6
- package/scripts/offline-proof.mjs +7 -1
- package/scripts/online-rig.mjs +9 -7
- package/scripts/parity/boot-smoke.mjs +13 -2
- package/scripts/pin-format.ts +5 -2
- package/scripts/pins-reuse.d.mts +1 -0
- package/scripts/pins-reuse.mjs +22 -0
- package/scripts/release-cook.mjs +109 -0
- package/scripts/scratch-dir.mjs +95 -0
- package/scripts/scratch-sweep.mjs +182 -0
- package/scripts/tsconfig.json +2 -12
- package/scripts/vps/harden-prometheus.sh +3 -0
- package/scripts/vps/rebuild.sh +35 -9
- package/scripts/vps/wildshard-apply.mjs +5 -1
- package/scripts/vps/wildshard-config +117 -1
- package/scripts/worktree-reap.mjs +54 -8
- package/scripts/worktree.mjs +19 -5
- package/src/client/engine/anim/rigParser.ts +2 -2
- package/src/client/engine/boot/contentRead.ts +54 -5
- package/src/client/engine/boot/gpuFiles.ts +3 -3
- package/src/client/engine/boot/leaveAfterPaint.ts +4 -1
- package/src/client/engine/core/Game.ts +63 -19
- package/src/client/engine/core/gpuOnly.ts +10 -0
- package/src/client/engine/core/renderBudget.ts +134 -0
- package/src/client/engine/core/shadowLayer.ts +18 -0
- package/src/client/engine/explore/pick.ts +13 -1
- package/src/client/engine/net/predictor.ts +12 -4
- package/src/client/engine/net/redial.ts +40 -5
- package/src/client/engine/player/TouchControls.ts +3 -2
- package/src/client/engine/render/dataLook.ts +70 -7
- package/src/client/engine/render/families/pbr.ts +2 -0
- package/src/client/engine/render/families/registry.ts +11 -2
- package/src/client/engine/render/families/sceneSurface.ts +118 -0
- package/src/client/engine/render/look.ts +7 -1
- package/src/client/engine/render/precompile.ts +4 -2
- package/src/client/engine/render/tiers.ts +4 -1
- package/src/client/engine/telemetry/browserErrors.ts +3 -1
- package/src/client/engine/ui/ErrorModal.ts +1 -1
- package/src/client/engine/ui/Loading.ts +14 -2
- package/src/client/engine/ui/errorScreen.ts +51 -9
- package/src/client/engine/ui/hoverBoost.ts +31 -4
- package/src/client/engine/ui/styles/touch.css +6 -0
- package/src/client/engine/world/declaredProps.ts +5 -1
- package/src/client/engine/world/skyRig.ts +4 -1
- package/src/client/engine/world/terrainTileView.ts +64 -23
- package/src/client/game/boot/spawnDownload.ts +44 -6
- package/src/client/game/devScene/hook.ts +149 -12
- package/src/client/game/devScene/liveLook.ts +21 -0
- package/src/client/game/grid/live.ts +47 -10
- package/src/client/game/grid/liveSession.ts +25 -6
- package/src/client/game/grid/pageEntry.ts +12 -1
- package/src/client/game/grid/productInputs.ts +22 -11
- package/src/client/game/grid/session.ts +15 -4
- package/src/client/game/grid/shardfileFar.ts +13 -2
- package/src/client/game/session/finish.ts +4 -1
- package/src/client/game/shardfile/client.ts +24 -7
- package/src/client/game/shardfile/clientPropMaterials.ts +4 -1
- package/src/client/game/shardfile/clientSource.ts +7 -3
- package/src/client/game/shardfile/clientViews.ts +36 -8
- package/src/client/game/shardfile/clientWorker.ts +4 -4
- package/src/client/game/shardfile/constructionCheckpoint.ts +2 -2
- package/src/client/game/shardfile/groundMerge.ts +59 -5
- package/src/client/game/shardfile/hybrid.ts +2 -0
- package/src/client/game/shardfile/look.ts +1 -1
- package/src/client/game/shardfile/slabLibrary.ts +115 -49
- package/src/client/game/shardfile/tileContent.ts +1 -1
- package/src/client/game/shardfile/tileDriver.ts +38 -11
- package/src/client/game/shardfile/wirePage.ts +7 -3
- package/src/client/game/shardfile/worldScenes.ts +17 -10
- package/src/client/host/online/doctor.ts +20 -7
- package/src/client/host/online/doctorView.ts +2 -0
- package/src/client/host/online/linkScreens.ts +95 -11
- package/src/client/host/online/reconnectStrip.ts +3 -2
- package/src/client/host/online/release.ts +87 -16
- package/src/client/host/online/releaseScreens.ts +108 -0
- package/src/client/host/online/shell.ts +24 -5
- package/src/client/host/online/voice.ts +45 -1
- package/src/client/host/online/voiceUi.ts +24 -6
- package/src/client/host/standalone/shell.ts +37 -1
- package/src/server/engine/sim/playerSim.ts +1 -1
- package/src/server/game/grid/simulation.ts +12 -6
- package/src/server/game/quest/eliteDrops.ts +7 -3
- package/src/server/game/riding/nativeTaming.ts +13 -2
- package/src/server/host/dedicated/cellHost.ts +21 -2
- package/src/server/host/dedicated/cellProtocol.ts +2 -0
- package/src/server/host/dedicated/cellWorker.ts +1 -1
- package/src/server/host/dedicated/dedicatedRoom.ts +38 -8
- package/src/server/host/dedicated/roadRoom.ts +3 -0
- package/src/server/host/dedicated/serverMetrics.ts +9 -0
- package/src/server/host/dedicated/workerTable.ts +31 -24
- package/src/server/host/standalone/gridServer.ts +1 -1
- package/src/server/host/standalone/serverHost.ts +56 -10
- package/src/server/host/standalone/serverProduct.ts +9 -7
- package/src/server/host/standalone/serverRuntime.ts +1 -1
- package/src/shared/engine/boot/loadingWaits.ts +10 -2
- package/src/shared/engine/core/config.ts +3 -0
- package/src/shared/engine/core/framePacing.ts +12 -1
- package/src/shared/engine/physics/terrainTiles.ts +20 -4
- package/src/shared/engine/player/hoverSpeed.ts +3 -3
- package/src/shared/engine/strings.ts +12 -1
- package/src/shared/game/devColliders.ts +60 -0
- package/src/shared/game/devGameplay.ts +41 -0
- package/src/shared/game/grid/rules.ts +12 -0
package/scripts/pin-format.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** J233: Template 2 is published in the frozen format dependency. This reads
|
|
2
2
|
* that installed product without a producer checkout, cook or network.
|
|
3
3
|
* BM-2: Brasscap Mesa, Template 2's own product, sits beside Template 1's
|
|
4
|
-
* `blender-template` in shardfile's corpus and is admitted the same way.
|
|
4
|
+
* `blender-template` in shardfile's corpus and is admitted the same way.
|
|
5
|
+
* SHARD-SOURCE SS4: its folder is `corpus/exports/brasscap-mesa`, shard-format's
|
|
6
|
+
* export of a pinned shard-brasscap commit (built by `wildshard build`, pinned
|
|
7
|
+
* by `corpus/exports/brasscap-mesa.pin.json`), not a hand-written source. */
|
|
5
8
|
import {createHash} from 'node:crypto';
|
|
6
9
|
import {readFileSync, readdirSync} from 'node:fs';
|
|
7
10
|
import {dirname, join, resolve} from 'node:path';
|
|
@@ -17,7 +20,7 @@ interface FormatTemplate {
|
|
|
17
20
|
/** Each product the format dependency ships, by slug: its folder under the package root. */
|
|
18
21
|
export const FORMAT_PRODUCTS: Readonly<Record<string, string>> = Object.freeze({
|
|
19
22
|
'blender-template': 'corpus/handwritten',
|
|
20
|
-
'brasscap-mesa': 'corpus/brasscap-mesa',
|
|
23
|
+
'brasscap-mesa': 'corpus/exports/brasscap-mesa',
|
|
21
24
|
});
|
|
22
25
|
export function formatTemplate(slug: string): FormatTemplate {
|
|
23
26
|
const folder = Object.hasOwn(FORMAT_PRODUCTS, slug) ? FORMAT_PRODUCTS[slug] : undefined;
|
package/scripts/pins-reuse.d.mts
CHANGED
|
@@ -17,6 +17,7 @@ export interface Reused {
|
|
|
17
17
|
}
|
|
18
18
|
export function pinsKey(root: string, revision: string): string;
|
|
19
19
|
export function dropManifest(root: string): void;
|
|
20
|
+
export function stalePinProducts(root: string): { folder: string; revision: unknown }[];
|
|
20
21
|
export function verifiedPinsOutputs(root: string): { paths: Set<string>; key: string };
|
|
21
22
|
export function writeManifest(root: string, key: string, products: Manifest['products'], mounts: Manifest['mounts']): void;
|
|
22
23
|
export function lockPins(root: string, options?: { wait?: boolean }): (() => void) | undefined;
|
package/scripts/pins-reuse.mjs
CHANGED
|
@@ -198,6 +198,28 @@ function pinHashes(root){
|
|
|
198
198
|
return (shards??[]).map(row=>String(row.hash));
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
/**
|
|
202
|
+
* The products under `out/` whose receipt names a pin `root`'s pins no longer name (`out/<folder>`, with the revision its
|
|
203
|
+
* receipt says), e.g. a worktree installed before a pin bump and rebased past it. Their mounts under public/ are that old
|
|
204
|
+
* revision's, so the boot stamps gen:inputs writes from public/ would carry the old files (Far Reach rev 1's 21 rows,
|
|
205
|
+
* re-added by lands from such worktrees, 2026-11-14). A tree with no `out/` or no pins file has none.
|
|
206
|
+
* @param {string} root @returns {{folder:string,revision:unknown}[]}
|
|
207
|
+
*/
|
|
208
|
+
export function stalePinProducts(root){
|
|
209
|
+
let want;
|
|
210
|
+
try{want=new Set(pinHashes(root));}catch{return [];}
|
|
211
|
+
let folders;
|
|
212
|
+
try{folders=readdirSync(join(root,'out'),{withFileTypes:true}).filter(entry=>entry.isDirectory()).map(entry=>entry.name);}catch{return [];}
|
|
213
|
+
/** @type {{folder:string,revision:unknown}[]} */const stale=[];
|
|
214
|
+
for(const folder of folders.sort()){
|
|
215
|
+
/** @type {unknown} */let pin;
|
|
216
|
+
try{pin=JSON.parse(readFileSync(join(root,'out',folder,'validation.json'),'utf8')).pin;}catch{continue;}
|
|
217
|
+
if(typeof pin!=='object'||pin===null||!('hash'in pin)||typeof pin.hash!=='string')continue;
|
|
218
|
+
if(!want.has(pin.hash))stale.push({folder,revision:'revision'in pin?pin.revision:undefined});
|
|
219
|
+
}
|
|
220
|
+
return stale;
|
|
221
|
+
}
|
|
222
|
+
|
|
201
223
|
/** Every file under `directory` as a path relative to it with its size, or a refusal: an entry that is neither a
|
|
202
224
|
* directory nor a regular file, an executable file, or a directory the owner can't write and enter.
|
|
203
225
|
* @param {string} directory @returns {Map<string,number>|string} */
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// AUTO-RELEASE AR5 (meta docs/plans/AUTO-RELEASE-PLAN.md, J355): the last step of an engine release, with no Jake command.
|
|
3
|
+
// Moves the box's cook worker to the tag production now serves, through the agents' own account (J266).
|
|
4
|
+
// node scripts/release-cook.mjs vX.Y.Z [--dry-run]
|
|
5
|
+
// 1. Production's signed release must name vX.Y.Z (read from packs.wildshard.io, public; the box checks the signature).
|
|
6
|
+
// 2. If the box's wildshard-config has no `cook` verb yet, it is installed from a signed tag that carries it, by the
|
|
7
|
+
// allowlisted `wildshard-apply <tag> harden` (which refreshes /usr/local/sbin and /opt/wildshard-vps). Only after
|
|
8
|
+
// `wildshard-harden --check` shows no `fail` row, so the apply changes no sshd, ufw or Tailscale setting.
|
|
9
|
+
// 3. `sudo -n wildshard-config cook vX.Y.Z`: the box verifies the tag, writes cook.settings, rebuilds the cook step alone,
|
|
10
|
+
// waits for its /health and rolls back if it does not come up. Then `show cook` and the worker's /health.
|
|
11
|
+
// --dry-run reads the box and says what it would do; it writes nothing. Output never carries an address or a secret.
|
|
12
|
+
import { spawnSync } from 'node:child_process';
|
|
13
|
+
|
|
14
|
+
const HOST = 'wildshard-agent';
|
|
15
|
+
const RELEASES = 'https://packs.wildshard.io/releases';
|
|
16
|
+
const TAG = /^v\d{1,4}\.\d{1,4}\.\d{1,4}$/u;
|
|
17
|
+
const SIGNED_TAG = /^(?:v\d{1,4}\.\d{1,4}\.\d{1,4}|server-(?:staging|production)-[0-9a-f]{40})$/u, COMMIT = /^[0-9a-f]{40}$/u;
|
|
18
|
+
const MARK = 'cook <tag>';
|
|
19
|
+
|
|
20
|
+
/** @param {string} what @param {string} message */
|
|
21
|
+
function say(what, message) { console.info(`${what.padEnd(7)} ${redact(message)}`); }
|
|
22
|
+
/** @param {string} message @returns {never} */
|
|
23
|
+
function stop(message) { console.error(`stop ${redact(message)}`); process.exit(1); }
|
|
24
|
+
/** Never print an address: IPv4 and tailnet hosts are blanked. @param {string} text */
|
|
25
|
+
function redact(text) { return text.replaceAll(/\b(?:\d{1,3}\.){3}\d{1,3}\b/gu, '<address>').replaceAll(/\b[\w-]+\.tail[\w-]+\.ts\.net\b/gu, '<tailnet>'); }
|
|
26
|
+
|
|
27
|
+
/** One command on the box as the agents' account. @param {string} command */
|
|
28
|
+
function box(command) {
|
|
29
|
+
const run = spawnSync('ssh', ['-o', 'ConnectTimeout=20', '-o', 'BatchMode=yes', HOST, command], { encoding: 'utf8', timeout: 20 * 60_000 });
|
|
30
|
+
return { status: run.status ?? 1, out: `${run.stdout ?? ''}${run.stderr ?? ''}` };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The tag and build a channel's release file names (unverified here; the box verifies). @param {'production' | 'staging'} channel */
|
|
34
|
+
async function served(channel) {
|
|
35
|
+
const answer = await fetch(`${RELEASES}/${channel}.json`, { signal: AbortSignal.timeout(20_000), cache: 'no-store' });
|
|
36
|
+
if (!answer.ok) stop(`${channel}'s release file answered ${String(answer.status)}`);
|
|
37
|
+
const body = JSON.parse(/** @type {{ body: string }} */ (await answer.json()).body);
|
|
38
|
+
const tag = String(body.bundle?.name ?? '').split('/')[0] ?? '', build = String(body.engineBuild ?? '');
|
|
39
|
+
// The file is unverified here and both values reach a shell on the box: only a release tag and a full commit pass.
|
|
40
|
+
if (!SIGNED_TAG.test(tag) || !COMMIT.test(build)) stop(`${channel}'s release file names an unexpected tag or build`);
|
|
41
|
+
return { tag, build };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** True when engine `commit` ships the cook verb. @param {string} commit */
|
|
45
|
+
function carries(commit) {
|
|
46
|
+
spawnSync('git', ['fetch', '--quiet', 'origin', commit], { encoding: 'utf8' });
|
|
47
|
+
const shown = spawnSync('git', ['show', `${commit}:scripts/vps/wildshard-config`], { encoding: 'utf8', maxBuffer: 1 << 24 });
|
|
48
|
+
return shown.status === 0 && shown.stdout.includes(MARK);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function main() {
|
|
52
|
+
const args = process.argv.slice(2), dry = args.includes('--dry-run');
|
|
53
|
+
const tag = args.find(arg => arg !== '--dry-run');
|
|
54
|
+
if (tag === undefined || !TAG.test(tag) || args.length > (dry ? 2 : 1)) stop('usage: node scripts/release-cook.mjs vX.Y.Z [--dry-run]');
|
|
55
|
+
const production = await served('production');
|
|
56
|
+
if (production.tag !== tag) stop(`production serves ${production.tag || 'nothing'}, not ${tag}: the cook follows production`);
|
|
57
|
+
say('ok', `production serves ${tag} (${production.build.slice(0, 8)})`);
|
|
58
|
+
|
|
59
|
+
const shown = box('sudo -n /usr/local/sbin/wildshard-config show cook');
|
|
60
|
+
say('now', shown.status === 0 ? shown.out.trim().replaceAll('\n', ', ') : 'the box has no cook verb yet');
|
|
61
|
+
if (shown.status === 0 && shown.out.includes(`COOK_ENGINE_REF=${tag}\n`) && shown.out.includes(`WILDSHARD_BUILD=${production.build}`)) {
|
|
62
|
+
const health = box('curl -fsS --max-time 5 http://127.0.0.1:8792/health >/dev/null && echo up');
|
|
63
|
+
if (health.out.includes('up')) { say('ok', `the cook worker already runs ${tag} and answers /health`); return; }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (box(`grep -qF '${MARK}' /usr/local/sbin/wildshard-config`).status !== 0) {
|
|
67
|
+
// The helper comes from a signed tag that carries it: production's if it does, else staging's.
|
|
68
|
+
const staging = await served('staging');
|
|
69
|
+
const source = carries(production.build) ? production : carries(staging.build) ? staging : null;
|
|
70
|
+
if (source === null) stop('no signed release carries `wildshard-config cook` yet: it rides the next staging serial (AUTO-RELEASE AR8)');
|
|
71
|
+
const check = box('sudo -n /usr/local/sbin/wildshard-harden --check');
|
|
72
|
+
const fails = check.out.split('\n').filter(line => line.startsWith('fail'));
|
|
73
|
+
if (fails.length > 0) stop(`harden --check has ${String(fails.length)} fail row(s) (${fails.map(line => line.split(/\s+/u)[1]).join(', ')}): applying would change the box, so no auto-install`);
|
|
74
|
+
if (dry) { say('would', `install the cook verb by: sudo -n wildshard-apply ${source.tag} harden`); }
|
|
75
|
+
else {
|
|
76
|
+
say('doing', `sudo -n wildshard-apply ${source.tag} harden (detached; it may restart sshd)`);
|
|
77
|
+
box(`nohup sudo -n /usr/local/sbin/wildshard-apply ${source.tag} harden > ~/release-cook-harden.log 2>&1 < /dev/null &`);
|
|
78
|
+
// [w]: pgrep must not match the remote shell that runs it.
|
|
79
|
+
const deadline = Date.now() + 20 * 60_000, running = `pgrep -f '[w]ildshard-apply ${source.tag}' >/dev/null`;
|
|
80
|
+
// pgrep's 1 is "finished"; ssh's 255 (harden restarting sshd) is "ask again".
|
|
81
|
+
let status;
|
|
82
|
+
do {
|
|
83
|
+
await new Promise(resolve => { setTimeout(resolve, 15_000); });
|
|
84
|
+
if (Date.now() > deadline) stop('wildshard-apply harden did not finish in 20 minutes; see ~/release-cook-harden.log on the box');
|
|
85
|
+
status = box(running).status;
|
|
86
|
+
} while (status !== 1);
|
|
87
|
+
if (box(`grep -qF '${MARK}' /usr/local/sbin/wildshard-config`).status !== 0) stop('harden ran but the cook verb is not installed; see ~/release-cook-harden.log on the box');
|
|
88
|
+
// A step that could cut SSH arms a 10-minute dead-man; this new session proves the way in, so stop it as harden asks.
|
|
89
|
+
if (box('systemctl is-active --quiet wildshard-harden-deadman.timer').status === 0) {
|
|
90
|
+
say('note', 'harden armed its dead-man, so it changed an SSH-side setting; this session got in, stopping the timer');
|
|
91
|
+
const stopped = box('sudo -n /usr/bin/systemctl stop wildshard-harden-deadman.timer');
|
|
92
|
+
if (stopped.status !== 0 || box('systemctl is-active --quiet wildshard-harden-deadman.timer').status === 0) {
|
|
93
|
+
stop('the harden dead-man timer is still armed: run `sudo -n systemctl stop wildshard-harden-deadman.timer` as wildshard-agent within 10 minutes');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
say('ok', `the cook verb is installed from ${source.tag}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (dry) { say('would', `sudo -n wildshard-config cook ${tag}`); return; }
|
|
101
|
+
const moved = box(`sudo -n /usr/local/sbin/wildshard-config cook ${tag}`);
|
|
102
|
+
for (const line of moved.out.trim().split('\n').filter(row => /^(ok|doing|undo|stop|note|wait|warn|done)\s/u.test(row))) console.info(redact(line));
|
|
103
|
+
if (moved.status !== 0) stop(`wildshard-config cook ${tag} exited ${String(moved.status)}`);
|
|
104
|
+
const after = box('sudo -n /usr/local/sbin/wildshard-config show cook; curl -fsS --max-time 5 http://127.0.0.1:8792/health >/dev/null && echo health-up');
|
|
105
|
+
if (!after.out.includes(`COOK_ENGINE_REF=${tag}\n`) || !after.out.includes(`WILDSHARD_BUILD=${production.build}`) || !after.out.includes('health-up')) stop('the cook did not settle on the new tag; see journalctl -u wildshard-cook');
|
|
106
|
+
say('done', `the cook worker runs ${tag} (${production.build.slice(0, 8)}) and answers /health`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
await main();
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// repo-kit's scratch folder maker (meta docs/plans/REPO-DISK-PLAN.md row DK3). One copy lives in repo-kit; every org
|
|
3
|
+
// repo and singleplayer carries a byte-identical copy at scripts/scratch-dir.mjs (DK8 checks the copies).
|
|
4
|
+
//
|
|
5
|
+
// node scripts/scratch-dir.mjs <task> "<purpose>"
|
|
6
|
+
//
|
|
7
|
+
// creates <repo>/tmp/<task>/ and tmp/<task>/.owner, then prints the folder's absolute path. .owner is JSON: the session
|
|
8
|
+
// id ($CLAUDE_SESSION_ID, else $CLAUDE_CODE_SESSION_ID, else the Codex lane name in $WS_LANE_NAME), the lane name, the
|
|
9
|
+
// herdr pane ($HERDR_PANE_ID), the start time and the purpose. DK4's SessionEnd hook removes the folders whose .owner
|
|
10
|
+
// names the ending session; a .keep file in the folder (one line: why to keep it) stops that and DK6's 3-day sweep.
|
|
11
|
+
//
|
|
12
|
+
// <task> is one plain folder name: letters, digits, '.', '_' and '-', not starting with '.', never containing '/' or
|
|
13
|
+
// '..'. The helper deletes nothing. It refuses a folder that already exists unless that folder's .owner names this
|
|
14
|
+
// same session (then it prints the path again), so it never takes over another lane's or an ownerless folder.
|
|
15
|
+
import { mkdirSync, readFileSync, rmdirSync, writeFileSync } from 'node:fs';
|
|
16
|
+
import { join, resolve } from 'node:path';
|
|
17
|
+
import { pathToFileURL } from 'node:url';
|
|
18
|
+
|
|
19
|
+
const ROOT = resolve(import.meta.dirname, '..');
|
|
20
|
+
const TASK = /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/u;
|
|
21
|
+
|
|
22
|
+
/** Why a task name is refused, or null when it is a plain folder name.
|
|
23
|
+
* @param {string} task @returns {string | null} */
|
|
24
|
+
export function refuseTask(task) {
|
|
25
|
+
if (typeof task !== 'string' || task === '') return 'a task name is required';
|
|
26
|
+
if (task.includes('/') || task.includes('\\')) return `task "${task}" contains a path separator`;
|
|
27
|
+
if (task.includes('..')) return `task "${task}" contains ".."`;
|
|
28
|
+
if (task.length > 100) return `task "${task}" is longer than 100 characters`;
|
|
29
|
+
if (!TASK.test(task)) return `task "${task}" must be letters, digits, ".", "_" and "-", not starting with "."`;
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The .owner record for a new folder.
|
|
34
|
+
* @param {string} task @param {string} purpose @param {NodeJS.ProcessEnv} env @param {Date} now */
|
|
35
|
+
export function ownerRecord(task, purpose, env, now) {
|
|
36
|
+
const lane = env.WS_LANE_NAME || null;
|
|
37
|
+
return {
|
|
38
|
+
task,
|
|
39
|
+
session: env.CLAUDE_SESSION_ID || env.CLAUDE_CODE_SESSION_ID || lane,
|
|
40
|
+
lane,
|
|
41
|
+
pane: env.HERDR_PANE_ID || null,
|
|
42
|
+
started: now.toISOString(),
|
|
43
|
+
purpose,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** @param {string} path @returns {{session?: unknown} | null} */
|
|
48
|
+
function readOwner(path) {
|
|
49
|
+
try { return JSON.parse(readFileSync(path, 'utf8')); } catch { return null; }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Make <root>/tmp/<task>/ and its .owner; returns the folder's absolute path. Throws on a refused name, an empty
|
|
53
|
+
* purpose, or a folder that exists and is not this session's.
|
|
54
|
+
* @param {string} task @param {string} purpose
|
|
55
|
+
* @param {{root?: string, env?: NodeJS.ProcessEnv, now?: Date}} [options] */
|
|
56
|
+
export function scratchDir(task, purpose, { root = ROOT, env = process.env, now = new Date() } = {}) {
|
|
57
|
+
const refusal = refuseTask(task);
|
|
58
|
+
if (refusal) throw new Error(refusal);
|
|
59
|
+
if (typeof purpose !== 'string' || purpose.trim() === '') throw new Error('a purpose is required');
|
|
60
|
+
const tmp = join(resolve(root), 'tmp');
|
|
61
|
+
const dir = join(tmp, task);
|
|
62
|
+
const owner = ownerRecord(task, purpose.trim(), env, now);
|
|
63
|
+
mkdirSync(tmp, { recursive: true });
|
|
64
|
+
try {
|
|
65
|
+
mkdirSync(dir);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (!(error instanceof Error && 'code' in error && error.code === 'EEXIST')) throw error;
|
|
68
|
+
const existing = readOwner(join(dir, '.owner'));
|
|
69
|
+
if (existing && owner.session && existing.session === owner.session) return dir;
|
|
70
|
+
throw new Error(existing
|
|
71
|
+
? `${dir} already belongs to session ${String(existing.session)}; pick another task name`
|
|
72
|
+
: `${dir} already exists with no .owner; pick another task name`);
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
writeFileSync(join(dir, '.owner'), `${JSON.stringify(owner, null, 2)}\n`, { flag: 'wx' });
|
|
76
|
+
} catch (error) {
|
|
77
|
+
rmdirSync(dir); // only the empty folder this call just made
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
return dir;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
|
|
84
|
+
const [task = '', purpose = '', ...rest] = process.argv.slice(2);
|
|
85
|
+
if (rest.length > 0 || task === '--help' || task === '-h') {
|
|
86
|
+
console.error('usage: node scripts/scratch-dir.mjs <task> "<purpose>"');
|
|
87
|
+
process.exit(2);
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
console.log(scratchDir(task, purpose));
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error(`scratch-dir: ${error instanceof Error ? error.message : String(error)}`);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// repo-kit's 3-day scratch sweep (meta REPO-DISK-PLAN DK6, was TEMP-HYGIENE T7). One copy lives in repo-kit; every org
|
|
3
|
+
// repo carries a byte-identical copy at scripts/scratch-sweep.mjs, beside scratch-dir.mjs (DK3) and vite-tmp.mjs.
|
|
4
|
+
//
|
|
5
|
+
// node scripts/scratch-sweep.mjs [--live] [--root <repo>] [--days <n>]
|
|
6
|
+
//
|
|
7
|
+
// It looks at each folder directly under <repo>/tmp/ and would remove one in which nothing (the folder or anything in
|
|
8
|
+
// it) changed for <n> days (3 by default), with or without a DK3 `.owner`. It keeps:
|
|
9
|
+
// - a folder holding `.keep`, or named in `tmp/keep` (one name per line, `#` comments); `tmp/keep` itself when it is a
|
|
10
|
+
// folder (singleplayer keeps hand-kept work there);
|
|
11
|
+
// - a folder that is, or holds, some process's cwd (lsof -d cwd; /proc on Linux); an unreadable table keeps all;
|
|
12
|
+
// - a folder holding a Git root with dirty files or commits no remote has (DS14's list: the reason names the root);
|
|
13
|
+
// - dot folders, symlinks, and `tmp/vitest` (vite-tmp.mjs's own).
|
|
14
|
+
// Dry run is the default until Jake's yes (REPO-DISK decision 1) and a week of dry-run log; `--live` removes. Every
|
|
15
|
+
// decision is appended to tmp/.sweep.log, one line each, and a summary line goes to stdout.
|
|
16
|
+
import { spawnSync } from 'node:child_process';
|
|
17
|
+
import { appendFileSync, lstatSync, readdirSync, readFileSync, readlinkSync, realpathSync, rmSync } from 'node:fs';
|
|
18
|
+
import { join, resolve, sep } from 'node:path';
|
|
19
|
+
import { pathToFileURL } from 'node:url';
|
|
20
|
+
|
|
21
|
+
const DEFAULT_DAYS = 3;
|
|
22
|
+
const MINUTES_A_DAY = 1440;
|
|
23
|
+
const OWNED_ELSEWHERE = new Set(['vitest']);
|
|
24
|
+
|
|
25
|
+
/** Every process cwd as a real path, or null when the table can't be read (the same read as scratch-end.mjs). */
|
|
26
|
+
export function processCwds() {
|
|
27
|
+
if (process.platform === 'linux') {
|
|
28
|
+
let pids;
|
|
29
|
+
try {
|
|
30
|
+
pids = readdirSync('/proc').filter(name => /^\d+$/u.test(name));
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const cwds = [];
|
|
35
|
+
for (const pid of pids) {
|
|
36
|
+
try {
|
|
37
|
+
cwds.push(readlinkSync(`/proc/${pid}/cwd`).replace(/ \(deleted\)$/u, ''));
|
|
38
|
+
} catch {}
|
|
39
|
+
}
|
|
40
|
+
return cwds;
|
|
41
|
+
}
|
|
42
|
+
// A timed-out or failed lsof printed only part of the table: treat it as unreadable.
|
|
43
|
+
const lsof = spawnSync('lsof', ['-nP', '-w', '-d', 'cwd', '-Fn'], { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024, timeout: 10_000 });
|
|
44
|
+
if (lsof.error || lsof.signal || lsof.status !== 0) return null;
|
|
45
|
+
const cwds = (lsof.stdout || '').split('\n').filter(line => line.startsWith('n')).map(line => line.slice(1));
|
|
46
|
+
return cwds.length > 0 ? cwds : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** @param {string} path */
|
|
50
|
+
function stat(path) {
|
|
51
|
+
try {
|
|
52
|
+
return lstatSync(path);
|
|
53
|
+
} catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Names in tmp/keep. @param {string} tmp */
|
|
59
|
+
function keepList(tmp) {
|
|
60
|
+
let text = '';
|
|
61
|
+
try {
|
|
62
|
+
text = readFileSync(join(tmp, 'keep'), 'utf8');
|
|
63
|
+
} catch {
|
|
64
|
+
return new Set();
|
|
65
|
+
}
|
|
66
|
+
return new Set(text.split('\n').map(line => line.replace(/#.*/u, '').trim()).filter(Boolean));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** True when anything under `dir` (itself included) changed in the last `days` days, or the walk failed.
|
|
70
|
+
* @param {string} dir @param {number} days */
|
|
71
|
+
function touched(dir, days) {
|
|
72
|
+
const find = spawnSync('find', [dir, '-mmin', `-${String(days * MINUTES_A_DAY)}`, '-print', '-quit'], { encoding: 'utf8', maxBuffer: 1024 * 1024 });
|
|
73
|
+
return find.status !== 0 || find.stdout.trim() !== '';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** @param {string} root @param {readonly string[]} args */
|
|
77
|
+
function git(root, args) {
|
|
78
|
+
// GIT_OPTIONAL_LOCKS=0: `git status` must not refresh the index, or reading a stale clone would touch it.
|
|
79
|
+
const run = spawnSync('git', ['-C', root, ...args], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, env: { ...process.env, GIT_OPTIONAL_LOCKS: '0' } });
|
|
80
|
+
return run.status === 0 ? run.stdout.trim() : null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The first Git root under `dir` with dirty files or unpublished commits, and why; a Git error counts as unpublished.
|
|
84
|
+
* @param {string} dir @returns {string | null} */
|
|
85
|
+
function unpublished(dir) {
|
|
86
|
+
const find = spawnSync('find', [dir, '-maxdepth', '4', '-name', '.git', '-prune', '-print'], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
|
|
87
|
+
if (find.status !== 0) return `${dir}: Git roots unreadable`;
|
|
88
|
+
for (const marker of find.stdout.split('\n').filter(Boolean)) {
|
|
89
|
+
const root = resolve(marker, '..');
|
|
90
|
+
const status = git(root, ['status', '--porcelain', '--ignore-submodules']);
|
|
91
|
+
if (status === null) return `${root}: git status failed`;
|
|
92
|
+
if (status !== '') return `${root}: dirty files`;
|
|
93
|
+
const ahead = git(root, ['log', '--branches', '--tags', '--not', '--remotes', '--oneline', '-1']);
|
|
94
|
+
if (ahead === null) return `${root}: git log failed`;
|
|
95
|
+
if (ahead !== '') return `${root}: commits no remote has`;
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Each tmp/ folder and what the sweep does with it, removing nothing.
|
|
101
|
+
* @param {{ root: string, days?: number, cwds?: readonly string[] | null }} options
|
|
102
|
+
* @returns {{ name: string, action: 'remove' | 'keep', reason: string }[]} */
|
|
103
|
+
export function plan({ root, days = DEFAULT_DAYS, cwds = processCwds() }) {
|
|
104
|
+
const tmp = join(root, 'tmp');
|
|
105
|
+
const rows = [];
|
|
106
|
+
let names = [];
|
|
107
|
+
try {
|
|
108
|
+
names = readdirSync(tmp).toSorted();
|
|
109
|
+
} catch {
|
|
110
|
+
return rows;
|
|
111
|
+
}
|
|
112
|
+
const kept = keepList(tmp);
|
|
113
|
+
const real = cwds?.map(cwd => {
|
|
114
|
+
try {
|
|
115
|
+
return realpathSync(cwd);
|
|
116
|
+
} catch {
|
|
117
|
+
return cwd;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
for (const name of names) {
|
|
121
|
+
const dir = join(tmp, name), info = stat(dir);
|
|
122
|
+
if (info === null || !info.isDirectory() || name.startsWith('.') || OWNED_ELSEWHERE.has(name)) continue;
|
|
123
|
+
const at = realpathSync(dir);
|
|
124
|
+
/** @param {string} reason */
|
|
125
|
+
const keep = reason => rows.push({ name, action: /** @type {const} */ ('keep'), reason });
|
|
126
|
+
if (stat(join(dir, '.keep')) !== null) keep('.keep');
|
|
127
|
+
else if (kept.has(name)) keep('tmp/keep');
|
|
128
|
+
else if (name === 'keep') keep('tmp/keep is a folder of kept work');
|
|
129
|
+
else if (real === undefined || real === null) keep('process table unreadable');
|
|
130
|
+
else if (real.some(cwd => cwd === at || cwd.startsWith(at + sep))) keep('busy: a process cwd inside');
|
|
131
|
+
else if (touched(dir, days)) keep(`changed within ${String(days)} days`);
|
|
132
|
+
else {
|
|
133
|
+
const why = unpublished(dir);
|
|
134
|
+
if (why === null) rows.push({ name, action: /** @type {const} */ ('remove'), reason: `untouched ${String(days)} days` });
|
|
135
|
+
else keep(`unpublished (DS14): ${why}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return rows;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Plans, logs every row to tmp/.sweep.log, and removes the planned folders when live.
|
|
142
|
+
* @param {{ root: string, live?: boolean, days?: number, cwds?: readonly string[] | null, now?: Date }} options */
|
|
143
|
+
export function sweep({ root, live = false, days = DEFAULT_DAYS, cwds, now = new Date() }) {
|
|
144
|
+
const rows = plan({ root, days, ...(cwds === undefined ? {} : { cwds }) });
|
|
145
|
+
const stamp = now.toISOString(), lines = [];
|
|
146
|
+
let removed = 0;
|
|
147
|
+
for (const row of rows) {
|
|
148
|
+
let verb = row.action === 'keep' ? `keep (${row.reason})` : 'would remove';
|
|
149
|
+
if (row.action === 'remove' && live) {
|
|
150
|
+
try {
|
|
151
|
+
rmSync(join(root, 'tmp', row.name), { recursive: true, force: true });
|
|
152
|
+
verb = 'removed';
|
|
153
|
+
removed += 1;
|
|
154
|
+
} catch (error) {
|
|
155
|
+
verb = `remove failed (${error instanceof Error ? error.message : String(error)})`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
lines.push(`${stamp} ${verb} tmp/${row.name}${row.action === 'remove' ? ` (${row.reason})` : ''}\n`);
|
|
159
|
+
}
|
|
160
|
+
if (lines.length > 0) {
|
|
161
|
+
try {
|
|
162
|
+
appendFileSync(join(root, 'tmp/.sweep.log'), lines.join(''));
|
|
163
|
+
} catch {}
|
|
164
|
+
}
|
|
165
|
+
const planned = rows.filter(row => row.action === 'remove').length;
|
|
166
|
+
return { rows, planned, removed };
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
170
|
+
const args = process.argv.slice(2);
|
|
171
|
+
const flag = (/** @type {string} */ name) => {
|
|
172
|
+
const at = args.indexOf(name);
|
|
173
|
+
return at === -1 ? undefined : args[at + 1];
|
|
174
|
+
};
|
|
175
|
+
const days = Number(flag('--days') ?? DEFAULT_DAYS);
|
|
176
|
+
if (!Number.isInteger(days) || days < 1) throw new Error('--days takes a whole number of days, 1 or more');
|
|
177
|
+
const root = resolve(flag('--root') ?? resolve(import.meta.dirname, '..'));
|
|
178
|
+
const live = args.includes('--live');
|
|
179
|
+
const { rows, planned, removed } = sweep({ root, live, days });
|
|
180
|
+
const keptRows = rows.filter(row => row.action === 'keep');
|
|
181
|
+
process.stdout.write(`scratch-sweep ${live ? 'live' : '(dry run)'} ${root}/tmp: ${live ? `removed ${String(removed)} of ${String(planned)}` : `would remove ${String(planned)}`}, kept ${String(keptRows.length)}; log tmp/.sweep.log\n`);
|
|
182
|
+
}
|
package/scripts/tsconfig.json
CHANGED
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
"ci-native-fixtures.mjs",
|
|
46
46
|
"agent-parity.mjs",
|
|
47
47
|
"agent-sync.mjs",
|
|
48
|
+
"scratch-dir.mjs",
|
|
49
|
+
"scratch-sweep.mjs",
|
|
48
50
|
"goldens/capture.mjs",
|
|
49
51
|
"goldens/native-residency.mjs",
|
|
50
52
|
"look-loop/views.mjs",
|
|
@@ -61,16 +63,13 @@
|
|
|
61
63
|
"../test/author-errors.test.ts",
|
|
62
64
|
"../test/author-lut-sampling.test.ts",
|
|
63
65
|
"../test/author-placement-parity.test.ts",
|
|
64
|
-
"../test/authored-html.test.ts",
|
|
65
66
|
"../test/bake-collider-kernels.test.ts",
|
|
66
67
|
"../test/balbal-program.test.ts",
|
|
67
68
|
"../test/balbal-v2.test.ts",
|
|
68
69
|
"../test/basis-glb-variant.test.ts",
|
|
69
70
|
"../test/boot-audio-packs.test.ts",
|
|
70
|
-
"../test/boot-extras.test.ts",
|
|
71
71
|
"../test/boot-settings-interaction.test.ts",
|
|
72
72
|
"../test/build-cache-report.test.ts",
|
|
73
|
-
"../test/build-validation-receipts.test.ts",
|
|
74
73
|
"../test/carried-quest-host.test.ts",
|
|
75
74
|
"../test/channel-programs-gather.test.ts",
|
|
76
75
|
"../test/ci12-ghost-owners.test.ts",
|
|
@@ -86,7 +85,6 @@
|
|
|
86
85
|
"../test/contract-page-admission.test.ts",
|
|
87
86
|
"../test/contract-program-owner.test.ts",
|
|
88
87
|
"../test/contracts-platform.test.ts",
|
|
89
|
-
"../test/control-chunks.test.ts",
|
|
90
88
|
"../test/creature-refill.test.ts",
|
|
91
89
|
"../test/creature-spawner.test.ts",
|
|
92
90
|
"../test/debug-authored-rows.test.ts",
|
|
@@ -107,7 +105,6 @@
|
|
|
107
105
|
"../test/elite-native-roster.test.ts",
|
|
108
106
|
"../test/encounter-room.test.ts",
|
|
109
107
|
"../test/encounter-slots.test.ts",
|
|
110
|
-
"../test/engine-sides.test.ts",
|
|
111
108
|
"../test/entry-styles.test.ts",
|
|
112
109
|
"../test/faceted-ao-scope.test.ts",
|
|
113
110
|
"../test/faceted-author-compiler.test.ts",
|
|
@@ -131,7 +128,6 @@
|
|
|
131
128
|
"../test/fixtures/driftwood-rock-author.ts",
|
|
132
129
|
"../test/fixtures/driftwood-trade-native.ts",
|
|
133
130
|
"../test/fixtures/geometry-cache-author-observation.ts",
|
|
134
|
-
"../test/fixtures/graph-scene-author-observation.ts",
|
|
135
131
|
"../test/fixtures/half-float-before-control.ts",
|
|
136
132
|
"../test/fixtures/headless/driftwood-optional-run.ts",
|
|
137
133
|
"../test/fixtures/headless/driftwood-story-run.ts",
|
|
@@ -243,7 +239,6 @@
|
|
|
243
239
|
"../test/graph-foliage-normal.test.ts",
|
|
244
240
|
"../test/graph-instance-transform.test.ts",
|
|
245
241
|
"../test/graph-optional-attribute.test.ts",
|
|
246
|
-
"../test/graph-scene-author-ports.test.ts",
|
|
247
242
|
"../test/graph-shadow-depth.test.ts",
|
|
248
243
|
"../test/graph-shadow-offset.test.ts",
|
|
249
244
|
"../test/graph-toon-caustics.test.ts",
|
|
@@ -326,10 +321,7 @@
|
|
|
326
321
|
"../test/nine-source-rows.test.ts",
|
|
327
322
|
"../test/nine-verb-tape.test.ts",
|
|
328
323
|
"../test/no-base64.test.ts",
|
|
329
|
-
"../test/no-generated-import.test.ts",
|
|
330
324
|
"../test/no-shard-runtime.test.ts",
|
|
331
|
-
"../test/open-plots-capture.test.ts",
|
|
332
|
-
"../test/open-plots-config.test.ts",
|
|
333
325
|
"../test/original-script-order.test.ts",
|
|
334
326
|
"../test/output-runtime.test.ts",
|
|
335
327
|
"../test/packed-specimen-files.test.ts",
|
|
@@ -476,7 +468,6 @@
|
|
|
476
468
|
"../test/splat-family-props.test.ts",
|
|
477
469
|
"../test/stealth-crouch-kernel.test.ts",
|
|
478
470
|
"../test/stealth-detection.test.ts",
|
|
479
|
-
"../test/sunscar-generation-inputs.test.ts",
|
|
480
471
|
"../test/taming-binding-order.test.ts",
|
|
481
472
|
"../test/taming-guest-legacy.test.ts",
|
|
482
473
|
"../test/taming-world-actions.test.ts",
|
|
@@ -493,7 +484,6 @@
|
|
|
493
484
|
"../test/titan-world-commands.test.ts",
|
|
494
485
|
"../test/uniform-tile-grid.test.ts",
|
|
495
486
|
"../test/view-author-metadata.test.ts",
|
|
496
|
-
"../test/vite-boot-modules.test.ts",
|
|
497
487
|
"../test/vitest-module-cache.test.ts",
|
|
498
488
|
"../test/wet-product-loans.test.ts",
|
|
499
489
|
"../test/whole-library-cache.test.ts",
|
|
@@ -129,6 +129,9 @@ if put "$NODE_DROPIN" < <(node_dropin); then units_changed=1; fi
|
|
|
129
129
|
# promtool comes with the package, so the very first config is checked after the install, before anything restarts.
|
|
130
130
|
check=; if command -v promtool >/dev/null 2>&1; then check='promtool check config'; fi
|
|
131
131
|
if put "$CONFIG" "$check" < <(config); then config_changed=1; fi
|
|
132
|
+
# The box's root umask (027, VH16) leaves a new /etc/prometheus root-only, and the prometheus user then cannot open its
|
|
133
|
+
# config (v0.1.19 staging, 2026-11-14: "open /etc/prometheus/wildshard.yml: permission denied"). It holds no secret.
|
|
134
|
+
chmod 755 "$(dirname "$CONFIG")" || exit 1
|
|
132
135
|
if [ "$units_changed" = 1 ]; then systemctl daemon-reload; fi
|
|
133
136
|
|
|
134
137
|
installed() { dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -q 'ok installed'; }
|