Refuse a logger installed in the core - #273
Merged
Merged
Conversation
0243 admits a logging facade on the standing condition that the core installs no logger and states that it installs none, and it says in its own text that nothing refuses one installed tomorrow. The narrowing it executes on 0103's fourth refused behaviour rests entirely on the facade's default sink writing nothing, so a registration behind it reopens a second exit for the values 0071 classifies field by field, with nothing having caught the change. no-logger-installed refuses the five registration calls under src/. It is a name list rather than a purpose test, which the block says of itself, and the near miss beside it is a diagnostic event handed to the client's sink carrying the word a careless pattern would key on - so a rule written as 'logger' would refuse the sentence 0243 requires the core to state about itself. Proven by planting the fixture under src/ and running the check three times: with the rule it refuses exactly that line and nothing else, with the rule deleted the same line is green, and with the line removed the register judges ten rules and refuses nothing. Signed-off-by: Nils Lehnen <30603423+iderex@users.noreply.github.com>
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.
The issue this belongs to
Closes #266
What changed
One rule,
no-logger-installed, added to.github/invariants/rules. It refuses aline under
src/that registers a logger behind the logging facade 0243 admits,and it names the five registration calls it knows:
set_logger,set_boxed_logger,set_logger_racy,set_global_defaultandset_default_dispatch.Nothing else moved. No script changed, no workflow changed, and the rule is data
in the register that
.github/invariants/invariants.shalready loads, which iswhat
CONTRIBUTING.mdsays a rule should be where the rules are the thing thatchanges rather than the logic applying them.
What failure it prevents
0243 narrows 0103's fourth refused behaviour from linking a logging facade to
writing to a log, and it does so on a standing condition: that the core installs
no logger and states that it installs none. The whole narrowing rests on the
facade's default sink writing nothing. Register something behind it and 0103's
fourth behaviour is back in force - a second exit for the values 0071 classifies
field by field - with nothing having caught the change and a record two levels
away saying the case was considered.
That failure has not happened. What has already happened is the absence: 0243 says
in its own text that nothing refuses a logger installed tomorrow, and it names
#266 as where a rule is asked for.
Evidence
The condition 0243 rests on still holds, at the commit being pushed:
so this rule is added over a tree that already satisfies it, and the register goes
from nine rules to ten:
What a guard here refuses, and the proof it bites
Three runs on one machine, in one go, on this branch.
Run 1 - the rule in the register, and one line under
src/that registers alogger. The line was appended to
src/diagnostics/mod.rson purpose and is notin this change:
One rule refused and no other. That is the run's own leg 1 as well as this
paragraph's claim:
ok bites: no-logger-installedis the judge applying the wholerule set to the fixture and requiring the verdict to be exactly this rule.
Run 2 - the same line, with the rule deleted from the register. Nothing else
changed:
So the line goes green the moment the rule is taken away, which is the direction
the guard is meant to have and the thing a run of the suite alone would not show.
Run 3 - the rule restored, the planted line removed, which is the tree being
pushed.
The register is back to ten rules, the new one has a subject and judged it, and
the only thing left modified is the register itself.
The near miss is the one 0243 makes expensive to get wrong. The rule's
cleanline is a diagnostic event handed to the client's sink, which is what 0100 says
the core does, carrying the word a careless pattern would key on:
A rule written as
loggerrather than as the registration calls would refusethat line, and it would refuse the sentence 0243 requires the core to state about
itself, which is a rule that makes its own record unsatisfiable. Every run above
proves it passes.
What this does not cover
It is a name list rather than a purpose test, which is the same bound the four
rules already in the register carry and which the run prints beside its verdict. A
registration written through a name nobody listed walks past it. The five are the
registration calls of the facade this graph carries and of its neighbour; a third
facade, a wrapper that registers on the core's behalf, or a call reached through
an alias is not refused.
The subject is
src/and nothing else. A logger installed in a test, in afixture or in an example is untouched, and 0243's condition is about the core
rather than about the suite. A logger implementation arriving in the dependency
graph is 0103's question and is refused there or not at all; this rule reads no
manifest and no lockfile.
Nothing was compiled or run. The planted line is not valid Rust in the place it
was planted, and it did not need to be: this check reads text out of
git ls-filesand never builds.
cargo buildandcargo testwere not run for this change, andno claim above rests on them.
The measurement above is one machine's. The three runs were made on Windows
with the repository's own
bash, not on the runner, and what the gate says is theinvariantscheck on this pull request.Who has read it
Nobody other than the author has read this change. The three runs above stand in
place of a second reader, and the second of them is the one worth checking: it is
the run that says the guard has a direction.