@aperant/framework 0.16.0 → 0.19.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.
- package/CHANGELOG.md +185 -1
- package/dist/cli/commands/ci-watch.mjs +49 -2
- package/dist/cli/commands/ci-watch.mjs.map +1 -1
- package/dist/cli/commands/commit.mjs +3 -3
- package/dist/cli/commands/commit.mjs.map +1 -1
- package/dist/cli/commands/event.mjs +16 -16
- package/dist/cli/commands/event.mjs.map +1 -1
- package/dist/cli/commands/merge-integrate.mjs +3 -3
- package/dist/cli/commands/merge-integrate.mjs.map +1 -1
- package/dist/cli/commands/produce.d.mts +9 -0
- package/dist/cli/commands/produce.d.mts.map +1 -0
- package/dist/cli/commands/produce.mjs +1345 -0
- package/dist/cli/commands/produce.mjs.map +1 -0
- package/dist/cli/commands/spar-resolve-partner.d.mts +9 -0
- package/dist/cli/commands/spar-resolve-partner.d.mts.map +1 -0
- package/dist/cli/commands/spar-resolve-partner.mjs +82 -0
- package/dist/cli/commands/spar-resolve-partner.mjs.map +1 -0
- package/dist/cli/commands/task.d.mts +16 -1
- package/dist/cli/commands/task.d.mts.map +1 -1
- package/dist/cli/commands/task.mjs +434 -266
- package/dist/cli/commands/task.mjs.map +1 -1
- package/dist/cli/config/gitignore-drift.d.mts.map +1 -1
- package/dist/cli/config/gitignore-drift.mjs +1 -0
- package/dist/cli/config/gitignore-drift.mjs.map +1 -1
- package/dist/cli/config/post-merge-sweep.d.mts.map +1 -1
- package/dist/cli/config/post-merge-sweep.mjs +1 -0
- package/dist/cli/config/post-merge-sweep.mjs.map +1 -1
- package/dist/cli/coordination/auto-emit-artifact-ready.mjs +5 -5
- package/dist/cli/coordination/auto-emit-artifact-ready.mjs.map +1 -1
- package/dist/cli/coordination/event-schema.d.mts +5 -3
- package/dist/cli/coordination/event-schema.d.mts.map +1 -1
- package/dist/cli/coordination/event-schema.mjs +245 -21
- package/dist/cli/coordination/event-schema.mjs.map +1 -1
- package/dist/cli/coordination/store.d.mts +2 -2
- package/dist/cli/coordination/store.mjs +4 -4
- package/dist/cli/coordination/store.mjs.map +1 -1
- package/dist/cli/dispatch.d.mts.map +1 -1
- package/dist/cli/dispatch.mjs +4 -0
- package/dist/cli/dispatch.mjs.map +1 -1
- package/dist/cli/help.d.mts.map +1 -1
- package/dist/cli/help.mjs +31 -0
- package/dist/cli/help.mjs.map +1 -1
- package/dist/cli/host/codex-config.d.mts +78 -0
- package/dist/cli/host/codex-config.d.mts.map +1 -0
- package/dist/cli/host/codex-config.mjs +169 -0
- package/dist/cli/host/codex-config.mjs.map +1 -0
- package/dist/cli/install/legacy-paths.d.mts.map +1 -1
- package/dist/cli/install/legacy-paths.mjs +2 -0
- package/dist/cli/install/legacy-paths.mjs.map +1 -1
- package/dist/cli/produce/blind-probe.d.mts +85 -0
- package/dist/cli/produce/blind-probe.d.mts.map +1 -0
- package/dist/cli/produce/blind-probe.mjs +217 -0
- package/dist/cli/produce/blind-probe.mjs.map +1 -0
- package/dist/cli/produce/claim.d.mts +188 -0
- package/dist/cli/produce/claim.d.mts.map +1 -0
- package/dist/cli/produce/claim.mjs +518 -0
- package/dist/cli/produce/claim.mjs.map +1 -0
- package/dist/cli/produce/done-gate.d.mts +87 -0
- package/dist/cli/produce/done-gate.d.mts.map +1 -0
- package/dist/cli/produce/done-gate.mjs +200 -0
- package/dist/cli/produce/done-gate.mjs.map +1 -0
- package/dist/cli/produce/events.d.mts +77 -0
- package/dist/cli/produce/events.d.mts.map +1 -0
- package/dist/cli/produce/events.mjs +126 -0
- package/dist/cli/produce/events.mjs.map +1 -0
- package/dist/cli/produce/evidence-oracle.d.mts +63 -0
- package/dist/cli/produce/evidence-oracle.d.mts.map +1 -0
- package/dist/cli/produce/evidence-oracle.mjs +122 -0
- package/dist/cli/produce/evidence-oracle.mjs.map +1 -0
- package/dist/cli/produce/ledger.d.mts +140 -0
- package/dist/cli/produce/ledger.d.mts.map +1 -0
- package/dist/cli/produce/ledger.mjs +272 -0
- package/dist/cli/produce/ledger.mjs.map +1 -0
- package/dist/cli/produce/probe-family.d.mts +53 -0
- package/dist/cli/produce/probe-family.d.mts.map +1 -0
- package/dist/cli/produce/probe-family.mjs +160 -0
- package/dist/cli/produce/probe-family.mjs.map +1 -0
- package/dist/cli/produce/projection.d.mts +55 -0
- package/dist/cli/produce/projection.d.mts.map +1 -0
- package/dist/cli/produce/projection.mjs +97 -0
- package/dist/cli/produce/projection.mjs.map +1 -0
- package/dist/cli/produce/run-id.d.mts +42 -0
- package/dist/cli/produce/run-id.d.mts.map +1 -0
- package/dist/cli/produce/run-id.mjs +79 -0
- package/dist/cli/produce/run-id.mjs.map +1 -0
- package/dist/cli/produce/saga.d.mts +180 -0
- package/dist/cli/produce/saga.d.mts.map +1 -0
- package/dist/cli/produce/saga.mjs +290 -0
- package/dist/cli/produce/saga.mjs.map +1 -0
- package/dist/cli/produce/scheduler.d.mts +165 -0
- package/dist/cli/produce/scheduler.d.mts.map +1 -0
- package/dist/cli/produce/scheduler.mjs +399 -0
- package/dist/cli/produce/scheduler.mjs.map +1 -0
- package/dist/cli/produce/setpoint.d.mts +52 -0
- package/dist/cli/produce/setpoint.d.mts.map +1 -0
- package/dist/cli/produce/setpoint.mjs +113 -0
- package/dist/cli/produce/setpoint.mjs.map +1 -0
- package/dist/cli/produce/verification-ttl.d.mts +75 -0
- package/dist/cli/produce/verification-ttl.d.mts.map +1 -0
- package/dist/cli/produce/verification-ttl.mjs +169 -0
- package/dist/cli/produce/verification-ttl.mjs.map +1 -0
- package/dist/cli/roadmap/{conductor-view.d.mts → showrunner-view.d.mts} +3 -3
- package/dist/cli/roadmap/showrunner-view.d.mts.map +1 -0
- package/dist/cli/roadmap/{conductor-view.mjs → showrunner-view.mjs} +7 -7
- package/dist/cli/roadmap/showrunner-view.mjs.map +1 -0
- package/dist/cli/wfrun/run.d.mts.map +1 -1
- package/dist/cli/wfrun/run.mjs +1 -0
- package/dist/cli/wfrun/run.mjs.map +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +2 -1
- package/dist/plugin/skills/apt/SKILL.md +112 -38
- package/dist/plugin/skills/apt-debug/SKILL.md +14 -24
- package/dist/plugin/skills/apt-fan-out/SKILL.md +4 -4
- package/dist/plugin/skills/apt-handoff/SKILL.md +1 -1
- package/dist/plugin/skills/apt-plan/SKILL.md +5 -5
- package/dist/plugin/skills/apt-plan/adapters/{conductor.md → showrunner.md} +16 -16
- package/dist/plugin/skills/apt-produce/SKILL.md +606 -0
- package/dist/plugin/skills/apt-quick/SKILL.md +14 -22
- package/dist/plugin/skills/apt-run/SKILL.md +126 -3
- package/dist/plugin/skills/apt-ship/SKILL.md +2 -0
- package/dist/plugin/skills/apt-spar/SKILL.md +19 -9
- package/dist/plugin/skills/apt-watch-ci/SKILL.md +4 -4
- package/package.json +4 -4
- package/prompts/{conductor-framework-context.md → showrunner-framework-context.md} +1 -1
- package/prompts/{conductor-status-check.md → showrunner-status-check.md} +1 -1
- package/prompts/{conductor-sub-agent.md → showrunner-sub-agent.md} +6 -6
- package/prompts/{conductor-system.md → showrunner-system.md} +8 -8
- package/skills/apt/SKILL.md +112 -38
- package/skills/apt-debug/SKILL.md +14 -24
- package/skills/apt-fan-out/SKILL.md +4 -4
- package/skills/apt-handoff/SKILL.md +1 -1
- package/skills/apt-plan/SKILL.md +5 -5
- package/skills/apt-plan/adapters/{conductor.md → showrunner.md} +16 -16
- package/skills/apt-produce/SKILL.md +606 -0
- package/skills/apt-quick/SKILL.md +14 -22
- package/skills/apt-run/SKILL.md +126 -3
- package/skills/apt-ship/SKILL.md +2 -0
- package/skills/apt-spar/SKILL.md +19 -9
- package/skills/apt-watch-ci/SKILL.md +4 -4
- package/src/cli/commands/ci-watch.mjs +51 -2
- package/src/cli/commands/commit.mjs +3 -3
- package/src/cli/commands/event.mjs +16 -16
- package/src/cli/commands/merge-integrate.mjs +3 -3
- package/src/cli/commands/produce.mjs +1466 -0
- package/src/cli/commands/spar-resolve-partner.mjs +85 -0
- package/src/cli/commands/task.mjs +482 -285
- package/src/cli/config/gitignore-drift.mjs +1 -0
- package/src/cli/config/post-merge-sweep.mjs +1 -0
- package/src/cli/coordination/auto-emit-artifact-ready.mjs +5 -5
- package/src/cli/coordination/event-schema.d.ts +4 -2
- package/src/cli/coordination/event-schema.mjs +276 -21
- package/src/cli/coordination/store.mjs +4 -4
- package/src/cli/dispatch.mjs +4 -0
- package/src/cli/help.mjs +31 -0
- package/src/cli/host/codex-config.mjs +165 -0
- package/src/cli/install/legacy-paths.mjs +2 -0
- package/src/cli/produce/blind-probe.mjs +245 -0
- package/src/cli/produce/claim.mjs +543 -0
- package/src/cli/produce/done-gate.mjs +238 -0
- package/src/cli/produce/events.mjs +131 -0
- package/src/cli/produce/evidence-oracle.mjs +133 -0
- package/src/cli/produce/ledger.mjs +284 -0
- package/src/cli/produce/probe-family.mjs +168 -0
- package/src/cli/produce/projection.mjs +105 -0
- package/src/cli/produce/run-id.mjs +84 -0
- package/src/cli/produce/saga.mjs +303 -0
- package/src/cli/produce/scheduler.mjs +423 -0
- package/src/cli/produce/setpoint.mjs +122 -0
- package/src/cli/produce/verification-ttl.mjs +191 -0
- package/src/cli/roadmap/showrunner-view.d.ts +10 -0
- package/src/cli/roadmap/{conductor-view.mjs → showrunner-view.mjs} +6 -6
- package/src/cli/wfrun/run.mjs +1 -0
- package/dist/cli/roadmap/conductor-view.d.mts.map +0 -1
- package/dist/cli/roadmap/conductor-view.mjs.map +0 -1
- package/src/cli/roadmap/conductor-view.d.ts +0 -10
package/skills/apt/SKILL.md
CHANGED
|
@@ -17,7 +17,7 @@ execution_modes:
|
|
|
17
17
|
- plan-mode
|
|
18
18
|
- plan-only
|
|
19
19
|
- research
|
|
20
|
-
allowed-tools: "Bash, Read, Grep, Glob,
|
|
20
|
+
allowed-tools: "Bash, Read, Grep, Glob, Task"
|
|
21
21
|
argument-hint: "[free-text task or /apt <skill> …]"
|
|
22
22
|
gates: []
|
|
23
23
|
---
|
|
@@ -234,12 +234,19 @@ Resolve the track, then create a fresh task record before invoking the skill.
|
|
|
234
234
|
- `plan` → `STANDARD`
|
|
235
235
|
- everything else with `task_context: create-new` → `STANDARD`
|
|
236
236
|
|
|
237
|
-
Then run:
|
|
237
|
+
Then run the deterministic allocator (NOT raw `task create`):
|
|
238
238
|
|
|
239
239
|
```bash
|
|
240
|
-
node packages/framework/bin/apt-tools.mjs task
|
|
240
|
+
node packages/framework/bin/apt-tools.mjs task ensure . --description "{slug}" --intent create-new --track {track} --autonomy {autonomy} [--scope {scope}]
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
+
`task ensure --intent create-new` is idempotent (re-running the same
|
|
244
|
+
input returns the SAME task + worktree, `reused: true`) and resolves the
|
|
245
|
+
effective autonomy from `config.autonomy.default` BEFORE provisioning the
|
|
246
|
+
worktree — so allocation is host-agnostic and never depends on this prose
|
|
247
|
+
being followed. The `allocation_intent` here is `create-new` because the
|
|
248
|
+
skill's `task_context` is `create-new` (the four-value taxonomy maps 1:1).
|
|
249
|
+
|
|
243
250
|
**Security note:** Do NOT interpolate `{skill_args}` directly into `--description "..."`. `skill_args` is verbatim user input and can contain double-quote characters that break out of the argument boundary and inject extra flags (e.g. `--autonomy`, `--scope`). The task slug is sufficient as the description; `skill_args` is passed to the skill separately after the task record is created.
|
|
244
251
|
|
|
245
252
|
(Use `--scope framework` only when the user is on a framework-scoped task —
|
|
@@ -300,29 +307,41 @@ The router emitted a `classify` envelope. This is the main routing path —
|
|
|
300
307
|
all free-text input and every flag-override (--quick/--deep/--debug) lands
|
|
301
308
|
here.
|
|
302
309
|
|
|
303
|
-
###
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
310
|
+
### allocation_intent — the single LLM bit (decide FIRST, before picking a skill)
|
|
311
|
+
|
|
312
|
+
The ONLY allocation judgment you make on the free-text path is a single
|
|
313
|
+
schema-bounded `allocation_intent ∈ {create-new | require-existing |
|
|
314
|
+
self-managed | none}` (the SAME four-value taxonomy as skill `task_context`).
|
|
315
|
+
**Fail-closed default is `none`** — when in doubt, allocate nothing. There is
|
|
316
|
+
no separate prose-only brainstorm gate that can bypass allocation; the
|
|
317
|
+
brainstorm decision is just the `none` outcome of this one judgment.
|
|
318
|
+
|
|
319
|
+
Map the user's input to one bit:
|
|
320
|
+
|
|
321
|
+
- **`none`** — vision / exploration / investigation / status / help. The user
|
|
322
|
+
wants to *explore a vision* or *ask a question*, not commit to a work item.
|
|
323
|
+
Allocate NOTHING (no task, no worktree) and dispatch to `apt:discuss
|
|
324
|
+
--brainstorm` (or the picked investigative skill). Signals — any one →
|
|
325
|
+
`none`:
|
|
326
|
+
- Vision statements: *"here's what I want to build"*, *"my goal is..."*, *"the idea is..."*
|
|
327
|
+
- Open invitations: *"let's think about"*, *"let's brainstorm"*, *"help me figure out"*, *"what's the best way..."*
|
|
328
|
+
- Paragraph-shaped input describing an outcome or direction, not a single work item
|
|
329
|
+
- Explicit "before we plan, let's explore / think / brainstorm..."
|
|
330
|
+
|
|
331
|
+
How to hand off:
|
|
332
|
+
```
|
|
333
|
+
[APT] allocation_intent=none (brainstorm/investigation) — routing to /apt:discuss --brainstorm
|
|
334
|
+
```
|
|
335
|
+
Then invoke `/apt:discuss --brainstorm` with the user's input and stop.
|
|
336
|
+
|
|
337
|
+
- **`self-managed`** — the picked skill owns its own task/worktree lifecycle
|
|
338
|
+
(e.g. `apt:run`, `apt:pr-review`). Allocate nothing here; let the skill do it.
|
|
339
|
+
- **`require-existing`** — the user is continuing an existing task. Do NOT mint;
|
|
340
|
+
resolve the active task (Step 2 uses `task ensure --intent require-existing`).
|
|
341
|
+
- **`create-new`** — concrete work item / specific deliverable that needs a
|
|
342
|
+
fresh task + worktree. Examples: *"add OAuth login"*, *"fix the view-tracking
|
|
343
|
+
bug"*, *"migrate reports to JSONB"*. Continue to Step 0; Step 2 provisions
|
|
344
|
+
deterministically via `task ensure --intent create-new`.
|
|
326
345
|
|
|
327
346
|
### Step 0a: Flag-override fast path (envelope.track is set)
|
|
328
347
|
|
|
@@ -332,6 +351,15 @@ carries `track`, `primary_skill`, `spawn_agent`, `agent`, and `options`.
|
|
|
332
351
|
**Skip Step 0b and Step 0c — go straight to Step 1.** These were locked
|
|
333
352
|
by the user typing `--quick` / `--deep` / `--debug`, not by the host LLM.
|
|
334
353
|
|
|
354
|
+
**allocation_intent (flag-override is deterministic — no LLM judgment):**
|
|
355
|
+
map `primary_skill` → `allocation_intent`:
|
|
356
|
+
- `quick` → `create-new`
|
|
357
|
+
- `debug` → `create-new`
|
|
358
|
+
- `plan` → `create-new` (STANDARD / DEEP)
|
|
359
|
+
- a skill whose `task_context` is `self-managed` (e.g. `run`) → `self-managed`
|
|
360
|
+
|
|
361
|
+
Step 2 forwards this bit to `task ensure --intent <bit>`.
|
|
362
|
+
|
|
335
363
|
### Step 0b: Classify the skill (envelope.skills[] inline pick)
|
|
336
364
|
|
|
337
365
|
When `classification.source: "host-model-deferred"` (free-text path),
|
|
@@ -405,15 +433,31 @@ Map choice: full auto → `execution_mode = "auto"`, step by step → `"step"`,
|
|
|
405
433
|
|
|
406
434
|
If `needs_autonomy_prompt` is false (user passed --yolo/--autonomous), skip this — use `execution_mode` from route result.
|
|
407
435
|
|
|
408
|
-
### Step 2: Register Task
|
|
436
|
+
### Step 2: Register Task (deterministic allocation)
|
|
437
|
+
|
|
438
|
+
Forward the `allocation_intent` decided above (Step 0a flag-override map,
|
|
439
|
+
or the free-text bit from the allocation_intent section) to the
|
|
440
|
+
deterministic, idempotent allocator — NOT raw `task create`:
|
|
409
441
|
|
|
410
442
|
```bash
|
|
411
|
-
node packages/framework/bin/apt-tools.mjs task
|
|
443
|
+
node packages/framework/bin/apt-tools.mjs task ensure . --description "{task_description}" --intent {allocation_intent} --track {track} --autonomy {autonomy}
|
|
412
444
|
```
|
|
413
445
|
|
|
446
|
+
- `--intent create-new` provisions a fresh task + worktree, idempotent on
|
|
447
|
+
re-run (`reused: true` returns the SAME task/worktree — re-issuing `/apt`
|
|
448
|
+
never duplicates). Effective autonomy is resolved from
|
|
449
|
+
`config.autonomy.default` BEFORE the worktree hook, so a
|
|
450
|
+
`from_branch: current` base is not spuriously deferred.
|
|
451
|
+
- `--intent require-existing` resolves the active task WITHOUT minting
|
|
452
|
+
(returns `requires_input` on ambiguity — fall back to the
|
|
453
|
+
skill-passthrough resolution chain prompt).
|
|
454
|
+
- `--intent none` / `--intent self-managed` allocate nothing
|
|
455
|
+
(`allocated: false`) — you should already have dispatched per the
|
|
456
|
+
allocation_intent section above and not reached Step 2.
|
|
457
|
+
|
|
414
458
|
Parse `task_id`, `task_dir`, and (if present) `worktree.worktree_path` / `worktree.branch` / `worktree.base_branch` from the result.
|
|
415
459
|
|
|
416
|
-
**Task-level worktree isolation:** when `task_isolation.worktree_per_task` is enabled (check via `host_capabilities.worktrees` + `task_isolation` in the route result) and `task
|
|
460
|
+
**Task-level worktree isolation:** when `task_isolation.worktree_per_task` is enabled (check via `host_capabilities.worktrees` + `task_isolation` in the route result) and `task ensure` returns a `worktree` block, every subsequent Bash call AND every spawned agent in this pipeline MUST use `worktree_path` as its working directory. Print:
|
|
417
461
|
|
|
418
462
|
```
|
|
419
463
|
[APT] Working in isolated worktree: {worktree_path}
|
|
@@ -424,7 +468,7 @@ Important nuances:
|
|
|
424
468
|
- `task_dir` is an **absolute path** under the main repo's `.aperant/tasks/{task-id}/`. All spec/plan/progress artifacts live there and are shared across worktrees.
|
|
425
469
|
- `apt-tools` commands still receive the **project root** as `<project-dir>` — they coordinate state through the main repo's `.aperant/`. The worktree only affects *code editing* cwd.
|
|
426
470
|
- When spawning an agent, set its `cwd` (or prefix its Bash calls with `cd {worktree_path} &&`) to the worktree for code reads/edits. Pass `worktree_path` in the agent's context so it knows where code work happens.
|
|
427
|
-
- Planner artifact safety: do **not** spawn `apt-planner` with host-level worktree isolation that gives it a separate copied repo. The planner must write `spec.md` and `implementation_plan.json` to the absolute main-repo `task_dir` from `task
|
|
471
|
+
- Planner artifact safety: do **not** spawn `apt-planner` with host-level worktree isolation that gives it a separate copied repo. The planner must write `spec.md` and `implementation_plan.json` to the absolute main-repo `task_dir` from `task ensure`; `.aperant/tasks/**` is gitignored, so artifacts written under a disposable worktree can be invisible to git and lost when that worktree is cleaned.
|
|
428
472
|
- If no `worktree` block is returned, proceed in the project root as before.
|
|
429
473
|
|
|
430
474
|
### Step 3: Spawn Planner Agent
|
|
@@ -482,14 +526,44 @@ tally output. Skip silently if tokens tally errors — never block the
|
|
|
482
526
|
pipeline on telemetry.
|
|
483
527
|
|
|
484
528
|
**If `spawn_agent` is false (QUICK or DEBUG):**
|
|
485
|
-
Both QUICK and DEBUG resolve here (single-shot, no spawned phase agent).
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
529
|
+
Both QUICK and DEBUG resolve here (single-shot, no spawned phase agent).
|
|
530
|
+
|
|
531
|
+
**The router itself CANNOT edit code.** Its frontmatter `allowed-tools` is
|
|
532
|
+
`Bash, Read, Grep, Glob, Task` — it has NO `Write` / `Edit` tool. This is the
|
|
533
|
+
load-bearing boundary (ID-05): the router can classify, allocate
|
|
534
|
+
(`task ensure`), and dispatch, but it can never edit a file on `main`.
|
|
535
|
+
|
|
536
|
+
So do NOT edit inline. **INVOKE the `apt:quick` / `apt:debug` SKILL** (per
|
|
537
|
+
`primary_skill`) AFTER Step 2's `task ensure --intent create-new` has
|
|
538
|
+
provisioned the worktree. Invoking the skill establishes that skill's OWN
|
|
539
|
+
`allowed-tools` scope (`apt-quick` / `apt-debug` both carry
|
|
540
|
+
`Read, Write, Edit, Bash, Grep, Glob`), which RE-GRANTS the edit affordance —
|
|
541
|
+
but only once a worktree exists, so editing can never land on `main` through
|
|
542
|
+
the router. Pass `task_id`, `task_dir`, AND `worktree_path` into the invoked
|
|
543
|
+
skill's context (thread `worktree_path` the same way the `spawn_agent: true`
|
|
544
|
+
branch threads it into the planner). This is a SKILL invocation, NOT a `Task`
|
|
545
|
+
sub-agent spawn — QUICK/DEBUG stay single-agent/single-context, so the Fast
|
|
546
|
+
Path Guarantee is preserved. No phase marker. (If Step 2 returned no `worktree`
|
|
547
|
+
block, pass `worktree_path` as "none" and the skill proceeds in the project
|
|
548
|
+
root.)
|
|
549
|
+
|
|
550
|
+
> **inline vs skill-scope (read this).** "Inline" here means the OLD behavior:
|
|
551
|
+
> the router editing within its own `/apt` turn under the router's allowlist.
|
|
552
|
+
> That is gone — the router has no edit tool. "Skill-scope" is the NEW
|
|
553
|
+
> behavior: a genuine `apt:quick` / `apt:debug` invocation whose own
|
|
554
|
+
> `allowed-tools` re-grants `Write, Edit` for the edit work, after the worktree
|
|
555
|
+
> exists.
|
|
556
|
+
>
|
|
557
|
+
> **Residual (host-runtime, not CI-provable — founder smoke-test gate).**
|
|
558
|
+
> Whether Claude Code treats a nested skill's `allowed-tools` as a REPLACEMENT
|
|
559
|
+
> (re-grants edit — design holds) or as an INTERSECTION/ceiling (the parent
|
|
560
|
+
> router allowlist caps the child — Fast Path breaks) is a host-implementation
|
|
561
|
+
> property that cannot be unit-tested from the framework. CI proves the
|
|
562
|
+
> frontmatter/prose structure; a founder in-app smoke-test is the residual gate.
|
|
563
|
+
> **Fallback if the smoke-test shows breakage:** revert ONLY the
|
|
564
|
+
> router-frontmatter line (re-add `Write, Edit`). The host-agnostic
|
|
565
|
+
> `task ensure` boundary (ID-02) still fixes the on-`main`-edit bug; the
|
|
566
|
+
> allowed-tools removal is hardening, not the fix.
|
|
493
567
|
|
|
494
568
|
### Step 4: Chain Pipeline (based on selected option)
|
|
495
569
|
|
|
@@ -42,7 +42,7 @@ reproduction, so loading this appendix is non-trivial.
|
|
|
42
42
|
- **apt-tools path:** `node packages/framework/bin/apt-tools.mjs` or the locally installed `apt-tools` binary
|
|
43
43
|
- **Constitution:** Read `AGENTS.md` in the project root if it exists
|
|
44
44
|
- **Debug sessions:** `.aperant/debug/{session-id}/DEBUG.md`
|
|
45
|
-
- **Task-level worktree isolation:** A worktree is provisioned at session start by `task
|
|
45
|
+
- **Task-level worktree isolation:** A worktree is provisioned at session start by `task ensure` (track-agnostic — DEBUG gets one too; parsed + banner-announced in §1a) when `task_isolation.worktree_per_task` is enabled. Read-only investigation (Sections 2-3 Observe / Hypothesize — `git log`, `git diff`, Grep, Read) may run from EITHER cwd; they only read. But once code changes begin — Section 4 (Checkpoint), Section 5b (Execute Test — the minimal change), Section 6b (Implement Fix + commit) — run those Bash commands with `cd {worktree_path} &&` so the fix + checkpoint commits land on the worktree's task branch. Use the `worktree_path` the router passed in skill context or that §1a parsed from `task ensure`'s envelope. `apt-tools` calls always take the project root as `<project-dir>`. If no `worktree` block was returned, proceed in the project root as before.
|
|
46
46
|
</your_environment>
|
|
47
47
|
|
|
48
48
|
<state_files>
|
|
@@ -71,35 +71,25 @@ If resuming, read DEBUG.md and skip to the current phase (observe/hypothesize/te
|
|
|
71
71
|
|
|
72
72
|
### 1a. Resolve canonical task id (idempotent — new sessions only)
|
|
73
73
|
|
|
74
|
-
DEBUG now produces a canonical state.active_tasks record so `/apt:ship` can find the task via the lite ship profile once the fix is committed.
|
|
74
|
+
DEBUG now produces a canonical state.active_tasks record so `/apt:ship` can find the task via the lite ship profile once the fix is committed. Idempotency is owned by the deterministic allocator `apt-tools task ensure --intent create-new` (NOT raw `task create`) — re-running returns the SAME task + worktree (`reused: true`), so the old `task get` guard dance is gone.
|
|
75
75
|
|
|
76
76
|
Two invocation paths converge here:
|
|
77
77
|
|
|
78
|
-
- **Router path** (`/apt` → `/apt:debug`): the router has already
|
|
79
|
-
|
|
78
|
+
- **Router path** (`/apt` → `/apt:debug`): the router has already run `task ensure --intent create-new` and injected `task_id` (+ `worktree_path`) into your skill context. Re-affirm idempotently with the same id and adopt `task_id` as `{session-id}`:
|
|
79
|
+
```bash
|
|
80
|
+
apt-tools task ensure . --description "$ARGUMENTS" --intent create-new --track DEBUG --id {task_id}
|
|
81
|
+
```
|
|
82
|
+
The `--id {task_id}` makes ensure resolve to the EXACT record the router just provisioned (`reused: true`) — no second task, no second worktree.
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
- **Direct path** (`/apt:debug foo`): no `task_id` in context — allocate now:
|
|
85
|
+
```bash
|
|
86
|
+
apt-tools task ensure . --description "$ARGUMENTS" --intent create-new --track DEBUG
|
|
87
|
+
```
|
|
88
|
+
Parse the generated `task_id` from the envelope and adopt it as `{session-id}`. ensure is keyed on the normalized description + scope, so a retry returns the SAME canonical id (replacing the legacy `debug-YYYYMMDD-HHmm` form).
|
|
82
89
|
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
apt-tools task get . --id {task_id}
|
|
86
|
-
```
|
|
87
|
-
- If exit 0 AND the returned record has `track === "DEBUG"` → reuse, skip the create call. Adopt `task_id` as `{session-id}`.
|
|
88
|
-
- Else (record missing OR wrong track) → call:
|
|
89
|
-
```bash
|
|
90
|
-
apt-tools task create . --description "$ARGUMENTS" --track DEBUG --id {task_id}
|
|
91
|
-
```
|
|
92
|
-
Adopt the id as `{session-id}`.
|
|
93
|
-
|
|
94
|
-
2. **If no `task_id` in skill context** (direct path):
|
|
95
|
-
```bash
|
|
96
|
-
apt-tools task create . --description "$ARGUMENTS" --track DEBUG
|
|
97
|
-
```
|
|
98
|
-
Parse the generated `task_id` from the envelope and adopt it as `{session-id}`. The canonical id replaces the legacy `debug-YYYYMMDD-HHmm` form.
|
|
99
|
-
|
|
100
|
-
The debug working dir at `.aperant/debug/{session-id}/` stays — that working artifact is preserved (per spec §3 R7). The canonical task record at `.aperant/tasks/{task-id}/` is created in parallel by `task create`, and both share the same id.
|
|
90
|
+
The debug working dir at `.aperant/debug/{session-id}/` stays — that working artifact is preserved (per spec §3 R7). The canonical task record at `.aperant/tasks/{task-id}/` is created in parallel by `task ensure`, and both share the same id.
|
|
101
91
|
|
|
102
|
-
**Worktree isolation (both paths).** `task create` provisions a worktree when `task_isolation.worktree_per_task` is enabled (track-agnostic — DEBUG gets one too). Parse `worktree.worktree_path`, `worktree.branch`, and `worktree.base_branch` from the `task
|
|
92
|
+
**Worktree isolation (both paths).** `task ensure --intent create-new` provisions a worktree when `task_isolation.worktree_per_task` is enabled (track-agnostic — DEBUG gets one too). Parse `worktree.worktree_path`, `worktree.branch`, and `worktree.base_branch` from the `task ensure` envelope (direct path); on the router path the orchestrator already passed `worktree_path` into your skill context — use that. When a `worktree` block is present, print the banner:
|
|
103
93
|
|
|
104
94
|
```
|
|
105
95
|
[APT] Working in isolated worktree: {worktree_path}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: apt:fan-out
|
|
3
|
-
description: "Cross-task fan-out — spawn N apt-executor workers from one
|
|
3
|
+
description: "Cross-task fan-out — spawn N apt-executor workers from one Showrunner terminal, each in its own worktree"
|
|
4
4
|
apt-skill-version: {{APT_VERSION}}
|
|
5
5
|
stage: execute
|
|
6
6
|
intent: x-fan-out
|
|
@@ -19,7 +19,7 @@ argument-hint: "apt:fan-out --tasks <id,id,id> [--phases <m/p,m/p>] [--unblocked
|
|
|
19
19
|
gates: []
|
|
20
20
|
---
|
|
21
21
|
<objective>
|
|
22
|
-
Run N pre-planned Aperant tasks concurrently from one
|
|
22
|
+
Run N pre-planned Aperant tasks concurrently from one Showrunner terminal. This skill is a thin orchestrator over the generalized wave engine (`unit_kind: "task"` path, see ADR-0003) and the existing primitives: `apt-tools worktree create --task`, `apt-tools lock claim`, `apt-tools event append`, and the `parallelization.max_tasks` quota. No daemon, no job queue, no in-skill scheduling. The host CLI's main thread is the Showrunner (ADR-0001); each spawned apt-executor subagent runs in its own worktree (ADR-0002).
|
|
23
23
|
|
|
24
24
|
This is the "I have 16 unblocked tasks in this phase, run them all" surface. It replaces the old workaround of opening 16 sibling terminals manually.
|
|
25
25
|
</objective>
|
|
@@ -160,7 +160,7 @@ call `integrate` with the batch's task list (or `--batch ${batch_id}` to recover
|
|
|
160
160
|
it from the worker rows):
|
|
161
161
|
|
|
162
162
|
```bash
|
|
163
|
-
git -C "$
|
|
163
|
+
git -C "$showrunner_root" fetch origin "$base_branch"
|
|
164
164
|
node packages/framework/bin/apt-tools.mjs merge integrate . --tasks ${task_ids_csv}
|
|
165
165
|
# OR recover the task list from the batch's worker rows:
|
|
166
166
|
node packages/framework/bin/apt-tools.mjs merge integrate . --batch ${batch_id}
|
|
@@ -213,7 +213,7 @@ Mix SHIPPED / BLOCKED / in-flight variants in the same rail. Below the panel, em
|
|
|
213
213
|
|
|
214
214
|
## Design references
|
|
215
215
|
|
|
216
|
-
- **ADR-0001** — Host CLI main thread is the
|
|
216
|
+
- **ADR-0001** — Host CLI main thread is the Showrunner; no daemon, no in-skill queue.
|
|
217
217
|
- **ADR-0002** — One worktree per task; workers run independent feature branches.
|
|
218
218
|
- **ADR-0003** — Wave engine accepts `unit_kind: "task"` so cross-task fan-out reuses the same primitives as intra-task subtask waves.
|
|
219
219
|
|
|
@@ -23,7 +23,7 @@ Compact the current conversation into a HANDOFF document so a different agent
|
|
|
23
23
|
|
|
24
24
|
Writes the handoff to `.aperant/handoffs/{id}/HANDOFF.md` (or `{task_dir}/handoffs/{id}/HANDOFF.md` when inside a routed task) so the artifact lives with the repo, survives across machines, and is discoverable by `/apt:resume` and team-status tooling.
|
|
25
25
|
|
|
26
|
-
**Use when:** an agent decides to transfer the work mid-flight. Examples — sender hit context-budget cap, the next phase needs a different model (e.g. Codex for a heavy refactor), a fan-out
|
|
26
|
+
**Use when:** an agent decides to transfer the work mid-flight. Examples — sender hit context-budget cap, the next phase needs a different model (e.g. Codex for a heavy refactor), a fan-out Showrunner is sharding scope to peers, or a planning agent is handing a locked plan to an executor.
|
|
27
27
|
|
|
28
28
|
**Do NOT use when:**
|
|
29
29
|
- The human operator wants to stop — use `/apt:pause` (it stashes uncommitted work and updates `CONTINUE_INDEX.md`).
|
package/skills/apt-plan/SKILL.md
CHANGED
|
@@ -504,13 +504,13 @@ node packages/framework/bin/apt-tools.mjs commit "plan: create implementation pl
|
|
|
504
504
|
## 8a. Runtime-context adapters
|
|
505
505
|
|
|
506
506
|
If `APERANT_TERMINAL_ID` is set (you are running under the Aperant
|
|
507
|
-
|
|
508
|
-
`adapters/
|
|
509
|
-
(`proceed` / `abort` / `[
|
|
510
|
-
|
|
507
|
+
Showrunner — a master-orchestrator agent inside the Aperant app), see
|
|
508
|
+
`adapters/showrunner.md` for the plan-review handshake convention
|
|
509
|
+
(`proceed` / `abort` / `[Showrunner realignment]` stdin strings) the
|
|
510
|
+
Showrunner's drawer uses post-commit. The `artifact.ready{kind:'plan'}`
|
|
511
511
|
signal itself is now emitted automatically by the `apt-tools commit`
|
|
512
512
|
postcondition — no manual emit step required. Native invocations
|
|
513
|
-
(Claude Code, Gemini, OpenCode, Codex with no
|
|
513
|
+
(Claude Code, Gemini, OpenCode, Codex with no Showrunner context) can
|
|
514
514
|
skip the adapter entirely and proceed to Section 9.
|
|
515
515
|
|
|
516
516
|
## 9. Report
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# apt-plan adapter — Aperant
|
|
1
|
+
# apt-plan adapter — Aperant Showrunner
|
|
2
2
|
|
|
3
3
|
This adapter is **only loaded** when the planner runs under the Aperant
|
|
4
|
-
|
|
4
|
+
Showrunner (a master-orchestrator agent inside the Aperant desktop / web
|
|
5
5
|
app). Native invocations of `/apt:plan` (from plain Claude Code, Gemini
|
|
6
6
|
CLI, OpenCode, or Codex) IGNORE this file entirely — the framework
|
|
7
7
|
behavior in `SKILL.md` is the source of truth for them.
|
|
8
8
|
|
|
9
9
|
## When to load this adapter
|
|
10
10
|
|
|
11
|
-
Detect
|
|
11
|
+
Detect Showrunner context by env var:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
[ -n "$APERANT_TERMINAL_ID" ]
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
The
|
|
18
|
-
If the var is unset, you are NOT under the
|
|
17
|
+
The Showrunner injects `APERANT_TERMINAL_ID` into every PTY it spawns.
|
|
18
|
+
If the var is unset, you are NOT under the Showrunner — stop reading.
|
|
19
19
|
|
|
20
|
-
## What changes under the
|
|
20
|
+
## What changes under the Showrunner
|
|
21
21
|
|
|
22
22
|
The planner's filesystem outputs (`spec.md`, `implementation_plan.json`)
|
|
23
23
|
are unchanged. The ADDITION is one extra step after Section 8 (Persist
|
|
@@ -34,7 +34,7 @@ node packages/framework/bin/apt-tools.mjs commit "plan: ..." \
|
|
|
34
34
|
--files spec.md implementation_plan.json
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
…and the process is running under a
|
|
37
|
+
…and the process is running under a Showrunner PTY (env
|
|
38
38
|
`APERANT_TERMINAL_ID` is set), `apt-tools commit` auto-emits a fully-
|
|
39
39
|
formed `artifact.ready` envelope to `.aperant/events/{today}.jsonl`.
|
|
40
40
|
The envelope carries the `task_id`, plan path, sha256 hash, and the
|
|
@@ -47,35 +47,35 @@ framework postcondition makes it work uniformly across QUICK, STANDARD,
|
|
|
47
47
|
DEEP, and COMPLEX without violating the Fast Path Guarantee.
|
|
48
48
|
|
|
49
49
|
**Planner authors don't need to do anything.** As long as you call
|
|
50
|
-
`apt-tools commit` to land your plan artifacts, the
|
|
50
|
+
`apt-tools commit` to land your plan artifacts, the Showrunner will
|
|
51
51
|
see `artifact.ready` and the drawer's PlanReadyCard will auto-promote.
|
|
52
52
|
|
|
53
53
|
If the planner does NOT use `apt-tools commit` (it lands the plan via
|
|
54
54
|
raw `git commit` or `git add`), the auto-emit will not fire. In that
|
|
55
|
-
case the
|
|
55
|
+
case the Showrunner falls back to filesystem polling of the task dir
|
|
56
56
|
(slightly higher latency, same outcome).
|
|
57
57
|
|
|
58
|
-
### Plan-review handshake (Step 6 + 7 of
|
|
58
|
+
### Plan-review handshake (Step 6 + 7 of Showrunner v2)
|
|
59
59
|
|
|
60
60
|
After emitting `artifact.ready{kind:'plan'}` the planner SHOULD pause at
|
|
61
|
-
an idle prompt and listen for ONE of three
|
|
61
|
+
an idle prompt and listen for ONE of three Showrunner-driven inputs:
|
|
62
62
|
|
|
63
63
|
- `proceed\r` — the human (via the PlanReadyCard's **Approve** button)
|
|
64
64
|
approves the plan. Continue to `/apt:execute` as you would in the
|
|
65
65
|
normal flow.
|
|
66
66
|
- `abort\r` — the human rejected. Abandon this plan; do not start
|
|
67
67
|
execution. Optionally exit the session cleanly.
|
|
68
|
-
- `[
|
|
68
|
+
- `[Showrunner realignment] <note>\r` — the human pressed **Realign**.
|
|
69
69
|
Treat the `<note>` as additional planning context: re-open spec.md /
|
|
70
70
|
implementation_plan.json, address the note's gaps, commit a new
|
|
71
71
|
revision, and emit a fresh `artifact.ready{kind:'plan'}` (with the
|
|
72
72
|
same task_id but a NEW request_id — the drawer keys cards on
|
|
73
73
|
request_id, so re-using it would suppress the new card). The
|
|
74
|
-
realignment loop can repeat; after attempt_n >= 3 the
|
|
74
|
+
realignment loop can repeat; after attempt_n >= 3 the Showrunner may
|
|
75
75
|
decide to respawn the terminal entirely.
|
|
76
76
|
|
|
77
|
-
These exact strings are pinned by the
|
|
78
|
-
handlers (`packages/ui/src/sections/
|
|
77
|
+
These exact strings are pinned by the Showrunner's `ShowrunnerContextHost`
|
|
78
|
+
handlers (`packages/ui/src/sections/showrunner/ShowrunnerContextHost.tsx`).
|
|
79
79
|
Native CLI invocations of `/apt:plan` (no `APERANT_TERMINAL_ID`) skip
|
|
80
80
|
this handshake and follow the normal report → `/apt:execute` flow.
|
|
81
81
|
|
|
@@ -84,7 +84,7 @@ this handshake and follow the normal report → `/apt:execute` flow.
|
|
|
84
84
|
The Aperant Framework is consumed by multiple CLIs (Claude Code, Gemini,
|
|
85
85
|
OpenCode, Codex) and by the Aperant app itself. The vast majority of
|
|
86
86
|
`/apt:plan` invocations come from native CLIs — those should not see
|
|
87
|
-
or execute
|
|
87
|
+
or execute Showrunner-specific machinery. By isolating the Showrunner's
|
|
88
88
|
event-emit obligations to this adapter, the public skill stays minimal
|
|
89
89
|
and the framework remains CLI-agnostic. The pattern mirrors
|
|
90
90
|
`appendices/` (reasoning-stance loaders) but with a different semantic:
|