Repository navigation
Conversation
…obert#939) Assisted-by: Muse (Muse Spark 1.3)
|
Reviewed, and this needs another pass before it can land. Two reviewers read it independently; what follows is what both measured. On method, so you can judge the numbers: neither of them executed your branch. They copied What is right, and worth saying firstYou reproduced the defect on The block half is also better than the issue asked for: testing And the change is measured as neutral on the tree: of the six What blocks it1. The comment claims a property the code does not have. The new comment says "Anything the switch does not recognise is refused, not accepted". The The PR body carries the same claim and then contradicts it two paragraphs later ("the default refuses only rests starting with 2. The defect of #939 is still open on the scalar branch.
This is why the issue asked for the inversion rather than more exceptions: enumerate what is a value, and an unrecognised spelling refuses by construction instead of by a list someone has to extend. 3. Three real lists are now refused, and no case decided that. The prefix test refuses the header before the body is looked at, so these go from accepted to refused, while PyYAML gives each a real value:
The table only added the body-less variants ( 4. Two of the six terms are measured by nothing. Removing {"folded block indicator with a value", " judged-jobs: >\n incus\n", true},
{"folded block, keep indicator with a value", " judged-jobs: >+\n incus\n", true},
{"literal block, strip indicator with a value", " judged-jobs: |-\n incus\n", true},
{"literal block, keep indicator with a value", " judged-jobs: |+\n incus\n", true},Plus 5. No mutation. Not yours to fix
Where this leaves the PRNOT READY, on points 1 and 2. The direction the issue asked for closes 1, 2 and 3 at once, which is why we recommend it rather than extending the exception list. If you would rather keep the blocklist, that is a defensible choice, but then the comment must say what the code does, the nulls must be refused explicitly, and the remaining gap needs an issue of its own: a limit written in a comment is not a tracked debt here. Take the time you need. The analysis above is yours to use, and nobody will touch the issue while it is assigned to you. |
Summary
nonEmptyListaccepted every block indicator it did not recognise, sojudged-jobs: >-passed the guard and a night with no judged jobs could look green. This inverts the guard: a value is one of two things, and nothing else — a block scalar (|,|-,|+,>,>-,>+) whose indented body holds a non-comment item, or a non-empty scalar on the same line. Anything the switch does not recognise is now refused: a block indicator the guard cannot parse (| # comment,>- # comment, an indent indicator like|2) is not a value it can vouch for, and neither is a comment-only rest. Refusing is the safe direction — a refused night is visible, while an empty list passed as non-empty restores the #830 race with green gates.The inversion is by class, not per spelling: a literal
default: return falsewould break the existing accepted inline scalars (incus,'incus'), so the default refuses only rests starting with|,>, or#and still accepts any other non-empty same-line scalar.Route taken: the inversion, as the issue asks. Not taken: switching to a YAML parser. That costs a dependency and the zero-dependency rule makes it a decision, not a detail — so this PR stays parser-free and the table test carries the coverage.
Evidence
Base:
main@4a9c1b3a20e1d57cd38162076fca96d6b2355082.Repro on that base (new table cases added first, fix not yet applied):
go test ./tools/ci/ -run TestNonEmptyListRequiresAValueFAILED — 5 cases returnedtrue, wantfalse:>-,>,>+,| # nothing here, and>-followed by an indented comment only. The control case (folded block with a value) passed on the base.After the fix: the targeted test passes; full
go test ./tools/ci/ -count=1ok (12.4s);go test -race ./tools/ci/ -count=1ok (18.2s);gofmt -l tools/ci/clean;go vet ./tools/ci/clean;golangci-lint run ./tools/ci/0 issues. The guard test reads the real workflow files, so no real caller uses a refused spelling.Falsification: reverting only the inversion (block case back to the three
|spellings, default back to plainreturn true, new tests kept) makes the test FAIL — at least 4 of the new cases go red. Restoring the fix makes it pass again.Two of the new cases go one step beyond the issue's literal list, in the same class:
> # nothing here(folded header with comment only) and# nothing here(comment only, no value) — a comment is not a value. The still-accepted control is>-followed by an indentedincus.Out of scope, unchanged: the block-sequence spelling (
key:followed by- itemlines, empty rest) was already refused before this change and still is. That is a separate question about whether the guard should accept sequences at all, not part of #939.Type of change
Checklist
Always
mise run checkpasses (gofmt, vet, golangci-lint,go test -race) — not fully green in my container, and I am not claiming it is. The full run could not complete here:shapes:checkpassed andgofmtwas clean, but the test and lint steps died on disk — first/tmp(512MB tmpfs) filled during the parallel race build, then the home disk quota (EDQUOT) tripped on the build temp. What did run green, on the touched package:gofmt,go vet ./tools/ci/,golangci-lint run ./tools/ci/(0 issues),go test ./tools/ci/andgo test -race ./tools/ci/. The full-suite result is for CI to give, after a maintainer approves the run.tools/ci/nightly_reporting_test.go;go.moduntouched.internal/corestill knows no provider — untouched.tools/ci, no provider code.mise run testplanwas run, and what it printed was run — run, but the named replay could not run here.mise run testplan --checkprinted: 1 path changed againstorigin/main— runmise run falsify -- tools/falsify/specs/a-silent-night-is-refused.json. I ran it twice; both times the harness exited 2 with "the copy is red before any mutation". The cause is this container, not the diff: the harness shells out throughsystemd-run --user, and there is no systemd user bus here (/run/user/absent, "Failed to connect to bus: No medium found"), so the baselinego testnever executes. The same failure was disclosed on fix(ci): the night report judges only its declared jobs (#830) #926. Note the spec's mutations target a different part of the same file (the excuse list), notnonEmptyList; the falsification evidence for this change is the table-test revert above.When a model wrote a substantive part of this — otherwise N/A
Assisted-by:trailer names the tool and the model version — in the commit:Assisted-by: Muse (Muse Spark 1.3).mise run conformancemyself — N/A with a reason, not run: no route or provider is touched, so there is no response shape for conformance to check. The diff is a test-only guard intools/ci.When a route is added or changed — otherwise N/A
N/A — no route added or changed.
When behaviour a client can observe changes — otherwise N/A
N/A — no documented limit moves and no client-observable response shape changes; the night report still judges the same jobs, and the guard now refuses malformed input as #939 asks.
When
.github/workflows/is touched — otherwise N/AN/A.
When a machine runtime is involved — otherwise N/A
N/A.
Related issues
Fixes #939