You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TASK-052: Hook bus doc/example/bench/stress closeout
Closes out the v2.0 hook bus by:
- examples/per_route_auth.cpp (new): per-route HTTP Basic auth via
http_resource::add_hook(before_handler, ...), end-to-end smoke
verified (200 OK on /public, 401 on /private without creds, 200
with valid creds). Resolves the per-route demo bullet in the
hook-examples set.
- README.md + examples/README.md: new "Lifecycle hooks" H2 section
on the top-level README listing all eleven phases, short-circuit
semantics, per-route restrictions, v1-alias equivalence table; new
"Lifecycle hooks" topical section in examples/README.md pointing
at the four canonical hook demos.
- RELEASE_NOTES.md: replaces the partial M5-skeleton "Lifecycle hook
bus" bullet with the complete eleven-phase summary; adds
closes-list for #332, #281, #69, #273 (and #272 partial).
- Doxygen on the four public hook headers (hook_phase, hook_action,
hook_handle, hook_context): @file blocks, @brief on every public
symbol; extends the existing webserver::add_hook block to
enumerate all eleven phases and drops the stale "skeleton-only at
TASK-045" note; extends http_resource::add_hook block to name the
five permitted phases AND the six rejected ones with the throw
contract; adds hook-concurrency sentence to webserver class-level
threading contract.
- test/bench_hook_overhead.cpp (new): microbench asserting the
per-phase any_hooks_ atomic-load gate stays within a 50ns ceiling
for the zero-hooks-registered configuration. The gate-load shape
(rather than a full HTTP round-trip) is the only signal
attributable to the hook bus alone; round-trip noise would swamp
it. Wired into `make bench` via EXTRA_PROGRAMS. Measured 0.3-0.6
ns/call locally.
- test/integ/threadsafety_stress.cpp: extends the TASK-032 stress
driver from 4 ops to 6 (adds add_hook on a random phase + remove
via hook_handle from the bag). Bag capped at 256 entries to bound
RSS. Asserts a new LT_CHECK_GT on hook_add_ok + hook_remove_ok.
Drains the bag explicitly before ws.stop() to keep lifetimes
obvious. The TSan CI matrix entry picks the binary up
automatically (no workflow edit).
- scripts/check-examples.sh: extended with TASK-052 hook-example
presence check (all four examples listed in both README files).
- scripts/check-readme.sh: extended REQUIRED_V2_TOKENS with
add_hook / hook_phase / hook_action / hook_handle, added
"lifecycle hooks" to REQUIRED_SECTIONS, added A4b alias-callout
block-content assertion.
- scripts/check-release-notes.sh: extended REQUIRED_V2_TOKENS with
add_hook / hook_phase / hook_handle; added REQUIRED_CLOSES_ISSUES
for #332/#281/#69/#273/#272; added "eleven phases" gate to
distinguish the complete bullet from the M5-skeleton wording.
- scripts/check-hooks-doc-spotcheck.sh (new): grep-based regression
gate for H1-H6 (file-level @file blocks, @brief on principal
symbols, eleven-phase enumeration on webserver::add_hook,
five-permitted/six-rejected on http_resource::add_hook, alias
callouts on the five v1 setters, hook-concurrency in webserver
threading block). Required because doxyconfig.in's
EXTRACT_ALL=YES suppresses Doxygen's "undocumented" warnings.
- Makefile.am: wires check-hooks-doc-spotcheck into check-local and
EXTRA_DIST.
Verification: full `make check` (80 tests + all 5 doc-check
scripts) green; `make bench` (3 bench targets) green;
`make doxygen-run` produces zero substantive warnings;
HTTPSERVER_STRESS_SECONDS=5 threadsafety_stress includes hook ops
and ticks both new counters.
Related: PRD-HOOK-REQ-002, PRD-HOOK-REQ-007, PRD-HOOK-REQ-008,
PRD-HOOK-REQ-009; DR-012; §4.10; §5.6.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments