bench(lab): read where a repository stands, and answer with it - #299
Merged
Conversation
…icts A repository's position lived in the operator's head. The old driver held it in a JSON map of repository to phase, edited by whoever was debugging, which made it the one number in the system with no evidence behind it. It is now a function of two inputs, and which input a fact comes from is the whole design. The run tree holds which artifacts exist and the authoring cycle, which is already a directory name: those are derived every time and never stored, so there is no counter to drift from the thing it counts. The attempt records hold the verdict, the table that rejected it and the anchor: a judgment is not recoverable by reading a tree, so it is recorded once and never rewritten. An attempt is one file, written with O_EXCL. Append-only as a convention survives until a bad night; append-only as an open flag survives the bad night. Out of the two comes a standing. A park and a PAY are the two most worth telling apart — one is the method failing on this repository, the other is the method succeeding and waiting on a wallet — and so are the two refusals: a verdict its phase cannot emit is an agent that misbehaved, and a usable verdict with no artifact is an agent that died. The fixture tree is copied from the jellyfin campaign's layout and carries one repository of each shape it takes.
`sense-lab repo <id>` now prints where the repository stands and exits with the
code that carries it. The codes are this command's API rather than a display,
because it belongs in a loop:
while sense-lab repo <id>; do :; done
That loop stops on a park, on a PAY and on either refusal instead of spinning on
any of them, and `-show` never returns 0 so it cannot be dropped into it.
`-show` stops at the announcement, which is the point before an admission writes
anything, so it is a preview of what is about to happen rather than a second
reading of the same inputs.
Owner
Author
|
reopening so CI runs against main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #298. Review that one first; this PR's diff is only its own changes.
Problem
A repository's position lives in the operator's head.
sense-lab statusanswers where a campaign stands; nothing answers the question a crank has to answer before it does anything — what is the next phase for this repository, and how many authoring cycles has it already spent.The old driver answered it with a JSON map of repository to phase, edited by whoever was debugging. That is a decision anyone can change by hand, which made it the one number in the system with no evidence behind it.
Summary
Position is a function of two inputs, and which input a fact comes from is the whole design.
The run tree holds which artifacts exist and the authoring cycle — already a directory name under
<campaign>/<repo>/<cycle>/. Derived every time, never stored: a counter beside the fact it counts is a counter that drifts from it.The attempt records hold the verdict, the table that rejected it and the anchor. Recorded once and never re-derived, because no amount of reading a tree recovers a judgment. One file per attempt, written with
O_EXCL— append-only as a convention survives until a bad night, and append-only as an open flag survives the bad night.Out of the two comes a standing, and the standing is an exit code, because this command belongs in a loop.
-show: a position was printed and nothing was donePAYnothing will spend on its ownFour and five are the two most worth telling apart: one is the method failing on this repository, the other is the method succeeding and waiting on a wallet. Six and seven are diagnosed differently too — an agent that misbehaved, against an agent that died.
-showstops at the announcement, which is the point before an admission writes anything, so it is a preview of what is about to happen rather than a second reading of the same inputs.Changes
lab/internal/position: the attempt record and the reader, with a committed fixture campaign carrying one repository of each shape — mid-cycle with two rejections carried, parked at the ceiling, waiting at aPAY, and one that banked a cycle and re-enteredlab/internal/cli/repocmd.go: the standing, the codes, and-showlab/README.md: the code table, and what is derived against what is recordedsense-lab statusis untouched: it stays campaign-wide, and there is no board across repositories here.Test plan
make cigreen: coverage floor with no new exception, zero complexity suppressions, lint clean