From c0034eb329ed14c18fd6537183488bea19e8dc0f Mon Sep 17 00:00:00 2001 From: Nirmal Khedkar Date: Fri, 6 Nov 2026 14:43:19 -0800 Subject: [PATCH 1/3] docs: record legacy account verification reachability Document that the non-minimal server mounts inline auth and user handlers without loading the legacy registration or verification controller. Retire conditional backlog item 07 for the inspected main snapshot, while keeping undocumented external consumers and pending identity contracts explicit. Link the audit from backend routing documentation. No runtime behavior, account migration policy, or verification endpoint changes are included. Validation: source and runtime reachability checks, complete backend test suite, and full Qlty baseline/final comparison pass with no new findings. Signed-off-by: Nirmal Khedkar --- backend/README.md | 3 + docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md | 91 +++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md diff --git a/backend/README.md b/backend/README.md index ef3c8d5..1008bca 100644 --- a/backend/README.md +++ b/backend/README.md @@ -56,6 +56,9 @@ These settings allow the backend services to connect to Redis for queue manageme ## Routing +For the legacy account-verification reachability finding and its boundary with +pending account PRs, see the [audit](../docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md). + Main mounts (see `server.js`): - `/health` – health check - `/uploads/*` – static uploads diff --git a/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md b/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md new file mode 100644 index 0000000..11f1a27 --- /dev/null +++ b/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md @@ -0,0 +1,91 @@ +# Legacy account verification reachability audit + +Reviewed on 2026-11-06 against upstream `main` at +`9373310afff24ca3294367e6308702446876bc2a`. + +## Disposition of workspace backlog item 07 + +Retire the conditional legacy-verification candidate for this source snapshot. +No supported in-repository caller was found for either `registerUser` or +`verifyUser` in `backend/controllers/user_controller.js`. The server does not +mount this controller. There is therefore no demonstrated reachable verification +lookup defect to repair under item 07's conditional scope. + +This is a reachability finding, not a claim that account verification works or +that all identity security requirements are satisfied. Leave the legacy module +in place; removing it could affect an undocumented external consumer. An external +consumer or an explicit maintainer decision to support these helpers would reopen +the candidate and require an agreed account-lookup/migration contract. + +## Evidence + +- `backend/server.js` mounts `backend/routes/authRoutes.js` at `/api/auth` and + `backend/routes/userRoutes.js` at `/users` in non-minimal mode. +- The auth router defines `GET /test`, `POST /register` and `POST /login`. + Registration and login are inline handlers, independent of the legacy module. +- The user router defines `GET /` and `POST /`, also using inline handlers. +- A search of tracked source, configuration and scripts found no reference to + the legacy module name or either exported function outside its definition file. + This includes the frontend and backend tests, not only HTTP routes. +- A runtime inspection loaded the actual non-minimal server, confirmed both + account routers were mounted, enumerated the methods above and confirmed the + legacy module was absent from Node's module cache. Unrelated BullMQ queue and + worker constructors were replaced for this inspection to avoid Redis access; + startup interval handles were cleared before their callbacks ran. Account + routers and their handlers were not replaced, and no account writes were sent. +- The public NTARI Slack search found no `verifyUser` support declaration. + The historical Agrinet channel ID was inaccessible; search absence is not + proof that no external caller or private support agreement exists. + +To reproduce the source check from the repository root: + +```sh +rg -n 'user_controller|registerUser|verifyUser' backend frontend scripts +rg -n 'authRoutes|userRoutes' backend/server.js +rg -n 'router\.(get|post|put|patch|delete)' backend/routes/authRoutes.js backend/routes/userRoutes.js +``` + +The first command should find only the two declarations in the legacy controller. +The other commands show the mounted routers and their methods. Inspect dynamic +loading or new entrypoints separately if those mechanisms change. + +The registration response currently says “Please verify your email/phone.” +That text is not evidence of a working verification endpoint, code-delivery +service or supported caller. This audit does not add such a workflow or change +that existing response contract. + +## Boundary with pending account work + +The following PRs were still open when inspected: + +- [#199](https://github.com/NTARI-RAND/Agrinet/pull/199), head + `af02744744e782259ec0db9e146cad81035bd7d3`, owns email claims, conditional + registration, direct login lookup and paginated backfill. Its proposed + trim/lowercase lookup and duplicate-account operator decisions are not adopted + by this audit. It does not change the legacy controller. +- [#197](https://github.com/NTARI-RAND/Agrinet/pull/197), head + `3f8c1285d00edbaf482992d409882c516ebc921c`, owns account authorization and + privileged user provisioning, including overlapping auth/user routes. +- [#194](https://github.com/NTARI-RAND/Agrinet/pull/194), head + `05b894f082f03a7e9cf2a6ee3012093999415155`, overlaps user-route pagination + and account response handling. + +Do not duplicate those PRs, introduce a `UserEmails` table here, mount a new +verification route, or silently choose a duplicate-account migration policy. +If legacy support is established later, reconcile these account contracts first. + +## Contribution and acceptance boundary + +This document follows item 07's explicit alternative: establish reachability, +then retire the conditional candidate with evidence when no supported caller is +found. Lookup-beyond-first-page, uniqueness and ambiguous-account behavior checks +apply only if a supported legacy path is retained; they are not claimed passing +or implemented by this disposition. + +The [NTARI Bug-Build-Test culture](https://ntari.slack.com/docs/T0978JCFFSL/F0C9PQT2WTW) +requires contributions through a fork and PR, with a DCO sign-off on every commit. +The repository's `CLAUDE.md` also requires human review and prohibits authors +from merging their own PRs. This audit changes no runtime behavior, identity +policy, record format, covenant rule or settlement mechanism. No governance or +conformance binding is amended. Slack task adoption and completion are separate +workflow actions; this document does not claim that any Slack task was updated. From f34bcb95ddb59a15bc06855e938a5f4ff23921b5 Mon Sep 17 00:00:00 2001 From: Nirmal Khedkar Date: Fri, 6 Nov 2026 14:46:23 -0800 Subject: [PATCH 2/3] docs: clarify legacy verification support boundary Describe server reachability and support limitations directly so the audit stands on its own. Preserve the findings and pending account-PR boundaries. Signed-off-by: Nirmal Khedkar --- docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md b/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md index 11f1a27..50b9757 100644 --- a/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md +++ b/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md @@ -3,19 +3,18 @@ Reviewed on 2026-11-06 against upstream `main` at `9373310afff24ca3294367e6308702446876bc2a`. -## Disposition of workspace backlog item 07 +## Legacy verification support boundary -Retire the conditional legacy-verification candidate for this source snapshot. No supported in-repository caller was found for either `registerUser` or `verifyUser` in `backend/controllers/user_controller.js`. The server does not mount this controller. There is therefore no demonstrated reachable verification -lookup defect to repair under item 07's conditional scope. +lookup defect to repair in the inspected application. This is a reachability finding, not a claim that account verification works or that all identity security requirements are satisfied. Leave the legacy module in place; removing it could affect an undocumented external consumer. An external -consumer or an explicit maintainer decision to support these helpers would reopen -the candidate and require an agreed account-lookup/migration contract. +consumer or an explicit maintainer decision to support these helpers would require +a new review and an agreed account-lookup/migration contract. ## Evidence @@ -76,9 +75,9 @@ If legacy support is established later, reconcile these account contracts first. ## Contribution and acceptance boundary -This document follows item 07's explicit alternative: establish reachability, -then retire the conditional candidate with evidence when no supported caller is -found. Lookup-beyond-first-page, uniqueness and ambiguous-account behavior checks +This review establishes reachability before proposing a lookup change. No +supported caller was found, so no legacy lookup change is proposed. +Lookup-beyond-first-page, uniqueness and ambiguous-account behavior checks apply only if a supported legacy path is retained; they are not claimed passing or implemented by this disposition. From 56b126da820cd315b789175c9f3e7c3d308227f9 Mon Sep 17 00:00:00 2001 From: Nirmal Khedkar Date: Mon, 16 Nov 2026 18:26:37 -0800 Subject: [PATCH 3/3] docs: scope legacy controller reachability evidence Distinguish source searches from historical issue-template references. The template lists establish no runtime caller or support agreement; account behavior and migration boundaries remain unchanged. Signed-off-by: Nirmal Khedkar --- docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md b/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md index f9afe6a..1615d8a 100644 --- a/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md +++ b/docs/LEGACY_ACCOUNT_VERIFICATION_AUDIT.md @@ -24,9 +24,11 @@ a new review and an agreed account-lookup/migration contract. - The auth router defines `GET /test`, `POST /register` and `POST /login`. Registration and login are inline handlers, independent of the legacy module. - The user router defines `GET /` and `POST /`, also using inline handlers. -- A search of tracked source, configuration and scripts found no reference to - the legacy module name or either exported function outside its definition file. - This includes the frontend and backend tests, not only HTTP routes. +- A search of tracked files in `backend`, `frontend` and `scripts` found no + reference to the legacy module name or either exported function outside its + definition file. This includes frontend and backend tests, not only HTTP routes. + Historical related-file lists in `.github/ISSUE_TEMPLATE` mention the controller + path; those references do not establish a runtime caller or a support agreement. - A runtime inspection loaded the actual non-minimal server, confirmed both account routers were mounted, enumerated the methods above and confirmed the legacy module was absent from Node's module cache. Unrelated BullMQ queue and