Skip to content

refactor: split guardrails extensions#34

Draft
aliou wants to merge 19 commits intomainfrom
feat/refactor-core-extraction
Draft

refactor: split guardrails extensions#34
aliou wants to merge 19 commits intomainfrom
feat/refactor-core-extraction

Conversation

@aliou
Copy link
Copy Markdown
Owner

@aliou aliou commented May 8, 2026

Summary

Refactors guardrails into a split extension architecture:

  • src/core: Pi-free primitives and typed rule checks.
  • src/shared: shared config, migrations, events, matching, warnings, and path helpers.
  • extensions/guardrails: policy enforcement plus settings, onboarding, and examples commands.
  • extensions/path-access: outside-workspace path access control.
  • extensions/permission-gate: dangerous command confirmation.

Also updates the package to Pi 0.74.0 / @earendil-works/*, restores and reorganizes the TUI commands, adds focused tests for the split features, updates docs, and adds a local skill for building future guardrails extensions.

User-facing changes

  • Adds /guardrails:examples for applying policy and dangerous-command presets.
  • Keeps /guardrails:settings as the main settings UI.
  • Registers /guardrails:onboarding only when onboarding is still pending.
  • Keeps all split extensions sharing guardrails.json.
  • Updates docs for defaults, examples, config, and Pi 0.74 package scope migration.

Validation

  • pnpm typecheck
  • pnpm lint
  • pnpm test -- --runInBand
  • Manual TUI smoke tested successfully:
    • /guardrails:settings
    • /guardrails:examples
    • onboarding command visibility after completion

Still left before merge

  • Add changeset.
  • Optional later hardening: user regex ReDoS mitigation.
  • Optional later cleanup: harmonize guardrails event payloads with the new registry-style event shape.

Leaving this PR as draft until release prep is done.

@aliou aliou changed the title feat: refactor package refactor: split guardrails extensions May 9, 2026
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