Skip to content

dogfood: wire C1 memory budget gate (/usr/bin/time RSS) #718

@noahgift

Description

@noahgift

Summary

Dogfood Gate C1 (memory budget: RSS < 3x model + 512 MB) is defined in the contract (apr-qa-chaos-v1.yaml / F-CHAOS-001) but skips when /usr/bin/time -v is unavailable or doesn't parse correctly.

Proposed Implementation

M=$(find ~/models -name "*.gguf" -size -1G | head -1)
MODEL_KB=$(du -k "$M" | cut -f1)
# Use /usr/bin/time -v (GNU time, not shell builtin)
RSS_KB=$( { /usr/bin/time -v apr inspect "$M" ; } 2>&1 | grep "Maximum resident" | awk '{print $NF}')
BUDGET_KB=$(( MODEL_KB * 3 + 524288 ))
[ "$RSS_KB" -lt "$BUDGET_KB" ] && echo "C1 PASS" || echo "C1 WARN"

Key: must use /usr/bin/time (GNU), not time (shell builtin). Redirect stderr properly since /usr/bin/time writes to stderr.

Blocking

Dogfood Gate C1.

Priority

P3 — memory bugs are rare but catastrophic (GH-434, GH-478).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions