Repository navigation
Releases
v1.5.3
Metadata only. No rule, CLI flag, default, report field, MCP tool or archive
layout changed. The library crates stay at 1.5.0, except rg-render 1.5.3
(same code; it carries the tool version). 1.5.2 cannot be listed on the
GitHub Actions Marketplace: its action description was 136 characters, and
the form requires fewer than 125.
Changed
- The action's description is 113 characters (was 136), so the GitHub
Marketplace accepts it (the limit is fewer than 125).tests/docs.rsnow
checks the name, description length, branding and thataction.ymlis the
only action metadata file at the root.server.jsonversions are pinned
to the crate version in the same test file.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
Built with rustc 1.95.0 and repacked deterministically, so the
archives can be compared with a local rebuild. From a checkout of this
repository:
scripts/reproduce-release.sh v1.5.3 x86_64-unknown-linux-musl
v1.5.2
Metadata only. No rule, CLI flag, default, report field, MCP tool or archive
layout changed. The library crates stay at 1.5.0, except rg-render 1.5.2
(same code; it carries the tool version).
Changed
- MCP Registry name is
io.github.KhomDev/rgate(was
io.github.khomdev/rgate). The registry namespace follows the GitHub login
and is case-sensitive, so the lowercase name could not be published. The
name changed inserver.json, the READMEmcp-name:line, the
realism-gate-mcp --helptext and the docs. 1.5.1 is not in the registry.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
Built with rustc 1.95.0 and repacked deterministically, so the
archives can be compared with a local rebuild. From a checkout of this
repository:
scripts/reproduce-release.sh v1.5.2 x86_64-unknown-linux-musl
v1.5.1
This is a patch release on the MCP server only. No rule, rule severity, CLI
flag, default, report field or archive layout changed; the new MCP tools and
settings wrap existing CLI commands. 1.5.0 shipped the broken transport, and
1.5.1 supersedes it for MCP use. The library crates are unchanged and stay at 1.5.0,
except rg-render 1.5.1 (same code; it carries the tool version printed in
reports, SARIF and cards).
Fixed (MCP)
realism-gate-mcpspeaks the MCP stdio transport. Up to and including
1.5.0 it wrote every response with an LSP-styleContent-Lengthheader.
MCP's stdio transport is one JSON message per line, so current clients did
not connect: the MCP Inspector timed out after 15 s ontools/listagainst
the 1.5.0 binary. Responses are now one line each. A request framed with
Content-Lengthis still read and answered in that framing
(src/mcp.rsserve,read_message;docs/agents.md).initializeechoes the client's protocol revision when it is2025-06-18,
2025-03-26or2024-11-05(it always said2024-11-05).- JSON-RPC error codes: unknown method
-32601, bad arguments-32602,
invalid request-32600(batches, a null or fractional id, a missing
jsonrpc), unreadable JSON-32700. A complete line that is not JSON no
longer stops the server. Every error used to be-32601. - A checker that cannot start is a tool result with
isError: trueand the
reason, not a protocol error.
Added (MCP)
- Three more tools:
dump_program(check --dump-program),list_rules
(rules --format json) andexplain_rule(explain -- RULE). All five
tools carryreadOnlyHintannotations andadditionalProperties: false
schemas; an argument a tool does not list is refused.check_poctakes
fragment. - Limits the operator sets:
REALISM_GATE_MCP_ROOT(every path argument
must resolve inside it, symlinks followed),REALISM_GATE_MCP_TIMEOUT_SECS
(default 120; the run is killed past it), a 4 MiB cap per output stream
(refused, not cropped), a 4096-byte cap per argument. The checker's stdin is
closed. realism-gate-mcp --versionand--help.serverInfoisrgate/
realism-gate, andinitializereturnsinstructionsthat carry the
DEV-ONLY caveat.- MCP Registry metadata:
server.json(io.github.khomdev/rgate,
registryType: cargo) and a visiblemcp-name:line in the README, which
is how the registry checks a crates.io package. - Tests:
tests/mcp_props.rs(9 proptest properties),tests/mcp_bounded.rs
(deadline, cap, closed stdin, against a real child process),
tests/mcp_stdio.rs(a real newline-delimited client session whose tool
text is compared byte for byte with direct CLI runs), and 38 unit tests in
src/mcp.rs(was 11). - The skill names the five tools and says the
measurednumbers are
DEV-ONLY.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
Built with rustc 1.95.0 and repacked deterministically, so the
archives can be compared with a local rebuild. From a checkout of this
repository:
scripts/reproduce-release.sh v1.5.1 x86_64-unknown-linux-musl
v1.5.0
Added (P2)
- Claude Code plugin.
plugin/and the root.claude-plugin/marketplace.json.
The plugin version is the crates.io releaserealism-gate-ensureinstalls.
A release bumpsplugin/.claude-plugin/plugin.jsonand the marketplace
entry withCargo.toml;tests/plugin.rsfails if they disagree. The
SessionStart hook only reports a missing or mismatched CLI. The plugin does
not registerrealism-gate-mcp(seeplugin/README.md). - Program model (RG-A1).
check --dump-program DIRreads a protocol
working tree and reports, per entry point, the authority it requires
(Signer(account),Role(name),Owner,None,Unknown(reason)) with
source spans. Anchor#[derive(Accounts)]constructs, nativeis_signer/
owner / key checks and Solidity modifiers and body guards are resolved; an
IDL fills gaps but the source wins and records the conflict; a resolution
failure isUnknown, never a guess. The model reads only the target tree. - Exploit model (RG-A2). Actors carry provenance (generated, loaded,
derived PDA, funded, granted, deployer); steps carry program, entry point,
signers, a separate payer and the required authority; mutations, assertions
and data-dependency phases are recorded, with position only a tiebreaker.
An authority over an account the attacker created or funded is
attacker-owned, and a payer is never a role signer.--dump-model FILE
writes the model deterministically with no absolute paths;
--model-target DIRsupplies the protocol checkout the rules read.
On the opened v2 corpus the model removes all 28 RG02 and 8 RG03 false
positives with no other rule moved and readability unchanged (in-sample;
not a fresh precision claim).
Changed (build)
- The crate is a Cargo workspace.
rg-ir,rg-frontend-sol,
rg-frontend-rust,rg-frontend-ts,rg-frontend-move,rg-program,
rg-model,rg-rules,rg-execandrg-renderare separate library
crates; therealism-gatepackage keeps its name, its three binaries, its
CLI flags and exit codes, thereport/v1andcard/v1schemas and the
SARIF output. A golden test pins the CLI output over every committed
fixture to prove the split changed no bytes. - The ten library crates are published to crates.io, each at the same
version asrealism-gate(rg-ir,rg-frontend-sol,rg-frontend-rust,
rg-frontend-ts,rg-frontend-move,rg-program,rg-model,rg-rules,
rg-exec,rg-render), in the dependency order of PACKAGING.md, because
realism-gatecannot be packaged without them. They are internal: no API
stability guarantee outsiderealism-gate.publish = falseis removed;
each carries a README, the MIT LICENSE and keywords. tests/golden.rsrestores the recorded tool version before hashing
the CLI output, so a version bump no longer changes all 109 recorded hashes;
every other byte is still compared.- Release cadence exception. 1.5.0 is the fourth release in three days
(1.1.0, 1.2.0 and 1.4.0 shipped on 2026-11-25), which RELEASING.md's
one-minor-per-week rule does not allow. It is a recorded exception
decided by the maintainer; see RELEASING.md.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
Built with rustc 1.95.0 and repacked deterministically, so the
archives can be compared with a local rebuild. From a checkout of this
repository:
scripts/reproduce-release.sh v1.5.0 x86_64-unknown-linux-musl
v1.4.0
Changed (severity)
- RG02 and RG03 ship at
noteon Solana. The 1.3.0 fresh held-out round
measured RG02 at 0/16 and RG03 at 0/5: the remaining flags are the fee payer
of an instruction whose accounts mark the role account non-signing, the
attacker's own fixture key, or a setup helper. A rule atwarnwith zero
fresh precision is noise. RG01, RG04 and RG06 were already notes. The
Solidity severities are unchanged. - RG08 and RG09 ship at
warnon Solana; no Solana rule ships aterror
in this release. The floor is a fresh held-out Wilson lower bound of at
least 0.80. RG08 is right 10/10 on the v2 held-out split, but 10/10 has a
lower bound of 0.7225, soerroris not supported yet; it returns there at
16/16, where the lower bound reaches 0.8064. RG09's only fresh flag was
labelled unclear, so it has no rate at all.warnis reported and is not a
CI failure under the default--fail-on error. - The floor is now enforced against the fresh measurement:
measure.pyin
eval/solana-poc-v2/regeneratesmeasured.jsonfrom the committed
held-out labels, andtests/precision_floor.rsreads it. A Solana rule at
errorwith no fresh cell of n >= 5 fails the test, so an unmeasured error
rule cannot ship. Previously the test read a file with no fresh cells and
passed vacuously.
Fixed (CI)
- The weekly
fuzzworkflow names the GNU triple. The prebuilt
cargo-fuzz installed byinstall-actionis a musl binary, and cargo-fuzz
derives its default build target from its own triple; a musl target links
libc statically, which the sanitizer refuses ("sanitizer is incompatible
with statically linked libc").cargo fuzz run --target x86_64-unknown-linux-gnupins the dynamic-libc target. The workflow now
builds and fuzzes again (run 45690709031). On that first run the TypeScript
target found an input that trips adebug_assert!inside the upstream
oxc_parser0.146.0 lexer (trivia_builder.rs:62,comment.is_pure()).
Release builds compile debug assertions out, so the shipped binaries do not
panic on it; the weekly job stays red until the upstream assertion is fixed
or the input is handled, and this entry does not call the fuzz job green.
Fixed (P1-C precision round, proposed 1.3.0)
- A helper file with no test is no longer read as a fragment. The script
reader wrapped every import-only helper passed alongside the PoC as
it("fragment")and flagged RG08 on it. Script mode now requires an
executable top-level statement (or amaincall), and auto-detection only
wraps the unit's first file, not its imported helpers. - A test title that says the attack is blocked is a control test. Titles
withblocks,blocked,denies,cannot,does not allow,not allowedormust failjoin the existingsecure/control/prevents/
rejects/fails whenclass, so RG01/RG02/RG03/RG04/RG06 do not fire on
them. A leading ✓/✔ (the secure-suite convention) is included.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
Built with rustc 1.95.0 and repacked deterministically, so the
archives can be compared with a local rebuild. From a checkout of this
repository:
scripts/reproduce-release.sh v1.4.0 x86_64-unknown-linux-musl
v1.2.0
Added (P1-C, 1.2.0)
- Four readers for the PoCs judges receive. A Rust
#[test]that calls
program functions directly is checked (the direct call is modelled as the
exploit transaction); a Rustfn mainthat drives a PoC framework
(poc-framework,LocalEnvironment,Environment::…_client) is read as one
test; a TypeScript script that drives an Anchor/web3.js/LiteSVM client is read
as one test, withmain()inlined; andcheck --fragment <file>wraps a
pasted fragment as one test body. A.rs/.ts/.jsfile given explicitly
that has no top-level test is auto-detected. The report gains
fragment: truewhen the boundary is the tool's. tests/precision_floor.rsenforces the severity floor in
docs/precision.md: a rule ships aterroron Solana only when its fresh
held-out Wilson lower bound is at least 0.80.eval/solana-poc-v2/is the sealed fresh corpus: 81 counted units (28
judged, 53 exploit-by-construction), pinned before the firstsrc/change.
Changed (P1-C, proposed 1.2.0)
- RG01, RG04 and RG06 ship at
noteon Solana. Their P1 PoC held-out
precision was 16.7%, 0% and 0%; a rule aterrornow needs a fresh held-out
lower bound of at least 0.80. The Solidity severities are unchanged. The
catalog gainssolana_severity(); the generated rule pages say which ids
moved. - RG01 no longer counts an attacker-signed grant as a harness grant. An
attacker that initialises the program as its own admin, or re-initialises
itself, took the role through the bug; that is the exploit, not the harness. - RG04/RG06 fixtures and preconditions. A write of an account a later
initialise/create instruction sets up is not reported. A precondition
written while setting up is reported atnotewithPrecondition fabricated:and says the drained balance never passed through the program. - RG10 accepts a read of the same account before the attack as a baseline,
whatever the local is called, not only a name likebefore. - Control tests (expects failure, or a title saying
secure/control/
prevents/rejects/fails when) no longer fire RG01, RG02, RG03, RG04
or RG06; RG08 still applies. - A fresh keypair the test never gives a role (by a grant, a role field, an
initialise/configure call, or a declaration) is not privileged. A role
granted by another signer, or shown by a role-named signer of a gated
instruction, still is.
Fixed (P1-C, proposed 1.2.0)
- Fragments: bare statements and
it()blocks pasted into an issue parse. - Scripts: an Anchor script with
main()is no longer silent. - PoC-framework binaries:
execute_as_transactionis a transaction with
its signers and instructions;LocalEnvironmentis a harness and
Environment::devnet_clientis a live cluster. - RG08: the rule's scope is the exploit part of the trace, matching its own
definition; the study rubric is updated to agree. - Docs: the rule pages and README example blocks are regenerated for the
1.2.0 severities and the four readers.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
Built with rustc 1.95.0 and repacked deterministically, so the
archives can be compared with a local rebuild. From a checkout of this
repository:
scripts/reproduce-release.sh v1.2.0 x86_64-unknown-linux-musl
v1.1.0
Added
rulesandexplainprint measured precision per language. The rule
catalog embedseval/solana/measured.json; a rule with no fresh or held-out
label printsunmeasured, never 100%. The JSON rule rows gain ameasured
object keyed by language withstatus,tp,fp,labelled,precision,
wilson95,split,populationand, for cells with fewer than five labels,
count_only(printed ask/n (n<5, count only), never a percentage). The
Rust and Anchor TypeScript numbers are the held-out split of the Solana PoC
study (eval/solana-poc/), not the earlier test-suite measurement, which
stays published ineval/solana/RESULTS.md; the Solidity number uses only the
fresh (out-of-sample) corpus.docs/precision.mdstates the population and
the limits, and the generated rule pages carry the same line.
Changed
rules --format json:languageslistsjavascriptfor every rule
that checks Solana tests. The tool already read JavaScript Anchor/web3.js
tests; the list said onlyrustandtypescript.eval/results/rules-v0.6.0.json
is regenerated (onlylanguagesand the newmeasuredobjects change; the
precision tables and the R3 check are unchanged).
Fixed
- Release workflow: the
checksumsjob did not listverifyinneeds, so
the version it repacks with was empty; andscripts/package-release.shwrote
the zip to a relative output directory from inside the staging directory.
Both were caught by the 1.1.0 dry runs, before any tag. A regression case in
scripts/test-package-release.shcovers the relative output directory. - Attestation test on Linux/macOS: the fake
ghin
scripts/test-verify-attestation.shwas not executable, socommand -v gh
found the runner's realgh. The Action itself runs the script withbash
and was not affected. - CI package check now allows
eval/solana/measured.json, which the crate
embeds forrules/explain.
Documentation
- Solana PoC measurement (P1-A redo, 2026-11-25).
eval/solana-poc/
measures the frozen 1.0.4 rules on 99 public Solana PoC units (12 judged,
82 exploit-by-construction, 5 patched negative controls) from 45 pinned
sources, preregistered before any run or label. The tool reads 1 of 12
judged PoCs (8.3% [1.5-35.4]) and 72 of 82 exploit-by-construction ones;
held-out precision over all rules is 46/106 = 43.4% [34.4-52.9], with RG08
29/30 and RG09 7/7 against RG01 2/12, RG02 8/30, RG04 0/16 and RG06 0/6.
docs/precision.mdcarries the summary (checked bytests/docs.rs).
No rule logic changed. - Correction.
eval/solana/{README,RESULTS}.mdanddocs/precision.md
said a public Solana PoC corpus does not exist in a form the tool reads.
That was wrong: the search checked three repositories and stopped, and the
Neodyme workshop PoCs it cited are unsolved templates. The text now says so
and links the PoC measurement. - P1 Rust/Anchor TypeScript measurement. Four pinned public test suites,
174 flags, 133 sampled, 63 held-out labels, Wilson 95% intervals per rule and
language. The report says plainly that the corpus is test suites, not PoCs,
and records the missing PoC corpus as a gap rather than widening the claim. - Correction.
docs/precision.mdsaid the264ca72solana-program-library
pin had fiveprogram/testsdirectories; at that commit onlytoken-lending
andgovernancehave one. The text is corrected.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
Built with rustc 1.95.0 and repacked deterministically, so the
archives can be compared with a local rebuild. From a checkout of this
repository:
scripts/reproduce-release.sh v1.1.0 x86_64-unknown-linux-musl
v1.0.4
A security and robustness release, from a self-review of 1.0.3. No rule id,
flag, default or output field changed; the JSON and SARIF formats are
unchanged. Reporter: self-review.
Security
verify-fixreadsffifrom TOML under a conservative key
normalization. Foundry resolves case and separator aliases:FFI,Ffi,
ffi_andffi__all setffi(verified against forge 1.5.1). The guard
applies a deliberately coarser normalization than Foundry (lowercase ASCII;
keeps ASCII alphanumerics only, dropping Unicode too), which catches every alias Foundry
resolves and also refuses some spellings Foundry treats as unknown (f_f_i). Only
exactlyffiwith the boolean valuefalseis accepted, a booleantrue
is refused, any other value is refused conservatively, and every
non-canonical spelling is refused whatever its value. The scan is document-wide: spacing, tabs, quoted keys,
dotted keys, inline tables, the top-level table and profiles the program has
never heard of are all covered. Foundry's global config (~/.foundry/foundry.toml, or
%USERPROFILE%\.foundry\foundry.toml), the root tree, the--patchedtree
and the copy after--patchare checked before the tree is used, with the
global config and both copies parsed again immediately before each forge
start. Afoundry.tomlthat does not parse is
refused rather than assumed off. A config in an ancestor directory of the
temp copy is not checked; on Windows Foundry may resolve the OS known
profile folder while this check usesUSERPROFILE/HOME, so the two can
differ;docs/threat-model.mdH5 records both residuals.
FOUNDRY_FFI=falseis not described as a control: Foundry documents the
variable as an explicit exception to its environment overrides. Tests:
ffi_is_seen_however_toml_spells_it,
foundry_key_aliases_and_non_boolean_ffi_values_are_refused,
ffi_is_refused_in_the_root_the_patched_tree_and_after_a_patch(17 exact
and alias spellings),
a_global_config_with_an_ffi_alias_is_refused_before_forge_starts,
a_minimal_top_level_ffi_alias_is_refused_before_forge
(src/verify_fix.rs,tests/verify_fix_ffi.rs).- Write
fs_permissionsand its aliases are refused, closing the
config-rewrite path. A PoC could setfs_permissions = [{ access = "read-write", path = "C:/" }]and usevm.writeFileto rewrite the other
copy's or the global config to an ffi alias between the two runs; the key
itself has aliases too (FS_PERMISSIONS,FS-PERMISSIONS,fsPermissions,
fs_Permissions,Fs-Permissions,fs__permissions, the quoted key
"fs.permissions", and spaces), which Foundry resolves to the same setting.
The unquoted dotted formfs.permissions = ...parses as nested
fs/permissionskeys; neither Foundry nor the guard resolves it as
fs_permissions, so there is no gap. Any key normalized tofs_permissionsmust be
the exact spelling, and every entry in every checked config must grant
exactlyaccess = "read"; a write or read-write entry, a missing or
non-string access, a non-array value, a non-table entry, or an alias is
refused before any forge run. Both copies and the global config are also
re-parsed immediately before each run, which catches a simple rewrite; the
fs_permissionsrefusal is the primary control. Tests:
fs_permissions_must_be_read_only,
write_fs_permissions_are_refused_in_every_config_the_guard_reads,
fs_permissions_aliases_are_refused_in_every_config_the_guard_reads,
a_global_config_with_a_fs_permissions_alias_is_refused_before_forge_starts,
the_alias_cross_run_combination_is_refused_before_forge,
read_only_fs_permissions_reach_forge,
a_rewritten_tree_or_global_config_is_refused_before_the_next_run,
a_global_config_rewritten_by_the_first_run_is_refused_before_the_second. - The dotenv redirect is closed. Foundry loads a
.envafter it starts,
and dotenvy does not override an already-set variable. Removing
FOUNDRY_CONFIGtherefore let a--patchthat created.env+
evil.tomlpoint forge at an unparsedffi = trueconfig.FOUNDRY_CONFIG
is now pinned to the absolute path of a config the guard checked inside the
copy (a minimal[profile.default]file is created when the tree has none),
and any.envin a copied tree is refused before each forge run. Tests:
a_patch_that_adds_dotenv_and_an_evil_config_is_refused,
a_clean_dotenv_is_still_refused,
the_forge_child_gets_the_pinned_absolute_config(src/verify_fix.rs,
tests/verify_fix_ffi.rs). - Relative
--patchand--forgepaths are resolved before the copy's
working directory applies.--patch ../fix.diff(outside--root) and a
--forgevalue containing a separator keep working; a bareforgekeeps
PATH lookup (src/verify_fix.rs,tests/verify_fix_paths.rs). - The host policy is enforced in the library.
verifyrefuses a request
with noHostPolicybefore copying a tree or starting forge, so a library
caller is covered like the CLI (src/verify_fix.rs,
no_attestation_is_refused_before_forge_is_started). --patchrequires git.git apply --checkruns first and the
hand-written fallback applier is gone, so a tree the patch does not describe
is never run (src/verify_fix.rs,docs/verify-fix.md).- A Foundry config is size-checked before it is parsed. A tree or global
foundry.tomlmust be a regular file of at most 1 MiB; a larger one is
refused before the read (src/verify_fix.rs,
an_oversized_foundry_toml_is_refused_before_forge_starts). - Each forge run is time- and output-bounded. A run longer than 10 minutes,
or one that prints more than 64 MiB of stdout or 1 MiB of stderr, is killed
and is aVerifyError(exit 2), never a fail verdict; the verdict is not
taken from a truncated log (wait_forge,
a_forge_that_runs_past_the_timeout_is_killed_and_is_not_a_verdict,
a_forge_that_floods_stdout_is_killed_and_is_not_a_verdict). - The copied tree is bounded. The project or
--patchedtree is
attacker-controlled; the copy is capped at 50 000 files, 512 MiB in total,
50 000 directories and 64 levels deep, checked from metadata while copying,
so a hostile tree cannot fill the disk with files or empty directories before
forge's own limits apply (copy_tree,copy_tree_with_limits,
the_copy_file_byte_and_directory_caps_are_enforced,
a_tree_larger_than_the_copy_limit_is_refused_before_forge_starts,
a_tree_deeper_than_the_copy_limit_is_refused_before_forge_starts). - MCP framing is bounded.
Content-Lengthis refused above 8 MiB before
any allocation. The server writes a JSON-RPC error and stops (exit 2): it
does not claim to resynchronise past a body it refused, so a following ping
is not served. A header line is capped at 8 KiB; empty lines are skipped in a
loop instead of by recursion (src/mcp.rs,tests/mcp_stdio.rs). - Control characters and bidi formatting from source and claims do not
reach terminal output. The text, Markdown and evidence-card renderers
replace newline, carriage return, tab and U+2028/U+2029 with a space, and
drop other Unicode control characters plus the bidi controls U+061C, U+200E,
U+200F, U+202A-U+202E and U+2066-U+2069, from finding messages, evidence,
paths, suite and test names, claim text and evidence, suppression notes and
parse errors, before any colour wrapper. A Linux file name containing a
newline can no longer fabricate a report line. JSON and SARIF keep their
serde escaping (src/render/mod.rs,
control_characters_in_source_never_reach_text_or_markdown_output,
a_newline_or_bidi_in_a_path_cannot_fabricate_a_report_line).
Fixed
- Input caps. 8 MiB per source file (from metadata, before the read),
128 MiB and 20 000 files per run, 64 levels deep, and 16 MiB for a
--report,--claims,--declarationor--configfile. Every error names
the limit (src/project.rs,an_oversized_source_file_is_refused_by_name_before_it_is_read). - Policy inputs must be regular files. The 16 MiB cap alone did not bound a
FIFO: it has length zero, soread_to_stringblocked forever. The type is
now checked withsymlink_metadata, a FIFO is refused before it is opened,
and a symlink is refused too. The check is not atomic with the open; policy
files must come from a trusted location (src/project.rs,
a_non_regular_policy_input_is_refused_by_name,
a_fifo_policy_input_is_refused_without_blocking). - The trace is no longer quadratic in test count. A suite base (state
initializers, constructors,setUp()and callbacks) and the RG15 whole-file
fee-concession fact are computed once per suite; the test-function
duplicate check uses a set. The 5 MB / 40 000-function adversarial case is
enabled instead of ignored, and a 12 000-function case (serialised with the
other size tests so the measurement is stable) has a 5 s release bound and a
120 s debug bound the old quadratic run cannot meet (src/trace.rs,
src/project.rs,src/engine.rs,tests/adversarial.rs). - Deleted the dead no-op context-line branch in the removed fallback applier.
verify-fixconfig errors name the offending alias key and display paths
with one separator style on Windows.
Changed
verify_fix::Request::hostisOption<HostPolicy>;Noneis refused by
verify. The library API is documented as unstable, and this is the change
that puts the host decision inside the library.#![forbid(unsafe_code)]on the library and all three binaries.- CI has an MSRV job that reads
rust-versionfromCargo.toml(1.95, the
1.95.0 minimum) and runscargo test --lockedon that toolchain. The weekly,
non-gatingcargo-mutantsjob oversrc/rules/,src/claims/,src/bind/
andsrc/verify_fix.rslives in its ownmutants.ymlworkflow with a
schedule andworkflow_dispatch, so the...
v1.0.3
A correctness release. Five of the eight adversarial cases recorded as ignored
in 1.0.2 now pass and are enabled; the parser no longer lowers statically dead
branches or statements after an unconditional return/revert, and a claim
field named in both places is the error docs/claims.md always said it was. No
rule id, flag, default or output field changed.
Fixed
- Statically dead code is not lowered.
if (false) { vm.prank(admin); }
used to reach the trace, so a dead prank could contradict an attacker claim
(RG02). A branch whose condition is a boolean literal is now lowered only when
it runs; a dynamic condition keeps both sides, as before.while (false)and
for (…; false; …)bodies are skipped too. - Statements after an unconditional
returnorrevertare dropped. An
assertion afterreturn;could count as impact evidence and mark a drain
claim SHOWN. A return in one branch of a dynamicifstill falls through, so
the branch is not treated as ending the function. - A claim field named both inside and outside a nested
claims:block is an
error.Raw::flattensilently preferred the outer value; docs/claims.md
says the duplicate is an error, and now it is. - A
claims.yamlthat disagrees with the report's front matter is an error.
The file used to win silently, so one finding could state two claim sets.
When both parse as claims and differ,checkexits 2 naming both sources;
agreement is accepted. - Source discovery is case-insensitive on Windows and elsewhere.
.SOL,
.Rs,.Moveand upper-case TypeScript extensions are found, and.d.ts
declaration files remain excluded. - Simplified the
vm.labelclassification inidentity.rs(clippy's
nonminimal_bool).
Tests
- Enabled five ignored adversarial cases: the dead prank, the assertion after
return, the assertion insideif (false), the duplicate claim field and
the claims/front-matter disagreement. - New parser unit tests for statically dead branches and unreachable code.
- New claims unit tests for the duplicate-field error.
- New property test: a literal-condition branch reaches the trace exactly when
it can run. - New unit test for case-insensitive source extensions.
Three tracked gaps remain ignored and unchanged: a privileged prank inside a
helper contract the test calls, an address round-tripped through
abi.encode/abi.decode, and super-linear time on very large files.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).
v1.0.2
A security and fix release. RG02 now catches a prank as a contract the PoC
deploys from its own file (#17). --changed-since and verify-fix no
longer let an untrusted repository or patch run a program or write outside
the copy. New adversarial, fuzz-corpus and property tests ship with it; eight
adversarial cases the checker gets wrong today are committed as ignored tests
with their inputs (cargo test -- --ignored), so the gaps are on record. No
rule id, flag, default or output field changed, and the published precision
numbers are unchanged (re-measured on this build).
Security
--changed-sinceno longer lets a repository's own config run a program.
A.git/configin the working tree could setcore.fsmonitor, which git
runs on an index refresh, and afilterattribute in.gitattributesor
.git/info/attributescould name a clean filter, which git runs for a
worktree comparison. Both ran. Every git call now goes through one helper
that turnscore.fsmonitoroff. git is no longer asked to compare the
worktree: realism-gate lists the blob ids at the revision (ls-tree) and
hashes the current files withhash-object --no-filters, then compares the
ids itself. A file that differs from the revision only in line endings is
listed, which is checked rather than missed; a symbolic link is listed
without being read.tests/security.rsplants each program and asserts it
does not run.--target-commitand--changed-sincevalues that start with-are
refused (exit 2). Tested; this was already enforced, and is now a regression
test.verify-fixrefuses a patch that creates a symbolic link, and a patch
over 8 MiB.git applyturns a mode120000entry into a link whose target
is not checked, so a later read could leave the temp tree. The check runs
before any apply. The size cap stops a huge patch being read whole into
memory, with a clear error. A project symlink is not copied (already true;
now tested), and drive-letter, verbatim and UNC spellings of an absolute path
are tested as refused.- The host decision for
verify-fixis pinned by tests.
REALISM_GATE_SANDBOX=1(and the/.dockerenvand/run/.containerenv
markers) still count as an attestation, anddocs/verify-fix.mdsays so. The
policy is unchanged;tests/verify_fix_limits.rsmakes a change visible. - Every third-party action in the workflows and
action.ymlis pinned to a
commit SHA. Eachuses:line names the commit and its version in a comment
(# v7.0.1), and the major version is unchanged. Twotaiki-e/install-action
tags are named after the tool, with no version tag on the same commit, so
their comment sayscargo-audit tagandcargo-binstall tag. Local./
references are not affected.
Fixed
- RG02 fires on a prank as a contract the test deployed from a type in its
own file (#17).vm.prank(address(vault))andvm.startPrank(address(vault))
withvault = new Vault(), whereVaultis defined in the PoC file, was
read as a helper and not as the protocol, so the attacker claim was SHOWN.
It is now flagged, and the claim is CONTRADICTED. Three cases stay quiet: a
contract named for the attacker, a contract the attacker deploys under
startPrank(attacker), and a hard-coded literal address (unchanged, out of
scope). The published measurements do not change; see the PR for the
before and after numbers.
Documentation
- SECURITY.md states the guarantee per command. It said the tool "runs no
Solidity", which was true ofcheckand false ofverify-fix, which runs
forgeon the PoC. The table now says what each command executes and what
it reaches on the network. docs/threat-model.mdis new. A short STRIDE-light model: assets,
attackers, trust boundaries withfile:linereferences, the guarantees and
what proves each one, and the open hypotheses with their status.
Tests
tests/adversarial.rs: PoCs and reports written to fool the checker. It
covers a privileged address reached through a local variable, a helper
contract, and anabi.encode/abi.decoderound trip; a prank and an
assertion insideif (false)or afterreturn; a claims file and front
matter that disagree; a non-ASCII identifier; a 5 MB file; and a deeply
nested expression. Each case states what the tool should do. Eight cases fail
today and are#[ignore]d with the reason, and the inputs are listed in the
pull request. No rule changed.- Fuzz targets for every parser, in
fuzz/. One cargo-fuzz target each
for the Solidity, Rust, TypeScript and Move frontends, the claims YAML and
front matter (with the prose heuristics), andrealism.yaml. The property is
that no target panics. The crate is excluded from the main workspace, so a
normal build needs no nightly. Its seed corpus is copied from the test
fixtures and examples. tests/fuzz_corpus.rsreplays the corpus on everycargo test. It runs
the same target bodies over each seed and over a fixed set of deterministic
mutations. cargo-fuzz does not run on Windows, so this is the check that runs
everywhere.fuzz.yml, a weekly five-minute fuzz run per target on Linux. It uploads
crashing inputs as an artifact.- Property tests (
proptest) intests/properties.rs. For generated inputs,
not only the fixtures: the JSON report does not depend on the order the files
are given; adding an unrelated test function does not change the findings of
the tests already in the file; every JSON report validates against
docs/output-schema.json, and every SARIF log has the keys SARIF 2.1.0
requires. The schema checker moved totests/support/so both tests share it. docs/test-quality.md: line coverage and the mutant count for the rule
code. Whole-crate line coverage is 87.77%; the least-covered rule files are
listed. Mutation outcomes are not recorded yet: a fullcargo mutantsrun
takes hours here, so the page says so rather than estimating a survival rate.
Linked fromCONTRIBUTING.md. Nothing is gated on these numbers.
Install
cargo binstall realism-gate
or download an archive below and check it:
sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify <archive> --repo KhomDev/realism-gate
Three binaries are included: realism-gate (the checker), rgate
(the same program under a short name) and realism-gate-mcp (the MCP
server). cargo binstall installs all three. Linux builds are static
(musl).