Replace V1 with the root-layout V2 rewrite #10

Merged
nimmo merged 120 commits from v2-rewrite into main 2026-10-02 14:16:54 +01:00
Owner

Summary

Replace the active V1 application with the completed V2 rewrite at the repository root. V1 source and history remain on the published v1-preservation branch; existing databases and backups are retained.

The current source version is 2.0.0-dev.119. Default Nix packages/module run V2, with compatibility exports retained. CI and release tooling use the root application and preserve honest requirement statuses.

Validation

  • 135 Node and 30 Python tests, package installation checks and workflow lint pass locally.
  • Default/compatibility module checks and the target system build passed.
  • The operator completed the migration and test activation of the immutable dev.118 application package; post-activation read-only API, authentication-contract, four-worker and mount checks passed.
  • Recorded requirement status: 44 Verified, 10 explicitly Accepted and Q-08 awaiting stable promotion. User performance/migrated-workflow waivers remain explicit acceptance, not measured passes.

Limits and follow-up

The deployed candidate remains dev.118; dev.119 changes CI/version tooling rather than application behavior. Personal OIDC login, a new production GPU/Reddit/VPN job and production rollback were not claimed by the post-activation checks. Stable 2.0.0 promotion/tagging and persistent operator deployment remain separate. Detailed evidence is in REQUIREMENTS-TRACE.md and acceptance/root-transition-2026-10-02.md.

## Summary Replace the active V1 application with the completed V2 rewrite at the repository root. V1 source and history remain on the published v1-preservation branch; existing databases and backups are retained. The current source version is 2.0.0-dev.119. Default Nix packages/module run V2, with compatibility exports retained. CI and release tooling use the root application and preserve honest requirement statuses. ## Validation - 135 Node and 30 Python tests, package installation checks and workflow lint pass locally. - Default/compatibility module checks and the target system build passed. - The operator completed the migration and test activation of the immutable dev.118 application package; post-activation read-only API, authentication-contract, four-worker and mount checks passed. - Recorded requirement status: 44 Verified, 10 explicitly Accepted and Q-08 awaiting stable promotion. User performance/migrated-workflow waivers remain explicit acceptance, not measured passes. ## Limits and follow-up The deployed candidate remains dev.118; dev.119 changes CI/version tooling rather than application behavior. Personal OIDC login, a new production GPU/Reddit/VPN job and production rollback were not claimed by the post-activation checks. Stable 2.0.0 promotion/tagging and persistent operator deployment remain separate. Detailed evidence is in REQUIREMENTS-TRACE.md and acceptance/root-transition-2026-10-02.md.
nimmo added 120 commits 2026-10-02 14:07:38 +01:00
docs: record successful operator V2 production test activation
All checks were successful
Build and Push Attic Cache / build (pull_request) Successful in 37s
AI pull-request review / review (pull_request) Successful in 7m58s
438ea0281d
Author
Owner

Automated code review

Reviewed commit: 438ea0281dea5dc130b4374adb49ba23d12f2233

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The pull request transitions the repository root to the V2 application, removing legacy V1 Dockerfiles and updating CI/tooling documentation. The primary technical change is the deletion of Dockerfile.amd, Dockerfile.cpu, and Dockerfile.nvidia in favor of Nix-based packaging. A significant finding is that the automated unit test gate (npm test) fails with 46 failures, primarily due to missing module resolution errors (ERR_MODULE_NOT_FOUND). While the PR description claims tests pass locally, the provided deterministic check output contradicts this, indicating a likely environment mismatch or missing dependency in the review context. The deletion of Dockerfiles is consistent with the stated goal of using Nix packages for deployment, but the test failure must be resolved before merging.

The repository has transitioned to a V2 root structure with version 2.0.0-dev.119. The diff includes documentation updates, acceptance test evidence, and critical patches to the BDFR downloader (bdfr-patches/downloader.py and resource.py) to support V2 callback schemas, job IDs, and improved error handling. A legacy backup utility is also added.

Blocking findings

None.

Important findings

  • Deletion of Dockerfiles without explicit removal notice in summary (Dockerfile.amd; medium confidence)
    Diff: diff --git a/Dockerfile.amd b/Dockerfile.amd deleted file mode 100644 (and similar for cpu/nvidia)
    Impact: Users relying on Docker Compose for local development or legacy deployments will lose the ability to build images from source. The PR summary mentions Nix packages but does not explicitly warn about the removal of Docker support.
    Suggested fix: Ensure the README and DEPLOYMENT.md clearly state that Docker is no longer supported and direct users to the Nix-based setup instructions. Consider adding a deprecation notice in previous versions if this is a breaking change for existing users.

  • BDFR callback schema defaults to v1 if not explicitly set (bdfr-patches/downloader.py:45; high confidence)
    The code sets self._redview_callback_schema = os.environ.get("REDVIEW_CALLBACK_SCHEMA", "v1"). If the environment variable is not set, it defaults to 'v1'. The logic for sending job IDs and field names (user vs poster) depends on this schema value.
    Impact: If the V2 worker does not explicitly set REDVIEW_CALLBACK_SCHEMA=v2, the BDFR process will continue using V1 callback formats (e.g., sending 'poster' instead of 'user', omitting 'rip_job_id'). This could lead to data integrity issues or failed callbacks in a mixed-version environment.
    Suggested fix: Ensure that the V2 worker configuration explicitly sets REDVIEW_CALLBACK_SCHEMA=v2 when invoking BDFR. Consider adding a validation check or warning if the schema is not explicitly set to 'v2' in a V2 context.

Suggestions

  • Documentation updates are extensive but fragmented (README.md; medium confidence)
    Diff: README.md replaced with V2-specific instructions, NixOS module examples, and local run commands.
    Impact: The README has been significantly rewritten. While the content is accurate for V2, the sheer volume of changes makes it hard to review for consistency with other docs like MIGRATION.md and DEPLOYMENT.md.
    Suggested fix: Verify that all code snippets in the new README are tested and match the actual behavior of the V2 package. Ensure links to MIGRATION.md and DEPLOYMENT.md are correct and up-to-date.

  • Missing explicit error handling for missing environment variables in BDFR patch (bdfr-patches/downloader.py:43; medium confidence)
    The code retrieves REDVIEW_CALLBACK_URL, REDVIEW_BASE_URL, and REDVIEW_API_KEY using os.environ.get(). If these are missing, they will be None. The code later uses them in headers and URLs without explicit checks for None before string formatting or dictionary construction (though some parts have conditional checks).
    Impact: If critical environment variables are missing, the BDFR process might fail silently or with unclear errors when attempting to make HTTP requests.
    Suggested fix: Add explicit validation at startup to ensure required environment variables (REDVIEW_CALLBACK_URL, REDVIEW_BASE_URL, REDVIEW_API_KEY) are present and non-empty. Raise a clear error if they are missing.

  • Inconsistent case handling for 'DELETED' user in ignore list (bdfr-patches/downloader.py:140; high confidence)
    The code checks "deleted" in self._redview_ignore_users (lowercase) while the input is processed with .casefold(). However, if the user explicitly adds 'DELETED' to the ignore list via args, it will be stored as 'deleted' due to casefolding. This is consistent, but the string literal 'DELETED' in the original code was uppercase. The change to lowercase 'deleted' in the check is correct given the .casefold() on input.
    Impact: Low. The logic is now consistent with case-insensitive matching. No functional defect, but worth noting for clarity.
    Suggested fix: No action required. The change aligns with the casefolding applied to the ignore list.

Tests and validation

  • unit-tests: failure
    • Raw output: `ageResolve (node:internal/modules/esm/resolve:768:81)

at moduleResolve (node:internal/modules/esm/resolve:855:18)

at defaultResolve (node:internal/modules/esm/resolve:985:11)

at #cachedDefaultResolve (node:internal/modules/esm/loader:731:20)

at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)

at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:310:38)

at ModuleJob._link (node:internal/modules/esm/module_job:182:49) {

code: 'ERR_MODULE_NOT_FOUND'

}

Node.js v22.22.2

Subtest: tests/worker-startup.test.mjs

not ok 51 - tests/worker-startup.test.mjs

duration_ms: 81.45837
type: 'test'
location: '/home/nimmo/.cache/act/8666e3ebfbc99643/hostexecutor/tests/worker-startup.test.mjs:1:1'
failureType: 'testCodeFailure'
exitCode: 1
signal: ~
error: 'test failed'
code: 'ERR_TEST_FAILURE'
...
1..58

tests 58

suites 0

pass 12

fail 46

cancelled 0

skipped 0

todo 0

duration_ms 275.011448

`

Questions

  • The PR description states that '135 Node and 30 Python tests... pass locally', but the provided deterministic check output shows unit-tests: failure with 46 failures. Can you clarify if this is a known issue in the review environment or if the local environment differs significantly?
  • Are there any existing users of the Docker Compose files that need to be notified of their removal? Is there a plan to archive these files or provide migration guidance for Docker users?
  • The openapi.json file is generated and not committed. Does the new CI workflow ensure that the generated OpenAPI spec is validated against the code changes in every PR?
  • Does the V2 worker explicitly set REDVIEW_CALLBACK_SCHEMA=v2 when launching BDFR jobs, or does it rely on the default 'v1' which might be incorrect for V2?
  • Are there any other test files that might have broken paths after moving to the repository root?

Review limitations

  • I cannot run the tests myself to verify the local pass claim.
  • I do not have access to the full repository history or the v1-preservation branch to compare V1 and V2 behavior directly.
  • The review is based on the provided diff and documentation; runtime behavior of the Nix packages cannot be verified.
  • The review is based on the provided diff and deterministic check output. I cannot run the tests or build the project myself.
  • The impact of the BDFR schema default depends on how the V2 worker invokes BDFR, which is not fully visible in the diff.
  • The 'blocking' severity for test failures mentioned in the initial review was removed as it referred to tests/worker-startup.test.mjs which is not in the changed files list provided.

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
  • .gitignore: reviewed — included in a context-limited batch
  • AGENTS.md: reviewed — included in a context-limited batch
  • ARCHITECTURE.md: reviewed — included in a context-limited batch
  • BENCHMARKS.md: reviewed — included in a context-limited batch
  • CHANGELOG.md: reviewed — included in a context-limited batch
  • DEPLOYMENT.md: reviewed — included in a context-limited batch
  • Dockerfile.amd: reviewed — included in a context-limited batch
  • Dockerfile.cpu: reviewed — included in a context-limited batch
  • Dockerfile.nvidia: reviewed — included in a context-limited batch
  • MIGRATION.md: reviewed — included in a context-limited batch
  • PRIORITIES.md: reviewed — included in a context-limited batch
  • README.md: reviewed — included in a context-limited batch
  • REQUIREMENTS-TRACE.md: reviewed — included in a context-limited batch
  • REQUIREMENTS.md: reviewed — included in a context-limited batch
  • VERSION: reviewed — included in a context-limited batch
  • VERSIONING.md: reviewed — included in a context-limited batch
  • acceptance/ops06-2026-10-01.json: reviewed — included in a context-limited batch
  • acceptance/q02-candidate-cleanup-2026-10-01.json: reviewed — included in a context-limited batch
  • acceptance/release-2026-10-02/README.md: reviewed — included in a context-limited batch
  • acceptance/release-2026-10-02/auth-contract.json: reviewed — included in a context-limited batch
  • acceptance/release-2026-10-02/filesystem-recovery.json: reviewed — included in a context-limited batch
  • acceptance/release-2026-10-02/rip-tag-recovery.json: reviewed — included in a context-limited batch
  • acceptance/release-2026-10-02/unsafe-delete.json: reviewed — included in a context-limited batch
  • acceptance/root-transition-2026-10-02.md: reviewed — included in a context-limited batch
  • backup_legacy.py: reviewed — included in a context-limited batch
  • bdfr-patches/downloader.py: reviewed — included in a context-limited batch
  • bdfr-patches/resource.py: 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: 30
  • Previous automated review: none found
  • Findings: 5
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `438ea0281dea5dc130b4374adb49ba23d12f2233` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The pull request transitions the repository root to the V2 application, removing legacy V1 Dockerfiles and updating CI/tooling documentation. The primary technical change is the deletion of `Dockerfile.amd`, `Dockerfile.cpu`, and `Dockerfile.nvidia` in favor of Nix-based packaging. A significant finding is that the automated unit test gate (`npm test`) fails with 46 failures, primarily due to missing module resolution errors (`ERR_MODULE_NOT_FOUND`). While the PR description claims tests pass locally, the provided deterministic check output contradicts this, indicating a likely environment mismatch or missing dependency in the review context. The deletion of Dockerfiles is consistent with the stated goal of using Nix packages for deployment, but the test failure must be resolved before merging. The repository has transitioned to a V2 root structure with version 2.0.0-dev.119. The diff includes documentation updates, acceptance test evidence, and critical patches to the BDFR downloader (`bdfr-patches/downloader.py` and `resource.py`) to support V2 callback schemas, job IDs, and improved error handling. A legacy backup utility is also added. ### Blocking findings None. ### Important findings - **Deletion of Dockerfiles without explicit removal notice in summary** (Dockerfile.amd; medium confidence) Diff: `diff --git a/Dockerfile.amd b/Dockerfile.amd deleted file mode 100644` (and similar for cpu/nvidia) Impact: Users relying on Docker Compose for local development or legacy deployments will lose the ability to build images from source. The PR summary mentions Nix packages but does not explicitly warn about the removal of Docker support. Suggested fix: Ensure the README and DEPLOYMENT.md clearly state that Docker is no longer supported and direct users to the Nix-based setup instructions. Consider adding a deprecation notice in previous versions if this is a breaking change for existing users. - **BDFR callback schema defaults to v1 if not explicitly set** (bdfr-patches/downloader.py:45; high confidence) The code sets `self._redview_callback_schema = os.environ.get("REDVIEW_CALLBACK_SCHEMA", "v1")`. If the environment variable is not set, it defaults to 'v1'. The logic for sending job IDs and field names (user vs poster) depends on this schema value. Impact: If the V2 worker does not explicitly set `REDVIEW_CALLBACK_SCHEMA=v2`, the BDFR process will continue using V1 callback formats (e.g., sending 'poster' instead of 'user', omitting 'rip_job_id'). This could lead to data integrity issues or failed callbacks in a mixed-version environment. Suggested fix: Ensure that the V2 worker configuration explicitly sets `REDVIEW_CALLBACK_SCHEMA=v2` when invoking BDFR. Consider adding a validation check or warning if the schema is not explicitly set to 'v2' in a V2 context. ### Suggestions - **Documentation updates are extensive but fragmented** (README.md; medium confidence) Diff: `README.md` replaced with V2-specific instructions, NixOS module examples, and local run commands. Impact: The README has been significantly rewritten. While the content is accurate for V2, the sheer volume of changes makes it hard to review for consistency with other docs like MIGRATION.md and DEPLOYMENT.md. Suggested fix: Verify that all code snippets in the new README are tested and match the actual behavior of the V2 package. Ensure links to MIGRATION.md and DEPLOYMENT.md are correct and up-to-date. - **Missing explicit error handling for missing environment variables in BDFR patch** (bdfr-patches/downloader.py:43; medium confidence) The code retrieves `REDVIEW_CALLBACK_URL`, `REDVIEW_BASE_URL`, and `REDVIEW_API_KEY` using `os.environ.get()`. If these are missing, they will be `None`. The code later uses them in headers and URLs without explicit checks for `None` before string formatting or dictionary construction (though some parts have conditional checks). Impact: If critical environment variables are missing, the BDFR process might fail silently or with unclear errors when attempting to make HTTP requests. Suggested fix: Add explicit validation at startup to ensure required environment variables (`REDVIEW_CALLBACK_URL`, `REDVIEW_BASE_URL`, `REDVIEW_API_KEY`) are present and non-empty. Raise a clear error if they are missing. - **Inconsistent case handling for 'DELETED' user in ignore list** (bdfr-patches/downloader.py:140; high confidence) The code checks `"deleted" in self._redview_ignore_users` (lowercase) while the input is processed with `.casefold()`. However, if the user explicitly adds 'DELETED' to the ignore list via args, it will be stored as 'deleted' due to casefolding. This is consistent, but the string literal 'DELETED' in the original code was uppercase. The change to lowercase 'deleted' in the check is correct given the `.casefold()` on input. Impact: Low. The logic is now consistent with case-insensitive matching. No functional defect, but worth noting for clarity. Suggested fix: No action required. The change aligns with the casefolding applied to the ignore list. ### Tests and validation - unit-tests: **failure** - Raw output: `ageResolve (node:internal/modules/esm/resolve:768:81) # at moduleResolve (node:internal/modules/esm/resolve:855:18) # at defaultResolve (node:internal/modules/esm/resolve:985:11) # at \#cachedDefaultResolve (node:internal/modules/esm/loader:731:20) # at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38) # at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:310:38) # at ModuleJob._link (node:internal/modules/esm/module_job:182:49) { # code: 'ERR_MODULE_NOT_FOUND' # } # Node.js v22.22.2 # Subtest: tests/worker-startup.test.mjs not ok 51 - tests/worker-startup.test.mjs --- duration_ms: 81.45837 type: 'test' location: '/home/nimmo/.cache/act/8666e3ebfbc99643/hostexecutor/tests/worker-startup.test.mjs:1:1' failureType: 'testCodeFailure' exitCode: 1 signal: ~ error: 'test failed' code: 'ERR_TEST_FAILURE' ... 1..58 # tests 58 # suites 0 # pass 12 # fail 46 # cancelled 0 # skipped 0 # todo 0 # duration_ms 275.011448 ` ### Questions - The PR description states that '135 Node and 30 Python tests... pass locally', but the provided deterministic check output shows `unit-tests: failure` with 46 failures. Can you clarify if this is a known issue in the review environment or if the local environment differs significantly? - Are there any existing users of the Docker Compose files that need to be notified of their removal? Is there a plan to archive these files or provide migration guidance for Docker users? - The `openapi.json` file is generated and not committed. Does the new CI workflow ensure that the generated OpenAPI spec is validated against the code changes in every PR? - Does the V2 worker explicitly set `REDVIEW_CALLBACK_SCHEMA=v2` when launching BDFR jobs, or does it rely on the default 'v1' which might be incorrect for V2? - Are there any other test files that might have broken paths after moving to the repository root? ### Review limitations - I cannot run the tests myself to verify the local pass claim. - I do not have access to the full repository history or the `v1-preservation` branch to compare V1 and V2 behavior directly. - The review is based on the provided diff and documentation; runtime behavior of the Nix packages cannot be verified. - The review is based on the provided diff and deterministic check output. I cannot run the tests or build the project myself. - The impact of the BDFR schema default depends on how the V2 worker invokes BDFR, which is not fully visible in the diff. - The 'blocking' severity for test failures mentioned in the initial review was removed as it referred to `tests/worker-startup.test.mjs` which is not in the changed files list provided. ### 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 - `.gitignore`: **reviewed** — included in a context-limited batch - `AGENTS.md`: **reviewed** — included in a context-limited batch - `ARCHITECTURE.md`: **reviewed** — included in a context-limited batch - `BENCHMARKS.md`: **reviewed** — included in a context-limited batch - `CHANGELOG.md`: **reviewed** — included in a context-limited batch - `DEPLOYMENT.md`: **reviewed** — included in a context-limited batch - `Dockerfile.amd`: **reviewed** — included in a context-limited batch - `Dockerfile.cpu`: **reviewed** — included in a context-limited batch - `Dockerfile.nvidia`: **reviewed** — included in a context-limited batch - `MIGRATION.md`: **reviewed** — included in a context-limited batch - `PRIORITIES.md`: **reviewed** — included in a context-limited batch - `README.md`: **reviewed** — included in a context-limited batch - `REQUIREMENTS-TRACE.md`: **reviewed** — included in a context-limited batch - `REQUIREMENTS.md`: **reviewed** — included in a context-limited batch - `VERSION`: **reviewed** — included in a context-limited batch - `VERSIONING.md`: **reviewed** — included in a context-limited batch - `acceptance/ops06-2026-10-01.json`: **reviewed** — included in a context-limited batch - `acceptance/q02-candidate-cleanup-2026-10-01.json`: **reviewed** — included in a context-limited batch - `acceptance/release-2026-10-02/README.md`: **reviewed** — included in a context-limited batch - `acceptance/release-2026-10-02/auth-contract.json`: **reviewed** — included in a context-limited batch - `acceptance/release-2026-10-02/filesystem-recovery.json`: **reviewed** — included in a context-limited batch - `acceptance/release-2026-10-02/rip-tag-recovery.json`: **reviewed** — included in a context-limited batch - `acceptance/release-2026-10-02/unsafe-delete.json`: **reviewed** — included in a context-limited batch - `acceptance/root-transition-2026-10-02.md`: **reviewed** — included in a context-limited batch - `backup_legacy.py`: **reviewed** — included in a context-limited batch - `bdfr-patches/downloader.py`: **reviewed** — included in a context-limited batch - `bdfr-patches/resource.py`: **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: 30 - Previous automated review: none found - Findings: 5 </details>
nimmo merged commit 7bfffff512 into main 2026-10-02 14:16:54 +01:00
nimmo deleted branch v2-rewrite 2026-10-02 14:16:55 +01:00
Author
Owner

For completeness after the approved merge: the advisory unit-tests failure came from the V1 base-commit review command (bare npm test in an unbuilt checkout), rather than the authoritative V2 package gate. The root package gate passed all 135 Node and 30 Python tests locally and in the remote build workflow. OpenAPI generation/contracts and package installation are checked there. The worker explicitly supplies REDVIEW_CALLBACK_SCHEMA=v2, the rip job ID and private callback authentication; tests/rip.test.mjs fails its subprocess if those are absent and exercises the authenticated callback. BDFR remains usable without optional Redview integration, so requiring callback environment for every standalone BDFR invocation would change intended behavior. V1 Dockerfiles were intentionally removed from the active rewrite; they remain on v1-preservation, while V2 uses the documented Nix/browser deployment.

For completeness after the approved merge: the advisory unit-tests failure came from the V1 base-commit review command (bare npm test in an unbuilt checkout), rather than the authoritative V2 package gate. The root package gate passed all 135 Node and 30 Python tests locally and in the remote build workflow. OpenAPI generation/contracts and package installation are checked there. The worker explicitly supplies REDVIEW_CALLBACK_SCHEMA=v2, the rip job ID and private callback authentication; tests/rip.test.mjs fails its subprocess if those are absent and exercises the authenticated callback. BDFR remains usable without optional Redview integration, so requiring callback environment for every standalone BDFR invocation would change intended behavior. V1 Dockerfiles were intentionally removed from the active rewrite; they remain on v1-preservation, while V2 uses the documented Nix/browser deployment.
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!10
No description provided.