agentsclimarketplace

Code verifier

Skill jajupmochi/agent-harness/skills/general/code-verifier

Use BEFORE claiming any code/test/script runs successfully. Detects FAKE-RUN patterns (hardcoded results, assert True, mocks-only tests, swallowed exceptions, fabricated numbers, dead-code short-circuits). Apply automatically whenever about to claim "test passes", "code works", "results show X", "training converges", or commit/push. Complements superpowers:verification-before-completion (which enforces real-run discipline) by auditing whether the run itself is genuine.From its SKILL.md

Install
npx -y skills add jajupmochi/agent-harness --skill code-verifier

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 8 commands, including `grep -rE "assert\s+(True|1\s*==\s*1)" tests/ src/ 2>/dev/null` and 7 more.

SKILL.md

8.4 KB, ~2.3k tokens by cl100k_base, as published. Nobody here has run it

/code-verifier

Audit the GENUINENESS of evidence — not just that a command ran.

Master TOC

Core principle

"Ran a command" ≠ "verified the work." A test that always passes (because it asserts True) proves nothing. A script that prints mAP = 0.85 from a hardcoded literal proves nothing. A pipeline that swallows exceptions silently and returns a default proves nothing.

This skill audits the GENUINENESS of evidence — not just that a command ran.

The Three-Layer Gate

Before any completion claim involving code / tests / results, run all three layers in order:

  1. Layer 1 — Did it really run? Defer to superpowers:verification-before-completion. Run the exact command in this turn; read full output; check exit code. Skip if already cleared in this turn.
  2. Layer 2 — Is the run genuine? Audit the artifact for the FAKE-RUN patterns below. If any match, the run is NOT genuine and the claim is unsupported until you fix and re-run.
  3. Layer 3 — Does the run exercise the claim? Even a real run can fail to exercise the claim — e.g. test imports the wrong module, runs with pytest -k other. Check that the artifact's scope matches the claim.

Fake-Run Patterns

A. Tests that pass without testing

PatternWhat it looks likeWhy fake
assert True / assert 1 == 1TautologicalPasses regardless of code
Tests with no assert/expect at allJust function bodyPasses if no exception, not if behavior correct
try: ... except: pass then assert succeedsHides real failuresReal exceptions go silent
Mocking the function under testmock.patch('module.fn_under_test')Tests the mock, not the function
Skipped tests counted as passingpytest.skip() everywhere0 failures but 0 verifications
Hardcoded fixture matching hardcoded outputFixture pre-stores expected, fn returns sameNo real computation

Detection commands:

# Tautological asserts
grep -rE "assert\s+(True|1\s*==\s*1)" tests/ src/ 2>/dev/null

# Tests with zero assertions
grep -rL "assert\|expect\|self\.assert" tests/ 2>/dev/null

# Bare-except in tests
grep -rE "except\s*:\s*pass|except\s+Exception:\s*pass" tests/ 2>/dev/null

# Skipped tests
grep -rE "@pytest\.mark\.skip|pytest\.skip\(\)" tests/ 2>/dev/null

# Mocking the SUT
grep -rE "mock\.patch.*$(basename module_under_test)" tests/ 2>/dev/null

B. Scripts that fabricate results

PatternWhy fake
Hardcoded numeric output (print(f"mAP = {0.85:.2f}"))Literal, not computed
Default fallback (result = compute() or 0.85)Falls back to plausible number
Random numbers as results (result = np.random.uniform(0.7, 0.9))No deterministic computation
Old cached values read without re-runCould be stale
if DEBUG: result = 0.85 enabledDebug path active in prod

Detection commands:

# Suspicious literal numbers near metric prints
grep -rE "(mAP|acc|score|loss|recall|precision)\s*[=:]\s*[0-9.]" outputs/ scripts/ 2>/dev/null | grep -vE "for|while|range|len|shape|return"

# Or-fallback to numeric literals
grep -rE "= [^#]*\(\)\s*or\s+[0-9.]+" src/ scripts/ 2>/dev/null

# np.random in eval scripts (excluding seeded)
grep -rE "np\.random|torch\.rand|random\." scripts/ 2>/dev/null | grep -viE "seed|generator"

C. Pipelines that short-circuit

PatternWhy fake
Early return with stub (return {"ok": True} # TODO)No real work
Swallowed exceptions (except: return default)Failures invisible
# noqa / # pragma: no cover over real logicHides skipped paths
time.sleep + returnLooks like work
if False: / if 0: blocks around real codeReal path never runs

Detection commands:

# TODO/stub patterns near returns
grep -rEB1 "return.*#.*TODO|return.*#.*FIXME|return.*#.*placeholder" src/ scripts/ 2>/dev/null

# Swallowed exceptions
grep -rE "except.*:\s*(pass|return\s+(None|default|\{\}|0))" src/ scripts/ 2>/dev/null

# Disabled blocks
grep -rE "if\s+(False|0):" src/ scripts/ 2>/dev/null

# time.sleep outside tests
grep -rE "time\.sleep" src/ scripts/ --exclude-dir=tests 2>/dev/null

D. ML-research specific

PatternWhy fake
Training loss not actually backpropping (opt.zero_grad(); opt.step() without .backward())Weights unchanged
Eval on training set claimed as test (eval(train_loader) while paper says test set)Inflated numbers
Cherry-picked seed (best of N undisclosed)Selection bias
Selected metric only (skip lower-scoring metrics)Cherry-picking
Validation == test pool overlapLeakage
Forward-only run on "test" (doesn't include all batches)Partial eval
Plot data manually drawn (data = [12, 14, 16, 18] hardcoded)Not from real run

Detection commands:

# Training loop without backward
grep -rEB3 "opt(imizer)?\.step\(\)" src/ scripts/ --include='*.py' | grep -A3 "\.step" | grep -L "\.backward" 2>/dev/null

# Eval on train loader
grep -rE "eval\(.*train_loader|test_metric.*train_data" src/ scripts/ --include='*.py' 2>/dev/null

# Cherry-picked seeds — max() over seed reports
grep -rE "best_(of|seed)|max\(.*seeds" src/ scripts/ --include='*.py' 2>/dev/null

# Hardcoded plot data near plt calls
grep -rB3 -A1 "plt\.(plot|bar|scatter)" scripts/ --include='*.py' 2>/dev/null | grep -E "= \[[0-9.,\s]+\]"

# Val/test split overlap
python3 -c "
import json
for p in ['data/splits.json', 'data_split.json']:
    try:
        d = json.load(open(p))
        v = set(d.get('val', d.get('validation', [])))
        t = set(d.get('test', []))
        print(f'{p}: val∩test = {len(v & t)} of {len(v)} val, {len(t)} test')
    except: pass
"

When to invoke

SituationAction
About to say "tests pass"Run all three layers
About to commit/pushRun Layer 2 on changed files
About to write a paper numberRun Layer 2.B + 2.D on the producing script
Inheriting test suite from elsewhereRun Layer 2.A audit before trusting it
Reviewing a PRRun Layer 2 on the diff
Hyperparameter search resultsRun Layer 2.D on the seed / selection logic

Output format when fake pattern found

[FAKE-RUN DETECTED]

Pattern: <category>.<subcategory>
File: path/to/file.py:line
Evidence:
  <exact line(s) showing the pattern>

Why this is fake:
  <one sentence explanation>

Required fix:
  <concrete change>

Re-run command after fix:
  <exact command>

Re-running NOT optional — the previous claim of <X> is NOT supported.

Anti-rationalisation

ExcuseReality
"It's a stub, will fix later"Stub = fake-run for THIS run
"Just for demo purposes"Demos still claim things
"Tests can be added later"Then don't claim "tested"
"The mock is realistic"Mock = tests the mock
"We trust the cache"Re-compute or document staleness
"Random noise is small"Then derive deterministically
"Just to show the pipeline works"Then say "pipeline runs", not "results show X"

Companion

  • superpowers:verification-before-completion — Layer 1 (real-run discipline)
  • research-critic — audits inferential chain ON TOP of authentic artifacts
  • always-on-verification rule (in this lib) — when to invoke

Provenance

Originally authored as a user-level always-on gate; consolidated into agent-harness for cross-project reuse. Pairs with research-critic for full claim-defensibility coverage.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most test skills give in ~2.3k tokens

Counted across 1,201 of the 2,096 authors here whose files we hold, read 2026-09-06

  • Write a failing test before writing codein 43 of 1201, across 36 files
  • Run the full test suitein 36 of 1201, across 35 files
  • Test only one variable per experimentin 34 of 1201, across 17 files
  • Read product marketing context before asking questionsin 34 of 1201, across 14 files
  • Mock external dependenciesin 34 of 1201, across 30 files
  • Define primary, secondary, and guardrail metricsin 33 of 1201, across 16 files
  • Pre-determine sample size before startingin 31 of 1201, across 14 files
  • Test behavior rather than implementationin 31 of 1201, across 29 files
  • Formulate a hypothesis before designing a testin 30 of 1201, across 13 files
  • Document every test hypothesis, variant, and resultin 29 of 1201, across 11 files
  • Use descriptive test function namesin 25 of 1201, across 21 files
  • Commit to the methodology without stopping earlyin 24 of 1201, across 8 files

Said here and by no other author read

  • run all three layers before claiming code or tests work
  • audit the artifact for fake-run patterns
  • check that the artifact scope matches the claim
  • fix and re-run if a fake pattern is found
  • report fake runs using the specified output format
  • reject claims supported only by fake-run patterns

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.