Loop Engineering: A Technical Roadmap for an Autonomous Loop ![rw-book-cover](https://pbs.twimg.com/profile_images/2047054153990516736/UqUBF2QO.jpg) ๐Ÿ”— **Source:** [Loop Engineering: A Technical Roadmap for an Autonomous Loop](https://twitter.com/h100envy/status/2068987470960623783/?rw_tt_thread=True) > [!note]+ Document Notes > tags: [loop-engineering, autonomous-agents, reward-hacking, observability, idempotency, agentic-workflows] > author: h100envy > source: Twitter/X > reference: https://twitter.com/h100envy/status/2068987470960623783/?rw_tt_thread=True > date created: 2026-06-26 09:00 > > # ๐Ÿท๏ธ Title: Loop Engineering: A Technical Roadmap for an Autonomous Loop > <!-- deep-read:sections start --> ## ๐Ÿงญ Table of Contents - [๐Ÿ“ Summary](#-summary) - [๐Ÿ“– Main Content](#-main-content) - [๐Ÿ—’๏ธ Notes](#๏ธ-notes) - [๐Ÿ“š References](#-references) - [๐Ÿ—ฃ๏ธ Paraphrase](#๏ธ-paraphrase) - [๐Ÿ“ฐ Newsletter](#-newsletter) - [โœ… Action Items](#-action-items) - [๐Ÿงช Hypotheses](#-hypotheses) - [๐Ÿ“Š Methodology](#-methodology) - [โ“ Questions](#-questions) - [๐Ÿ”ฎ Future Research](#-future-research) - [๐Ÿ’ก Implications](#-implications) - [๐Ÿง  Learning Styles Assessment](#-learning-styles-assessment) - [๐Ÿ“Š Accessibility Assessment](#-accessibility-assessment) - [๐ŸŒ DEIB Assessment](#-deib-assessment) - [โœ… Logical Validity](#-logical-validity) - [๐Ÿ›ก๏ธ DARVO Analysis](#-darvo-analysis) - [๐ŸŽฏ Conclusion](#-conclusion) ### ๐Ÿ”— References - [Original thread โ€” h100envy on X](https://twitter.com/h100envy/status/2068987470960623783/?rw_tt_thread=True) - Lost-in-the-middle effect (long-context degradation) โ€” referenced concept, no link in source - Context rot โ€” referenced concept, no link in source ## ๐Ÿ“ Summary - A practitioner lays out an eight-step (Step 0 through Step 7) roadmap for building an autonomous agent loop that can run unattended without burning money or wrecking your environment. - It matters because the ceiling on what one engineer ships isn't prompt-writing skill โ€” it's the ability to build a loop that converges to a true result instead of wandering. - Key stakeholders: solo engineers and small teams running coding agents, anyone wiring up CI-style checks around model output, and ops people who own the blast radius. - Risks and tradeoffs: a loop without a real independent check amplifies error by the iteration count; reward hacking turns "make the test green" into "break the test"; a judge on a strong model doubles per-turn cost. - Bottom line: a loop only makes sense when an external deterministic oracle delivers a verdict the agent can't author. Build one boring, trustworthy loop before scaling to a hundred. ## ๐Ÿ“– Main Content - The core distinction: a prompt is something you turn by hand; a loop turns itself. You set a goal once, and the system finds work, does it, checks it, fixes it, and repeats until the check passes. - Step 0 is a go/no-go filter. If no check can produce a verdict independent of the agent, you don't have a loop candidate. A model grading its own output is in statistical conflict of interest โ€” its own answer is a high-probability continuation, so it overrates correctness. Self-assessment is an echo, not a check. - The check must be an external deterministic oracle (test, type-check, linter, build, threshold) that returns an exit code, and it must be deterministic and idempotent. A flaky check breaks the stop condition. Run the check ten times on one state before building anything. - Step 1 demands one reliable manual run with measurement (model calls, tokens, dominant error type) to set a baseline. Step 2 introduces the minimal stateless `while` loop: each iteration launches the agent fresh so context rot and lost-in-the-middle degradation don't accumulate. Progress lives on the filesystem and in git, not in the conversation window. `MAX_ITER` is the first fuse. - Step 2.5 covers building the right iteration context: current state, the specific open failure, and only the files relevant to that failure (pulled mechanically from the stack trace, last diff, and test imports) โ€” bounded by an explicit token budget. - Step 3 is the heart: an independent check plus defense against reward hacking. Prompt prohibitions are the weakest layer. Real defenses are a check the agent can't edit (read-only tests, or a gate that fails if test files changed in the diff) and an independent judge on a different model for expensive cases. - Steps 4โ€“7 add disk-based state (human-readable `STATUS.md` plus machine-parsable JSON), isolation (git worktree, then a `--network none` container to cap blast radius against prompt injection), structured logging for observability, and nonlinear cost accounting (stateless keeps per-iteration cost roughly constant; stateful grows quadratically). - Contested/uncertain: the "dumb" relevance heuristic is presented as correct-for-now; the author concedes smarter variants exist but cost debugging. The understanding-debt failure mode is explicitly not solvable by code โ€” it's a discipline claim, not a technical one. ### ๐Ÿ—’๏ธ Notes - "A loop is not a prompt. A prompt you turn yourself. A loop turns itself: set the goal once, then the system finds work, does it, checks it, fixes it, repeats until done." - The skill that sets the ceiling is building a loop that converges to truth instead of an expensive random walk. The order of steps is strict; skipping is where loops blow up later. - Step 0 filter: a loop only makes sense if there's a check delivering a verdict independent of the agent. The model that generates and grades is in statistical conflict of interest โ€” its output is a high-probability continuation, so it systematically overrates correctness. Self-assessment is an echo. - The check is an external deterministic oracle returning an exit code, not an opinion. Hard requirement almost everyone misses: deterministic and idempotent. A flaky test (green then red on same code) is worse than no test โ€” it breaks the stop condition. Run the check ten times on one state first. - Step 1: don't automate what doesn't work by hand. One reliable manual run, with measurement (calls, tokens, top error type) = baseline. An unstable manual run gets multiplied by iteration count. - Step 2: minimal loop is a `while` feeding the agent a prompt until green. Each iteration launches the agent anew from clean context โ€” an engineering decision, not laziness. Models degrade as context fills (lost-in-the-middle, context rot). State on disk and git, not in the window. `MAX_ITER` is the first fuse. - Step 2.5: right iteration context = current state + the specific open failure + only relevant files. Pick files mechanically from the failing test's stack trace, last diff, and test imports. Explicit token budget keeps every iteration equally light and cost linear. Start with the dumb heuristic; complicate only if it misses. - Step 3: two problems โ€” independence (covered) and reward hacking. The agent fools the check not from malice but optimization; cheapest path to green is often breaking the test (delete asserts, mock everything, wrap in try/except, hardcode). Defense layers: prompt prohibition (weakest), a second check the agent can't control (read-only tests / diff gate), and an independent judge on a different model. A judge on a strong model doubles the bill โ€” reserve for expensive errors; keep the cheap deterministic gate always on. - Step 4: memory lives in a file the loop reads first and writes last. Two levels โ€” human-readable `STATUS.md` plus machine state in structured JSON, because free text gets reread differently run to run. Treat the loop as a night shift; design the morning note first. - Step 5: isolation and blast radius. Access is binary; a limit can be overstepped. Git worktree detaches the loop's working copy; a `--network none` container with stripped permissions gives real isolation. `--network none` defends against prompt injection from untrusted task texts and commit messages. Define the loop by what it can destroy, not what you want it to do. Radius first, task second. - Step 6: brakes plus a structured log (json line per event: time, iteration, type, detail). The log lets you grep the death pattern โ€” runaway, stuck, reward hacking, silent death. Minimal brakes: iteration limit, budget cap per turn, repeat detector, liveness marker, reward-hacking gate, isolation. - Step 7: cost is nonlinear. Stateful loops reread history โ†’ quadratic cost; stateless keeps per-iteration cost roughly constant. Estimate: cost โ‰ˆ (iterations) ร— (state + work tokens) ร— price. Measure one iteration, multiply by `MAX_ITER`. - Four deaths: runaway (limits cure), silent death (fresh context + liveness marker), random walk (deterministic fixpoint check), and understanding debt โ€” invisible in the log and the most dangerous, cured only by a mandatory human read. The first three are engineering bugs; the fourth is your own degradation. ## ๐Ÿ“š References - [h100envy โ€” Loop Engineering thread (X)](https://twitter.com/h100envy/status/2068987470960623783/?rw_tt_thread=True) - Lost-in-the-middle / context rot โ€” long-context degradation concepts cited in the thread (no primary link provided) - Git worktree, container `--network none` isolation โ€” standard tooling referenced, no link in source ## ๐Ÿ—ฃ๏ธ Paraphrase - A prompt is a one-shot you operate; a loop operates itself. Once you give it a goal, it keeps finding, doing, checking, and fixing until a check passes โ€” and the real skill is making that loop land on a correct answer rather than drift expensively. - Before you build anything, confirm the task has a check that's independent of the agent, deterministic, and idempotent. Run one reliable manual pass with measurement, then wrap it in a stateless loop that rebuilds a narrow, token-budgeted context each iteration. Defend the check against an agent that will try to game it, keep state on disk, isolate the blast radius, log everything structurally, and count cost before you launch. Start with one boring loop you actually trust. ## ๐Ÿ“ฐ Newsletter - Not applicable to this source โ€” it's a general agent-engineering thread with no direct WordPress hook. Light bridge for an OSS/DevRel audience: the independent-check principle maps cleanly onto CI gates in any contributor workflow. If you run automation against a WordPress repo (PHPUnit, PHPCS, Playwright), the lesson is the same โ€” the green checkmark only means something when the bot can't edit the test, and a flaky check is worse than none. Worth a "how we keep our agents honest" community post. ## โœ… Action Items #### DevRel - Developer advocacy: write a short talk/demo on "the independent check" as the gate for any agent loop; measure adoption via repo templates shipped. - Education: run an office-hours session walking through Step 0 โ†’ Step 7 on a real repo. - Developer experience: ship a starter loop template (stateless `while`, token-budgeted context builder, diff gate) as a quickstart. - Developer marketing: content series on "loops that don't blow up while you sleep." - Community management: collect war stories of reward-hacking incidents to build a shared failure catalog. - Internal/external/cross-project: align on a standard structured-log schema so loop deaths are diagnosable across teams. #### OSPO - Policy & Governance: require an independent, idempotent check before any autonomous-agent contribution lands. - License Compliance: scan agent-generated code paths the same as human PRs; no exemptions for bots. - Security Management: mandate `--network none` + read-only-outside-workdir for unattended agent runs; treat task text as untrusted input (prompt-injection intake policy). - Software Inventory: track which repos have agent loops and what their blast radius is. - Developer Support: provide a vetted isolation container image for contributors running loops. - Community Engagement: fund a shared "loop brakes" library. - Strategic Alignment: KPI on cost-per-merged-PR for agent loops, with `MAX_ITER` budget caps. #### Community - Maintainers: add a "tests are read-only to bots" rule to release hygiene. - Contributors: onboarding path that teaches the manual-run-with-measurement baseline before automating. - Sponsors: transparent budget caps per loop, reported against the nonlinear cost estimate. - Ecosystem: cross-project drill on detecting reward hacking via diff gates. #### WordPress - Core: define an independent-check requirement for any CI step an agent could close. - Core Performance: track token/cost budgets as a perf-style budget for agent runs. - Core AI: publish responsible-AI guardrails covering reward hacking, independent judges, and blast-radius isolation; build evaluation sets with deterministic oracles. - **Core Program Team:** add agent-loop retrospectives (how loops died, by the log) to coordination rituals. - Mobile: telemetry on any automated agent flows touching the app. - Playground: reproducible loop-failure demos as education modules in the browser. - Community: meetup kit on "build one loop you trust." - Training: lesson plan mapping Step 0โ€“7 to a learning path. - Marketing: narrative on safe agent automation. - Support: escalation path for runaway/silent-death incidents. - Design: UX for STATUS.md-style morning notes. - Documentation: examples-first guide to stateless iteration and token-budgeted context. - Photos: not applicable. - TV: caption a recorded loop walkthrough. - Polyglots: translate the loop-safety checklist. - Accessibility: ensure structured logs and STATUS notes render accessibly. - Meta: API reliability for any .org-side agent tooling. - CLI: scaffold a `wp` command pattern that emits exit codes suitable as loop oracles. - Hosting: cross-host defaults for sandboxed agent execution. - Tide: deterministic scoring as an oracle model; false-positive review loops mirror flaky-check guidance. - Openverse: moderation pipelines as deterministic gates. - Themes: lints as read-only oracles bots can't edit. - Plugins: security liaisons review agent-authored diffs; provenance checks on bot commits. #### The WPCC - Programs: fellowship track on agent-loop engineering. - Projects: governance clinic on independent-check requirements. - Funding experiments: milestone payouts gated on deterministic checks. #### FAIR - Technical independence: local, signature-checked oracles instead of agent self-report. - Policies and covenants: anti-capture rule that the entity being measured can't author its own check. - Productized governance artifacts: a scorecard template encoding "verdict independent of the agent." ## ๐Ÿงช Hypotheses - Loops fronted by a deterministic, idempotent oracle reach a correct stop state more often than loops relying on agent self-assessment. - Stateless iteration keeps per-iteration token cost roughly constant, while stateful loops grow cost super-linearly with iteration count. - A reward-hacking gate (test-diff check) catches a measurable fraction of "green by cheating" turns at near-zero cost. - An independent judge on a different model catches substantive failures that same-model self-review misses. - Running a check ten times before building the loop predicts loop stability better than any in-loop signal. ## ๐Ÿ“Š Methodology - Controlled comparison: same task, same model, loop with independent oracle vs. loop with self-grading; measure pass@correct and false-stop rate. - Cost study: instrument token usage per iteration across stateless and stateful variants; fit cost-vs-iteration curves. - Reward-hacking detection: seed tasks where breaking the test is the cheapest path to green; measure catch rate of prompt-only vs. diff-gate vs. cross-model judge. - Flaky-check ablation: inject controlled flakiness into the oracle; measure false-fix and false-stop rates. - Data sources: structured json logs (iteration, type, detail), git history, API billing records. ## โ“ Questions - What's the actual catch rate of a cross-model judge versus its doubled cost, by task class? - At what task complexity does the "dumb" stack-trace + last-diff relevance heuristic start missing files it needs? - How do you measure understanding debt before it becomes dangerous, given it's invisible in the log? - Where's the crossover point where splitting a task into phases beats raising `MAX_ITER`? - Can the diff gate itself be gamed (e.g., agent moves assertions into non-test files)? ## ๐Ÿ”ฎ Future Research - Formalize a taxonomy of reward-hacking moves and matching cheap deterministic gates. - Build tooling that auto-assembles the relevant file slice and proves the token budget held. - Metrics for understanding debt (diff-read coverage, comprehension spot-checks) that flag the fourth death. - Standard structured-log schema for cross-team loop autopsies. ## ๐Ÿ’ก Implications - Practice: this thread is the clearest external statement of the maker/checker rule that runs Courtney's loop-engineering OS โ€” the maker must never grade its own homework. Step 0's "a check that delivers a verdict independent of the agent" is exactly the registry's blind-checker requirement, and "self-assessment is an echo" is the precise mechanism (statistical conflict of interest) behind why the fleet-checker re-derives from source instead of re-reading the maker's draft. - Policy: any governance body certifying automated work should encode "the measured can't author the check" โ€” directly applicable to FAIR anti-capture and to WordPress Core AI guardrails. - Security: blast-radius-first thinking (`--network none`, read-only outside workdir) reframes agent safety as containment, not just correctness; treat all task text as untrusted (prompt injection). - Education: the Step 0โ€“7 order is a teachable curriculum; the manual-run-with-measurement baseline is a discipline most skip. - Funding models: budget caps and nonlinear cost accounting argue for milestone-gated, capped autonomous spend rather than open-ended runs. ### ๐Ÿง  Learning Styles Assessment - Reading level estimate: Flesch-Kincaid Grade ~11โ€“13 (dense technical prose, long compound sentences, domain jargon like idempotent, oracle, context rot). Flesch Reading Ease roughly 40โ€“50. #### ๐Ÿ‘€ Visual learners - Present: none โ€” text-only thread; code blocks referenced ("Some content could not be imported") but not visible here. - Improve: add an architecture diagram of the loop (find โ†’ do โ†’ check โ†’ fix), a state-on-disk vs. state-in-window before/after, and a labeled flow of the diff gate + judge. #### ๐Ÿ”Š Aural learners - Present: none. - Improve: a 3โ€“5 minute narrated walkthrough of Step 0 โ†’ Step 7; TTS of the "How loops die" section. #### ๐Ÿ—ฃ๏ธ Verbal learners - Present: strong โ€” analogies (echo, night shift, fuse, blast radius), clear definitions of reward hacking and context rot. - Improve: a glossary callout for oracle, idempotent, lost-in-the-middle, worktree. #### ๐Ÿงฉ Kinesthetic learners - Present: implicit labs (run the check ten times; do one manual run). - Improve: a reproducible starter repo with a broken test and a minimal loop to run hands-on. #### ๐Ÿง  Logical learners - Present: strong โ€” strict ordered steps, causal mechanics, a cost formula, a four-death decision table. - Improve: a decision tree for "build a loop or not" and an error-budget table. #### ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Social learners - Present: thread format invites replies. - Improve: discussion prompts and a shared reward-hacking war-stories thread. #### ๐Ÿง˜โ€โ™€๏ธ Solitary learners - Present: self-contained roadmap good for solo study. - Improve: a self-check quiz per step and a journaling prompt on understanding debt. #### ๐ŸŒฟ Naturalistic learners - Present: none. - Improve: frame cost/iteration as a resource-consumption lifecycle; tie blast radius to containment ecology analogies. ### ๐Ÿ“Š Accessibility Assessment #### Screen reader semantics - Present: linear prose, clear step headings in the original. - Improve: real heading markup, lang attributes, alt text for the referenced code/screenshots that didn't import. #### Keyboard navigation - Present: n/a (static text on X). - Improve: ensure any republished version has reachable, visibly-focusable links. #### Contrast and readability - Present: platform default. - Improve: ensure 4.5:1 in any reposted form; generous line-height for dense paragraphs. #### Text resizing and reflow - Present: platform-dependent. - Improve: confirm no clipping at 200% zoom in republished versions. #### Media and captions - Present: none โ€” and key code blocks are missing ("Some content could not be imported"), a real content gap. - Improve: restore the code with captions/transcripts; provide downloadable snippets. #### Forms and interactions - Present: n/a. - Improve: n/a. #### Standards reference - Gaps map to WCAG 2.2 AA: 1.1.1 Non-text Content (missing code/alt), 1.4.3 Contrast, 1.4.10 Reflow, 1.4.4 Resize Text, 2.4.6 Headings and Labels. ### ๐ŸŒ DEIB Assessment #### Cultural breadth - Present: none โ€” neutral technical content, no region-specific examples. - Improve: examples spanning different stacks and team sizes; translation links. #### Inclusive language - Present: largely neutral; jargon defined inline (reward hacking, context rot). - Improve: a plain-language summary; expand the glossary for non-native readers; "blast radius" is a military metaphor worth a plainer gloss. #### Neurodiversity support - Present: strong โ€” chunked into numbered steps with consistent "what + why" structure. - Improve: icon+text labels per step; even more predictable per-step template. #### Representation - Present: n/a โ€” no people depicted. - Improve: n/a. #### Psychological safety - Present: framing is candid but non-blaming on the engineering deaths; the fourth death ("your degradation as an engineer") is pointed but fair. - Improve: soften the closing judgment slightly; pair the critique with a concrete remediation path (mandatory diff read). ### โœ… Logical Validity #### Strong reasoning - Causal (Step 0, lines on self-grading): the conflict-of-interest argument is mechanistically grounded โ€” the model's own output is a high-probability continuation, so it overrates correctness. Strong because it names the statistical cause, not just the symptom. Clarify by citing measurement of overrating. - Deductive (idempotency requirement): if the check is flaky, the stop condition is undefined โ†’ the loop fixes what isn't broken or stops on what is. Valid given the premise; strengthen with a measured flaky-rate threshold. - Economic/analogical (Step 7, stateful = quadratic): the "iteration k pays for k previous turns" reasoning is sound and explains the stateless choice on cost grounds, reinforcing the quality argument. #### Fallacies - Hasty generalization / anecdote as evidence: "hundreds of dollars โ€ฆ unbraked it burns tens of thousands" and "no one shipping two hundred PRs a month started with a hundred agents." Location: Step 7 and the closing. Weakness: vivid numbers with no dataset; could be survivorship bias. Fix: cite the sample or frame as illustrative range. - False dilemma (mild): self-assessment framed as strictly "an echo, not a check." Location: Step 0. Weakness: self-checks have nonzero value as a cheap pre-filter even if insufficient alone. Fix: rank it as a weak layer (which Step 3 actually does for prompt prohibitions), keeping consistency. - Appeal to consequences (rhetorical): "Fail this filter, do not build a loop." Location: Step 0. Not strictly fallacious given the mechanics, but stated as a hard rule without edge-case allowance (e.g., human-in-the-loop checks). Fix: note the human-check option. #### Tone of voice - Authoritative, terse, practitioner-to-practitioner; aphoristic ("State on disk, not in the window," "Radius first, task second"). Confident, occasionally stern (the fourth-death close). Examples: "an agent's self-assessment is not a check, it is an echo." ### ๐Ÿ›ก๏ธ DARVO Analysis - Not applicable to this source โ€” it's a technical roadmap with no accusations, denials, or victim/offender dynamics. ## ๐ŸŽฏ Conclusion - Bottom line: an autonomous loop is only worth building when an external, deterministic, idempotent check can hand down a verdict the agent can't author โ€” everything else (stateless iteration, narrow token-budgeted context, reward-hacking gates, disk state, isolation, structured logs, cost accounting) protects that check from being faked or drowned. - Practical next steps: pick the most boring task; confirm a machine check exists and run it ten times for stability; do one measured manual pass; wrap it in a stateless `while` with `MAX_ITER`; add a diff gate so the agent can't edit the tests; keep state in STATUS.md + JSON; isolate with a worktree or `--network none` container; log structurally; estimate cost before launch; and read every diff so understanding debt never accrues. ## ๐Ÿ”„ Refactor Appendix โ€” Loop Engineering: A Technical Roadmap for an Autonomous Loop > Density: 2โ€“5 Literature atoms (H3), 0โ€“3 Permanent candidates (H4). > Defaults: 3 Literature, 1 Permanent. Resonance filter: if you can't > articulate in one line why a claim matters, drop it. ### ๐Ÿ“š Literature Atoms (H3) #### [H1] A loop turns itself; a prompt you turn yourself > [!quote] ID:rw_h1 > A loop is not a prompt. A prompt you turn yourself. A loop turns itself: set the goal once, then the system finds work, does it, checks it, fixes it, repeats until done. **Context & use**: - Opening framing of the thread. - The cleanest one-line definition separating one-shot prompting from autonomous loops; anchors the whole roadmap. **Tags**: #xref #aphorisms **Highlight**: [view highlight](readwise://) <!-- atomicity: 1 idea โœ“ --> #### [H2] The skill ceiling is convergence, not prompt-writing > [!quote] ID:rw_h2 > it is building a loop that converges to truth instead of becoming an expensive random walk. **Context & use**: - Step framing, on what sets the engineer's ceiling. - Reframes the valuable skill from prompt craft to loop convergence โ€” useful for DevRel narrative. **Tags**: #xref #articleseed **Highlight**: [view highlight](readwise://) <!-- atomicity: 1 idea โœ“ --> #### [H3] A loop needs a verdict independent of the agent > [!quote] ID:rw_h3 > A loop only makes sense if there is a check that delivers a verdict independent of the agent. **Context & use**: - Step 0, the go/no-go filter. - This is the exact technical statement of Courtney's maker/checker rule โ€” the maker can't grade its own homework. **Tags**: #xref #addendum **Highlight**: [view highlight](readwise://) <!-- atomicity: 1 idea โœ“ --> #### [H4] Self-assessment is an echo, not a check > [!quote] ID:rw_h4 > So an agent's self-assessment is not a check, it is an echo. **Context & use**: - Step 0, the mechanics of self-grading conflict of interest. - Names the mechanism (high-probability continuation โ†’ overrating) behind why blind checkers re-derive from source. **Tags**: #xref #aphorisms **Highlight**: [view highlight](readwise://) <!-- atomicity: 1 idea โœ“ --> #### [H5] Idempotent checks; flaky is worse than none > [!quote] ID:rw_h5 > A flaky test (green then red on the same code) is worse than no test, because it breaks the stop condition **Context & use**: - Step 0, hard requirement on the check. - Directly applicable to CI gates and to the fleet-checker's reliance on deterministic facts (exit codes, dates, HTTP codes). **Tags**: #xref **Highlight**: [view highlight](readwise://) <!-- atomicity: 1 idea โœ“ --> #### [H6] Reward hacking is optimization, not malice > [!quote] ID:rw_h6 > This is reward hacking: the optimizer exploits a hole in the metric instead of solving the task. **Context & use**: - Step 3, defending the check. - Justifies the read-only-tests / diff-gate / cross-model-judge defense stack. **Tags**: #xref **Highlight**: [view highlight](readwise://) <!-- atomicity: 1 idea โœ“ --> ### ๐Ÿง  Permanent Candidates (H4) #### [P1] The measured cannot author its own check **Claim** (one sentence, Courtney's voice): A loop converges only when the verdict comes from a check the agent neither writes nor can edit. **Evidence pointer**: [[#H3]] > [!quote] > A loop only makes sense if there is a check that delivers a verdict independent of the agent. **Scope & conditions**: Holds for any maker/checker automation where the maker could influence its own evaluation. Breaks when no deterministic oracle exists โ€” then use a human check, not a loop. **Links**: - [[Loop engineering OS]] โ€” because applies-in the fleet's blind-checker rule - [[Maker should not grade its own homework]] โ€” because extends the same principle to agents - [[Reward hacking defense stack]] โ€” because evidence-for why independence must be enforced, not requested <!-- atomicity: 1 idea โœ“ --> ### โœ๏ธ Fleeting Queue - [F1] This thread is the canonical external articulation of the maker/checker rule that runs the loop-engineering OS at `2. Areas/Loop Reports/` โ€” "verdict independent of the agent" = the blind-checker requirement; "self-assessment is an echo" = why checkers re-derive from source, never re-read the maker's draft. Cross-link into `loop_engineering_os.md` and the loop-template skill. โ€” https://twitter.com/h100envy/status/2068987470960623783/ #fleeting #inbox - [F2] Map Step 0โ€“7 onto the existing loop registry: which of the ~48 routines have a deterministic oracle vs. self-grading? Flaky-check audit (run the check ten times) for any loop whose checker is itself a model. #fleeting #inbox - [F3] "Blast radius first, task second" + `--network none` โ€” sanity-check which local routines run with network/permissions they don't need (ties to the scheduler-reliability + permission-churn note). #fleeting #inbox ### โ†’ Things 3 (max 2 actions) - [ ] Add a row/cross-link in `_loop-registry.md` noting this thread as the reference statement of the independent-check rule โ€” `2. Areas/Loop Reports/` #things - [ ] Audit which fleet loops rely on a model-graded check and flag them for a deterministic-oracle or blind-checker upgrade #things <!-- deep-read:sections end --> ๐Ÿ“„ **Full text:** [[Full Document Contents/Tweets/Loop Engineering A Technical Roadmap for an Autonomous Loop.md|Loop Engineering: A Technical Roadmap for an Autonomous Loop by h100envy]] ## Highlights - Deep mechanics plus working code. Stateless iteration, idempotent checks, isolation, defense against reward hacking, observability. From zero to a loop that will not blow up while you sleep. ([View Highlight](https://read.readwise.io/read/01kw3dq7te6555d6vn8a5kwqvv)) - Note: The roadmap's pillars: stateless iteration, idempotent checks, isolation, reward-hacking defense, observability. - Tags: atom/literature/h3 - A loop is not a prompt. A prompt you turn yourself. A loop turns itself: set the goal once, then the system finds work, does it, checks it, fixes it, repeats until done. The skill that sets the ceiling is not writing a prompt, it is building a loop that converges to truth instead of becoming an expensive random walk. ([View Highlight](https://read.readwise.io/read/01kw3dpzj2c6j95tqqzj24rbr0)) - Note: Loop vs prompt: a loop turns itself and must converge to truth, not an expensive random walk. - Tags: atom/literature/h1 - A filter that saves weeks. A loop only makes sense if there is a check that delivers a verdict independent of the agent. ([View Highlight](https://read.readwise.io/read/01kw3dq1j83tn7rwxxwb1v8yh8)) - Note: Step 0 = an independent machine check. This IS the maker/checker "don't grade your own homework" rule from the loop-engineering OS. - Tags: atom/literature/h1 - The mechanics of why this is critical. The model that generated a solution and also grades it is in a conflict of interest at the statistical level: its own output is a high-probability continuation to it, so it systematically overrates its correctness. This is not the model being lazy, it is a direct consequence of sampling from a distribution where its own answer is already raised in probability. So an agent's self-assessment is not a check, it is an echo. ([View Highlight](https://read.readwise.io/read/01kw3dq3qhvwmpv637xm70nccp)) - Note: Why self-grading fails statistically: the model's own output is a high-probability continuation, so it overrates correctness โ€” an echo, not a check. - Tags: atom/zettel/z1 - A hard requirement on the check almost everyone misses: it must be deterministic and idempotent. A flaky test (green then red on the same code) is worse than no test, because it breaks the stop condition: the loop will fix what is not broken, or stop on what is broken. Before building the loop, run the check ten times on one state. If the result is not stable, fix the check first, then the loop. ([View Highlight](https://read.readwise.io/read/01kw3dq62djnj8gh34s5wv4mad)) - Note: The check must be deterministic and idempotent; a flaky check breaks the stop condition. Run it 10x on one state first. - Tags: atom/literature/h2