Commit Graph
106 Commits
Author SHA1 Message Date
timothy 157d16df67 fix(819): the Docker stage needs the git BINARY excluded too, not just the index
Round 8 found a BLOCKER, and it was my verification that was wrong rather than
an argument. The previous commit re-armed `npm test` in the web-build stage and
excluded the one file that needs a git CHECKOUT. It did not exclude the file
added in round 6 that needs the git BINARY: `trackedSourceFiles`' real-repository
tests shell out to `git` to prove the derivation by executing it, and
`node:22-bookworm-slim` ships no git. So `docker build` would have failed on
every push to `main` and every `v*` tag — no image ships.

Why I did not catch it: every "gitless replica" I ran deleted `.git` and left the
git binary on `PATH`. That reproduces one of the two preconditions. Re-measured
with `PATH` stripped, the previous head gives `spawnSync git ENOENT`,
`Test Files 1 failed | 116 passed`. The Dockerfile comment stated the right
premise — "no `.git`, AND node:22-bookworm-slim ships no git binary" — two lines
above the line that only acted on the first half.

The real-git block is now its own file, `trackedSourceFiles.realgit.test.ts`, so
excluding it costs two tests rather than the thirteen injected-runner ones that
run fine with no git at all. Both exclusions are named in the Dockerfile with
their DIFFERENT reasons, and with the instruction to verify any change there with
the binary off `PATH`. MEASURED in a replica with neither `.git` nor `git`:
117 files / 1225 tests pass, lint, typecheck and build all exit 0.

Also from round 8:
- `docs/testing.md`'s row asserted the suite "cannot run against an exported tree
  with no index" and that the Dockerfile "no longer runs it" — both false at the
  previous head. It now distinguishes the checkout requirement from the binary
  requirement, which is the distinction the blocker turned on.
- Two clauses this PR added had no proof and MEASURED green when disarmed: the
  trailing-slash restriction in `unaccountedWalkedPaths` (without it every
  `others` entry becomes a prefix mask) and the plugin's dedupe. Both now have
  fixtures, and both mutations redden by name.
- The dedupe's stated rationale was wrong: duplicates appear on both sides of the
  ratio the floor computes, so they cancel. Re-stated as tidiness, with the
  measurement, and "three times" corrected to two-or-three (a both-added conflict
  has two stages).
- Three JSDoc blocks were stacked above one function, so two of them documented
  functions defined 15 and 50 lines below and attached to the wrong ones. Pure
  reordering, plus the blank lines that were detaching them.
- `vite-env.d.ts` named the wrong mechanism for its loud-failure claim: a renamed
  field yields an empty Set, caught by the anti-vacuity floor rather than by a
  throw at first read.
- The Dockerfile no longer hardcodes a test-file count that nothing reddens on.

Refs: #819
2026-08-29 05:12:23 +02:00
timothy e3a3c46f1d fix(819): pin the round-6 mechanism, and stop the Docker stage dropping 117 files
Round 7 found no blocker and reported the cancellation class terminated for
every single-site edit it could construct — 16 mutations, all caught. What it
found instead was proof debt on the round-6 fix itself, plus two environment
defects.

- The `others` term of the new cross-check had no clause proof. MEASURED:
  removing it left all 1265 tests green, because `others` is EMPTY on any clean
  checkout — the only tree CI sees — and with it gone an ordinary untracked
  scratch file reddens the developer's checkout while CI stays green. That is
  the #778/#806 shape #819 exists to remove, reintroduced by #819's own fix.
  Extracted as `unaccountedWalkedPaths` and pinned by fixtures, the load-bearing
  case being "in `others` only -> not returned".
- The anti-vacuity floor shipped as TWO identical assertions side by side, so
  deleting either left the suite green — `duplicate guards mask each other`,
  and the comment claimed a clause proof that measurement refuted. One
  assertion now, over `populationIsDegenerate`, with a four-case fixture table.
  MEASURED: `return false` now reddens by name; before, it was green.
- The new real-git tests were not hermetic: MEASURED 2 failures under a global
  `commit.gpgsign = true`, which many people set. The commit was unnecessary —
  `ls-files` reads the INDEX — so the fixture now stages without committing, and
  the non-repo test pins `GIT_CEILING_DIRECTORIES` so it does not depend on
  where TMPDIR points. Green under both configurations.
- The cross-check's message named one cause and MEASURED two more: a disk/index
  spelling divergence (where the sibling test gives the better diagnosis) and an
  untracked NESTED git repository, which `ls-files --others` reports as a
  directory rather than as files. Both named now, and a trailing-slash `others`
  entry covers its subtree so an embedded repo is not a permanent spurious red.
- The Dockerfile threw away 117 test files (~1228 tests) that run fine gitless
  in order to accommodate one that cannot. It now excludes that single file
  instead. MEASURED in an exact gitless replica: 117 files / 1228 tests pass,
  lint, typecheck and build all exit 0.

Residuals, now three rather than two: the surviving hole is a two-site PARTITION
inside the derivation — moving paths out of `tracked` and into `others` preserves
the union the cross-check compares, so it is invisible to any consumer. MEASURED
green with a planted call site. Nothing a consumer can compute closes it; a
derivation that lies consistently in both outputs is answerable only by testing
the derivation, which is what the real-git tests are for. Stated in the guard, in
`docs/guard-inventory.md` and in the record rather than left implied.

Also: the plugin deduplicates `tracked` (a merge conflict emits an unmerged path
once per stage), its error message drops the "guards" plural retracted earlier
elsewhere, `vite-env.d.ts` records that it is a hand-written mirror with no
compile-time link, the record's enumeration was four items for five rounds
(round 2's shared scope was missing), and the last undated "previous head"
references are now issue-referenced.

Refs: #819
Decisions-Edit: yes
2026-08-29 05:12:23 +02:00
timothy 8081b9b9d9 fix(819): make the scope restatement closed-form, and state that as the criterion
Round 5's cold review found the class a fifth time, and it was a BLOCKER rather
than a narrowing. The restatement inlined both documented components but computed
its filename with `basename(path)` — the same helper `isInScopeSourcePath` calls
— so `basename` sat on both sides of the comparison and cancelled, exactly as the
filename predicate did in round 4 and the path table in round 3.

MEASURED on the previous head: teaching `basename` to return '' for paths four
segments deep removed 15 real tracked files, and a `pageSize: 100` planted in one
of them (`src/builder/rules/compile.ts`) went completely unseen — 36/36 green.
Reproduced here before fixing. The guard did not merely see less; it stopped
working and reported success. An `index.ts` variant hid 3 more.

What actually terminates this, and why the previous four attempts did not: each
one restated something and left something else SHARED, and "restate the scope"
gives no way to tell whether you are done. The criterion is now a checkable
property, written where the next author will edit:

  the restatement must be CLOSED FORM over the raw path — it may share NO helper,
  at ANY depth, with `isInScopeSourcePath`.

`basename` is why it is phrased that way: it reads as plumbing rather than as
policy, which is precisely why it got shared. The inlined `lastIndexOf` carries a
"do not tidy this into basename(path)" note for the same reason. Both mutations
above now redden `the shared scope predicate is EXACTLY its two documented
components`, including with the rogue site planted.

The previous head also ASSERTED that its residuals were complete, which this
blocker falsifies — a single-site edit to a shared helper narrowed scope
invisibly. Both the code comment and `docs/guard-inventory.md` now record the
three retracted mechanisms with what each one measured, and state the two
residuals as residuals rather than as closure.

Also from round 5:
- The anti-vacuity floor fired at 15 unstaged in-scope deletions with a bare
  assertion message, inside a test whose own failure text tells the reader to
  rename files or widen the glob. Wrong cause, and the #806 shape. It now carries
  its own message naming deletions first and a degenerate plugin result second.
- The Dockerfile's `docs_only` claim stated an accident as the rule.
  `ci-detect-docs-only.sh` classifies by PATH SHAPE (`docs/` or `*.md`), not by
  directory, so "any `web/**` path is not docs-only" is true only because no
  `web/*.md` is tracked. Restated, with `design-system/` named too.
- `ABSENT_FROM_DISK` emptied is an uncaught mutation. Recorded as a residual with
  its DIRECTION, which is what makes it tolerable: an empty set makes the guard
  red on an unstaged deletion, never blind.
- The decision record's `signals:` line carried neither the bounded exception's
  vocabulary nor #819, so the record's discovery surface did not carry the change
  its `rule:` makes.
- A worked example still named `src/api/generated/v1.ts`; the tracked file is
  `v1.d.ts`. Swept both tables this time rather than the one site.

Refs: #819
Decisions-Edit: yes
2026-08-29 05:12:23 +02:00
timothy a3abfa7234 fix(819): restate BOTH halves of the scope decomposition, not one
Round 4's cold review found the recurring class had moved one level down rather
than terminated. The decomposition restated the `/generated/` half inline but
DELEGATED the filename half to `isScannableSourceFileName` — the same function
`isInScopeSourcePath` calls — putting it on both sides of the comparison, where
it cancels algebraically. Exactly the cancellation that hid the walk-vs-index
narrowing in round 2 and the directory narrowing in round 3.

MEASURED survivors on the previous head, whole suite, no filter: adding
`&& !name.endsWith('.d.ts')` to that predicate dropped a real tracked file
(`src/vite-env.d.ts`) and a term skipping lowercase-initial `.tsx` dropped
eleven — 8% of the in-scope SPA — both with all 1259 tests green. Reproduced
here before fixing. Both now redden `the shared scope predicate is EXACTLY its
two documented components`.

The fix is to restate the filename predicate inline too, so the decomposition
delegates nothing. What that is, said plainly instead of overclaimed: a verbatim
restatement of a FIXED-SIZE predicate checked against itself every run — the
`MARKED_JOBS` shape the record already blesses — which does not decay as the SPA
grows, unlike a list of members or example paths. Two residuals are now stated
rather than implied: an author editing the predicate AND the restatement together
passes deliberately, the two-site edit being the signal; and a term matching zero
tracked paths survives until the day it first matches one. So the claim is "a
term becomes visible the moment it affects a tracked path", not the previous
"regardless of what it excludes", which round 4 measured false.

Also from round 4:
- `docs/guard-inventory.md` still named the table as the proof — the mechanism
  the previous commit retracted in code but did not sweep out of the docs. It now
  describes the decomposition, why both halves are restated, and the residual.
  The same retracted phrase in the walk-side code comment is gone too; grepping
  the subject ("table of cases") found both, which is the sweep that was missed.
- The anti-vacuity floor was bounded by every tracked path under `src/` (260),
  a denominator that grows with test files while the numerator counts sources.
  It is now bounded by the IN-SCOPE count, so at most a tenth of those may be
  absent from disk before the plugin result reads as degenerate.
- The Dockerfile comment named two gates on `Test SPA` and argued only one; the
  `docs_only` arm holds because `ci-detect-docs-only.sh` classifies any `web/**`
  path as not-docs-only, so a tree taking that skip has an SPA subtree already
  tested.
- "~260 SPA sources" read as the guarded population in both the record and the
  guard comment; it is every tracked path under `web/src/`, of which ~141 are in
  scope. A worked example named a file that does not exist.

Refs: #819
Decisions-Edit: yes
2026-08-29 05:12:23 +02:00
timothy d8c29fd11e fix(819): mutation-proof the fix that closed the blind spot
Round 2's cold review found the previous commit had reproduced, one layer up,
the exact defect it was fixing: `expectedTrackedSources` — the function that
closes the dot-directory / case-divergence hole — had no clause proof. Measured:
replacing its body with `return []` left all 1249 tests green while the hole it
exists to catch went undetected, and deleting the `absentFromDisk` subtraction
(the whole point of the plugin's second field) was green too.

Three proofs added, each MEASURED red against the mutation it names:
- a direct fixture test pinning all four terms of `expectedTrackedSources`
  (`return []` and dropping the subtraction now each redden it);
- an anti-vacuity floor INSIDE the shortfall test, so an empty expected set
  cannot pass the comparison it feeds;
- a table pinning `isInScopeSourcePath`. That one closes a hole the review
  measured separately: the walk and the index side applied the SAME scope
  filters, so scope cancelled out of the equality between them — excluding
  `src/components/` dropped 13 real files with the whole suite green. The two
  copies of that predicate are now ONE named function, and the table is what
  reddens a change to it, since no assertion comparing the two sides can.

Also corrected, all found by the same review:
- The comment justifying the `absentFromDisk` subtraction cited
  `scripts/tests/tracked_files.py` as stating the rule it follows. That module
  states the OPPOSITE and enforces it with `assert absolute.is_file()`. It is
  now recorded as a deliberate DEVIATION with its reason (that population is a
  handful of hooks where a missing file is remarkable; this one is ~260 SPA
  sources a developer edits continuously), rather than as an instance of it.
- `absentFromDisk` is named for what it measures — no READABLE file — not for
  its common cause. `existsSync` follows links, so a tracked BROKEN SYMLINK is a
  committed, permanent state landing in that set, which "deleted in the working
  tree" licensed subtracting without saying so.
- The Dockerfile comment claimed the `needs: [test, …]` edge alone guarantees no
  image ships from an untested tree. `Test SPA` is also gated on `docs_only` and
  the #420 revalidate skip, and `build` is not gated on `revalidate`; the
  property survives via #420's byte-identical-tree argument, which the comment
  now names instead of implying the wrong mechanism.
- `docs/testing.md`'s web row was falsified by this PR: `web/vite-plugins/**` is
  a third collection root, and `npm test` now hard-requires a git checkout.
- Two prose slips: guard-inventory counted "the first of those" onto the wrong
  file, and both `docs/spa-conventions.md` and the Dockerfile said "guards"
  plural where exactly one derives a population.

Rebased onto 4b3f6f6c9 (#872), which rewrote `docs/guard-inventory.md`.

refs #819
2026-08-29 05:12:23 +02:00
timothy eedf56b8ad fix(819): close the review's blocker and the blind spot it measured
Three defects found by cold review of 9e5c288db, all reproduced here before
fixing and re-measured after.

BLOCKER — the Docker image build failed on the previous commit.
`docker/Dockerfile`'s web-build stage copies only `web/` and `design-system/`,
so it has no `.git`, and `node:22-bookworm-slim` ships no git binary. Its
`RUN` line ran `npm test -- --run`, which loads the virtual module, which shells
out to git and throws by design. Measured in an exact gitless replica of the
stage: `Test Files 1 failed | 117 passed`, against `117 passed` on the parent.
`build` is gated `needs: [test, migrations, scan]` and the `test` job — which
carries no `if:`, so it runs on PR, main and tag alike — already runs the
identical suite on a real checkout, so the Dockerfile's run was duplicated work
and is dropped rather than propped up with a `.git` copy and a git install. The
previous commit message asserted this build was safe on the strength of having
verified `vite build` alone; the test step on the same line was never measured.

HIGH — a tracked file could still leave the population silently, and one way was
a REGRESSION. `import.meta.glob` matches no dotfile or dot-directory, and on
`core.ignorecase=true` a disk spelling that diverges from the index spelling
(`caseprobe.tsx` vs `CaseProbe.tsx`) is tracked, present, and invisible to the
intersection — measured blind here, and measured CAUGHT by the parent commit.
The stated residual named only the deleted-file case, so the prose claimed a
completeness the code did not have. Fixed by asserting the other direction: the
plugin now reports which tracked paths are absent from disk, and the guard
requires every tracked, on-disk, in-scope path to have reached the scanner. A
mid-edit deletion stays tolerated — measured, still green — because that is
transient, while a hole is now named and red. This is the rule
`scripts/tests/tracked_files.py` already states for the Python derivations:
existence is ASSERTED, never filtered.

MEDIUM — the clause proof was fixture-only. Every clause test drove
`listSourceFilesFrom` with injected inputs, so `... && tracked.size < 10` was
live over the 1-2 entry fixtures and dead over the real 260-path index: the fix
fully regressed, suite green. Measured. Added a liveness test that drives the
REAL glob and REAL index with one synthetic key. That mutation now reddens it,
and disarming the clause outright reddens two named tests.

Also: the plugin refuses instead of guessing when `configResolved` never ran
(a wrong root was a silent wrong answer), its doc comment states the `src/`-only
pathspec so a future caller cannot inherit a truncated population, and git's
stderr is piped so the framed error is the only message.

Docs: `docs/spa-conventions.md` §1 gains the `web/vite-plugins/` layout entry;
`docs/guard-inventory.md`'s hand-written TS/C# list gains the fourth file the
review noted it had already gone stale against, and the row's Notes no longer
overstate the population as "`git ls-files`" when it is the walk intersected
with the index.

refs #819
2026-08-29 05:12:23 +02:00
timothy 32747a067e docs(445): note the ci-image-pin length guard in the rebase-trap warning
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 16s
PR Gates / CI image pin matches docker/ci (pull_request) Failing after 16s
PR Gates / Docs update reminder (pull_request) Successful in 25s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 11s
PR Gates / decisions lifecycle (pull_request) Successful in 23s
Build CI Toolchain Image / Build & push CI image (push) Successful in 1m4s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 17m38s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 18m48s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 23m19s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Second pin-recovery cycle on this branch — main moved twice during review and each
rebase rewrites the sha of the commit that touched docker/ci. Records that #598 now
length-checks the pin at exactly 7 chars, which turns a locally-computed 8-char
`git rev-parse --short` into a loud gate failure instead of a confusing
manifest-unknown at image-pull time. That guard came from #594, filed by this
session after hitting exactly that ambiguity.

This commit also IS the recovery: it touches docker/ci, so ci-image.yml tags it and
the pin can be re-pointed in the follow-up commit.

Refs #445 #594
2026-07-25 14:29:27 +02:00
timothy 5dd0b147e8 docs(445): record that rebasing invalidates the CI toolchain image pin
Hit this for real on this branch. `ci-image-pin` went red after a rebase that
was otherwise clean, and the failure is confusing on three counts:

  - the pin must equal the short sha of the commit that touched docker/ci, and a
    rebase REWRITES that sha (e9fd26f6 -> 9130274c here);
  - the pin still resolves to a real commit and the tagged image still exists in
    the registry, so nothing looks broken;
  - the force-push does NOT republish: ci-image.yml filters on
    `paths: docker/ci/**`, and a rebase that leaves the Dockerfile's content
    unchanged produces no diff for that path.

And it cannot be fixed by re-dispatching ci-image.yml, because that tags
`git rev-parse --short HEAD` — the branch HEAD, not the commit that touched
docker/ci. The two coincide only when the docker/ci commit IS HEAD, which is why
the original two-step worked and the post-rebase state does not.

Recorded in docs/ci-cd.md with the recovery, plus the cheaper lesson: land a
toolchain-image change on its OWN branch first, so the consuming branch never
carries the docker/ci commit through a rebase.

This commit is also the recovery itself — it touches docker/ci, so it becomes the
commit ci-image.yml tags, restoring the pin dance.

Refs #445
2026-07-25 14:04:52 +02:00
timothy cb5d1af65f ci(445): bake headless Chromium into the CI toolchain image
Adds `chromium-headless-shell` + its system deps to the shared CI toolchain
image so the `functional-e2e` job can run the UI-E2E Playwright flows without
installing a browser per run — the same "jobs install nothing at run time"
rule as the rest of this image.

Measured on this exact base (Ubuntu 24.04 ffmpeg base, amd64):
  - headless shell: 267M   vs   full chromium: 656M
  - `chromium.launch()` resolves to the shell anyway (the config never asks
    for headed), so the only cost is that a HEADED run inside this image would
    fail — CI-only, and deliberate.
  - Chromium launches as root in a container with NO --no-sandbox /
    chromiumSandbox:false opt-out, so the Playwright config needs no sandbox
    workaround. Verified rather than assumed.

`ARG PLAYWRIGHT_VERSION` must stay equal to web/package.json's EXACT
`@playwright/test` pin: Playwright ties a browser revision to the package
version, so a mismatch leaves no usable browser.

The build-time smoke test LAUNCHES the browser (not just a file test), so a
missing system library fails the image build instead of a CI run.

First half of the deliberate two-step toolchain bump: this commit is what
ci-image.yml publishes as :<sha>; the follow-up commit pins it.

Refs #445
2026-07-25 14:02:31 +02:00
timothyandClaude Opus 4.8 04e3a5249d ci(406): disable swap on the capped mysql; fix peak-step placement and failure mode [decisions-edit]
Build ErsatzTV Image / CI image pin matches docker/ci (pull_request) Successful in 6s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 5s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 6s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 16s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 14s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m6s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 14m42s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 13m43s
Review fixes from the cold adversarial pass on PR #411. Verdict was MERGEABLE, but one
HIGH is a genuine defect worth the round-trip.

[decisions-edit] rationale: the 12 "modified" lines in docs/decisions.md are lines THIS PR
added in its own previous commit (e33205e8), not a settled entry on main. The hook diffs
against HEAD; net against origin/main this file is still a pure insertion (65 added, 0
deleted -- verified, and CI's decisions-guard diffs against the PR base). It is also the
sanctioned reason regardless: the entry as first written contained a factual error (see
HIGH below).

HIGH -- `--memory=2g` alone silently grants 2g of SWAP as well. Docker defaults an unset
--memory-swap to 2x --memory. Verified live on bumblebee: `--memory=2g` alone gives
memory.max=2147483648 AND memory.swap.max=2147483648; adding `--memory-swap=2g` gives
memory.swap.max=0. Capping RAM while permitting swap is close to the worst outcome on the
one host whose swap thrash is the entire reason for the cap -- and a swapping mysqld
mid-DDL is exactly the pathology behind the known `Command Timeout expired` migrations
flake, so the naive cap could have made that flake worse rather than better. The comment
promising "if this ever OOM-kills the service" described a failure mode that would not
have happened first: it would have swapped, silently. Now --memory-swap=2g (swap off);
prefer a loud OOM over silent degradation.

The same 2x applies to the runners' 10g job slots (10 GiB RAM + 10 GiB swap each), which
is a plausible direct mechanism for the incident's 21 GiB swapped. That is #604's
boundary -- reporting it there.

MEDIUM -- `if: always()` does not make a step advisory. It controls whether the step RUNS,
not whether its failure fails the job, and defaults.run.shell: bash means -e is on, so a
failed cat/redirect in an informational step could redden a green test job. Use
continue-on-error: true, matching the neighbouring Coverage summary step.

MEDIUM -- the peak step must run LAST. memory.peak read at step N reports the peak only up
to N, so sitting before Coverage summary excluded reportgenerator's memory -- under-
reporting the very number #604 sizes caps on. Moved after it.

LOW -- dependency-scan.yml gets the env too; workflow env does not cross workflow files,
and that one runs unattended on a cron against the prod media host.

NIT -- Dockerfile ENV moved below the openapi-generator wget: an ENV invalidates every
layer under it, and that ~30MB download is deliberately ordered early to stay cached
(#190). Nothing between it and restore compiles, so this placement is free.

NIT -- docs no longer imply this shrinks `format`. dotnet format loads Roslyn in-process
via MSBuildWorkspace and never spawns csc, so its 3.95 GiB is untouched; sizing the small
lane on the assumption it shrank would be a trap.

Also record honestly that 543 MiB is init+idle rather than the 787-migration replay (so 2g
is a measured floor + headroom, not a measured ceiling -- the migrations job going green
is what validates it) and that --cpus=2 is judgement with no measurement behind it. The
entry criticises dressing estimates as measurements; it should not do that itself.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 15:36:18 +02:00
timothyandClaude Opus 4.8 e33205e8eb ci(406): disable persistent compiler servers, cap the mysql service, report peak RSS
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 9s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 1m22s
Build ErsatzTV Image / CI image pin matches docker/ci (pull_request) Successful in 6s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 6s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 5s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 14m9s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 18m23s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 18m45s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Refs #406, server-management#604. Items 1 and 2 of #406 (item 3 landed in PR #407).

Root cause of the 2026-07-17 bumblebee incident (load 340, 21 GiB swapped, prod media
down until reboot) is CI-induced memory pressure, and the largest single consumer was
Roslyn's persistent VBCSCompiler at 7.8 GB RSS. It is a compiler *server*: it outlives
the build that started it to keep its heap warm for the next one. In CI there is no next
build -- each job container is torn down at the end of the run -- so it is pure cost, and
it is the actual reason each job needed a 10 GiB cap.

1. Disable the compiler servers via the workflow's top-level env (UseSharedCompilation,
   DOTNET_CLI_USE_MSBUILD_SERVER, MSBUILDDISABLENODEREUSE). MSBuild surfaces env vars as
   properties and only defaults UseSharedCompilation when empty, so the env var wins and
   every dotnet call is covered without touching each call site.

   Also set as ENV in the Dockerfile's SDK stage: the workflow env reaches runner-side
   jobs only, and the `build` job compiles inside `docker build` where it does not
   propagate -- that is the job server-management#570 measured pegging 5.999/6 GiB, so it
   is the one that most needs this. Build stage only; the final image is FROM
   runtime-base, so nothing lands in the shipped image.

   Verified locally: a default build leaves 1 VBCSCompiler alive, the same build under
   these vars leaves 0, and ErsatzTV.sln still builds clean (0 errors). Trade-off: csc
   runs per project instead of via the server, costing some build time.

2. Cap the mysql service (--memory=2g --cpus=2). A runner's container.options applies to
   the job container ONLY: a live migrations job reported HostConfig.Memory=10737418240
   for the job and mem=0 nanocpus=0 for its mysql service, i.e. unbounded. 2g is sized on
   measurement -- mysql:8.4 with this exact env peaked at 543 MiB during init, 481 MiB
   idle (probed on bumblebee) -- not on inheritance.

Also add a `Report peak container memory` step to the test job (cgroup memory.peak,
always(), never fails a build). server-management#604 sizes both runners' caps on that
number and it was inherited rather than measured; now every run reports it.

Docs: ci-cd.md gains the compiler-server + services-cap sections and the lane table is
corrected (PR #407 reverted the #390 lane move without updating it). decisions.md records
all three, incl. the standing rule that a services: container never inherits a cap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 15:22:31 +02:00
timothy 07048b8c96 ci(390): address cold review — pin-drift guard, honest cron, doc fixes
Build ErsatzTV Image / CI image pin matches docker/ci (pull_request) Failing after 13s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 15s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 16s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 15s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 13s
Build CI Toolchain Image / Build & push CI image (push) Successful in 29s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m7s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 9m11s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 6m6s
Cold adversarial review findings:
- MEDIUM (Renovate generates pin drift): add a blocking ci-image-pin job. Renovate
  manages docker/ci/Dockerfile's base pins but cannot bump an opaque :<sha> in
  container.image, so a base bump would publish a new image, test the OLD one, and
  merge with the Dockerfile disagreeing with the pin. The guard fails when the pin
  isn't the last commit to touch docker/ci, or when the 5 jobs pin different tags —
  making the documented two-step enforced rather than remembered.
- MEDIUM (cron was a no-op): the weekly rebuild updated nothing (jobs pin :<sha>) and
  buildcache would have restored the apt layer verbatim, collecting none of the base
  updates it existed for. Added no-cache on the schedule path and rewrote the comment
  to state what it actually is: a build canary + a fresh :latest for the next bump.
- LOW: FFMPEG_TAG was referenced in the Dockerfile + docs but never existed (the FROM
  is hardcoded); reworded both.
- LOW: paths: filtered the exact file while the docs claimed docker/ci/** — use **.
- NIT: docs oversold ENTRYPOINT reset as a gotcha; act overrides it anyway. Marked
  defensive.

Refs #390
2026-07-17 09:34:46 +02:00
timothy 6a9e27c6b8 ci(390): fix CI-image smoke test — reportgenerator --version exits 1
Build CI Toolchain Image / Build & push CI image (push) Successful in 2m9s
The build-time smoke test failed the image build even though the toolchain was
healthy: reportgenerator prints its version banner then exits 1 ("No report
files specified"), so it has no clean version probe. Probe the dotnet-tool shim
on PATH instead. dotnet --info confirmed the SDK + .NET 10.0.10 runtimes resolve
correctly on the ffmpeg base (ICU/glibc fine).

Refs #390
2026-07-17 09:13:09 +02:00
timothy f27ff876d0 ci(390): add shared CI toolchain image (.NET 10 SDK + Node 22 + prod ffmpeg)
Build CI Toolchain Image / Build & push CI image (push) Failing after 1m42s
Layers the .NET 10 SDK + Node 22 onto our own ersatztv-ffmpeg base (the same
COPY --from=.../usr/share/dotnet pattern docker/Dockerfile uses for prod), and
bakes the dotnet-ef + reportgenerator global tools the jobs installed per run.

Builds/pushes 192.168.1.95:3000/timothy/ersatztv-ci:<sha> via a separate
workflow so a ~2GB toolchain image isn't rebuilt on every commit.

Refs #390
2026-07-17 09:09:11 +02:00
timothyandCodex 10ae885b47 fix(analyzers): preserve non-CPM and image builds
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 9s
Build ErsatzTV Image / decisions.md append-only (pull_request) Successful in 10s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 17s
Build ErsatzTV Image / Functional E2E (curl contracts) (pull_request) Successful in 5m12s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 5m52s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 2m40s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 8m40s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Guard analyzer package references for the inline-version MCP tool and copy the SDK suggestion baseline into the Docker build context before restore.

Refs #15

Co-Authored-By: Codex <codex@openai.com>
2026-07-16 21:52:27 +02:00
timothyandClaude Opus 4.8 e68aa5834c ci: speed up build pipeline (NuGet cache, shallow checkout, jar layer reorder)
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 5m3s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 5m17s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
Three CI wins from ersatztv#190, all config-only:

- Cache ~/.nuget/packages via actions/cache@v4 in both the `test` and
  `migrations` jobs, keyed on Directory.Packages.props + global.json, so
  dotnet restore no longer starts from scratch every run.
- Shallow-checkout the `test` job (fetch-depth: 1) since it never runs
  git describe/log; only `build` needs full history for versioning. The
  `migrations` job's checkout was already effectively shallow (default
  fetch-depth 1), documented explicitly.
- Reorder the Dockerfile so the openapi-generator jar wget happens before
  the openapi spec COPY, decoupling the ~30MB download layer from spec
  changes (e.g. v1.json) that previously busted it on every API PR.

Documented all three in docs/ci-cd.md alongside the existing job/Dockerfile
notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 19:37:31 +02:00
timothyandClaude Fable 5 2952aceb5b fix(docker): use valid node:22-bookworm-slim base for web-build stage
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m11s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m36s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
node:22-noble does not exist on Docker Hub (no noble variant of the
official node image; the -noble suffix was carried over from the MS
dotnet image tags). Broke the main image-build job (run 482) after
PR #120 landed, since PR runs skip the build job.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 08:19:12 +02:00
timothy b183c6a154 feat(frontend): scaffold ChicoryTV SPA
refs #78
2026-07-02 07:37:00 +02:00
timothy e170b2dc3c fix(ffmpeg): align transcode pipelines with ffmpeg 8
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m4s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 5m17s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
refs #9
2026-07-01 19:37:51 +02:00
timothyandClaude Opus 4.8 77a28fcefc build: adopt Central Package Management (Directory.Packages.props)
Move all 154 PackageReference versions (96 distinct packages) out of the 14
project files into a single central Directory.Packages.props with
ManagePackageVersionsCentrally=true. No version changes — every package was
already pinned identically across projects (no conflicts detected), so this is a
pure relocation: updates become one-line and cross-project version drift is
structurally impossible.

Also copy Directory.Packages.props into the Docker image build before restore:
with CPM the csproj carry no versions, so the image's `dotnet restore` fails
without the central manifest (verified: NU1015 across every project).

Restore + Release build verified locally, plus a simulation of the image's
restore layer under linux-x64 (0 errors; only the pre-existing
NCalcSync/SQLitePCLRaw advisories remain, demoted to warnings, tracked in #8).

Part of #14.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 01:07:52 +02:00
timothy 45627ede82 ci: harden build pipeline per adversarial review
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 1m55s
Build ErsatzTV Image / Build & push image (amd64) (push) Successful in 24s
- Add concurrency group so the single jazz runner can't run the
  push-main-then-push-tag release flow in parallel (shared :buildcache
  + smoke container would collide).
- Add pull_request trigger running the test job only (PRs had no gate);
  skip the build job on PRs.
- Only push images from main or a v* tag (workflow_dispatch from other
  refs now builds without publishing, instead of clobbering :latest/:prod).
- Replace the log-grep smoke check with a real HTTP readiness probe
  (docker exec python3 -> http://localhost:8409/), unique container name,
  and trap-based cleanup to avoid leaks on cancel.
- dotnet test now runs -c Release --no-build (was rebuilding in Debug).
- Directory.Build.props: WarningsAsErrors=NU1904 so critical NuGet
  advisories block in every project, not just ones with
  TreatWarningsAsErrors.
- Dockerfile copies global.json + .editorconfig too, so the image build
  matches CI's SDK pin and analyzer severities.
- Remove dead .github/dependabot.yml + FUNDING.yml (upstream-pointed).
- Rewrite docs/ci-cd.md to the implemented pipeline.

Refs #4, #3, #8.
2026-06-27 00:01:22 +02:00
timothy 46e2fbf0f7 build: don't fail restore on low/moderate/high NuGet audit advisories
.NET 10's NuGet audit promotes vulnerable transitive packages to NU1901-1904
warnings during restore; the app projects set TreatWarningsAsErrors=true, so
restore failed on NCalcSync 5.11.0 (moderate) and SQLitePCLRaw 2.1.10 (high).

Demote NU1901/NU1902/NU1903 to warnings in Directory.Build.props (NU1904
critical still errors). Also COPY Directory.Build.props/.targets in the
Dockerfile before restore so the image build honors the same props as
local/CI builds (it previously copied only the .sln). Underlying deps tracked
in #8.

Refs #4, #8.
2026-06-26 22:22:48 +02:00
timothyandClaude Opus 4.8 9ad0c4a393 ci: add Gitea Actions build pipeline, retire upstream workflows
Adds .gitea/workflows/docker-build.yml: a test-gated, amd64-only Docker
build that pushes the fork's own image to the Gitea container registry
(192.168.1.95:3000). The .NET test job gates the image build; the build
job stamps INFO_VERSION from git, uses buildx registry layer caching, and
smoke-tests that the built image boots before finishing.

Tagging:
  - push to main -> :latest + :<short-sha> (test image; prod untouched)
  - push tag v*  -> :prod + :<version> + :<short-sha> (prod release)

Updates docker/Dockerfile to pull the FFmpeg base image from our Gitea
registry (192.168.1.95:3000/timothy/ersatztv-ffmpeg:7.1.1) instead of the
archived upstream ghcr.io image.

Removes the upstream .github/workflows/* — they target GHCR/DockerHub and
Azure/Apple signing secrets we don't have, call reusable workflows at dead
ersatztv/ersatztv@main paths, and were running as noise (incl. a daily
stale-issue cron) on the Gitea runner. Upstream is archived, so there are
no future merges to preserve them for.

Refs #4, #3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 22:17:48 +02:00
Jason Dove 08cbf59527 lower gop size and keyframe interval (#2832)
* lower gop size and keyframe interval

* update changelog

* fix build using latest dotnet sdk

* fixes
2026-02-19 13:35:27 -06:00
Jason Dove 3dbde17f68 pin dotnet sdk in docker to 10.0.102 (#2822) 2026-02-12 08:42:54 -06:00
Jason Dove 7bd8cefe2e more dotnet 10 updates (#2676)
* update more libraries to dotnet 10

* fix dockerfiles

* fix numeric types
2025-11-29 15:47:08 -06:00
Jason Dove 758399e339 fix missing net9.0 to net10.0 in docker/github (#2668) 2025-11-26 10:54:24 -06:00
Jason Dove 6c635a4be9 upgrade to dotnet 10 (#2667)
* upgrade to dotnet 10

* remove packages that would be pruned

* properly fix tests
2025-11-26 10:49:01 -06:00
Jason Dove d709cc9f21 include streamlink in amd64 docker image (#2611)
* include streamlink in docker images

* tweak command
2025-11-07 14:12:43 -06:00
Peter Dey c71269058e Display hostname & build configuration when build config is not "release" (#2449)
* Display hostname & build configuration when build config is not "release" (default).

* Add missed ARG line for arm64/Dockerfile
2025-09-21 19:04:15 +00:00
Jason Dove 487d99dc69 openapi improvements (#2381)
* generate openapi definitions as separate build task

* first defns

* install etv-client module in docker

* include python entrypoint in docker

* update changelog
2025-09-05 17:11:43 +00:00
Jason Dove fde05a0299 fix docker tag typo 2025-07-24 15:29:12 -05:00
Jason Dove d3f8163580 use updated ersatztv-ffmpeg base images (#2198) 2025-07-24 20:27:06 +00:00
Jason Dove a6fa93d44e fix nvidia compatibility with ffmpeg 7.2+ (#2108)
* tweak random seed

* fix dotnet install in docker test

* fix nvidia compatibility with ffmpeg 7.2+
2025-07-03 15:08:18 +00:00
Jason Dove a04c72788f fix arm64 docker build (#2078) 2025-06-27 11:48:21 +00:00
Jason Dove f94a440b62 stream selector improvements (#2077)
* add tests for audio blocklist and audio allowlist

* add subtitle allow list and block list

* add subtitle condition

* add audio condition

* cache bust mudblazor css
2025-06-27 11:40:06 +00:00
Jason Dove 06f233e5bd upgrade to dotnet 9 (#2056) 2025-06-22 19:04:39 +00:00
Jason Dove b04b517f7b add dockerfile to run transcoding test suite (#2052) 2025-06-21 18:08:23 +00:00
Jason Dove 4b0faf4da1 unify hardware acceleration in docker (#2045) 2025-06-20 02:52:05 +00:00
Jason Dove 69a1e718df use ffmpeg 7.1.1 for nvidia docker (#2038) 2025-06-14 23:20:22 +00:00
Jason Dove 1184dc565c use ffmpeg 7.1.1 for base, arm, arm64 docker (#2035)
* use ffmpeg 7.1.1 for base, arm, arm64 docker

* keep newline
2025-06-14 11:16:30 +00:00
Jason Dove 4d83cc705f use ffmpeg 7.1.1 for vaapi docker (#2033) 2025-06-14 00:34:17 +00:00
Jason Dove b30b458574 allow ui and streaming to run on different ports (#1992)
* allow ui and streaming to run on different ports

* revert global.json change
2025-04-14 16:48:19 +00:00
Jason Dove ab3afcfad0 use ffmpeg 6.1 everywhere instead of ffmpeg 7 (#1754) 2024-06-21 12:30:07 -05:00
Jason Dove 6dc526a817 fix dotnet in vaapi docker (#1724) 2024-05-23 07:38:01 -05:00
Jason Dove 182c02b865 use ffmpeg 7 with vaapi again (#1723) 2024-05-22 20:09:38 -05:00
Jason Dove 2c97c49763 custom config folders env vars (#1714)
* use custom config folder location

* allow customizing config and transcode folder locations
2024-05-10 09:28:58 -05:00
Jason Dove 50a6ed4cea fix docker again 2024-05-02 10:31:01 -05:00
Jason Dove 66b8c8aa0e fix docker builds (#1699) 2024-05-02 10:23:07 -05:00
Jason Dove c1bedb661c rever vaapi docker to ffmpeg 6.1 (#1681) 2024-04-16 22:27:26 -05:00