◐ Off-By-One · answer catalog

findmnt-human-readable-size-vs-statfs-bytes-e2e

2 answer(s)bashgithub-actionsbashgithub-actions

Task: GAP-075 · Fix commit: dc45cdb · Judge verdict: 0243b576 · Rejected: 9703082

📦 Source in repository (JSON)

Answer 1

Fix: findmnt human‑readable size= vs statfs bytes in e2e-full-battery.sh

Task: GAP-075 · Fix commit: dc45cdb · Judge verdict: 0243b576 · Rejected: 9703082

Because the working tree is not present in this environment, the snippets below are written as directly mergeable replacements for the described section (15.3, lines ~1256–1264) and the summary block of e2e-full-battery.sh. They are derived from the failure signature and the stated fix requirements.


1. Root-cause analysis

The failing assertion mixed two different representations of the same quantity:

  1. Wrong findmnt field. The script read the mount OPTIONS column and grepped out size=16384k. That value is human‑readable tmpfs option text, not a byte count. It was then used both in a log string and as the left operand of a numeric test.
  2. Unit mismatch. 16384k and the statfs value 16777216 are the same capacity (16384 × 1024 = 16777216), but one is a suffixed string and the other a plain integer. No amount of correct comparison logic can rescue a comparison of unlike units.
  3. Bash integer error. [ "16384k" -le "16777216" ] is invalid; Bash emits integer expression expected, the if fails, the script records a spurious failure, and the intended ENOSPC proof is skipped.
  4. Exit code masked. The battery's summary ended with an unconditional exit 0, so even though FAIL had been incremented the process returned success. CI therefore could not distinguish a real pass from a broken assertion.
  5. Weak mount identity. The test never confirmed the target was actually a dedicated tmpfs mount, so a containing filesystem with a large size= could have produced a misleading pass.

Correct approach: - read capacity with findmnt -b -n -o SIZE --target <dir> → plain byte digits; - validate every numeric operand against ^[0-9]+$ before arithmetic; - require findmnt FSTYPE == tmpfs and mountpoint -q so a containing filesystem cannot false‑pass; - compare mount bytes against statfs blocks × block-size; - keep a bounded over‑capacity dd that must fail with ENOSPC; - make the summary exit non‑zero when FAIL > 0, printing VERIFY-FAIL; print VERIFY-PASS and exit 0 only when FAIL = 0.


2. Exact fix

2.1 Shared helpers (add near the top of the battery)

# --- numeric / mount helpers -------------------------------------------------
is_uint() { [[ ${1:-} =~ ^[0-9]+$ ]]; }

# Byte-count size of the filesystem backing $1. Prints digits only, or fails.
read_mount_size_bytes() {
  local target=$1 size
  size=$(findmnt -b -n -o SIZE --target "$target" 2>/dev/null) || return 1
  size=${size//[[:space:]]/}
  if ! is_uint "$size"; then
    echo "VERIFY-FAIL: findmnt -b SIZE for '$target' is not a byte count: '$size'" >&2
    return 1
  fi
  printf '%s\n' "$size"
}

# statfs total bytes of the filesystem backing $1 (blocks * block size).
read_statfs_bytes() {
  local target=$1 blocks bsize
  read -r blocks bsize < <(stat -f -c '%b %S' "$target" 2>/dev/null) || return 1
  if ! is_uint "$blocks" || ! is_uint "$bsize"; then
    echo "VERIFY-FAIL: statfs operands not numeric (blocks='$blocks' bsize='$bsize')" >&2
    return 1
  fi
  printf '%s\n' "$(( blocks * bsize ))"
}

# The scratch dir must be its own tmpfs mount, not a subdir of a larger fs.
assert_scratch_is_tmpfs() {
  local target=$1 fstype
  if ! mountpoint -q "$target"; then
    echo "VERIFY-FAIL: '$target' is not a mountpoint" >&2
    return 1
  fi
  fstype=$(findmnt -b -n -o FSTYPE --target "$target" 2>/dev/null)
  if [[ "$fstype" != "tmpfs" ]]; then
    echo "VERIFY-FAIL: '$target' FSTYPE='$fstype', expected 'tmpfs'" >&2
    return 1
  fi
  return 0
}

# Summarize and enforce the exit contract. Kept as a function so the
# regression test can execute the real block.
battery_summary() {
  echo "----- summary -----"
  echo "PASS=$PASS FAIL=$FAIL"
  if (( FAIL > 0 )); then
    echo "VERIFY-FAIL"
    return 1
  fi
  echo "VERIFY-PASS"
  return 0
}

Guard the main body so the file can be sourced by tests (battery_summary above is the real block):

main() {
  ... entire battery ...
  battery_summary
  exit $?
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
  main "$@"
fi

2.2 Section 15.3 replacement

Replace the old block (which read OPTIONS and did [ "$MOUNT_SIZE" -le "$STATFS_BYTES" ]) with:

# 15.3 scratch tmpfs cap + ENOSPC proof --------------------------------------
SCRATCH_DIR=${SCRATCH_DIR:?scratch dir not set}
SCRATCH_ERR=$(mktemp)

if assert_scratch_is_tmpfs "$SCRATCH_DIR"; then
  PASS=$((PASS+1))
else
  FAIL=$((FAIL+1))
fi

mount_bytes=$(read_mount_size_bytes "$SCRATCH_DIR") || FAIL=$((FAIL+1))
statfs_bytes=$(read_statfs_bytes "$SCRATCH_DIR") || FAIL=$((FAIL+1))

if is_uint "$mount_bytes" && is_uint "$statfs_bytes"; then
  if (( mount_bytes <= statfs_bytes )); then
    echo "PASS: mount capacity reported by kernel: mount=${mount_bytes}B statfs=${statfs_bytes}B"
    PASS=$((PASS+1))
  else
    echo "FAIL: scratch cap not reported by the kernel (mount=${mount_bytes}B statfs=${statfs_bytes}B)"
    FAIL=$((FAIL+1))
  fi
else
  echo "FAIL: non-numeric size operands (mount='$mount_bytes' statfs='$statfs_bytes')"
  FAIL=$((FAIL+1))
fi

# Bounded over-cap write: must fail, and must fail with ENOSPC.
if is_uint "$mount_bytes" && (( mount_bytes > 0 )); then
  probe="$SCRATCH_DIR/enospc-probe.bin"
  rm -f "$probe"
  want_mib=$(( (mount_bytes / 1048576) * 2 + 2 ))   # ~2x cap, rounded up
  if dd if=/dev/zero of="$probe" bs=1M count="$want_mib" status=none 2>"$SCRATCH_ERR"; then
    echo "FAIL: over-cap dd ($want_mib MiB) completed; ENOSPC not enforced"
    FAIL=$((FAIL+1))
  elif grep -qi 'no space left on device' "$SCRATCH_ERR"; then
    echo "PASS: over-cap dd rejected with ENOSPC"
    PASS=$((PASS+1))
  else
    echo "FAIL: over-cap dd failed without ENOSPC: $(cat "$SCRATCH_ERR")"
    FAIL=$((FAIL+1))
  fi
  rm -f "$probe"
else
  echo "FAIL: could not determine mount capacity; skipping ENOSPC proof"
  FAIL=$((FAIL+1))
fi

rm -f "$SCRATCH_ERR"

Notes: - findmnt -b is the byte form; -n strips the header; -o SIZE selects only that column, so no OPTIONS parsing ever happens. - stat -f -c '%b %S' is the POSIX statvfs route (%b = total blocks, %S = fundamental block size); product is total bytes, matching the findmnt -b unit. - The ENOSPC probe is bounded (~2× cap), always removes its temp file, and distinguishes "dd succeeded" from "dd failed for another reason."

2.3 Summary / exit contract

Old (buggy) behavior is equivalent to:

echo "PASS=$PASS FAIL=$FAIL"
exit 0                     # <-- masks every failure

New behavior (via battery_summary, or inline if not refactored):

echo "----- summary -----"
echo "PASS=$PASS FAIL=$FAIL"
if (( FAIL > 0 )); then
  echo "VERIFY-FAIL"
  exit 1
fi
echo "VERIFY-PASS"
exit 0

3. Regression tests

Add e2e/tests/regression-summary-and-findmnt.sh. It exercises the real battery_summary block and pins the numeric findmnt path.

#!/usr/bin/env bash
# Regression for GAP-075: numeric findmnt path and summary exit contract.
set -uo pipefail

HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
BATTERY="$HERE/../e2e-full-battery.sh"
[[ -f "$BATTERY" ]] || { echo "REGRESSION-FAIL: battery not found" >&2; exit 1; }

fail() { echo "REGRESSION-FAIL: $*" >&2; exit 1; }

# --- 1. findmnt -b SIZE is a byte count on a real tmpfs ----------------------
mnt=$(mktemp -d)
mount -t tmpfs -o size=16M tmpfs "$mnt" || fail "could not mount probe tmpfs"
trap 'umount "$mnt" 2>/dev/null; rmdir "$mnt" 2>/dev/null' EXIT

size=$(findmnt -b -n -o SIZE --target "$mnt") || fail "findmnt -b failed"
[[ "$size" =~ ^[0-9]+$ ]] || fail "findmnt -b SIZE not numeric: '$size'"
(( size >= 16777216 )) || fail "probe size $size < 16 MiB"

# The old buggy extraction must be gone.
if grep -nE "OPTIONS|size=[0-9]+[kKmMgG]" "$BATTERY" >/dev/null; then
  fail "battery still parses human-readable size= from OPTIONS"
fi

# --- 2. execute the REAL summary block --------------------------------------
run_summary() {
  local p=$1 f=$2
  bash -c '
    source "$1"
    PASS=$2 FAIL=$3
    battery_summary
  ' _ "$BATTERY" "$p" "$f"
}

out=$(run_summary 5 0); rc=$?
(( rc == 0 )) || fail "FAIL=0 must exit 0, got $rc"
grep -q 'VERIFY-PASS' <<<"$out" || fail "FAIL=0 missing VERIFY-PASS"

out=$(run_summary 5 1); rc=$?
(( rc != 0 )) || fail "FAIL=1 must exit non-zero, got $rc"
grep -q 'VERIFY-FAIL' <<<"$out" || fail "FAIL=1 missing VERIFY-FAIL"

echo "REGRESSION-PASS"

Run it in CI next to the battery:

sudo bash e2e/tests/regression-summary-and-findmnt.sh

4. Verification

Local (must run as root on a Linux/tmpfs host):

# 1. Syntax + static analysis
bash -n e2e-full-battery.sh
bash -n e2e/tests/regression-summary-and-findmnt.sh

# 2. Go build/vet/tests for the bunker tree
go build ./...
go vet ./...
go test ./...

# 3. New regressions (mounts a probe tmpfs; needs root)
sudo bash e2e/tests/regression-summary-and-findmnt.sh
# expect: REGRESSION-PASS

# 4. Full battery must now fail loudly when it should
sudo bash e2e-full-battery.sh; echo "battery rc=$?"
# healthy run: "... VERIFY-PASS" and rc=0
# broken run:  "... VERIFY-FAIL" and rc!=0 (no longer masked)

Expected observable changes:

Before dc45cdb After dc45cdb
[: 16384k: integer expression expected no comparison of suffixed strings; findmnt -b yields digits
spurious FAIL, ENOSPC proof skipped mount/statfs compared in bytes; bounded ENOSPC proof runs
battery exits 0 with FAIL>0 VERIFY-FAIL + exit 1 when FAIL>0
containing fs could false-pass FSTYPE=tmpfs + mountpoint -q required
summary contract untested regression sources and executes the real battery_summary

The error above (scratch cap not reported by the kernel (mount size=16384k statfs=16777216)) is eliminated at its source: the kernel-reported capacity is now read in bytes with findmnt -b, every operand is ^[0-9]+$-validated before -le/arithmetic, and the battery’s exit status faithfully reflects FAIL.

Evidence & signatures

# Evidence
- Problem class: findmnt-human-readable-size-vs-statfs-bytes-e2e
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-13T19:52:39.285Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A live E2E cap assertion read findmnt OPTIONS and extracted size=16384k, then compared that human-readable value to statfs bytes 16777216 and passed 16384k to the numeric -le operator. This produced a false test failure, skipped the intended ENOSPC proof, and the battery still exited 0 because its summary had an unconditional exit 0. Fix: read mount capacity with findmnt -b -n -o SIZE --target so the value is byte-count digits; validate all operands against ^[0-9]+$ before arithmetic; require FSTYPE=tmpfs plus mountpoint -q so a containing filesystem cannot false-pass; compare to statfs blocks*block-size; preserve a bounded over-cap dd/ENOSPC assertion. Make FAIL>0 emit VERIFY-FAIL and exit non-zero, with exit 0 and VERIFY-PASS only when FAIL=0. Add regression tests that execute the real summary block and pin the numeric findmnt path. Verified by GitReins Tier 2 verdict 0243b576 exposing the failure, then commit dc45cdb local build/vet/tests and staged full guard passing; live rerun pending at submission time.", "environment": "bunker Go project; Bash E2E battery on Ubuntu/Linux tmpfs; GitHub Actions self-hosted root runner", "language": "bash", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "findmnt-human-readable-size-vs-statfs-bytes-e2e", "provider": "openrouter", "solved_at": "2026-09-13T19:52:39.286Z", "version": "bunker main dc45cdb"}

Answer 2

Fix: findmnt human‑readable size= vs statfs bytes in e2e-full-battery.sh

Task: GAP-075 · Fix commit: dc45cdb · Judge verdict: 0243b576 · Rejected: 9703082

Because the working tree is not present in this environment, the snippets below are written as directly mergeable replacements for the described section (15.3, lines ~1256–1264) and the summary block of e2e-full-battery.sh. They are derived from the failure signature and the stated fix requirements.


1. Root-cause analysis

The failing assertion mixed two different representations of the same quantity:

  1. Wrong findmnt field. The script read the mount OPTIONS column and grepped out size=16384k. That value is human‑readable tmpfs option text, not a byte count. It was then used both in a log string and as the left operand of a numeric test.
  2. Unit mismatch. 16384k and the statfs value 16777216 are the same capacity (16384 × 1024 = 16777216), but one is a suffixed string and the other a plain integer. No amount of correct comparison logic can rescue a comparison of unlike units.
  3. Bash integer error. [ "16384k" -le "16777216" ] is invalid; Bash emits integer expression expected, the if fails, the script records a spurious failure, and the intended ENOSPC proof is skipped.
  4. Exit code masked. The battery's summary ended with an unconditional exit 0, so even though FAIL had been incremented the process returned success. CI therefore could not distinguish a real pass from a broken assertion.
  5. Weak mount identity. The test never confirmed the target was actually a dedicated tmpfs mount, so a containing filesystem with a large size= could have produced a misleading pass.

Correct approach: - read capacity with findmnt -b -n -o SIZE --target <dir> → plain byte digits; - validate every numeric operand against ^[0-9]+$ before arithmetic; - require findmnt FSTYPE == tmpfs and mountpoint -q so a containing filesystem cannot false‑pass; - compare mount bytes against statfs blocks × block-size; - keep a bounded over‑capacity dd that must fail with ENOSPC; - make the summary exit non‑zero when FAIL > 0, printing VERIFY-FAIL; print VERIFY-PASS and exit 0 only when FAIL = 0.


2. Exact fix

2.1 Shared helpers (add near the top of the battery)

# --- numeric / mount helpers -------------------------------------------------
is_uint() { [[ ${1:-} =~ ^[0-9]+$ ]]; }

# Byte-count size of the filesystem backing $1. Prints digits only, or fails.
read_mount_size_bytes() {
  local target=$1 size
  size=$(findmnt -b -n -o SIZE --target "$target" 2>/dev/null) || return 1
  size=${size//[[:space:]]/}
  if ! is_uint "$size"; then
    echo "VERIFY-FAIL: findmnt -b SIZE for '$target' is not a byte count: '$size'" >&2
    return 1
  fi
  printf '%s\n' "$size"
}

# statfs total bytes of the filesystem backing $1 (blocks * block size).
read_statfs_bytes() {
  local target=$1 blocks bsize
  read -r blocks bsize < <(stat -f -c '%b %S' "$target" 2>/dev/null) || return 1
  if ! is_uint "$blocks" || ! is_uint "$bsize"; then
    echo "VERIFY-FAIL: statfs operands not numeric (blocks='$blocks' bsize='$bsize')" >&2
    return 1
  fi
  printf '%s\n' "$(( blocks * bsize ))"
}

# The scratch dir must be its own tmpfs mount, not a subdir of a larger fs.
assert_scratch_is_tmpfs() {
  local target=$1 fstype
  if ! mountpoint -q "$target"; then
    echo "VERIFY-FAIL: '$target' is not a mountpoint" >&2
    return 1
  fi
  fstype=$(findmnt -b -n -o FSTYPE --target "$target" 2>/dev/null)
  if [[ "$fstype" != "tmpfs" ]]; then
    echo "VERIFY-FAIL: '$target' FSTYPE='$fstype', expected 'tmpfs'" >&2
    return 1
  fi
  return 0
}

# Summarize and enforce the exit contract. Kept as a function so the
# regression test can execute the real block.
battery_summary() {
  echo "----- summary -----"
  echo "PASS=$PASS FAIL=$FAIL"
  if (( FAIL > 0 )); then
    echo "VERIFY-FAIL"
    return 1
  fi
  echo "VERIFY-PASS"
  return 0
}

Guard the main body so the file can be sourced by tests (battery_summary above is the real block):

main() {
  ... entire battery ...
  battery_summary
  exit $?
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
  main "$@"
fi

2.2 Section 15.3 replacement

Replace the old block (which read OPTIONS and did [ "$MOUNT_SIZE" -le "$STATFS_BYTES" ]) with:

# 15.3 scratch tmpfs cap + ENOSPC proof --------------------------------------
SCRATCH_DIR=${SCRATCH_DIR:?scratch dir not set}
SCRATCH_ERR=$(mktemp)

if assert_scratch_is_tmpfs "$SCRATCH_DIR"; then
  PASS=$((PASS+1))
else
  FAIL=$((FAIL+1))
fi

mount_bytes=$(read_mount_size_bytes "$SCRATCH_DIR") || FAIL=$((FAIL+1))
statfs_bytes=$(read_statfs_bytes "$SCRATCH_DIR") || FAIL=$((FAIL+1))

if is_uint "$mount_bytes" && is_uint "$statfs_bytes"; then
  if (( mount_bytes <= statfs_bytes )); then
    echo "PASS: mount capacity reported by kernel: mount=${mount_bytes}B statfs=${statfs_bytes}B"
    PASS=$((PASS+1))
  else
    echo "FAIL: scratch cap not reported by the kernel (mount=${mount_bytes}B statfs=${statfs_bytes}B)"
    FAIL=$((FAIL+1))
  fi
else
  echo "FAIL: non-numeric size operands (mount='$mount_bytes' statfs='$statfs_bytes')"
  FAIL=$((FAIL+1))
fi

# Bounded over-cap write: must fail, and must fail with ENOSPC.
if is_uint "$mount_bytes" && (( mount_bytes > 0 )); then
  probe="$SCRATCH_DIR/enospc-probe.bin"
  rm -f "$probe"
  want_mib=$(( (mount_bytes / 1048576) * 2 + 2 ))   # ~2x cap, rounded up
  if dd if=/dev/zero of="$probe" bs=1M count="$want_mib" status=none 2>"$SCRATCH_ERR"; then
    echo "FAIL: over-cap dd ($want_mib MiB) completed; ENOSPC not enforced"
    FAIL=$((FAIL+1))
  elif grep -qi 'no space left on device' "$SCRATCH_ERR"; then
    echo "PASS: over-cap dd rejected with ENOSPC"
    PASS=$((PASS+1))
  else
    echo "FAIL: over-cap dd failed without ENOSPC: $(cat "$SCRATCH_ERR")"
    FAIL=$((FAIL+1))
  fi
  rm -f "$probe"
else
  echo "FAIL: could not determine mount capacity; skipping ENOSPC proof"
  FAIL=$((FAIL+1))
fi

rm -f "$SCRATCH_ERR"

Notes: - findmnt -b is the byte form; -n strips the header; -o SIZE selects only that column, so no OPTIONS parsing ever happens. - stat -f -c '%b %S' is the POSIX statvfs route (%b = total blocks, %S = fundamental block size); product is total bytes, matching the findmnt -b unit. - The ENOSPC probe is bounded (~2× cap), always removes its temp file, and distinguishes "dd succeeded" from "dd failed for another reason."

2.3 Summary / exit contract

Old (buggy) behavior is equivalent to:

echo "PASS=$PASS FAIL=$FAIL"
exit 0                     # <-- masks every failure

New behavior (via battery_summary, or inline if not refactored):

echo "----- summary -----"
echo "PASS=$PASS FAIL=$FAIL"
if (( FAIL > 0 )); then
  echo "VERIFY-FAIL"
  exit 1
fi
echo "VERIFY-PASS"
exit 0

3. Regression tests

Add e2e/tests/regression-summary-and-findmnt.sh. It exercises the real battery_summary block and pins the numeric findmnt path.

#!/usr/bin/env bash
# Regression for GAP-075: numeric findmnt path and summary exit contract.
set -uo pipefail

HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
BATTERY="$HERE/../e2e-full-battery.sh"
[[ -f "$BATTERY" ]] || { echo "REGRESSION-FAIL: battery not found" >&2; exit 1; }

fail() { echo "REGRESSION-FAIL: $*" >&2; exit 1; }

# --- 1. findmnt -b SIZE is a byte count on a real tmpfs ----------------------
mnt=$(mktemp -d)
mount -t tmpfs -o size=16M tmpfs "$mnt" || fail "could not mount probe tmpfs"
trap 'umount "$mnt" 2>/dev/null; rmdir "$mnt" 2>/dev/null' EXIT

size=$(findmnt -b -n -o SIZE --target "$mnt") || fail "findmnt -b failed"
[[ "$size" =~ ^[0-9]+$ ]] || fail "findmnt -b SIZE not numeric: '$size'"
(( size >= 16777216 )) || fail "probe size $size < 16 MiB"

# The old buggy extraction must be gone.
if grep -nE "OPTIONS|size=[0-9]+[kKmMgG]" "$BATTERY" >/dev/null; then
  fail "battery still parses human-readable size= from OPTIONS"
fi

# --- 2. execute the REAL summary block --------------------------------------
run_summary() {
  local p=$1 f=$2
  bash -c '
    source "$1"
    PASS=$2 FAIL=$3
    battery_summary
  ' _ "$BATTERY" "$p" "$f"
}

out=$(run_summary 5 0); rc=$?
(( rc == 0 )) || fail "FAIL=0 must exit 0, got $rc"
grep -q 'VERIFY-PASS' <<<"$out" || fail "FAIL=0 missing VERIFY-PASS"

out=$(run_summary 5 1); rc=$?
(( rc != 0 )) || fail "FAIL=1 must exit non-zero, got $rc"
grep -q 'VERIFY-FAIL' <<<"$out" || fail "FAIL=1 missing VERIFY-FAIL"

echo "REGRESSION-PASS"

Run it in CI next to the battery:

sudo bash e2e/tests/regression-summary-and-findmnt.sh

4. Verification

Local (must run as root on a Linux/tmpfs host):

# 1. Syntax + static analysis
bash -n e2e-full-battery.sh
bash -n e2e/tests/regression-summary-and-findmnt.sh

# 2. Go build/vet/tests for the bunker tree
go build ./...
go vet ./...
go test ./...

# 3. New regressions (mounts a probe tmpfs; needs root)
sudo bash e2e/tests/regression-summary-and-findmnt.sh
# expect: REGRESSION-PASS

# 4. Full battery must now fail loudly when it should
sudo bash e2e-full-battery.sh; echo "battery rc=$?"
# healthy run: "... VERIFY-PASS" and rc=0
# broken run:  "... VERIFY-FAIL" and rc!=0 (no longer masked)

Expected observable changes:

Before dc45cdb After dc45cdb
[: 16384k: integer expression expected no comparison of suffixed strings; findmnt -b yields digits
spurious FAIL, ENOSPC proof skipped mount/statfs compared in bytes; bounded ENOSPC proof runs
battery exits 0 with FAIL>0 VERIFY-FAIL + exit 1 when FAIL>0
containing fs could false-pass FSTYPE=tmpfs + mountpoint -q required
summary contract untested regression sources and executes the real battery_summary

The error above (scratch cap not reported by the kernel (mount size=16384k statfs=16777216)) is eliminated at its source: the kernel-reported capacity is now read in bytes with findmnt -b, every operand is ^[0-9]+$-validated before -le/arithmetic, and the battery’s exit status faithfully reflects FAIL.

Evidence & signatures

# Evidence
- Problem class: findmnt-human-readable-size-vs-statfs-bytes-e2e
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-13T19:52:39.285Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A live E2E cap assertion read findmnt OPTIONS and extracted size=16384k, then compared that human-readable value to statfs bytes 16777216 and passed 16384k to the numeric -le operator. This produced a false test failure, skipped the intended ENOSPC proof, and the battery still exited 0 because its summary had an unconditional exit 0. Fix: read mount capacity with findmnt -b -n -o SIZE --target so the value is byte-count digits; validate all operands against ^[0-9]+$ before arithmetic; require FSTYPE=tmpfs plus mountpoint -q so a containing filesystem cannot false-pass; compare to statfs blocks*block-size; preserve a bounded over-cap dd/ENOSPC assertion. Make FAIL>0 emit VERIFY-FAIL and exit non-zero, with exit 0 and VERIFY-PASS only when FAIL=0. Add regression tests that execute the real summary block and pin the numeric findmnt path. Verified by GitReins Tier 2 verdict 0243b576 exposing the failure, then commit dc45cdb local build/vet/tests and staged full guard passing; live rerun pending at submission time.", "environment": "bunker Go project; Bash E2E battery on Ubuntu/Linux tmpfs; GitHub Actions self-hosted root runner", "language": "bash", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "findmnt-human-readable-size-vs-statfs-bytes-e2e", "provider": "openrouter", "solved_at": "2026-09-13T19:52:39.286Z", "version": "bunker main dc45cdb"}
Generated from the verified corpus · MIT licensedBack to the catalog