Repository navigation
M3 G4 prep: the laws layer, unregistered - #67
Merged
Merged
Conversation
…e, not yet registered The laws layer runs the ESLint and compiler readers for the laws that map their tools, takes the worst reading of each law, and ends the run on a required law that is refused, failed or not evaluated; a law whose tool has no reader is not-evaluated for it, never a pass, and a law whose tool artifact (audit, install, publint, attw, dependency-cruiser) gate 1 did not write is not-evaluated too. It reads the laws from laws/W-NN.yaml, gives every mapped law a finding of its own, and declares those artifacts as optional inputs. The registry does not use it yet, and it lives under src/laws/layer. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, and the tracked-file listing it reads The optional-input path (a law whose tool artifact gate 1 did not write is not-evaluated and its reader is not asked) and the artifact map are tested on the layer itself with fakes, and the coverage layer tracked-file listing, which the laws layer also uses, gets the tests that say what it passes to git and what it reports when git is missing, slow or fails. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… a law is read by its own tool only Which of two verdicts is worse is the first of the worst-first list that is either, so two equal verdicts need no tie rule. New tests cover a law that maps two tools with one artifact missing, a reader that has no law left to read, the layer inputs and outputs, and a severity A law whose verdict is not a refusal. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.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.
This is the second of four PRs for M3's laws readers step. It lands the laws layer, not yet registered with the gate. Registration, with the runner's optional inputs, comes next; the report fields and the protocol text come in the step PR.
What it does
lawsLayer(catalog, readers)insrc/laws/layer/:law/W-NNfinding per mapped law, and each law's verdict is the worst of its readings.not-evaluated, and that ends the layer. It never passes.ack-missing.laws/W-NN.yamlthrough a catalog seam. It requireseslint-jsonandtsc-diagnosticsfrom the hygiene layer, and treats five tool artifacts (attw,audit,dependency-cruiser,install,publint) as optional.The tests call the layer directly, with a fake process runner and fake readers, so the gate's runner stays out of this PR's mutation scope. The end-to-end tests with real ESLint and
tscneed the layer registered, so they come with the next PR.Declared exceptions
src/gate/types.tsoptional?: booleanfield on a layer'sconsumesentry. Types only, with no runtime code. The runner behaviour comes in the next PRsrc/layers/coverage/tracked.test.ts(new)trackedFiles, which brought its 5 untested mutants into scope. This test kills themThe layer lives at
src/laws/layer/, inside thesrc/laws/path that every tool already covers. The protocol's §17 text naming it comes with the step PR.Gate on this head
layers: 5 in range, 5 ran, 0 failed, 0 not-evaluated. The gate took 6 minutes on a 10-CPU machine.🤖 Generated with Claude Code