Phase 5 — Snapshots and trend #5
Notifications
Due Date
No due date set.
Blocks
Depends on
#7 Phase 7 — Acceptance
kotkan/claude-plugin-inference-arbitrage
#4 Phase 4 — Rubric and classification
kotkan/claude-plugin-inference-arbitrage
Reference: kotkan/claude-plugin-inference-arbitrage#5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Per design/tasks.md Phase 5. Blocked by Phase 4 calibration passing (closed).
bin/audit-snapshot write|list|diff; schema per design/plan.md §6 (+2 justified additions:target.skillsfor stale-detection,measurements_by_signaturefor FR-5.5)persisting, notshrunk)resolvedvsclaimed-fixed-unconfirmedlogic (FR-5.5) — reusesbin/boundary-classify's exact filing threshold rather than reinventing it_test-fixture, cleaned up after — wiki back to its original 4 pages)skills/offload-trend/SKILL.mdtests/snapshot.test.sh— 30 assertionsImplemented in
ff997d3,5bdc984,4d6f6f7. Storage/push design resolved cleanly (offline filesystem-only + explicitpages/importpublish seam) — documented and consistent with plan §7's "offline" constraint. Real Gitea quirk found and documented:wiki_write deletetakes the URL-decodedsub_url, not the page title.bash tests/run-all.sh: 147 assertions, exit 0.Phase 5 — snapshots and trend: done (5.1–5.7 checked off in
design/tasks.md)Commit
ff997d3(+5bdc984markdown lint)..claude-plugin/plugin.json0.2.0 → 0.3.0.What was built
bin/audit-snapshot—write | list | diff, plus two subcommands that carry the wiki bridge:pages(emit what to publish, with content) andimport(seed a cold cache from a wiki-fetchedsnapshots.jsonl).skills/offload-trend/SKILL.md— the trend-reporting procedure.references/snapshot-schema.md— the schema, with the two additions to plan §6 justified.tests/snapshot.test.sh— 30 assertions over two synthetic snapshots, wired intotests/run-all.shby the existing./*.test.shglob. Full suite green.The storage / push design decision
plan §5 said the store is this plugin's own wiki, "cloned to a local cache and pushed via
cluster:gitea-agent(this plugin never writes Gitea directly)". Those cannot both be true of one process — a git push to the wiki repo is a write to Gitea.Resolved as:
bin/audit-snapshotis offline and filesystem-only. It mirrors the wiki tree into a local store (~/.cache/inference-arbitrage/wikiby default) and never opens a socket — no git push, no Gitea API. That keeps plan §7's "offline; only the two output paths touch the network" literally true and keeps wiki credentials entirely outside the plugin. Publishing is a separate explicit caller action:pagesemits each wiki page name and its full content, the caller (offload-trendskill, orcluster:gitea-agent) performs thewiki_write.importis the read half, so a machine with a cold cache still diffs against real history. Documented in the script docstring, the skill, anddesign/tasks.md5.5.The wiki is the git-backed store plan §5 asked for — Gitea wiki pages are files in a git repo, so
git logon it is the audit trail.Data/<target>/snapshots.jsonlis appended by read-current, add one line, write back, which is whypagesemits whole files rather than deltas.Semantics
(skill, slug), in that order;matched_byrecords which one hit. A hash change under a stable identity issignature-drifted, not a silent vanish-plus-new.context_onlyblock and never drive a status. The test asserts this directly: in a window with half the volume, a candidate whose absolute offload value halved but whose per-invocation cost is flat reportspersisting, notshrunk.resolvedvsclaimed-fixed-unconfirmed(FR-5.5):resolvedrequires issue closed and remeasured under 2% of spend with ≥3 invocations — the sameMIN_SHARE_OF_SPEND/MIN_INVOCATIONSbarbin/boundary-classifyuses to file, reused deliberately rather than reinvented. Anything that merely stopped being reported isclaimed-fixed-unconfirmedwith areasonnaming the missing leg. Same spirit asnixos-deploy-pending/nixos-deployed: closed is not fixed, the way committed is not deployed.rubric_versionwas already1.0.0inbin/boundary-classify; snapshots pin it anddiffreportsrubric_comparable: falsewhen two snapshots were graded by different tables.Two additions to the plan §6 schema
Both because a requirement is otherwise uncomputable, not for convenience:
target.skills— FR-5.3'sstalemust distinguish "the skill was deleted" from "the candidate got cheap". A candidate list alone cannot.measurements_by_signature— FR-5.5 needs a later window's measured cost for a signature whose candidate is gone; nothing else in the snapshot carries it, so the resolution test would be unfalsifiable.statusis deliberately not stored on a candidate — it is a property of a pair of snapshots, computed bydiffand only ever rendered.Wiki write path, verified for real
Against this repo's own wiki, under a
_test-fixturename, then cleaned up — the wiki is back to its original 4 pages:Data/_test-fixture/snapshots.jsonl— slashes and the.jsonlextension are accepted;Audits/_test-fixture/Latestmarkdown rollup;import→diffon a cold store.Gitea quirk worth recording:
wiki_writecreate/updatetake the page title, butdeletetakes the escapedsub_urlURL-decoded (Data/_test-fixture/snapshots.jsonl.-) — deleting by title 404s. Documented in the skill so the publish path does not trip on it.Not done here
Audits/<target>/…for a real plugin — that needs a real audit with reviewed findings, which is Phase 6/7 territory.Leaving this issue open for review.