feat(factory): five review skills + a per-review cost model
Skills — the primary now loads conditionally (each one is input tokens), per a load table in pragent.md: - attention-tiering: classify every PR trivial/lite/full/oversized BEFORE reading anything, and cap file reads, linter runs and subagent fan-out per tier. This is the cost governor; the other skills defer to its budget. - linter-playbook: per-ecosystem detect-and-run commands scoped to changed files, the never-install rule, and how to turn a diagnostic into a finding instead of pasting tool output. - security-lens: the inline security checklist for when @security isn't worth delegating, built around a source -> sink test each finding must pass. - malicious-change: hostile-PR detection — injection aimed at the reviewer, install/CI-time hooks, obfuscated payloads, dependency confusion, logic backdoors. Complements the runtime containment added in the previous commit: that stops the agent being hijacked, this makes it report the attempt. - comment-craft: how to write problem/fix/suggestion so a maintainer can act in one read, and what to cut. pilot/cost_model.py — prices a review against published Claude and OpenAI rates (fetched 2026-08-18). Prompt sizes are measured from the factory files rather than guessed; per-tier workloads come from the tiering budgets. The model is explicit about the thing that actually dominates an agent loop: the whole conversation is resent every step, so caching moves ~2.3x of the bill. Blended over a 5/35/55/5 mix with caching on: ~$0.61/PR on Opus 5 or GPT-5.6 Sol, ~$0.24 on Sonnet 5 or Terra, ~$0.12 on Haiku 4.5, ~$0.02 on Luna. At 350 PRs/month that's ~$212 / ~$85 / ~$43 / ~$8.50. Tests: 101 -> 122. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B11e8TZZxJyzHW7jj7KWUN
This commit is contained in:
@@ -56,6 +56,26 @@ first; an ambiguous case gets one cheap model call as tie-breaker.
|
||||
Every tier decision records *why*, so a surprising outcome is explainable rather than
|
||||
mysterious.
|
||||
|
||||
## What it costs
|
||||
|
||||
The pilot runs on `glm-5.2:cloud` through the on-network headroom proxy, so today it
|
||||
bills nothing per token — but the token *work* is real, and `pilot/cost_model.py`
|
||||
prices it against published API rates. The factory's prompt sizes are measured from
|
||||
the files in this repo; the per-tier workloads come from the `attention-tiering`
|
||||
budgets. Blended over a 5/35/55/5 tier mix, prompt caching on:
|
||||
|
||||
| Model | per PR | 350 PRs/month |
|
||||
|---|---:|---:|
|
||||
| Claude Opus 5 / GPT-5.6 Sol | ~$0.61 | ~$212 |
|
||||
| Claude Sonnet 5 / GPT-5.6 Terra | ~$0.24 | ~$85 |
|
||||
| Claude Haiku 4.5 | ~$0.12 | ~$43 |
|
||||
| GPT-5.6 Luna | ~$0.02 | ~$8.5 |
|
||||
|
||||
Run `python3 pilot/cost_model.py --help` for other mixes and PR volumes. The
|
||||
dominant cost is the agent loop resending its own context each step, not the diff —
|
||||
turning prompt caching off multiplies the bill by ~2.3x, which is why the tiering
|
||||
skill caps steps, file reads, and subagent fan-out per tier.
|
||||
|
||||
## Extension points
|
||||
|
||||
Five, all documented in the design doc. Teams override or add; nobody forks.
|
||||
|
||||
Reference in New Issue
Block a user