# Contributing

Thanks for helping improve `pi-delegation-policy`.

## Before opening an issue

- Search existing issues.
- Include the package version or commit, Pi version, operating system, and a minimal reproduction.
- Remove credentials, session files, prompts, personal paths, model account identifiers, and unredacted logs.
- Report security vulnerabilities through [`SECURITY.md`](SECURITY.md), not a public issue.

## Pull requests

Pull requests should:

- explain the user-visible behavior and the reason for the change;
- include focused tests for behavior changes;
- keep the public package English-only;
- use fictional examples and provider-agnostic documentation;
- preserve exact role references and the absence of model fallbacks;
- preserve the boundary: this package performs no delegated work of its own and never starts a worker from a hook; its only launch belongs to the explicit `context_shunt_delegate` tool, which asks the host-authorized external executor for one bounded answer about a preserved artifact, and the optional advisor is a role the main agent launches as a subagent rather than a launch of this package;
- preserve ContextShunt defaults and controls: `off` performs no classification, metrics, I/O, or interception; declared preflight limits count lines, post-result limits use returned UTF-8 bytes and lines, and rejected requests do not consume the admitted-request window;
- preserve originals when an artifact, permission, or recognized contract is unavailable; keep one-time exceptions user-authorized, short-lived, and bound to the exact tool call and input, with byte limits checked against the returned result;
- avoid project configuration, credential handling, telemetry, and network requests;
- run `npm run format:check`, `npm run lint`, `npm run typecheck`, `npm test`, and `npm run build`.

Changes to persisted schemas, public commands, ContextShunt contracts, or the delegated-work policy need documentation and migration notes.

## Code of conduct

Participation follows [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
