quest-loop 0.1.0 → 0.3.2

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.
@@ -35,5 +35,5 @@ quest protocol
35
35
  - A `complete` checkpoint cites backticked commands in `validation_summary`
36
36
  and enumerates every Done-when item as Done / Blocked / Cancelled.
37
37
 
38
- **Next:** plan with `/quest:plan`, execute with `/quest:work`, drive with
39
- `/quest:orchestrate`, improve with `/quest:retro`.
38
+ **Next:** plan with `$quest:plan`, execute with `$quest:work`, drive with
39
+ `$quest:orchestrate`, improve with `$quest:retro`.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Quest Protocol"
3
3
  short_description: "The quest loop rules, checkpoint format, and vocabulary"
4
- default_prompt: "Use $protocol to look up the exact quest loop rule before acting."
4
+ default_prompt: "Use $quest:protocol to look up the exact quest loop rule before acting."
@@ -72,7 +72,7 @@ updated: 2026-07-07T14:00:00Z
72
72
  | `effort` | no | reasoning effort passed to the worker (e.g. `xhigh`); omitted = config default |
73
73
  | `max_iterations` | yes | positive integer (counts runner **sessions**) |
74
74
  | `max_cost` | no | USD number; omitted = uncapped |
75
- | `parent` | no | quest id (epic linking; children derived by scanning) |
75
+ | `parent` | no | quest id (epic linking; children derived by scanning). A quest with children is an epic: excluded from `--ready` until every child is terminal (complete/cancelled), and closed by the orchestrator inline — never dispatched to a worker |
76
76
  | `depends_on` | no | list of quest ids (wave ordering) |
77
77
  | `created` / `updated` | yes | UTC ISO-8601 `…Z` |
78
78
 
@@ -135,7 +135,11 @@ Optional free-form note.
135
135
 
136
136
  - `quest_status` ∈ `in_progress | complete | blocked` — the only legal values.
137
137
  - `iteration` required; `pr`, `head_sha`, `failed_approaches`,
138
- `compatible_expansion` optional.
138
+ `compatible_expansion`, `reopen_reason` optional.
139
+ - `reopen_reason` is written only by `quest reopen`: it records why a `complete`
140
+ quest was legally sent back into the loop (`quest_status: in_progress`), so a
141
+ fresh session can see why a once-complete quest is in progress again. Old
142
+ parsers ignore it — `parseCheckpoints` accepts any `- key: value` line.
139
143
  - `validation_summary` required. When `quest_status: complete`, lint requires
140
144
  at least one backticked command in it (commands, not adjectives).
141
145
  - A checkpoint's `quest_status` drives the store `status` transition:
@@ -149,10 +153,15 @@ in_progress → complete (checkpoint quest_status: complete)
149
153
  in_progress → blocked (checkpoint quest_status: blocked)
150
154
  blocked → in_progress (new checkpoint quest_status: in_progress)
151
155
  todo|in_progress|blocked → cancelled (quest cancel --reason)
156
+ complete → in_progress (quest reopen --reason ONLY — never a checkpoint)
152
157
  ```
153
158
 
154
- Any other transition is illegal (exit 5). `complete` and `cancelled` are
155
- terminal.
159
+ Any other transition is illegal (exit 5). `cancelled` is fully terminal.
160
+ `complete` is terminal for **checkpoints** — a stray checkpoint can never
161
+ resurrect it — but the `quest reopen <id> --reason` verb provides the one
162
+ audited path back into the loop, flipping `complete → in_progress` and appending
163
+ a checkpoint carrying `reopen_reason`. This is a separate `assertReopen` path in
164
+ `lib/contract.mjs`, deliberately not part of the checkpoint transition table.
156
165
 
157
166
  ## GitHub backend mapping
158
167
 
@@ -161,7 +170,7 @@ terminal.
161
170
  | record | `quests/NNN-slug.md` | issue; body = same body sections |
162
171
  | orchestration metadata | frontmatter | `<!-- quest:meta -->` HTML block at top of body (same `key: value` lines) |
163
172
  | id | frontmatter `id` | issue number |
164
- | status | frontmatter | labels `quest:todo\|in-progress\|blocked\|complete\|cancelled` (+ marker label `quest`); issue state mirrored (complete → closed-completed, cancelled → closed-not-planned) |
173
+ | status | frontmatter | labels `quest:todo\|in-progress\|blocked\|complete\|cancelled` (+ marker label `quest`); issue state mirrored (complete → closed-completed, cancelled → closed-not-planned, reopen → issue reopened + label swapped back to `quest:in-progress`) |
165
174
  | priority | frontmatter | labels `quest-p0\|p1\|p2` |
166
175
  | checkpoint | appended section | issue comment, identical bytes |
167
176
  | parent/child | child `parent:` | child meta `parent:` + epic body `## Children` task list (`- [ ] #12`) |
@@ -1,7 +1,7 @@
1
1
  # The quest loop protocol
2
2
 
3
3
  This is the base protocol every quest execution follows. Local amendments (mined
4
- from retros, see `/quest:retro`) live in `.quests/amendments.md` and extend this
4
+ from retros, see `$quest:retro`) live in `.quests/amendments.md` and extend this
5
5
  document — read both. `quest protocol` prints them together.
6
6
 
7
7
  ## Vocabulary
@@ -44,7 +44,11 @@ Each iteration:
44
44
  6. **Evaluate stop conditions.**
45
45
  - `complete` — every "Done when" item is enumerated as
46
46
  **Done / Blocked / Cancelled** with its evidence, and no new TODOs or
47
- follow-up work remain inside this quest (file a new quest instead).
47
+ follow-up work remain inside this quest (file a new quest instead). If a
48
+ completed quest is later found defective, the one legal way back into the
49
+ loop is `quest reopen <id> --reason` (flips `complete → in_progress`,
50
+ appends an audited `reopen_reason` checkpoint) — never hand-edit a terminal
51
+ status line. `cancelled` stays fully terminal.
48
52
  - `blocked` — (a) two consecutive iterations failing on the same error,
49
53
  (b) a decision only a human can make, or (c) an unsatisfiable "Done when"
50
54
  — name the exact discrepancy and the corrected anchor; **never improvise
@@ -81,7 +85,7 @@ When reviewing a finished iteration or run, the orchestrator rules one of:
81
85
  - **accept** — the checkpoint's evidence actually satisfies the Done-when items
82
86
  it claims (quote the commands; never accept adjectives).
83
87
  - **iterate-with-feedback** — send the specific gap back to the executor.
84
- - **split** — the quest was bigger than it looked; decompose via `/quest:plan`.
88
+ - **split** — the quest was bigger than it looked; decompose via `$quest:plan`.
85
89
  - **escalate-to-human** — human-only decisions are surfaced verbatim, never
86
90
  guessed.
87
91
 
@@ -90,4 +94,8 @@ When reviewing a finished iteration or run, the orchestrator rules one of:
90
94
  - **Small** — one quest, worked inline in the current session.
91
95
  - **Medium** — one quest dispatched to an executor (subagent or headless run).
92
96
  - **Large** — an epic (parent quest) with child quests in dependency waves via
93
- `depends_on`; orchestrate wave by wave.
97
+ `depends_on`; orchestrate wave by wave. The epic itself is never dispatched to
98
+ a worker: it is gated out of `--ready` while any child is non-terminal, and
99
+ once the children are done the orchestrator closes it inline (verify children,
100
+ run the epic validation loop, checkpoint). Keep the epic contract
101
+ integration-level; its milestones must not mirror the children 1:1.
@@ -46,5 +46,5 @@ quest amend --text "Treat a test that fails twice in one quest as a blocker to e
46
46
  quest protocol # confirm the amendment now rides along
47
47
  ```
48
48
 
49
- **Next:** amendments feed every future `/quest:work` orient automatically.
50
- Start the next wave with `/quest:orchestrate`.
49
+ **Next:** amendments feed every future `$quest:work` orient automatically.
50
+ Start the next wave with `$quest:orchestrate`.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Quest Retro"
3
3
  short_description: "Mine finished quest traces into numbered protocol amendments"
4
- default_prompt: "Use $retro to turn this wave's traces into protocol amendments."
4
+ default_prompt: "Use $quest:retro to turn this wave's traces into protocol amendments."
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: setup
3
+ description: Use when setting up, validating, updating, or troubleshooting Quest's native Codex or Claude plugin integration.
4
+ argument-hint: "[doctor|install-agents|init]"
5
+ ---
6
+
7
+ # Set up Quest native agents
8
+
9
+ Use this for Codex or Claude integration work, not for ordinary quest execution.
10
+
11
+ ## Project Init
12
+
13
+ `quest init` creates `.quests/` and, by default, installs project-scoped native
14
+ agent templates for both providers:
15
+
16
+ - `.codex/agents/quest-executor.toml`
17
+ - `.codex/agents/quest-reviewer.toml`
18
+ - `.claude/agents/quest-executor.md`
19
+ - `.claude/agents/quest-reviewer.md`
20
+
21
+ Use `quest init --no-agents` when you only want the quest store. If an existing
22
+ project template conflicts, init fails before creating `.quests/`; inspect the
23
+ file, run the explicit provider install command with `--force` only when you
24
+ intend replacement, then rerun `quest init`.
25
+
26
+ Project-scoped agent templates install at the Git repository root. For a nested
27
+ quest store, use `quest init --no-agents` in the nested directory and set
28
+ `QUEST_DIR` for agents launched from elsewhere, or initialize from the repo root.
29
+
30
+ ## Doctor
31
+
32
+ Check the installed Codex-facing state from the actual Codex surfaces:
33
+
34
+ ```bash
35
+ quest codex doctor
36
+ ```
37
+
38
+ This verifies the Codex CLI, `quest` binary on PATH, `multi_agent` and `goals`
39
+ feature flags, installed `quest@quest` plugin version, hook parser health,
40
+ duplicate/stale Quest skill roots, and whether the `quest-executor` plus
41
+ `quest-reviewer` native-agent templates are installed and current. Runtime
42
+ dispatch still happens from the parent Codex session via native subagent tools;
43
+ use `quest-run --codex-goal-mode require` only as the headless fallback.
44
+
45
+ Check the installed Claude-facing state from the actual Claude surfaces:
46
+
47
+ ```bash
48
+ quest claude doctor
49
+ ```
50
+
51
+ ## Install Native Agents
52
+
53
+ Install the Codex custom agents for this repository:
54
+
55
+ ```bash
56
+ quest codex install-agents --scope project
57
+ ```
58
+
59
+ Install the Claude custom agents for this repository:
60
+
61
+ ```bash
62
+ quest claude install-agents --scope project
63
+ ```
64
+
65
+ Use user scope only when you want the agents available everywhere:
66
+
67
+ ```bash
68
+ quest codex install-agents --scope user
69
+ quest claude install-agents --scope user
70
+ ```
71
+
72
+ If an existing file conflicts, inspect it first. Use `--force` only when you
73
+ intend to replace that custom agent with Quest's bundled definition. Symlinked
74
+ agent directories or files are refused rather than overwritten.
75
+
76
+ ## Update Installed Plugin
77
+
78
+ Codex installs from marketplace snapshots. After updating or releasing Quest,
79
+ refresh and reinstall, then start a new Codex thread:
80
+
81
+ ```bash
82
+ codex plugin marketplace upgrade quest
83
+ codex plugin add quest@quest
84
+ quest codex doctor
85
+ ```
86
+
87
+ If hooks changed, review/trust the updated hook definitions in Codex when
88
+ prompted, then re-run:
89
+
90
+ ```bash
91
+ codex debug prompt-input "noop"
92
+ ```
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "Quest Setup"
3
+ short_description: "Validate and install Quest's native Codex integration"
4
+ default_prompt: "Use $quest:setup to validate Quest's Codex plugin install."
5
+
6
+ policy:
7
+ allow_implicit_invocation: false
@@ -35,7 +35,7 @@ session can resume from.
35
35
  --summary "M2 done — <one line per milestone touched>" \
36
36
  --validation "\`npm test\` → 42 passed, 0 failed"
37
37
  ```
38
- 6. **Check stop conditions** (see `/quest:protocol` for the full rules):
38
+ 6. **Check stop conditions** (see `$quest:protocol` for the full rules):
39
39
  - All Done-when items hold with evidence → final checkpoint with
40
40
  `--status complete`, whose `--note` enumerates EVERY Done-when item as
41
41
  Done / Blocked / Cancelled with its evidence.
@@ -69,5 +69,5 @@ quest show 12
69
69
  ```
70
70
 
71
71
  **Next:** finished or blocked → the orchestrator (or human) rules on your
72
- checkpoint — see `/quest:orchestrate`. Learned something protocol-worthy →
73
- mention it so `/quest:retro` can turn it into an amendment.
72
+ checkpoint — see `$quest:orchestrate`. Learned something protocol-worthy →
73
+ mention it so `$quest:retro` can turn it into an amendment.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Work a Quest"
3
3
  short_description: "Execute one quest iteratively to a checkpointed stop"
4
- default_prompt: "Use $work to execute quest <id> per the quest protocol, ending in a recorded checkpoint."
4
+ default_prompt: "Use $quest:work to execute quest <id> per the quest protocol, ending in a recorded checkpoint."