@aperant/framework 0.6.3 → 0.6.5
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 +61 -0
- package/README.md +64 -10
- package/agents/apt-improver.md +99 -0
- package/agents/apt-planner.md +115 -10
- package/dist/__test-helpers/run-cmd.d.mts +4 -2
- package/dist/__test-helpers/run-cmd.d.mts.map +1 -1
- package/dist/__test-helpers/run-cmd.mjs +56 -15
- package/dist/__test-helpers/run-cmd.mjs.map +1 -1
- package/dist/cli/artifacts/classification.d.mts.map +1 -1
- package/dist/cli/artifacts/classification.mjs +10 -0
- package/dist/cli/artifacts/classification.mjs.map +1 -1
- package/dist/cli/ci-watch/lock.d.mts +53 -0
- package/dist/cli/ci-watch/lock.d.mts.map +1 -0
- package/dist/cli/ci-watch/lock.mjs +172 -0
- package/dist/cli/ci-watch/lock.mjs.map +1 -0
- package/dist/cli/ci-watch/state.d.mts +36 -0
- package/dist/cli/ci-watch/state.d.mts.map +1 -0
- package/dist/cli/ci-watch/state.mjs +103 -0
- package/dist/cli/ci-watch/state.mjs.map +1 -0
- package/dist/cli/ci-watch/stop-matrix.d.mts +58 -0
- package/dist/cli/ci-watch/stop-matrix.d.mts.map +1 -0
- package/dist/cli/ci-watch/stop-matrix.mjs +164 -0
- package/dist/cli/ci-watch/stop-matrix.mjs.map +1 -0
- package/dist/cli/cli-wrappers/ci-watch.d.mts +2 -0
- package/dist/cli/cli-wrappers/ci-watch.d.mts.map +1 -0
- package/dist/cli/cli-wrappers/ci-watch.mjs +9 -0
- package/dist/cli/cli-wrappers/ci-watch.mjs.map +1 -0
- package/dist/cli/commands/adr.d.mts +5 -0
- package/dist/cli/commands/adr.d.mts.map +1 -0
- package/dist/cli/commands/adr.mjs +228 -0
- package/dist/cli/commands/adr.mjs.map +1 -0
- package/dist/cli/commands/ci-watch.d.mts +7 -0
- package/dist/cli/commands/ci-watch.d.mts.map +1 -0
- package/dist/cli/commands/ci-watch.mjs +465 -0
- package/dist/cli/commands/ci-watch.mjs.map +1 -0
- package/dist/cli/commands/context.d.mts +7 -0
- package/dist/cli/commands/context.d.mts.map +1 -0
- package/dist/cli/commands/context.mjs +224 -0
- package/dist/cli/commands/context.mjs.map +1 -0
- package/dist/cli/commands/event.d.mts.map +1 -1
- package/dist/cli/commands/event.mjs +59 -24
- package/dist/cli/commands/event.mjs.map +1 -1
- package/dist/cli/commands/host-detect.d.mts +1 -1
- package/dist/cli/commands/host-detect.d.mts.map +1 -1
- package/dist/cli/commands/host-detect.mjs +30 -3
- package/dist/cli/commands/host-detect.mjs.map +1 -1
- package/dist/cli/commands/init.d.mts.map +1 -1
- package/dist/cli/commands/init.mjs +73 -5
- package/dist/cli/commands/init.mjs.map +1 -1
- package/dist/cli/commands/modes.d.mts +13 -0
- package/dist/cli/commands/modes.d.mts.map +1 -0
- package/dist/cli/commands/modes.mjs +220 -0
- package/dist/cli/commands/modes.mjs.map +1 -0
- package/dist/cli/commands/pr-review-audit-fixer.d.mts +41 -2
- package/dist/cli/commands/pr-review-audit-fixer.d.mts.map +1 -1
- package/dist/cli/commands/pr-review-audit-fixer.mjs +91 -14
- package/dist/cli/commands/pr-review-audit-fixer.mjs.map +1 -1
- package/dist/cli/commands/route.d.mts.map +1 -1
- package/dist/cli/commands/route.mjs +11 -2
- package/dist/cli/commands/route.mjs.map +1 -1
- package/dist/cli/commands/task.d.mts.map +1 -1
- package/dist/cli/commands/task.mjs +136 -6
- package/dist/cli/commands/task.mjs.map +1 -1
- package/dist/cli/commands/tokens.d.mts.map +1 -1
- package/dist/cli/commands/tokens.mjs +150 -6
- package/dist/cli/commands/tokens.mjs.map +1 -1
- package/dist/cli/commands/triage.d.mts +8 -0
- package/dist/cli/commands/triage.d.mts.map +1 -0
- package/dist/cli/commands/triage.mjs +259 -0
- package/dist/cli/commands/triage.mjs.map +1 -0
- package/dist/cli/config/post-merge-sweep.d.mts +18 -0
- package/dist/cli/config/post-merge-sweep.d.mts.map +1 -1
- package/dist/cli/config/post-merge-sweep.mjs +48 -3
- package/dist/cli/config/post-merge-sweep.mjs.map +1 -1
- package/dist/cli/consistency/registry.d.mts +11 -0
- package/dist/cli/consistency/registry.d.mts.map +1 -1
- package/dist/cli/consistency/registry.mjs +13 -0
- package/dist/cli/consistency/registry.mjs.map +1 -1
- package/dist/cli/coordination/agent-identity.d.mts +9 -0
- package/dist/cli/coordination/agent-identity.d.mts.map +1 -1
- package/dist/cli/coordination/agent-identity.mjs +11 -0
- package/dist/cli/coordination/agent-identity.mjs.map +1 -1
- package/dist/cli/coordination/event-log.d.mts +27 -0
- package/dist/cli/coordination/event-log.d.mts.map +1 -1
- package/dist/cli/coordination/event-log.mjs +72 -2
- package/dist/cli/coordination/event-log.mjs.map +1 -1
- package/dist/cli/design/frontmatter-schema.d.mts +3 -3
- package/dist/cli/design/frontmatter-schema.d.mts.map +1 -1
- package/dist/cli/design/frontmatter-schema.mjs +3 -1
- package/dist/cli/design/frontmatter-schema.mjs.map +1 -1
- package/dist/cli/dispatch.d.mts.map +1 -1
- package/dist/cli/dispatch.mjs +14 -1
- package/dist/cli/dispatch.mjs.map +1 -1
- package/dist/cli/gate/registry.d.mts +11 -0
- package/dist/cli/gate/registry.d.mts.map +1 -1
- package/dist/cli/gate/registry.mjs +13 -0
- package/dist/cli/gate/registry.mjs.map +1 -1
- package/dist/cli/help.d.mts.map +1 -1
- package/dist/cli/help.mjs +1 -0
- package/dist/cli/help.mjs.map +1 -1
- package/dist/cli/host/detect.d.mts +1 -0
- package/dist/cli/host/detect.d.mts.map +1 -1
- package/dist/cli/host/detect.mjs +5 -0
- package/dist/cli/host/detect.mjs.map +1 -1
- package/dist/cli/route/envelope.d.mts +68 -4
- package/dist/cli/route/envelope.d.mts.map +1 -1
- package/dist/cli/route/envelope.mjs +140 -103
- package/dist/cli/route/envelope.mjs.map +1 -1
- package/dist/cli/route/skill-discover.d.mts +11 -0
- package/dist/cli/route/skill-discover.d.mts.map +1 -1
- package/dist/cli/route/skill-discover.mjs +46 -1
- package/dist/cli/route/skill-discover.mjs.map +1 -1
- package/dist/cli/skill-author/contract.d.mts +20 -0
- package/dist/cli/skill-author/contract.d.mts.map +1 -1
- package/dist/cli/skill-author/contract.mjs +27 -0
- package/dist/cli/skill-author/contract.mjs.map +1 -1
- package/dist/cli/skill-author/skill-template.d.mts.map +1 -1
- package/dist/cli/skill-author/skill-template.mjs +4 -3
- package/dist/cli/skill-author/skill-template.mjs.map +1 -1
- package/dist/cli/task/worktree-cleanup.d.mts +9 -1
- package/dist/cli/task/worktree-cleanup.d.mts.map +1 -1
- package/dist/cli/task/worktree-cleanup.mjs +190 -9
- package/dist/cli/task/worktree-cleanup.mjs.map +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/agents/apt-planner.md +1 -1
- package/dist/plugin/skills/apt/SKILL.md +111 -5
- package/dist/plugin/skills/apt-author-skill/SKILL.md +11 -0
- package/dist/plugin/skills/apt-bootstrap/SKILL.md +1 -0
- package/dist/plugin/skills/apt-classify/SKILL.md +1 -0
- package/dist/plugin/skills/apt-close-task/SKILL.md +1 -0
- package/dist/plugin/skills/apt-create-docs/SKILL.md +1 -0
- package/dist/plugin/skills/apt-debug/SKILL.md +2 -0
- package/dist/plugin/skills/apt-design/SKILL.md +2 -0
- package/dist/plugin/skills/apt-discuss/SKILL.md +2 -0
- package/dist/plugin/skills/apt-docs/SKILL.md +2 -0
- package/dist/plugin/skills/apt-execute/SKILL.md +1 -0
- package/dist/plugin/skills/apt-mockup/SKILL.md +2 -0
- package/dist/plugin/skills/apt-pause/SKILL.md +1 -0
- package/dist/plugin/skills/apt-personas/SKILL.md +1 -0
- package/dist/plugin/skills/apt-plan/SKILL.md +2 -0
- package/dist/plugin/skills/apt-pr-review/SKILL.md +1 -0
- package/dist/plugin/skills/apt-quick/SKILL.md +2 -0
- package/dist/plugin/skills/apt-resume/SKILL.md +1 -0
- package/dist/plugin/skills/apt-review/SKILL.md +1 -0
- package/dist/plugin/skills/apt-roadmap/SKILL.md +1 -0
- package/dist/plugin/skills/apt-roundtable/SKILL.md +2 -0
- package/dist/plugin/skills/apt-run/SKILL.md +1 -0
- package/dist/plugin/skills/apt-scan/SKILL.md +1 -0
- package/dist/plugin/skills/apt-setup/SKILL.md +1 -0
- package/dist/plugin/skills/apt-ship/SKILL.md +6 -5
- package/dist/plugin/skills/apt-stress-test/SKILL.md +1 -0
- package/dist/plugin/skills/apt-terminal/SKILL.md +1 -0
- package/dist/plugin/skills/apt-update/SKILL.md +5 -0
- package/dist/plugin/skills/apt-verify/SKILL.md +1 -0
- package/dist/plugin/skills/apt-verify-proof/SKILL.md +1 -0
- package/dist/types/config.d.ts +85 -0
- package/dist/types/config.d.ts.map +1 -1
- package/package.json +125 -122
- package/prompts/coder.md +2 -0
- package/prompts/planner.md +12 -0
- package/prompts/spec_writer.md +9 -0
- package/skills/apt/SKILL.md +112 -5
- package/skills/apt-author-skill/SKILL.md +11 -0
- package/skills/apt-bootstrap/SKILL.md +1 -0
- package/skills/apt-classify/SKILL.md +1 -0
- package/skills/apt-close-task/SKILL.md +33 -1
- package/skills/apt-create-docs/SKILL.md +1 -0
- package/skills/apt-debug/SKILL.md +41 -6
- package/skills/apt-debug/appendices/diagnose-discipline.md +119 -0
- package/skills/apt-design/SKILL.md +2 -0
- package/skills/apt-diagram/SKILL.md +342 -0
- package/skills/apt-diagram/appendices/design-discipline.md +97 -0
- package/skills/apt-discuss/SKILL.md +27 -0
- package/skills/apt-discuss/appendices/grill-discipline.md +104 -0
- package/skills/apt-discuss/appendices/zoom-out-helper.md +79 -0
- package/skills/apt-docs/SKILL.md +2 -0
- package/skills/apt-execute/SKILL.md +49 -5
- package/skills/apt-execute/appendices/tdd-mode.md +107 -0
- package/skills/apt-improve/DEEPENING.md +84 -0
- package/skills/apt-improve/INTERFACE-DESIGN.md +97 -0
- package/skills/apt-improve/LANGUAGE.md +104 -0
- package/skills/apt-improve/SKILL.md +141 -0
- package/skills/apt-mockup/SKILL.md +2 -0
- package/skills/apt-pause/SKILL.md +1 -0
- package/skills/apt-personas/SKILL.md +1 -0
- package/skills/apt-plan/SKILL.md +149 -4
- package/skills/apt-planner.md +42 -1
- package/skills/apt-pr-review/SKILL.md +47 -16
- package/skills/apt-prototype/LOGIC.md +109 -0
- package/skills/apt-prototype/SKILL.md +143 -0
- package/skills/apt-prototype/UI.md +90 -0
- package/skills/apt-quick/SKILL.md +32 -0
- package/skills/apt-resume/SKILL.md +1 -0
- package/skills/apt-review/SKILL.md +3 -0
- package/skills/apt-roadmap/SKILL.md +1 -0
- package/skills/apt-roundtable/SKILL.md +2 -0
- package/skills/apt-run/SKILL.md +33 -4
- package/skills/apt-scan/SKILL.md +1 -0
- package/skills/apt-setup/SKILL.md +129 -2
- package/skills/apt-ship/SKILL.md +52 -4
- package/skills/apt-stress-test/SKILL.md +1 -0
- package/skills/apt-terminal/SKILL.md +1 -0
- package/skills/apt-triage/AGENT-BRIEF.md +84 -0
- package/skills/apt-triage/OUT-OF-SCOPE.md +75 -0
- package/skills/apt-triage/SKILL.md +169 -0
- package/skills/apt-update/SKILL.md +3 -0
- package/skills/apt-verify/SKILL.md +4 -0
- package/skills/apt-verify-proof/SKILL.md +4 -0
- package/skills/apt-watch-ci/SKILL.md +163 -0
- package/skills/apt-zoom-out/SKILL.md +130 -0
- package/src/cli/artifacts/classification.mjs +10 -0
- package/src/cli/ci-watch/lock.mjs +178 -0
- package/src/cli/ci-watch/state.mjs +103 -0
- package/src/cli/ci-watch/stop-matrix.mjs +181 -0
- package/src/cli/cli-wrappers/ci-watch.mjs +9 -0
- package/src/cli/commands/adr.mjs +243 -0
- package/src/cli/commands/ci-watch.mjs +503 -0
- package/src/cli/commands/context.mjs +244 -0
- package/src/cli/commands/event.mjs +63 -24
- package/src/cli/commands/host-detect.mjs +33 -7
- package/src/cli/commands/init.mjs +83 -5
- package/src/cli/commands/modes.mjs +215 -0
- package/src/cli/commands/pr-review-audit-fixer.mjs +95 -16
- package/src/cli/commands/route.mjs +11 -2
- package/src/cli/commands/task.mjs +152 -18
- package/src/cli/commands/tokens.mjs +157 -6
- package/src/cli/commands/triage.mjs +277 -0
- package/src/cli/config/post-merge-sweep.mjs +49 -3
- package/src/cli/consistency/registry.mjs +14 -0
- package/src/cli/coordination/agent-identity.mjs +12 -0
- package/src/cli/coordination/event-log.mjs +73 -2
- package/src/cli/design/frontmatter-schema.mjs +3 -1
- package/src/cli/dispatch.mjs +15 -1
- package/src/cli/gate/registry.mjs +14 -0
- package/src/cli/help.mjs +1 -0
- package/src/cli/host/detect.mjs +5 -0
- package/src/cli/route/envelope.mjs +140 -106
- package/src/cli/route/skill-discover.mjs +46 -1
- package/src/cli/skill-author/contract.mjs +29 -0
- package/src/cli/skill-author/skill-template.mjs +4 -3
- package/src/cli/task/worktree-cleanup.mjs +191 -9
- package/templates/adr-format.md +56 -0
- package/templates/config.json +4 -0
- package/templates/context-format.md +34 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Adapted from Matt Pocock's MIT-licensed skill suite:
|
|
3
|
+
https://github.com/mattpocock/skills/blob/main/skills/engineering/prototype/UI.md
|
|
4
|
+
Licensed under MIT. Modifications: routed through Aperant's existing
|
|
5
|
+
apt:mockup skill rather than a freestanding HTML+Tailwind generator;
|
|
6
|
+
aligned with the 5 universal rules in apt-prototype/SKILL.md.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# UI branch — Delegates to apt:mockup
|
|
10
|
+
|
|
11
|
+
When the user's question is about **appearance / layout / flow /
|
|
12
|
+
discoverability**, the prototype is one or more HTML files generated
|
|
13
|
+
by Aperant's existing `/apt:mockup` skill. apt:mockup already enforces
|
|
14
|
+
the UI-specific universal rules (zero-dep Tailwind CDN, no JS, throwaway
|
|
15
|
+
HTML iterations preserved).
|
|
16
|
+
|
|
17
|
+
## When this branch fires
|
|
18
|
+
|
|
19
|
+
Question types that route here:
|
|
20
|
+
|
|
21
|
+
- "Does this UI shape feel right?"
|
|
22
|
+
- "Is this flow discoverable?"
|
|
23
|
+
- "Does this layout work on mobile?"
|
|
24
|
+
- "Should the primary action be a button or a card?"
|
|
25
|
+
- "How does X scale to N items?"
|
|
26
|
+
|
|
27
|
+
Question types that DO NOT route here (use LOGIC branch):
|
|
28
|
+
|
|
29
|
+
- "Does this state machine work?"
|
|
30
|
+
- "Does this control flow handle edge case X?"
|
|
31
|
+
- "Can this protocol handle out-of-order messages?"
|
|
32
|
+
|
|
33
|
+
## How the delegation works
|
|
34
|
+
|
|
35
|
+
apt:prototype's UI branch is a thin wrapper that:
|
|
36
|
+
|
|
37
|
+
1. Parses the user's question to extract the UI element / flow being
|
|
38
|
+
asked about (e.g., "search results card with N items").
|
|
39
|
+
2. Invokes the existing skill: `/apt:mockup --variants 3 [extracted topic]`.
|
|
40
|
+
3. apt:mockup produces 3 parallel HTML+Tailwind variants under
|
|
41
|
+
`.aperant/mockups/{topic-slug}/` so the user can compare them
|
|
42
|
+
side-by-side.
|
|
43
|
+
|
|
44
|
+
apt:prototype does NOT re-implement HTML+Tailwind generation — the
|
|
45
|
+
discipline lives in apt:mockup's body. UI.md exists so the apt:prototype
|
|
46
|
+
skill body can branch on question-type without conflating "logic
|
|
47
|
+
prototype" and "UI mockup" code paths.
|
|
48
|
+
|
|
49
|
+
## The 5 universal rules still apply
|
|
50
|
+
|
|
51
|
+
apt:mockup already enforces:
|
|
52
|
+
|
|
53
|
+
- Throwaway-marked (each HTML file carries a comment marker)
|
|
54
|
+
- Single-command-run (`open mockup.html` — zero dependencies)
|
|
55
|
+
- No-persistence-default (static HTML, no localStorage usage by default)
|
|
56
|
+
- Skip-polish (CSS reset, no animation refinement, no responsive
|
|
57
|
+
breakpoints unless the question is about responsive)
|
|
58
|
+
|
|
59
|
+
The fifth rule — **surface-state-transparently** — is the one
|
|
60
|
+
apt:mockup doesn't fully cover by default. For UI prototypes where the
|
|
61
|
+
question is about data shape (e.g., "what does this look like with 0
|
|
62
|
+
items vs 100 items?"), instruct apt:mockup to render each variant with
|
|
63
|
+
a different data-fixture state, and put the fixture JSON in a
|
|
64
|
+
side-panel of each mockup so the user can see what's driving the
|
|
65
|
+
render.
|
|
66
|
+
|
|
67
|
+
## What apt:prototype's UI branch adds over running apt:mockup directly
|
|
68
|
+
|
|
69
|
+
Two things:
|
|
70
|
+
|
|
71
|
+
1. **Question framing.** apt:mockup is invocable as "build me a mockup
|
|
72
|
+
of X". apt:prototype's UI branch is invocable as "I have a question
|
|
73
|
+
about UI X — show me three answers." The framing shifts the
|
|
74
|
+
discipline from "deliver the mockup the user asked for" to "answer
|
|
75
|
+
the user's question with the cheapest possible visual artifact."
|
|
76
|
+
|
|
77
|
+
2. **5-rule cross-discipline reminder.** When the UI branch fires, the
|
|
78
|
+
skill body explicitly re-states all 5 universal rules (not just the
|
|
79
|
+
UI-specific ones). The user gets the apt:prototype mental model on
|
|
80
|
+
top of apt:mockup's mechanical output — which prevents the variant
|
|
81
|
+
from drifting into "polish this until it's production-ready."
|
|
82
|
+
|
|
83
|
+
## When the apt:mockup delegation is NOT enough
|
|
84
|
+
|
|
85
|
+
If the question requires interaction the user can drive (click through,
|
|
86
|
+
hover states, conditional rendering on input), the right call is
|
|
87
|
+
`/apt:prototype` LOGIC branch on top of `/apt:mockup` — a tiny
|
|
88
|
+
JS-driven terminal-ish runner that swaps between the 3 mockups based
|
|
89
|
+
on simulated state. This is rare; most UI questions are answered by
|
|
90
|
+
the side-by-side parallel variants apt:mockup already produces.
|
|
@@ -9,6 +9,8 @@ user_invocable: true
|
|
|
9
9
|
internal: false
|
|
10
10
|
spawns_agent: false
|
|
11
11
|
agent_name: null
|
|
12
|
+
task_context: create-new
|
|
13
|
+
default_track: QUICK
|
|
12
14
|
default_execution_mode: auto
|
|
13
15
|
execution_modes:
|
|
14
16
|
- auto
|
|
@@ -19,6 +21,8 @@ gates: []
|
|
|
19
21
|
---
|
|
20
22
|
<objective>
|
|
21
23
|
Execute a small task quickly without full pipeline overhead. For small fixes, doc updates, config changes, and ad-hoc tasks. Skip planning — go straight to implementation with atomic commits and lightweight state tracking.
|
|
24
|
+
|
|
25
|
+
**QUICK is sequential single-agent by contract.** Per roundtable 2026-05-14 (R1), QUICK = one agent doing intent → implementation in one context window. There are no phase sub-agents. This is a contract, not an optimization — the QUICK track exists precisely because phase isolation buys nothing on tasks small enough that the planner's mental model and the implementer's mental model would be identical.
|
|
22
26
|
</objective>
|
|
23
27
|
|
|
24
28
|
<your_environment>
|
|
@@ -97,6 +101,34 @@ If the task does NOT cross any obligation axes, proceed normally.
|
|
|
97
101
|
2. Use Glob/Grep to find the files that need changes
|
|
98
102
|
3. Read those files to understand current state
|
|
99
103
|
|
|
104
|
+
## 3.5. Risk Check (mandatory)
|
|
105
|
+
|
|
106
|
+
Before implementing, check the risk class of files this task will modify. QUICK shares the same Critical/Destructive hard stop as `/apt:execute` step 3b — the speed of QUICK does NOT waive the risk gate. Misclassified QUICK tasks touching `**/auth/**`, `**/schema*`, `**/convex/schema.*`, or other Critical paths must NOT commit without explicit human approval.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
node .aperant/deps/node_modules/@aperant/framework/bin/apt-tools.mjs risk-check . --paths {target files}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
If the task description contains destructive keywords ("delete", "remove", "drop", "force-push"), pass `--operation delete` so glob matching covers the destructive intent.
|
|
113
|
+
|
|
114
|
+
Parse the JSON result and apply the gate:
|
|
115
|
+
|
|
116
|
+
**If `risk_class` is `"Critical"` or `"Destructive"`:**
|
|
117
|
+
Stop execution. Show the user:
|
|
118
|
+
```
|
|
119
|
+
RISK GATE: This QUICK task touches {risk_class} files.
|
|
120
|
+
Files: {matched_paths list}
|
|
121
|
+
Pattern: {matched_pattern}
|
|
122
|
+
|
|
123
|
+
Approve this change? (yes/no)
|
|
124
|
+
```
|
|
125
|
+
Wait for explicit approval. If denied, abort the task and record `verification.risk_gate = "denied"` in `task.json`. The gate is hardcoded at ALL autonomy levels — QUICK does not get to skip it.
|
|
126
|
+
|
|
127
|
+
**If `risk_class` is `"Elevated"` AND autonomy < 3:**
|
|
128
|
+
Show the affected files briefly before proceeding (5-second delay; user can interrupt). At YOLO autonomy, proceed without stopping.
|
|
129
|
+
|
|
130
|
+
**Why this exists:** roundtable 2026-05-14 R1 surfaced that `apt-quick` previously had no risk-check gate, meaning a misclassified QUICK task touching schema/auth could commit Critical-path changes with zero code-level safeguard. See `.aperant/roundtables/phase-mode-per-track-20260514/REPORT.md` (R1, Risk Assessment §1).
|
|
131
|
+
|
|
100
132
|
## 4. Implement
|
|
101
133
|
|
|
102
134
|
Make the changes directly:
|
|
@@ -9,6 +9,7 @@ user_invocable: true
|
|
|
9
9
|
internal: false
|
|
10
10
|
spawns_agent: true
|
|
11
11
|
agent_name: "apt-reviewer"
|
|
12
|
+
task_context: require-existing
|
|
12
13
|
default_execution_mode: auto
|
|
13
14
|
execution_modes:
|
|
14
15
|
- auto
|
|
@@ -17,6 +18,8 @@ allowed-tools: "Read, Bash, Grep, Glob"
|
|
|
17
18
|
argument-hint: "apt:review [--skip-docs | --fix-all]"
|
|
18
19
|
gates:
|
|
19
20
|
- verify-approved
|
|
21
|
+
config_keys:
|
|
22
|
+
- pipeline.skip_review
|
|
20
23
|
---
|
|
21
24
|
<objective>
|
|
22
25
|
Review the code produced by a task's execution, analyzing logic, security, quality, architecture, and performance. Fix all findings. Update task documentation. Report what's next.
|
package/skills/apt-run/SKILL.md
CHANGED
|
@@ -9,6 +9,7 @@ user_invocable: true
|
|
|
9
9
|
internal: false
|
|
10
10
|
spawns_agent: false
|
|
11
11
|
agent_name: null
|
|
12
|
+
task_context: self-managed
|
|
12
13
|
default_execution_mode: auto
|
|
13
14
|
execution_modes:
|
|
14
15
|
- auto
|
|
@@ -16,10 +17,13 @@ execution_modes:
|
|
|
16
17
|
- plan-mode
|
|
17
18
|
- plan-only
|
|
18
19
|
allowed-tools: "Bash, Read, Write, Edit, Grep, Glob, Task"
|
|
19
|
-
argument-hint: "apt:run [task description] [--skip-review]"
|
|
20
|
+
argument-hint: "apt:run [task description] [--skip-review] [--phase-mode auto|agent-team|sub-agents|sequential]"
|
|
20
21
|
gates:
|
|
21
22
|
- constitution-read
|
|
22
23
|
- constitution-coverage
|
|
24
|
+
config_keys:
|
|
25
|
+
- parallelization.enabled
|
|
26
|
+
- parallelization.max_agents
|
|
23
27
|
---
|
|
24
28
|
<objective>
|
|
25
29
|
Run the full Aperant pipeline: plan a task, execute all subtasks, verify the implementation, and optionally review the code. This is the one-command experience — from task description to verified, reviewed code.
|
|
@@ -62,12 +66,14 @@ node packages/framework/bin/apt-tools.mjs state .
|
|
|
62
66
|
|
|
63
67
|
## 1b. Resolve Orchestration Mode
|
|
64
68
|
|
|
65
|
-
Run reconcile to determine the effective orchestration strategy for this pipeline run:
|
|
69
|
+
Run reconcile to determine the effective orchestration strategy for this pipeline run. Pass the task's track via `--track <quick|standard|deep>` so per-track defaults from `.aperant/config.json:orchestration.per_track` apply (roundtable 2026-05-14 R7):
|
|
66
70
|
|
|
67
71
|
```bash
|
|
68
|
-
node packages/framework/bin/apt-tools.mjs reconcile .
|
|
72
|
+
node packages/framework/bin/apt-tools.mjs reconcile . --track {track}
|
|
69
73
|
```
|
|
70
74
|
|
|
75
|
+
**Per-invocation override:** if the user passed `--phase-mode {auto|agent-team|sub-agents|sequential}` on the invocation, use that value as `PHASE_MODE` directly (it wins over both `per_track` and the global `phase_delegation`). Still call reconcile so `review_mode` and `debate_mode` are resolved against host capabilities.
|
|
76
|
+
|
|
71
77
|
Parse the result and display:
|
|
72
78
|
|
|
73
79
|
```
|
|
@@ -80,7 +86,7 @@ If `downgrades` is present in the result, display each downgrade warning:
|
|
|
80
86
|
[APT] Warning: {downgrade.field} requested '{downgrade.requested}' but host does not support it — using '{downgrade.resolved}'. {downgrade.reason}
|
|
81
87
|
```
|
|
82
88
|
|
|
83
|
-
Store `resolved.phase_delegation` as `PHASE_MODE` for use in the pipeline steps below.
|
|
89
|
+
Store `resolved.phase_delegation` (or the explicit `--phase-mode` override) as `PHASE_MODE` for use in the pipeline steps below.
|
|
84
90
|
|
|
85
91
|
## 2. Create Feature Branch (or task worktree)
|
|
86
92
|
|
|
@@ -160,6 +166,19 @@ Execute the apt:execute workflow inline:
|
|
|
160
166
|
|
|
161
167
|
## 5. Stage 3 — Verify (apt:verify)
|
|
162
168
|
|
|
169
|
+
**De-anchored re-read (PHASE_MODE=sequential only — roundtable 2026-05-14 R2):**
|
|
170
|
+
|
|
171
|
+
When `PHASE_MODE` is `"sequential"` and the same agent that ran Stage 2 is about to run Stage 3 in the same context window, treat the boundary as an attention reset before proceeding. The agent MUST:
|
|
172
|
+
|
|
173
|
+
1. **Re-read `spec.md` from disk** — do not rely on its in-context summary from earlier in the conversation
|
|
174
|
+
2. **Re-read the diff from disk** via `git diff {base_branch}...HEAD` — verify what was actually written, not what was intended
|
|
175
|
+
3. **Adopt adversarial QA posture** — for the duration of Stage 3 you are not the implementer; you are reading this code for the first time, asking "what does this break?" rather than "did I do this right?"
|
|
176
|
+
4. **Ignore your prior reasoning chain** — the executor's "why I did it this way" rationalization is in-window but MUST NOT anchor the verifier's reading. If a finding conflicts with prior reasoning, prefer the finding
|
|
177
|
+
|
|
178
|
+
This block exists because the roundtable's STANDARD-track de-anchoring relies on prompt-level discipline rather than fresh-context isolation. The exit condition: if verify completeness+correctness scores drop >0.5 points across 10+ STANDARD tasks measured under R6 telemetry, flip `orchestration.per_track.standard` to `"sub-agents"` (R3 — the named fallback preserved from Systems Analyst + Risk Analyst dissent). See `.aperant/roundtables/phase-mode-per-track-20260514/REPORT.md` §Dissenting Views.
|
|
179
|
+
|
|
180
|
+
Sub-agents and agent-team modes skip this block — they get fresh-context isolation by spawning, which makes the de-anchored re-read redundant.
|
|
181
|
+
|
|
163
182
|
Execute the apt:verify workflow inline:
|
|
164
183
|
|
|
165
184
|
1. Check all subtasks completed
|
|
@@ -187,6 +206,16 @@ Stop pipeline (do not proceed to review).
|
|
|
187
206
|
|
|
188
207
|
**Skip if** `--skip-review` flag is set.
|
|
189
208
|
|
|
209
|
+
**De-anchored re-read (PHASE_MODE=sequential only — roundtable 2026-05-14 R2):**
|
|
210
|
+
|
|
211
|
+
Same attention-reset discipline as Stage 3 applies before review starts. In sequential mode the reviewer is the same agent that planned, executed, and verified — the rationalization chain is in-window. Before the 6-pass loop:
|
|
212
|
+
|
|
213
|
+
1. **Re-read `spec.md` and `qa_signoff.json` from disk** — do not summarize from in-context recall
|
|
214
|
+
2. **Re-read changed files** at their post-execution state via `git show HEAD:{path}` or direct Read
|
|
215
|
+
3. **Adopt fresh-reviewer posture** — you are reading this code as if a colleague wrote it, not as if you wrote it. The 6 review passes (logic / security / quality / architecture / performance / docs-coherence) are independent lenses; treat each lens as a fresh adversarial reading
|
|
216
|
+
|
|
217
|
+
Pattern reference: `packages/core/src/workflows/sparring/engine.ts` implements this exact discipline for sparring reviewers (fresh `streamText` per lens, lens prompt in system slot). This SKILL.md block is the same idea applied to verify/review in a single-context pipeline.
|
|
218
|
+
|
|
190
219
|
Execute the apt:review workflow inline (see `apt-review/SKILL.md`):
|
|
191
220
|
|
|
192
221
|
1. Load context — spec, QA results, constitution
|
package/skills/apt-scan/SKILL.md
CHANGED
|
@@ -9,6 +9,7 @@ user_invocable: true
|
|
|
9
9
|
internal: false
|
|
10
10
|
spawns_agent: false
|
|
11
11
|
agent_name: null
|
|
12
|
+
task_context: none
|
|
12
13
|
default_execution_mode: step
|
|
13
14
|
execution_modes:
|
|
14
15
|
- auto
|
|
@@ -16,6 +17,8 @@ execution_modes:
|
|
|
16
17
|
allowed-tools: "Bash, Read, Write, Edit, Grep, Glob"
|
|
17
18
|
argument-hint: "apt:setup [--batch <n> | --reset]"
|
|
18
19
|
gates: []
|
|
20
|
+
config_keys:
|
|
21
|
+
- "*"
|
|
19
22
|
---
|
|
20
23
|
<objective>
|
|
21
24
|
Interactive configuration of the Aperant Framework. Presents human-friendly questions
|
|
@@ -145,6 +148,7 @@ Display the current settings summary:
|
|
|
145
148
|
| Date Format | {current value} |
|
|
146
149
|
| Time Format | {current value} |
|
|
147
150
|
| Task Index | {current value} |
|
|
151
|
+
| Diagram Mode | {current value} |
|
|
148
152
|
| Phase Delegation | {config value} → {resolved} |
|
|
149
153
|
| Review Mode | {config value} → {resolved} |
|
|
150
154
|
| Debate Mode | {config value} → {resolved} |
|
|
@@ -167,7 +171,7 @@ AskUserQuestion([
|
|
|
167
171
|
multiSelect: false,
|
|
168
172
|
options: [
|
|
169
173
|
{ label: "Verification", description: "Verify mode, cross-verification, video review, strictness" },
|
|
170
|
-
{ label: "Pipeline", description: "Auto branch, code review, TDD Iron Law, date/time format, task index" },
|
|
174
|
+
{ label: "Pipeline", description: "Auto branch, code review, TDD Iron Law, date/time format, task index, diagram mode (file vs mcp)" },
|
|
171
175
|
{ label: "Orchestration", description: "Phase delegation, review mode, debate mode, agent teams" },
|
|
172
176
|
{ label: "Team Collaboration", description: "Enable/disable team mode — shared task board, roadmap, members" },
|
|
173
177
|
{ label: "Visibility", description: "Artifact-sharing policy — what leaves your machine (roadmap, team.json, decisions, digests, tasks)" },
|
|
@@ -180,10 +184,11 @@ AskUserQuestion([
|
|
|
180
184
|
|
|
181
185
|
**Routing:**
|
|
182
186
|
- "Verification" → jump to **Step 2** (Batch 1 + Batch 2 only), then skip to **Step 4** (mapping) and **Step 5** (write)
|
|
183
|
-
- "Pipeline" → jump to **Step 3b** (Batch 3 only), then skip to **Step 4** and **Step 5**
|
|
187
|
+
- "Pipeline" → jump to **Step 3b** (Batch 3 only, including Diagram Mode), then skip to **Step 4** and **Step 5**
|
|
184
188
|
- "Orchestration" → jump to **Step 3c** (Batch 4 only), then skip to **Step 4** and **Step 5**
|
|
185
189
|
- "Team Collaboration" → jump to **Step 3d** (Batch 5 only), then skip to **Step 4** and **Step 5**
|
|
186
190
|
- "Visibility" → jump to **Step 3e** (Batch 6 only), then skip to **Step 4** and **Step 5**
|
|
191
|
+
- "Task Tracking" → jump to **Step 3g** (Batch 8 only), then skip to **Step 4** and **Step 5**
|
|
187
192
|
- "Everything" → proceed to **Step 2** and run all batches (same as fresh setup)
|
|
188
193
|
- "Done" → display "Settings unchanged." and exit
|
|
189
194
|
|
|
@@ -395,6 +400,15 @@ AskUserQuestion([
|
|
|
395
400
|
{ label: "Yes (Recommended)", description: "Generates .aperant/tasks/INDEX.md with date, status, and title for every task — updated automatically" },
|
|
396
401
|
{ label: "No", description: "Skip index generation" }
|
|
397
402
|
]
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
question: "How should /apt:diagram render diagrams by default? (You can override per-call with --mode=file or --mode=mcp.)",
|
|
406
|
+
header: "Diagram Mode",
|
|
407
|
+
multiSelect: false,
|
|
408
|
+
options: [
|
|
409
|
+
{ label: "File (default)", description: "Writes a local docs/diagrams/<slug>.excalidraw file — works offline, no external services" },
|
|
410
|
+
{ label: "MCP (live canvas)", description: "Renders into a live Excalidraw MCP canvas — requires the Excalidraw MCP server to be connected. Asks for one-time consent on first use." }
|
|
411
|
+
]
|
|
398
412
|
}
|
|
399
413
|
])
|
|
400
414
|
```
|
|
@@ -858,6 +872,112 @@ Add a row to the Step 8 table:
|
|
|
858
872
|
|
|
859
873
|
---
|
|
860
874
|
|
|
875
|
+
## 3g. Present Settings (Batch 8: Task Tracking + Coding) (Pocock adoption AC13)
|
|
876
|
+
|
|
877
|
+
This batch captures the **task_tracking** backend and the **coding**
|
|
878
|
+
defaults block introduced by the Pocock adoption (ST-10 apt:triage +
|
|
879
|
+
ST-3 apt:execute --tdd).
|
|
880
|
+
|
|
881
|
+
Per ID-01 (Framework full-featured locally; backends are pluggable), the
|
|
882
|
+
default is `local-only` — zero GitHub auth required on first run. Users
|
|
883
|
+
can switch to `github-issues` (v1 stub) or `app-inbox` (v1 stub) later;
|
|
884
|
+
the framework abstraction is open for v2 adapter implementations.
|
|
885
|
+
|
|
886
|
+
### 3g.1 Present the task-tracking picker
|
|
887
|
+
|
|
888
|
+
```
|
|
889
|
+
AskUserQuestion([
|
|
890
|
+
{
|
|
891
|
+
question: "Where should triage state mirror to?",
|
|
892
|
+
header: "Task Tracking",
|
|
893
|
+
options: [
|
|
894
|
+
{ label: "Local files only (recommended for solo / 2-founder)",
|
|
895
|
+
description: "Writes to .aperant/tasks/{id}/triage.json. Zero net dep." },
|
|
896
|
+
{ label: "GitHub Issues (v2 — stub returns not-implemented in v1)",
|
|
897
|
+
description: "v1 ships the adapter shape only; full implementation in v2." },
|
|
898
|
+
{ label: "App inbox (post-app-launch — stub in v1)",
|
|
899
|
+
description: "Convex-backed; same state machine, app-rendered." }
|
|
900
|
+
]
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
question: "Publish vertical-slice subtasks to the tracker?",
|
|
904
|
+
header: "Tracker Publishing",
|
|
905
|
+
options: [
|
|
906
|
+
{ label: "No (recommended for solo / local)",
|
|
907
|
+
description: "Slices stay in implementation_plan.json only." },
|
|
908
|
+
{ label: "Yes (only meaningful with github-issues or app-inbox backend)",
|
|
909
|
+
description: "Each vertical slice becomes an issue via the to-issues template." }
|
|
910
|
+
]
|
|
911
|
+
}
|
|
912
|
+
])
|
|
913
|
+
```
|
|
914
|
+
|
|
915
|
+
For hosts without structured prompts, present each as a numbered list
|
|
916
|
+
and read the reply as a single number per question.
|
|
917
|
+
|
|
918
|
+
### 3g.2 Present the coding-defaults picker
|
|
919
|
+
|
|
920
|
+
```
|
|
921
|
+
AskUserQuestion([
|
|
922
|
+
{
|
|
923
|
+
question: "Activate TDD discipline by default for /apt:execute?",
|
|
924
|
+
header: "TDD Default",
|
|
925
|
+
options: [
|
|
926
|
+
{ label: "No (off — opt in per run via --tdd)",
|
|
927
|
+
description: "Single-commit flow; --tdd activates red-green-refactor + G9 audit." },
|
|
928
|
+
{ label: "Yes (on — opt out per run via --no-tdd)",
|
|
929
|
+
description: "Vertical-tracer-bullet discipline on every STANDARD/DEEP run." }
|
|
930
|
+
]
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
question: "Enforce the 5-rule prototype discipline on /apt:prototype?",
|
|
934
|
+
header: "Prototype Discipline",
|
|
935
|
+
options: [
|
|
936
|
+
{ label: "Yes (recommended — throwaway-marked, single-command-run, etc.)",
|
|
937
|
+
description: "All 5 universal rules apply to every prototype." },
|
|
938
|
+
{ label: "No (relaxed — rules are guidance only)",
|
|
939
|
+
description: "Prototypes may grow into production code; not recommended." }
|
|
940
|
+
]
|
|
941
|
+
}
|
|
942
|
+
])
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
### 3g.3 Map answers to `.aperant/config.json`
|
|
946
|
+
|
|
947
|
+
```jsonc
|
|
948
|
+
{
|
|
949
|
+
"task_tracking": {
|
|
950
|
+
"backend": "local-only", // default; or "github-issues" | "app-inbox"
|
|
951
|
+
"publish_to_tracker": false, // default
|
|
952
|
+
"tracker_url": null, // user-supplied when publish_to_tracker = true
|
|
953
|
+
"tracker_label_vocabulary": "default" // or custom name
|
|
954
|
+
},
|
|
955
|
+
"coding": {
|
|
956
|
+
"tdd_default": false, // default — see ST-3 apt:execute --tdd
|
|
957
|
+
"prototype_discipline": true // default — see ST-8 apt:prototype
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
Migration rule: any existing config WITHOUT a `task_tracking` or
|
|
963
|
+
`coding` block gets defaults silently — NEVER error on a missing block.
|
|
964
|
+
This is the migration path for projects that adopted Aperant pre-Pocock.
|
|
965
|
+
|
|
966
|
+
### 3g.4 Review-Mode routing entry
|
|
967
|
+
|
|
968
|
+
Extend the "1b. Review Mode" routing table (§1b) to include "Task
|
|
969
|
+
Tracking" as a selectable edit target — jumping back into this Batch 8
|
|
970
|
+
picker.
|
|
971
|
+
|
|
972
|
+
### 3g.5 Confirmation row
|
|
973
|
+
|
|
974
|
+
Add a row to the Step 8 table:
|
|
975
|
+
```
|
|
976
|
+
| Task Tracking | {backend} (publish: {true|false}, TDD default: {true|false}) |
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
---
|
|
980
|
+
|
|
861
981
|
## 4. Map Answers to Config
|
|
862
982
|
|
|
863
983
|
Map the user's selections to config values:
|
|
@@ -908,6 +1028,12 @@ Map the user's selections to config values:
|
|
|
908
1028
|
|
|
909
1029
|
**Task Index:** "Yes" → `preferences.task_index: true`, "No" → `preferences.task_index: false`
|
|
910
1030
|
|
|
1031
|
+
**Diagram Mode:**
|
|
1032
|
+
- "File (default)" → `diagram.mode: "file"`
|
|
1033
|
+
- "MCP (live canvas)" → `diagram.mode: "mcp"`
|
|
1034
|
+
|
|
1035
|
+
If `.aperant/config.json` has no `diagram` block yet, also seed `diagram.mcpConsent: null` so the structure matches the template default. Existing `mcpConsent` records are preserved across mode flips (changing the mode does not invalidate prior consent for the same host).
|
|
1036
|
+
|
|
911
1037
|
**Orchestration (Auto mode):** "Auto (Recommended)" → all three fields set to `"auto"`:
|
|
912
1038
|
- `orchestration.phase_delegation: "auto"`
|
|
913
1039
|
- `orchestration.review_mode: "auto"`
|
|
@@ -1015,6 +1141,7 @@ Display:
|
|
|
1015
1141
|
| Date Format | {DD-MM-YY / MM-DD-YY / YY-MM-DD} |
|
|
1016
1142
|
| Time Format | {24h / 12h} |
|
|
1017
1143
|
| Task Index | {Yes/No} |
|
|
1144
|
+
| Diagram Mode | {file/mcp} |
|
|
1018
1145
|
| Design Taste | {Skip / Brutalist / Editorial / Enterprise-Clean / Playful} |
|
|
1019
1146
|
| Phase Delegation | {Auto / Agent Team / Sub-Agents / Sequential} |
|
|
1020
1147
|
| Review Mode | {Auto / Agent Team / Sub-Agents / Sequential} |
|
package/skills/apt-ship/SKILL.md
CHANGED
|
@@ -9,6 +9,7 @@ user_invocable: true
|
|
|
9
9
|
internal: false
|
|
10
10
|
spawns_agent: false
|
|
11
11
|
agent_name: null
|
|
12
|
+
task_context: require-existing
|
|
12
13
|
default_execution_mode: auto
|
|
13
14
|
execution_modes:
|
|
14
15
|
- auto
|
|
@@ -19,6 +20,9 @@ gates:
|
|
|
19
20
|
- review-clean
|
|
20
21
|
- all-subtasks-complete
|
|
21
22
|
- gitignore-in-sync
|
|
23
|
+
config_keys:
|
|
24
|
+
- pipeline.auto_branch
|
|
25
|
+
- pipeline.branch_prefix
|
|
22
26
|
---
|
|
23
27
|
<objective>
|
|
24
28
|
Create a pull request (or publish a package) with full traceability from decisions to implementation. The PR body includes QA dimension scores, decision audit trail, and commit-to-subtask mapping. This is the final step in any track -- after verify passes, ship it.
|
|
@@ -288,6 +292,8 @@ Capture the PR URL from the output into `pr_url` (for example, the last line of
|
|
|
288
292
|
node packages/framework/bin/apt-tools.mjs task update . --id {task-id} --pr-url {PR_URL}
|
|
289
293
|
```
|
|
290
294
|
|
|
295
|
+
This same call **atomically flips `lifecycle_phase` from `reviewing` to `shipped-pending-merge`** when the task is in `reviewing` and no explicit `--lifecycle-phase` flag is passed. Section 6 is now the single load-bearing step that both records the PR and transitions the lifecycle; Section 8 below documents the semantics but no longer issues a separate command.
|
|
296
|
+
|
|
291
297
|
Display the resolution so users see which branch/base was used:
|
|
292
298
|
|
|
293
299
|
```
|
|
@@ -338,20 +344,62 @@ suggest_mode=$(jq -r '.pr_review.suggest_after_ship // "always"' .aperant/config
|
|
|
338
344
|
```
|
|
339
345
|
[APT:ship] Run /apt:pr-review --pr {pr_number} now for deep multi-agent review? [Y/n]
|
|
340
346
|
```
|
|
341
|
-
On `Y` (or empty enter), invoke `/apt:pr-review --pr {pr_number}` inline
|
|
347
|
+
On `Y` (or empty enter), invoke `/apt:pr-review --pr {pr_number}` inline — the task has already been flipped to `shipped-pending-merge` atomically by the `--pr-url` recording in Section 6, so the deep-review hint does NOT need to block on Section 8. On `N` or any other response, proceed silently to Section 8.
|
|
342
348
|
|
|
343
349
|
- **`never`** — silent. Proceed directly to Section 8.
|
|
344
350
|
|
|
345
351
|
`suggest_after_ship` is purely additive — it does not affect `authorship_override`, `authorship_overrides`, or `max_rounds` in the same `pr_review` block.
|
|
346
352
|
|
|
347
|
-
|
|
353
|
+
### 7.2 Post-ship /apt:watch-ci hook
|
|
354
|
+
|
|
355
|
+
After Section 7.1's hint resolves (whether it ran the deep review or skipped), conditionally arm a post-ship CI watcher. The hook is controlled by `ci_watch.after_ship` in `.aperant/config.json` (tri-state: `auto` | `ask` | `never`). The default depends on host capability — `auto` on cron-capable hosts (Claude Code, Pi), `never` elsewhere.
|
|
356
|
+
|
|
357
|
+
**Skip entirely** when no PR URL was captured in Section 6 (library `npm publish`-only path — same skip rule as 7.1).
|
|
348
358
|
|
|
349
|
-
|
|
359
|
+
**Read host cron capability + the after-ship mode:**
|
|
350
360
|
|
|
351
361
|
```bash
|
|
352
|
-
node packages/framework/bin/apt-tools.mjs
|
|
362
|
+
host_cron=$(node packages/framework/bin/apt-tools.mjs host-detect | jq -r '.host.capabilities.cron')
|
|
363
|
+
after_ship_default=$([ "$host_cron" = "true" ] && echo "auto" || echo "never")
|
|
364
|
+
after_ship_mode=$(jq -r --arg d "$after_ship_default" '.ci_watch.after_ship // $d' .aperant/config.json)
|
|
353
365
|
```
|
|
354
366
|
|
|
367
|
+
**Autonomy interaction** (apply BEFORE branching, same rule as 7.1): when `autonomy === 3` (YOLO), degrade `ask` → `auto`.
|
|
368
|
+
|
|
369
|
+
**Branch on `after_ship_mode`:**
|
|
370
|
+
|
|
371
|
+
- **`auto` AND `host_cron=true`** — call `apt-tools ci-watch start --pr {pr_number} --task-id {task-id} --host {cli}`. On success, emit:
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
[APT:ship] CI watcher armed (host cron: {cli}). Deadline: {iso}. Stop: /apt:watch-ci --stop --pr {N}.
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
- **`auto` AND `host_cron=false`** — call `apt-tools ci-watch start --pr {pr_number} --task-id {task-id} --host {cli}` (creates state file, sets `scheduler_handle: null`), then emit:
|
|
378
|
+
|
|
379
|
+
```
|
|
380
|
+
[APT:ship] CI watcher state created (host has no cron; advance manually: /apt:watch-ci --tick --pr {N}).
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
This is the honest-gap surface per D-03 — we never lie about cron-capability.
|
|
384
|
+
|
|
385
|
+
- **`ask`** — emit:
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
[APT:ship] Arm CI watcher for PR {N} now? [Y/n]
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
On `Y` (or empty enter), invoke the `auto` branch logic above (with the same host-cron derivation). On `N` or any other response, proceed silently to Section 8.
|
|
392
|
+
|
|
393
|
+
- **`never`** — silent. Proceed directly to Section 8.
|
|
394
|
+
|
|
395
|
+
Section 7.2 is purely additive — it does not affect Section 7.1's `pr_review.suggest_after_ship` policy or any other config block.
|
|
396
|
+
|
|
397
|
+
## 8. Transition lifecycle to `shipped-pending-merge` (C56 B5)
|
|
398
|
+
|
|
399
|
+
Ship is NOT the final closer. The PR has just been opened — it won't merge for minutes, hours, or days, and no agent will be present on merge. The task lifecycle is now `shipped-pending-merge` — the intermediate state between `reviewing` and `completed`. `/apt:close-task` runs post-merge (either manually via `/apt:close-task --all` or by the user when they return to the repo) and performs the actual closeout: phase flip, documentation narration, worktree GC, per-PR config strip, task archive.
|
|
400
|
+
|
|
401
|
+
Section 6 already performed this transition atomically as part of `task update --pr-url`. This section documents the semantics; no separate command is required.
|
|
402
|
+
|
|
355
403
|
The task stays in `state.active_tasks[*]` with `lifecycle_phase: "shipped-pending-merge"`. Do NOT call `task close` here — that would mark it `completed` before the PR is actually merged, producing the same artifact drift C56 was built to eliminate.
|
|
356
404
|
|
|
357
405
|
The linked phase (if any) stays `in-progress` — it only flips to `completed` when `/apt:close-task` confirms via `gh pr view` that the PR's state is `MERGED`.
|