Skip to content

Fix/a closed row names a test that touches behaviour - #293

Merged
evkir merged 4 commits into
mainfrom
fix/a-closed-row-names-a-test-that-touches-behaviour
Sep 22, 2026
Merged

evkir merged 4 commits into
mainfrom
fix/a-closed-row-names-a-test-that-touches-behaviour

Conversation

@evkir

@evkir evkir commented Sep 22, 2026

Copy link
Copy Markdown
Owner

What this changes

How it was measured

Checklist

  • ruff format --check cyberai/ tests/ and ruff check cyberai/ tests/ pass
  • pytest -W ignore::DeprecationWarning -m "not slow and not smoke" passes
  • New behaviour is covered by a test that fails without the change
  • I have read CLA.md and I hereby sign the CLA

Risk 20 stood closed for fifteen days on a test that read a config
field while an unscoped run spent fifty-one seconds touching a
protected range. The existing guard was green and right to be: it asks
whether the named test exists, not what the test asserts.

Two probes settled that "measures behaviour" is not a syntactic
property. A test calling validate_exploit_scope and checking its
verdict is indistinguishable from one calling from_env and reading
.strict_scope, so a rule failing the second accuses rows 1 and 6
wrongly. This reports instead of judging: structural, boundary,
entrypoint or value, with helpers in the same module followed.

Entrypoint is decided by the argument, not the receiver. CliRunner and
asyncio are the receivers of every command run here; the product rides
in as an argument. Measured over the register today: structural 2,
boundary 2, entrypoint 6, value 6 across sixteen references.

The cases are synthetic. A test reading today's register measures this
morning's history and turns red when an unrelated test is renamed,
which teaches the reader to edit the expectation instead of the code.

The script is loaded by path, as the badge gates are, and named by a
step in the typecheck job: scripts/ resolves on sys.path only because
of how the package is installed here.
The page now carries a Held by column, written by the script rather than
by whoever edits the row, and a guard that fails when the column and the
tree disagree. Measured today: structural 2, boundary 2, entrypoint 6,
value 6 over sixteen references. Risk 20 reads boundary/value, which is
what it would have said out loud while it stood closed on a config read.

No level is forbidden. Two probes established that the distinction cannot
be made from syntax, so a value row is not a defect: it is a row whose
guard could be stronger, now readable as such without opening the test.

Both readers of this page matched the new column into the evidence cell
and went on working. That is the wrong reason for a check to be green, so
each pattern was widened to know the shape it reads.

A column of claims decays the way the last table did: typing-scope.md
carried a module at 17 errors while the tree said 12, and nobody was
wrong when it was written. Hence the comparison rather than a note.

Known gap, recorded rather than fixed: a row the pattern cannot parse
leaves both sides of that comparison at once and is not reported missing.
Counting the rows is a second guard, not this one.
The gap the last commit recorded is closed. A row the pattern cannot
parse is absent from the page side and the tree side together, so the
comparison could not see it: rows 20 and 24 carry a slash and would have
vanished silently under a narrower pattern. The pipe lines are now split
into heads, rules and body, and a body line the pattern misses is
reported. Counting rows against a fixed number would have been a claim
about today instead.

Row 4 named test_the_manifest_carries_the_profile, which asserts two keys
are present in the manifest. The risk is that two runs seeing different
surfaces published the same provenance, and the test beside it --
test_two_profiles_do_not_share_a_hash -- is the one that fails when they
do. Both have existed since 2026-09-08; the row named the weaker of the
two. The level does not change, which is the point: entrypoint says how
the test runs, not whether it asks the right question.

That limit is deliberate and now has a name. Restoring the old reference
under mutation leaves the suite green, because no measurement here reads
what a risk means. The column narrows where to look; it does not judge.
The release notes carry the column under Added. Risk 22 -- one developer,
measuring by hand -- said its mitigation was that every closed row names a
test rather than a memory. That is still true and now says more: the row
names what kind of test, measured rather than asserted. Neither makes a
second pair of eyes out of one, and the row says so; both shorten how long
a row can be wrong without anyone noticing.
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@evkir
evkir merged commit b8fb4f8 into main Sep 22, 2026
10 checks passed
@evkir
evkir deleted the fix/a-closed-row-names-a-test-that-touches-behaviour branch September 22, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant