Three-inspection (structural / type / behavior) static analysis for MoonBit programs, every toolchain file kind (.mbt / .mbtx / .mbti / .mbt.md / .mbtp) and state-machine tables
moon add riantr/moonbit_static_analysis@0.5.1import {
"riantr/moonbit_static_analysis@0.5.1",
}| what | where |
|---|---|
| the symbols a host has to be able to provide — the floor | _verify/host_requirements.txt |
| the gate that holds the artifact to them | _verify/check_host_requirements.ps1 |
| the same check against the published bytes | _verify/selfscan_published.ps1 |
| symbols | |
|---|---|
| new | stdio/get_stdio_handle, thread_pool/get_read_console_result, thread_pool/make_read_console_job, thread_pool/make_write_console_job, thread_pool/run_job |
| gone | io/errno_is_read_EOF/windows, thread_pool/errno_is_cancelled |
0.4.45 and later need a MoonBit toolchain bundling moonbitlang/core 0.10.21+06da1ed44 or later — moon 0.1.20261117 or later. A toolchain that still bundles the standalone moonbitlang/async cannot instantiate this artifact, and upgrading this package alone will not change that: the import surface is a property of the published bytes.
LinkError: WebAssembly.Instance(): Import #5 "moonbitlang/async" "thread_pool/make_write_console_job": function import requires a callablemoonx riantr/moonbit_static_analysis@latest riantr/moonbit_doubleML@latest// Use 1: revise a MoonBit (current-subset) program
let result : @pipeline.PipelineResult =
@pipeline.run(source, "main.mbt", @core.IfaceSymTab::empty())
println(@pipeline.render_result(result))
// Use 2: audit a state machine (machine tables come in as plain data)
let spec : @statecheck.MachineSpec = { name: "主体", states: [...], ... }
println(@statecheck.render(spec))moon run src/cli # 6 samples × 3 inspections, the file-kind demos, a sample machine| Inspection | Package | Responsibility | Output |
|---|---|---|---|
| Structural | src/walk | assignment-as-binding, unused/undefined/param-reassigned, constant-folding pruning | binding tables fn_bindings |
| Type | src/types | annotations-as-contracts, inference, assignment/argument/condition checks (declarations come from the binding tables) | signature tables sigs |
| Behavior | src/interp | abstract interpretation over a lattice, signature-dispatched methods, virtual stacks (the method table comes from the signature tables) | behavior findings |
| Merge | src/pipeline | one defect's echoes across inspections → one report, union of lenses | render_result |
=== undefined.mbt ===
2:10 - error: undefined variable 'missing' (UndefinedName) [structural+type+behavior]
in main() at undefined.mbt:4
in g at undefined.mbt:1
Summary: 1 finding(s) (before merge: structural 1, type 2, behavior 1)| Inspection | Machine-side semantics | What it checks |
|---|---|---|
| Structural | states are bindings ("assignment-as-binding" lifted to machine tables) | every state must be bound by at least one transition (in or out); out-only → never entered; reachability closure from the initial position; the terminal must be reachable — the machine must be able to finish |
| Type | the drive-slot contract ("annotations-as-contracts") | every trigger must be placed into a known slot, no empty slots; a Block must carry a reason — a road-less step must say so out loud, never silently |
| Behavior | the course as abstract execution (virtual stacks) | every course step must be carried by some transition; a stranded step carries a virtual stack from entry frame → error frame |
let spec : @statecheck.MachineSpec = { name: "主体", states: [...], ... }
let findings : Array[@report.Report] = @statecheck.audit(spec)
let text : String = @statecheck.render(spec) // merged text report规格 | 计数
---|---
状态 | 034
迁移 | 053
触发→槽 | 049 → 8
无路组合(带理由) | 228
修习历程 | 031 站
未预期发现:**0 条**The pyroduct-shaped sample machine printed at the end of moon run src/cli is this module's own 8-state toy (statecheck.pyroduct_flavored()), not pyroduct's real tables. It carries coordinates like 182:12; those are stable pseudo-spans hashed from the state name, not positions in any source file.
| function | signature |
|---|---|
| run | (src : String, file : String, extern_iface : @core.IfaceSymTab) -> PipelineResult |
| run_functions | (src : String, file : String, extern_iface : @core.IfaceSymTab) -> PipelineResult |
| render_result | (r : PipelineResult) -> String |
| merge_findings | (all : Array[@report.Report]) -> Array[@report.Report] |
| merge_group | (g : Array[@report.Report]) -> @report.Report |
| function | signature |
|---|---|
| audit | (spec : MachineSpec) -> Array[@report.Report] |
| render | (spec : MachineSpec) -> String |
| pyroduct_flavored | () -> MachineSpec — the 8-state sample machine |
| function | signature |
|---|---|
| mermaid_states | (verdicts : Array[Verdict], summary : Summary, prov : ScanProvenance, per_file : Int32, max_files : Int32) -> String |
| provenance_for | async (target : String, root : String) -> ScanProvenance |
| scan_artifact_name | (p : ScanProvenance, root : String) -> String |
| aggregate | (verdicts : Array[Verdict]) -> Summary |
| stamp_utc | (ms : Int64) -> String |
| moon_mod_version | (src : String) -> String |
moonbit_static_analysis_0.5.1_0.1.20261023_20261024T060000Z.mmd
moonbitlang-core_0.1.20261105+65efd5b93_0.1.20261104_20261114T060000Z.mmd
tree_unknown_unknown_0.1.20261104_20261114T055946Z.mmd # version not determined| field | question | source |
|---|---|---|
| package | what was read | the coordinate, or the resolved directory |
| version | which revision of it | the target's moon.mod (moon.mod.json too) |
| moonbit | which toolchain read it | moon version, run as a subprocess |
| stamp | when | @async.now(), UTC |
| function | signature |
|---|---|
| Report::render | (self : Report) -> String |
| render_reports | (reports : Array[Report]) -> String |
moonx riantr/moonbit_static_analysis@latest <target> [flags]| flag | meaning |
|---|---|
| <target> | registry coordinate (author/module[@version]) or a path. Omit it to scan the current directory. |
| --exclude <dir> | a directory name to skip. Repeatable. It exists because a dot-directory rule cannot catch everything: a project may keep vendored registry snapshots under an ordinary name. |
| --extern-iface-dir <dir> | a directory to scan for .mbti files whose declared types/values are treated as valid in every .mbt file under analysis. Repeatable. The natural target is .repos/ after moon fetch of the dependencies you want indexed. The target's own tree is always indexed. |
| --no-auto-fetch-deps | by default the analyzer reads the target's moon.mod and moon fetches each direct import. Pass this to skip the auto-fetch. |
| --mmd <path> | also write the scan as a mermaid stateDiagram-v2 to <path>, and print MMD<TAB><path> on the last line. Opt-in on purpose: stdout stays the authoritative text report. |
| --mmd-auto | the same, but pick the name and write it to the working directory — never inside the analysed tree. |
| --per-function | enter the behavioral lens at each function rather than at the module. |
| --explain MSA-011 | print that family's contract — what it asserts, the assumption it rests on, and what it does not cover — then stop. No scan runs. The value is mandatory, for the same reason --mmd's is: a bare word after the flag could equally be the value or the target. |
| --explain-all | the whole roster, each family's three parts, then stop. No scan runs. |
| --metrics | after the SUMMARY, print the adequacy block: files understood, call sites visited and checked (with the share), findings by family × severity × confidence, and the declared scope-limit count. Opt-in: the block states how much was checked, not what was found, so it changes no count above it. |
| --contexts | after the SUMMARY, print one CONTEXTS line: how many function bodies the behavioral lens executed (executions), over how many distinct signatures (function + abstract arguments), reached from how many call strings, how many signatures were reached from more than one string, how many arrivals were recursion cuts, and the deepest call stack. Opt-in for the same reason as --metrics, and it answers a different question: not "how much was checked" but "how the analyzer spent its executions" — the code re-executes a body per call site rather than summarizing it (the book's §8.4 functional approach), so the call-string bound of §8.3 is never imposed and the recursion cut is the only context merge. |
| --findings-shown-per-file N | how many findings are printed per file (default 40). A printing limit, not an analysis limit: the SUMMARY counts come from every finding, so raising it reveals findings that were already counted and changes no summary number. |
| --show-notices | print every notice per line, not only the ones that can hide a finding. By default a notice is printed only when its region lies inside a function's extent -- that is, when a conclusion may have been withheld because of it -- and every other notice is counted by shape in one NOTICES table. This flag restores the whole per-line list, which is what the tool printed before 0.4.36, and it changes no count: the SUMMARY's numbers are the same either way. |
| --families MSA-007,MSA-002 | report only these families, by their stable id. The ids are the MSA-NNN codes every rendered finding and every JSON record carries; the full roster is in Confidence, ids, profiles and nosec. An id this version does not know is a WARNING and the scan still runs -- a family added in a later release must not make an older analyzer's profile unusable, and a typo must be loud rather than fatal. |
| --exclude-families MSA-007 | report everything except these families. The same id vocabulary and the same rules. An id that is both included and excluded is an ERROR and the scan does not run at all: the two rules contradict each other, and which one won would be decided by the order of two ifs inside the scanner. |
| --honor-nosec | honour // nosec comments in the analysed source: // nosec silences every finding on that line, and // nosec MSA-007 silences that one family on that line. Off by default, and the default is a decision rather than an omission: a tool that stops reporting a finding because of a comment in the analysed source has an output the reader cannot trust without reading that source first. A // nosec that suppresses nothing is reported as a finding of its own -- a stale suppression is a fact about the source, and the source is what this tool analyses. |
| --ssa-cost | Measure what static single assignment would cost on the target tree and print one SSA-COST line: the variables the programs define, the versions SSA would give them, the phi-functions, and the copies their removal would need. It is a query and not a scan — it prints the line and stops, and no finding is reported. The claim it measures is the lecture's own — the Intermediate Representation lecture (2_IR.pdf, Nanjing University, Fall 2026), p.37: "SSA may introduce too many variables and phi-functions" — a claim with no number in it. The line carries its coverage beside the numbers, because a number without its coverage is half a number. |
The CLI cannot exit non-zero. MoonBit exposes no process-exit entry point in the packages available here, so a target that cannot be located prints ERROR and still exits 0 — a caller must read the output, not the exit code.
SCANNED 107 files under ...\ML\CI
CLEAN .mbti unchecked=0 ...\CI/pof/pkg.generated.mbti
PARTIAL .mbt defects=1 notices=2 unchecked=17 read up to line 36, 57 after it not shown ...\CI/pof/aggregator.mbt
12:3 - notice: ... (UndefinedName) [behavior, MSA-002, low]
PARSED 32/107 files understood (29.9%); 75 more read only up to their first parse error
SUMMARY files=107 parsed=32 actionable=56 notices=212 unreliable=15759 withheld=6769 unchecked=2841 total=16027 (actionable+notices+unreliable = total; withheld ⊆ unreliable; unchecked calls are not findings)NOTICES TOTAL notices=14157 printed=1754 aggregated=12403 1754 of them are printed per line: the ones that can hide a finding, and the low-confidence ones, which name a place. The other 12403 are counted by shape below
NOTICES count=8330 test declaration is outside the analyzed subset; its body was not analyzed12:3 - notice: no visible binding for 'cmd' (UndefinedName) [structural, MSA-002, low]| confidence | the lens… | the family | rendered |
|---|---|---|---|
| high | had the declaration, the signature or the type in front of it | everything else | its own severity |
| low | was reasoning from a name alone | UndefinedName (MSA-002) — the binding it could not find may be in a file, or in a package, it was never given | notice: |
| undecided | could not decide at all | a declared scope limit — the analyzer's own blind spot | notice: |
| id | family | id | family |
|---|---|---|---|
| MSA-001 | ParseError | MSA-007 | ArgTypeMismatch |
| MSA-002 | UndefinedName | MSA-008 | OperatorMismatch |
| MSA-003 | UnusedLocal | MSA-009 | MethodError |
| MSA-004 | UnusedParam | MSA-010 | NonBooleanCond |
| MSA-005 | ParamChanged | MSA-011 | Unreachable |
| MSA-006 | AssignTypeMismatch | MSA-012 | StaleNosec |
| MSA-013 | InfeasibleBranch | MSA-014 | RedundantGuard |
| MSA-015 | DeadStore | MSA-016 | DivisionByZero |
| MSA-017 | NegativeIndex | MSA-018 | TaintFlow |
let x = cmd() // nosec -- silences every finding on this line
let y = cmd() // nosec MSA-002 -- silences that one family on this line| reason | this tree | the seven corpora | reports? |
|---|---|---|---|
| a method call — the lens has no signature for a method | 3,800 | 21,350 | silent |
| a callee that is not callable | 498 | 7,647 | reports (MSA-008) |
| a cross-file value whose signature was never read | 191 | 1,941 | silent |
| a .. chain link — the lens has no signature for it | 0 | 104 | silent |
| a name that did not resolve at all | 0 | 16 | reports (MSA-002) |
| the remainder | 4,489 | 31,058 |
| notice | n | notice | n | ||
|---|---|---|---|---|---|
| test declaration | 1800 | const declaration | 7 | ||
| if expression | 101 | short lambda | 8 | ||
| struct declaration | 121 | type declaration | 7 | ||
| anonymous function literal | 48 | try expression | 1 | ||
| enum declaration | 35 |
| what it is | rendered | counted as |
|---|---|---|
| a declared scope limit | notice: | a notice — excluded from actionable |
| a low-confidence finding (since 0.4.38) | notice: | a notice — excluded from actionable |
| a genuine defect in the file | error: | actionable |
This view is not yet sound, and the flag is opt-in for that reason. It is measured across all seven pinned corpora by _verify/census_perfunction.ps1, and the release gate pins the number. Today it reports 47 actionable findings — 46 of them on moonbitlang/core and one on moonbit_labeler — where the module view reports 30 and 1. The census classifies them: 26 are constructs this frontend does not read or operators it does not model, 20 are dead stores — a value nobody reads, and the lens's own claim about the code — and one — a local assigned and never read in moonbit_labeler — is still the first true defect this tool has published on any corpus.Every one of them is in a NAMED family. The census keeps a bucket for findings it cannot classify, and that bucket held nine MSA-015 dead stores until 0.4.45 — a family reporting a store as unread while the read sat inside a region the frontend had declared outside its subset. The rule that fixes them is the one the frame audit already applies: a function with a hole in it is not audited.
family n what the lens claimed C 6 == between two arrays D 4 Int + Char and List + List E 3 * on a struct G 8 unreachable code — the lens's own claim about the code H 1 a local assigned and never read — the lens's own claim about the code, and the one finding in the census that is a real defect I 1 abs on a Double J 1 * on two function values K 3 a local call with a named argument M 20 a dead store — a value nobody reads — the lens's own claim about the code AND 16 MORE ARE DEMOTED. Since 0.4.38 a finding the analyzer does not stand behind is rendered notice: and counted as a notice rather than as actionable, and the census keeps the demoted set in its own table and its own total — a set of findings that leaves the census is a set that can go missing silently. Every one of the 16 carries the confidence low, and every one of them is a name the analyzer could not resolve.THE MODULE VIEW COUNTS 12 OF THEM, AND IT IS NOT THE SAME 12. The two views are two analyses — this one takes every function as an entry point, the module view takes the module — so they do not find the same names: in moonbit_core this view reports 16 and the module view 12, and only 8 of those are the same site. That is the same difference as the 46 against the 30 above, and the two views stay separate, not additive.
demoted family n what the lens claimed B 8 a BigInt literal's N suffix (0N) is not read L 8 the documented #doc(hidden) limit FAMILY A IS GONE, AND IT IS GONE BECAUSE IT WAS FIXED. It was the hex float: the lexer read 0x1.0p1023 as the integer 0x1 followed by the name p1023, and every exponent part it could not read became an undefined name. The lexer reads a hex float as ONE literal now, with the value the toolchain computes for it, so the family has no members left — and the row is kept in the census, empty, so that a hex float that leaks a name again is caught rather than reported as something the census could not classify."Accepted" is measured, not assumed. moon check --target all on moonbitlang/core reports no diagnostic at all: the pinned core is self-hosted and the toolchain type-checks interface files, and this version of the core passes that check cleanly. That is only half of it: a file with no diagnostic is indistinguishable from a file nobody opened, so _verify/control_perfunction_census.ps1 appends a deliberate type error to each of the seventeen files that carry a finding in a copy and requires the error back — the requirement is 17 of 17, and the control reads 17 of 17 today.(That row was red from 0.4.43 to 0.4.46, and the reason was the corpus and not the analyzer: the old pin carried one diagnostic of its own — abort/pkg.mbti:4, where the String of fn[T] abort(String) -> T is out of scope — and the checker bails on it before it type-checks anything else, so every probe came back carrying that one error and the probe's own error never appeared. The re-pin to 0.1.20261105+65efd5b93 brought a corpus this toolchain can check end to end, and the row turned green with it.)The eight in family L are the documented limit rather than a defect: a cross-package #doc(hidden) function cannot be indexed from the dependency's source — only from its .mbti — so the new_uninitialized constructors of io are still reported as undefined functions: @io.Utf8TextView::new_uninitialized on four sites, @io.Utf8Writer::new_uninitialized on two and @io.Utf8Reader::new_uninitialized on two. Answering them would mean growing the analyzer into a source indexer, which is a different project. Use the view to see the lens, not to gate a build on it.(This note said 116 → 2 until 0.4.32, and the "2" was the census of six corpora — moonbit_core was not in it, and it carries more findings than all six put together. The number was true of the corpora that were measured and false of the ones that were not. The history is in CHANGELOG.md.)
| suffix | static analysis here |
|---|---|
| .mbt | three-inspection program analysis |
| .mbtx | three-inspection program analysis + import-block audit |
| .mbti | interface audit: malformed lines / duplicate signatures / unknown type references. The line grammar matches what moon info actually emits, so a generated file raises no malformed line. The unknown-type check consults the module-wide interface table and measures 0 on moonbitlang/core. A residual finding can still name a type declared outside the scan — treat it as unverified, not as a defect. |
| .mbt.md | literate: only fences the toolchain actually compiles — mbt check / mbt test and the moonbit spellings. A bare mbt, a bare moonbit and nocheck are display blocks and are skipped. |
| .mbtp | logic-side proof lint (string constants in bodies, banned !/↔ forms, cross-package calls, lemma without proof_ensure) — not a replacement for moon prove |
| moon.mod / moon.pkg / workspace | recorded only, no static analysis — configuration is not code |
src/core Span/Severity/Lens/Family(merge_group contract)/Frame + Family::advice
src/report Report struct and rendering (union lens tags, vst frames)
src/flow data-flow framework: CFG + four solvers (round-robin, the
edge-transfer variant, and the before-node and forward work lists,
run against each other in tests),
basic blocks and the CFG over them,
live variables (may, backward), the
interval domain with widening, available expressions (must,
forward — the dual reading of the same solver), constant
propagation (the same lattice, read over a CFG), the call
graph (the whole-program graph, over the trait hierarchy),
and the pointer analysis read seven more times: over a pointer
flow graph, with a context (call-site / object / type), with a
scope (on demand), with a context-sensitive heap, without a heap
at all (access paths -- the storeless model), and interprocedurally
with the call graph built on the fly
src/sa scan entry + aggregate() + mermaid_states() (public, library)
src/lexer MoonBit lexer frontend
src/parser MoonBit syntax → ast
src/ast MoonBit abstract syntax
src/walk structural inspection: binding tables + structural findings
src/types type inspection: Ty/Ty?/Sig inference
src/interp behavior inspection: AbsVal lattice + dispatch + virtual stacks
src/pipeline assembly: run the three inspections + merge_group merge
src/moonfiles the other file kinds: .mbt.md per-block three-inspection / .mbti
interface audit / .mbtp proof lint
src/statecheck use 2: generic machine-table audit (plain-data MachineSpec bridge)
src/samples demo samples (embedded MoonBit source)
src/cli executable entry (program demo + file-kind demo + sample machine audit)
src/jsoncli the DeepSeek Harness JSON bridgea = b; ①
c.f = a; ②
d = c; ③
c.f = d; ④
e = d.f; ⑤taint_reaches_sink(sink=log, source=get_password, arg=0, line=7, col=3)x = readInput(); // untrusted
cmd = "..." + x;
execute(cmd); // critical (trusted)VarPointsTo(x, o) <- New(x, o). // one head
FieldPointsTo(f, o) <- New(f, o). // the deck's p.15 form: three heads,
FieldPointsTo(f, o) <- HeapStore(f, o). // one body -- read as THREE rulesRf = { (0,0) } U { (0,y) | y in f(EMPTY) } U { (x,y) | y not in f(EMPTY) and y in f({x}) }(0 -> 0) at every node THE GLUE EDGE
(0 -> g) for every g in gen[B] the constant part
(x -> x) for every x not in gen[B] and not in kill[B] the fact survivesGiven a statement S, besides S itself, if we need to consider multiple input data facts to create correct outputs, then the analysis is not distributive and should not be expressed in IFDS.
A path is considered to connect two nodes A and B, or B is reachable from A, only if the concatenation of the labels on the edges of the path is a word in a specified context-free language.
Every right parenthesis ")i" is balanced by a preceding left parenthesis "(i", but the converse needs not hold. For each call site i, label its call edge "(i" and return edge ")i". Label all other edges with symbol "e"
A soundy analysis aims to capture all dynamic behaviors with certain hard language features unsoundly handled within reason A sound analysis requires to capture all dynamic behaviors An unsound analysis deliberately ignores certain behaviors in its design for better efficiency, precision or accessibility
sound=0 soundy=15 unsound=3| the exclusion | the family | what the analyzer chose not to do |
|---|---|---|
| X-ARG-TYPE-NAMED-ARITY | MSA-007 ArgTypeMismatch | the arity of a named-call is not checked — a deliberate leniency, kept because the alternative produced false positives |
| X-OP-PIPE-EXEMPT | MSA-008 OperatorMismatch | the operands of the pipe operator and of regex-match are exempt |
| X-NOSEC-REALITY | MSA-012 StaleNosec | the finding a // nosec silenced is removed, and whether it was real is never re-checked |
Problem: Reflection targets cannot be resolved if the string values are statically unknown
When string arguments cannot be resolved statically, infer the reflective targets at their usage points!
pub fn action_mask_to_action_vec(UInt) -> Array[Action]| the deck's p.40 pair | count |
|---|---|
| cross-file calls whose callee the .mbti declares a signature for | 2,943 |
| of those, the ones whose declared arity agrees with the argument count of the call | 2,282 |
Current practice Manually models the critical native code
For efficiency, arraycopy() is implemented in native code
An alternative modeling System.arraycopy(src, sp, dest, dp, ln); Java for(int i = 0; i < ln; i++) dest[dp+i] = src[sp+i];
Recent work Identifying Java Calls in Native Code via Binary Scanning (ISSTA 2020)
| the deck's p.57 question | declared | covered | missing |
|---|---|---|---|
| moonbit_core — the standard library | 1,155 | 1,075 | 80 |
| async | 10 | 0 | 10 |
| the other five corpora | 0 | 0 | 0 |
| this repository | 0 | 0 | 0 |
| the eight trees | 1,165 | 1,075 | 90 |
if e goto L1
goto L2
x₀ = 0
goto L3
x₁ = 1
x₂ = ∅(x₀,x₁)
y = x₂ + 7SSA-COST files=262 unreadable=0 functions=1436 converted=5 partial=1431 declined=6533 …moon check --target all --deny-warn # 0 errors, 0 warnings (js / native / wasm / wasm-gc)
moon test --deny-warn # 1800/1800 on wasm; 1635/1635 on js and wasm-gc
moon run src/cli # program demo + file-kind demo + sample machine auditpowershell -NoProfile -ExecutionPolicy Bypass -File _verify\release.ps1moon fmt --check
moon check --deny-warn
moon test --target js
moon test --target wasm
moon test --target wasm-gc
moon build --target wasm
moon build --release --target wasm
the host contract of the artifact (what a user's toolchain must supply)
grammar probe control (its verdicts can go red)
self-scan (own source)
ssa cost (own source)
README links, anchors, versions and counts
gate roster: self-test (eleven injected defects must be caught)
gate roster: one harness, one list, a count that matches, and every check gate accounted for
the shared harness: the INCONCLUSIVE verdict, shown to go red
proof contracts: no false #proof_pure
proof contracts, shown to go red (its own self-test)
the proof status: the documents must say what the prover says
the proof status, shown to go red (its own self-test)
the goal checklist: the tasks are ticked and the rules are numbered
the goal checklist, shown to go red (its own self-test)
the registry URLs: the documents must point at URLs that answer
the registry URLs, shown to go red (its own self-test)
the newest core: the tree must have been re-gated against the one the registry publishes
package contents: the junk stays out, the evidence stays in
notice labels: a scope limit is a notice, a defect is an error
the family roster: one id each, contiguous, and reversible
frame audit: a region silences the bindings it could have read, and no others
match arms: the arms are read, the findings are true ones, and the fallback is exact
the family sweep: every family fires, from its own fixture
the family sweep, shown to go red (its own self-test)
the false-positive pin: this tree has no actionable finding
the false-positive pin, shown to go red (its own self-test)
the blind-spot rate: the defects inside a `test` body
the blind-spot rate, shown to go red (its own self-test)
the published pointers: every pointer in a shipped document resolves
the published pointers, shown to go red (its own self-test)
the shipped CLI example: every line of it is a line the CLI prints
the shipped CLI example, shown to go red (its own self-test)
the toolchain claims: the shipped documents must agree with the toolchain itself
the toolchain claims, shown to go red (its own self-test)
published self-scan self-test
published package self-scan
the notice reconciliation can go red (a real defect is seen)
corpus SUMMARY vs pinned baseline
per-function census vs pinned baseline
per-function census control (the files are READ by moon check)
the behavior lens: measured against its own header
the region suppression: what it hides, measured and pinned
the reach of the `raise?` construct, measured and pinned
the premises of the 0505 porting plan, measured
the notice flood: which notices deserve a line, measured
the three bandit transfers: measured, not asserted
the confidence demotion: measured, not asserted
the transfer scope: the requirements document, the three rows, and where they landed
the release freshness: the version must still describe the source| row | what it asks for | the files that implement it |
|---|---|---|
| 1 | a per-finding confidence axis beside severity | src/core/core.mbt, src/report/report.mbt, src/jsoncli/main.mbt |
| 2 | stable family ids and a checked profile | src/core/core.mbt, src/sa/profile.mbt |
| 3 | nosec, including the stale-suppression warning | src/sa/profile.mbt, src/sa/main.mbt |
The command does not run green today, and the reason is measured. moon prove src/core fails with unbound type symbol 'array' — not 'map'. The generated Why3 file declares the two abstract types itself: type array 'a1 at line 136, type map 'a1 'a2 at line 138. It uses them earlier — array at line 20 (IfaceSig), map at line 27 (IfaceSymTab). Why3 requires a type to be declared before it is used, and array is declared after its first use. So the file does not load, and nothing is proved: 0 of 1 packages proved, 0 goals proved.THE CAUSE WAS RE-MEASURED, AND THE EXPLANATION THIS PARAGRAPH USED TO GIVE WAS WRONG. It blamed the toolchain's proof prelude. The experiment below is what refuted it, and it also refuted the advice the old explanation carried — that IfaceSymTab has to move out of the proof subject, which changes this package's public API and is therefore a version-line decision. No public API has to change to find that out.THE EXPERIMENT. Hoisting only the array declaration moves the error forward: it becomes unbound type symbol 'map' at line 28. Hoisting both makes why3 load the file, generate 21 VCs and exit 0 — and of those 21, cvc5 answers unsat for 20, while severity_taxonomy_holds comes back unknown (incomplete) (measured 2026-11-20 on core 0.10.21+06da1ed44; a 300 s limit decides it no better). The lemmas are not blocked by this package's source; they are blocked by the order two declarations are emitted in, which is the toolchain's to fix. _verify/check_prove_status.ps1 runs the prover and holds this paragraph, its Chinese twin, the workspace skill and the sibling gate to what the prover reports today.Two #proof_pure annotations were also false: on path_tail and unqualified, whose bodies build a StringBuilder, which the prover rejects (error 4207). One false annotation stops the whole file from proving, and both of those arrived on 2026-10-09. They are removed, and _verify/check_prove_contracts.ps1 now fails the release if any #proof_pure body is one the prover rejects.
powershell -NoProfile -ExecutionPolicy Bypass -File _verify\release.ps1Install
Download zipThree-inspection (structural / type / behavior) static analysis for MoonBit programs, every toolchain file kind (.mbt / .mbtx / .mbti / .mbt.md / .mbtp) and state-machine tables