Replace V1 with the root-layout V2 rewrite #10
Loading…
Reference in a new issue
No description provided.
Delete branch "v2-rewrite"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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.
Automated code review
Reviewed commit:
438ea0281dea5dc130b4374adb49ba23d12f2233Verdict: 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, andDockerfile.nvidiain 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.pyandresource.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=v2when 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.mdreplaced 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, andREDVIEW_API_KEYusingos.environ.get(). If these are missing, they will beNone. The code later uses them in headers and URLs without explicit checks forNonebefore 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
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
unit-tests: failurewith 46 failures. Can you clarify if this is a known issue in the review environment or if the local environment differs significantly?openapi.jsonfile 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?REDVIEW_CALLBACK_SCHEMA=v2when launching BDFR jobs, or does it rely on the default 'v1' which might be incorrect for V2?Review limitations
v1-preservationbranch to compare V1 and V2 behavior directly.tests/worker-startup.test.mjswhich 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 batchAGENTS.md: reviewed — included in a context-limited batchARCHITECTURE.md: reviewed — included in a context-limited batchBENCHMARKS.md: reviewed — included in a context-limited batchCHANGELOG.md: reviewed — included in a context-limited batchDEPLOYMENT.md: reviewed — included in a context-limited batchDockerfile.amd: reviewed — included in a context-limited batchDockerfile.cpu: reviewed — included in a context-limited batchDockerfile.nvidia: reviewed — included in a context-limited batchMIGRATION.md: reviewed — included in a context-limited batchPRIORITIES.md: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchREQUIREMENTS-TRACE.md: reviewed — included in a context-limited batchREQUIREMENTS.md: reviewed — included in a context-limited batchVERSION: reviewed — included in a context-limited batchVERSIONING.md: reviewed — included in a context-limited batchacceptance/ops06-2026-10-01.json: reviewed — included in a context-limited batchacceptance/q02-candidate-cleanup-2026-10-01.json: reviewed — included in a context-limited batchacceptance/release-2026-10-02/README.md: reviewed — included in a context-limited batchacceptance/release-2026-10-02/auth-contract.json: reviewed — included in a context-limited batchacceptance/release-2026-10-02/filesystem-recovery.json: reviewed — included in a context-limited batchacceptance/release-2026-10-02/rip-tag-recovery.json: reviewed — included in a context-limited batchacceptance/release-2026-10-02/unsafe-delete.json: reviewed — included in a context-limited batchacceptance/root-transition-2026-10-02.md: reviewed — included in a context-limited batchbackup_legacy.py: reviewed — included in a context-limited batchbdfr-patches/downloader.py: reviewed — included in a context-limited batchbdfr-patches/resource.py: reviewed — included in a context-limited batchReview metadata
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.