TASK22168 endpoint account contract consistency slice

This commit is contained in:
2026-03-19 12:11:52 +00:00
parent 54820324f5
commit f9c9687cfe
9 changed files with 529 additions and 86 deletions
@@ -711,6 +711,41 @@ Status key: `[x] done`, `[ ] pending`
- `tests/phase20/service-behaviour.test.cjs`
- Re-run phase6phase20 baseline tests and lint after rollback.
### Phase 21 endpoint contract slice snapshot (2026-03-19)
Status key: `[x] done`, `[ ] pending`
1. `[x]` Confirm work item + branch from `origin/SIPS-Development`
- work item: `TASK22168`
- branch: `TASK22168-endpoint-account-contract-consistency`
2. `[x]` Select next coherent low-risk endpoint contract slice after TASK22109
- selected handlers:
- `getaccounts_api`
- `getemailaccountcheck_api`
- `getpreferredlanguage_api`
3. `[x]` Apply consistency pattern from TASK22109
- remove dead/noisy code (unused imports/commented debug remnants)
- standardize structured negative-path responses (missing required input + catch path)
- preserve success payload behavior
4. `[x]` Add focused phase21 tests for endpoint slice
- added `tests/phase21/endpoint-handler-contract.test.cjs`
- extended `tests/phase21/api-contract-slice1.test.cjs` runner
5. `[x]` Execute required validation
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
- `npm run lint` -> warnings only (pre-existing)
### Phase 21 rollback notes
- Revert files:
- `pages/api/endpoint/getaccounts_api.js`
- `pages/api/endpoint/getemailaccountcheck_api.js`
- `pages/api/endpoint/getpreferredlanguage_api.js`
- `tests/phase21/endpoint-handler-contract.test.cjs`
- `tests/phase21/api-contract-slice1.test.cjs`
- Re-run:
- `node tests/phase21/api-contract-slice1.test.cjs`
- `npm run lint`
## 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.