Research-Stack/.devin/hooks/programming-choice-reminder.sh
Brandon Schneider 7585388386 chore(devin): UserPromptSubmit hook — programming choice flow reminder
Adds .devin/config.json with a UserPromptSubmit hook that fires on every
user message and injects the programming choice flow + post-interaction
checklist into the agent's context via add_context.

.devin/hooks/programming-choice-reminder.sh:
  Emits a JSON add_context block with the 7-branch decision tree:
  1. Admissibility/gating → Lean only
  2. Receipt minting / top-level JSON → AVMIsa.Emit only
  3. Alignment classification → Lean (RRC.Emit)
  4. Raw input features → Python shim OK with constraints
  5. Float in compute path → STOP, use Q16_16
  6. Promotion in shim space → STOP, not_promoted until Lean gate passes
  7. Pure I/O → Python fine, route receipts through AVMIsa.Emit
  Plus the 4-step post-interaction checklist (AGENTS.md / build / commit / status)

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 22:27:41 -05:00

9 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# Programming choice flow reminder — injected before every user message.
# Full contract lives in AGENTS.md §Post-Interaction Workflow §5.
cat <<'EOF'
{
"add_context": "PROGRAMMING CHOICE FLOW (check before writing any new code):\n\n1. Admissibility / gating / routing / alignment decision? → Lean only. No Python equivalent.\n2. Minting a receipt or emitting top-level JSON? → Semantics.AVMIsa.Emit ONLY (sole output boundary).\n3. Classifying rows / computing alignment scores? → Lean (Semantics.RRC.Emit or new Semantics.RRC.* module).\n4. Supplying raw input features (equation text, IDs, weak_axes)? → Python shim OK, but: (a) no admissibility logic, (b) regenerable from source, (c) TODO(lean-port) if portable.\n5. Float arithmetic in a compute path? → STOP. Use Q16_16.ofNat / Q16_16.ofRatio instead.\n6. Advancing promotion status in shim space? → STOP. Always not_promoted until a Lean gate passes.\n7. Pure I/O (read/write JSON, call subprocess, format output)? → Python shim fine; receipt output must route through AVMIsa.Emit.\n\nSummary rule: Lean owns all decisions. Python owns all I/O.\n\nPOST-INTERACTION CHECKLIST (before claiming session complete):\n1. Update nearest AGENTS.md for every touched subtree\n2. lake build Compiler (+ full lake build if Lean files touched)\n3. Commit with explicit file list — never git add .\n4. git status --branch --short --untracked-files=all"
}
EOF