Skip to content

feat: permission-gateway + fan-flames + /tune command#37

Merged
muloka merged 5 commits intomainfrom
push-all
Mar 19, 2026
Merged

feat: permission-gateway + fan-flames + /tune command#37
muloka merged 5 commits intomainfrom
push-all

Conversation

@muloka
Copy link
Copy Markdown
Owner

@muloka muloka commented Mar 19, 2026

Summary

Three new capabilities for autonomous subagent workflows:

  • permission-gateway — Standalone plugin. Tiered PreToolUse hook that auto-approves safe commands, blocks dangerous ones, confirms risky operations, and LLM-evaluates everything else. 124 tests. One-way ratchet security model prevents prompt injection from loosening deny rules.
  • fan-flames — New skill in workspace-jj. Orchestrates parallel subagent execution across isolated jj workspaces, reunifies results via jj squash --from, reports plan coverage. Delegates dispatch to superpowers, handles jj-specific lifecycle only.
  • /tune — Self-tuning command. Scans decision log, normalizes commands into patterns, suggests .local.md rule promotions based on confirmation frequency.

Changes

permission-gateway plugin (new)

  • permission-gate.sh — tiered evaluation: Gate-the-Gate → Deny (immutable) → .local.md → Confirm → Approve → Tier 2 LLM
  • gate-config-writes.sh — fail-closed Write/Edit hook protecting gateway config + hook registration settings
  • permission-evaluate.md — Tier 2 LLM prompt template
  • commands/tune.md — log-based rule self-tuning command
  • tests/test-permission-gate.sh — 124 tests covering safe/dangerous/confirm/edge cases/precedence
  • Decision logging to .claude/permission-gateway.log (APPROVE/DENY/CONFIRM + command)
  • .local.md config: project > global > defaults, deny wins ties

workspace-jj (enhanced)

  • skills/fan-flames.md — 5-phase lifecycle (plan → fan-out → collect → fan-in → verify)
  • Change-ID-based fan-in (decoupled from workspace lifecycle / WorktreeRemove race)
  • Merge order: smallest diff first by files touched, with --merge-order override
  • CLAUDE.md override: routes subagent-driven-development through fan-flames in jj repos
  • Scripts renamed: jj-worktree-*jj-workspace-* (jj terminology)

Docs

  • Design spec for both features
  • Implementation plans for all three phases
  • READMEs for permission-gateway and updated root README
  • project-setup-jj template: added jj working-copy-is-a-commit instruction

Security model

  • One-way ratchet: hardcoded deny is immutable floor — .local.md cannot loosen
  • Gate the gate: writes to permission-gate*, .claude/settings, .claude-plugin/ require human confirmation
  • Fail-closed: malformed hook input defaults to ask, not pass-through
  • Full-string scanning: dangerous patterns caught inside xargs, find -exec, redirect clobbers

Test plan

  • Run bash plugins/permission-gateway/tests/test-permission-gate.sh — 124 tests
  • Verify gate-config-writes with malformed input (fail-closed)
  • Install plugin, verify safe commands auto-approve in real session
  • Verify denied commands show BLOCKED message
  • Test .local.md rule override (project level)
  • Test fan-flames skill triggers on "fan out tasks" intent

🤖 Generated with Claude Code

muloka and others added 5 commits March 18, 2026 09:07
… status

- Strip model context suffix (e.g. "1M context") before incident name matching so "Opus 4.6 (1M context)" correctly matches "Increased errors on Opus 4.6"
- Add STATUS_LBL to show which service is affected (model family or "CC")
- Map 4-level severity scale: ✓ operational, ▲ minor, ⚠ major, ↯ critical
- Apply same severity scale to CC component: degraded_performance=▲, partial_outage=⚠, major_outage=↯

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…plan

- Add design spec for permission-gateway (standalone plugin) and fan-flames (workspace-jj skill)
- Add implementation plan for permission-gateway Phase 1
- Rename workspace-jj scripts: jj-worktree-* → jj-workspace-* (jj terminology)
- Update workspace-setup command to reference renamed scripts
…ay plugin

- Tiered evaluation: Gate-the-Gate → Deny (immutable) → .local.md → Confirm → Approve → Tier 2 LLM
- 124 tests covering safe/dangerous/confirm/edge cases/precedence/Tier 2
- One-way ratchet: hardcoded deny is immutable floor, .local.md cannot loosen
- Gate-the-gate: Write/Edit hooks confirm modifications to gateway config files
- Full-string scanning: dangerous patterns caught inside xargs, find -exec, redirects
- Decision logging to .claude/permission-gateway.log for rule self-tuning
- .local.md config: project > user global > plugin defaults, deny wins ties
- Tier 2: systemMessage with LLM evaluation prompt for unknown commands
- READMEs for permission-gateway plugin and updated root README
- project-setup-jj: add jj working-copy-is-a-commit instruction to CLAUDE.md template
- Skill file: 5-phase lifecycle (plan → fan-out → collect → fan-in → verify)
- Merge order: smallest diff first by files touched, with --merge-order override
- Partial success: merge what succeeded, preserve failed workspaces
- Change ID based fan-in: decouples squash from workspace lifecycle
- Delegates dispatch to superpowers, handles jj-specific bookends only
- CLAUDE.md override: routes subagent-driven-development through fan-flames
- README: documents skill usage and integration
- /tune: scans decision log, normalizes commands into patterns, suggests .local.md promotions
- gate-config-writes: widened pattern (permission-gate*, .claude/settings, .claude-plugin/)
- gate-config-writes: fail-closed trap (malformed input defaults to ask, not pass-through)
- gate-config-writes: anchored settings path (no false positives on app-level settings files)
- READMEs updated with self-tuning docs
@muloka muloka merged commit 4b66703 into main Mar 19, 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