Skip to content

[Adapter] Support Pi CLI #19

Description

@teseo

Kind

implement

Goal

Integrate human.md with Pi through an extension that observes lifecycle events and enforces pre-tool decisions.

Non-goals

  • Supporting the Pi desktop surface.
  • Modifying Pi's policy or settings files outside the extension boundary.
  • Duplicating policy logic inside the extension.

Invariants

  • The adapter only translates Pi events to the neutral contract.
  • Deny decisions prevent the tool call; advisory decisions remain visible.
  • Session state is namespaced and cleaned up on session end.
  • Extension load failure has an explicit documented mode.

Behavioral contract / States

Register Pi lifecycle and tool-call hooks, emit normalized events, apply the engine response, and report reason/message to the user. Unknown Pi events are logged as diagnostics without changing policy state.

Scope surface

Pi extension entrypoint, installer registration, fixtures, and adapter tests.

Acceptance

  • Install the extension in a temporary Pi home and verify session start/end.
  • Verify an allowed tool proceeds, a denied tool is blocked, and advisory output is shown.
  • Run: python3 -m pytest tests/test_guard.py -v and the adapter-specific Pi test command documented in the repository.
  • Add a smoke-test command that exits non-zero when the extension is not loaded.

Split triggers

  • Pi's stable extension API cannot express blocking pre-tool decisions.
  • Pi desktop exposes a different lifecycle than the CLI.

Dependencies / Parent

Blocked by: #1, #2, #3
Parent Epic: #15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions