42 KiB
Change Log (AI/Human Curated)
Entry Template
date: YYYY-MM-DD
author: <agent|name>
scope: <files/routes/features>
type: change
rationale: <why change was made>
impact: <user/system/security/i18n/a11y>
status: completed|rolled-back|partial
Summary:
Validation:
Follow-ups:
CL-001: Initial AI Enablement Bundle
date: 2026-03-11
author: Cline
scope: .clinerules, ai-prompts/, context/, memory-bank/
type: change
rationale: Establish consistent AI collaboration, delivery guardrails, and durable project context.
impact: Higher consistency/safety in future changes, especially around auth/i18n/public-service reliability.
status: completed
Summary: Created repository-specific governance, prompt templates, context documentation, and memory protocols with seed entries.
Validation:
- File structure and contents created in-repo.
- Content aligned to detected stack and key paths (
next-auth, Prisma, middleware, i18n rewrites, Redux HYDRATE/persist).
Follow-ups:
- Confirm owner assignments for open questions.
- Add automation checks to enforce key guardrails over time.
CL-002: Priority 1 Refactor (Phase 1) — actions/index.js split foundation
date: 2026-03-12
author: Cline
scope: actions/index.js, actions/core/*, actions/services/legacyActionsService.js, actions/clients/README.md, memory-bank/*
type: change
rationale: Reduce coupling in the actions monolith by extracting core helpers while keeping backward-compatible exports for existing consumers.
impact: Lower regression blast radius for future actions-related changes; no intended functional behavior change.
status: completed
Summary:
Extracted helper concerns from actions/index.js into focused actions/core modules (env, logger, hash, token, headers). Replaced actions/index.js with a compatibility barrel and moved operational wrappers into actions/services/legacyActionsService.js with imports from core helpers.
Validation:
- Branch created:
0000-update-actions-monolith. - Compatibility preserved by re-exporting legacy service functions plus core exports from
actions/index.js. - Lint run for regression check.
Follow-ups:
- Phase 2: split
legacyActionsServiceby domain into dedicated service/client modules. - Add helper-focused automated tests for core modules and export parity checks.
CL-003: Priority 1 Refactor (Phase 2) — service grouping via compatibility layer
date: 2026-03-12
author: Cline
scope: actions/services/*, actions/index.js, memory-bank/*
type: change
rationale: Continue reducing monolith risk by introducing domain service boundaries while preserving public action exports.
impact: Maintains backward compatibility for existing ../actions imports; improves maintainability and safer future migration to targeted imports.
status: completed
Summary:
Added grouped service modules (searchService, caseService, accountService, portalService, documentService, referenceDataService, notifyService, adminService, integrationService) plus actions/services/index.js barrel. Updated actions/index.js to export from ./services (and core modules), keeping legacy function names/signatures available.
Validation:
- Service export coverage check confirms all legacy exports are represented in grouped services.
npm run lintstill fails due legacy Next/ESLint option incompatibility (tooling issue, unchanged by this refactor).
Follow-ups:
- Incrementally migrate high-churn consumers to direct service imports.
- Add automated export-parity and helper unit tests.
CL-004: Priority 1 Refactor (Phase 3) — targeted consumer import migration
date: 2026-03-12
author: Cline
scope: components/case/summary.js, pages/api/email/notify.js, selected pages/api/endpoint/*, memory-bank/*
type: change
rationale: Begin replacing broad actions barrel imports with focused service/core module imports in high-churn and representative endpoint areas.
impact: Lower coupling to monolithic action entrypoint while preserving behavior and public compatibility.
status: completed
Summary:
Migrated targeted consumers to direct imports from actions/services/* and actions/core/* without changing function signatures or route contracts.
Validation:
- Lint still blocked by repository ESLint/Next option compatibility issue (pre-existing tooling configuration).
- Manual testing remains required for search/case/myportal/auth/notify/file matrix.
Follow-ups:
- Continue phased import migration for additional
pages/api/endpoint/**handlers. - Add export-parity and helper-level tests as planned.
CL-005: Priority 1 Refactor (Phase 4) — helper hardening + redacted logging baseline
date: 2026-03-12
author: Cline
scope: actions/core/{guards,logger}.js, actions/index.js, selected API handlers
type: change
rationale: Introduce low-risk guard and redaction primitives, then apply them to sensitive/high-churn API paths to reduce injection/privacy risk while preserving behavior.
impact: Better input hygiene and safer diagnostics in selected notify/login/contact flows; no intended contract changes.
status: completed
Summary:
Added guards helper module (isNonEmptyString, sanitizeString, escapeODataString) and logger redaction utility (redactSensitive). Adopted these helpers in notify, getpreferredlanguage_api, and createcrmtask_api handlers.
Validation:
npm run lintremains blocked by existing Next/ESLint options incompatibility in repository tooling.- Targeted diff review confirms changes are scoped to helper hardening and selected handlers.
Follow-ups:
- Continue Phase 4 adoption for additional sensitive file/email/auth handlers.
- Add focused unit tests for
guardsandredactSensitivebehavior.
CL-006: Priority 1 Refactor — consumer migration pass (portal/form/admin utilities)
date: 2026-03-12
author: Cline
scope: components/admin/*, components/case/*, components/myportal/*, components/elements/index.js, components/utils/index.js, lib/*, memory-bank/*
type: change
rationale: Continue Phase 3-style decoupling by replacing broad actions barrel imports with focused service/core imports in high-use consumer files while preserving behavior.
impact: Lower coupling to monolithic action barrel and clearer dependency boundaries; no intended functional behavior change.
status: completed
Summary:
Migrated a targeted set of portal/form/admin utility consumers from ../../actions/../../../actions to explicit imports from actions/services/* and actions/core/*. Also resolved migration-side compile issues in components/myportal/topthree_reps.js (duplicate import source and invalid res.status usage in client context).
Validation:
- In-scope consumer files now have no broad
from "../../actions"/from "../../../actions"imports. npm run lintre-run; result unchanged and blocked by pre-existing Next/ESLint option incompatibility.
Follow-ups:
- Continue migrating remaining broad
actionsimports incomponents/myportal/viewall.js,components/search/addresssearchresults.js, unsubscribe flows, and selected API endpoints. - Add focused manual smoke checks for myportal representations and awaiting-submission deletion/edit flows after this import migration.
CL-007: Priority 1 Refactor — consumer migration pass (viewall/search/unsubscribe)
date: 2026-03-12
author: Cline
scope: components/myportal/viewall.js, components/search/addresssearchresults.js, pages/unsubscribe/[watchlistid].js, pages/unsubscribeall/[watchlistid].js, memory-bank/*
type: change
rationale: Continue Phase 3 decoupling by removing additional broad actions barrel imports in high-use myportal/search/unsubscribe flows and replacing them with focused service/core imports.
impact: Reduced coupling to monolithic action barrel with intended behavior parity; no API contract changes intended.
status: completed
Summary:
Migrated four additional consumers away from ../../actions:
components/myportal/viewall.js->actions/services/documentService,actions/services/portalService,actions/core/loggercomponents/search/addresssearchresults.js->actions/services/portalServicepages/unsubscribe/[watchlistid].js->actions/core/{hash,token,headers,logger}pages/unsubscribeall/[watchlistid].js->actions/core/{hash,token,headers,logger}
Validation:
- Regex verification confirms these four files no longer import from the broad
actionsbarrel. - Repository-wide broad-import scan now reports 11 matches total, including comment-only occurrences and remaining endpoint/file handlers pending migration.
Follow-ups:
- Migrate remaining non-comment broad imports in selected
pages/api/endpoint/*andpages/api/file/*handlers. - Run focused manual smoke checks for myportal view-all watch/unwatch + unsubscribe routes (EN/CY path sanity and negative paths).
CL-008: Priority 1 Refactor — endpoint/file proxy import migration chunk
date: 2026-03-12
author: Cline
scope: pages/api/endpoint/*, pages/api/file/* (selected handlers), memory-bank/*
type: change
rationale: Continue Phase 3 migration by replacing broad actions barrel imports in selected endpoint/file proxy handlers with focused actions/core/* and service module imports.
impact: Further reduces monolithic import coupling in API paths while preserving existing request/response behavior and hash/token/header patterns.
status: completed
Summary:
Migrated these handlers away from broad ../../../actions imports:
pages/api/endpoint/getmylpacases_api.jsgetLPA->actions/services/referenceDataServiceazureHeaders,consoleLogger,getToken,hashAPIPath->actions/core/*- removed local duplicated
hashAPIPathimplementation
pages/api/endpoint/getbasicdnssearchpaged_api.jspages/api/endpoint/getsearchdocumentdetailspaged_api.jspages/api/endpoint/getbasicsearchpaged_api.jspages/api/file/getawaitingsubmissionfromblobproxy.jspages/api/file/getrepsblobproxy.jspages/api/file/getbloblistproxy.jspages/api/file/createappealcompletemessageproxy_api.js
Validation:
- Regex scans over
pages/api/endpointandpages/api/fileshow 0 remaining broadfrom "../../../actions"imports. git status --shortconfirms this chunk is isolated to the targeted endpoint/file handlers.
Follow-ups:
- Run focused manual smoke checks for touched endpoint/file flows (paged search APIs, LPA case retrieval, blob proxy endpoints).
- Continue hardening pass for sensitive handlers with guard/redaction helpers where not yet applied.
CL-009: Priority 1 import-migration wave checked in + PR completed; handover to next branch
date: 2026-03-13
author: Cline
scope: actions/services/* consumer and endpoint migrations (completed), planning handover docs
type: change
rationale: Record that the current import-migration wave has been checked in and completed via pull request, and set the next refactor slice to start on a new branch.
impact: Clear project continuity and reduced risk of overlap between completed import migration work and upcoming legacyActionsService decomposition.
status: completed
Summary:
- Import migration wave is now completed, checked in, and PR’d.
- Latest commits in this wave include:
f0202bb— viewall/search/unsubscribe focused importsfa98535— endpoint/file proxy focused importsbef8f25— stale legacy comment cleanup
- Next chunk is explicitly designated as a new-branch activity focused on splitting
actions/services/legacyActionsService.jsinto smaller direct service/client modules.
Validation:
- Broad
.../actionsimport scans now show no active matches in.jsfiles (legacy references are comment-only/removed). - Branch history confirms migration commits are present and ordered for safe rollback.
Follow-ups:
- Create new branch for Phase 5 decomposition work.
- Start with low-risk extraction slices from
legacyActionsService.js(reference/search first), then portal/document batches.
CL-010: Phase 5 kickoff — first legacy split slice (search/reference direct modules)
date: 2026-03-13
author: Cline
scope: actions/services/searchDirectService.js, actions/services/referenceDataDirectService.js, actions/services/{searchService,referenceDataService}.js
type: change
rationale: Start Phase 5 decomposition on a new branch by extracting low-risk search/reference wrappers from legacyActionsService.js into direct domain modules while keeping service exports stable.
impact: Search/reference service exports now route through focused direct modules; compatibility signatures preserved for callers importing from service barrels.
status: completed
Summary:
- Created branch
TASK21997-phase5-legacyactions-splitfromSIPS-Development. - Added
searchDirectService.jscontaining extracted search/address/document-search wrapper implementations. - Added
referenceDataDirectService.jscontaining extracted reference-data wrapper implementations. - Updated
searchService.jsandreferenceDataService.jsto import from the new direct modules instead oflegacyActionsService.
Validation:
npm run lint(result unchanged): still fails due pre-existing Next/ESLint options incompatibility in repository tooling.- Import checks confirm:
searchService.js->./searchDirectServicereferenceDataService.js->./referenceDataDirectService
- Branch/status check confirms only Phase 5 slice files are modified on the new branch.
Follow-ups:
- Continue portal/document extraction slices from
legacyActionsService.jsin small batches. - After each slice, re-point corresponding grouped service modules and remove dead wrappers once no longer referenced.
CL-011: Phase 5 document slice — direct document module extraction
date: 2026-03-13
author: Cline
scope: actions/services/documentDirectService.js, actions/services/documentService.js, memory-bank/*
type: change
rationale: Continue Phase 5 decomposition by extracting document/file wrappers from legacyActionsService.js into a dedicated direct module while preserving grouped service API compatibility.
impact: Document/file grouped service exports now route through focused direct implementation; legacy coupling reduced for document domain with no expected caller contract changes.
status: completed
Summary:
- Added
documentDirectService.jswith extracted blob/file upload, download, pdf, and container helpers. - Re-pointed
documentService.jsimports to./documentDirectService. - Kept export names and signatures unchanged at grouped service boundary.
Validation:
- Service import scan confirms
documentService.jsno longer imports fromlegacyActionsService. - Remaining legacy-backed grouped modules:
portalService,accountService,caseService,adminService,notifyService,integrationService. npm run lintcompletes with warnings only (no blocking errors).
Follow-ups:
- Next recommended slice:
portalDirectServiceextraction, thenaccount/case. - Continue per-slice parity checks and legacy import reduction scan.
CL-012: Phase 5 portal slice — direct portal module extraction
date: 2026-03-13
author: Cline
scope: actions/services/portalDirectService.js, actions/services/portalService.js
type: change
rationale: Continue Phase 5 decomposition by extracting portal-domain wrappers from legacyActionsService into a direct module while preserving grouped service contract stability.
impact: Portal grouped exports now route through a focused direct module; reduced coupling to legacy monolith.
status: completed
Summary:
- Added
portalDirectService.js. - Updated
portalService.jsto import from./portalDirectService.
Validation:
- Legacy import scan reduced remaining
legacyActionsService-backed grouped modules. npm run lintcompletes with warnings only.
Follow-ups:
- Extract account + case direct modules.
CL-013: Phase 5 account/case slice — direct module extraction
date: 2026-03-13
author: Cline
scope: actions/services/{accountDirectService,caseDirectService,accountService,caseService}.js
type: change
rationale: Continue Phase 5 by moving account and case wrappers out of legacy module into dedicated direct modules while keeping grouped service API stable.
impact: Account/case grouped services now point to direct implementations; further legacy decoupling.
status: completed
Summary:
- Added
accountDirectService.jsandcaseDirectService.js. - Re-pointed
accountService.jsandcaseService.js.
Validation:
- Legacy import scan left only admin/integration/notify using legacy.
npm run lintcompletes with warnings only.
Follow-ups:
- Extract admin + integration + notify direct modules.
CL-014: Phase 5 final extraction slice — admin/integration/notify direct modules
date: 2026-03-13
author: Cline
scope: actions/services/{adminDirectService,integrationDirectService,notifyDirectService,adminService,integrationService,notifyService}.js
type: change
rationale: Complete Phase 5 domain decomposition by extracting final legacy-backed grouped services into direct modules.
impact: All grouped service modules now route through direct implementations.
status: completed
Summary:
- Added
adminDirectService.js,integrationDirectService.js,notifyDirectService.js. - Re-pointed
adminService.js,integrationService.js,notifyService.js.
Validation:
actions/servicesscan reports zero./legacyActionsServiceimports.npm run lintcompletes with warnings only.
Follow-ups:
- Remove dead
legacyActionsService.jsimplementation.
CL-015: Phase 5 cleanup — remove legacy actions service
date: 2026-03-13
author: Cline
scope: actions/services/legacyActionsService.js (deleted)
type: change
rationale: Finalize Phase 5 after full routing migration by removing dead legacy implementation module.
impact: Monolithic legacy service removed; architecture now uses grouped service façade + direct per-domain modules.
status: completed
Summary:
- Deleted
actions/services/legacyActionsService.jsafter zero-reference verification.
Validation:
- Project scan confirms no
legacyActionsServicereferences in.jsfiles. npm run lintcompletes with warnings only.npm run buildsucceeds.
Follow-ups:
- Begin next phase: post-split hardening/tests/logging cleanup.
CL-016: Phase 6 hardening — parity tests, safe dedupe, and logging cleanup
date: 2026-03-13
author: Cline
scope: actions/services/*DirectService.js, actions/services/httpServiceUtils.js, tests/phase6/service-parity.test.cjs, memory-bank/*
type: change
rationale: Start post-Phase-5 hardening by adding focused parity checks, reducing repeated axios/error-handling patterns without contract changes, and removing noisy logs in sensitive service paths.
impact: Improved maintainability and safety posture in service layer with preserved grouped-service signatures/return shapes; added regression guard for service export stability.
status: completed
Summary:
- Added
tests/phase6/service-parity.test.cjsto verify:- grouped service import/export parity for search/reference/document/portal/account/case/admin/integration/notify
actions/services/index.jsre-export list stability
- Added
actions/services/httpServiceUtils.jswith shared helpers:logAndReturnResponsebuildEmptyValueErrorResponselogAndReturnEmptyValueErrorResponse
- Applied low-risk dedupe refactors in:
searchDirectService.jsreferenceDataDirectService.jscaseDirectService.jsadminDirectService.js
- Removed debug
console.logtraces from sensitive/noisy direct service flows in:searchDirectService.jsdocumentDirectService.jsportalDirectService.jscaseDirectService.jsadminDirectService.js
- Added focused behavioural service test pack:
tests/phase6/service-behaviour.test.cjs- mocked axios and logger checks to assert success/error contract handling for selected critical functions.
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)npm run lint-> warnings only (pre-existing warning set)- Targeted smoke/negative checks on local dev server:
GET /advancedsearchandGET /cy/advancedsearch-> 200GET /caseandGET /cy/case-> 200GET /myportalandGET /cy/myportal-> 307 to/auth/signin(unauthenticated negative path)GET /api/file/getbloblistproxy?container=test&casefolderID=test-> 400 (negative path)POST /api/email/notifywith{}-> 400 (negative path)GET /searchresultsand/cy/searchresults-> 500 due pre-existing SSR serialization issue (initialState.search.searchStringundefined)
Follow-ups:
- Investigate/fix pre-existing
/searchresultsSSR serialization issue before broader search smoke confidence sign-off. - Optional next increment: extend behavioural coverage to document/portal/account/notify/integration direct-service contracts.
CL-017: Phase 7 hardening — search SSR fix + behavioural expansion for remaining service domains
date: 2026-03-13
author: Cline
scope: pages/searchresults.js, tests/phase7/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Start Phase 7 from a new branch based on origin/SIPS-Development, fix known pre-existing /searchresults SSR serialization failure, and extend behavioural/negative-path coverage for remaining direct-service domains.
impact: Search results SSR now safely serializes when query q is absent; behavioural confidence improved across document/portal/account/notify/integration service contracts with no signature/return-shape changes.
status: completed
Summary:
- Created branch:
TASK21988a-phase7-postphase6-hardening(fromorigin/SIPS-Development). - Fixed pre-existing SSR issue in
pages/searchresults.jsby changing:setSearch(query.q)->setSearch(query?.q || "")
- Added
tests/phase7/service-behaviour.test.cjswith mocked-axios behavioural assertions for:- document
- portal
- account
- notify
- integration
- Included feasible negative-path checks for relay/hash/token-sensitive behavior patterns (hashed URL composition and existing per-function error contracts).
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)node tests/phase7/service-behaviour.test.cjs-> pass (10/10)npm run lint-> warnings only, no new lint errors introduced- Manual smoke/negative-path checks (local dev on
localhost:3001due3000in use):/searchresults,/cy/searchresults-> 200/case,/cy/case-> 200/myportal,/cy/myportal-> 307 to/auth/signin/api/file/getbloblistproxy?container=test&casefolderID=test-> 400POST /api/email/notifywith{}-> 400
Follow-ups:
- Continue incremental hardening in sensitive relay/hash/token flows without changing external contracts.
- Keep lint warning backlog separate from this refactor stream unless explicitly scoped.
Rollback plan:
- Revert
pages/searchresults.jsand removetests/phase7/service-behaviour.test.cjsif regression is observed.
CL-018: Phase 8 hardening — hash enforcement and negative-path standardization in sensitive APIs
date: 2026-03-13
author: Cline
scope: pages/api/file/{deleteblobcase,deleteblobrep,createappealcompletemessage_api}.js, pages/api/endpoint/getportallogin_api.js, actions/services/{documentDirectService,portalDirectService}.js, tests/phase8/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Deliver a small reversible hardening slice by re-enforcing hash guards in high-risk handlers, standardizing invalid-input negative paths, and reducing noisy/sensitive logging while preserving external contracts.
impact: Stronger hash/integrity guard posture and consistent 400 negative paths for invalid/missing hash and required params; no intended response-shape or signature changes.
status: completed
Summary:
- Started from latest
origin/SIPS-Developmenton new branchTASK22017-phase8-hardening-slice. - Re-enabled/enforced hash validation in:
deleteblobcasedeleteblobrepcreateappealcompletemessage_api
- Standardized early 400 handling for missing required query params where feasible:
- container/casefolder/repfile/tempcaseref/emailAddress checks as applicable
- Hardened
getportallogin_api:- explicit early validation for email/hash before token fetch
- removed unnecessary lodash branch complexity while preserving output behavior
- Improved logging discipline in sensitive flow:
- removed noisy
console.logtraces fromcreateappealcompletemessage_api - switched error logging to
consoleLogger
- removed noisy
- Added parity updates required for existing callers after hash re-enforcement:
documentDirectServicenow appends hash ondeleteblobcaseanddeleteblobrepportalDirectServicenow appends hash forcreateappealcompletemessage_apicall using existing hash path contract
- Added focused phase-8 tests:
tests/phase8/service-behaviour.test.cjs- covers invalid/missing hash and missing key inputs as applicable across the 4 target handlers
- includes one valid-hash happy-path contract check for
getportallogin_apivia mocks
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)node tests/phase7/service-behaviour.test.cjs-> pass (10/10)node tests/phase8/service-behaviour.test.cjs-> pass (5/5)npm run lint-> warnings only (pre-existingreact-hooks/exhaustive-depswarnings; no new lint errors)- Manual HTTP checks (local server
http://localhost:3001):- invalid/missing hash for all 4 handlers -> 400
- missing required key params where tested -> 400
- valid-hash spot-check (
getportallogin_api) still returned 400 due upstream relay/CRM behavior in local env (hash gate passed, downstream dependency failed)
Follow-ups:
- Investigate local relay/CRM dependency behavior for
getportallogin_apihappy path in integrated environment. - Continue incremental hash/negative-path hardening for other sensitive
pages/api/file/**handlers still carrying commented bypass patterns.
Rollback plan:
- Revert the four hardened API files and the two direct-service hash append updates.
- Remove
tests/phase8/service-behaviour.test.cjsif the full phase-8 slice is rolled back. - Re-run phase6/phase7 baseline tests and lint to confirm rollback parity.
CL-019: Phase 9 hardening — additional file-handler hash enforcement slice
date: 2026-03-13
author: Cline
scope: pages/api/file/{createrepcompletemessage_api,upload,uploadsinglefile,setupcontainer}.js, actions/services/{portalDirectService,documentDirectService}.js, tests/phase9/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Continue incremental hardening with a small reversible slice focused on additional sensitive file handlers still showing bypassed/commented hash checks or inconsistent negative-path behavior.
impact: Stronger hash/integrity guard posture and standardized 400 negative paths for invalid/missing hash and key params; no intended signature or response-shape contract changes.
status: completed
Summary:
- Started from latest
origin/SIPS-Developmenton branchTASK22019-phase-9-hardening. - Re-enabled/enforced hash validation and early 400 guards in:
createrepcompletemessage_apiuploaduploadsinglefilesetupcontainer
- Reduced noisy logs in sensitive paths and retained structured error logging where applicable.
- Added required caller parity updates:
portalDirectService.sendRepCompleteMessagenow appends hashdocumentDirectService.uploadFiles/uploadRepFiles/uploadSingleFilenow append hash
- Added focused phase-9 tests:
tests/phase9/service-behaviour.test.cjs- negative-path coverage for the 4 selected phase-9 handlers
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)node tests/phase7/service-behaviour.test.cjs-> pass (10/10)node tests/phase8/service-behaviour.test.cjs-> pass (5/5)node tests/phase9/service-behaviour.test.cjs-> pass (5/5)npm run lint-> warnings only (pre-existingreact-hooks/exhaustive-depswarnings; no new lint errors)- Manual HTTP negative-path checks on
localhost:3000:- missing/invalid hash for each selected handler -> 400
- missing required key params where tested -> 400
- Valid-hash HTTP spot-check:
POST /api/file/uploadsinglefile?hash=<valid>-> 200 (hash generated from.env.localkey)
Follow-ups:
- Continue incremental hardening slices for remaining sensitive handlers with commented/bypassed hash checks.
Rollback plan:
- Revert the 4 hardened API handlers and 2 caller parity service files.
- Remove
tests/phase9/service-behaviour.test.cjsif rolling back full phase-9 slice. - Re-run phase6/7/8/9 tests and lint to confirm rollback parity.
CL-020: Phase 10 hardening — file retrieval handlers negative-path standardization
date: 2026-03-13
author: Cline
scope: pages/api/file/{getawaitingsubmissionfromblob,getprogressobjblob,getbloblist,getrepsblob}.js, tests/phase10/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Continue connected hardening slices on the same work-item branch, targeting additional sensitive file retrieval handlers with inconsistent early guards and legacy commented hash/debug handling.
impact: Stronger and more consistent 400 negative-path behavior for missing/invalid hash and missing key params, with no intended signature or response-shape contract changes.
status: completed
Summary:
- Continued from Phase 9 on branch
TASK22019-phase-9-hardening. - Hardened 4 additional handlers:
getawaitingsubmissionfromblobgetprogressobjblobgetbloblistgetrepsblob
- Added explicit early guards for required query/hash inputs.
- Standardized hash mismatch handling to early 400 return.
- Removed legacy commented debug blocks in touched handlers.
- Added focused phase-10 tests:
tests/phase10/service-behaviour.test.cjs- includes negative-path coverage for all 4 handlers and one valid-hash mocked happy path.
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)node tests/phase7/service-behaviour.test.cjs-> pass (10/10)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)npm run lint-> warnings only (pre-existingreact-hooks/exhaustive-depswarnings)- Manual HTTP checks (
localhost:3000):- missing hash for each selected phase-10 handler -> 400
- valid hash
getbloblistspot-check -> 500 due local downstream/storage dependency constraints
Follow-ups:
- Continue next incremental slice for remaining sensitive handlers with commented/bypassed hash checks.
Rollback plan:
- Revert the 4 hardened API handlers.
- Remove
tests/phase10/service-behaviour.test.cjsif rolling back full phase-10 slice. - Re-run phase6/7/8/9/10 tests + lint to confirm rollback parity.
CL-021: Phase 11 hardening — delete/bloblist hash guard standardization
date: 2026-03-13
author: Cline
scope: pages/api/file/{getbloblist,deleteblob,deleteawaitingsubmissionfromblob}.js, tests/phase11/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Continue connected hardening slices on the same work-item branch, targeting additional sensitive blob/delete handlers with inconsistent early guards and legacy commented traces.
impact: More consistent and explicit 400 negative-path handling for missing/invalid hash and key params, with no intended signature or response-shape contract changes.
status: completed
Summary:
- Continued on branch
TASK22019-phase-9-hardening. - Hardened 3 additional handlers:
getbloblistdeleteblobdeleteawaitingsubmissionfromblob
- Added explicit early guards for required query/hash inputs.
- Standardized hash mismatch handling to early 400 return.
- Removed legacy commented debug traces in touched handlers.
- Added focused phase-11 tests:
tests/phase11/service-behaviour.test.cjs- includes negative-path coverage and one valid-hash mocked happy path.
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)node tests/phase7/service-behaviour.test.cjs-> pass (10/10)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)npm run lint-> warnings only (pre-existingreact-hooks/exhaustive-depswarnings)- Manual HTTP checks (
localhost:3000):- missing/invalid hash for selected phase-11 handlers -> 400
- valid-hash
getbloblistspot-check -> 500 due local downstream/storage dependency constraints
Follow-ups:
- Continue next incremental slice for remaining sensitive handlers with commented/bypassed hash checks.
Rollback plan:
- Revert the 3 hardened API handlers.
- Remove
tests/phase11/service-behaviour.test.cjsif rolling back full phase-11 slice. - Re-run phase6/7/8/9/10/11 tests + lint to confirm rollback parity.
CL-022: Phase 12 hardening — download/proxy param and hash guard standardization
date: 2026-03-13
author: Cline
scope: pages/api/file/{downloadblob,getbloblistproxy,getrepsblobproxy,getawaitingsubmissionfromblobproxy}.js, tests/phase12/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Continue connected hardening slices on the same work-item branch, targeting additional sensitive download/proxy handlers with inconsistent early guards.
impact: More consistent and explicit 400 negative-path handling for missing/invalid hash and key params, with no intended signature or response-shape contract changes.
status: completed
Summary:
- Continued on branch
TASK22019-phase-9-hardening. - Hardened 4 additional handlers:
downloadblobgetbloblistproxygetrepsblobproxygetawaitingsubmissionfromblobproxy
- Added explicit early guards for required query/hash inputs.
- Standardized hash mismatch handling to early 400 return for
downloadblob. - Added focused phase-12 tests:
tests/phase12/service-behaviour.test.cjs- includes negative-path coverage and one valid-hash mocked happy path.
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)node tests/phase7/service-behaviour.test.cjs-> pass (10/10)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)npm run lint-> warnings only (pre-existingreact-hooks/exhaustive-depswarnings)- Manual HTTP checks (
localhost:3000):- missing/invalid inputs for selected phase-12 handlers -> 400
- valid-hash
downloadblobspot-check -> 500 due local downstream/storage dependency constraints
Follow-ups:
- Continue next incremental slice for remaining sensitive handlers with commented/bypassed hash checks.
Rollback plan:
- Revert the 4 hardened API handlers.
- Remove
tests/phase12/service-behaviour.test.cjsif rolling back full phase-12 slice. - Re-run phase6/7/8/9/10/11/12 tests + lint to confirm rollback parity.
CL-023: Phase 13 hardening — delete and involvement handler guard standardization
date: 2026-03-13
author: Cline
scope: pages/api/file/{deleteblobcase,deleteblobrep,createcaseinvolvement_api,createrepinvolvement_api}.js, tests/phase13/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Continue connected hardening slices on the same work-item branch, targeting additional sensitive delete/involvement handlers with inconsistent early guard and logging behavior.
impact: More consistent and explicit 400 negative-path handling for missing/invalid hash and required body keys, with no intended signature or response-shape contract changes.
status: completed
Summary:
- Continued on branch
TASK22019-phase-9-hardening. - Hardened 4 additional handlers:
deleteblobcasedeleteblobrepcreatecaseinvolvement_apicreaterepinvolvement_api
- Added explicit early guards for required hash/body inputs.
- Standardized hash mismatch handling to early 400 return for delete handlers.
- Removed noisy body/query logs from involvement handlers.
- Added focused phase-13 tests:
tests/phase13/service-behaviour.test.cjs- includes negative-path coverage and valid-input mocked happy paths.
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> pass (8/8)node tests/phase7/service-behaviour.test.cjs-> pass (10/10)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)npm run lint-> warnings only (pre-existingreact-hooks/exhaustive-depswarnings)- Manual HTTP checks (
localhost:3000):- missing/invalid inputs for selected phase-13 handlers -> 400
- valid-hash
deleteblobcasespot-check -> 500 due local downstream/storage dependency constraints
Follow-ups:
- Continue next incremental slice for remaining sensitive handlers with commented/bypassed hash checks.
Rollback plan:
- Revert the 4 hardened API handlers.
- Remove
tests/phase13/service-behaviour.test.cjsif rolling back full phase-13 slice. - Re-run phase6/7/8/9/10/11/12/13 tests + lint to confirm rollback parity.
CL-024: Phase 14 fix — authenticated server-side hash signing for browser callers
date: 2026-03-13
author: Cline
scope: actions/services/{documentDirectService,portalDirectService}.js, pages/api/endpoint/gethash_api.js, tests/phase14/service-behaviour.test.cjs, memory-bank/*
type: change
rationale: Fix runtime break in authenticated new-appeal journey where client-side hash generation attempted to use server-only HASHKEY.
impact: Restores browser flow while preserving hash-guard posture by moving hash generation to authenticated server endpoint; no intended external API contract changes.
status: completed
Summary:
- Added
gethash_apiendpoint to sign allow-listed API paths server-side. - Endpoint enforces authenticated session and rejects unsupported paths.
- Updated direct services to fetch hash from signer endpoint for browser calls.
- Added server-side fallback hashing only when
HASHKEYexists (non-browser contexts). - Added phase-14 tests for missing-path, invalid-path, unauthenticated, and happy-path signer behavior.
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> passnode tests/phase7/service-behaviour.test.cjs-> passnode tests/phase8/service-behaviour.test.cjs-> passnode tests/phase9/service-behaviour.test.cjs-> passnode tests/phase10/service-behaviour.test.cjs-> passnode tests/phase11/service-behaviour.test.cjs-> passnode tests/phase12/service-behaviour.test.cjs-> passnode tests/phase13/service-behaviour.test.cjs-> passnode tests/phase14/service-behaviour.test.cjs-> pass (4/4)npm run lint-> warnings only (pre-existing warnings)
Follow-ups:
- Keep signer allow-list tight and expand only for explicitly required browser-side hash use cases.
- Continue removing legacy client-side direct hash assumptions as encountered.
CL-025: Phase 14 closeout follow-up — portal-login signer adoption + contract alignment fixes
date: 2026-03-13
author: Cline
scope: actions/services/accountDirectService.js, pages/api/endpoint/gethash_api.js, tests/phase7/service-behaviour.test.cjs, tests/phase14/service-behaviour.test.cjs, pages/api/file/getrepsblob.js, components/elements/index.js, memory-bank/*
type: change
rationale: Extend browser-safe hash signing to portal-login call path, keep signer allow-list explicit, and align an over-tightened file guard with actual endpoint contract discovered during runtime verification.
impact: Removes remaining browser-side hash risk in portal login path; preserves API response contracts while restoring route-accurate parameter validation and resolving Quill runtime import issue.
status: completed
Summary:
- Updated
accountDirectService.getPortalLoginto use/api/endpoint/gethash_apifor signed hash retrieval in browser contexts. - Added
/api/endpoint/getportallogin_apito signer endpoint allow-list ingethash_api.js. - Updated tests to reflect signer-driven behavior and allow-list coverage:
tests/phase7/service-behaviour.test.cjstests/phase14/service-behaviour.test.cjs
- Applied follow-up runtime/contract fixes confirmed during manual verification:
pages/api/file/getrepsblob.js: removedcasefolderIDhard requirement and pass-through argument to align with route usage (container + hash).components/elements/index.js: restored missingupdateLinksimport required by Quill-related flow.
- Branch pushed with follow-up commits:
6094874b8fa514
Validation:
node tests/phase6/service-parity.test.cjs-> passnode tests/phase6/service-behaviour.test.cjs-> passnode tests/phase7/service-behaviour.test.cjs-> pass (10/10)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 (5/5)npm run lint-> warnings only (pre-existing hook dependency warnings)
Follow-ups:
- Keep signer allow-list expansion minimal and task-driven.
- Continue replacing remaining browser-side direct hash assumptions only where flows require it.
- Confirm work-item/branch naming alignment for any subsequent phase slices if strict tracker continuity is required.