codex-orchestrator 0.1.26 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +19 -7
  3. package/dist/src/cli.js +0 -8
  4. package/dist/src/cli.js.map +1 -1
  5. package/dist/src/config/constants.d.ts +1 -1
  6. package/dist/src/config/constants.d.ts.map +1 -1
  7. package/dist/src/config/constants.js +6 -1
  8. package/dist/src/config/constants.js.map +1 -1
  9. package/dist/src/config/schema.js +1 -1
  10. package/dist/src/config/schema.js.map +1 -1
  11. package/dist/src/github/gh-issue-adapter.d.ts +2 -1
  12. package/dist/src/github/gh-issue-adapter.d.ts.map +1 -1
  13. package/dist/src/github/gh-issue-adapter.js +9 -0
  14. package/dist/src/github/gh-issue-adapter.js.map +1 -1
  15. package/dist/src/github/issues.d.ts +29 -0
  16. package/dist/src/github/issues.d.ts.map +1 -1
  17. package/dist/src/github/issues.js +75 -0
  18. package/dist/src/github/issues.js.map +1 -1
  19. package/dist/src/index.d.ts +2 -2
  20. package/dist/src/index.d.ts.map +1 -1
  21. package/dist/src/index.js +1 -1
  22. package/dist/src/index.js.map +1 -1
  23. package/dist/src/runner/doctor-command.d.ts +2 -0
  24. package/dist/src/runner/doctor-command.d.ts.map +1 -1
  25. package/dist/src/runner/doctor-command.js +27 -10
  26. package/dist/src/runner/doctor-command.js.map +1 -1
  27. package/dist/src/runner/issue-state-machine.d.ts +1 -1
  28. package/dist/src/runner/issue-state-machine.d.ts.map +1 -1
  29. package/dist/src/runner/issue-state-machine.js +5 -0
  30. package/dist/src/runner/issue-state-machine.js.map +1 -1
  31. package/dist/src/runner/issue-tree.d.ts.map +1 -1
  32. package/dist/src/runner/issue-tree.js +0 -12
  33. package/dist/src/runner/issue-tree.js.map +1 -1
  34. package/dist/src/runner/recovery.d.ts +1 -1
  35. package/dist/src/runner/recovery.d.ts.map +1 -1
  36. package/dist/src/runner/recovery.js +6 -3
  37. package/dist/src/runner/recovery.js.map +1 -1
  38. package/dist/src/setup/codex-command-resolver.d.ts +10 -0
  39. package/dist/src/setup/codex-command-resolver.d.ts.map +1 -0
  40. package/dist/src/setup/codex-command-resolver.js +91 -0
  41. package/dist/src/setup/codex-command-resolver.js.map +1 -0
  42. package/dist/src/setup/project-config.d.ts.map +1 -1
  43. package/dist/src/setup/project-config.js +19 -4
  44. package/dist/src/setup/project-config.js.map +1 -1
  45. package/dist/src/setup/setup-command.d.ts +2 -1
  46. package/dist/src/setup/setup-command.d.ts.map +1 -1
  47. package/dist/src/setup/setup-command.js +50 -2
  48. package/dist/src/setup/setup-command.js.map +1 -1
  49. package/dist/src/setup/workflows.d.ts +1 -2
  50. package/dist/src/setup/workflows.d.ts.map +1 -1
  51. package/dist/src/setup/workflows.js +8 -32
  52. package/dist/src/setup/workflows.js.map +1 -1
  53. package/docs/deep-dive.md +6 -3
  54. package/package.json +8 -1
  55. package/prompts/workflows/breakdown-review.md +46 -3
  56. package/prompts/workflows/issue-breakdown.md +116 -3
  57. package/prompts/workflows/issue-tree-orchestration.md +156 -3
  58. package/prompts/workflows/prd.md +68 -3
  59. package/prompts/workflows/scoped-implementation.md +81 -22
  60. package/prompts/workflows/triage.md +137 -3
@@ -1,4 +1,157 @@
1
- # Issue Tree Orchestration Workflow Fallback
1
+ # Issue Tree Orchestration Workflow / Issue Orchestrator
2
2
 
3
- Coordinate a parent issue tree through dependency-aware child waves.
4
- Do not start blocked issues or overlapping write scopes.
3
+ Coordinate a parent issue or PRD with child implementation issues through dependency-aware waves, integration review, phase-gated handoff, and final verification.
4
+
5
+ Use orchestration only when the work is explicitly a parent/child issue tree or the caller asks for coordination, delegation, parallel agent work, or waves. Do not implement the parent issue directly when child implementation issues exist.
6
+
7
+ ## Required Inputs
8
+
9
+ - Parent issue, PRD, or plan.
10
+ - Child issue references, or permission to discover linked child issues from the issue tracker.
11
+ - Repo instructions, including `AGENTS.md`, domain docs, ADRs, and issue-tracker label policy.
12
+ - Current git status and branch.
13
+
14
+ ## Core Rules
15
+
16
+ 1. Treat the dependency graph and active wave plan as the live orchestration ledger.
17
+ 2. Do not start a child issue until blockers and preconditions are satisfied or explicitly cleared.
18
+ 3. Keep one integrator responsible for merge sequencing, handoff checks, validation, and final reconciliation.
19
+ 4. Use parallel workers only for disjoint write scopes.
20
+ 5. Never let two workers edit the same file, generated artifact, source-of-truth rule, schema, or shared contract at the same time.
21
+ 6. Do not broaden scope, add cleanup, or redesign the parent unless a blocker is proven.
22
+ 7. If repo reality contradicts the issue, parent PRD, or wave plan, stop and ask for clarification.
23
+ 8. Use TDD for behavior-changing child issues.
24
+ 9. Honor issue-level and wave-level spec gates before coding.
25
+
26
+ ## Verification Contract
27
+
28
+ A child issue is not complete until every acceptance criterion has proof.
29
+
30
+ Allowed proof includes test result, smoke result, command output, API or browser check, mobile proof, log evidence, DB inspection, or an explicit skipped-verification reason with risk. No proof means the issue remains incomplete, blocked, or explicitly deferred in the wave ledger.
31
+
32
+ ## Orient
33
+
34
+ 1. Read repo instructions and issue-tracker config.
35
+ 2. Fetch the parent and child issues.
36
+ 3. Extract acceptance criteria, blockers, out-of-scope items, rejected approaches, preconditions, and validation expectations.
37
+ 4. Build a dependency graph: ready, blocked, final integration/regression.
38
+ 5. Identify protected paths, likely source-of-truth owners, and files that must not be edited concurrently.
39
+ 6. Extract each issue's spec gate metadata.
40
+ 7. Mark unresolved external contracts, credentials, live fixtures, or human-only decisions as blocked until proven or cleared.
41
+
42
+ ## Plan Waves
43
+
44
+ Create the smallest safe parallel wave first:
45
+
46
+ - start only issues with no unresolved blockers;
47
+ - prefer independent vertical slices over horizontal layer splits;
48
+ - avoid parallel writes to the same owner files unless scopes are truly disjoint;
49
+ - keep final cross-cutting regression or cleanup issues for the last wave;
50
+ - define each wave exit gate: worker reports, integration diff review, combined validation, and blocker reconciliation;
51
+ - decide whether the wave requires a spec gate.
52
+
53
+ ## Spec Gates
54
+
55
+ Run a spec gate when an active issue says `Spec required: issue-level` or `Spec required: wave-level`, or when implementation would otherwise require guessing about contracts, state, ownership, external dependencies, validation, or rejected approaches.
56
+
57
+ Use an issue-level spec for one complex isolated child. Use a wave-level spec when several child issues share contracts, source-of-truth files, runtime flow, fixtures, or validation. If multiple active issues are marked issue-level but clearly share the same source-of-truth files or execution flow, coalesce them into one wave spec.
58
+
59
+ Default to a compact execution checklist. Expand to a full spec only when compact mode would leave safety, contract, ownership, or validation ambiguity.
60
+
61
+ Accepted spec gate output must identify:
62
+
63
+ - active child issues covered;
64
+ - source-of-truth contracts and ownership;
65
+ - protected paths and rejected approaches;
66
+ - exact implementation phases;
67
+ - first behavior proof or Contract Test Ledger rows when needed;
68
+ - validation gates;
69
+ - stop conditions.
70
+
71
+ Only after the spec gate is accepted should implementation workers start.
72
+
73
+ ## Delegate
74
+
75
+ For each issue in the active wave, assign one worker with a narrow ownership scope. Worker instructions must include:
76
+
77
+ - parent and child issue references;
78
+ - accepted implementation spec reference when a spec gate was run;
79
+ - repo policy and relevant docs to read;
80
+ - instruction to use TDD for behavior changes;
81
+ - exact ownership boundaries;
82
+ - warning that other agents may be editing the repo;
83
+ - instruction not to revert or overwrite user or worker changes;
84
+ - protected paths, rejected approaches, and out-of-scope items;
85
+ - required preconditions and verification commands;
86
+ - stop conditions;
87
+ - required final report: changed files, proof per acceptance criterion, tests run, skipped checks, risks, blockers, and unresolved acceptance criteria.
88
+
89
+ While workers run, the integrator should do non-overlapping work: read docs, inspect ownership, map integration points, and prepare validation. Do not duplicate a worker's implementation.
90
+
91
+ ## Integrate Each Wave
92
+
93
+ Treat each wave as a hard execution gate:
94
+
95
+ 1. Review worker reports before touching code.
96
+ 2. Review diffs and verify scope boundaries.
97
+ 3. Resolve conflicts without discarding user or worker changes.
98
+ 4. Remove duplicated logic, competing source-of-truth changes, and workaround-shaped code.
99
+ 5. Check for architecture drift: shallow modules, one-adapter seams, duplicated rules, or tests coupled to implementation details.
100
+ 6. Reconcile every active child issue as complete, blocked with evidence, or deferred.
101
+ 7. Verify TDD evidence for behavior-changing issues.
102
+ 8. Run the smallest meaningful combined validation for the wave.
103
+ 9. Run repo architecture checks when available and applicable.
104
+ 10. Verify implementation stayed inside the accepted spec, or document why a spec amendment was required.
105
+ 11. Run cleanup-review and code-review when repo policy or change size requires them.
106
+ 12. Fix high-confidence review findings and rerun validation.
107
+ 13. Create focused commits for completed child issues, or one documented wave commit when safe separation is impossible.
108
+ 14. Update the dependency graph before starting the next wave.
109
+
110
+ If a worker reports an ambiguous or risky decision, pause and ask the user a targeted question.
111
+
112
+ ## Finish And Delivery
113
+
114
+ After all child issues are implemented, blocked, or deferred:
115
+
116
+ 1. Run final integration or regression issues last.
117
+ 2. Reconcile all child acceptance criteria, skipped checks, blockers, and out-of-scope protections.
118
+ 3. Run cleanup-review before final code-review when repo policy requires it.
119
+ 4. Fix grounded findings and rerun relevant checks.
120
+ 5. Summarize completed issues, verification, skipped checks, and follow-up risks.
121
+ 6. Comment on completed child issues with result summaries and verification.
122
+ 7. Close completed child issues only after completion evidence is posted.
123
+ 8. Comment on the parent with completed children, validation, out-of-scope items preserved, and residual risks.
124
+ 9. Open or prepare a pull request when requested or expected by repo workflow.
125
+ 10. Stop before any human-only action such as PR approval, merge, product decision, manual validation, missing access, or secrets.
126
+
127
+ ## Stop Conditions
128
+
129
+ Stop immediately if:
130
+
131
+ - a required precondition cannot be satisfied exactly;
132
+ - a required file, symbol, command, issue, or dependency is missing;
133
+ - a child issue cannot be validated with available repo context;
134
+ - a required spec gate cannot produce an accepted spec;
135
+ - an external contract is not machine-confirmed;
136
+ - completing a child would touch protected or out-of-scope areas;
137
+ - two active workers need the same write target or source-of-truth owner;
138
+ - a worker introduces duplicate business rules, dispatch builders, normalization, persistence accounting, or compatibility layers;
139
+ - implementation would use a rejected approach;
140
+ - review exposes ambiguity that cannot be resolved from code, docs, or issues;
141
+ - the next wave depends on unverified, blocked, or ambiguous work.
142
+
143
+ ## Completion Standard
144
+
145
+ Do not claim orchestration is complete until:
146
+
147
+ - every child issue is complete, blocked with evidence, or explicitly deferred;
148
+ - every reached wave exit gate has passed;
149
+ - every required spec gate was completed and accepted;
150
+ - integration diffs have been reviewed and remediated;
151
+ - protected paths and rejected approaches were respected;
152
+ - source-of-truth ownership remains singular;
153
+ - behavior-changing child issues used TDD or documented a no-seam testing gap;
154
+ - required validation ran, or skipped checks have concrete reasons;
155
+ - required cleanup-review and code-review gates completed;
156
+ - completed child issues have focused commits or documented wave commits;
157
+ - completed children and the parent have been updated unless delivery was explicitly skipped.
@@ -1,4 +1,69 @@
1
- # PRD Workflow Fallback
1
+ # PRD Workflow
2
2
 
3
- Turn the parent issue and repository context into a clear product requirements document.
4
- Record open questions instead of inventing product decisions.
3
+ Turn the current parent issue, conversation context, and repository context into a Product Requirements Document. Do not interview the user by default; synthesize what is already known, and record open questions instead of inventing product or technical decisions.
4
+
5
+ Use the repository's issue tracker and triage label vocabulary from repo instructions when available. Use the project's domain glossary vocabulary throughout the PRD, and respect ADRs in the area being changed.
6
+
7
+ ## Process
8
+
9
+ 1. Explore the repository enough to understand the current product and codebase state.
10
+ 2. Identify the major modules, interfaces, contracts, or flows likely to change.
11
+ 3. Actively look for opportunities to define deep modules: small, testable interfaces that encapsulate meaningful behavior.
12
+ 4. Capture unresolved product, contract, external dependency, or validation questions explicitly.
13
+ 5. Write the PRD using the template below.
14
+ 6. If the execution environment has issue-tracker access and the caller requested publication, publish the PRD to the configured tracker and apply the triage entry label.
15
+
16
+ ## PRD Template
17
+
18
+ ### Problem Statement
19
+
20
+ Describe the problem from the user's perspective. Name the pain, missing capability, or operational risk without assuming an implementation.
21
+
22
+ ### Solution
23
+
24
+ Describe the desired solution from the user's perspective. Focus on outcomes and observable behavior.
25
+
26
+ ### User Stories
27
+
28
+ Provide a numbered list of user stories in this format:
29
+
30
+ 1. As an `<actor>`, I want `<feature>`, so that `<benefit>`.
31
+
32
+ Cover the important actors, workflows, edge cases, and operational scenarios.
33
+
34
+ ### Implementation Decisions
35
+
36
+ List implementation decisions already known or confirmed. Include:
37
+
38
+ - modules, contracts, or interfaces expected to change;
39
+ - schema, DTO, API, or persistence decisions;
40
+ - state machine, background job, auth, permission, caching, or integration decisions;
41
+ - specific interactions between systems;
42
+ - rejected approaches and why they are rejected.
43
+
44
+ Do not include brittle file paths or line numbers. If a prototype produced a snippet that captures a decision more precisely than prose, include only the decision-rich part and note that it came from a prototype.
45
+
46
+ ### Testing Decisions
47
+
48
+ List testing decisions. Include:
49
+
50
+ - what behavior must be proven through public interfaces;
51
+ - which modules or flows need tests;
52
+ - existing prior art in the repository;
53
+ - required smoke, browser, mobile, API, or live validation;
54
+ - cases where a deterministic test seam is missing and must be created or explicitly accepted as risk.
55
+
56
+ ### Out of Scope
57
+
58
+ List adjacent behavior that should not be included in this PRD.
59
+
60
+ ### Further Notes
61
+
62
+ Record open questions, migration notes, rollout notes, compatibility concerns, and follow-up ideas.
63
+
64
+ ## Quality Bar
65
+
66
+ - The PRD must be durable: useful even if files move.
67
+ - The PRD must be specific enough to break into vertical implementation issues.
68
+ - Do not hide unresolved decisions inside implementation work.
69
+ - Do not mark work as agent-ready when the PRD still depends on unconfirmed external contracts, credentials, manual design decisions, or ambiguous acceptance criteria.
@@ -1,22 +1,81 @@
1
- # Scoped Implementation Workflow Fallback
2
-
3
- Implement one scoped issue from GitHub context and repository instructions.
4
- For runtime behavior changes, use strict TDD red-to-green: write one focused
5
- behavior test first, prove the test fails before implementation, then make the
6
- smallest implementation that passes after implementation. Report this as a
7
- passed validation line that includes the failing/red and passing/green evidence.
8
- Do not batch many tests before implementation.
9
- Run cleanup-review before code-review for medium or large runtime changes.
10
- Run code-review before completion for runtime changes and report the result.
11
- Report validation, skipped checks, and risks.
12
- For UI or visual changes, follow the orchestration prompt's visual proof
13
- contract. If a runner-owned visual proof command is configured, prepare its
14
- script/artifacts (prefer Playwright for browser/web UI) but let the runner
15
- execute it. For Android mobile app UI work, use device-backed proof instead of
16
- Playwright: run `adb devices -l`, prefer a connected non-emulator device serial,
17
- and run `export ANDROID_SERIAL=<serial>`. Otherwise run `emulator -list-avds`,
18
- start an AVD in a separate shell with `emulator -avd <avd-name>`, and wait with
19
- `adb wait-for-device`. If Test Android Apps skills are unavailable, try to enable
20
- or load that plugin through the available Codex plugin/tool discovery mechanism.
21
- If the plugin cannot be enabled, or no usable device or emulator is available,
22
- report that as a warning/skipped check with the concrete reason and proceed.
1
+ # Scoped Implementation Workflow / Spec Implementer
2
+
3
+ Implement one scoped issue or approved implementation spec. Follow the issue, repo policy, and runner completion contract exactly. Do not redesign the work unless repo reality proves a blocker.
4
+
5
+ ## Core Rules
6
+
7
+ 1. Keep scope narrow. Do not broaden the issue, add unrelated cleanup, or invent adjacent features.
8
+ 2. Treat protected paths, rejected approaches, out-of-scope items, and repo instructions as hard constraints.
9
+ 3. Confirm required services, env vars, fixtures, commands, and repo state before editing.
10
+ 4. Stop if exact execution would require guessing about contracts, state, ownership, credentials, or validation.
11
+ 5. Prefer existing local patterns and deep module boundaries over new abstractions.
12
+ 6. Do not add pass-through modules, one-adapter seams, or test-only helpers unless they improve real locality or leverage.
13
+ 7. Add comments only where they clarify non-obvious behavior.
14
+
15
+ ## TDD And Behavior Proof
16
+
17
+ For runtime behavior changes, use strict TDD red-to-green:
18
+
19
+ 1. Choose one observable behavior.
20
+ 2. Write one focused behavior test first.
21
+ 3. Prove the test fails before implementation.
22
+ 4. Implement the smallest correct change.
23
+ 5. Prove the test passes after implementation.
24
+ 6. Repeat vertically for the next behavior.
25
+ 7. Refactor only while green.
26
+
27
+ Report the failing/red and passing/green evidence in validation. Do not batch many imagined tests before implementing. If no correct test seam exists, report why the available seams would give false confidence and provide the strongest alternate proof.
28
+
29
+ ## Execution Flow
30
+
31
+ 1. Read the issue, comments, repo instructions, and relevant docs.
32
+ 2. Identify acceptance criteria, blockers, out-of-scope items, validation expectations, and likely source-of-truth owners.
33
+ 3. Inspect current git status and avoid reverting user changes.
34
+ 4. Implement the smallest complete solution.
35
+ 5. Keep validation proportional to risk and blast radius.
36
+ 6. Preserve runner-owned publication boundaries: do not push, open PRs, merge, publish, deploy, or mutate GitHub labels/comments.
37
+ 7. Produce the structured completion report required by the runner.
38
+
39
+ ## Review Gates
40
+
41
+ Run cleanup-review before code-review for medium or large runtime changes, or when repo policy requires it. Fix high-confidence cleanup findings and rerun relevant validation.
42
+
43
+ Run code-review before completion when the issue or repo policy requires it, or when the change touches shared behavior, APIs, persistence, auth, permissions, caching, concurrency, background jobs, navigation, middleware, or multiple runtime files. Fix grounded findings or report blockers with evidence.
44
+
45
+ For compact low-risk changes, focused validation plus a clear completion report is enough unless repo policy says otherwise.
46
+
47
+ ## UI And Visual Proof
48
+
49
+ For browser UI work, prepare runner-owned visual proof artifacts when configured. Prefer Playwright for web UI proof, but let the runner execute configured proof commands when the prompt says so.
50
+
51
+ For Android mobile app UI work, use device-backed proof instead of Playwright:
52
+
53
+ 1. Run `adb devices -l`.
54
+ 2. Prefer a connected non-emulator device serial and set `export ANDROID_SERIAL=<serial>`.
55
+ 3. If no device exists, run `emulator -list-avds`, start an AVD in a separate shell with `emulator -avd <avd-name>`, and wait with `adb wait-for-device`.
56
+ 4. After selecting the adb target, use Test Android Apps skills when available.
57
+ 5. Do not use Playwright as the primary proof path for Android mobile app verification.
58
+ 6. If Test Android Apps cannot be enabled, or no usable Android device or emulator is available, report a warning/skipped check with the concrete plugin or adb/emulator reason and proceed only if repo policy allows it.
59
+
60
+ ## Stop Conditions
61
+
62
+ Stop and report a blocker if:
63
+
64
+ - a required file, symbol, command, dependency, or interface differs from the issue/spec;
65
+ - a required precondition cannot be satisfied;
66
+ - validation cannot prove the intended behavior with available repo context;
67
+ - completing the work requires touching protected paths or using rejected approaches;
68
+ - the change would require unapproved migration, compatibility logic, external access, or product decisions;
69
+ - review exposes ambiguity that cannot be resolved from code, docs, or the issue;
70
+ - the runner completion contract cannot be satisfied safely.
71
+
72
+ ## Completion Standard
73
+
74
+ Do not mark the issue complete until:
75
+
76
+ - every acceptance criterion is implemented, blocked with evidence, or explicitly out of scope;
77
+ - validation commands and behavior proof have run, or skipped checks have concrete reasons;
78
+ - applicable cleanup-review and code-review gates have run;
79
+ - protected paths stayed untouched and rejected approaches were avoided;
80
+ - changed files, validation, skipped checks, residual risks, and blockers are reported;
81
+ - the structured completion report is written exactly where the runner requested it.
@@ -1,4 +1,138 @@
1
- # Triage Workflow Fallback
1
+ # Triage Workflow
2
2
 
3
- Classify issues for agent readiness, blockers, required validation, and human-in-the-loop needs.
4
- Do not mark underspecified work as ready.
3
+ Move issues through a small issue-tracker triage state machine. Every comment or issue posted during triage must start with:
4
+
5
+ ```markdown
6
+ > *This was generated by AI during triage.*
7
+ ```
8
+
9
+ Use the repository's configured label vocabulary. The canonical roles are below; actual labels may differ by repo policy.
10
+
11
+ ## Roles
12
+
13
+ Category roles:
14
+
15
+ - `bug`: something is broken.
16
+ - `enhancement`: new feature or improvement.
17
+
18
+ State roles:
19
+
20
+ - `needs-triage`: maintainer needs to evaluate.
21
+ - `needs-info`: waiting on reporter information.
22
+ - `ready-for-agent`: fully specified, ready for AFK agent work.
23
+ - `ready-for-human`: needs human implementation or decision.
24
+ - `wontfix`: will not be actioned.
25
+
26
+ Every triaged issue should carry exactly one category role and one state role. If state roles conflict, stop and ask the maintainer before changing the issue.
27
+
28
+ ## Needs Attention View
29
+
30
+ When asked what needs attention, show three buckets, oldest first:
31
+
32
+ 1. Unlabeled issues.
33
+ 2. Issues in `needs-triage`.
34
+ 3. Issues in `needs-info` with reporter activity since the last triage note.
35
+
36
+ Show counts and one-line summaries, then let the maintainer choose.
37
+
38
+ ## Triage A Specific Issue
39
+
40
+ 1. Gather context: read the full issue body, comments, labels, reporter, and dates.
41
+ 2. Parse prior triage notes to avoid re-asking answered questions.
42
+ 3. Explore relevant repo context using domain glossary terms and ADRs.
43
+ 4. Read `.out-of-scope/*.md` if present and surface matching prior rejections.
44
+ 5. Recommend a category and state with reasoning and a short codebase summary.
45
+ 6. For bugs, attempt reproduction before final recommendation: trace code, run focused tests or commands, and report successful repro, failed repro, or insufficient detail.
46
+ 7. If the issue needs fleshing out, run a grilling or clarification pass before marking it ready.
47
+ 8. Apply the outcome only after the requested action is clear.
48
+
49
+ ## Outcomes
50
+
51
+ - `ready-for-agent`: post an Agent Brief comment and apply the mapped role.
52
+ - `ready-for-human`: post an Agent Brief-style comment that explains why human work is required.
53
+ - `needs-info`: post triage notes with established facts and specific reporter questions.
54
+ - `wontfix` bug: post a polite explanation and close.
55
+ - `wontfix` enhancement: create or update `.out-of-scope/<concept>.md`, link it from a comment, then close.
56
+ - `needs-triage`: apply the role; comment only if useful.
57
+
58
+ ## Agent Brief
59
+
60
+ An Agent Brief is the durable contract an AFK agent will work from. The original issue and discussion are context; the brief is the current specification.
61
+
62
+ Write briefs that are durable, behavioral, complete, and scoped. Avoid file paths and line numbers. Name interfaces, types, commands, contracts, config shapes, and observable behavior when useful.
63
+
64
+ Template:
65
+
66
+ ```markdown
67
+ ## Agent Brief
68
+
69
+ **Category:** bug / enhancement
70
+ **Summary:** one-line description
71
+
72
+ **Current behavior:**
73
+ Describe what happens now.
74
+
75
+ **Desired behavior:**
76
+ Describe what should happen, including edge cases and error conditions.
77
+
78
+ **Key interfaces:**
79
+ - Interface or contract name - what needs to change and why
80
+ - Config shape or command - expected behavior
81
+
82
+ **Acceptance criteria:**
83
+ - [ ] Specific, testable criterion
84
+ - [ ] Specific, testable criterion
85
+ - [ ] Specific, testable criterion
86
+
87
+ **Out of scope:**
88
+ - Adjacent thing not included
89
+ - Risky interpretation not allowed
90
+ ```
91
+
92
+ ## Needs-Info Template
93
+
94
+ ```markdown
95
+ ## Triage Notes
96
+
97
+ **What we've established so far:**
98
+
99
+ - fact 1
100
+ - fact 2
101
+
102
+ **What we still need from you (@reporter):**
103
+
104
+ - specific question 1
105
+ - specific question 2
106
+ ```
107
+
108
+ Capture resolved facts under "established so far" so the work is not lost. Questions must be specific and actionable.
109
+
110
+ ## Out-Of-Scope Knowledge Base
111
+
112
+ The `.out-of-scope/` directory stores durable records of rejected enhancement requests. One file should represent one concept, not one issue.
113
+
114
+ File shape:
115
+
116
+ ```markdown
117
+ # Concept Name
118
+
119
+ ## Why this is out of scope
120
+
121
+ Durable reason, including project scope, architectural constraints, or strategic decision.
122
+
123
+ ## Prior requests
124
+
125
+ - #123 - Request title
126
+ ```
127
+
128
+ During triage, check existing out-of-scope records by concept similarity. If a new issue matches a prior rejection, surface it and ask whether the maintainer wants to confirm, reconsider, or proceed as distinct.
129
+
130
+ Only write `.out-of-scope/` records for rejected enhancements, not bugs.
131
+
132
+ ## Quick State Override
133
+
134
+ If the maintainer explicitly says to move an issue to a state, trust them. Confirm the exact label/comment/close action, then apply it. If moving to `ready-for-agent` without a grilling session, ask whether they want an Agent Brief written.
135
+
136
+ ## Spec Gate Policy
137
+
138
+ Triage does not create implementation specs. When an issue has a `Spec gate` section, preserve it in the Agent Brief and do not expand it into a file-by-file implementation plan.