Skip to content

fix(harness): enforce permissions and correct stale guidance - #178

Merged
e128 merged 1 commit into
mainfrom
fix/harness-permissions
Nov 17, 2026
Merged

e128 merged 1 commit into
mainfrom
fix/harness-permissions

Conversation

@e128

@e128 e128 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Executive Summary

The project permission rules denied only three destructive actions. A guard hook that claimed to protect .claude/settings.json never ran, because its matcher covered only shell commands, and the Stop hook only printed a warning from an inline command. A prompt audit of the agents, skills, and instruction files also found stale paths, commands, and facts. This change adds deny rules for irreversible actions, removes the ineffective guard wiring, and corrects the stale guidance.

Code Changes

  • .claude/settings.json: 17 new deny rules (destructive git, recursive delete, remote delete, and reads of .env*, ~/.ssh, ~/.aws). The unused pre-tool-use-guard wiring is removed. The opencode plugin still uses that script. Native ask rules now gate edits to this file for the primary harness.
  • .claude/hooks/stop-violations: the Stop hook moves from an inline command to this script. It warns and exits 0. The violation scan matches text, so it reports diagnostic strings and ordinary properties as hits.
  • Agents (.claude/agents/, plus the regenerated opencode mirror): fixes for the analyzer register paths, the --no-format flag, the smart-commit description, dep-check.sh routing, local function expression bodies, and the memory index. naming-migrate and refactoring-specialist keep worktree isolation and now return edits with verification pending when the worktree is nested.
  • Skills (.claude/skills/): stale coverage and CRAP instructions rewritten for the Cobertura workflow, approval prompts before file deletes, preflight phrases mapped to /yeet --dry-run, plan wording without a named planning skill, a review-only rule for mr-sparkle, and approval rules for fix-investigate.
  • Lode: documents the permission gates, the worktree verification boundary, the coverage and CRAP limits, and the split between internal and package compatibility. References to a private sibling repository are removed from the analyzer candidate files.

Tests and Tooling

  • scripts/check.sh passed (shell lint, format, build, CI-category tests) on an earlier tree. Later edits changed markdown and shell hook text only.
  • scripts/format.sh --check, shellcheck on all shell scripts, the opencode mirror check, the analyzer release check, and the README rule table check pass on the branch head.
  • gitleaks found no leaks in the commit.
  • The full suite (scripts/test.sh --all) did not run. No C# source changed.
  • A ReportGenerator probe exited 0 with a CRAP maximum of 1 against this repository's reports. The CRAP reference now says to verify that gate before use.

Review Guide

  • Check the deny list in .claude/settings.json. Bash deny patterns match prefixes, so a wrapped command such as bash -c "rm -rf ..." bypasses them. The Read denies are the reliable ones.
  • Confirm that lode/practices.md now treats the published E128.Analyzers package surface as public.
  • Pug.Core.* type names stay in analyzer metadata and test stubs. They are functional, not prose.

Rollback

Revert the squashed commit. No runtime code, package version, or CI workflow changes.

Align both harnesses with intended safety boundaries and match agent guidance to current workflows.

- Deny destructive and secret-read actions, and move stop warnings into a dedicated hook.
- Correct stale instructions for approvals, tools, reviews, and coverage workflows.
- Document permission gates, coverage limits, and package compatibility; regenerate the OpenCode agent mirror.
@e128
e128 merged commit d889801 into main Nov 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant