feat: implement native hooks runtime
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## Status
|
||||
|
||||
**Approved on 27 August 2026 for later execution.** This repository is seeded with the reviewed plan only. Runtime implementation has not started and is intentionally outside the repository-creation task.
|
||||
**Approved on 27 August 2026 and implemented as the repository baseline.** Activation remains a separate explicit user-authorized step; the package is not installed and live personal configuration is not created by implementation or tests.
|
||||
|
||||
## Purpose
|
||||
|
||||
@@ -18,7 +18,7 @@ The extension will also establish a small toolkit and authoring skill for adding
|
||||
|
||||
- Implement a native TypeScript Pi extension with `pi.on(...)`, not `pi-yaml-hooks`, `pi-steering`, or `pi-workflow`.
|
||||
- Build one standalone repository and Pi package named `pi-native-hooks`, with one extension of the same name.
|
||||
- Install the package from `/srv/data/code/pi-native-hooks` as a Pi local-path package during development; do not depend on harness-tools link management.
|
||||
- Install the package from `/srv/data/code/jb-pi/pi-native-hooks` as a Pi local-path package during development; do not depend on harness-tools link management.
|
||||
- Load personal hook policies as trusted TypeScript modules from `~/.config/pi-native-hooks/`.
|
||||
- Use ast-grep rule packs for syntax diagnostics.
|
||||
- Execute an analyzer once per overlapping mutation wave and analyzer configuration, then fan an immutable normalized result out to every interested policy. Individual policy modules must not spawn AST, lint, or LSP processes through the runtime interface.
|
||||
@@ -85,11 +85,11 @@ The first release is successful when:
|
||||
|
||||
## Repository and runtime boundaries
|
||||
|
||||
- **Repository:** `/srv/data/code/pi-native-hooks`
|
||||
- **Repository:** `/srv/data/code/jb-pi/pi-native-hooks`
|
||||
- **Package and extension:** `pi-native-hooks`
|
||||
- **Extension entrypoint:** `extensions/pi-native-hooks/index.ts`
|
||||
- **Personal policy root:** `~/.config/pi-native-hooks/`
|
||||
- **Installation:** Pi local-path package during development; registry publication is deferred.
|
||||
- **Installation:** Pi local-path package from `/srv/data/code/jb-pi/pi-native-hooks` during development; registry publication is deferred.
|
||||
- **Runtime code:** package-owned lifecycle, analyzer, state, delivery, validation, and UI modules.
|
||||
- **Personal code:** user-owned policy modules and adjacent ast-grep rule files. Personal policies are not committed to this repository.
|
||||
- **Repository fixtures:** checked-in example policies and test fixtures that mirror the personal module contract without containing the user's live policy set.
|
||||
@@ -634,7 +634,7 @@ After approval, implementation should add:
|
||||
- A throwaway ast-grep 0.45.1 fixture detected both initial TypeScript patterns in one `scan --json=stream` invocation, did not confuse logical negation with a non-null expression, and honored a rule-specific suppression with a trailing rationale.
|
||||
- The ast-grep fixture confirmed warning findings return exit code zero and JSON source ranges are zero-based, both now reflected in the adapter plan.
|
||||
- Node 26.7 successfully imported an erasable `.ts` policy containing interfaces, `satisfies`, and a type-only import to an unavailable runtime package. Phase 0 still must repeat the contract on the minimum supported Node 22.19 runtime.
|
||||
- Planning created only this repository's README and documentation. No runtime extension, live personal policy, Pi package setting, or global installation was changed.
|
||||
- Planning originally created only this repository's README and documentation. Implementation subsequently added the runtime, tests, examples, and authoring skill. No live personal policy, Pi package setting, or global installation is changed without the separate activation approval.
|
||||
|
||||
Independent agent review is deferred because direct subagent launches are currently being repaired. It remains the first execution prerequisite when implementation starts from this repository.
|
||||
|
||||
@@ -653,4 +653,4 @@ The user accepted these consequences on 27 August 2026:
|
||||
9. Pi's settlement gate cannot prevent a user or external client from closing the session.
|
||||
10. Local-path package installation and creation of `~/.config/pi-native-hooks` are separate external mutations requiring approval after tests and review.
|
||||
|
||||
User approval is recorded. Implementation has not started; independent review remains the first execution prerequisite.
|
||||
User approval is recorded. An independent pre-implementation review was completed before runtime changes; its blockers were addressed by `docs/event-contract.md`, the explicit project identity schema, fail-fast native TypeScript loading, and canonical repository paths.
|
||||
|
||||
Reference in New Issue
Block a user