- 13 xfail stubs: 5 for D-01/D-02 (logging), 8 for D-11/D-12+A1 (rate limiting) - load_tests package skeleton (D-04/D-05/D-06) excluded from pytest - Package legitimacy decisions recorded (structlog + locust both approved) - Full suite: 344 passed, 20 xfailed, 1 pre-existing failure, 0 regressions
6.4 KiB
6.4 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 06-performance-production-hardening | 01 | observability/rate-limiting/load-testing |
|
|
|
|
|
|
Phase 06 Plan 01: Wave 0 Nyquist Scaffold Summary
Wave 0 xfail test scaffold for Phase 6 structured logging (D-01/D-02), trusted-proxy rate limiting (D-11), per-account rate limiting (D-12), and Locust load-test skeleton (D-04/D-05/D-06).
What Was Built
backend/tests/test_logging.py — 5 xfail stubs for D-01/D-02:
test_setup_logging_emits_json_when_LOG_JSON_true— JSON renderer through ProcessorFormattertest_correlation_id_middleware_binds_contextvar— CorrelationIDMiddleware binds to structlog contextvarstest_correlation_id_response_header_present— X-Correlation-ID header on every responsetest_contextvars_cleared_between_requests— Pitfall 2 guard: no context bleed between requeststest_uvicorn_access_log_suppressed— uvicorn.access propagate=False
backend/tests/test_rate_limiting.py — 8 xfail stubs for D-11/D-12 + A1 verification:
test_get_client_ip_untrusted_returns_direct_peer— untrusted peer ignores XFFtest_get_client_ip_trusted_proxy_reads_xff_leftmost— trusted peer reads leftmost XFFtest_get_client_ip_trusted_proxy_no_xff_falls_back— trusted peer with no XFF falls back to peer IPtest_get_client_ip_invalid_peer_returns_none_or_string— None client returns None safelytest_account_limiter_key_uses_user_id— key_func returns str(user.id)test_account_limiter_key_falls_back_to_ip_when_no_user— no user on request.state → IP fallback, no crashtest_account_limiter_key_ordering_assumption— A1 gate: verifies slowapi reads request.state.current_user correctly before countingtest_authenticated_endpoint_429_after_100_per_minute— full integration 429 check
backend/load_tests/__init__.py — empty package marker (56 bytes)
backend/load_tests/locustfile.py — DocuVaultUser skeleton:
on_start,_auth_headers,list_documents,upload_document,refresh_tokenstubs (all raise NotImplementedError)check_slaSLA listener registered via@events.quitting.add_listener- Credentials from
LOAD_TEST_EMAIL/LOAD_TEST_PASSWORDenv vars only - Zero application imports
Test Suite Results
| Metric | Baseline | After Plan 06-01 | Delta |
|---|---|---|---|
| Passed | 344 | 344 | 0 |
| Failed | 1 (pre-existing) | 1 (pre-existing) | 0 |
| Skipped | 5 | 5 | 0 |
| XFailed | 7 | 20 | +13 |
- 5 new XFAIL in
test_logging.py - 8 new XFAIL in
test_rate_limiting.py - Zero regressions
- Pre-existing failure:
test_extractor.py::test_extract_docx(ModuleNotFoundError — carried over from 6.2)
Package Legitimacy Decision (verbatim from checkpoint)
structlog 25.5.0 — APPROVED
- PyPI: https://pypi.org/project/structlog/
- Author: Hynek Schlawack (CPython core contributor)
- Homepage: https://github.com/hynek/structlog
- Action: add to
backend/requirements.txtin plan 06-02
locust 2.34.0 — APPROVED (dev-only)
- PyPI: https://pypi.org/project/locust/
- Project: locustio/locust, 10+ years of releases, multi-million monthly downloads
- Action: add to
backend/requirements-dev.txtin plan 06-03 (NOT in requirements.txt)
Commits
| Task | Commit | Description |
|---|---|---|
| 2 | e1f8874 |
test(06-01): add 5 xfail stubs for structured logging (D-01/D-02) |
| 3 | 56d9da7 |
test(06-01): add 8 xfail stubs for rate limiting (D-11/D-12 + A1) |
| 4 | 594eb46 |
feat(06-01): add backend/load_tests/ package skeleton with Locust stub (D-04/D-05/D-06) |
| 5 | (verification only — no files changed) | Full suite regression check |
Deviations from Plan
None — plan executed exactly as written.
Notes for Downstream Plans
- 06-02 (structured logging): Must turn the 5
test_logging.pystubs green. Installstructlogin requirements.txt. - 06-03 (Locust implementation): Must fill in
DocuVaultUsermethod bodies andcheck_sla. Installlocustin requirements-dev.txt. - 06-04 (rate limiting): Must turn the 8
test_rate_limiting.pystubs green. The A1 verification test (test_account_limiter_key_ordering_assumption) must be promoted to PASS before applying@account_limiter.limit("100/minute")to all document/cloud endpoints — this test is the explicit gate that turns assumption A1 into a fact. - pytest discovery:
testpaths = testsinpytest.inialready excludesbackend/load_tests/; no additional configuration needed.
Self-Check: PASSED
All files created and all commits present:
- FOUND: backend/tests/test_logging.py
- FOUND: backend/tests/test_rate_limiting.py
- FOUND: backend/load_tests/__init__.py
- FOUND: backend/load_tests/locustfile.py
- FOUND: 06-01-SUMMARY.md
- FOUND: commit
e1f8874(test_logging.py) - FOUND: commit
56d9da7(test_rate_limiting.py) - FOUND: commit
594eb46(load_tests/ skeleton)