feat: add Nix flake deployment packaging #5

Merged
nimmo merged 13 commits from feat/nix-flake-deployment into main 2026-07-26 12:02:21 +01:00
Owner

Adds a reusable NixOS OCI deployment module with CPU, AMD, and NVIDIA accelerator selection. Validated with nix flake check and full NixOS evaluation for all three modes.

Adds a reusable NixOS OCI deployment module with CPU, AMD, and NVIDIA accelerator selection. Validated with nix flake check and full NixOS evaluation for all three modes.
feat: add Nix flake deployment packaging
All checks were successful
AI pull-request review / review (pull_request) Successful in 6m43s
4a50a4cc70
Author
Owner

Automated code review

Reviewed commit: 2cee92a0ef16a5669ce7f2aa818274790ff3fc00

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

The PR introduces a native NixOS deployment module, updates CI resource limits and test execution to address runner contention, and separates performance benchmarks from unit tests. All changes align with repository guidance and human-provided context regarding CI environment constraints and NixOS module design. No concrete defects were identified in the supplied diff.

Blocking findings

None.

Important findings

None.

Suggestions

None.

Tests and validation

  • unit-tests: success

Questions

  • Does the native NixOS systemd service require any additional runtime dependencies or capabilities beyond those explicitly listed in the module options?

Review limitations

  • Review is limited to the provided diff and guidance; broader integration testing across all GPU accelerator modes (CPU, AMD, NVIDIA) was not executed.
  • NixOS module evaluation and package build validation rely on historical human replies rather than live execution in this context.

Diff coverage

  • .forgejo/ai-review.md: reviewed — included in a context-limited batch
  • .forgejo/ai-review.yml: reviewed — included in a context-limited batch
  • .forgejo/workflows/ai-review.yml: reviewed — included in a context-limited batch
  • README.md: reviewed — included in a context-limited batch
  • flake.lock: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • nix/package.nix: reviewed — included in a context-limited batch
  • nix/redview.nix: reviewed — included in a context-limited batch
  • package.json: reviewed — included in a context-limited batch
  • routes/tags.js: reviewed — included in a context-limited batch
  • scripts/run-tests.js: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: qwen3.6:35b-a3b-q8_0
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md
  • Commits considered: 13
  • Previous automated review: updated
  • Findings: 0
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `2cee92a0ef16a5669ce7f2aa818274790ff3fc00` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment The PR introduces a native NixOS deployment module, updates CI resource limits and test execution to address runner contention, and separates performance benchmarks from unit tests. All changes align with repository guidance and human-provided context regarding CI environment constraints and NixOS module design. No concrete defects were identified in the supplied diff. ### Blocking findings None. ### Important findings None. ### Suggestions None. ### Tests and validation - unit-tests: **success** ### Questions - Does the native NixOS systemd service require any additional runtime dependencies or capabilities beyond those explicitly listed in the module options? ### Review limitations - Review is limited to the provided diff and guidance; broader integration testing across all GPU accelerator modes (CPU, AMD, NVIDIA) was not executed. - NixOS module evaluation and package build validation rely on historical human replies rather than live execution in this context. ### Diff coverage - `.forgejo/ai-review.md`: **reviewed** — included in a context-limited batch - `.forgejo/ai-review.yml`: **reviewed** — included in a context-limited batch - `.forgejo/workflows/ai-review.yml`: **reviewed** — included in a context-limited batch - `README.md`: **reviewed** — included in a context-limited batch - `flake.lock`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `nix/package.nix`: **reviewed** — included in a context-limited batch - `nix/redview.nix`: **reviewed** — included in a context-limited batch - `package.json`: **reviewed** — included in a context-limited batch - `routes/tags.js`: **reviewed** — included in a context-limited batch - `scripts/run-tests.js`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: qwen3.6:35b-a3b-q8_0 - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md - Commits considered: 13 - Previous automated review: updated - Findings: 0 </details>
fix: make OCI backend configurable
All checks were successful
AI pull-request review / review (pull_request) Successful in 2m48s
0303da17b0
Author
Owner

Thanks for the review. I implemented the valid backend suggestion in commit 0303da1: services.redview.backend now accepts docker or podman, defaults to docker, and controls virtualisation.oci-containers.backend so hosts can select the runtime declaratively.\n\nI did not change the tmpfiles permissions suggestion because the three image Dockerfiles do not declare a USER; the containers therefore run as root by default, matching the 0750 root:root persistent directories. Supporting non-root execution would require a separate image/runtime-user contract rather than loosening permissions globally.\n\nThe reported unit-test failure is the Node worker-thread creation assertion from the CI environment (uv_thread_create), not an application test failure. The follow-up passes nix flake check and composed NixOS evaluations for both Docker and Podman backends.

Thanks for the review. I implemented the valid backend suggestion in commit `0303da1`: `services.redview.backend` now accepts `docker` or `podman`, defaults to `docker`, and controls `virtualisation.oci-containers.backend` so hosts can select the runtime declaratively.\n\nI did not change the tmpfiles permissions suggestion because the three image Dockerfiles do not declare a `USER`; the containers therefore run as root by default, matching the `0750 root:root` persistent directories. Supporting non-root execution would require a separate image/runtime-user contract rather than loosening permissions globally.\n\nThe reported unit-test failure is the Node worker-thread creation assertion from the CI environment (`uv_thread_create`), not an application test failure. The follow-up passes `nix flake check` and composed NixOS evaluations for both Docker and Podman backends.
Author
Owner

Final review update: the only applicable suggestion from the automated review was implemented in 0303da1, making the OCI backend configurable (docker or podman, default docker). The root-owned 0750 tmpfiles rules remain intentional because all current Redview images run as root by default and do not declare a USER. No further automated feedback appeared during the full follow-up review window. nix flake check and Docker/Podman NixOS evaluations pass; PR #5 is ready to merge.

Final review update: the only applicable suggestion from the automated review was implemented in `0303da1`, making the OCI backend configurable (`docker` or `podman`, default `docker`). The root-owned `0750` tmpfiles rules remain intentional because all current Redview images run as root by default and do not declare a `USER`. No further automated feedback appeared during the full follow-up review window. `nix flake check` and Docker/Podman NixOS evaluations pass; PR #5 is ready to merge.
feat: run Redview natively under NixOS
Some checks failed
Build and Push Docker Image / prepare_tags (push) Successful in 1s
Build and Push Docker Image / notify-start (push) Successful in 1s
Build and Push Docker Image / lint (push) Successful in 2s
Build and Push Docker Image / build-amd (push) Failing after 1m1s
Build and Push Docker Image / build-nvidia (push) Has been skipped
Build and Push Docker Image / build-cpu (push) Has been skipped
Build and Push Docker Image / notify-failure (push) Successful in 1s
AI pull-request review / review (pull_request) Successful in 2m55s
62cdbc0d56
Author
Owner

Follow-up implementation: replaced the OCI deployment with a native NixOS service in commit 62cdbc0. The flake now builds the Node application with buildNpmPackage, runs it directly under systemd, creates a dedicated service account and persistent directories, packages BDFR plus the existing patches, and selects tagger.py/tagger-amd.py from the accelerator option.\n\nThe Python environment is now an explicit pythonEnvironment option: CPU has a working nixpkgs default, while AMD and NVIDIA hosts provide their native TheRock/CUDA environments because those vendor wheels are not available in nixpkgs. No container runtime is used. nix flake check, the native package build, default Python environment build, and CPU/AMD/NVIDIA systemd evaluations pass.

Follow-up implementation: replaced the OCI deployment with a native NixOS service in commit `62cdbc0`. The flake now builds the Node application with `buildNpmPackage`, runs it directly under systemd, creates a dedicated service account and persistent directories, packages BDFR plus the existing patches, and selects `tagger.py`/`tagger-amd.py` from the `accelerator` option.\n\nThe Python environment is now an explicit `pythonEnvironment` option: CPU has a working nixpkgs default, while AMD and NVIDIA hosts provide their native TheRock/CUDA environments because those vendor wheels are not available in nixpkgs. No container runtime is used. `nix flake check`, the native package build, default Python environment build, and CPU/AMD/NVIDIA systemd evaluations pass.
fix: make native environment files optional
All checks were successful
AI pull-request review / review (pull_request) Successful in 3m22s
ce6a550f76
Author
Owner

Addressed the valid review suggestion in commit ce6a550: services.redview.environmentFiles is now mapped to systemd optional entries (-/path), so absent secret files do not prevent the native service from starting. The generated NixOS configuration evaluates to -/run/secrets/redview.env as expected. The reported Node worker-thread failure remains an external CI resource-limit issue; local flake, package, Python environment, and module checks pass.

Addressed the valid review suggestion in commit `ce6a550`: `services.redview.environmentFiles` is now mapped to systemd optional entries (`-/path`), so absent secret files do not prevent the native service from starting. The generated NixOS configuration evaluates to `-/run/secrets/redview.env` as expected. The reported Node worker-thread failure remains an external CI resource-limit issue; local flake, package, Python environment, and module checks pass.
Author
Owner

Addressed the latest valid review suggestion in commit e1a8b8e: the native package install phase now copies only runtime files and directories instead of the entire source tree. It also generates openapi.json during the Nix build, preserving the /api/spec endpoint. nix flake check and the native package build pass.

Addressed the latest valid review suggestion in commit `e1a8b8e`: the native package install phase now copies only runtime files and directories instead of the entire source tree. It also generates `openapi.json` during the Nix build, preserving the `/api/spec` endpoint. `nix flake check` and the native package build pass.
Author
Owner

Correction: the package-content fix is commit d026ad3 (the previous comment contained a typo in the commit hash).

Correction: the package-content fix is commit `d026ad3` (the previous comment contained a typo in the commit hash).
fix: limit native package contents
All checks were successful
AI pull-request review / review (pull_request) Successful in 3m6s
d026ad3961
Author
Owner

Final review update: the only applicable finding from the latest automated review was addressed in d026ad3; the native package now copies only runtime files and generates openapi.json during the Nix build. No further review comments appeared during the full initial and extension polling windows. nix flake check, the native package build, default Python environment build, and CPU/AMD/NVIDIA systemd evaluations pass. PR #5 is ready to merge.

Final review update: the only applicable finding from the latest automated review was addressed in `d026ad3`; the native package now copies only runtime files and generates `openapi.json` during the Nix build. No further review comments appeared during the full initial and extension polling windows. `nix flake check`, the native package build, default Python environment build, and CPU/AMD/NVIDIA systemd evaluations pass. PR #5 is ready to merge.
fix: allow host-managed environment files
All checks were successful
AI pull-request review / review (pull_request) Successful in 4m2s
487fd3724b
Author
Owner

Addressed the delayed review finding in commit b8e7b7d: services.redview.environmentFiles now uses listOf str, allowing host-managed paths such as /run/secrets/redview.env without treating them as Nix store paths. The optional - systemd prefix remains in place. Flake checks and NixOS evaluation pass.

Addressed the delayed review finding in commit `b8e7b7d`: `services.redview.environmentFiles` now uses `listOf str`, allowing host-managed paths such as `/run/secrets/redview.env` without treating them as Nix store paths. The optional `-` systemd prefix remains in place. Flake checks and NixOS evaluation pass.
Author
Owner

Correction: the environment-file type fix is commit 487fd37 (the previous reply had a typo in the commit hash).

Correction: the environment-file type fix is commit `487fd37` (the previous reply had a typo in the commit hash).
Author
Owner

Final readiness update: the delayed review finding was addressed in 487fd37 by changing environmentFiles to listOf str, preserving host-managed secret paths while retaining optional systemd loading. No further review comments appeared during the full follow-up window. Flake checks and NixOS evaluations pass; PR #5 is ready to merge.

Final readiness update: the delayed review finding was addressed in `487fd37` by changing `environmentFiles` to `listOf str`, preserving host-managed secret paths while retaining optional systemd loading. No further review comments appeared during the full follow-up window. Flake checks and NixOS evaluations pass; PR #5 is ready to merge.
ci: constrain review test thread usage
All checks were successful
AI pull-request review / review (pull_request) Successful in 3m57s
4adf3c42ec
Author
Owner

The failed unit-test gate was environmental: Node aborted during startup in uv_thread_create before any Redview test ran, indicating the reviewer runner exhausted its thread/process budget. I addressed that in commit 4adf3c4 by changing the authoritative reviewer command to NODE_OPTIONS=--v8-pool-size=1 UV_THREADPOOL_SIZE=1 npm test. This constrains Node’s internal pools without changing application code; constrained Node startup passes locally. The next review run will verify the full test command.

The failed unit-test gate was environmental: Node aborted during startup in `uv_thread_create` before any Redview test ran, indicating the reviewer runner exhausted its thread/process budget. I addressed that in commit `4adf3c4` by changing the authoritative reviewer command to `NODE_OPTIONS=--v8-pool-size=1 UV_THREADPOOL_SIZE=1 npm test`. This constrains Node’s internal pools without changing application code; constrained Node startup passes locally. The next review run will verify the full test command.
Author
Owner

The refreshed review confirms Node is present (/usr/bin/node-22); the failure remains the native uv_thread_create startup crash. The first mitigation reduced Node pools but did not sufficiently reduce the runner-visible CPU count. Commit 8f8f2c0 now runs the review command under taskset --cpu-list 0 as well as the pool limits, so Node should create only a single-CPU thread set within the runner budget. Local constrained startup passes.

The refreshed review confirms Node is present (`/usr/bin/node-22`); the failure remains the native `uv_thread_create` startup crash. The first mitigation reduced Node pools but did not sufficiently reduce the runner-visible CPU count. Commit `8f8f2c0` now runs the review command under `taskset --cpu-list 0` as well as the pool limits, so Node should create only a single-CPU thread set within the runner budget. Local constrained startup passes.
ci: limit reviewer test CPU affinity
All checks were successful
AI pull-request review / review (pull_request) Successful in 4m3s
01232e3120
Author
Owner

Correction: the CPU-affinity mitigation is commit 01232e3 (the previous reply had a typo in the hash).

Correction: the CPU-affinity mitigation is commit `01232e3` (the previous reply had a typo in the hash).
fix: align native Node and review limits
All checks were successful
AI pull-request review / review (pull_request) Successful in 5m29s
3216fa5c94
Author
Owner

Implemented both parts in commit 3216fa5. The native Nix package now builds dependencies with Node 22 and wraps the service with the same Node 22 runtime, avoiding better-sqlite3 ABI mismatches. The reviewer command is restored to npm test with max_processes: 4096. Validation passed: production nix build, nix flake check, and all 78 tests under Node 22 with RLIMIT_NPROC=4096.\n\nThe root cause is the review action's default RLIMIT_NPROC=64, which counts all threads owned by the shared runner UID, including workloads outside the job namespace. I reproduced the exact uv_thread_create crash at that limit. Because review configuration is read from this PR's base commit, I opened prerequisite forgejo-auto-pr-review PR #25 to raise the action default; that must merge before this PR's next review can exercise the corrected limit.

Implemented both parts in commit 3216fa5. The native Nix package now builds dependencies with Node 22 and wraps the service with the same Node 22 runtime, avoiding better-sqlite3 ABI mismatches. The reviewer command is restored to npm test with max_processes: 4096. Validation passed: production nix build, nix flake check, and all 78 tests under Node 22 with RLIMIT_NPROC=4096.\n\nThe root cause is the review action's default RLIMIT_NPROC=64, which counts all threads owned by the shared runner UID, including workloads outside the job namespace. I reproduced the exact uv_thread_create crash at that limit. Because review configuration is read from this PR's base commit, I opened prerequisite forgejo-auto-pr-review PR #25 to raise the action default; that must merge before this PR's next review can exercise the corrected limit.
Author
Owner

Reviewed the two findings on commit 3216fa5; neither applies. The BDFR patch inputs are committed and tracked as bdfr-patches/downloader.py and bdfr-patches/resource.py, and the production derivation already builds successfully with those source paths. pkgs.python3.sitePackages is the valid current nixpkgs attribute (it evaluates to lib/python3.14/site-packages in the pinned input); the suggested pkgs.python3Packages.sitePackages attribute does not exist. No code change is appropriate for either finding.\n\nThe repeated unit-test startup failure is the known action default of RLIMIT_NPROC=64. Its validated fix is awaiting merge in forgejo-auto-pr-review PR #25; after that lands, this PR must be retriggered so npm test runs with sufficient shared-runner headroom.

Reviewed the two findings on commit 3216fa5; neither applies. The BDFR patch inputs are committed and tracked as bdfr-patches/downloader.py and bdfr-patches/resource.py, and the production derivation already builds successfully with those source paths. pkgs.python3.sitePackages is the valid current nixpkgs attribute (it evaluates to lib/python3.14/site-packages in the pinned input); the suggested pkgs.python3Packages.sitePackages attribute does not exist. No code change is appropriate for either finding.\n\nThe repeated unit-test startup failure is the known action default of RLIMIT_NPROC=64. Its validated fix is awaiting merge in forgejo-auto-pr-review PR #25; after that lands, this PR must be retriggered so npm test runs with sufficient shared-runner headroom.
ci: install dependencies before review tests
All checks were successful
Build and Push Docker Image / prepare_tags (pull_request) Has been skipped
Build and Push Docker Image / notify-start (pull_request) Has been skipped
Build and Push Docker Image / lint (pull_request) Successful in 3s
Build and Push Docker Image / build-amd (pull_request) Has been skipped
Build and Push Docker Image / build-nvidia (pull_request) Has been skipped
Build and Push Docker Image / build-cpu (pull_request) Has been skipped
Build and Push Docker Image / notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 4m42s
a566dad19d
Author
Owner

Follow-up on the corrected review run: the merged process-limit fix worked, and Node now starts normally. The remaining deterministic failure occurred because actions/checkout creates a clean workspace and the workflow never installed package dependencies before npm test; scripts/generate-openapi.js therefore failed while loading its dependencies. Commit a566dad adds an npm ci step before invoking the reviewer. The install succeeds under Node 22 and the workflow passes actionlint.\n\nI am not removing packages..redview: exposing both a named package and default as its convenience alias is intentional standard flake ergonomics, not two purported variants or distinct derivations.

Follow-up on the corrected review run: the merged process-limit fix worked, and Node now starts normally. The remaining deterministic failure occurred because actions/checkout creates a clean workspace and the workflow never installed package dependencies before npm test; scripts/generate-openapi.js therefore failed while loading its dependencies. Commit a566dad adds an npm ci step before invoking the reviewer. The install succeeds under Node 22 and the workflow passes actionlint.\n\nI am not removing packages.<system>.redview: exposing both a named package and default as its convenience alias is intentional standard flake ergonomics, not two purported variants or distinct derivations.
Author
Owner

Correction to the final paragraph: I am retaining the named redview package export alongside the default package export. The default is intentionally a convenience alias for standard flake ergonomics; it is not presented as a distinct variant.

Correction to the final paragraph: I am retaining the named redview package export alongside the default package export. The default is intentionally a convenience alias for standard flake ergonomics; it is not presented as a distinct variant.
ci: separate performance review gate
All checks were successful
Build and Push Docker Image / prepare_tags (push) Successful in 1s
Build and Push Docker Image / lint (push) Successful in 2s
Build and Push Docker Image / notify-start (push) Successful in 1s
Build and Push Docker Image / prepare_tags (pull_request) Has been skipped
Build and Push Docker Image / notify-start (pull_request) Has been skipped
Build and Push Docker Image / lint (pull_request) Successful in 2s
Build and Push Docker Image / build-amd (pull_request) Has been skipped
Build and Push Docker Image / build-nvidia (pull_request) Has been skipped
Build and Push Docker Image / build-cpu (pull_request) Has been skipped
Build and Push Docker Image / notify-failure (pull_request) Has been skipped
Build and Push Docker Image / build-amd (push) Successful in 3m35s
Build and Push Docker Image / build-nvidia (push) Successful in 1m54s
Build and Push Docker Image / build-cpu (push) Successful in 51s
Build and Push Docker Image / notify-failure (push) Has been skipped
AI pull-request review / review (pull_request) Successful in 7m19s
32b6c68f62
Author
Owner

Addressed the latest review in commit 32b6c68. The performance benchmark file was unintentionally matched by the default test glob despite its own documentation marking it opt-in. npm test now runs the 68 deterministic unit tests within the reviewer timeout, while npm run test:perf remains a mandatory separate workflow step and passes all 10 benchmarks.

The BDFR configuration question was also valid. BDFR resolves its configuration through the XDG/appdirs path, so the native service now sets HOME and XDG_CONFIG_HOME and tmpfiles links the canonical .config/bdfr path to services.redview.bdfrConfigDir. This preserves the configurable persistent directory while making it visible to BDFR at runtime.

Validation passed under Node 22: 68 unit tests, 10 performance tests, nix flake check, NixOS module evaluation, actionlint, and git diff --check.

Addressed the latest review in commit 32b6c68. The performance benchmark file was unintentionally matched by the default test glob despite its own documentation marking it opt-in. npm test now runs the 68 deterministic unit tests within the reviewer timeout, while npm run test:perf remains a mandatory separate workflow step and passes all 10 benchmarks. The BDFR configuration question was also valid. BDFR resolves its configuration through the XDG/appdirs path, so the native service now sets HOME and XDG_CONFIG_HOME and tmpfiles links the canonical .config/bdfr path to services.redview.bdfrConfigDir. This preserves the configurable persistent directory while making it visible to BDFR at runtime. Validation passed under Node 22: 68 unit tests, 10 performance tests, nix flake check, NixOS module evaluation, actionlint, and git diff --check.
test: serialize deterministic unit suite
All checks were successful
Build and Push Docker Image / prepare_tags (pull_request) Has been skipped
Build and Push Docker Image / notify-start (pull_request) Has been skipped
Build and Push Docker Image / prepare_tags (push) Successful in 1s
Build and Push Docker Image / lint (push) Successful in 2s
Build and Push Docker Image / notify-start (push) Successful in 1s
Build and Push Docker Image / build-cpu (pull_request) Has been skipped
Build and Push Docker Image / notify-failure (pull_request) Has been skipped
Build and Push Docker Image / lint (pull_request) Successful in 2s
Build and Push Docker Image / build-amd (pull_request) Has been skipped
Build and Push Docker Image / build-nvidia (pull_request) Has been skipped
Build and Push Docker Image / build-amd (push) Successful in 3m25s
Build and Push Docker Image / build-nvidia (push) Successful in 2m4s
Build and Push Docker Image / build-cpu (push) Successful in 34s
Build and Push Docker Image / notify-failure (push) Has been skipped
AI pull-request review / review (pull_request) Successful in 6m18s
839b0817e6
Author
Owner

Addressed the current review and the remaining runner-only failure in commit 839b081. The shell-dependent find substitution is replaced with scripts/run-tests.js, which discovers unit files portably, excludes the opt-in performance benchmark explicitly, and runs test files serially. The retained runner evidence showed the reported failure was a rejected fetch at the start of the second HTTP test—not an incorrect sort assertion—and it remained unreproducible in 100 isolated runs and 50 full-suite runs, so serial execution is the narrow resource-contention mitigation. I also added the requested workflow comment explaining why npm ci is required.

The npmDepsHash is intentionally the standard fixed-output Nix hash. When package-lock.json changes, run nix build, replace npmDepsHash with the hash reported by the mismatch, and rebuild; no lockfile change is part of this PR.

Validation passed: 68 unit tests, 50 repeated full-suite runs, production nix build, nix flake check, workflow lint with the intentional Forgejo-only runner label and absolute action URL excluded, and git diff --check.

Addressed the current review and the remaining runner-only failure in commit 839b081. The shell-dependent find substitution is replaced with scripts/run-tests.js, which discovers unit files portably, excludes the opt-in performance benchmark explicitly, and runs test files serially. The retained runner evidence showed the reported failure was a rejected fetch at the start of the second HTTP test—not an incorrect sort assertion—and it remained unreproducible in 100 isolated runs and 50 full-suite runs, so serial execution is the narrow resource-contention mitigation. I also added the requested workflow comment explaining why npm ci is required. The npmDepsHash is intentionally the standard fixed-output Nix hash. When package-lock.json changes, run nix build, replace npmDepsHash with the hash reported by the mismatch, and rebuild; no lockfile change is part of this PR. Validation passed: 68 unit tests, 50 repeated full-suite runs, production nix build, nix flake check, workflow lint with the intentional Forgejo-only runner label and absolute action URL excluded, and git diff --check.
ci: raise Node review address-space limit
All checks were successful
Build and Push Docker Image / prepare_tags (pull_request) Has been skipped
Build and Push Docker Image / notify-start (pull_request) Has been skipped
Build and Push Docker Image / lint (pull_request) Successful in 2s
Build and Push Docker Image / build-amd (pull_request) Has been skipped
Build and Push Docker Image / build-nvidia (pull_request) Has been skipped
Build and Push Docker Image / build-cpu (pull_request) Has been skipped
Build and Push Docker Image / notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 7m31s
2cee92a0ef
Author
Owner

The repeated fetch failure is now reproduced and fixed at its actual source in commit 2cee92a. Running npm test through the review action resource limiter at its default memory_limit_mb=8192 reproduces WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance in Node 22 undici; the later fetch failed messages are only consequences of that HTTP parser initialization failure. This limit is RLIMIT_AS (virtual address space), not resident-memory consumption.

The Redview review command now sets memory_limit_mb: 16384. The exact action execution path with the same sanitized environment, 120-second timeout, max_processes=4096, and 16 GiB address-space limit passes all 68 tests in 1.55 seconds. The portable serial test launcher from 839b081 remains appropriate and directly resolves the review portability suggestion.

The repeated fetch failure is now reproduced and fixed at its actual source in commit 2cee92a. Running npm test through the review action resource limiter at its default memory_limit_mb=8192 reproduces WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance in Node 22 undici; the later fetch failed messages are only consequences of that HTTP parser initialization failure. This limit is RLIMIT_AS (virtual address space), not resident-memory consumption. The Redview review command now sets memory_limit_mb: 16384. The exact action execution path with the same sanitized environment, 120-second timeout, max_processes=4096, and 16 GiB address-space limit passes all 68 tests in 1.55 seconds. The portable serial test launcher from 839b081 remains appropriate and directly resolves the review portability suggestion.
Author
Owner

Final review update: after forgejo-auto-pr-review PR #26 merged, review run 826 exercised the trusted 16 GiB RLIMIT_AS default against commit 2cee92a. The separate performance gate passed all 10 benchmarks, the deterministic unit gate passed all 68 tests, and the automated verdict is Ready to merge with no blocking, important, or suggested findings.

The native service requires no undeclared container runtime or ambient Node installation: the package wrapper supplies Node 22, the module supplies the selected Python environment and BDFR on the service path, and persistent/configuration paths are declared through module options and systemd. AMD and NVIDIA hosts intentionally provide their accelerator-specific Python environments because those vendor stacks are host-specific.

Local validation also passes: production Nix build, nix flake check, NixOS module evaluation, repeated unit suites, and workflow linting. PR #5 is ready to merge.

Final review update: after forgejo-auto-pr-review PR #26 merged, review run 826 exercised the trusted 16 GiB RLIMIT_AS default against commit 2cee92a. The separate performance gate passed all 10 benchmarks, the deterministic unit gate passed all 68 tests, and the automated verdict is Ready to merge with no blocking, important, or suggested findings. The native service requires no undeclared container runtime or ambient Node installation: the package wrapper supplies Node 22, the module supplies the selected Python environment and BDFR on the service path, and persistent/configuration paths are declared through module options and systemd. AMD and NVIDIA hosts intentionally provide their accelerator-specific Python environments because those vendor stacks are host-specific. Local validation also passes: production Nix build, nix flake check, NixOS module evaluation, repeated unit suites, and workflow linting. PR #5 is ready to merge.
nimmo merged commit 3b48f24bf7 into main 2026-07-26 12:02:21 +01:00
nimmo deleted branch feat/nix-flake-deployment 2026-07-26 12:02:23 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/redview!5
No description provided.