{"modulePath":"github.com/Agent-Field/codeaf","version":"v0.8.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\ncodeaf-replay judges a chooser by REGRET ON TEN DAYS OF LOG rather than by a screenshot.\n\nIT EXISTS BECAUSE WE WERE TUNING A BANDIT BY ANECDOTE. Every change to the machine chooser in the week to 2026-09-11 — #850, #853, #873 and two lanes still in flight — was argued from one person's screenshot and a ten-row grep, and every one of them moved a number nobody then measured. The model-call log already holds about a thousand finished requests a day: which machine was asked for, which one answered, how long its first token took, how fast it wrote, whether it refused, and what the call was for. That is a bandit replay dataset, and this is the instrument that reads it as one.\n\nWHAT IT DOES, in one paragraph. It walks the log in time order. Every finished request becomes a question — \"on this model, at this moment, for this role, which machine would you have demanded?\" — put to each candidate policy, whose beliefs have been fed exactly the sightings and refusals that had arrived by then and not one that had not. The answer is priced against what that machine measurably did around that moment (world.go), the best machine available is priced the same way, and the difference is the regret. The table it prints is per role class, because a second of a watched answer and a second of an unattended errand are not the same second.\n\nIT IS A DEVELOPER'S BINARY AND NEVER A VERB ON codeaf, for the reason cmd/codeaf-census and cmd/codeaf-changes are: the shipped binary is on a checked-in byte budget (SIZE-BUDGET) and a measuring tool must not spend the product's weight.\n\nUsage:\n\n\tcodeaf-replay [flags]\n\n\t  -log PATH         the model-call log (default: this machine's own)\n\t  -sightings PATH   the lane observation journal (default: beside the belief file)\n\t  -since DATE       ignore rows before this RFC3339 prefix\n\t  -window D         how far either side of a request a machine's own answers\n\t                    are read for what it was doing then (default 15m)\n\t  -min N            the fewest machines a model needs before its requests are\n\t                    scored at all (default 2 — nothing to choose between)\n\t  -incidents N      how many of the worst moments to show every candidate at\n\t  -out PATH         write the report to a file instead of stdout\n\n## Types\n\n```go\ntype Policy interface {\n\t// Name is what it is called in the table.\n\tName() string\n\t// Saw folds in one timed answer, as the ledger's [lane.Ledger.Note] does,\n\t// and says which class of call measured it.\n\t//\n\t// THE CLASS IS OFFERED TO EVERY CANDIDATE AND THE SHIPPED ONE THROWS IT\n\t// AWAY, which is itself one of the questions being asked here:\n\t// internal/lane's ledger keys a belief on (model, machine) and on nothing\n\t// else, so a first token measured behind a two-hundred-message turn and one\n\t// measured behind a two-message errand are folded into the same posterior.\n\tSaw(lane.Sighting, string)\n\t// Judged folds in whether an answer could be used, or whether the machine\n\t// answered at all ([lane.Ledger.NoteOutcome]).\n\tJudged(lane.Outcome)\n\t// Published folds in one row of the public sheet at a weight of 1/k, as\n\t// [lane.Ledger.Prime] does.\n\tPublished(lane.Row, float64)\n\t// Demand names the machine this policy would have asked for, and is empty\n\t// for a policy with no opinion — which is a real answer and the right one\n\t// when nothing has been measured.\n\tDemand(asked) string\n}\n```\nPolicy is one candidate chooser, judged offline.\n\n","path":"github.com/Agent-Field/codeaf/cmd/codeaf-replay","name":"main","synopsis":"codeaf-replay judges a chooser by REGRET ON TEN DAYS OF LOG rather than by a screenshot.","isRedistributable":true}
