@nodii/dev 0.6.220 → 0.6.221
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/README.md +3 -3
- package/dist/core.js +1 -1
- package/dist/heavy-slot.sh +6 -2
- package/dist/heavy.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -166,10 +166,10 @@ nodii-dev heavy run --size light -- bun test tests/unit/money.test.ts
|
|
|
166
166
|
nodii-dev heavy run -- git push -u origin HEAD
|
|
167
167
|
nodii-dev heavy run --tighten memory=40 -- true # refused (exit 75) unless 40 GB is available
|
|
168
168
|
nodii-dev heavy status
|
|
169
|
-
nodii-dev heavy run --help # prints the usage; takes no slot and runs nothing
|
|
169
|
+
nodii-dev heavy run --help # prints what it does, then the usage; takes no slot and runs nothing
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
- **The machine's floor (DEV-PROCESS-2).** Every job reads the floor before it queues and again when a slot is free (`src/machine-floor.js`). Available memory, after what running jobs hold back for their peaks, must be at least 10 GB (5 GB for a light job); swap used at most 24 GB; disk free at least 15 GB. A running job holds back its class's peak (7 GB heavy, 1 GB light) less what its process tree uses now. Under the floor a job exits 75 at once with `MACHINE_UNDER_FLOOR`, naming the reading, the figure and the five largest holders of memory. It is never queued and never let through: there is no exception for a lone job, a landing or a push (hub-490). The readings use the system tools' absolute paths (`/usr/bin/vm_stat`, `/usr/sbin/sysctl vm.swapusage`, `/bin/df -Pk /`), on the install's own node.
|
|
172
|
+
- **The machine's floor (DEV-PROCESS-2).** Every job reads the floor before it queues and again when a slot is free (`src/machine-floor.js`). Available memory, after what running jobs hold back for their peaks, must be at least 10 GB (5 GB for a light job); swap used at most 24 GB; disk free at least 15 GB. A running job holds back its class's peak (7 GB heavy, 1 GB light) less what its process tree uses now. Under the floor a job exits 75 at once with `MACHINE_UNDER_FLOOR`, naming the reading, the figure and the five largest holders of memory. It is never queued and never let through: there is no exception for a lone job, a landing or a push (hub-490). A job that queued for a slot and is then refused when one frees leaves no queue ticket behind. The readings use the system tools' absolute paths (`/usr/bin/vm_stat`, `/usr/sbin/sysctl vm.swapusage`, `/bin/df -Pk /`), on the install's own node.
|
|
173
173
|
- **The floor file.** The floor, the class peaks, the ceilings (3 heavy slots, one of them only for a push forced heavy; 8 light slots) and the 10 s stagger live in `/etc/nodii/floor.env`. It counts only when root owns it and `/etc/nodii`, neither is group- or world-writable, and the lanes' user cannot write it; else the shipped defaults hold, and `heavy status` says why. Only the machine owner installs or changes it, with their password (`sudo install -d -o root -g wheel -m 755 /etc/nodii && sudo install -o root -g wheel -m 644 floor.env /etc/nodii/floor.env`). No variable moves it or the slot directory: `NODII_RESOURCE_LIMITS`, `HEAVY_SLOT_DIR`, `NODII_HEAVY_SLOT`, `NODII_HEAVY_SLOT_HELD` and `HEAVY_LANDING` are gone. `~/.config/nodii-resources/limits.env` keeps only the coordinator's `LANE_CAP`, `STACK_CAP`, `LIGHT_LANE_CAP` and `DEV_SERVER_CAP`.
|
|
174
174
|
- `--tighten memory=GB|swap=GB|disk=GB` (repeatable, or a comma list) makes one call stricter than the floor; a figure that would loosen it exits 2 (`USAGE`). `lane launch` and `lane resume` take it too.
|
|
175
175
|
- **Heavy is end-to-end; light is a short list (MW2-51).** A heavy slot is for end-to-end, real-stack and browser-flow work: Playwright, Cypress and other browser drivers, an `e2e`, `integration`, real-stack or stack script, an image build and a detached stack start. A light slot (under the light floor, 5 GB, with no stagger) is for a typecheck or lint on the diff's files only (`tsc`, `tsgo`, `vue-tsc`, `eslint`, `biome` or `oxlint` naming the files it checks, or a package manager's `typecheck`, `lint` or `tsc` script scoped by its name: `:affected`, `:changed`, `:touched`, `:diff`, `:staged`; a whole-repository typecheck or lint counts heavy), a unit-test run naming at most 20 test files (`bun test`, `vitest`, `jest`, `mocha`, `node --test`; no globs, no compound commands) and `git push`. Anything else counts heavy (`sleep`, `true`, a whole suite, an install), and a command declared light with `--size light` that is none of those counts heavy and says so. `--size heavy` makes any job heavy. Light locks live in `/tmp/nodii-heavy-slots/light`.
|
|
@@ -186,7 +186,7 @@ nodii-dev heavy run --help # prints the usage; takes no s
|
|
|
186
186
|
|
|
187
187
|
It then stops its own job's process tree and logs the reclaim (slot, lane, time held and why) to `/tmp/nodii-heavy-slots/reclaim.log`. `heavy status` shows each slot's lane, marks a reclaim candidate and lists the last reclaims. No session ever signals another session's processes (MW2-49): a waiter only waits. A slot taken outside a lane, or held by a pre-v26 copy, is never reclaimed this way; a check that can't tell (Dev unreachable, no `lsof`) keeps the slot.
|
|
188
188
|
- It can't be skipped. In a lane, the safety hook (`hook safety-pre`) refuses an unqueued heavy command (`SAFETY_HEAVY_UNQUEUED`) and prints the same command with `nodii-dev heavy run --` in front of each heavy part. Only the installed queue queues: a file named `heavy-slot.sh`, run directly or by a shell, is no queue, so its job is judged as if run bare. design-system's surface-gen check (`node infra/code-connect/surface-gen.mjs check`) is heavy.
|
|
189
|
-
- Every-page checks run in CI only (DEV-PROCESS-2, hub-650). In a lane, the hook refuses with `SAFETY_CI_ONLY
|
|
189
|
+
- Every-page checks run in CI only (DEV-PROCESS-2, hub-650). In a lane, the hook refuses with `SAFETY_CI_ONLY`. The refusal opens with "`<check>` runs over every page and runs in CI only; locally run it on the touched pages (`--touched`). Covered by the pull request's `<job>` check (MW1-107)." and names the pull-request check that covers it: `nodii-dev surface generate --all --check` (also through `npx @nodii/dev`, `pnpm dlx` or an env prefix) and any surface-gen check run with `CI=` set, bare or queued, are covered by "Generated pages match their Surfaces" (job `surface-gen-equal`); `pnpm verify:frame-conformance` and `pnpm verify:frame-conformance:gate`, with or without `--touched`, bare or queued, by "Frame conformance for touched pages" (job `frame-conformance`). `surface generate --all --write` and `nodii-dev heavy run -- node infra/code-connect/surface-gen.mjs check` (no `CI=`) stay allowed.
|
|
190
190
|
- `lane check --gate` and `receipt write --run` queue every gate themselves, `lane check` runs each reviewer under a slot (its timeout starts once the slot is granted), and `lane closeout` pushes through the landing reserve.
|
|
191
191
|
- `[TOOL GAP hub-86]` MW5-19 places this helper as the `heavy-slot` util. It ships here until the util pipeline exists.
|
|
192
192
|
|
package/dist/core.js
CHANGED
|
@@ -4,7 +4,7 @@ import { chmod, lstat, mkdir, readFile, rename, rm, writeFile } from "node:fs/pr
|
|
|
4
4
|
import { homedir, platform } from "node:os";
|
|
5
5
|
import { basename, dirname, join } from "node:path";
|
|
6
6
|
|
|
7
|
-
export const VERSION = "0.6.
|
|
7
|
+
export const VERSION = "0.6.221";
|
|
8
8
|
export const configPath = () =>
|
|
9
9
|
process.env.NODII_DEV_CONFIG_PATH ??
|
|
10
10
|
join(homedir(), ".config/nodii-dev/config.json");
|
package/dist/heavy-slot.sh
CHANGED
|
@@ -209,6 +209,8 @@ while [ $# -gt 0 ]; do
|
|
|
209
209
|
--tighten=*) TIGHTEN="${TIGHTEN:+$TIGHTEN,}${1#--tighten=}"; shift;;
|
|
210
210
|
# The drill's red run (o2-red-run.confirm.md): `heavy run --help` once took a slot and ran `--help` as a command.
|
|
211
211
|
-h|--help) cat <<'USAGE'
|
|
212
|
+
Runs a command in a heavy slot (end-to-end only) or a light slot (typecheck, lint, unit tests, push), or refuses it at once below the machine floor (MW2-51).
|
|
213
|
+
|
|
212
214
|
usage: nodii-dev heavy run [--size light|heavy] [--tighten READING=GB] -- <command...>
|
|
213
215
|
nodii-dev heavy status
|
|
214
216
|
|
|
@@ -431,7 +433,9 @@ local frc=0; floor_gate || frc=$?; [ "$frc" -eq 0 ] || return "$frc"
|
|
|
431
433
|
# (limit - held) live tickets may try for a slot. Landings keep their reserve and skip the line.
|
|
432
434
|
local Q="$D/q" TICKET=""; [ "$SIZE" = light ] && Q="$D/lq"; mkdir -p "$Q" 2>/dev/null
|
|
433
435
|
if [ "$IS_LANDING" != 1 ]; then TICKET="$Q/$(date +%s).$(printf '%06d' $$)"; echo $$ > "$TICKET"; fi
|
|
434
|
-
trap '
|
|
436
|
+
# The trap names the ticket's path, not $TICKET: TICKET is local to main, so when a refusal returns from main the EXIT
|
|
437
|
+
# trap ran with it unset ("TICKET: unbound variable" under set -u, O2 green run 28 Nov) and the ticket stayed queued.
|
|
438
|
+
if [ -n "$TICKET" ]; then trap "rm -f '$TICKET'" EXIT; fi
|
|
435
439
|
# v25 (13 Nov, hub-377): a STOPPED waiter (ps state T: ^Z, SIGSTOP, a suspended session) never polls, so it can never
|
|
436
440
|
# take a slot, yet it kept its rank: eight stopped head tickets held 46 live waiters for an hour with 1/6 slots held
|
|
437
441
|
# (05:30Z, reported by rbac-edge-strip). A stopped waiter keeps its ticket, so it gets its place back when it resumes,
|
|
@@ -487,7 +491,7 @@ while :; do
|
|
|
487
491
|
# v30: this read is the one that admits the job, so it is the one logged (--admit), once, admission or
|
|
488
492
|
# refusal, without the job's own slot (--self) and before the job starts.
|
|
489
493
|
frc=0; floor_gate --self "$l" --admit || frc=$?
|
|
490
|
-
if [ "$frc" -ne 0 ]; then rmdir "$D/.admit"; rm -rf "$l"; return "$frc"; fi
|
|
494
|
+
if [ "$frc" -ne 0 ]; then rmdir "$D/.admit"; rm -rf "$l"; [ -n "$TICKET" ] && rm -f "$TICKET"; TICKET=""; return "$frc"; fi
|
|
491
495
|
date +%s > "$SD/last-admit"; rmdir "$D/.admit"; slot="$l"; [ -n "$TICKET" ] && rm -f "$TICKET"; TICKET=""; break 2
|
|
492
496
|
fi
|
|
493
497
|
rmdir "$D/.admit"
|
package/dist/heavy.js
CHANGED
|
@@ -474,8 +474,9 @@ export function ciOnlyViolation(command) {
|
|
|
474
474
|
return {
|
|
475
475
|
code: "SAFETY_CI_ONLY",
|
|
476
476
|
message: [
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
// The first line is the frozen text in DEV-PROCESS-2's o2-clause-texts.md ("Help and hook text"); done check step 7.
|
|
478
|
+
`\`${found.text}\` runs over every page and runs in CI only; locally run it on the touched pages (\`--touched\`). Covered by the pull request's ${covering.job} check (MW1-107).`,
|
|
479
|
+
`Not run here. That check is "${covering.check}" (design-system CI, job ${covering.job}). DEV-PROCESS-2, hub-650.`,
|
|
479
480
|
covering.local,
|
|
480
481
|
].join("\n"),
|
|
481
482
|
};
|