GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — dynamic slots: capacity readings: swap, pressure, live total, per-piece demand (DS2) by scuttletoby · Pull Request #284 · scuttletoby/t3code Conversation
|
| File | What it is |
|---|---|
capacityReadings.ts |
The readers, all through one small injectable host (read a file, run a command, Node's numbers), so every reading is tested from fixtures. readMachine gives total and available memory, cores, swap, machine PSI and the OS pressure level. readBoxPsi reads a box's PSI. readPieceDemand reads one piece's demand (cgroup v2, v1 fallback). capacityFactsOf builds the evaluator's input. nodeCapacityHost(platform) is the real host. |
capacity/capacity-readings.json |
72 shared fixture cases (cgroup v2, cgroup v1, a container, a container with systemd inside, no PSI, PSI turned off, macOS, Windows), with expected values worked out by hand. 29 are marked failed, and each of those must give no more room than its healthy host. The kit's Python reader will run the same file later. |
capacityRule.ts |
Adds capacityLevel: the pressure level on its own. The caller passes in the {level, calmSinceMs} it kept, and nothing is stored inside. It uses the same code path as capacityDecision, and a test checks it gives the same level as capacityDecision on all 110 vectors. |
capacity/README.md |
A new "Readings" section: what each OS gives, what it cannot give and what the reader returns instead. |
Rule: a failed reading never admits more. A value that is missing, unreadable, empty, cut short, impossible (available above total, swap free above swap total, PSI above 100) or in the wrong unit (meminfo lines without kB) is returned as null (total, available, cores, demand) or "unreadable" (swap, PSI, OS level). The rule then admits nothing or brakes. A missing file counts as "none" only where the OS simply has no such signal: /proc/pressure/memory on a kernel without PSI (or with PSI built in but turned off, where reading it fails with EOPNOTSUPP), and box PSI on cgroup v1. A failed read is never "missing": the real host sorts only ENOENT/ENOTDIR as missing and EOPNOTSUPP as "turned off"; EACCES, EIO and every other error are unreadable. If the files that tell cgroup v2 from v1 cannot be read, cgroup is "unreadable", a container cap is unknown, and available memory and cores are null.
Live total. MemTotal is read on every call and never kept, so ballooning, WSL2 resizing and VM changes need no restart. Total and available come from the same read, so they always match each other. A later cache (DS3/DS8) must keep them as a pair, never a cached total with a fresh available. Inside a container, total and available are capped by the cgroup root's memory.max and cores by its cpu.max. These are read whenever they exist: a real host's cgroup v2 root has neither (the kernel gives the root no limit files), and a container's namespace root has them wherever this process sits inside it, including with systemd inside the container (0::/init.scope). /proc/self/cgroup is no longer read. This follows upstream's HostResources (pingdotgg#28261). A host process's own unit limit is not treated as the machine's limit (tested).
Demand = anon + shmem + swap. Page cache is not counted: it is still in "available", and counting it as demand would under-count what a piece still owes. A missing swap part counts as 0, so the piece owes more, never less. memory.current and memory.peak are returned separately for cost learning (D5). A scope that ended between the list and the read comes back as gone (the caller drops it). A path that is the cgroup root or contains .. is never read.
| Reading | Linux cgroup v2 | Linux cgroup v1 | macOS | Windows |
|---|---|---|---|---|
| available | MemAvailable (container: capped) | same | vm_stat free + inactive + speculative; if that fails, Node's free pages (less than the real figure) | Node's freemem (includes standby) |
| swap | SwapTotal/SwapFree | same | none: swap files grow on demand, so the margin is wider and the OS level covers it | none: Node does not give the page file, so the margin is wider |
| PSI | /proc/pressure/memory; missing = none |
same | none; uses kern.memorystatus_vm_pressure_level (1/2/4) |
none, and no OS level either: available memory against the margin only |
| box PSI | memory.pressure; missing = unreadable |
none | none | none |
| per-piece demand | memory.stat + memory.swap.current |
total_rss + total_shmem + total_swap |
null: each piece owes its full cost |
null: each piece owes its full cost |
Not read yet (known limits): a cgroup v1 container's CPU quota, a container's memory.swap.max, and process-tree demand on macOS and Windows (basic tier). A v2 box with PSI turned off through cgroup.pressure reads as unreadable, which counts as elevated (the safe side).
"What happens when this runs again, stops half-way, or meets existing, old or empty state?"
| Case | What happens |
|---|---|
| Runs again | Nothing is kept: every call reads fresh. Hysteresis state is passed in by the caller and handed back. |
| Stops half-way (a read fails, a file is cut short, a command times out after 2 s) | That value is null/"unreadable", so nothing more is admitted, or the brake applies. Tested: 29 failed cases never give more room than their healthy host. |
A container marker file fails to read (cgroup.controllers, the v1 root memory.stat) |
cgroup: "unreadable": available and cores null, box PSI unreadable, every piece owes its full cost. Never the host's numbers (tested per file). |
/proc/self/cgroup fails to read, or this process is not at 0::/ (systemd in the container) |
Not read any more: the cap comes from the root's memory.max/cpu.max alone (tested). |
| PSI built in but turned off (EOPNOTSUPP) | Machine PSI: none, with the gap listed. Elsewhere (box PSI, memory.max) EOPNOTSUPP is a failed read (tested). |
| Host function throws | Caught; read as unreadable (tested). |
| Scope ends between list and read | memory.stat missing gives gone; a later missing file gives that value null. |
| Empty file (meminfo, PSI, memory.stat) | Unreadable / demand unknown (tested). |
| Truncated line, kB vs bytes, value above 2^53 | Not read (tested). |
| Values larger than total; PSI present but zero; swap total 0 | Unreadable; a real zero reading; no swap (tested). |
| Old rule file without a new key / rule file from a newer build | Unchanged from DS1: parseCapacityRule refuses it by name and the caller keeps today's fixed limits. The readers read no rule. |
| Empty or broken fixture/vector file | The test fails: at least 50 reading cases, unique names, every host present. DS1's format check covers the vector file. |
| Old kernel (no MemAvailable, no PSI, no memory.peak) | Available unreadable (nothing admitted, stated); PSI none; peak null. |
Foreign state: a host service's own unit has memory.max/cpu.max |
Not taken: only the cgroup root's files are read, and a real host's root has none (tested). |
| # | Finding | Fixed | Test (red on 8bad3cd, green now) |
|---|---|---|---|
| 1 | MAJOR: a failed read of /proc/self/cgroup, cgroup.controllers or the v1 root memory.stat dropped the container cap |
Yes. cgroupVersion keeps missing and unreadable apart (new cgroup: "unreadable": available and cores null, box PSI unreadable, piece demand unknown); /proc/self/cgroup is no longer read |
Fixtures container, own cgroup unreadable, container, cgroup.controllers unreadable (each red twice: own case + "never more room"), cgroup v1 container, root memory.stat unreadable; guards piece when the cgroup version is unreadable, box PSI when the cgroup version is unreadable (red) |
| 2 | MAJOR: a container with systemd inside was not detected | Yes. The root's memory.max and cpu.max are read whenever they exist |
container with systemd inside, ... deeper unit (red); guards host process with its own unit limit, host process at the cgroup root (a real host: no cap) |
| 3 | minor: PSI built in but turned off read as unreadable | Yes. New file error unsupported (EOPNOTSUPP/ENOTSUP); "none" only for the machine PSI |
PSI built in but turned off (red); guards box PSI turned off for that box, container limit unsupported (stay fail-closed) |
| 4 | minor: the real host's error mapping had no test (M13 survived) | Yes. The mapping is capacityFileError, tested code by code; reading a directory (EISDIR) gives unreadable |
sorts file errors (red: new); reads a file that exists but cannot be read as unreadable. M13 now fails 2 tests |
| 5 | minor: inside a container the machine PSI is the host's | Not in this PR | See "Follow-ups for DS3" |
| 6 | minor: gone for any missing memory.stat; a box not created yet reads unreadable |
Not in this PR | See "Follow-ups for DS3" |
Red first: the new tests on the 8bad3cd reader: 10 failed, 102 passed (112). With the fix: 238 passed (capacityReadings.test.ts + capacityRule.test.ts).
Mutation check of the new guards (each broken alone, capacityReadings.test.ts, restored): every error read as missing (M13): 2 failed; EOPNOTSUPP read as unreadable on the real host: 1; machine PSI turned off read as unreadable: 1; unreadable cgroup.controllers read as missing: 3; unreadable v1 memory.stat read as missing: 1; unknown cgroup ignored for memory: 2, for cores: 2; unknown cgroup read as no box PSI: 1; a piece read with an unknown cgroup: 1; the old 0::/ gate put back: 4. One survived and is equivalent: box PSI "turned off" read as none, because readBoxPsi already turns a box's "none" into unreadable.
/proc/pressure/memory is system-wide, so a container stalling at its own memory.max while the host is calm reads as calm. When a v2 root limit is found, take the worse of /proc/pressure/memory and /sys/fs/cgroup/memory.pressure (and let readBoxPsi reach the namespace root, which cgroupPath refuses today).readPieceDemand gives gone for any missing memory.stat, including a wrong or never-created path, so that piece would owe 0. DS3 should drop a piece only when its own records agree that it ended. A box that does not exist yet (systemd removes empty slices) reads unreadable, so the first ask after an idle spell is elevated for the 60 s calm wait; DS3 can pass boxPsi: null for a box that holds no pieces.All general: Linux (cgroup v1/v2, containers, WSL2), macOS and Windows, with no project facts, paths or names. Fixture paths are made up (/work.slice/...).
Builds on upstream's HostResources reading (/proc/meminfo, the vm_stat formula, container memory.max from upstream pingdotgg#28261) and on the scope/slice layout upstream already uses for agents. The level hysteresis has the same shape as upstream PR pingdotgg#27253. Plain async functions with an injected host; DS3 wraps them in Effect at the slot gate. Nothing posted upstream.
capacityReadings.test.ts: the 72 shared cases; 29 "never more room" checks through the real evaluator; unreadable meminfo, PSI and box PSI end to end; a throwing host; an unknown-demand piece owing its full cost while a gone one is dropped; capacityLevel matching capacityDecision on every vector; up-at-once / down-after-calm through readings; the real Node host (missing file vs failed command, reading this machine on Linux).capacityRule.test.ts (DS1) still passes unchanged... or no leading / read (2 failed). All restored before the commit.Results on the measured host: vp test run on capacityReadings.test.ts and capacityRule.test.ts: 238 passed (2 files). The packages/shared typecheck, vp lint and vp fmt on the touched files, and knip (files/dependencies and the packages/shared exports) are clean.
🤖 Generated with Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ce demand (DS2) Readers that turn the machine's live state into the capacity rule's input: live total and available memory (container-capped), cores, swap, machine and box PSI, the macOS pressure level, and per-piece demand from cgroup v2 (v1 fallback). Everything goes through an injectable host and is tested from 60 shared fixture cases. A failed or half-read value is null/"unreadable", never free room. Adds capacityLevel (hysteresis state passed in). Not wired into the slot gate (DS3); no timer, cache or file written. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
lens: correctness verdict: NOT SAFE (head 8bad3cd) Lens: correctness + requirements + tests/state. Read-only review of the diff, the dynamic-slots design (sections 3, 4, 6, row D2) and upstream's Findings1. MAJOR: a failed read of the container markers removes the container cap (more room, not less).
The 25 "never more room" cases do not include these files, so the suite stays green. Fix: keep missing and unreadable apart for these three reads; unreadable gives 2. MAJOR: a container is only detected when this process sits at 3. MINOR (major once DS3 enforces): PSI that is built in but turned off reads as unreadable, so the level stays elevated forever. 4. MINOR (test gap): the real host's error mapping has no guarding test. Mutation M13 (every 5. MINOR: inside a container the machine PSI is the host's. 6. MINOR, a seam for DS3: Checked and fine
Tests and mutation checkBaseline: To merge: fix 1 and 2 with fixtures (each fixture red without its fix), and preferably 3 and 4. 5 and 6 can be issues for DS3. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…f, file errors) - A failed read of cgroup.controllers or the v1 root memory.stat no longer reads as "no container": cgroup is "unreadable", so available memory and cores are null (never the host's numbers). - The cgroup v2 root's memory.max and cpu.max are read whenever they exist, so a container with systemd inside is capped too; /proc/self/cgroup is no longer read. A real host's root has no such files. - PSI built in but turned off (EOPNOTSUPP) reads as "no PSI" for the machine; everywhere else it stays a failed read. - capacityFileError sorts the real host's file errors, tested code by code (every error read as missing no longer passes). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
lens: correctness-r2 verdict: SAFE (head fe6f5fb) Round 2 of the correctness lens (round 1: NOT SAFE at 8bad3cd). I read the round-1 comment, the PR body (fix table, state table, follow-ups for DS3), the whole of Round-1 findings: all fixed in code
New fail-open paths: none found
The mutation that survived in round 1 changes nothingBox PSI "turned off" read as none (N8 below) and "unsupported always none" (N9) both survive, and both are truly equivalent. State question"What happens when this runs again, stops half-way, or meets existing, old or empty state?" These are pure readers. The diff adds no cache, timer, write or module state, and the same host input gives the same output.
Tests and mutation checkBaseline:
Follow-ups (minor, none blocks the merge)
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
… exports after the rebase) Co-Authored-By: Claude Opus 5.5 <[email protected]>
#189) (#277) * fork seam check: every upstream file counted, allow list from main (#242 #189) The seam check only judged files listed in .github/fork-seams.json, so a fork line in any other upstream file passed; and it read that list from the working tree, so a pull request judged itself by the list it brought. - Every upstream file counts. From upstream (a base without the list), every file the merge-base has is upstream's. From a pull request's base, files named as the fork's or matched by the new "forkFiles" are the fork's own; a pattern that matches an upstream file fails the check from upstream. - "pending" names the 61 upstream files whose fork lines predate this rule: noted from upstream, and a pull request may change them but not grow them. - The list is read from git: --config-ref, else the base when it has the list, else the head (upstream has none). Never the working tree or the PR's head. - From main, a seam line main already has cannot be added a second time. - fork-follow refuses an upstream workflow named like the fork's before the seam check, so its report keeps the specific advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: no hidden upstream files, pending ceilings, stale-branch error Review round 1 of the seam check (bypass and state lenses): - An upstream file the change deletes or renames is refused, unless .github/fork-removed-workflows.txt lists it (or it is upstream's fork-*.yml, which fork-follow makes the fork delete). - "pending" maps each file to a ceiling of fork lines counted from upstream; fork-follow refuses a file above it and notes one below it. - pending now lists the three provider files main gained since; the 29 older fork lines in apps/server/src/serverSettings.ts are pinned in its seam entry until they move into apps/server/src/fork/. - A pull request run (base with the list, or --config-ref) refuses a base or merge-base without the list with one "update the branch" error. - A moved submodule pointer counts as a changed line; an unlisted upstream file may not lose or reorder lines either. - fork-follow refuses an upstream fork-*.yml before the seam check on the same-base path too, and its test checks the advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: a pending file below its ceiling is refused from upstream Round-2 state lens on #277: a ceiling left too high after fork lines move out is room for a later PR to swap an upstream line for a fork line (net zero on the PR, within the ceiling from upstream), and the 'lower its ceiling' note only lands in a nightly log nobody sees. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: packages/shared/package.json ceiling 28 (DS2 #284 added 4 exports after the rebase) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: after a rebase, a pending file below its ceiling is a note (#277 round 3) When upstream takes a fork line word for word, the rebase drops it, so the series falls below its "pending" ceiling and the after-rebase check refused it; lowering the ceiling first failed the check on the old base, so fork-follow was stuck. --after-rebase (fork-follow's second check only) turns below-ceiling into a note; the next run, from the new base, refuses it and a pull request lowers it. The refusal for a ceiling now names that fix instead of "put the change in a fork file", and the fork-follow report says "does not fit the seam list". Adds a ceiling+1 boundary test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: shorten comments to satisfy no-low-value-comments Cut two comments to four lines and drop PR numbers from two test comments. Meaning unchanged; no code change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: run the seam check and its tests on pull requests Add fork-seam-check.test.cjs to "Test the check" and a "Fork lines in upstream files" step that reads the seam list from the default branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: allow more than one DEFAULT_SHA when each is github.sha The seam-check step reads its list from the default branch too. The contract test now requires every DEFAULT_SHA to be github.sha instead of exactly one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: pending ceilings for four provider files changed on main after the rebase Usage refresher and usage history fixes added fork lines to ProviderRegistry.test.ts and three provider-core files after this branch's snapshot of main. Record them as pending so the check from upstream passes once this merges. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ce demand (DS2) (#284) * dynamic slots: capacity readings: swap, pressure, live total, per-piece demand (DS2) Readers that turn the machine's live state into the capacity rule's input: live total and available memory (container-capped), cores, swap, machine and box PSI, the macOS pressure level, and per-piece demand from cgroup v2 (v1 fallback). Everything goes through an injectable host and is tested from 60 shared fixture cases. A failed or half-read value is null/"unreadable", never free room. Adds capacityLevel (hysteresis state passed in). Not wired into the slot gate (DS3); no timer, cache or file written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * dynamic slots: capacity readings: review fixes (container cap, PSI off, file errors) - A failed read of cgroup.controllers or the v1 root memory.stat no longer reads as "no container": cgroup is "unreadable", so available memory and cores are null (never the host's numbers). - The cgroup v2 root's memory.max and cpu.max are read whenever they exist, so a container with systemd inside is capped too; /proc/self/cgroup is no longer read. A real host's root has no such files. - PSI built in but turned off (EOPNOTSUPP) reads as "no PSI" for the machine; everywhere else it stays a failed read. - capacityFileError sorts the real host's file errors, tested code by code (every error read as missing no longer passes). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#189) (#277) * fork seam check: every upstream file counted, allow list from main (#242 #189) The seam check only judged files listed in .github/fork-seams.json, so a fork line in any other upstream file passed; and it read that list from the working tree, so a pull request judged itself by the list it brought. - Every upstream file counts. From upstream (a base without the list), every file the merge-base has is upstream's. From a pull request's base, files named as the fork's or matched by the new "forkFiles" are the fork's own; a pattern that matches an upstream file fails the check from upstream. - "pending" names the 61 upstream files whose fork lines predate this rule: noted from upstream, and a pull request may change them but not grow them. - The list is read from git: --config-ref, else the base when it has the list, else the head (upstream has none). Never the working tree or the PR's head. - From main, a seam line main already has cannot be added a second time. - fork-follow refuses an upstream workflow named like the fork's before the seam check, so its report keeps the specific advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: no hidden upstream files, pending ceilings, stale-branch error Review round 1 of the seam check (bypass and state lenses): - An upstream file the change deletes or renames is refused, unless .github/fork-removed-workflows.txt lists it (or it is upstream's fork-*.yml, which fork-follow makes the fork delete). - "pending" maps each file to a ceiling of fork lines counted from upstream; fork-follow refuses a file above it and notes one below it. - pending now lists the three provider files main gained since; the 29 older fork lines in apps/server/src/serverSettings.ts are pinned in its seam entry until they move into apps/server/src/fork/. - A pull request run (base with the list, or --config-ref) refuses a base or merge-base without the list with one "update the branch" error. - A moved submodule pointer counts as a changed line; an unlisted upstream file may not lose or reorder lines either. - fork-follow refuses an upstream fork-*.yml before the seam check on the same-base path too, and its test checks the advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: a pending file below its ceiling is refused from upstream Round-2 state lens on #277: a ceiling left too high after fork lines move out is room for a later PR to swap an upstream line for a fork line (net zero on the PR, within the ceiling from upstream), and the 'lower its ceiling' note only lands in a nightly log nobody sees. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: packages/shared/package.json ceiling 28 (DS2 #284 added 4 exports after the rebase) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: after a rebase, a pending file below its ceiling is a note (#277 round 3) When upstream takes a fork line word for word, the rebase drops it, so the series falls below its "pending" ceiling and the after-rebase check refused it; lowering the ceiling first failed the check on the old base, so fork-follow was stuck. --after-rebase (fork-follow's second check only) turns below-ceiling into a note; the next run, from the new base, refuses it and a pull request lowers it. The refusal for a ceiling now names that fix instead of "put the change in a fork file", and the fork-follow report says "does not fit the seam list". Adds a ceiling+1 boundary test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: shorten comments to satisfy no-low-value-comments Cut two comments to four lines and drop PR numbers from two test comments. Meaning unchanged; no code change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: run the seam check and its tests on pull requests Add fork-seam-check.test.cjs to "Test the check" and a "Fork lines in upstream files" step that reads the seam list from the default branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: allow more than one DEFAULT_SHA when each is github.sha The seam-check step reads its list from the default branch too. The contract test now requires every DEFAULT_SHA to be github.sha instead of exactly one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: pending ceilings for four provider files changed on main after the rebase Usage refresher and usage history fixes added fork lines to ProviderRegistry.test.ts and three provider-core files after this branch's snapshot of main. Record them as pending so the check from upstream passes once this merges. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ce demand (DS2) (#284) * dynamic slots: capacity readings: swap, pressure, live total, per-piece demand (DS2) Readers that turn the machine's live state into the capacity rule's input: live total and available memory (container-capped), cores, swap, machine and box PSI, the macOS pressure level, and per-piece demand from cgroup v2 (v1 fallback). Everything goes through an injectable host and is tested from 60 shared fixture cases. A failed or half-read value is null/"unreadable", never free room. Adds capacityLevel (hysteresis state passed in). Not wired into the slot gate (DS3); no timer, cache or file written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * dynamic slots: capacity readings: review fixes (container cap, PSI off, file errors) - A failed read of cgroup.controllers or the v1 root memory.stat no longer reads as "no container": cgroup is "unreadable", so available memory and cores are null (never the host's numbers). - The cgroup v2 root's memory.max and cpu.max are read whenever they exist, so a container with systemd inside is capped too; /proc/self/cgroup is no longer read. A real host's root has no such files. - PSI built in but turned off (EOPNOTSUPP) reads as "no PSI" for the machine; everywhere else it stays a failed read. - capacityFileError sorts the real host's file errors, tested code by code (every error read as missing no longer passes). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#189) (#277) * fork seam check: every upstream file counted, allow list from main (#242 #189) The seam check only judged files listed in .github/fork-seams.json, so a fork line in any other upstream file passed; and it read that list from the working tree, so a pull request judged itself by the list it brought. - Every upstream file counts. From upstream (a base without the list), every file the merge-base has is upstream's. From a pull request's base, files named as the fork's or matched by the new "forkFiles" are the fork's own; a pattern that matches an upstream file fails the check from upstream. - "pending" names the 61 upstream files whose fork lines predate this rule: noted from upstream, and a pull request may change them but not grow them. - The list is read from git: --config-ref, else the base when it has the list, else the head (upstream has none). Never the working tree or the PR's head. - From main, a seam line main already has cannot be added a second time. - fork-follow refuses an upstream workflow named like the fork's before the seam check, so its report keeps the specific advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: no hidden upstream files, pending ceilings, stale-branch error Review round 1 of the seam check (bypass and state lenses): - An upstream file the change deletes or renames is refused, unless .github/fork-removed-workflows.txt lists it (or it is upstream's fork-*.yml, which fork-follow makes the fork delete). - "pending" maps each file to a ceiling of fork lines counted from upstream; fork-follow refuses a file above it and notes one below it. - pending now lists the three provider files main gained since; the 29 older fork lines in apps/server/src/serverSettings.ts are pinned in its seam entry until they move into apps/server/src/fork/. - A pull request run (base with the list, or --config-ref) refuses a base or merge-base without the list with one "update the branch" error. - A moved submodule pointer counts as a changed line; an unlisted upstream file may not lose or reorder lines either. - fork-follow refuses an upstream fork-*.yml before the seam check on the same-base path too, and its test checks the advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: a pending file below its ceiling is refused from upstream Round-2 state lens on #277: a ceiling left too high after fork lines move out is room for a later PR to swap an upstream line for a fork line (net zero on the PR, within the ceiling from upstream), and the 'lower its ceiling' note only lands in a nightly log nobody sees. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: packages/shared/package.json ceiling 28 (DS2 #284 added 4 exports after the rebase) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: after a rebase, a pending file below its ceiling is a note (#277 round 3) When upstream takes a fork line word for word, the rebase drops it, so the series falls below its "pending" ceiling and the after-rebase check refused it; lowering the ceiling first failed the check on the old base, so fork-follow was stuck. --after-rebase (fork-follow's second check only) turns below-ceiling into a note; the next run, from the new base, refuses it and a pull request lowers it. The refusal for a ceiling now names that fix instead of "put the change in a fork file", and the fork-follow report says "does not fit the seam list". Adds a ceiling+1 boundary test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: shorten comments to satisfy no-low-value-comments Cut two comments to four lines and drop PR numbers from two test comments. Meaning unchanged; no code change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: run the seam check and its tests on pull requests Add fork-seam-check.test.cjs to "Test the check" and a "Fork lines in upstream files" step that reads the seam list from the default branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: allow more than one DEFAULT_SHA when each is github.sha The seam-check step reads its list from the default branch too. The contract test now requires every DEFAULT_SHA to be github.sha instead of exactly one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: pending ceilings for four provider files changed on main after the rebase Usage refresher and usage history fixes added fork lines to ProviderRegistry.test.ts and three provider-core files after this branch's snapshot of main. Record them as pending so the check from upstream passes once this merges. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ce demand (DS2) (#284) * dynamic slots: capacity readings: swap, pressure, live total, per-piece demand (DS2) Readers that turn the machine's live state into the capacity rule's input: live total and available memory (container-capped), cores, swap, machine and box PSI, the macOS pressure level, and per-piece demand from cgroup v2 (v1 fallback). Everything goes through an injectable host and is tested from 60 shared fixture cases. A failed or half-read value is null/"unreadable", never free room. Adds capacityLevel (hysteresis state passed in). Not wired into the slot gate (DS3); no timer, cache or file written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * dynamic slots: capacity readings: review fixes (container cap, PSI off, file errors) - A failed read of cgroup.controllers or the v1 root memory.stat no longer reads as "no container": cgroup is "unreadable", so available memory and cores are null (never the host's numbers). - The cgroup v2 root's memory.max and cpu.max are read whenever they exist, so a container with systemd inside is capped too; /proc/self/cgroup is no longer read. A real host's root has no such files. - PSI built in but turned off (EOPNOTSUPP) reads as "no PSI" for the machine; everywhere else it stays a failed read. - capacityFileError sorts the real host's file errors, tested code by code (every error read as missing no longer passes). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#189) (#277) * fork seam check: every upstream file counted, allow list from main (#242 #189) The seam check only judged files listed in .github/fork-seams.json, so a fork line in any other upstream file passed; and it read that list from the working tree, so a pull request judged itself by the list it brought. - Every upstream file counts. From upstream (a base without the list), every file the merge-base has is upstream's. From a pull request's base, files named as the fork's or matched by the new "forkFiles" are the fork's own; a pattern that matches an upstream file fails the check from upstream. - "pending" names the 61 upstream files whose fork lines predate this rule: noted from upstream, and a pull request may change them but not grow them. - The list is read from git: --config-ref, else the base when it has the list, else the head (upstream has none). Never the working tree or the PR's head. - From main, a seam line main already has cannot be added a second time. - fork-follow refuses an upstream workflow named like the fork's before the seam check, so its report keeps the specific advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: no hidden upstream files, pending ceilings, stale-branch error Review round 1 of the seam check (bypass and state lenses): - An upstream file the change deletes or renames is refused, unless .github/fork-removed-workflows.txt lists it (or it is upstream's fork-*.yml, which fork-follow makes the fork delete). - "pending" maps each file to a ceiling of fork lines counted from upstream; fork-follow refuses a file above it and notes one below it. - pending now lists the three provider files main gained since; the 29 older fork lines in apps/server/src/serverSettings.ts are pinned in its seam entry until they move into apps/server/src/fork/. - A pull request run (base with the list, or --config-ref) refuses a base or merge-base without the list with one "update the branch" error. - A moved submodule pointer counts as a changed line; an unlisted upstream file may not lose or reorder lines either. - fork-follow refuses an upstream fork-*.yml before the seam check on the same-base path too, and its test checks the advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: a pending file below its ceiling is refused from upstream Round-2 state lens on #277: a ceiling left too high after fork lines move out is room for a later PR to swap an upstream line for a fork line (net zero on the PR, within the ceiling from upstream), and the 'lower its ceiling' note only lands in a nightly log nobody sees. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: packages/shared/package.json ceiling 28 (DS2 #284 added 4 exports after the rebase) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: after a rebase, a pending file below its ceiling is a note (#277 round 3) When upstream takes a fork line word for word, the rebase drops it, so the series falls below its "pending" ceiling and the after-rebase check refused it; lowering the ceiling first failed the check on the old base, so fork-follow was stuck. --after-rebase (fork-follow's second check only) turns below-ceiling into a note; the next run, from the new base, refuses it and a pull request lowers it. The refusal for a ceiling now names that fix instead of "put the change in a fork file", and the fork-follow report says "does not fit the seam list". Adds a ceiling+1 boundary test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: shorten comments to satisfy no-low-value-comments Cut two comments to four lines and drop PR numbers from two test comments. Meaning unchanged; no code change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: run the seam check and its tests on pull requests Add fork-seam-check.test.cjs to "Test the check" and a "Fork lines in upstream files" step that reads the seam list from the default branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: allow more than one DEFAULT_SHA when each is github.sha The seam-check step reads its list from the default branch too. The contract test now requires every DEFAULT_SHA to be github.sha instead of exactly one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: pending ceilings for four provider files changed on main after the rebase Usage refresher and usage history fixes added fork lines to ProviderRegistry.test.ts and three provider-core files after this branch's snapshot of main. Record them as pending so the check from upstream passes once this merges. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ce demand (DS2) (#284) * dynamic slots: capacity readings: swap, pressure, live total, per-piece demand (DS2) Readers that turn the machine's live state into the capacity rule's input: live total and available memory (container-capped), cores, swap, machine and box PSI, the macOS pressure level, and per-piece demand from cgroup v2 (v1 fallback). Everything goes through an injectable host and is tested from 60 shared fixture cases. A failed or half-read value is null/"unreadable", never free room. Adds capacityLevel (hysteresis state passed in). Not wired into the slot gate (DS3); no timer, cache or file written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * dynamic slots: capacity readings: review fixes (container cap, PSI off, file errors) - A failed read of cgroup.controllers or the v1 root memory.stat no longer reads as "no container": cgroup is "unreadable", so available memory and cores are null (never the host's numbers). - The cgroup v2 root's memory.max and cpu.max are read whenever they exist, so a container with systemd inside is capped too; /proc/self/cgroup is no longer read. A real host's root has no such files. - PSI built in but turned off (EOPNOTSUPP) reads as "no PSI" for the machine; everywhere else it stays a failed read. - capacityFileError sorts the real host's file errors, tested code by code (every error read as missing no longer passes). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#189) (#277) * fork seam check: every upstream file counted, allow list from main (#242 #189) The seam check only judged files listed in .github/fork-seams.json, so a fork line in any other upstream file passed; and it read that list from the working tree, so a pull request judged itself by the list it brought. - Every upstream file counts. From upstream (a base without the list), every file the merge-base has is upstream's. From a pull request's base, files named as the fork's or matched by the new "forkFiles" are the fork's own; a pattern that matches an upstream file fails the check from upstream. - "pending" names the 61 upstream files whose fork lines predate this rule: noted from upstream, and a pull request may change them but not grow them. - The list is read from git: --config-ref, else the base when it has the list, else the head (upstream has none). Never the working tree or the PR's head. - From main, a seam line main already has cannot be added a second time. - fork-follow refuses an upstream workflow named like the fork's before the seam check, so its report keeps the specific advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: no hidden upstream files, pending ceilings, stale-branch error Review round 1 of the seam check (bypass and state lenses): - An upstream file the change deletes or renames is refused, unless .github/fork-removed-workflows.txt lists it (or it is upstream's fork-*.yml, which fork-follow makes the fork delete). - "pending" maps each file to a ceiling of fork lines counted from upstream; fork-follow refuses a file above it and notes one below it. - pending now lists the three provider files main gained since; the 29 older fork lines in apps/server/src/serverSettings.ts are pinned in its seam entry until they move into apps/server/src/fork/. - A pull request run (base with the list, or --config-ref) refuses a base or merge-base without the list with one "update the branch" error. - A moved submodule pointer counts as a changed line; an unlisted upstream file may not lose or reorder lines either. - fork-follow refuses an upstream fork-*.yml before the seam check on the same-base path too, and its test checks the advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: a pending file below its ceiling is refused from upstream Round-2 state lens on #277: a ceiling left too high after fork lines move out is room for a later PR to swap an upstream line for a fork line (net zero on the PR, within the ceiling from upstream), and the 'lower its ceiling' note only lands in a nightly log nobody sees. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: packages/shared/package.json ceiling 28 (DS2 #284 added 4 exports after the rebase) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: after a rebase, a pending file below its ceiling is a note (#277 round 3) When upstream takes a fork line word for word, the rebase drops it, so the series falls below its "pending" ceiling and the after-rebase check refused it; lowering the ceiling first failed the check on the old base, so fork-follow was stuck. --after-rebase (fork-follow's second check only) turns below-ceiling into a note; the next run, from the new base, refuses it and a pull request lowers it. The refusal for a ceiling now names that fix instead of "put the change in a fork file", and the fork-follow report says "does not fit the seam list". Adds a ceiling+1 boundary test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: shorten comments to satisfy no-low-value-comments Cut two comments to four lines and drop PR numbers from two test comments. Meaning unchanged; no code change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: run the seam check and its tests on pull requests Add fork-seam-check.test.cjs to "Test the check" and a "Fork lines in upstream files" step that reads the seam list from the default branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: allow more than one DEFAULT_SHA when each is github.sha The seam-check step reads its list from the default branch too. The contract test now requires every DEFAULT_SHA to be github.sha instead of exactly one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: pending ceilings for four provider files changed on main after the rebase Usage refresher and usage history fixes added fork lines to ProviderRegistry.test.ts and three provider-core files after this branch's snapshot of main. Record them as pending so the check from upstream passes once this merges. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ce demand (DS2) (#284) * dynamic slots: capacity readings: swap, pressure, live total, per-piece demand (DS2) Readers that turn the machine's live state into the capacity rule's input: live total and available memory (container-capped), cores, swap, machine and box PSI, the macOS pressure level, and per-piece demand from cgroup v2 (v1 fallback). Everything goes through an injectable host and is tested from 60 shared fixture cases. A failed or half-read value is null/"unreadable", never free room. Adds capacityLevel (hysteresis state passed in). Not wired into the slot gate (DS3); no timer, cache or file written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * dynamic slots: capacity readings: review fixes (container cap, PSI off, file errors) - A failed read of cgroup.controllers or the v1 root memory.stat no longer reads as "no container": cgroup is "unreadable", so available memory and cores are null (never the host's numbers). - The cgroup v2 root's memory.max and cpu.max are read whenever they exist, so a container with systemd inside is capped too; /proc/self/cgroup is no longer read. A real host's root has no such files. - PSI built in but turned off (EOPNOTSUPP) reads as "no PSI" for the machine; everywhere else it stays a failed read. - capacityFileError sorts the real host's file errors, tested code by code (every error read as missing no longer passes). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#189) (#277) * fork seam check: every upstream file counted, allow list from main (#242 #189) The seam check only judged files listed in .github/fork-seams.json, so a fork line in any other upstream file passed; and it read that list from the working tree, so a pull request judged itself by the list it brought. - Every upstream file counts. From upstream (a base without the list), every file the merge-base has is upstream's. From a pull request's base, files named as the fork's or matched by the new "forkFiles" are the fork's own; a pattern that matches an upstream file fails the check from upstream. - "pending" names the 61 upstream files whose fork lines predate this rule: noted from upstream, and a pull request may change them but not grow them. - The list is read from git: --config-ref, else the base when it has the list, else the head (upstream has none). Never the working tree or the PR's head. - From main, a seam line main already has cannot be added a second time. - fork-follow refuses an upstream workflow named like the fork's before the seam check, so its report keeps the specific advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: no hidden upstream files, pending ceilings, stale-branch error Review round 1 of the seam check (bypass and state lenses): - An upstream file the change deletes or renames is refused, unless .github/fork-removed-workflows.txt lists it (or it is upstream's fork-*.yml, which fork-follow makes the fork delete). - "pending" maps each file to a ceiling of fork lines counted from upstream; fork-follow refuses a file above it and notes one below it. - pending now lists the three provider files main gained since; the 29 older fork lines in apps/server/src/serverSettings.ts are pinned in its seam entry until they move into apps/server/src/fork/. - A pull request run (base with the list, or --config-ref) refuses a base or merge-base without the list with one "update the branch" error. - A moved submodule pointer counts as a changed line; an unlisted upstream file may not lose or reorder lines either. - fork-follow refuses an upstream fork-*.yml before the seam check on the same-base path too, and its test checks the advice. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seam check: a pending file below its ceiling is refused from upstream Round-2 state lens on #277: a ceiling left too high after fork lines move out is room for a later PR to swap an upstream line for a fork line (net zero on the PR, within the ceiling from upstream), and the 'lower its ceiling' note only lands in a nightly log nobody sees. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: packages/shared/package.json ceiling 28 (DS2 #284 added 4 exports after the rebase) Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: after a rebase, a pending file below its ceiling is a note (#277 round 3) When upstream takes a fork line word for word, the rebase drops it, so the series falls below its "pending" ceiling and the after-rebase check refused it; lowering the ceiling first failed the check on the old base, so fork-follow was stuck. --after-rebase (fork-follow's second check only) turns below-ceiling into a note; the next run, from the new base, refuses it and a pull request lowers it. The refusal for a ceiling now names that fix instead of "put the change in a fork file", and the fork-follow report says "does not fit the seam list". Adds a ceiling+1 boundary test. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-seams: shorten comments to satisfy no-low-value-comments Cut two comments to four lines and drop PR numbers from two test comments. Meaning unchanged; no code change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: run the seam check and its tests on pull requests Add fork-seam-check.test.cjs to "Test the check" and a "Fork lines in upstream files" step that reads the seam list from the default branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork-checks: allow more than one DEFAULT_SHA when each is github.sha The seam-check step reads its list from the default branch too. The contract test now requires every DEFAULT_SHA to be github.sha instead of exactly one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fork seams: pending ceilings for four provider files changed on main after the rebase Usage refresher and usage history fixes added fork lines to ProviderRegistry.test.ts and three provider-core files after this branch's snapshot of main. Record them as pending so the check from upstream passes once this merges. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.