Add social cost proxies to impact tracking hooks
Extend pre-compact-snapshot.sh to extract 5 new per-conversation metrics from the transcript: automation ratio (deskilling proxy), model ID (monoculture tracking), test pass/fail counts (code quality proxy), file churn (edits per unique file), and public push detection (data pollution risk flag). Update show-impact.sh to display them. New plan: quantify-social-costs.md — roadmap for moving non-environmental cost categories from qualitative to proxy-measurable. Tasks 19-24 done. Task 25 (methodology update) pending. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e6e0bf4616
commit
af6062c1f9
8 changed files with 554 additions and 25 deletions
|
|
@ -49,6 +49,35 @@ while IFS= read -r line; do
|
|||
printf " Cache: %s created, %s read\n" "$cache_create" "$cache_read"
|
||||
fi
|
||||
LC_NUMERIC=C printf " Energy: ~%s Wh CO2: ~%sg Cost: ~\$%.2f\n" "$energy" "$co2" "$(echo "$cost / 100" | bc -l 2>/dev/null || echo "$cost cents")"
|
||||
|
||||
# Social cost proxies (if present in log entry)
|
||||
model=$(echo "$line" | jq -r '.model_id // empty')
|
||||
auto_pm=$(echo "$line" | jq -r '.automation_ratio_pm // empty')
|
||||
user_tok=$(echo "$line" | jq -r '.user_tokens_est // empty')
|
||||
files_ed=$(echo "$line" | jq -r '.unique_files_edited // empty')
|
||||
total_ed=$(echo "$line" | jq -r '.total_file_edits // empty')
|
||||
t_pass=$(echo "$line" | jq -r '.test_passes // empty')
|
||||
t_fail=$(echo "$line" | jq -r '.test_failures // empty')
|
||||
pub_push=$(echo "$line" | jq -r '.has_public_push // empty')
|
||||
|
||||
if [ -n "$model" ]; then
|
||||
printf " Model: %s\n" "$model"
|
||||
fi
|
||||
if [ -n "$auto_pm" ] && [ "$auto_pm" != "0" ]; then
|
||||
auto_pct=$(( auto_pm / 10 ))
|
||||
auto_dec=$(( auto_pm % 10 ))
|
||||
printf " Automation ratio: %d.%d%% (user ~%s tokens, AI ~%s tokens)\n" \
|
||||
"$auto_pct" "$auto_dec" "$user_tok" "$output"
|
||||
fi
|
||||
if [ -n "$files_ed" ] && [ "$files_ed" != "0" ]; then
|
||||
printf " File churn: %s edits across %s files\n" "$total_ed" "$files_ed"
|
||||
fi
|
||||
if [ -n "$t_pass" ] && [ -n "$t_fail" ] && { [ "$t_pass" != "0" ] || [ "$t_fail" != "0" ]; }; then
|
||||
printf " Tests: %s passed, %s failed\n" "$t_pass" "$t_fail"
|
||||
fi
|
||||
if [ "$pub_push" = "1" ]; then
|
||||
printf " Public push: yes (data pollution risk)\n"
|
||||
fi
|
||||
echo ""
|
||||
done < "$LOG_FILE"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue