Elffuss BraidHub

utopia-ia/elffuss-braid public

Docs: a reset that holds, deferred notices, and the bounds verification left unsaid

A reset with green forgets the verdicts given before it above the new
green, so that green moves on and red comes back only on new verdicts
(section 25, VerifyReset, braid hub verify reset --help). Section 25 also
says that reset takes at most 4 KiB and is 400 while the policy is off,
that an empty green_from is refused only with mode report, that with no
green the hub looks at the newest 10,000 changesets, that a change of
suite or reporters clears red without a fixed notice, and that notices
held back by the ten-minute spacing are sent later. Section 8 says the
verify of a landing is the hub's last decision, pending above green.
Changeset4da9bb424185c437d5bb8ed065e9a2b4366c933106d6677cff11828586174e89
AuthorKikoCis <KikoCis@users.noreply.github.com> · 2026-10-22 18:18 +02:00
CommitterKikoCis <KikoCis@users.noreply.github.com> · 2026-10-22 18:18 +02:00
Parentsadef7e4baed3

Browse the files at this changeset

3 files changed

modified crates/cli/src/hub/verify.rs +6 −3
@@ -138,9 +138,12 @@
138138 pub(crate) const RESET_HELP: &str =
139139 "Its admins only. With --green REV, move green to that changeset of the
140140 default branch, backward too: it must be on the first-parent chain of the
141-branch's head. Without --green, dismiss the fails there are now: they no
142-longer count, and only a new one turns the branch red again. Either way
143-red is cleared, and the log records who did it. REV is a changeset's id
141+branch's head. The verdicts given before the reset on the changesets above
142+it are forgotten, so the reset holds: green moves on, and red comes back,
143+only on verdicts given after it. Without --green, dismiss the fails there
144+are now: they no longer count, and only a new one turns the branch red
145+again. Either way red is cleared, and the log records who did it. A reset
146+needs the policy on. REV is a changeset's id
144147 or, in a repository that holds it, any revision braid resolves there.
145148
146149 The reset goes with an Idempotency-Key, and once more with the same key
modified crates/hubproto/src/verify.rs +3 −1
@@ -495,7 +495,9 @@
495495 #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
496496 #[serde(default)]
497497 pub struct VerifyReset {
498- /// Where green goes, on the head's first-parent chain, backward too;
498+ /// Where green goes, on the head's first-parent chain, backward too:
499+ /// the verdicts given before the reset on the changesets above it are
500+ /// forgotten, so that only new ones move green or bring red back.
499501 /// `None` dismisses the fails there are now instead.
500502 #[serde(with = "hex::opt_id")]
501503 pub green: Option<ObjectId>,
modified docs/hub.md +32 −15
@@ -700,7 +700,10 @@
700700
701701 A landing on the default branch of a repository whose verification is
702702 on (section 25), a change request's landing included, also carries
703- `verify`: how the branch stands once the landing is done.
703+ `verify`: how the branch stands once the landing is done, from the
704+ hub's last decision, which the landing does not wait for: `green` turns
705+ to `pending` when the landing put changesets above green, and a red
706+ branch stays red.
704707
705708 ```json
706709 "verify": {"state": "red", "green": "<id>|null", "red": "<id>|null",
@@ -2894,13 +2897,18 @@
28942897 the logins whose verdicts count, 1 to 10, kept lowercase.
28952898
28962899 A field the hub does not know, a `mode` other than `off` and `report`, a
2897-`green_from` that is empty or names a source the policy has no block for,
2898-a suite or reporters outside those bounds, and `report` missing with mode
2899-`report` are 400 `invalid`, with a detail that says which: nothing is
2900-dropped without a word. A change counts toward the account's limits as an
2901-edit (section 12), and the log records it with the admin's login. Turning
2902-the policy `off` deletes both refs and forgets how the branch stood;
2903-turning it on again starts from `unknown`.
2900+`green_from` that names a source the policy has no block for, a suite or
2901+reporters outside those bounds, and, with mode `report`, a `green_from`
2902+that is empty or `report` missing are 400 `invalid`, with a detail that
2903+says which: nothing is dropped without a word. With mode `off`, an empty
2904+`green_from` is accepted, as the hub gives it. A change counts toward the
2905+account's limits as an edit (section 12), and the log records it with the
2906+admin's login. Turning the policy `off` deletes both refs and forgets how
2907+the branch stood; turning it on again starts from `unknown`. A change of
2908+the suite or of the reporters clears red, as a reset does (the log records
2909+a `reset` whose `other` is `policy`), since the verdicts that set it no
2910+longer count; the branch turns red again only on verdicts under the new
2911+policy, and no `verify_fixed` notice goes out.
29042912
29052913 **Reporting.** `POST /v1/r/{owner}/{name}/verify/report` takes
29062914 `Idempotency-Key` (section 1) and a body of at most 4 KiB:
@@ -2945,7 +2953,9 @@
29452953
29462954 **How the hub decides.** After each verdict, reset and change of policy,
29472955 and whenever the branch moves, the hub looks at the changesets above green
2948-along the head's first-parent chain:
2956+along the head's first-parent chain. With no green yet, it looks at the
2957+newest 10,000 changesets of the branch: a fail older than those is never
2958+seen, and `no_green` and the naming of a culprit work within them.
29492959
29502960 - A changeset's verdict is what its reporters said of the policy's suite:
29512961 a fail with no pass is a fail; a pass with no fail is a pass; reporters
@@ -3029,7 +3039,8 @@
30293039 `null` for the hub, and for callers who are not the repository's admins.
30303040
30313041 **Resets.** `POST /v1/r/{owner}/{name}/verify/reset` (`admin`, takes
3032-`Idempotency-Key`):
3042+`Idempotency-Key`, a body of at most 4 KiB; 400 `invalid` while the
3043+policy is `off`, since there is nothing to reset):
30333044
30343045 ```json
30353046 {"green": "<id> | null",
@@ -3037,16 +3048,22 @@
30373048 ```
30383049
30393050 With `green`, green moves to that changeset, backward too; it must be on
3040-the first-parent chain of the head (400 `invalid` otherwise). Without it,
3041-the fails there are now are dismissed: they no longer count, and only a
3042-new one turns the branch red again. Either way red is cleared, and the log
3043-records a `reset` with the admin's login. With `expect`, the hub resets
3051+the first-parent chain of the head (400 `invalid` otherwise). The verdicts
3052+given before the reset on the changesets above it are forgotten, so that
3053+the reset holds: green moves on, and red comes back, only on verdicts
3054+given after it. Without `green`, the fails there are now are dismissed:
3055+they no longer count, and only a new one turns the branch red again.
3056+Either way red is cleared, and the log records a `reset` with the admin's
3057+login. With `expect`, the hub resets
30443058 only while green and red are what it says, `null` for a ref that does not
30453059 exist (409 `moved` otherwise). It answers the status.
30463060
30473061 **Notices.** `verify_red`, `verify_fixed` and `verify_stuck` tell the
30483062 repository's admins, and for a red branch with a culprit the account that
3049-landed it, in their inbox (section 21).
3063+landed it, in their inbox (section 21). A repository sends at most one
3064+every 10 minutes: a change within them is told once they are over, as the
3065+branch then stands. When the hub names a culprit, or another one, while
3066+the branch stays red, `verify_red` tells the account that landed it.
30503067
30513068 **From CI.** A CI job reports with a token made for that alone, on the
30523069 tokens page (section 14): `read` and `verify:<branch glob>` on the