Skip to content

Commit 86771ad

Browse files
etrclaude
andcommitted
TASK-052: housekeeping — mark Done, persist review notes (0 critical, 0 major, 21 minor)
- Mark TASK-052 status Done and check off all 13 action items in specs/tasks/M5-routing-lifecycle/TASK-052.md - Update TASK-052 row in specs/tasks/_index.md from Not Started to Done - Persist 21 unworked minor findings to specs/unworked_review_issues/2026-05-27_000000_task-052.md - Apply iter1 fixer fixes to bench_hook_overhead.cpp (OUTER=11→51, clarify gate comment, capture min/max before sort) and threadsafety_stress.cpp (safe recycle via move-then-remove) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 830a929 commit 86771ad

5 files changed

Lines changed: 140 additions & 27 deletions

File tree

specs/tasks/M5-routing-lifecycle/TASK-052.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ Close the hook bus by extending the docs that already shipped in M6 (TASK-040 ex
1010
**Action Items:**
1111

1212
*Examples (extends TASK-040)*
13-
- [ ] `examples/banned_ip_log.cpp` — single `accept_decision` hook writing to a configurable sink. Resolves #332 in user-visible form.
14-
- [ ] `examples/early_413.cpp` — single `request_received` hook returning `hook_action::respond_with(http_response::empty().with_status(413))` when `Content-Length > N`. Resolves #273 in user-visible form.
15-
- [ ] `examples/clf_access_log.cpp` — single `response_sent` hook formatting Common Log Format with `time-taken`. Resolves #281 and #69 in user-visible form.
16-
- [ ] `examples/per_route_auth.cpp``http_resource::add_hook(hook_phase::before_handler, ...)` demonstrating a per-route auth scheme that does NOT touch other routes.
17-
- [ ] All four examples added to `examples/Makefile.am` and listed in `examples/README.md` next to the canonical "hello world" / class-form examples.
13+
- [x] `examples/banned_ip_log.cpp` — single `accept_decision` hook writing to a configurable sink. Resolves #332 in user-visible form.
14+
- [x] `examples/early_413.cpp` — single `request_received` hook returning `hook_action::respond_with(http_response::empty().with_status(413))` when `Content-Length > N`. Resolves #273 in user-visible form.
15+
- [x] `examples/clf_access_log.cpp` — single `response_sent` hook formatting Common Log Format with `time-taken`. Resolves #281 and #69 in user-visible form.
16+
- [x] `examples/per_route_auth.cpp``http_resource::add_hook(hook_phase::before_handler, ...)` demonstrating a per-route auth scheme that does NOT touch other routes.
17+
- [x] All four examples added to `examples/Makefile.am` and listed in `examples/README.md` next to the canonical "hello world" / class-form examples.
1818

1919
*README (extends TASK-041)*
20-
- [ ] New top-level section "Lifecycle hooks" between "Handlers" and "Threading". Phase table identical to §4.10. One-paragraph short-circuit explainer. Pointer to the four new examples. Explicit callout: "The v1 setters `log_access`, `not_found_handler`, `method_not_allowed_handler`, `internal_error_handler`, and `auth_handler` are aliases for `add_hook`. They remain for ergonomic call sites; new code can use either form." with a side-by-side equivalence table.
20+
- [x] New top-level section "Lifecycle hooks" between "Handlers" and "Threading". Phase table identical to §4.10. One-paragraph short-circuit explainer. Pointer to the four new examples. Explicit callout: "The v1 setters `log_access`, `not_found_handler`, `method_not_allowed_handler`, `internal_error_handler`, and `auth_handler` are aliases for `add_hook`. They remain for ergonomic call sites; new code can use either form." with a side-by-side equivalence table.
2121

2222
*RELEASE_NOTES.md (extends TASK-042)*
23-
- [ ] New bullet under "What's new in v2.0": "Lifecycle hook bus (`webserver::add_hook` / `http_resource::add_hook`) — 11 phases spanning connection, request, routing, handler, response. Multi-subscriber, server-wide and per-route. The v1 single-slot setters survive as documented aliases. See specs/architecture/04-components/hooks.md."
24-
- [ ] Closes-list addition: #332, #281, #69, #273 (and #272 partial).
23+
- [x] New bullet under "What's new in v2.0": "Lifecycle hook bus (`webserver::add_hook` / `http_resource::add_hook`) — 11 phases spanning connection, request, routing, handler, response. Multi-subscriber, server-wide and per-route. The v1 single-slot setters survive as documented aliases. See specs/architecture/04-components/hooks.md."
24+
- [x] Closes-list addition: #332, #281, #69, #273 (and #272 partial).
2525

2626
*Doxygen (extends TASK-043)*
27-
- [ ] Doxygen blocks on the four new public headers (`hook_phase.hpp`, `hook_action.hpp`, `hook_handle.hpp`, `hook_context.hpp`).
28-
- [ ] Doxygen on `webserver::add_hook` and `http_resource::add_hook` (one overload-group block per file, listing the eleven phases and the per-route restriction set).
29-
- [ ] Update existing Doxygen for `log_access`, `not_found_handler`, `method_not_allowed_handler`, `internal_error_handler`, `auth_handler`: each gets one paragraph identifying it as an alias and naming the hook phase + equivalent `add_hook` call. (Per the user's "let's make sure we highlight in the documentation that they are aliases of hooks.")
30-
- [ ] Update existing Doxygen block on `webserver` class-level threading contract (§5.1) to add a sentence on hook concurrency: "Registered hooks may run concurrently from multiple MHD worker threads; implementations must be thread-safe."
27+
- [x] Doxygen blocks on the four new public headers (`hook_phase.hpp`, `hook_action.hpp`, `hook_handle.hpp`, `hook_context.hpp`).
28+
- [x] Doxygen on `webserver::add_hook` and `http_resource::add_hook` (one overload-group block per file, listing the eleven phases and the per-route restriction set).
29+
- [x] Update existing Doxygen for `log_access`, `not_found_handler`, `method_not_allowed_handler`, `internal_error_handler`, `auth_handler`: each gets one paragraph identifying it as an alias and naming the hook phase + equivalent `add_hook` call. (Per the user's "let's make sure we highlight in the documentation that they are aliases of hooks.")
30+
- [x] Update existing Doxygen block on `webserver` class-level threading contract (§5.1) to add a sentence on hook concurrency: "Registered hooks may run concurrently from multiple MHD worker threads; implementations must be thread-safe."
3131

3232
*Benchmark*
33-
- [ ] `test/bench_hook_overhead.cpp`: serves a fixed warm path 1M times with (a) zero hooks registered, (b) one observation hook at `response_sent`. Records median + p99 per-request cost for each. CI gate: (a) within 2× microbench noise of the pre-hook-system baseline; (b) is informational. Mirrors the pattern of `test/bench_get_headers.cpp`.
33+
- [x] `test/bench_hook_overhead.cpp`: serves a fixed warm path 1M times with (a) zero hooks registered, (b) one observation hook at `response_sent`. Records median + p99 per-request cost for each. CI gate: (a) within 2× microbench noise of the pre-hook-system baseline; (b) is informational. Mirrors the pattern of `test/bench_get_headers.cpp`.
3434

3535
*Stress test (extends TASK-032)*
36-
- [ ] Extend `test/integ/threadsafety_stress.cpp` with a new fixture mode: in addition to randomly invoking `register_path`/`unregister_path`/`block_ip`/`unblock_ip` from inside handlers, also randomly `add_hook` / `hook_handle::remove` at random phases. TSan-clean under the existing tsan CI matrix entry. Document the rationale in the test file header.
36+
- [x] Extend `test/integ/threadsafety_stress.cpp` with a new fixture mode: in addition to randomly invoking `register_path`/`unregister_path`/`block_ip`/`unblock_ip` from inside handlers, also randomly `add_hook` / `hook_handle::remove` at random phases. TSan-clean under the existing tsan CI matrix entry. Document the rationale in the test file header.
3737

3838
**Dependencies:**
3939
- Blocked by: TASK-045, TASK-046, TASK-047, TASK-048, TASK-049, TASK-050, TASK-051
@@ -50,4 +50,4 @@ Close the hook bus by extending the docs that already shipped in M6 (TASK-040 ex
5050
**Related Requirements:** PRD-HOOK-REQ-002, PRD-HOOK-REQ-007, PRD-HOOK-REQ-008, PRD-HOOK-REQ-009
5151
**Related Decisions:** DR-012, §4.10, §5.6
5252

53-
**Status:** Not Started
53+
**Status:** Done

specs/tasks/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Nominally: **13 sequential tasks**, each S–XL. Most other tasks parallelize of
134134
| TASK-049 | Fire `handler_exception`; wire `internal_error_handler` alias | M5 | Done | TASK-045, TASK-031 |
135135
| TASK-050 | Fire `after_handler` (post-handler short-circuit), `response_sent`, `request_completed`; wire `log_access` alias | M5 | Done | TASK-045 |
136136
| TASK-051 | Per-route hooks (`http_resource::add_hook`) | M5 | Done | TASK-045, TASK-048, TASK-049, TASK-050 |
137-
| TASK-052 | Hook bus documentation, examples, benchmark, stress-test extension (touches back into TASK-040/041/042/043) | M5 | Not Started | TASK-045, TASK-046, TASK-047, TASK-048, TASK-049, TASK-050, TASK-051 |
137+
| TASK-052 | Hook bus documentation, examples, benchmark, stress-test extension (touches back into TASK-040/041/042/043) | M5 | Done | TASK-045, TASK-046, TASK-047, TASK-048, TASK-049, TASK-050, TASK-051 |
138138
| TASK-037 | CI test for build-flag invariance | M6 | Done | TASK-034 |
139139
| TASK-038 | Sanitizer-clean tests for `http_response` move semantics | M6 | Done | TASK-009, TASK-036 |
140140
| TASK-039 | Performance acceptance (`get_headers`, `sizeof(http_resource)`) | M6 | Done | TASK-017, TASK-018, TASK-021 |

0 commit comments

Comments
 (0)