-
Notifications
You must be signed in to change notification settings - Fork 0
chore: enforce Pi package catalog contract #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
faaf541
docs: polish Pi package catalog metadata
ChefGroep 3eb9c1f
chore: enforce Pi package release contract
ChefGroep 74ecc53
fix: Align pack check with package verifier
qodo-code-review[bot] 8944a92
fix(package): harden Pi catalog release gate
ChefGroep 48227e6
review: address CodeRabbit findings (#4)
ChefGroep 89074aa
review: handle multiline static imports (#4)
ChefGroep 2a4a482
review: fix type-only vs multiline import detection (unify gate)
MisterWanted 35f9398
fix(package): share compact-import runtime scanner with pi-tools
ChefGroep 3bb5265
fix(contract): use token-aware runtime dependency scanning
ChefGroep d4b46d0
fix(contract): ignore member calls named import or export
ChefGroep 788af2e
test(contract): cover token-aware module detection
ChefGroep 14ceb53
fix(contract): traverse packaged runtime modules from Pi entrypoints
ChefGroep 5515c1d
ci(contract): run parser regressions before publish
ChefGroep cd46a2e
ci: validate Pi package contract on pull requests
ChefGroep eca4c75
fix(contract): accept npm 12 pack JSON and pack the gallery PNG
ChefGroep 45662e0
ci: disable Linear sync on this public package repo
ChefGroep e2ca294
fix(ci): keep public sync compatibility workflow valid
ChefGroep 5c0f2b0
fix(contract): skip regex literals during runtime import scan
ChefGroep bb81d3c
merge(main): reconcile package contract with current main
ChefGroep 6dd2c5f
fix(contract): recognize regex after expression operators
ChefGroep 7a9a65c
chore: reconcile pi catalog metadata with main
ChefGroep d9b2cf5
Expand Pi package contract verification test coverage
coderabbitai[bot] cc1e6b0
docs: full README, architecture, and skill rewrite; sharpen catalog m…
ChefGroep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,46 @@ | ||
| # Architecture | ||
|
|
||
| `pi-control` is a thin in-process Pi extension. It does not run a daemon or hosted control plane. | ||
| `pi-control` is a thin, in-process Pi extension. It runs no daemon, hosts no control plane, and keeps no second copy of Pi's state — every read and write goes through the live Pi host. | ||
|
|
||
| ```text | ||
| Pi host | ||
| -> extensions/pi-control/index.ts | ||
| -> commands/ operator slash workflows | ||
| -> tools.ts structured agent tools | ||
| -> guardrails.ts mutation / shell safety checks | ||
| -> Pi context APIs session, model, tools, state | ||
| └─ extensions/pi-control/index.ts | ||
| ├─ commands/ operator slash workflows (/pi-demo, /pi-verify, /pi-qa) | ||
| ├─ tools.ts five structured agent tools | ||
| ├─ guardrails.ts lifecycle + tool-call safety hooks | ||
| └─ Pi context APIs sessions, model, tools, state | ||
| skills/pi-control/SKILL.md packaged operating guidance | ||
| ``` | ||
|
|
||
| ## Ownership | ||
| ## Module ownership | ||
|
|
||
| - `pi_session` inspects or changes the active Pi session. | ||
| - `pi_model` controls the selected model and thinking level. | ||
| - `pi_tool` inspects or replaces the active tool set. | ||
| - `pi_state` stores small named snapshots used by control workflows. | ||
| - `pi_verify` asserts observable runtime conditions after a change. | ||
| - Guardrails intercept unsafe control/shell patterns before execution. | ||
| | Module | Owns | Never does | | ||
| | --- | --- | --- | | ||
| | `index.ts` | Extension bootstrap; registers commands, tools, guardrails | Holds no state of its own | | ||
| | `tools.ts` | `pi_session`, `pi_model`, `pi_tool`, `pi_state`, `pi_verify` | Bypasses Pi's own session/model/tool APIs | | ||
| | `guardrails.ts` | Denies destructive shell patterns and gates unsafe mutations before execution | Intercepts anything outside control/shell patterns | | ||
| | `commands/` | Operator workflows that compose the tools | Introduces separate state or side effects | | ||
| | `skills/pi-control` | The capture → change → verify → report discipline for agents | Loads tools itself; Pi does that from the manifest | | ||
|
|
||
| State that belongs to durable project work is intentionally outside this package; use `pi-missions`. Multi-agent execution belongs to `pi-agent-orchestrator`. Browser/terminal capture and evidence/showcase workflows belong to `pi-agent-control-extension`. | ||
| ## Data flow | ||
|
|
||
| 1. **Capture** — `pi_session inspect` / `pi_state save` record the current runtime state. | ||
| 2. **Change** — `pi_session fork|switch|compact`, `pi_model set|thinking`, `pi_tool set_active`, `pi_state restore` mutate the live process. | ||
| 3. **Verify** — `pi_verify session|model|tool|state` asserts observable expectations against the same process. | ||
| 4. **Report** — evidence comes from tool outputs and session dumps, not from a parallel model of the world. | ||
|
|
||
| Guardrails sit in front of step 2: a denied mutation never reaches Pi's runtime. | ||
|
|
||
| ## Boundaries | ||
|
|
||
| State that belongs to durable project work is intentionally outside this package — use [`@groeponline/pi-missions`](https://github.com/GroepOnline/pi-missions). Browser/terminal capture, QA evidence recipes, and showcase rendering belong to [`@groeponline/pi-agent-control-extension`](https://github.com/GroepOnline/pi-agent-control-extension). Operator cockpit surfaces (status bar, queue, Skill Studio) belong to [`@groeponline/pi-wishcraft`](https://github.com/GroepOnline/pi-wishcraft). | ||
|
|
||
| ## Packaging | ||
|
|
||
| The npm package carries the extension entrypoint, the skill, and the hero assets declared in `package.json` (`pi.extensions`, `pi.skills`, `pi.image`). The [`verify:pi-package`](scripts/verify-pi-package-contract.mjs) gate validates the manifest, resource existence, public metadata, gallery preview format, Pi core peer-dependency rules, and the final packed tarball on every PR and before every publish. | ||
|
|
||
| ## Testing | ||
|
|
||
| - `scripts/package-contract-runtime.test.mjs` — contract-parser regressions | ||
| - `extensions/pi-control/tests/` — extension unit tests (`npm test --prefix extensions/pi-control`) | ||
| - CI (`publish-npm.yml`) runs both plus the full gate, then publishes with provenance when the version is new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.