Description
Repeated delivery or retrying the same request can currently produce ambiguous outcomes. src/middleware/access-log.ts owns request logging, correlation IDs, and PII redaction, but the current behavior does not yet define the contract tightly enough for safe maintenance. Design the change so the runtime path, tests, and docs all describe the same behavior.
Requirements and context
- Keep the contract specific to
src/middleware/access-log.ts and its existing callers.
- Add coverage for the success path and the failure or boundary path relevant to this issue.
- Preserve compatibility where older callers or existing tests already rely on the current shape.
- Keep the change easy to review and small enough for one focused PR.
Suggested execution
Fork the repo and create a branch
git checkout -b access-log-redaction-idempotency-169
Implement changes
- Update/Write:
src/middleware/access-log.ts
- Write comprehensive tests:
src/middleware/access-log.test.ts
- Add documentation:
docs/middleware/access-log.md
- Keep any new helper names consistent with the rest of
src/
Test and commit
- Run
pnpm test
- Run
pnpm lint
- Add a note for any edge cases that are intentionally out of scope
Example commit message
fix: add idempotency and duplicate-request protection
Guidelines
- WCAG 2.1 AA is not relevant here; keep the focus on correctness and maintainability.
- Prefer a narrow, well-documented fix over a broad refactor.
- Timeframe: 96 hours
Description
Repeated delivery or retrying the same request can currently produce ambiguous outcomes.
src/middleware/access-log.tsowns request logging, correlation IDs, and PII redaction, but the current behavior does not yet define the contract tightly enough for safe maintenance. Design the change so the runtime path, tests, and docs all describe the same behavior.Requirements and context
src/middleware/access-log.tsand its existing callers.Suggested execution
Fork the repo and create a branch
Implement changes
src/middleware/access-log.tssrc/middleware/access-log.test.tsdocs/middleware/access-log.mdsrc/Test and commit
pnpm testpnpm lintExample commit message
Guidelines