Repository navigation
feat(formal): add where.mjs, the contract lookup command - #236
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #236 +/- ##
=======================================
Coverage 93.73% 93.73%
=======================================
Files 78 78
Lines 11357 11357
Branches 656 656
=======================================
+ Hits 10645 10646 +1
+ Misses 642 641 -1
Partials 70 70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`node formal/tools/where.mjs C45` prints where one contract is stated (its CONTRACTS row and every Quint comment that cites it, with file:line), tested (the semantic cases that carry it with their scenarios, scoped Quint checks, witnesses, replays and vectors, the documentation sections and tests disposed to it, the feature families), challenged (the model-fault challenges that name it, with their invariant, native mutant, reproducer and profile partition counts) and mapped (the native mutants whose case carries it, with the ports they edit, and the Go parity rows). A semantic case ID narrows the view to that case. `--json` prints the same structure for an agent. It reads only the catalogs the audit already parses and adds no data and no gate: it is the navigation a reviewer or an agent otherwise assembles by hand, and the contract-level navigation test of #220 as a command. The README task table, the tools index and AUTHORING's reviewer-context section point at it.
…he argument CodeQL flagged the regular expression where.mjs built from the validated command-line ID. The scan now tests whole-token occurrences of the ID directly, which also makes the intent (an ID is a letter and two digits, not a prefix of a longer one) explicit.
Review follow-up. Mapped selected mutants by case-ID prefix while Tested
selected cases by contract, so a cross-listed case lost its mutant: C33
printed four challenges "mapped M06" above "Mapped (0 native mutants)".
Mutants are now the ones whose case the contract's cases include.
A case query dropped every challenge whose mutant sits on another case,
including the eight cross-contract mappings and the eight challenges
without a port line. Those stay with a tag ("cross-contract via M40 on
C40.future-rejected", "model-only, not narrowed to a case") and the
cross-contract note that execution.mjs requires is printed at both
levels.
Citations now include ranges ("C40 to C46", "C40-C45"), the house style
of the rewritten kernel headers; C42 showed no model citation although
six headers state it. The kernel fixtures are no longer scanned as
statements. The B-series contracts list their native cases from
feature-coverage.json with the port tests, and a native case ID is an
accepted query. Each semantic case shows its defining transitions and
source pointers. Challenge rows carry full paths and count profiles and
models separately; the CONTRACTS row must split into three cells; the
CLI rejects unknown flags and extra arguments; a case query's header is
the case rule. The near-constant "reviewed guides naming it" line is
gone.
lan17
force-pushed
the
claude/formal-where
branch
from
October 15, 2026 01:54
e4fc08c to
d8b4d38
Compare
lan17
added a commit
that referenced
this pull request
Oct 15, 2026
#236 added formal/tools/where.mjs, which prints where one contract is stated, tested, challenged and mapped. That is the navigation the Bug fix path and the formal convention in AGENTS.md asked agents to assemble by hand, so both name the command, and DEVELOPMENT_PROCESS.md lists it under Where to look.
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.
Phase 3 of #220, item N1. One commit, base
main. Independent of the other open PRs.What
prints, for one contract or one semantic case, where it is:
file:line, plus the reviewed guides that name it.For C45 that is 96 lines assembled from eight files in one command; by hand it was the three-read navigation test #220 set for Phase 1, now one read. It adds no data and no gate: everything comes from the catalogs the audit already parses.
Tests
formal-where.test.ts: C45 resolves to its obligation, the kernel citation inrecovery.qnt, the known case, challenge and mutant (M01 with TypeScript, Go and Rust edits), parity rows for exactly its cases and disposed sections; a case ID narrows the view and keeps only the challenges mapped through that case's mutant; the rendering has the four sections withfile:linelocations; an unknown contract, a malformed query and an unknown case are rejected with a one-line message.Verification
vitest run test/formal-wherepasses;tsc --noEmitclean;make auditgreen;node scripts/check-docs.mjsgreen. The README and AUTHORING entries were re-keyed with--refresh; parity inputs re-pinned.🤖 Generated with Claude Code