docs: add a closed-loop overview to the README - #10
Merged
Conversation
Add a Mermaid feedback-loop diagram and a short prose walkthrough right after the intro, so a reader instantly grasps that FPSMaxxing is a closed loop: measure -> policy decides bounded adjustment -> broker applies via typed capability (snapshot + TTL lease) -> watchdog reverts on regression or safety violation -> deterministic evaluator keeps or rolls back, then iterate. Names the gateway, capability/policy registry, broker, provider sidecars, durable journal, independent watchdog, and evaluator, keeping the safety invariants (no shell/admin to the LLM, snapshot+TTL+rollback on every write, independent watchdog) visible. Grounded in ARCHITECTURE.md and IMPLEMENTATION_PLAN.md; docs-only.
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.
Intent
Captain order (2026-07-25): update the fpsmaxxing README so a reader landing on it instantly grasps that fpsmaxxing is a closed feedback loop that fine-tunes system + hardware performance. Docs-only change to README.md. Near the top (right after the title/intro blurb and the alpha IMPORTANT note, before deep architecture detail) I added a new '## The closed loop' section containing: (1) a GitHub-native Mermaid flowchart showing the full loop end to end as a cycle - Measure (FPS, latency, frametimes, thermals) -> Policy engine (bounded adjustment) -> Broker (apply via typed capability, snapshot + TTL lease) -> Watchdog (revert on regression or safety violation) -> Evaluator (keep or roll back) -> iterate back to Measure; and (2) a short five-sentence prose walkthrough naming the pieces: unprivileged gateway (typed MCP tools, no shell/admin/raw device access), capability registry + policy engine, privileged broker, provider sidecars, durable experiment journal, independent watchdog, deterministic evaluator. Deliberate decisions/tradeoffs a diff reviewer would not know: no ASCII fallback for the Mermaid block is intentional since GitHub renders Mermaid natively; the existing linear '## Architecture' ASCII diagram and the 'observe -> propose ...' text loop were intentionally left in place (different views, not rewritten) per the instruction to not touch unrelated sections; every claim is grounded strictly in README.md, docs/ARCHITECTURE.md, and docs/IMPLEMENTATION_PLAN.md with no invented components or promised features; safety invariants (LLM never gets admin/shell, every write has snapshot+TTL+rollback, watchdog independent) are kept visible in the prose as the selling point; each full sentence is on its own line per repo/docs Markdown convention; and no co-author trailer was added to the commit per the project's global instruction. No code or schemas were touched, so fmt/clippy/test/schema checks are unaffected.
What Changed
## The closed loopsection near the top ofREADME.md, right after the alpha notice: a GitHub-native Mermaid flowchart (Measure -> Policy engine -> Broker -> Evaluator, with the watchdog drawn out-of-band as a dashed lease/TTL-or-safety revert edge into the broker) plus a short prose walkthrough naming the gateway, capability registry and policy engine, broker, provider sidecars, experiment journal, watchdog, and evaluator. Claims about unimplemented stages are hedged as design intent to match the existing status list and FAQ.## ArchitectureASCII diagram so the watchdog reverts through the privileged broker instead of pointing at the telemetry normalizer, keeping it consistent with the new Mermaid diagram.docs/ARCHITECTURE.mdnow states the watchdog reverts to the pre-state snapshot through the broker on lease expiry or safety violation, anddocs/README.mdpoints readers to the README's closed-loop overview before the detailed design.Docs-only; no code, schemas, or tests touched. The Test stage rendered the README through a GFM + Mermaid 11.12 pipeline, asserted the diagram's edges and a clean parse, and ran
cargo test --workspace --lockedgreen.Risk Assessment
✅ Low: Docs-only addition of 25 lines to README.md with no code, schema, or build impact; every claim is hedged and traceable to ARCHITECTURE.md/IMPLEMENTATION_PLAN.md, and the diagram now matches the watchdog-independence invariant after three converged fix rounds.
Testing
Rendered README.md at the base and target commits in headless Chromium through a GitHub-equivalent Markdown+Mermaid pipeline and captured before/after landing screenshots, a full-page render, and a 2x close-up of the new closed-loop diagram; the diagram renders with no Mermaid syntax errors and its SVG edge ids confirm the cycle closes (Measure->Policy->Broker->Evaluator->Measure) with Evaluator->Broker rollback and Watchdog->Broker revert, while the full-page shot shows the pre-existing Architecture ASCII diagram and text loop untouched. Cross-checked every component named in the new prose against README.md, docs/ARCHITECTURE.md, and docs/IMPLEMENTATION_PLAN.md.cargo test --workspace --lockedinitially failed on the sandbox's C toolchain (zig cc rejecting the Rust target triple, noar), which I fixed with local compiler shims; the full suite then passed, and thetarget/build output was removed so the worktree is clean./tmp/no-mistakes-evidence/01KYH47XZ1DDQ3TXT7C6ZJHZMS/01-readme-landing-AFTER.png)/tmp/no-mistakes-evidence/01KYH47XZ1DDQ3TXT7C6ZJHZMS/00-readme-landing-BEFORE.png)/tmp/no-mistakes-evidence/01KYH47XZ1DDQ3TXT7C6ZJHZMS/04-closed-loop-diagram.png)/tmp/no-mistakes-evidence/01KYH47XZ1DDQ3TXT7C6ZJHZMS/03-readme-full-page.png)Evidence: Mermaid render verification (fence, diagnostics, SVG edge topology)
== headless Chromium render of README.md (mermaid 11.12, theme default, securityLevel strict) == <title>rendered:ok docHeight=4569 mermaidBlocks=1 flowchartSvgs=1</title> == edge ids in the rendered flowchart SVG (proves loop topology) == B -> E E -> B E -> M M -> P P -> B W -> B (M->P->B->E->M closes the cycle; E->B rollback; W->B watchdog revert via broker) == mermaid syntax-error strings in rendered DOM == 0Evidence: Self-contained rendered README (open in any browser; Mermaid renders live)
Evidence: Reproduction notes for the evidence pipeline
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 4 issues found → auto-fixed (3) ✅
README.md:13- The new section asserts the full loop in present tense as shipped behavior ("FPSMaxxing is a closed feedback loop that tunes...", "The privileged broker applies that adjustment through a provider sidecar", "An independent watchdog owns the lease deadline", "the deterministic evaluator ... decides whether to keep the change"). The README's own status list (line 89: "Scaffolds for the privileged broker, watchdog, and experiment runner"), the FAQ (line 131: "the measurement-driven keep-or-rollback decision and real hardware providers are not implemented yet"), and docs/ARCHITECTURE.md:5 all say otherwise, and the Measure node (FPS, latency, frametimes, thermals) describes telemetry adapters that also do not exist yet. Every other forward-looking part of this README is explicitly hedged ("is intended to connect", "Planned integrations", "will not expose"), so this section reads as the odd one out. Placing it immediately after the alpha IMPORTANT note helps but does not undo the present tense; one qualifying clause (e.g. "the target loop, today exercised end to end against a mock provider") would keep the punch without the overclaim.README.md:24- The flowchart puts the watchdog inline as a sequential stage (B --> W --> E), implying each experiment flows through the watchdog between apply and evaluate. The architecture is the opposite: the watchdog is an out-of-band supervisor that owns lease deadlines and can restore state without the gateway, agent, or runner (docs/ARCHITECTURE.md:19, docs/IMPLEMENTATION_PLAN.md:109), and the README's own ASCII diagram at lines 114-117 draws it as a side path rather than a step. As drawn, the diagram contradicts the independence invariant the prose one line below is selling. Modeling it as Broker --> Evaluator for the normal path, with the watchdog hanging off the broker via a dashed "regression / lease expiry -> revert" edge, would match both the docs and the prose.README.md:16- The prose names seven pieces (gateway, capability registry + policy engine, privileged broker, provider sidecars, durable experiment journal, independent watchdog, deterministic evaluator) but the diagram shows five nodes and shares only three of those names; the unprivileged gateway, provider sidecars, and experiment journal - including the gateway, which is the main safety boundary being sold - are absent from the visual. A reader who maps the picture onto the paragraph will not find the trust boundary in the picture.README.md:15- The README now carries three overlapping depictions of the same pipeline: this Mermaid cycle (lines 15-27), the "observe -> propose -> validate -> snapshot -> apply -> benchmark -> keep or rollback" text loop (line 49), and the ASCII architecture diagram (lines 110-121), which use three different vocabularies for the same stages ("benchmark"/"Evaluator"/"benchmark decision gate"). Keeping all three was deliberate, but they will drift independently as the implementation lands; consider dropping or folding the line-49 text loop into the new section, since it is the closest duplicate.🔧 Fix: hedge closed-loop README claims and draw watchdog out-of-band
2 infos still open:
README.md:34- The watchdog is described (line 34: "restore the snapshot ... whenever a regression or safety violation appears") and drawn (line 27: M -.->|regression or safety violation| W) as owning revert-on-regression, while the same diagram gives E["Evaluator keep or roll back"] that decision and line 35 says the evaluator "decides whether to keep the change or roll it back". docs/ARCHITECTURE.md:19 scopes the watchdog to lease deadlines and emergency rollback; docs/ARCHITECTURE.md:23 gives promotion/rollback decisions to the runner/evaluator, and docs/IMPLEMENTATION_PLAN.md:109 requires the watchdog to be independent of the experiment runner - yet the diagram's only trip input for W comes from the runner's Measure stage. Scoping the watchdog edge to safety violations and lease expiry (its documented job) and leaving performance regressions to the evaluator would keep the two roles distinct instead of overlapping. This is close to the captain's original "revert on regression or safety violation" wording, so it needs the author's call.README.md:28- The recovery edge is drawn as W -.->|revert to snapshot| M, pointing the watchdog's restore at the Measure stage. Every other depiction in the repo routes recovery through the broker/provider layer that actually holds the applied state: README.md:116-119 (broker -> independent watchdog), docs/IMPLEMENTATION_PLAN.md:26 (broker with an independent watchdog and rollback branch), and docs/IMPLEMENTATION_PLAN.html:110 (WATCH -->|"trip / TTL expiry"| BROKER). As drawn, no edge shows the applied change being undone on the machine, so the dashed path reads as "the watchdog triggers a re-measure" rather than "the watchdog restores hardware state". Retargeting the dashed revert edge at B keeps the watchdog out-of-band (it is still not on the M -> P -> B -> E path) while showing where the snapshot is actually restored.🔧 Fix: scope watchdog to lease/safety; route reverts through broker
1 warning still open:
README.md:27- The trip edge is drawn asB -.->|lease/TTL expiry or safety violation| W, i.e. the broker detects expiry and notifies the watchdog. That inverts ownership relative to the prose one line below (line 34: "An independent watchdog will own the lease deadline"), docs/ARCHITECTURE.md:19 ("The independent watchdog owns lease deadlines and emergency rollback"), and docs/IMPLEMENTATION_PLAN.md:59 ("If the gateway, workload, or agent dies, the watchdog restores the prior state") - the whole point is that the watchdog fires when nobody is left to signal it. The repo's other Mermaid diagram draws it the other way: docs/IMPLEMENTATION_PLAN.html:110 isWATCH["Independent watchdog service"] -->|"trip / TTL expiry"| BROKER. The direction change from the previous round'sM -.-> WtoB -.-> Wwas not part of the round-2 instruction (only the label and the W->B revert target were), so this looks incidental. Two edges between B and W is fine if the labels match their direction: labelB -.-> Was the arming/registration step (e.g. "register lease + snapshot") and move the trip condition onto the existingW -.-> Bedge (e.g. "lease/TTL expiry or safety violation: revert to snapshot"), which keeps both the out-of-band styling and the correct detector.🔧 Fix: fix inverted watchdog trip edge in closed-loop diagram
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
node build-readme-page.mjs README.md readme-rendered.html- renders README.md with GFM + github-markdown-css + mermaid 11.12 (theme default, securityLevel strict), the same client-side path GitHub usesheadless_shell --screenshot --window-size=1280,1500on the target-commit render - captured01-readme-landing-AFTER.png(reader's landing view)git show 7f3ab1d:README.mdrendered identically and captured as00-readme-landing-BEFORE.pngfor the before/after comparisonheadless_shell --screenshot --window-size=1280,4600- full-page render confirming the existing## ArchitectureASCII diagram andobserve -> propose ...text loop are unchangednode build-diagram-page.mjs README.md diagram-rendered.html- extracts the single ```mermaid fence verbatim from README.md (asserts exactly one) and renders it standalone at 2x for04-closed-loop-diagram.pngheadless_shell --dump-dom+grep -o 'id="L_[A-Za-z_0-9]*"'on the rendered SVG - asserts edges M->P, P->B, B->E, E->M, E->B, W->B andgrep -ci 'syntax error'== 0Render diagnostics from the page title:rendered:ok docHeight=4569 mermaidBlocks=1 flowchartSvgs=1Doc-grounding check:grep -cifor each named component across README.md, docs/ARCHITECTURE.md, docs/IMPLEMENTATION_PLAN.md, plus line-level match of the watchdog-independence, evaluator-outside-LLM, and intersect-with-provider-limits claimsCC=/tmp/zig-shim/cc AR=/tmp/zig-shim/ar RANLIB=/tmp/zig-shim/ranlib cargo test --workspace --locked- full suite green after shimming the sandbox's C toolchaingit status --porcelain --ignoredafter removing thetarget/build output - worktree left clean🔧 **Document** - 1 issue found → auto-fixed ✅
README.md:118- The legacy ASCII diagram in '## Architecture' contradicts the new Mermaid closed-loop diagram on the watchdog relationship. The ASCII draws privileged broker -> independent watchdog -> telemetry normalizer -> gateway, while README.md:27 (new) and docs/IMPLEMENTATION_PLAN.html:110 both draw watchdog -> broker ('trip / TTL expiry'). No document anywhere supports a watchdog -> telemetry normalizer edge. Left unresolved because the author's stated intent was to keep the ASCII diagram in place as a separate view, and fixing it requires a judgment call: redraw the ASCII arrows to match, or drop the ASCII diagram now that a GitHub-native Mermaid diagram covers the same flow ~90 lines above it.🔧 Fix: correct watchdog arrows in README architecture diagram
✅ Re-checked - no issues remain.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.