copilot-tap-extension 2.0.6 → 2.0.8

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.
@@ -5,22 +5,23 @@ argument-hint: "<objective>"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
- Create an idle PromptEmitter with `tap_start_emitter` that keeps advancing one explicit objective until the goal is achieved, blocked, stopped, or the iteration limit is reached.
8
+ Create a PromptEmitter that keeps advancing one explicit objective until the goal is achieved, blocked, stopped, or the iteration budget is reached.
9
9
 
10
- Use these goal-loop rules:
10
+ Use Codex-style goal-loop rules:
11
11
 
12
- - Goals are explicit; do not infer one from ordinary user tasks.
13
- - A bare goal command reports the current goal state.
14
- - Control commands are user-owned (`status`, `stop`, `resume`, `clear`, `replace`).
15
- - The model can complete a goal only when the objective is actually achieved.
16
- - Runtime budget exhaustion is not proof of completion; only achieving the objective marks completion.
12
+ - A goal is a **thread-scoped completion contract**, not a bigger prompt and not global memory.
13
+ - Goals are explicit; do not infer one from ordinary one-shot tasks.
14
+ - The goal contract should name six things: outcome, verification surface, constraints, boundaries, iteration policy, and blocked stop condition.
15
+ - Completion must be evidence-based. The model may stop a goal as complete only after checking concrete evidence.
16
+ - Runtime budget exhaustion is not proof of completion; it is a budget-limited stop/handoff state.
17
+ - Control commands are user-owned (`status`, `stop`, `pause`, `resume`, `clear`, `replace`).
17
18
 
18
19
  ## Expected input
19
20
 
20
21
  Interpret the invocation as one of:
21
22
 
22
23
  1. No arguments — show current `goal-*` emitters with `tap_list_emitters`.
23
- 2. A control command — `status`, `stop`, `resume`, `clear`, or `replace`.
24
+ 2. A control command — `status`, `stop`, `pause`, `resume`, `clear`, or `replace`.
24
25
  3. Otherwise, the full invocation is the goal objective.
25
26
 
26
27
  Example:
@@ -33,16 +34,49 @@ means:
33
34
 
34
35
  - `objective = "migrate the repo to the new API and keep going until tests pass"`
35
36
 
36
- If the objective is missing or too vague, ask the user for a concrete objective instead of guessing.
37
+ If the objective is missing, ask the user for a concrete objective instead of guessing.
38
+
39
+ If the objective is weak but the user's intent is clear, help strengthen it before creating the emitter. A strong goal contract has:
40
+
41
+ ```text
42
+ Outcome: <desired end state>
43
+ Verification surface: <test, benchmark, command output, artifact, or source material that proves completion>
44
+ Constraints: <what must not regress>
45
+ Boundaries: <files, tools, data, repos, or resources allowed>
46
+ Iteration policy: <how to choose the next best action between attempts>
47
+ Blocked stop condition: <what to report if no valid path remains and what would unlock progress>
48
+ ```
49
+
50
+ If one of these fields is not explicitly provided but can be safely inferred from the objective and repository context, infer it and show it in the confirmation. If the verification surface or blocked stop condition cannot be inferred, ask for that missing detail.
37
51
 
38
52
  If another `goal-*` emitter already exists, ask before replacing it unless the user explicitly said `replace`.
39
53
 
54
+ ## Schedule choice
55
+
56
+ Use a **PromptEmitter** in one of two modes:
57
+
58
+ ### Default: conservative idle goal
59
+
60
+ Use `every = "idle"` when the user did not ask for autopilot-style busy-session progress.
61
+
62
+ This matches Codex's conservative continuation model: continue only at safe idle boundaries.
63
+
64
+ ### Autopilot-compatible timed goal
65
+
66
+ Use `everySchedule = ["2m", "5m", "10m"]` instead of `every = "idle"` when any of these are true:
67
+
68
+ - the user mentions autopilot, busy sessions, continuous work, "keep nudging", or "while Copilot stays busy"
69
+ - the user explicitly says to work autonomously in the current session
70
+ - the current session is in autopilot mode and the goal is expected to advance while other work may be active
71
+
72
+ Timed goal prompts use `session.send()` and can keep the objective visible even when the thread may not become idle often. The runtime preserves the iteration budget when a prompt send is deferred because the session is still busy.
73
+
40
74
  ## What to create
41
75
 
42
- Use `tap_start_emitter` to create a **PromptEmitter**:
76
+ Use `tap_start_emitter`:
43
77
 
44
78
  - `prompt` — a fully self-contained goal-loop prompt using the template below.
45
- - `every = "idle"` the loop advances only when the session is idle.
79
+ - `every = "idle"` for default goals, OR `everySchedule = ["2m", "5m", "10m"]` for autopilot-compatible goals.
46
80
  - `scope = "temporary"`, `managedBy = "modelOwned"`.
47
81
  - `subscribe = false` — PromptEmitter output already reaches the session through `session.send()`.
48
82
  - `maxRuns` — use the user's requested budget if provided; otherwise default to `50`.
@@ -58,36 +92,88 @@ Write the prompt so it stands alone because it will run later without the origin
58
92
  ```text
59
93
  You are running a tap-goal autonomous goal loop.
60
94
 
61
- Goal:
62
- <untrusted_objective>
95
+ Goal contract:
96
+ <untrusted_goal_contract>
97
+ Objective:
63
98
  <objective>
64
- </untrusted_objective>
99
+
100
+ Outcome:
101
+ <desired end state>
102
+
103
+ Verification surface:
104
+ <test, benchmark, command output, artifact, or source material that proves completion>
105
+
106
+ Constraints:
107
+ <what must not regress>
108
+
109
+ Boundaries:
110
+ <files, tools, data, repos, or resources allowed>
111
+
112
+ Iteration policy:
113
+ <how to choose the next best action between attempts>
114
+
115
+ Blocked stop condition:
116
+ <what to report if no defensible path remains and what would unlock progress>
117
+ </untrusted_goal_contract>
65
118
 
66
119
  Emitter name: <goal-emitter-name>
120
+ EventStream name: <goal-emitter-name>
121
+ Schedule mode: <idle | timed-autopilot>
67
122
  Iteration budget: <max-runs>
68
123
 
69
124
  At the start of each iteration:
70
- 1. Call tap_list_emitters and locate the emitter entry in the returned list whose name is exactly '<goal-emitter-name>'.
125
+ 1. Call tap_list_emitters and locate the emitter entry whose name is exactly '<goal-emitter-name>'.
71
126
  2. Read its current runs and maxRuns values.
72
127
  3. If the emitter is missing, report that the goal loop is no longer running and stop.
73
128
  4. Estimate remaining iterations.
74
129
 
75
- Auto-steering rules:
130
+ Continuation rules:
131
+ - Treat the goal as a completion contract: work -> check evidence -> continue, complete, or stop blocked.
76
132
  - If remaining iterations are low (3 or fewer), switch into wrap-up mode.
77
- - In wrap-up mode, prefer finishing the smallest high-value task, validating what changed, and leaving a precise handoff.
78
- - If only 1 iteration remains and the goal is not complete, do not start broad new work. Leave the best concise handoff you can.
79
- - Do not treat budget exhaustion as success.
133
+ - If only 1 iteration remains and the goal is not complete, do not start broad new work. Produce a budget-limited handoff instead.
134
+ - Do not treat budget exhaustion or a lifecycle "reached run budget" message as success.
135
+ - If this iteration makes no progress-producing tool calls beyond required status/ledger bookkeeping and does not change evidence, call `tap_post` with `channel='<goal-emitter-name>'` and a no-action handoff, then stop the emitter rather than spinning.
136
+ - If the remaining delta is unchanged from the previous ITERATION RECORD, post a STALLED LOOP record and stop rather than spending the rest of the budget.
137
+
138
+ Evidence-audit rules:
139
+ - Before marking complete, identify the verification surface from the goal contract.
140
+ - Check the evidence directly: test output, benchmark result, file content, diff, generated artifact, source material, or other concrete proof.
141
+ - When the evidence is a workspace file, EventStream entry, or already-run command result, call `tap_verify_goal_output` or `tap_audit_claims` before GOAL COMPLETE.
142
+ - Check listed constraints for regressions.
143
+ - If the verification surface cannot be checked, treat the goal as blocked, not complete.
144
+ - Completion requires an explicit evidence audit in the final response and in the EventStream.
145
+ - Wrap machine-readable EventStream records with explicit markers:
146
+ `=== BEGIN_ITERATION_RECORD ===` / `=== END_ITERATION_RECORD ===`,
147
+ `=== BEGIN_GOAL_COMPLETE ===` / `=== END_GOAL_COMPLETE ===`,
148
+ `=== BEGIN_GOAL_BLOCKED ===` / `=== END_GOAL_BLOCKED ===`.
149
+
150
+ Research/audit goal rules:
151
+ - For research, reproduction, audit, or investigation goals, maintain a claim ledger.
152
+ - Each ledger item should include: Claim, route attempted, evidence surface, status, and remaining uncertainty.
153
+ - Use statuses such as confirmed, approximate-support, blocked, and uncertain. Do not flatten partial support into success.
80
154
 
81
155
  On this iteration:
82
156
  1. Briefly assess current progress toward the goal and the remaining iteration budget.
83
- 2. If the goal is already achieved, call tap_stop_emitter for '<goal-emitter-name>' with scope='temporary', report that the goal is complete, and stop.
84
- 3. If the goal is blocked by missing information, permissions, failing external systems, or an unsafe action, report the blocker, call tap_stop_emitter for '<goal-emitter-name>' with scope='temporary', and stop.
85
- 4. Otherwise, choose the next smallest useful action toward the goal that fits the remaining budget and perform it.
86
- 5. Validate the action using the repository's existing checks when relevant.
87
- 6. End with a concise progress update, what remains, and the best next step if the loop stops before completion.
157
+ 2. If the goal is already achieved, first call `tap_verify_goal_output` or `tap_audit_claims` against the verification surface. If verification passes, call `tap_post` with `channel='<goal-emitter-name>'` and a marked GOAL COMPLETE evidence audit in `message`, then call tap_stop_emitter for '<goal-emitter-name>' with scope='temporary', report that the goal is complete, and stop.
158
+ 3. If the goal is blocked by missing information, permissions, failing external systems, or an unsafe action, first call `tap_post` with `channel='<goal-emitter-name>'` and a GOAL BLOCKED report in `message`, then call tap_stop_emitter for '<goal-emitter-name>' with scope='temporary', report the blocker, and stop.
159
+ 4. If this is the final iteration and the goal is not complete, do not start substantive new work. Call `tap_post` with `channel='<goal-emitter-name>'` and a BUDGET LIMITED summary in `message`: progress, evidence gathered, remaining work, recommended next `/tap-goal ...` invocation, and suggested fresh budget. Then leave a concise handoff.
160
+ 5. Otherwise, choose the next smallest useful action toward the goal that fits the remaining budget and perform it.
161
+ 6. Validate the action using the repository's existing checks when relevant.
162
+ 7. End by calling `tap_post` with `channel='<goal-emitter-name>'` and an ITERATION RECORD in `message` containing:
163
+ - iteration and budget used
164
+ - action taken
165
+ - evidence checked and result
166
+ - claim ledger entries when this is a research/audit goal
167
+ - remaining_delta or unchanged_delta status
168
+ - current status: progressing, complete, blocked, or budget-limited
169
+ - next best action
170
+ - branch, commit SHA, PR URL, run URL, or issue key when relevant
171
+ 8. End the user-visible response with the same concise progress update, what remains, and the next best step if the loop stops before completion.
88
172
 
89
173
  Safety rules:
90
174
  - Do not make unrelated changes.
175
+ - Do not modify this goal emitter's own `every`, `everySchedule`, `maxRuns`, event filter, or goal contract while it is running unless the user explicitly asks.
176
+ - Do not spawn additional emitters from this goal unless orchestration is explicitly part of the goal contract.
91
177
  - Do not mark the goal complete unless the objective is actually achieved and no required work remains.
92
178
  - Do not treat reaching the iteration budget as success.
93
179
  - Do not continue if the next step requires explicit user approval.
@@ -95,7 +181,7 @@ Safety rules:
95
181
  - Stop yourself when done or blocked; do not rely on the user to notice.
96
182
  ```
97
183
 
98
- Substitute the real objective, emitter name, and max iteration count before passing the prompt to `tap_start_emitter`.
184
+ Substitute the real objective, goal-contract fields, emitter name, schedule mode, and max iteration count before passing the prompt to `tap_start_emitter`.
99
185
 
100
186
  ## Required behavior
101
187
 
@@ -110,26 +196,36 @@ When this skill is invoked:
110
196
  - if none exist, report that no goal loop is running
111
197
  - if multiple exist and the user did not name one, ask them to choose one after showing `/tap-goal status`
112
198
  - when you do stop one, call `tap_stop_emitter` with its exact name and confirm that it will not fire again
113
- 4. If the user is asking to pause an existing goal, explain that pausing is not supported for goal loops because idle PromptEmitters do not preserve resumable internal state. Offer to stop the loop instead. Only call `tap_stop_emitter` if they confirm; otherwise take no action and leave the goal loop running.
114
- 5. If the user is asking to resume a goal, create a new `/tap-goal` loop with the resumed objective; ask for the objective if it is not clear.
199
+ 4. If the user is asking to pause an existing goal:
200
+ - Explain that runtime-native pause is not supported because PromptEmitters do not preserve resumable internal state.
201
+ - Offer a simulated pause: call `tap_post` with a PAUSED NOTE containing objective, current status, progress, and resume guidance, then call `tap_stop_emitter`.
202
+ - Only stop the emitter if the user confirms; otherwise leave it running.
203
+ 5. If the user is asking to resume a goal:
204
+ - If they provide an objective, create a new `/tap-goal` loop from it.
205
+ - If they name a prior goal stream, inspect its history with `tap_stream_history` using `channel='<goal-stream-name>'`, recover the latest PAUSED NOTE or handoff if available, and create a new loop from that objective.
206
+ - If the objective is not clear, ask for it.
115
207
  6. Before creating a new goal, check for existing `goal-*` emitters. If one exists and the user did not explicitly ask to replace it, ask for confirmation before starting another goal loop.
116
- 7. If the user wants the loop to keep nudging the session even while Copilot stays busy in autopilot-style work, explain that idle goal loops may not fire until the session becomes idle. Suggest a timed PromptEmitter or hook/session-injector based delivery instead.
117
- 8. Otherwise, create the idle PromptEmitter using the template above.
208
+ 7. Choose idle vs timed-autopilot schedule using the schedule rules above.
209
+ 8. Create the PromptEmitter using the template above.
118
210
  9. Confirm to the user:
119
211
  - Goal emitter name
120
212
  - EventStream name
121
213
  - Objective
214
+ - Verification surface
215
+ - Constraints
216
+ - Schedule mode (`idle` or `timed-autopilot`)
122
217
  - Max iteration count
123
- - That it will advance when the session is idle and stop itself when complete or blocked
218
+ - That it will stop itself when complete, blocked, or budget-limited
124
219
  10. Stop there. Do not immediately perform the first goal iteration unless the user explicitly asks you to start working now.
125
220
 
126
221
  ## Iteration budget
127
222
 
128
- Idle goal loops must always have `maxRuns`.
223
+ Goal loops must always have `maxRuns`.
129
224
 
130
225
  - If the user gives a budget, use it.
131
226
  - Otherwise, default to `50`.
132
227
  - If the objective is large, tell the user they can invoke `/tap-goal` again with a higher budget.
228
+ - Budget exhaustion is a handoff state, not success.
133
229
 
134
230
  ## Persistence
135
231
 
@@ -7,6 +7,12 @@ user-invocable: true
7
7
 
8
8
  Create a timed or idle PromptEmitter with `tap_start_emitter`.
9
9
 
10
+ If the request includes a completion condition such as "until", "keep going
11
+ until", "stop when", "work until done", or "iterate until complete", do not
12
+ create a plain loop. Redirect to `/tap-goal` semantics instead, because the
13
+ user is asking for a completion contract with evidence, budget, and stop
14
+ conditions rather than a recurring prompt.
15
+
10
16
  ## Expected input
11
17
 
12
18
  Interpret the invocation as:
@@ -63,9 +63,25 @@ Steps:
63
63
  - Lines that indicate important events (errors, warnings, state changes) → candidates for `{ "match": "...", "outcome": "inject" }`.
64
64
  - Lines that are never relevant at all → candidates for tighter keep/drop rules.
65
65
  4. Compare what you see against the current filter patterns for emitter '<command-emitter-name>'.
66
- 5. Only update if the evidence clearly justifies a change (signal-to-noise is poor or a pattern is clearly wrong).
67
- 6. If an update is needed, call tap_set_event_filter with the revised patterns for emitter '<command-emitter-name>'.
68
- 7. Do not report your findings to the user unless you made a change. If you made a change, send one short message describing what you updated and why.
66
+ 5. Use this shared contract when judging the stream:
67
+ - stream_purpose: <why the user wanted this monitor>
68
+ - signal_vocabulary: errors, warnings, failures, state changes, explicit success/failure markers
69
+ - noise_vocabulary: timestamps-only, heartbeat-only, repeated unchanged status, empty pings
70
+ 6. Only update if the evidence clearly justifies a change (signal-to-noise is poor or a pattern is clearly wrong).
71
+ 7. If an update is needed, call tap_set_event_filter with the revised patterns for emitter '<command-emitter-name>'.
72
+ 8. Always call tap_post with channel '<stream-name>' and a REVIEW RECORD wrapped in markers:
73
+ === BEGIN_REVIEW_RECORD ===
74
+ {
75
+ "reviewed_at": "<ISO timestamp>",
76
+ "entries_examined": <number>,
77
+ "issue_type": "noise_pattern|missed_signal|over_filtering|duplicate_inject|no_change",
78
+ "patterns_changed": ["short label for each change"],
79
+ "remaining_noise_delta": ["what still looks noisy or uncertain"],
80
+ "signal_vocabulary": ["terms treated as signal"],
81
+ "noise_vocabulary": ["terms treated as noise"]
82
+ }
83
+ === END_REVIEW_RECORD ===
84
+ 9. Do not report your findings to the user unless you made a change. If you made a change, send one short message describing what you updated and why.
69
85
  ```
70
86
 
71
87
  Substitute the real emitter name and stream name into the prompt before passing it to `tap_start_emitter`.
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: tap-orchestrate
3
+ description: "Create a coordinator PromptEmitter for multi-agent tap workflows with role-specific sub-emitters, gated handoffs, and evidence records. Use when the user asks to orchestrate multiple agents, roles, workstreams, or parallel implementation/review/test phases."
4
+ argument-hint: "<objective and roles>"
5
+ user-invocable: true
6
+ ---
7
+
8
+ Create a coordinator PromptEmitter that manages a multi-agent workflow using tap
9
+ emitters and EventStreams.
10
+
11
+ Use this for work that naturally decomposes into roles such as planner,
12
+ implementer, reviewer, tester, documenter, provider-builder, or release
13
+ coordinator. Do not use it for a single straightforward task.
14
+
15
+ ## What to create
16
+
17
+ Use `tap_start_emitter` to create a **coordinator PromptEmitter**:
18
+
19
+ - Name: `orchestrate-<objective-slug>`.
20
+ - Prompt: a self-contained orchestration contract.
21
+ - Schedule: `everySchedule = ["2m", "5m", "10m"]`.
22
+ - `lifespan = "temporary"` unless the user explicitly asks for persistence.
23
+ - `ownership = "modelOwned"`.
24
+ - `subscribe = false`.
25
+ - `maxRuns = 50` unless the user gives a budget.
26
+
27
+ The coordinator may create role-specific PromptEmitters only when the role has a
28
+ clear deliverable and verification surface. Each role emitter should write its
29
+ handoff to an EventStream with a stable name:
30
+
31
+ ```text
32
+ orchestrate-<objective>-<role>
33
+ ```
34
+
35
+ ## Coordinator prompt contract
36
+
37
+ The coordinator prompt must include:
38
+
39
+ ```text
40
+ Objective: <user objective>
41
+ Roles: <role list, deliverables, and verification surface>
42
+ Gate policy:
43
+ - Do not hand off to the next role until required artifacts or EventStream notes exist.
44
+ - Read role EventStreams with tap_stream_history before deciding a gate is satisfied.
45
+ - If parallel work is safe, create independent role emitters in the same iteration.
46
+ - If a role blocks, post ORCHESTRATION BLOCKED and stop the coordinator.
47
+ Audit trail:
48
+ - After every decision, call tap_post to the coordinator stream with ORCHESTRATION RECORD:
49
+ role, gate, evidence checked, decision, next handoff.
50
+ Safety:
51
+ - Do not spawn duplicate role emitters.
52
+ - Do not mutate another role's scope unless the coordinator evidence supports it.
53
+ - Stop all role emitters when the orchestration completes or blocks.
54
+ ```
55
+
56
+ ## Required behavior
57
+
58
+ 1. Parse the objective and any requested roles.
59
+ 2. If roles are missing, infer a minimal role set from the objective:
60
+ planner, implementer, reviewer, validator.
61
+ 3. Create the coordinator PromptEmitter only; do not immediately create role
62
+ emitters in the setup turn. The coordinator will create them when it runs.
63
+ 4. Confirm:
64
+ - coordinator emitter name and stream
65
+ - roles
66
+ - gate policy
67
+ - max iteration budget
68
+
69
+ ## Good role patterns
70
+
71
+ - **planner**: produce plan and boundaries; verification is a plan note.
72
+ - **implementer**: make code/doc changes; verification is diff + focused checks.
73
+ - **reviewer**: inspect changes; verification is review note with findings.
74
+ - **validator**: run tests/build/evals; verification is command evidence.
75
+ - **release**: bump/push/publish only after validator passes.
76
+
77
+ ## When not to use
78
+
79
+ Do not create orchestration for a normal `/tap-goal` objective that one agent can
80
+ complete directly. Orchestration adds coordination cost and should only be used
81
+ when parallel roles or gated handoffs are genuinely useful.
package/dist/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "2.0.6"
2
+ "version": "2.0.8"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilot-tap-extension",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Copilot CLI extension for background event emitters, event streams, and session injection.",
5
5
  "type": "module",
6
6
  "license": "MIT",