TASK22057: phase18 additional consolidation slices

This commit is contained in:
2026-03-14 06:52:17 +00:00
parent daa38d6459
commit fffe1d19dd
15 changed files with 460 additions and 66 deletions
+27
View File
@@ -568,6 +568,33 @@
- Broader consistency scan note:
- no additional broad hash/400 consistency gaps were identified in `pages/api/endpoint/**` in this pass.
## Phase 18 additional consolidation slices (2026-03-14)
- Continued on branch:
- `TASK22057-phase17-hardening-closeout`
- Completed all three requested additional slices:
1. endpoint logging/input hygiene
2. file hash-guard flow consistency
3. create/update input-guard + logging hygiene
- Touched handlers:
- `pages/api/endpoint/deletewatchedcases_api.js`
- `pages/api/endpoint/getaccounts_api.js`
- `pages/api/endpoint/getbasicsearchpaged_api.js`
- `pages/api/endpoint/getappealpdfdocuments_api.js`
- `pages/api/file/deleteblob.js`
- `pages/api/file/deleteawaitingsubmissionfromblob.js`
- `pages/api/file/getprogressobjblob.js`
- `pages/api/file/getbloblist.js`
- `pages/api/file/createcase_api.js`
- `pages/api/file/updatecase_api.js`
- `pages/api/file/editRepJson.js`
- Outcome:
- consistent early 400 guard behavior for missing/invalid required inputs/hash in selected handlers
- noisy direct logs removed in touched sensitive flows
- no response-shape/signature contract changes intended
- Added focused test pack:
- `tests/phase18/service-behaviour.test.cjs` (8/8 pass)
## Likely next steps
1. Stabilize and simplify breadcrumb/back-link decision logic with focused regression checks.
+58
View File
@@ -1156,3 +1156,61 @@ Validation:
Follow-ups:
- If desired, run additional integrated HTTP/manual checks in an environment with full relay/storage dependencies for end-to-end happy-path confirmation beyond mocked behaviour tests.
---
### CL-032: Phase 18 additional consolidation slices — endpoint/file consistency and guard hygiene
date: 2026-03-14
author: Cline
scope: `pages/api/endpoint/{deletewatchedcases_api,getaccounts_api,getbasicsearchpaged_api,getappealpdfdocuments_api}.js`, `pages/api/file/{deleteblob,deleteawaitingsubmissionfromblob,getprogressobjblob,getbloblist,createcase_api,updatecase_api,editRepJson}.js`, `tests/phase18/service-behaviour.test.cjs`, `memory-bank/*`
type: change
rationale: Complete the user-requested three additional small, reversible hardening slices (logging hygiene, hash-guard flow consistency, and required-input guard consistency) without broad refactor or contract drift.
impact: Improves consistency of negative-path behavior and reduces noisy logging in selected sensitive handlers while preserving response/signature contracts.
status: completed
Summary:
- Implemented all three requested additional slices:
1. endpoint logging/input hygiene
2. file hash-guard flow consistency
3. create/update input-guard + logging hygiene
- Endpoint updates:
- `deletewatchedcases_api`: added required `watchedCaseID` early 400 guard and removed direct URL logging.
- `getaccounts_api`: added required `emailAddress` early 400 guard and removed direct query logging.
- `getbasicsearchpaged_api`: added required `searchString` early 400 guard and removed noisy query logging.
- `getappealpdfdocuments_api`: added required `incidentid` early 400 guard and removed direct URL logging.
- File handler updates:
- standardized hash-check flow by removing redundant post-validation branches in:
- `deleteblob`
- `deleteawaitingsubmissionfromblob`
- `getprogressobjblob`
- `getbloblist`
- added required-input early 400 guards in:
- `createcase_api` (contact/appealType/container/lpa)
- `updatecase_api` (collection/appealObj/incident/body)
- removed noisy tag logging in `editRepJson`.
- Added focused test pack:
- `tests/phase18/service-behaviour.test.cjs` with negative-path and contract-preserving happy-path checks (8/8 pass).
Validation:
- `node tests/phase6/service-parity.test.cjs` -> pass
- `node tests/phase6/service-behaviour.test.cjs` -> pass (8/8)
- `node tests/phase7/service-behaviour.test.cjs` -> pass (12/12)
- `node tests/phase8/service-behaviour.test.cjs` -> pass (5/5)
- `node tests/phase9/service-behaviour.test.cjs` -> pass (5/5)
- `node tests/phase10/service-behaviour.test.cjs` -> pass (5/5)
- `node tests/phase11/service-behaviour.test.cjs` -> pass (4/4)
- `node tests/phase12/service-behaviour.test.cjs` -> pass (4/4)
- `node tests/phase13/service-behaviour.test.cjs` -> pass (7/7)
- `node tests/phase14/service-behaviour.test.cjs` -> pass (9/9)
- `node tests/phase15/service-behaviour.test.cjs` -> pass (5/5)
- `node tests/phase16/service-behaviour.test.cjs` -> pass (4/4)
- `node tests/phase17/service-behaviour.test.cjs` -> pass (6/6)
- `node tests/phase18/service-behaviour.test.cjs` -> pass (8/8)
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps` warnings)
Follow-ups:
- Optional: execute integrated manual HTTP matrix for phase-18 touched handlers in an environment with full relay/storage dependencies for non-mocked happy-path verification.
@@ -612,6 +612,50 @@ Status key: `[x] done`, `[ ] pending`
- `tests/phase17/service-behaviour.test.cjs`
- Re-run phase6phase17 baseline tests and lint after rollback to confirm parity.
### Phase 18 additional consolidation slices snapshot (2026-03-14)
Status key: `[x] done`, `[ ] pending`
1. `[x]` Confirm requested scope expansion to implement all 3 additional slices
2. `[x]` Apply endpoint logging/input hygiene slice
- `pages/api/endpoint/deletewatchedcases_api.js`
- `pages/api/endpoint/getaccounts_api.js`
- `pages/api/endpoint/getbasicsearchpaged_api.js`
- `pages/api/endpoint/getappealpdfdocuments_api.js`
3. `[x]` Apply file hash-guard flow consistency slice
- `pages/api/file/deleteblob.js`
- `pages/api/file/deleteawaitingsubmissionfromblob.js`
- `pages/api/file/getprogressobjblob.js`
- `pages/api/file/getbloblist.js`
4. `[x]` Apply create/update input-guard + logging hygiene slice
- `pages/api/file/createcase_api.js`
- `pages/api/file/updatecase_api.js`
- `pages/api/file/editRepJson.js`
5. `[x]` Add focused phase-18 behavioural tests
- added `tests/phase18/service-behaviour.test.cjs`
- negative-path coverage for required inputs/hash
- contract-preserving happy-path checks on selected handlers
6. `[x]` Execute validation bundle
- phase6 parity + phase6phase18 behavioural tests all pass
- lint warnings only (pre-existing `react-hooks/exhaustive-deps` set)
### Phase 18 rollback notes
- Revert files in this slice:
- `pages/api/endpoint/deletewatchedcases_api.js`
- `pages/api/endpoint/getaccounts_api.js`
- `pages/api/endpoint/getbasicsearchpaged_api.js`
- `pages/api/endpoint/getappealpdfdocuments_api.js`
- `pages/api/file/deleteblob.js`
- `pages/api/file/deleteawaitingsubmissionfromblob.js`
- `pages/api/file/getprogressobjblob.js`
- `pages/api/file/getbloblist.js`
- `pages/api/file/createcase_api.js`
- `pages/api/file/updatecase_api.js`
- `pages/api/file/editRepJson.js`
- `tests/phase18/service-behaviour.test.cjs`
- Re-run phase6phase18 baseline tests and lint after rollback to confirm parity.
## Safe execution mode for migration chunks (required)
To reduce terminal hangs during bulk migration work, run refactor chunks in **safe stepwise mode** instead of long chained commands.