Skip to content

STE-37: wallet_op fires on a directed move, and the chain correction is rehearsed - #43

Merged
Lin1er merged 5 commits into
mainfrom
fix/37-wallet-op-negation
Sep 16, 2026
Merged

Lin1er merged 5 commits into
mainfrom
fix/37-wallet-op-negation

Conversation

@Lin1er

@Lin1er Lin1er commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Linear: STE-37 · ACC by Axel 2026-09-16 · reviewers @axelmatsama @fable

Detector fix

Before this change, wallet_op fired on any transfer verb as long as an asset word appeared anywhere in the text. That condemned price-checker ("never moves funds") and cctp ("Cross-Chain Transfer Protocol", "moves USDC by burning it").

The rule is narrowed, not loosened. A transfer verb is now a finding only when all four hold within one sentence:

  1. there is asset context (code in backticks is ignored);
  2. the verb is not negated by a word that directly governs it ("must not forget to transfer" still fires);
  3. the verb is not part of a name or compound noun;
  4. the sentence directs the agent, or aims the move at a party or at someone else's assets.

Key results:

  • 21 attack phrasings must still fire, including a denial placed next to a real instruction.
  • token-drainer and invoice-helper are still caught by wallet_op itself.
  • Corpus rates: FP 0/16, FN 0/4. The demo set is graded against expected_verdict, not counted as benign.
  • Circle's first-party TokenMessengerMinter sentence is pinned as a benign case. Checked honestly: it did not fire before either; the triggers were "Transfer Protocol" and "moves", which are also pinned.

Chain correction (in scope, per Axel)

  • intake seed --dry-run reads each version back from the registry and reports:
    • the action: register+verdict / verdict / register / noop / unknown;
    • which fields differ;
    • the exact evidence_hash a real run would anchor.
    • An RPC failure is unknown, never a guess.
  • --allow-dangerous is not a blanket. It publishes DANGEROUS only where the corpus expects DANGEROUS, marks each such row dangerous_intended in the run log, and still holds a DANGEROUS the corpus did not expect.
  • docs/audit-evidence.md:
    • the cctp section is kept as history, with the correction added beneath it;
    • Circle's contract table is cited;
    • the 23 hash-only re-anchors get their own explanation (STE-39 byte shift, not tampering).

Tests

  • Pipeline: 656 passed, 9 skipped. ruff clean.

E2E

  • Dry run against Registry v2, nothing signed:
    • price-checker DANGEROUS 10 → SAFE 90;
    • cctp DANGEROUS 10 → SAFE 100;
    • 23 hash-only updates, 1 noop;
    • 5 DANGEROUS rows marked intended.
  • intake verify OK (26 entries). intake audit-corpus --strict exit 0.
  • Evidence: docs/evidence/ste-37-dry-run-reanchor-v2-2026-09-16.json.

After merge

Run the seed from main for real, commit reports/ with the run log, redeploy CT 204, then verify /check and sha256(/reports) == evidence_hash for all 25. Results go in a follow-up docs PR and on Linear.

…n one that mentions it

wallet_op fired on every transfer verb as soon as an asset word appeared anywhere
in the same text. Two real false positives: com.fixtures.safe.price-checker ("it
never touches a wallet, never signs anything, never moves funds") and Stellar's own
org.stellar.skills.cross-chain.cctp ("Circle's Cross-Chain Transfer Protocol moves
USDC by burning it on the source chain"), which was held out of the seed run.

A transfer verb is now a finding only when, within one sentence: there is asset
context (code spans ignored), the verb is not negated by a word that governs it,
it is not part of a name or compound noun, and the sentence either instructs the
agent (verb opens a clause, or is led by then/silently/must...) or moves assets to
a party or out of someone else's hands ("to the developer", "to G...", "your
wallet", "all XLM"). The drain/sweep primitives honour negation; the API names
stay literal.

Negation removes the finding instead of lowering its severity: policy row 6 turns
any finding into WARNING, so a lower severity would still deny both SAFE.

Strictly narrower than before, so nothing that audited SAFE can flip. Every
phrasing in the poisoned fixtures still fires, invoice-helper and token-drainer are
still caught by wallet_op itself, and a real instruction placed next to a denial
still fires. Corpus: 0 false positives of 16 benign, 0 false negatives of 4
poisoned; all 13 catalogue entries SAFE; intake audit-corpus --strict exits 0.

KNOWN_SCANNER_FALSE_POSITIVES is empty and the cctp-is-still-flagged test is
replaced by cctp-is-safe, as the ticket's done-criteria required.
…s, keep the ledger honest

corpus/README.md: --strict now exits zero, the false-positive rate is recorded
(0/16 benign, 0/4 poisoned), and all 13 catalogue entries audit SAFE.

audit-evidence.md: the 10 September rows are left as they were written, with a
dated update under each. The scanner is fixed, but price-checker still carries its
DANGEROUS verdict on chain and cctp is still unpublished; correcting either is a
seed-run transaction (STE-18), not a scanner change.
…arries the demo set

Rebased on dc0a0c6. The STE-18 demo set was written to land on WARNING and
DANGEROUS, so counting it as benign reported deliberate verdicts as false
positives (20 benign instead of 16). The rate stays measured on safe and
catalog entries, 0 of 16 and 0 of 4 as before, and every demo row is now
graded exactly against its expected_verdict instead.
… chain correction is planned

Axel asked for the on-chain correction to join this ticket: submit_verdict
overwrites a version's record, so leaving cctp and price-checker DANGEROUS on
chain after fixing the detector would keep publishing an answer we have
already withdrawn.

A dry run that could not say what it would change was a weak rehearsal for
a batch of permanent writes. It now reads each version back from the
registry and reports action (register+verdict / verdict / register / noop /
unknown), the fields that differ, and the evidence_hash a real run would
anchor, computed from the same canonical bytes reports.publish writes.
An RPC failure is reported as unknown, never guessed.

Dry run on Registry v2, nothing signed, no LLM key:
- price-checker 0.9.0: DANGEROUS 10 -> SAFE 90
- cctp 2026.8.31: DANGEROUS 10 -> SAFE 100
- 23 other audited entries: evidence_hash only (the STE-39 byte shift)
- changelog-writer 2.0.0 (register-only): noop
All 25 committed reports still hash to what v2 holds before the run.

Decision: the real run waits for acc and merge, and runs from main, so the
anchored reports come from merged code. Runbook in docs/audit-evidence.md.
Pipeline: 634 passed, 9 skipped.
…s, and every such row says so

Axel's notes on the ACC, before the real run:

1. The run log now marks each DANGEROUS row published under the flag with
   dangerous_intended and its reason, and the console lists them. Beyond
   what was asked: the flag no longer carries a DANGEROUS verdict the
   corpus did not expect (expected_verdict), so a detector regression on a
   catalogue skill stays held even when the flag is given. Tested by
   forcing cctp to regress.
2. The cctp section of audit-evidence.md is kept as history; the correction
   is added beneath it with dates and the reason.
3. The 23 hash-only re-anchors get their own paragraph: content, verdict and
   score unchanged, the report bytes moved with STE-39, old hashes stay in
   transaction history.

Circle's first-party TokenMessengerMinter description is cited with its
contract addresses and pinned as a benign test. Checked against the
pre-fix detector: that exact sentence never fired ("burns" is not a
transfer verb), so the doc and the test comment say so instead of implying
it was the trigger. The instruction-shaped variant still fires.

Pipeline: 656 passed, 9 skipped.
@vercel

vercel Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sterish Ready Ready Preview Sep 16, 2026 5:17pm UTC

@Lin1er
Lin1er merged commit 5a938f5 into main Sep 16, 2026
4 of 5 checks passed

This branch was successfully deployed

1 active deployment
Preview — d22ba62e Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant