Repository navigation
v1.5.7
Fixed
- RG09 does not treat a local assigned only in a
catchor branch as a
constant.let failed; try { .. } catch { failed = true }; assert.isTrue(failed)
was reported as "failedis a constant", although the assertion fails when
the call succeeds: the assignment runs only in the branch. The IR flattens
branches and the constant check read the single assignment. A local is now a
constant only when its value is the declaration's initializer
(let a = 1; assert_eq!(a, 1)still fires); an assignment after the
declaration is not, even when it is the only one and its value is a literal.
Covered bya_local_assigned_only_in_a_catch_is_not_a_constantand
a_local_initialized_with_a_constant_is_still_a_tautologyin
tests/typescript.rs. - RG08 is silent on a file the tool, not the author, made a test. A
top-level script (scripts/setup.ts,solve.ts) has noit()/#[test];
the frontend read it as one script test, and RG08 then reported that the
"test" asserts nothing. The suite name made the false positive visible as
setup::fragmentor a script'smain. A test whose boundary the tool
supplied is now marked synthetic, and RG08 skips it.--fragmentis the
operator saying the file is a test body, so that boundary is theirs and RG08
still fires there; a.rs/.ts/.jsfile given explicitly without the flag
is still read as a fragment, but RG08 does not judge it. Covered by
a_top_level_script_with_no_test_is_not_flagged_for_asserting_nothingand
an_auto_detected_fragment_is_not_flagged_for_asserting_nothingin
tests/typescript.rs. - A policy file inside the repository is refused regardless of path
casing on Windows.--declarationand--configmust live outside the
tree under review, but the containment check compared paths
case-sensitively.git rev-parse --show-toplevelreports the on-disk
casing while the process's current directory can be spelled differently, so
entering the checkout with a different case (for exampledesktopfor
Desktop) let arealism.yamlinside the repository be applied. The check
now compares case-insensitively on Windows. Covered by
policy_path_testsinsrc/cli.rs. - RG09 no longer calls a snapshot taken before the attack a tautology.
The 1.5.4 change "a local assigned the same expression is compared as that
expression" substituted a local's initializer without checking whether state
could change in between.let before = svm.get_account(&market).unwrap(); send(..); assert_eq!(svm.get_account(&market).unwrap(), before)was reported
as "both sides aresvm.get_account(&market).unwrap()", although the
transaction may have changed the account and the assertion can fail. A local
is now substituted only when its initializer is a compile-time constant, or
when no state-changing op lies between the binding and the assertion. The
snapshot shape accounted for 669 of the 693 RG09 findings on the pinned
Solana corpus, all 669 in one source; RG09 is now silent on it. A constant
local such aslet a = 1; assert_eq!(a, 1)is still reported. Covered by
tests/rg09_state_change.rs, the RG09 snapshot fixtures in Rust, TypeScript
and Solidity, and a property test that inserts a state-changing call between
the binding and the assertion. - RG02 now sees a privileged prank inside a function of a contract the PoC
defines in its own file.op.act()whereactdoes
vm.prank(owner); vault.setFee(0)used to stop at the external call, so only
RG08 fired. RG02 now reads that function's body (and same-contract calls it
makes) for a sender switch to a privileged address, and reports it at the
prank's own line. Only contracts defined in the test's own file are read; an
imported dependency's body is never followed. RG02 is the only rule that
changes: the test's other findings do not move. Covered by
privileged_address_aliased_through_a_helper_contractin
tests/adversarial.rs(previously#[ignore]d). The golden manifest is
byte-identical, and the corpus counts are unchanged (no committed fixture,
DeFiHackLabs file or DeFiVulnLabs file has this shape). - A privileged prank reached through
abi.encode/abi.decodeis reported as
RG02.address who = abi.decode(abi.encode(admin), (address)); vm.prank(who)
was not treated as a prank to the privilegedadmin: the identity pass
followed a plain alias to another variable but not the ABI wrapper around the
same value, so only RG08 fired.rg-model's alias follow now peels
abi.encode(x),abi.encodePacked(x)andabi.decode(x, (T))down to the
value they carry; a call that combines several values is left alone. Covered
byprivileged_address_round_tripped_through_abi_encode_decodein
tests/adversarial.rs(previously#[ignore]d) and a unit test in
rg-model. The golden manifest is byte-identical: no committed fixture uses
the shape. rg-modelchanged and is re-published at the next release.rg-irgains
Function::syntheticandOp::decl,rg-frontend-tssets the synthetic
boundary on a script, andrg-rulesreads both; all four move to 1.5.7
(rg-irandrg-frontend-tsto 1.5.1,rg-rulesto 1.5.6).
rg-rendermoves with the tool version.
Changed
syn3.0.10 (from 2.0.119) parses Rust tests. syn 3 removes
Arm::guardand carries a match guard asPat::Guardon the arm's
pattern;rg-frontend-rustnow reads it from there, so guards are lowered
as before. No output change: every golden case is byte-identical. syn 3.0.10
declares rust-version 1.71, so the MSRV stays 1.95. Supersedes Dependabot
PR #56, which did not compile.rg-frontend-rustchanged, so it is re-published at the next release
(its own version is still 1.5.0).
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.7 x86_64-unknown-linux-musl