Fix enforcement nits: dottie config, hook bugs, new safety hooks #85

Merged
forgejo_admin merged 2 commits from 84-fix-enforcement-nits into main 2026-03-13 20:21:50 +00:00
Contributor

Summary

Fixes six accumulated enforcement nits: adds "dottie" as a recognized agent type in the spawn gate schema, removes a stale pal-e-docs MCP reference that dev/QA agents cannot access, fixes large HTML content truncation in the note template checker, and adds a new advisory hook that warns before note deletion.

Changes

  • schemas/agent-spawn-requirements.json -- Added "dottie" agent type with plan- required pattern and isolation: false, matching the general-purpose entry structure. Fixes spawn gate blocking Dottie spawns.
  • hooks/remind-mcp-review-loop.sh -- Replaced mcp__pal-e-docs__get_note(slug="pr-review-loop") reference with plain English guidance ("Follow the review-fix loop: review, post findings, stop."). Dev/QA agents have no pal-e-docs access.
  • hooks/check-note-template.sh -- Replaced echo "$DECODED_CONTENT" | grep with temp file approach (mktemp + grep -qiF "$heading" "$TMPFILE"). Fixes silent truncation on multi-KB HTML content that exceeds shell argument limits.
  • hooks/warn-delete-note.sh -- New PreToolUse hook for mcp__pal-e-docs__delete_note. Outputs sop-note-deletion reminder (WAL switch, JSON export, pg_dump, then delete). Exits 0 (advisory, non-blocking).
  • settings.json -- Registered warn-delete-note.sh under PreToolUse with matcher mcp__pal-e-docs__delete_note.

Test Plan

  • Verified "dottie" spawn with plan ref passes check-agent-spawn.sh (exit 0, no output)
  • Verified "dottie" spawn without plan ref is correctly denied by check-agent-spawn.sh
  • Verified remind-mcp-review-loop.sh contains zero mcp__pal-e-docs references
  • Verified warn-delete-note.sh outputs warning JSON with slug and exits 0
  • Verified check-note-template.sh correctly processes large HTML content via temp file and still rejects notes missing required sections
  • Validated settings.json and agent-spawn-requirements.json as valid JSON

Review Checklist

  • All four fixes implemented as specified in issue #84
  • No unrelated changes
  • All modified/new shell scripts are executable
  • JSON files validated
  • Hook exit codes follow convention (0 = allow/warn, 2 = block)
  • Plan: plan-pal-e-agency (traceability)
  • Forgejo issue: #84

Closes #84

## Summary Fixes six accumulated enforcement nits: adds "dottie" as a recognized agent type in the spawn gate schema, removes a stale pal-e-docs MCP reference that dev/QA agents cannot access, fixes large HTML content truncation in the note template checker, and adds a new advisory hook that warns before note deletion. ## Changes - **`schemas/agent-spawn-requirements.json`** -- Added `"dottie"` agent type with `plan-` required pattern and `isolation: false`, matching the general-purpose entry structure. Fixes spawn gate blocking Dottie spawns. - **`hooks/remind-mcp-review-loop.sh`** -- Replaced `mcp__pal-e-docs__get_note(slug="pr-review-loop")` reference with plain English guidance ("Follow the review-fix loop: review, post findings, stop."). Dev/QA agents have no pal-e-docs access. - **`hooks/check-note-template.sh`** -- Replaced `echo "$DECODED_CONTENT" | grep` with temp file approach (`mktemp` + `grep -qiF "$heading" "$TMPFILE"`). Fixes silent truncation on multi-KB HTML content that exceeds shell argument limits. - **`hooks/warn-delete-note.sh`** -- New PreToolUse hook for `mcp__pal-e-docs__delete_note`. Outputs sop-note-deletion reminder (WAL switch, JSON export, pg_dump, then delete). Exits 0 (advisory, non-blocking). - **`settings.json`** -- Registered `warn-delete-note.sh` under PreToolUse with matcher `mcp__pal-e-docs__delete_note`. ## Test Plan - Verified `"dottie"` spawn with plan ref passes check-agent-spawn.sh (exit 0, no output) - Verified `"dottie"` spawn without plan ref is correctly denied by check-agent-spawn.sh - Verified `remind-mcp-review-loop.sh` contains zero `mcp__pal-e-docs` references - Verified `warn-delete-note.sh` outputs warning JSON with slug and exits 0 - Verified `check-note-template.sh` correctly processes large HTML content via temp file and still rejects notes missing required sections - Validated `settings.json` and `agent-spawn-requirements.json` as valid JSON ## Review Checklist - [x] All four fixes implemented as specified in issue #84 - [x] No unrelated changes - [x] All modified/new shell scripts are executable - [x] JSON files validated - [x] Hook exit codes follow convention (0 = allow/warn, 2 = block) ## Related - Plan: `plan-pal-e-agency` (traceability) - Forgejo issue: #84 Closes #84
- Add "dottie" as recognized agent type in spawn schema
- Remove stale mcp__pal-e-docs reference from remind-mcp-review-loop.sh
- Fix large HTML truncation in check-note-template.sh using temp file
- Add warn-delete-note.sh PreToolUse hook with sop-note-deletion reminder
- Register warn-delete-note hook in settings.json

Closes #84

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The schema already recognizes "dottie" as an agent type, but the
SubagentStart matcher in settings.json and the context injection hook
did not handle it. This adds dottie to both so spawned dottie agents
receive proper context injection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
forgejo_admin deleted branch 84-fix-enforcement-nits 2026-03-13 20:21:50 +00:00
Sign in to join this conversation.
No description provided.