@mgiles/perk 1.1.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/README.md +68 -44
  2. package/extension/adapters/planAdapterPlannotator.ts +27 -41
  3. package/extension/adapters/planAdapterTombell.ts +15 -28
  4. package/extension/adapters/todoAdapterJuicesharp.ts +10 -13
  5. package/extension/checkpoints/checkpoints.ts +19 -12
  6. package/extension/doors/address.ts +4 -4
  7. package/extension/doors/askUser.ts +12 -8
  8. package/extension/doors/ciExecutor.ts +21 -14
  9. package/extension/doors/hunkHandoff.ts +202 -0
  10. package/extension/doors/land.ts +31 -9
  11. package/extension/doors/learn.ts +2 -2
  12. package/extension/doors/learnFactory.ts +144 -0
  13. package/extension/doors/plannotatorHandoff.ts +509 -0
  14. package/extension/doors/prReview.ts +4 -4
  15. package/extension/doors/prReviewBrowser.ts +341 -0
  16. package/extension/doors/prReviewTerminal.ts +267 -0
  17. package/extension/doors/selfcheck.ts +238 -5
  18. package/extension/doors/submit.ts +20 -0
  19. package/extension/doors/submitPrReview.ts +408 -0
  20. package/extension/factories/objective.ts +15 -5
  21. package/extension/factories/objectiveAuthor.ts +15 -32
  22. package/extension/factories/objectiveDraft.ts +1 -1
  23. package/extension/factories/objectivePlan.ts +12 -10
  24. package/extension/factories/objectiveSave.ts +2 -2
  25. package/extension/factories/planMode.ts +22 -40
  26. package/extension/factories/planReview.ts +213 -191
  27. package/extension/factories/planSave.ts +7 -7
  28. package/extension/index.ts +83 -25
  29. package/extension/substrate/bindingDelivery.ts +32 -10
  30. package/extension/substrate/bindings.ts +4 -2
  31. package/extension/substrate/cache.ts +34 -7
  32. package/extension/substrate/clipboard.ts +81 -0
  33. package/extension/substrate/config.ts +97 -70
  34. package/extension/substrate/git.ts +43 -0
  35. package/extension/substrate/paths.ts +1 -1
  36. package/extension/substrate/prompts.ts +2 -2
  37. package/extension/substrate/providers.ts +62 -8
  38. package/extension/substrate/sessionPointers.ts +35 -6
  39. package/extension/substrate/structuredOutput.ts +3 -1
  40. package/extension/substrate/terminalLaunch.ts +178 -0
  41. package/extension/substrate/toolGating.ts +330 -79
  42. package/extension/substrate/toolParams.ts +7 -0
  43. package/extension/substrate/workflowState.ts +54 -2
  44. package/extension/surfaces/footerProvider.ts +8 -4
  45. package/extension/surfaces/surfaces.ts +330 -12
  46. package/extension/vendor/btw/btw.ts +10 -0
  47. package/extension/worker/readOnlySession.ts +19 -6
  48. package/extension/worker/worker.ts +77 -7
  49. package/extension/workerMain.ts +12 -13
  50. package/package.json +3 -3
  51. package/prompts/_fixtures/live.yaml +117 -2
  52. package/prompts/contexts/adapters/juicesharp-todo.md +7 -0
  53. package/prompts/contexts/adapters/plannotator-objective.md +7 -0
  54. package/prompts/contexts/adapters/plannotator-plan.md +6 -0
  55. package/prompts/contexts/adapters/tombell-plan.md +17 -0
  56. package/prompts/contexts/objective-authoring.md +20 -0
  57. package/prompts/contexts/plan-authoring.md +24 -0
  58. package/prompts/contexts/read-only.md +10 -0
  59. package/prompts/stages/conflict-resolution.md +1 -1
  60. package/prompts/stages/learn-code.md +1 -1
  61. package/prompts/stages/learn-docs.md +2 -2
  62. package/prompts/stages/learn-orchestrate.md +1 -1
  63. package/prompts/stages/objective-author/adopt.md +1 -1
  64. package/prompts/stages/objective-author/file.md +1 -1
  65. package/prompts/stages/objective-plan/guidance.md +1 -1
  66. package/prompts/stages/objective-plan/seed.md +1 -1
  67. package/prompts/stages/objective-reconcile.md +1 -1
  68. package/prompts/stages/objective-replan.md +1 -1
  69. package/prompts/stages/plan-from/adopt.md +2 -2
  70. package/prompts/stages/plan-from/file.md +2 -2
  71. package/prompts/stages/pr-review-browser/active.md +11 -0
  72. package/prompts/stages/pr-review-browser/foreign.md +11 -0
  73. package/prompts/stages/pr-review-terminal/active.md +12 -0
  74. package/prompts/stages/pr-review-terminal/foreign.md +13 -0
  75. package/prompts/stages/pr-review-terminal/local.md +4 -0
  76. package/prompts/stages/pr-review.md +1 -1
  77. package/prompts/stages/replan.md +2 -2
  78. package/prompts/stages/skills/create-from.md +1 -1
  79. package/prompts/stages/skills/create.md +1 -1
  80. package/prompts/stages/skills/refine.md +1 -1
  81. package/shared/README.md +22 -18
  82. package/shared/bindings.yaml +10 -2
  83. package/shared/contracts-history.md +24 -0
  84. package/shared/contracts.md +1538 -1803
  85. package/shared/providers.yaml +8 -1
  86. package/shared/registry.yaml +7 -8
  87. package/shared/schemas/inputs/review-submit-batch.schema.json +66 -0
  88. package/shared/schemas/outputs/pr-review-checkout.schema.json +69 -0
  89. package/shared/schemas/outputs/pr-review-cleanup.schema.json +54 -0
  90. package/shared/schemas/outputs/pr-review-submit.schema.json +64 -0
  91. package/extension/doors/learnCode.ts +0 -100
  92. package/extension/doors/learnDocs.ts +0 -100
  93. package/extension/doors/prReviewLocal.ts +0 -229
@@ -1,4 +1,4 @@
1
- You are running perk skills create --from — authoring a NEW repo-specific skill seeded from a source document. Follow the perk-skill-author skill.
1
+ You are running perk skills create --from — authoring a NEW repo-specific skill seeded from a source document. Follow the `perk-skill-author` skill (read `.agents/skills/perk-skill-author/SKILL.md`).
2
2
 
3
3
  1. The skill directory `{{ repo_skills_rel }}/{{ skill_name }}/` has already been scaffolded with a TODO `SKILL.md` at `{{ skill_path }}`. You will replace the scaffold, authoring the skill FROM the source below.
4
4
  {% if seed_url %}
@@ -1,4 +1,4 @@
1
- You are running perk skills create — authoring a NEW repo-specific skill. Follow the perk-skill-author skill.
1
+ You are running perk skills create — authoring a NEW repo-specific skill. Follow the `perk-skill-author` skill (read `.agents/skills/perk-skill-author/SKILL.md`).
2
2
 
3
3
  1. The skill directory `{{ repo_skills_rel }}/{{ skill_name }}/` has already been scaffolded with a TODO `SKILL.md` at `{{ skill_path }}`. Open it and replace the scaffold.
4
4
  2. Author the skill: write a concrete, trigger-phrase `description` (the entire discovery surface — name the tasks/phrases, not a vague topic), keep `SKILL.md` lean and self-contained (heavy/reference material goes in sibling `references/`/`scripts/` files the delivery symlink carries for free), and validate the frontmatter (`name` must equal the directory segment `{{ skill_name }}`; `description` non-empty).
@@ -1,4 +1,4 @@
1
- You are running perk skills refine — improving an EXISTING repo-specific skill. Follow the perk-skill-author skill.
1
+ You are running perk skills refine — improving an EXISTING repo-specific skill. Follow the `perk-skill-author` skill (read `.agents/skills/perk-skill-author/SKILL.md`).
2
2
 
3
3
  1. Read the existing `SKILL.md` at `{{ skill_path }}` and the relevant repo context.
4
4
  2. Improve it in place: sharpen the `description` triggers (the entire discovery surface — name the tasks/phrases, not a vague topic), tighten/restructure the body, move heavy/reference material into sibling `references/`/`scripts/` files (the delivery symlink carries them for free), and re-validate the frontmatter (`name` must equal the directory segment `{{ skill_name }}`; `description` non-empty).
package/shared/README.md CHANGED
@@ -3,33 +3,37 @@
3
3
  perk's language-neutral contracts, authored once and **bundled into both build
4
4
  artifacts** (the Python wheel as package data `perk/_shared/`; the npm package under
5
5
  `shared/`). Each plane reads its *own* bundled copy at runtime — no dependency on
6
- repo layout (`Q12`).
6
+ repo layout.
7
7
 
8
- Contents (authored in **T2**):
8
+ Contents:
9
9
 
10
10
  - **`registry.yaml`** — a *parsed* contract: the stage registry (descriptor
11
- shape + the six MVP stages + graph) and the `state_keys` vocabulary. Read by both
12
- planes (`perk/substrate/registry.py`, `extension/substrate/registry.ts`); validated by
11
+ shape + stages + graph) and the `state_keys` vocabulary. Read by both
12
+ planes (`src/perk/substrate/registry.py`, `extension/substrate/registry.ts`); validated by
13
13
  `perk registry check`.
14
14
  - **`bindings.yaml`** — the second *parsed* contract: the skill-binding set
15
15
  (trigger→skill delivery, with a per-binding `nudge`/`transclude` mode). Read by both
16
- planes (`perk/substrate/bindings.py`, `extension/substrate/bindings.ts`); see `contracts.md` §8.9.
16
+ planes (`src/perk/substrate/bindings.py`, `extension/substrate/bindings.ts`); see `contracts.md` §8.9.
17
17
  - **`providers.yaml`** — the third *parsed* contract: the provider-selection supported
18
18
  set (the catalog of plan/todo/askuser/footer/web providers perk can wire, with each entry's `package` /
19
19
  `adapter` / `default` / optional `package_filter`). Read by both planes
20
- (`perk/substrate/providers.py`, `extension/substrate/providers.ts`); see `contracts.md` §8.10.
21
- - **`contracts.md`** — the four *prose* specs implemented once per plane: the
20
+ (`src/perk/substrate/providers.py`, `extension/substrate/providers.ts`); see `contracts.md` §8.10.
21
+ - **`contracts.md`** — the numbered *prose* contract sections (`§8.1`–`§8.38`,
22
+ non-contiguous: `§8.8` is skipped and `§8.6a` exists), each pinning the exact
23
+ names/paths/shapes both planes implement against. The founding four — the
22
24
  `.perk/workflow/` layout, the `PERK_RUN_ID` protocol, the `perk:workflow-state`
23
- schema, and the GitHub gateway contract.
24
- - **`contracts-history.md`** — the relocated chronological `Status (…)` changelog
25
- sibling of the prose spec, grouped by `§N.M` anchor (keeps `contracts.md` a compact
26
- current-spec document).
27
- - **`schemas/`** — published JSON Schemas for perk's boundary models (the shared-YAML
28
- parse contracts, the machine batch inputs, and the `--json` output envelopes),
29
- generated from the Pydantic models in `perk/boundary.py` and grouped by role under
30
- `contracts/` / `inputs/` / `outputs/`. Reference artifacts bundled into both planes
31
- but read at runtime by neither; guarded against drift by
32
- `tests/test_contract_schemas.py`. See `contracts.md` §8.34.
25
+ schema, and the GitHub gateway contract — were the original seed, not the current
26
+ inventory.
27
+ - **`contracts-history.md`** the chronological `Status (…)` changelog sibling of the
28
+ prose spec, grouped by `§N.M` anchor (keeps `contracts.md` a compact current-spec
29
+ document).
30
+ - **`schemas/`** committed **golden snapshots** of perk's boundary models (the
31
+ shared-YAML parse contracts, the machine batch inputs, and the `--json` output
32
+ envelopes), generated from the Pydantic models in `perk/boundary.py` and grouped by
33
+ role under `contracts/` / `inputs/` / `outputs/`. Their function is making
34
+ machine-surface shape changes reviewable in PRs: bundled into both artifacts, read at
35
+ runtime by neither, drift-guarded by `tests/test_contract_schemas.py`. See
36
+ `contracts.md` §8.34.
33
37
 
34
- Resolution is proven by T1's per-plane resolvers (`perk/_resources.py`,
38
+ Resolution goes through the per-plane resolvers (`src/perk/_resources.py`,
35
39
  `extension/substrate/resources.ts`): installed bundle → editable repo-sibling fallback.
@@ -20,8 +20,10 @@
20
20
  # trigger — the "<kind>:<id>" string above.
21
21
  # skill — the skill name (a skills/*/ dir name today).
22
22
  # mode — per-binding delivery mode:
23
- # nudge — deliver a short pointer to follow the named skill (the skill
24
- # body stays ambient / Pi-discovered).
23
+ # nudge — deliver a short pointer to follow the named skill. The pointer
24
+ # carries the skill's read path (.agents/skills/<skill>/SKILL.md):
25
+ # perk's own stage skills are hidden from the ambient system prompt
26
+ # (disable-model-invocation: true) and are reached only through it.
25
27
  # transclude — inline the skill body into the prompt/context.
26
28
  # mode is per-binding (not global): one skill may be a nudge at one trigger
27
29
  # and a transclude at another.
@@ -68,6 +70,12 @@ bindings:
68
70
  - trigger: "command:pr-review"
69
71
  skill: perk-pr-review
70
72
  mode: nudge
73
+ - trigger: "command:pr-review-terminal"
74
+ skill: perk-pr-review-terminal
75
+ mode: nudge
76
+ - trigger: "command:pr-review-browser"
77
+ skill: perk-pr-review-browser
78
+ mode: nudge
71
79
  - trigger: "command:skills-create"
72
80
  skill: perk-skill-author
73
81
  mode: nudge
@@ -401,6 +401,30 @@ bundled — the Python wheel as package data `perk/_shared/`, the npm package un
401
401
  > selection** — it is pi-web-access-specific (it depends on `fetch_content`'s GitHub-clone path),
402
402
  > documented and not re-homed. Catalog entries carry no `package_filter` (each package's sole
403
403
  > extension is its root `./index.ts`, verified via `npm view <pkg> pi`).
404
+ >
405
+ > **Status (review — the sixth seam, the first DISPATCH seam; RETIRED 2026-07, Objective #1261
406
+ > Node 4.1):** a sixth seam, **`review`**, existed from the toolbox objective's nodes 1.x through
407
+ > 4.1 and is now **retired**. Its shape while live: the first **DISPATCH posture** — no adapter
408
+ > (the seam produces no durable artifact) and nothing to vacate (perk owned no prior guest-review
409
+ > surface); the selection drove **protocol dispatch** inside a dispatching `/review` door — which
410
+ > review surface the door drove (`hunk`, the default: the hunk session CLI handshake, with perk's
411
+ > `submit_pr_review` tool as the only posting path; or `plannotator-review`: the `code-review`
412
+ > `pi.events` bridge behind an `open_plannotator_review` tool plus the agent-driven
413
+ > external-annotations HTTP stream, with the UI's native platform-posting as the GitHub path) and
414
+ > which posting path was primary. The default `hunk` was the first `default: true` entry whose
415
+ > substrate is an **external CLI** (npm `hunkdiff`) rather than a Pi package;
416
+ > `plannotator-review` shared `npm:@plannotator/pi-extension` with `plannotator-plan`, the
417
+ > cross-seam instance of the desired-**union** package convergence. **The retirement (Node 4.1):**
418
+ > once the surface-named doors (`/pr-review-terminal`, `/pr-review-browser`) absorbed both arms
419
+ > (nodes 2.1–3.1), the dispatch had no job left — the command IS the selection. `/review`, its
420
+ > dispatch, `open_plannotator_review`, and the seam rows were deleted; `SEAMS`/`PROVIDER_SEAMS`
421
+ > shrank back to five; the retired `[providers] review` key got the legacy-tripwire treatment
422
+ > (hard-fail on the Python plane, silent-ignore on the TS plane); the hunk-CLI init/doctor
423
+ > handling was already unconditional (a review *surface*, not a selection consequence) and is
424
+ > unchanged; the plannotator package is desired via `plannotator-plan` alone (the union mechanism
425
+ > stays generic, its only cross-seam instance retired). `submit_pr_review` re-homed to
426
+ > `extension/doors/submitPrReview.ts` with an unchanged contract; the `perk-review` skill split
427
+ > into `perk-pr-review-terminal` + `perk-pr-review-browser`.
404
428
 
405
429
  ## §8.31 · The prompt render seam + golden parity (Objective #791, Node 1.2)
406
430