Phase 7 — hardening, load test & launch (v0.1.0) - #9
Merged
Conversation
Closes the launch-blocking security gaps and completes SECURITY_REVIEW_LOG: - Per-API-key inbound rate-limiting (CLIENT_RPM) via a per-client token bucket; one runaway key gets 429 without affecting others (box 7.1). - Upstream fetch uses redirect: error so a malicious provider can't 3xx the prompt to another host (box 4.2). - Exported logRedaction + a test proving the authorization header logs as [redacted] and the raw key never appears (box 1.2). - pnpm audit --prod in CI (prod deps clean; dev-only advisories triaged, box 8.1). - Ticked boxes 3.2/6.2/8.2 from existing coverage; SR-006 + pre-launch gate complete. 203 tests, pnpm verify green.
Add pnpm load: an in-process harness (mock upstreams + the gateway via Fastify inject) that drives the cache, fallback, and guardrail paths and writes load/RESULTS.md. Excluded from lint/typecheck; run manually, not in CI. Fill PRP_SPEC section 5 with the measured numbers: 50% cache cost-reduction on a 50%-repeat workload, zero unhandled 429s (all 50 always-429 requests failed over), 100% PII guardrail catch-rate, and ~14 ms p99 added overhead.
…creenshot (Phase 7 Part C) Add LICENSE (MIT), CHANGELOG.md (v0.1.0 grouped by capability area), and a Playwright-generated docs/dashboard.png on seeded data (screenshot spec reuses the E2E route-stub pattern). Polish README: CI + license + node badges, a current-state v0.1.0 banner replacing the stale Phase 1 header, a Benchmarks section with the measured numbers, the embedded dashboard screenshot, and License + Contributing sections.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 7 — Hardening, Load Test & Launch
The final phase: turn a feature-complete gateway into a launch-ready, v0.1.0 artifact. Three logical commits — security hardening, a measured load harness, and launch hygiene.
Part B — Security hardening (
cfa9477)Closes the launch-blocking gaps in
SECURITY_REVIEW_LOG.md:CLIENT_RPM) via a per-client token bucket — one runaway key gets429s without affecting other clients (box 7.1, new code + tests).fetchusesredirect: 'error'so a malicious provider can't 3xx-redirect the prompt to another host (box 4.2).logRedaction+ a test proving theauthorizationheader logs as[redacted]and the raw key never appears (box 1.2).pnpm audit --prod(prod deps clean; dev-only advisories triaged, box 8.1).Part A — Load harness + measured numbers (
8cd3c1a)pnpm load— an in-process harness (two mock upstreams + the gateway via Fastifyinject) that exercises the cache, fallback, and guardrail paths and writesload/RESULTS.md. It's excluded from lint/typecheck and run manually, not in CI. The mock serves a deterministic/embeddingsendpoint so exact-repeat prompts truly hit the semantic cache. This fills the long-standingX/Yplaceholders inPRP_SPEC.md§5 with real measured numbers:Framing is stated honestly in
load/RESULTS.mdand the README: overhead is Sentinel's own per-request cost (not a model's latency); cost-reduction tracks your traffic's repeat rate; the catch-rate is the deterministic guardrail rate (the async LLM judge needs a real model and is covered by unit tests).Part C — Launch hygiene (
37d23fb)LICENSE(MIT) andCHANGELOG.md(v0.1.0, grouped by capability area).docs/dashboard.png— a Playwright-generated screenshot on seeded data (the screenshot spec reuses the E2E route-stub pattern and doubles as a render smoke test).Verification
pnpm verifygreen — typecheck + lint + 203 tests at 98.6% statements / 92.6% branches (above the 90% gate).load/**is lint/typecheck-excluded; the new screenshot spec lints clean.pnpm test:e2egreen — both dashboard specs pass;docs/dashboard.pngregenerates.pnpm loadruns clean and prints the metrics table above.Follow-up (post-merge)
v0.1.0+gh release createfrom the CHANGELOG notes.Closes out the ROADMAP. After this, Sentinel is feature-complete, hardened, benchmarked, and documented.