Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ All notable changes to this project are documented here, following
## [Unreleased]

### Added
- **The run contract (`loop.yaml`) — a reviewable order ticket for a loop** — run inputs
(target, goal, lane, ten budget knobs) existed only as CLI flags: un-diffable,
unreviewable, and impossible to attach to the proof pack the run produced. Ships
`src/loopeng/contracts/` + `loop-anything run --contract`, `contract check`, and
`contract evidence`. Built on three rules that keep it from becoming decoration:
(1) **it compiles, it doesn't extend** — every key becomes a `config.Budget`/`Lane` the
loop already reads, so there is no new controller state and no knob the engine ignores;
(2) **an unenforced declaration is a parse error, not a no-op** — a typo'd
`max_iteratons:`, a `safety:` block nothing consumes, or maker-authored
`evaluation.dimensions` (maker ≠ checker laundering) all fail the parse, and the error
message names what *is* accepted; (3) **the gate is monotonic** —
`gate.require_human_confirm: false` is rejected, because a caller-authored file must
never hand back the bypass `VerificationGate` deliberately withholds. `evidence.required`
names real `ProofPack` fields and is verified against the recorded run (exit 1 on a gap),
so declaring evidence is a claim the run has to satisfy. Conflicting flags alongside
`--contract` fail closed rather than silently taking precedence. 57 tests in
`tests/test_run_contract.py`; design in `docs/solutions/run-contract.md`; annotated
example (pinned by a test) in `docs/examples/loop.yaml`.
- **`docs/solutions/external-eval-2026-08-12.md` — the repo's answer to an external
architecture review** — an item-by-item verdict, checked against the code rather than
the README: 6 real gaps, 5 partials, and 1 proposal (`artifact_type` as a closed enum)
**rejected as a regression** of the existing `Domain` registry seam, plus a
counter-scorecard that scores human-gate and generality *higher* than the review and
safety, observability, and enterprise-readiness *lower*. Records the meta-finding: the
review's every citation resolves to the README, so "the architecture is too CLI-shaped"
is evidence the **README** is CLI-shaped, not the engine. Names the best idea in the
review (a **false-green rate** benchmark) as the top remaining P0.
- **`ToolingSkillFactory` — generate tooling from a repo's KG (U4)** — the tooling
half's generator, closing the loop with U3. Given a repo's knowledge graph
(`kg-summary.json`), it emits a **skill** — `SKILL.md` + a real, compiling
Expand Down
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,42 @@ same sanitize-on-write path as recorded learnings (`MemoryStore.record_learning`
hostile line in a corpus file can't forge prompt structure — and re-importing the same
file inserts nothing.

### 📝 Run it from a contract, not a shell history

A run used to exist only as CLI flags — unreviewable, un-diffable, and impossible to
attach to the proof pack it produced. Now the ask is a file you commit next to the thing
it converges:

```bash
loop-anything contract check loop.yaml # validate; print the compiled plan
loop-anything run --contract loop.yaml # run it
loop-anything contract evidence loop.yaml --run 12 # verify it proved what it promised
```

```yaml
version: 1
name: qms-agent-native
target: ./qms-kbp
goal: Make the factory QMS inspection workflow operable by AI agents.
budget: { target_grade: A, max_iterations: 8, plateau_patience: 2, token_budget: 250000 }
evidence:
required: [grade_trajectory, dimension_diff, regression_tests]
```

Three rules keep it from becoming decoration
([design](docs/solutions/run-contract.md), [annotated example](docs/examples/loop.yaml)):

- **It compiles, it doesn't extend.** Every key becomes a `config.Budget` / `Lane` the
loop already reads. No new controller state, no knob the engine ignores.
- **An unenforced declaration is an error, not a no-op.** A typo'd `max_iteratons:` — or a
hopeful `safety:` block nothing consumes — fails the parse. A governance field that
quietly does nothing is the false-green this engine exists to prevent.
- **The gate only tightens.** `require_human_confirm: false` is rejected. The contract is
caller-authored, and a caller can never pre-confirm its own run.

`evidence.required` is checked against the run's **real** proof pack and exits non-zero on
a gap — so declaring evidence is a claim the run has to satisfy.

---

## ⚙️ How it works
Expand Down Expand Up @@ -338,8 +374,9 @@ flowchart TD
```
loop-engineering-anything/
├── src/loopeng/
│ ├── cli.py # loop-anything entrypoint (run / preflight / status / report / demo proof)
│ ├── cli.py # loop-anything entrypoint (run / contract / preflight / status / report / demo proof)
│ ├── config.py # budgets, convergence knobs, dependency table
│ ├── contracts/ # loop.yaml run contract — parse, compile to Budget/Lane, verify evidence
│ ├── preflight.py # per-mechanism dependency detection (+ refine-only gate)
│ ├── adopt.py # catalog tool adopter — venv-isolated, env-pruned, full-SHA pin
│ ├── proof.py # ProofPack builder + store-backed compounder
Expand All @@ -354,7 +391,7 @@ loop-engineering-anything/
│ ├── loop/ # controller state machine, convergence, brief, compound, GitCheckpoint
│ └── autonomous/ # research report + autonomous runner
├── skills/loop-anything/ # the /loop-anything agent skill
├── tests/ # 286 tests — loop dynamics validated against recorded verdicts
├── tests/ # 600 tests — loop dynamics validated against recorded verdicts
└── docs/plans/ # the implementation plan
```

Expand Down
41 changes: 41 additions & 0 deletions docs/examples/loop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# A run contract — the reviewable order ticket for one loop.
#
# loop-anything contract check docs/examples/loop.yaml # validate, print the compiled plan
# loop-anything run --contract docs/examples/loop.yaml # run it
# loop-anything contract evidence docs/examples/loop.yaml --run 12 # verify what it promised
#
# Every key below compiles into a primitive the engine ALREADY enforces
# (config.Budget, config.Lane, the VerificationGate). Anything else is a parse
# error — a contract may not declare what nothing consumes.

version: 1
name: qms-agent-native
target: ./qms-kbp
goal: Make the factory QMS inspection workflow operable by AI agents.

# Optional. Omit to let the router classify the target itself.
lane: codebase

budget:
target_grade: A # A-F; the letter ladder the judge grades on
max_iterations: 8 # the hard guarantee
plateau_patience: 2 # stop after N iterations with no gain
plateau_pivots: 1 # rotate to the next-lowest dimension before stopping
token_budget: 250000 # enforced only for refiners that report cost
max_wall_seconds: 5400 # the universal cost backstop
min_score_gain: 0.0 # noise band; set from `loop-anything judge-variance`

gate:
# May be omitted or true. `false` is rejected: the contract is caller-authored,
# and a caller can never pre-confirm its own run (anti-surrender).
require_human_confirm: true

evidence:
# Checked against the run's real proof pack by `contract evidence`. A pack omits
# (never fakes) a field it has no source for, so a missing item is a real gap.
required:
- grade_trajectory # before_grade -> after_grade
- dimension_diff # per-dimension before/after/delta
- iterations
- convergence_status
- regression_tests # the tests /ce-compound recorded on accepted fixes
84 changes: 84 additions & 0 deletions docs/reportcards/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,89 @@
"evidence": "scorecard output"
}
]
},
{
"id": "rc0004",
"delivery": "Verified the external review against the codebase (not the README, which is what it read). Shipped src/loopeng/contracts/ + 'run --contract' / 'contract check' / 'contract evidence' (items 1+7): a loop.yaml that compiles into config.Budget/Lane, rejects any key nothing enforces (parse error, not no-op), and makes the human gate monotonic (require_human_confirm:false is rejected). evidence.required is verified against the real ProofPack, exit 1 on a gap. Rejected item 2 (artifact_type as a closed Literal) as a regression of the existing open Domain registry, and rejected the section-20 directory rename. Recorded docs/solutions/external-eval-2026-08-12.md with an item-by-item verdict and a counter-scorecard. Suite 543 -> 600 passing, ruff clean.",
"objective": "Make loop-engineering-anything's public architecture as honest and reviewable as its engine already is",
"created_at": "2026-08-12T14:11:12-05:00",
"key_results": [
{
"text": "External review adjudicated item-by-item against code",
"target": "12/12 items ruled",
"score": 1.0,
"evidence": "docs/solutions/external-eval-2026-08-12.md"
},
{
"text": "Run inputs become a reviewable, fail-closed artifact",
"target": "run --contract ships with tests",
"score": 1.0,
"evidence": "tests/test_run_contract.py, 57 tests"
},
{
"text": "No regression to the engine",
"target": "full suite green",
"score": 1.0,
"evidence": "600 passed, 2 skipped; ruff clean"
}
],
"request": "Eval this post [external 8.6/10 architecture review of loop-engineering-anything] based on deep research, align and upgrade loop-engineering-anything code base.",
"headline": "Review answered; loop.yaml contract shipped",
"brief": "Someone graded the repo 8.6/10 and listed 12 upgrades. I checked each one against the actual code instead of the README. Six were real gaps, five were half-built already, and one would have made the repo worse. I built the biggest real one: you can now write the ask for a run in a file you commit, and the file is checked so it can never quietly promise something the engine does not do.",
"growth": [
"C:met:Checked every claim against src/ before accepting it; caught that the review's central premise came from README-only sourcing",
"P:met:Derived the contract's three rules from the repo's existing invariants (KTD1, maker!=checker, anti-surrender) rather than copying the reviewer's schema"
],
"why": "The review's headline claim (too CLI-shaped) is false about the engine and true about the README; acting on it literally would have replaced an open registry with a closed enum. Answering it with code evidence now prevents a 23-item backlog from being executed on a wrong premise.",
"needle": {
"name": "tests passing",
"before": "543",
"after": "600",
"better": "up",
"source": "pytest -q"
},
"next_lever": "Item 9: a false-green rate benchmark \u2014 how often the loop says A when a stronger evaluator disagrees"
},
{
"id": "rc0005",
"delivery": "Long-form article 'An AI Reviewed My Repo and Told Me to Make It Worse' at public/articles/ai-review-told-me-to-make-it-worse.html, per docs/ARTICLE_AUTHORING.md end to end: cover 1200x627 + 2-panel infographic (house style, rasterized, visually inspected, every count counted in the raster), byline, back-link, reader kit, rk-summary, related, engage.js, portfolio.yaml registration, promo kit (LinkedIn + 8-tweet thread), translation deferral recorded (machine-gated), CHANGELOG. Three external quotes verified verbatim against primary sources (Kubernetes blog, RFC 9413 raw text, arXiv 2404.13076); W3C DNT added as the mechanism's largest real instance. 5-S gate run twice with reviewer != maker: pass 1 FAIL at S2 3/5 (3 blockers), pass 2 PASS (S1 5, S2 4, S3 5, S5 4). Also corrected a 599->600 off-by-one the reviewer found in the engine repo's eval doc. npm test and npm run build both exit 0. Committed on branch article/ai-review-told-me-to-make-it-worse; NOT pushed.",
"objective": "Make loop-engineering-anything's public architecture as honest and reviewable as its engine already is",
"created_at": "2026-08-12T16:24:05-05:00",
"key_results": [
{
"text": "The upgrade is published as long-form, playbook-complete",
"target": "every DoD item in ARTICLE_AUTHORING.md",
"score": 1.0,
"evidence": "npm test + npm run build exit 0, incl. test-translation-coverage 0 silent gaps"
},
{
"text": "Nothing ships that an independent reviewer can falsify",
"target": "5-S gate passed with reviewer != maker",
"score": 1.0,
"evidence": "content/promos/ai-review-told-me-to-make-it-worse.scorecard.md, 2 passes"
},
{
"text": "Claims about my own code are true",
"target": "every number reconciled against source",
"score": 1.0,
"evidence": "reviewer re-ran the CLI and the test suite; 3 blockers fixed"
}
],
"request": "write a long form article about this upgrade and publish it to my portfolio writtings, all according to our playbooks",
"headline": "Article shipped; the gate failed it first",
"brief": "I wrote the long-form piece about the loop.yaml upgrade and put it in your portfolio. Your own publishing playbook made me have an independent reviewer grade it before shipping. It failed the first time \u2014 it caught me claiming something about my own code that was not true, a source listed but never used, and three numbers that did not add up. I fixed those, it passed the second round, and I fixed two more things it found even after passing.",
"growth": [
"C:met:Ran the playbook's reviewer!=maker gate instead of self-certifying, and published the FAIL in the scorecard rather than only the PASS",
"P:met:When the reviewer found a contract key that compiles to nothing at runtime, disclosed it in the article as a violation of my own Rule 2 rather than defending it"
],
"why": "The engine's whole thesis is that a declaration nobody enforces is a costume. Publishing an article about that thesis without running my own publishing gate would have been the same failure one level up \u2014 and the gate immediately proved it by catching a false claim about my own CLI flags.",
"needle": {
"name": "5-S mandatory dimensions at or above 4/5",
"before": "3 of 4 (S2 failed at 3)",
"after": "4 of 4",
"better": "up",
"source": "content/promos/ai-review-told-me-to-make-it-worse.scorecard.md"
},
"next_lever": "Item 9 from the review: a false-green rate benchmark \u2014 how often the loop reports A when a stronger judge disagrees"
}
]
Loading
Loading