@rudderhq/agent-runtime-utils 0.7.9 → 0.7.11
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/dist/rudder-mcp-contract.d.ts +10 -1
- package/dist/rudder-mcp-contract.d.ts.map +1 -1
- package/dist/rudder-mcp-contract.js +38 -0
- package/dist/rudder-mcp-contract.js.map +1 -1
- package/dist/rudder-mcp-tool-descriptors.generated.d.ts +9 -1
- package/dist/rudder-mcp-tool-descriptors.generated.d.ts.map +1 -1
- package/dist/rudder-mcp-tool-descriptors.generated.js +10 -1
- package/dist/rudder-mcp-tool-descriptors.generated.js.map +1 -1
- package/dist/server-utils.prompts.d.ts +4 -3
- package/dist/server-utils.prompts.d.ts.map +1 -1
- package/dist/server-utils.prompts.js +184 -16
- package/dist/server-utils.prompts.js.map +1 -1
- package/dist/server-utils.prompts.test.js +130 -6
- package/dist/server-utils.prompts.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -22,17 +22,99 @@ export const AGENT_ISSUE_CREATION_PROMPT_TEMPLATE = `You are agent {{agent.id}}
|
|
|
22
22
|
Interpret the user's instruction and create exactly one real Rudder Issue. Generate a clear, specific title and a complete description that preserves the user's intent and relevant context. Use the stable Rudder Issue creation tool when it is available; otherwise use the existing \`rudder issue create\` CLI compatibility path.
|
|
23
23
|
|
|
24
24
|
Carry the project, goal, and parent issue context into the created Issue when it is valid and relevant. The request record is already durable; do not create an Issue for the request itself, do not create duplicates, and do not modify unrelated Issues or files. Do not invent an assignee or notification target. After the single Issue is created, report its identifier and stop.`;
|
|
25
|
-
const RUDDER_GOAL_RUNTIME_BOUNDARY = `This is a Rudder product Goal, not a Codex internal goal. Do not call Codex \`create_goal\`, \`update_goal\`, or \`get_goal\` for it; those tools do not manage Rudder Goals.
|
|
25
|
+
const RUDDER_GOAL_RUNTIME_BOUNDARY = `This is a Rudder product Goal, not a Codex internal goal. Do not call Codex \`create_goal\`, \`update_goal\`, or \`get_goal\` for it; those tools do not manage Rudder Goals.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Treat the supplied Goal Runtime Context as the current wake snapshot. If the Goal ID is present but the contract, current Plan, continuation, recent evidence, proposal state, or blocker history needed for this turn is missing or stale, call \`rudder_goal_context\` once when that managed tool is available, then reason from the returned Goal context. If the Goal ID is missing, the managed context tool is unavailable, or the refreshed context still lacks a required fact, name the exact missing fact and request refreshed context. Missing context is not by itself a validated blocked conclusion.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
If the Goal packet or this protocol names an exact managed Rudder tool, call that typed tool directly. Do not load \`rudder-docs\`, inspect skill files, or run discovery commands merely to confirm a named tool. Do not use shell, Bash, curl, or the \`rudder\` CLI to read or mutate Goal state.
|
|
30
|
+
|
|
31
|
+
Use only tools that are actually available in the runtime. Never claim that a Plan, wait, review, Checkpoint, proposal, or transition was persisted when it exists only in reasoning or prose.
|
|
32
|
+
|
|
33
|
+
Record meaningful evidence-backed advancement with \`rudder_goal_progress\`; the tool automatically attributes progress to this Run. If evidence shows the Goal contract itself must change, use \`rudder_goal_change_propose\` so a human can review the exact delta; never silently redefine the outcome or boundaries. When the outcome is ready for review, use \`rudder_goal_result_propose\` with the current contract revision and supporting evidence. A human must accept every terminal Goal result. A Result Proposal requests acceptance; it does not let the runtime mark, close, or claim the Goal complete.`;
|
|
34
|
+
const RUDDER_GOAL_ADVANCEMENT_PROTOCOL = `## Goal Advancement Protocol
|
|
35
|
+
|
|
36
|
+
Use this as a phase router, not a checklist to replay mechanically. Enter at the phase implied by the wake reason and current Goal facts, skip phases whose exit conditions are already satisfied, and advance as far as current authority, evidence, and available tools allow in this Run.
|
|
37
|
+
|
|
38
|
+
### Phase 1 - Reconstruct the current state
|
|
39
|
+
|
|
40
|
+
- Read the accepted Contract, current persisted Plan, current continuation, latest relevant Evidence and feedback, open proposals or reviews, deadlines, and autonomy envelope.
|
|
41
|
+
- Keep three things separate: the Contract defines the outcome and boundaries; the Plan is the current mutable strategy; a bounded Run is one attempt under that Plan.
|
|
42
|
+
- Treat the recorded continuation as the current handoff hypothesis, not an instruction to ignore newer Evidence or feedback.
|
|
43
|
+
- Resolve missing or stale context through the managed context rule above before making a consequential Goal mutation, a three-turn blocker judgment, or a Result Proposal.
|
|
44
|
+
|
|
45
|
+
### Phase 2 - Check that the Goal is executable
|
|
46
|
+
|
|
47
|
+
- An active Goal is already human-confirmed. Do not restart broad Goal shaping on every wake.
|
|
48
|
+
- Check whether the outcome, required criteria, evaluation boundary, evidence expectations, authority, and next continuation are concrete enough for the next bounded decision.
|
|
49
|
+
- Ask only for a missing fact that materially changes execution. If the missing fact can be discovered safely within current authority, discover it instead of handing the work back.
|
|
50
|
+
- If only the strategy must change, stay inside the Contract and Replan. If the outcome, criteria, deadlines, authority, budget boundary, or guardrails must change, use the Contract-change route in Phase 7.
|
|
51
|
+
|
|
52
|
+
### Phase 3 - Plan or Replan
|
|
53
|
+
|
|
54
|
+
- State the current Goal gap, the working hypothesis, one bounded next commitment, the Evidence it should produce, and the stop or invalidation condition.
|
|
55
|
+
- Prefer a commitment that can produce decision-relevant Evidence in this Run. Do not stop after writing a Plan when an authorized, meaningful next action can be executed now.
|
|
56
|
+
- Replan when new Evidence, feedback, a failed assumption, a review finding, or a changed Contract invalidates the current path. A Replan must choose a materially different path or explain why no such path exists; renaming the same failed action is not a Replan.
|
|
57
|
+
- Plan and Replan changes remain Agent-owned while they stay inside the accepted autonomy envelope. They do not silently revise the Goal Contract.
|
|
58
|
+
- Persist a Plan/Replan only through a real named Goal Plan mechanism. If no such mechanism is available, label the proposed strategy as Run-local and unpersisted in the closeout; do not imply that Rudder saved or adopted it for a later wake.
|
|
59
|
+
|
|
60
|
+
### Phase 4 - Run an optional Plan or Replan review
|
|
61
|
+
|
|
62
|
+
- Invoke a Plan/Replan review only when the Contract, continuation, risk policy, or explicit human instruction requires it and a real Review or Verification mechanism is available.
|
|
63
|
+
- The review checks assumptions, material risks, authority boundaries, and whether the proposed commitment can produce useful Evidence.
|
|
64
|
+
- A Reviewer returns findings; it does not become the Goal Owner, approve a Contract change, perform the Owner's work by reviewing it, or replace final human Acceptance.
|
|
65
|
+
- If review is required but no review mechanism is available, report that exact unpersisted gate. Do not invent a completed review.
|
|
66
|
+
|
|
67
|
+
### Phase 5 - Execute one bounded commitment
|
|
68
|
+
|
|
69
|
+
- Perform or delegate one coherent, bounded attempt through the owning work domain. Respect approvals, budgets, permissions, idempotency, and external-effect recovery boundaries.
|
|
70
|
+
- Preserve candidate, environment, and evidence identity across action and verification. Do not retry an external effect whose outcome is unknown.
|
|
71
|
+
- A Run ending, a task completing, or an artifact existing is not Goal completion. It is an observation to evaluate against the Contract.
|
|
72
|
+
|
|
73
|
+
### Phase 6 - Observe and checkpoint
|
|
74
|
+
|
|
75
|
+
- Separate activity (what was attempted), output (what was produced), and Evidence (what proves an external or criterion-relevant fact).
|
|
76
|
+
- Compare fresh Evidence and feedback with every affected required criterion, the current hypothesis, guardrails, and deadlines.
|
|
77
|
+
- Call \`rudder_goal_progress\` only for meaningful advancement, Evidence, or a named bottleneck backed by valid evidence references. Do not manufacture an evidence reference to record narration.
|
|
78
|
+
- Treat the resulting judgment as the Checkpoint for routing. When \`rudder_goal_checkpoint\` is available, call \`rudder_goal_checkpoint\` exactly once for this bounded Run with the current Goal ID, expected Plan revision, complete Evidence references, and exactly one continuation (commitment, verification, wait, or decision). Include a full next Plan payload only when Replan changed the strategy. Do not substitute a progress Activity for a Checkpoint, and do not claim the handoff is durable until the typed tool succeeds. If no Checkpoint tool exists, state the judgment in the Run closeout without claiming it was persisted as a separate object.
|
|
79
|
+
|
|
80
|
+
### Phase 7 - Choose exactly one primary continuation route
|
|
81
|
+
|
|
82
|
+
- **Continue:** the Plan is still viable; execute the next bounded commitment now when possible.
|
|
83
|
+
- **Replan:** Evidence or feedback invalidated the current path; return to Phase 3.
|
|
84
|
+
- **Wait:** name the external fact, event, time, or actor being awaited, plus the resume trigger, expiry, and safe fallback. A known wait is not blocked. Persist the wait only through a real named continuation, scheduling, or Decision mechanism; otherwise label it Run-local and unpersisted and do not imply that Rudder will resume it automatically.
|
|
85
|
+
- **Human decision:** provide the exact question, affected boundary, Evidence, recommendation, options, response deadline, and safe fallback. Use a real typed Decision, Approval, Assistance, or Review mechanism when available; otherwise disclose that the request was not persisted.
|
|
86
|
+
- **Contract change:** call \`rudder_goal_change_propose\` with the current contract revision, exact before/after meaning, rationale, and supporting Evidence. Continue under the existing Contract until a human-applied decision says otherwise.
|
|
87
|
+
- **Blocked audit:** use Phase 8. Do not transfer responsibility on the first failure.
|
|
88
|
+
- **Result Proposal:** use Phase 9 only when every required criterion can be honestly mapped to fresh Evidence or an explicit non-success verdict.
|
|
89
|
+
|
|
90
|
+
### Phase 8 - Audit a possible block
|
|
91
|
+
|
|
92
|
+
- Do not mark or claim the Goal blocked the first time a blocker appears.
|
|
93
|
+
- If the same blocker persists for three consecutive Goal turns, first perform a Replan audit and look for a materially different path.
|
|
94
|
+
- If Replan finds a viable path, continue through that path.
|
|
95
|
+
- If Replan still cannot produce meaningful progress, report the Goal as operationally blocked and ask for the exact human input or external-state change required.
|
|
96
|
+
- Resuming after a blocked conclusion starts a fresh three-turn audit.
|
|
97
|
+
- Do not use blocked merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.
|
|
98
|
+
- Judge whether the blocker is materially the same from recent Goal history; no blocker fingerprint schema is required. If the necessary three-turn history is absent, refresh managed Goal context once or report that the audit cannot yet establish a block.
|
|
99
|
+
|
|
100
|
+
### Phase 9 - Review and propose the result
|
|
101
|
+
|
|
102
|
+
- Build a criterion-to-Evidence packet with the current contract revision, evidence identity and freshness, guardrail state, unresolved risk, and the mode-specific proposed result.
|
|
103
|
+
- If policy requires a Result review, route the packet through the available Review or Verification mechanism first. A review finding returns to Replan, Contract change, or evidence correction; it cannot choose the terminal result.
|
|
104
|
+
- Call \`rudder_goal_result_propose\` only after the evidence packet passes required preflight and any required review. No Evidence means no successful terminal proposal.
|
|
105
|
+
- Stop execution while a Result Proposal is ready for human Acceptance. Human rejection must name a scoped finding and cannot silently rewrite the Contract or waive missing Evidence.
|
|
106
|
+
|
|
107
|
+
### Required turn closeout
|
|
108
|
+
|
|
109
|
+
Before ending the Run, state: the phase reached, what materially changed, the Evidence observed or still missing, the primary continuation route, and the next responsible actor or resume trigger. Persist supported Goal facts with the managed tools before reporting them. If nothing durable changed, say so plainly and leave one bounded next action, wait, or decision request; do not claim Goal progress or completion.`;
|
|
30
110
|
export const GOAL_STARTED_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agent.name}}). A Goal has started and you are responsible for advancing it.
|
|
31
111
|
|
|
32
112
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
33
113
|
|
|
34
114
|
${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
35
115
|
|
|
116
|
+
${RUDDER_GOAL_ADVANCEMENT_PROTOCOL}
|
|
117
|
+
|
|
36
118
|
## Goal Runtime Context
|
|
37
119
|
|
|
38
120
|
**Goal:** {{context.goalRuntime.goalTitle}}
|
|
@@ -44,16 +126,28 @@ ${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
|
44
126
|
**Current contract:**
|
|
45
127
|
{{context.goalRuntime.currentContract}}
|
|
46
128
|
|
|
129
|
+
**Current Plan:**
|
|
130
|
+
{{context.goalRuntime.currentPlan}}
|
|
131
|
+
|
|
47
132
|
**Continuation:**
|
|
48
133
|
{{context.goalRuntime.continuation}}
|
|
49
134
|
|
|
50
|
-
|
|
135
|
+
**Latest checkpoint facts:**
|
|
136
|
+
{{context.goalRuntime.latestCheckpoint}}
|
|
137
|
+
|
|
138
|
+
## Wake Entry - Goal Started
|
|
139
|
+
|
|
140
|
+
Start at Plan/Replan because activation already confirmed the Contract. Validate and use the persisted initial Plan before replacing it. Verify that the packet is executable, form the first bounded commitment and expected Evidence, run any policy-required Plan review, then execute the commitment in this Run when authority and dependencies allow. Do not finish by merely restating the Goal or producing a Plan if meaningful work can start now.
|
|
141
|
+
|
|
142
|
+
Preserve the stated outcome and Contract boundaries. If the activation packet is not executable, follow the missing-context, human-decision, or Contract-change route instead of silently redefining it.`;
|
|
51
143
|
export const GOAL_FEEDBACK_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agent.name}}). New feedback requires your review on a Goal you own.
|
|
52
144
|
|
|
53
145
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
54
146
|
|
|
55
147
|
${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
56
148
|
|
|
149
|
+
${RUDDER_GOAL_ADVANCEMENT_PROTOCOL}
|
|
150
|
+
|
|
57
151
|
## Goal Runtime Context
|
|
58
152
|
|
|
59
153
|
**Goal:** {{context.goalRuntime.goalTitle}}
|
|
@@ -65,9 +159,15 @@ ${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
|
65
159
|
**Current contract:**
|
|
66
160
|
{{context.goalRuntime.currentContract}}
|
|
67
161
|
|
|
162
|
+
**Current Plan:**
|
|
163
|
+
{{context.goalRuntime.currentPlan}}
|
|
164
|
+
|
|
68
165
|
**Continuation:**
|
|
69
166
|
{{context.goalRuntime.continuation}}
|
|
70
167
|
|
|
168
|
+
**Latest checkpoint facts:**
|
|
169
|
+
{{context.goalRuntime.latestCheckpoint}}
|
|
170
|
+
|
|
71
171
|
## Goal Feedback
|
|
72
172
|
|
|
73
173
|
**Feedback ID:** {{context.goalRuntime.feedbackId}}
|
|
@@ -75,13 +175,25 @@ ${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
|
75
175
|
**Feedback body:**
|
|
76
176
|
{{context.goalRuntime.feedbackBody}}
|
|
77
177
|
|
|
78
|
-
|
|
178
|
+
## Wake Entry - Goal Feedback
|
|
179
|
+
|
|
180
|
+
Classify the feedback before acting:
|
|
181
|
+
|
|
182
|
+
- new fact or Evidence -> observe and checkpoint;
|
|
183
|
+
- strategy guidance inside the Contract -> Plan/Replan;
|
|
184
|
+
- outcome, criteria, boundary, deadline, authority, or guardrail change -> Contract-change proposal;
|
|
185
|
+
- review or result finding -> scoped remediation, evidence correction, or Replan;
|
|
186
|
+
- question or clarification -> answer it without treating it as implicit authorization.
|
|
187
|
+
|
|
188
|
+
Reconcile the feedback with newer Goal facts, then continue from the selected route in this Run when possible. Do not merely acknowledge feedback, and do not treat ordinary feedback as permission to change the Contract or perform a governed action.`;
|
|
79
189
|
export const GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agent.name}}). A human decided a proposed change to a Goal you own.
|
|
80
190
|
|
|
81
191
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
82
192
|
|
|
83
193
|
${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
84
194
|
|
|
195
|
+
${RUDDER_GOAL_ADVANCEMENT_PROTOCOL}
|
|
196
|
+
|
|
85
197
|
## Goal Runtime Context
|
|
86
198
|
|
|
87
199
|
**Goal:** {{context.goalRuntime.goalTitle}}
|
|
@@ -93,9 +205,15 @@ ${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
|
93
205
|
**Current contract:**
|
|
94
206
|
{{context.goalRuntime.currentContract}}
|
|
95
207
|
|
|
208
|
+
**Current Plan:**
|
|
209
|
+
{{context.goalRuntime.currentPlan}}
|
|
210
|
+
|
|
96
211
|
**Continuation:**
|
|
97
212
|
{{context.goalRuntime.continuation}}
|
|
98
213
|
|
|
214
|
+
**Latest checkpoint facts:**
|
|
215
|
+
{{context.goalRuntime.latestCheckpoint}}
|
|
216
|
+
|
|
99
217
|
## Goal Change Decision
|
|
100
218
|
|
|
101
219
|
**Decision:** {{context.goalRuntime.decision}}
|
|
@@ -104,8 +222,47 @@ ${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
|
104
222
|
**Decision note:**
|
|
105
223
|
{{context.goalRuntime.decisionNote}}
|
|
106
224
|
|
|
107
|
-
|
|
108
|
-
|
|
225
|
+
## Wake Entry - Goal Change Decision
|
|
226
|
+
|
|
227
|
+
- If the decision is approved and applied, treat the supplied latest Contract revision as authoritative, invalidate Plan assumptions tied to the prior revision, and Replan before the next bounded commitment.
|
|
228
|
+
- If the proposal was rejected, preserve the current Contract, use the decision note as feedback, and find a viable path inside the accepted boundaries. If none exists, use the blocked audit rather than re-proposing the same change automatically.
|
|
229
|
+
- If the proposal is superseded, cancelled, stale, or otherwise not applied, do not assume its patch changed the Contract; refresh managed Goal context when the authoritative revision is unclear.
|
|
230
|
+
|
|
231
|
+
Continue from the resulting Contract and decision state in this Run when possible. Acknowledging the decision alone is not advancement unless the Goal is now waiting on a named external trigger or human gate.`;
|
|
232
|
+
export const GOAL_CONTINUATION_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agent.name}}). A prior bounded Goal Run persisted a checkpoint and this continuation wake is ready.
|
|
233
|
+
|
|
234
|
+
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
235
|
+
|
|
236
|
+
${RUDDER_GOAL_RUNTIME_BOUNDARY}
|
|
237
|
+
|
|
238
|
+
${RUDDER_GOAL_ADVANCEMENT_PROTOCOL}
|
|
239
|
+
|
|
240
|
+
## Goal Runtime Context
|
|
241
|
+
|
|
242
|
+
**Goal:** {{context.goalRuntime.goalTitle}}
|
|
243
|
+
**Goal ID:** {{context.goalRuntime.goalId}}
|
|
244
|
+
|
|
245
|
+
**Goal outcome:**
|
|
246
|
+
{{context.goalRuntime.goalOutcome}}
|
|
247
|
+
|
|
248
|
+
**Current contract:**
|
|
249
|
+
{{context.goalRuntime.currentContract}}
|
|
250
|
+
|
|
251
|
+
**Current Plan:**
|
|
252
|
+
{{context.goalRuntime.currentPlan}}
|
|
253
|
+
|
|
254
|
+
**Continuation:**
|
|
255
|
+
{{context.goalRuntime.continuation}}
|
|
256
|
+
|
|
257
|
+
**Latest checkpoint facts:**
|
|
258
|
+
{{context.goalRuntime.latestCheckpoint}}
|
|
259
|
+
|
|
260
|
+
## Wake Entry - Goal Continuation
|
|
261
|
+
|
|
262
|
+
The prior Run has already persisted the checkpoint named above. Reconstruct the current Contract, Plan revision, Evidence, and continuation before acting. Continue only the checkpoint's bounded commitment or verification when its wake condition is satisfied and the Goal is still active. Do not replay the prior action blindly, create a duplicate checkpoint for the same effect, or treat checkpoint persistence as Goal completion.
|
|
263
|
+
|
|
264
|
+
If the checkpoint instead records a wait or human decision, this wake is unexpected: do not invent authorization or execute the waiting action. Refresh managed Goal context, report the mismatch, and leave the Goal waiting for its named actor or external trigger. If a ready Result Proposal exists, stop and wait for human Acceptance.`;
|
|
265
|
+
const GOAL_WAKE_KINDS = new Set(["goal_started", "goal_feedback", "goal_change_decided", "goal_continuation"]);
|
|
109
266
|
const GOAL_RUNTIME_PLACEHOLDER_PREFIX = "context.goalRuntime.";
|
|
110
267
|
const GOAL_CONTEXT_PREFIXES = ["", "payload.", "wakePayload.", "wakeup.payload.", "heartbeat.payload."];
|
|
111
268
|
function asPromptRecord(value) {
|
|
@@ -169,6 +326,8 @@ function detectGoalWakeKind(context) {
|
|
|
169
326
|
return "goal_feedback";
|
|
170
327
|
if (record.goal_change_decided === true || record.goalChangeDecided === true)
|
|
171
328
|
return "goal_change_decided";
|
|
329
|
+
if (record.goal_continuation === true || record.goalContinuation === true)
|
|
330
|
+
return "goal_continuation";
|
|
172
331
|
}
|
|
173
332
|
for (const value of [context.payload, context.wakePayload, wakeup?.payload, heartbeat?.payload]) {
|
|
174
333
|
const detected = goalWakeIndicator(value);
|
|
@@ -180,6 +339,9 @@ function detectGoalWakeKind(context) {
|
|
|
180
339
|
function promptPlaceholder(path, fallback) {
|
|
181
340
|
return path ? `{{context.${path}}}` : fallback;
|
|
182
341
|
}
|
|
342
|
+
function missingGoalRuntimeFact(fact) {
|
|
343
|
+
return `Not provided in the wake context. If the Goal ID and \`rudder_goal_context\` are available, load managed Goal context once; otherwise report the missing ${fact} and request refreshed context.`;
|
|
344
|
+
}
|
|
183
345
|
function continuationPromptValue(context) {
|
|
184
346
|
const kindPath = firstPromptPath(context, prefixedGoalPaths("goalContinuation.kind", "continuation.kind", "currentContinuation.kind", "continuationKind"));
|
|
185
347
|
const summaryPath = firstPromptPath(context, prefixedGoalPaths("goalContinuation.summary", "continuation.summary", "currentContinuation.summary", "continuationSummary", "nextStepSummary"));
|
|
@@ -189,13 +351,15 @@ function continuationPromptValue(context) {
|
|
|
189
351
|
const continuationPath = firstPromptPath(context, prefixedGoalPaths("goalContinuation", "continuation", "currentContinuation", "nextStep"));
|
|
190
352
|
if (continuationPath)
|
|
191
353
|
return promptPlaceholder(continuationPath, "");
|
|
192
|
-
return promptPlaceholder(summaryPath ?? kindPath, "
|
|
354
|
+
return promptPlaceholder(summaryPath ?? kindPath, missingGoalRuntimeFact("continuation"));
|
|
193
355
|
}
|
|
194
356
|
function buildGoalPromptTemplate(context, kind) {
|
|
195
357
|
const goalIdPath = firstPromptPath(context, prefixedGoalPaths("id", "goalId"));
|
|
196
358
|
const goalTitlePath = firstPromptPath(context, prefixedGoalPaths("title", "goalTitle"));
|
|
197
359
|
const goalOutcomePath = firstPromptPath(context, prefixedGoalPaths("outcomeStatement", "goalOutcome", "outcome", "currentGoal.summary", "currentContract.outcomeStatement", "contract.outcomeStatement"));
|
|
198
360
|
const currentContractPath = firstPromptPath(context, prefixedGoalPaths("currentContract", "goalContract", "contract")) ?? firstPromptPath(context, GOAL_CONTEXT_PREFIXES.map((prefix) => `${prefix}goal`));
|
|
361
|
+
const currentPlanPath = firstPromptPath(context, prefixedGoalPaths("goalPlan", "currentPlan", "plan"));
|
|
362
|
+
const latestCheckpointPath = firstPromptPath(context, prefixedGoalPaths("goalCheckpoint", "latestCheckpoint", "checkpoint", "checkpointFacts"));
|
|
199
363
|
const feedbackIdPath = firstPromptPath(context, prefixedGoalPaths("feedback.id", "goalFeedback.id", "feedbackId"));
|
|
200
364
|
const feedbackBodyPath = firstPromptPath(context, prefixedGoalPaths("feedback.body", "goalFeedback.body", "feedbackBody", "body"));
|
|
201
365
|
const decisionPath = firstPromptPath(context, prefixedGoalPaths("decision.decision", "goalDecision.decision"));
|
|
@@ -203,21 +367,25 @@ function buildGoalPromptTemplate(context, kind) {
|
|
|
203
367
|
const decisionNotePath = firstPromptPath(context, prefixedGoalPaths("decision.note", "goalDecision.note"));
|
|
204
368
|
const replacements = {
|
|
205
369
|
goalTitle: promptPlaceholder(goalTitlePath, "Untitled Goal"),
|
|
206
|
-
goalId: promptPlaceholder(goalIdPath, "Not provided in the wake context"),
|
|
207
|
-
goalOutcome: promptPlaceholder(goalOutcomePath, "
|
|
208
|
-
currentContract: promptPlaceholder(currentContractPath, "
|
|
370
|
+
goalId: promptPlaceholder(goalIdPath, "Not provided in the wake context; request refreshed context."),
|
|
371
|
+
goalOutcome: promptPlaceholder(goalOutcomePath, missingGoalRuntimeFact("outcome")),
|
|
372
|
+
currentContract: promptPlaceholder(currentContractPath, missingGoalRuntimeFact("contract")),
|
|
373
|
+
currentPlan: promptPlaceholder(currentPlanPath, missingGoalRuntimeFact("current Plan")),
|
|
374
|
+
latestCheckpoint: promptPlaceholder(latestCheckpointPath, missingGoalRuntimeFact("latest checkpoint facts")),
|
|
209
375
|
continuation: continuationPromptValue(context),
|
|
210
|
-
feedbackId: promptPlaceholder(feedbackIdPath, "
|
|
211
|
-
feedbackBody: promptPlaceholder(feedbackBodyPath, "
|
|
212
|
-
decision: promptPlaceholder(decisionPath, "
|
|
213
|
-
decisionStatus: promptPlaceholder(decisionStatusPath, "
|
|
376
|
+
feedbackId: promptPlaceholder(feedbackIdPath, missingGoalRuntimeFact("feedback id")),
|
|
377
|
+
feedbackBody: promptPlaceholder(feedbackBodyPath, missingGoalRuntimeFact("feedback body")),
|
|
378
|
+
decision: promptPlaceholder(decisionPath, missingGoalRuntimeFact("Goal change decision")),
|
|
379
|
+
decisionStatus: promptPlaceholder(decisionStatusPath, missingGoalRuntimeFact("Goal change decision status")),
|
|
214
380
|
decisionNote: promptPlaceholder(decisionNotePath, "No decision note was provided."),
|
|
215
381
|
};
|
|
216
382
|
let template = kind === "goal_feedback"
|
|
217
383
|
? GOAL_FEEDBACK_PROMPT_TEMPLATE
|
|
218
384
|
: kind === "goal_change_decided"
|
|
219
385
|
? GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE
|
|
220
|
-
:
|
|
386
|
+
: kind === "goal_continuation"
|
|
387
|
+
? GOAL_CONTINUATION_PROMPT_TEMPLATE
|
|
388
|
+
: GOAL_STARTED_PROMPT_TEMPLATE;
|
|
221
389
|
for (const [name, replacement] of Object.entries(replacements)) {
|
|
222
390
|
template = template.replace(`{{${GOAL_RUNTIME_PLACEHOLDER_PREFIX}${name}}}`, replacement);
|
|
223
391
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-utils.prompts.js","sourceRoot":"","sources":["../src/server-utils.prompts.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,6BAA6B,GACxC;;;CAGD,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG;;;;;;;;;;;;;;;;;;;0XAmBsU,CAAC;AAE3X,MAAM,4BAA4B,GAAG;;;;4JAIuH,CAAC;AAE7J,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;EAI1C,4BAA4B;;;;;;;;;;;;;;;;kJAgBoH,CAAC;AAEnJ,MAAM,CAAC,MAAM,6BAA6B,GAAG;;;;EAI3C,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;yMAuB2K,CAAC;AAE1M,MAAM,CAAC,MAAM,mCAAmC,GAAG;;;;EAIjD,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;sIAwBwG,CAAC;AAIvI,MAAM,eAAe,GAAG,IAAI,GAAG,CAAe,CAAC,cAAc,EAAE,eAAe,EAAE,qBAAqB,CAAC,CAAC,CAAC;AACxG,MAAM,+BAA+B,GAAG,sBAAsB,CAAC;AAC/D,MAAM,qBAAqB,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;AAExG,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,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PT_TEMPLATE, COMMENT_MENTION_PROMPT_TEMPLATE, DEFAULT_AGENT_PROMPT_TEMPLATE, GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE, GOAL_FEEDBACK_PROMPT_TEMPLATE, GOAL_STARTED_PROMPT_TEMPLATE, ISSUE_ASSIGN_PROMPT_TEMPLATE, ISSUE_ASSIGNEE_EXECUTION_RAIL, ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE, ISSUE_COMMENTED_PROMPT_TEMPLATE, ISSUE_PASSIVE_FOLLOWUP_PROMPT_TEMPLATE, ISSUE_RECOVERY_PROMPT_TEMPLATE, ISSUE_REVIEW_PROMPT_TEMPLATE, ISSUE_REVIEW_RECOVERY_PROMPT_TEMPLATE, RECOVERY_PROMPT_TEMPLATE, renderTemplate, RUDDER_AGENT_HEARTBEAT_INSTRUCTION, RUDDER_AGENT_OPERATING_CONTRACT, selectPromptTemplate, } from "./server-utils.js";
|
|
2
|
+
import { AGENT_ISSUE_CREATION_PROMPT_TEMPLATE, COMMENT_MENTION_PROMPT_TEMPLATE, DEFAULT_AGENT_PROMPT_TEMPLATE, GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE, GOAL_CONTINUATION_PROMPT_TEMPLATE, GOAL_FEEDBACK_PROMPT_TEMPLATE, GOAL_STARTED_PROMPT_TEMPLATE, ISSUE_ASSIGN_PROMPT_TEMPLATE, ISSUE_ASSIGNEE_EXECUTION_RAIL, ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE, ISSUE_COMMENTED_PROMPT_TEMPLATE, ISSUE_PASSIVE_FOLLOWUP_PROMPT_TEMPLATE, ISSUE_RECOVERY_PROMPT_TEMPLATE, ISSUE_REVIEW_PROMPT_TEMPLATE, ISSUE_REVIEW_RECOVERY_PROMPT_TEMPLATE, RECOVERY_PROMPT_TEMPLATE, renderTemplate, RUDDER_AGENT_HEARTBEAT_INSTRUCTION, RUDDER_AGENT_OPERATING_CONTRACT, selectPromptTemplate, } from "./server-utils.js";
|
|
3
3
|
describe("server-utils prompt contracts", () => {
|
|
4
4
|
it("selects the dedicated single-issue prompt for Agent Issue creation wakes", () => {
|
|
5
5
|
const context = {
|
|
@@ -72,19 +72,92 @@ describe("server-utils prompt contracts", () => {
|
|
|
72
72
|
GOAL_STARTED_PROMPT_TEMPLATE,
|
|
73
73
|
GOAL_FEEDBACK_PROMPT_TEMPLATE,
|
|
74
74
|
GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE,
|
|
75
|
+
GOAL_CONTINUATION_PROMPT_TEMPLATE,
|
|
75
76
|
]) {
|
|
76
77
|
expect(template).toContain("This is a Rudder product Goal, not a Codex internal goal.");
|
|
77
78
|
expect(template).toContain("Do not call Codex `create_goal`, `update_goal`, or `get_goal`");
|
|
79
|
+
expect(template).toContain("call `rudder_goal_context` once");
|
|
80
|
+
expect(template).toContain("contract, current Plan, continuation");
|
|
78
81
|
expect(template).toContain("call that typed tool directly");
|
|
79
82
|
expect(template).toContain("Do not load `rudder-docs`, inspect skill files, or run discovery commands");
|
|
80
|
-
expect(template).toContain("
|
|
83
|
+
expect(template).toContain("Do not use shell, Bash, curl, or the `rudder` CLI");
|
|
81
84
|
expect(template).toContain("`rudder_goal_progress`");
|
|
82
85
|
expect(template).toContain("`rudder_goal_change_propose`");
|
|
83
86
|
expect(template).toContain("`rudder_goal_result_propose`");
|
|
84
87
|
expect(template).toContain("automatically attributes progress to this Run");
|
|
85
88
|
expect(template).toContain("A human must accept every terminal Goal result.");
|
|
89
|
+
expect(template).toContain("Never claim that a Plan, wait, review, Checkpoint, proposal, or transition was persisted");
|
|
86
90
|
}
|
|
87
91
|
});
|
|
92
|
+
it("drives every Goal wake through the complete advancement phase router", () => {
|
|
93
|
+
for (const template of [
|
|
94
|
+
GOAL_STARTED_PROMPT_TEMPLATE,
|
|
95
|
+
GOAL_FEEDBACK_PROMPT_TEMPLATE,
|
|
96
|
+
GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE,
|
|
97
|
+
GOAL_CONTINUATION_PROMPT_TEMPLATE,
|
|
98
|
+
]) {
|
|
99
|
+
expect(template).toContain("## Goal Advancement Protocol");
|
|
100
|
+
expect(template).toContain("### Phase 1 - Reconstruct the current state");
|
|
101
|
+
expect(template).toContain("### Phase 2 - Check that the Goal is executable");
|
|
102
|
+
expect(template).toContain("### Phase 3 - Plan or Replan");
|
|
103
|
+
expect(template).toContain("### Phase 4 - Run an optional Plan or Replan review");
|
|
104
|
+
expect(template).toContain("### Phase 5 - Execute one bounded commitment");
|
|
105
|
+
expect(template).toContain("### Phase 6 - Observe and checkpoint");
|
|
106
|
+
expect(template).toContain("When `rudder_goal_checkpoint` is available, call `rudder_goal_checkpoint` exactly once for this bounded Run");
|
|
107
|
+
expect(template).toContain("### Phase 7 - Choose exactly one primary continuation route");
|
|
108
|
+
expect(template).toContain("### Phase 8 - Audit a possible block");
|
|
109
|
+
expect(template).toContain("### Phase 9 - Review and propose the result");
|
|
110
|
+
expect(template).toContain("### Required turn closeout");
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
it("keeps Plan ownership, review authority, Contract changes, and result acceptance distinct", () => {
|
|
114
|
+
for (const template of [
|
|
115
|
+
GOAL_STARTED_PROMPT_TEMPLATE,
|
|
116
|
+
GOAL_FEEDBACK_PROMPT_TEMPLATE,
|
|
117
|
+
GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE,
|
|
118
|
+
GOAL_CONTINUATION_PROMPT_TEMPLATE,
|
|
119
|
+
]) {
|
|
120
|
+
expect(template).toContain("Plan and Replan changes remain Agent-owned");
|
|
121
|
+
expect(template).toContain("They do not silently revise the Goal Contract.");
|
|
122
|
+
expect(template).toContain("label the proposed strategy as Run-local and unpersisted");
|
|
123
|
+
expect(template).toContain("do not imply that Rudder will resume it automatically");
|
|
124
|
+
expect(template).toContain("Invoke a Plan/Replan review only when the Contract, continuation, risk policy, or explicit human instruction requires it");
|
|
125
|
+
expect(template).toContain("A Reviewer returns findings; it does not become the Goal Owner");
|
|
126
|
+
expect(template).toContain("If review is required but no review mechanism is available, report that exact unpersisted gate.");
|
|
127
|
+
expect(template).toContain("Continue under the existing Contract until a human-applied decision says otherwise.");
|
|
128
|
+
expect(template).toContain("Stop execution while a Result Proposal is ready for human Acceptance.");
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
it("requires a materially different Replan before a three-turn blocked conclusion", () => {
|
|
132
|
+
for (const template of [
|
|
133
|
+
GOAL_STARTED_PROMPT_TEMPLATE,
|
|
134
|
+
GOAL_FEEDBACK_PROMPT_TEMPLATE,
|
|
135
|
+
GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE,
|
|
136
|
+
GOAL_CONTINUATION_PROMPT_TEMPLATE,
|
|
137
|
+
]) {
|
|
138
|
+
expect(template).toContain("Do not mark or claim the Goal blocked the first time a blocker appears.");
|
|
139
|
+
expect(template).toContain("If the same blocker persists for three consecutive Goal turns, first perform a Replan audit");
|
|
140
|
+
expect(template).toContain("If Replan finds a viable path, continue through that path.");
|
|
141
|
+
expect(template).toContain("Resuming after a blocked conclusion starts a fresh three-turn audit.");
|
|
142
|
+
expect(template).toContain("no blocker fingerprint schema is required");
|
|
143
|
+
expect(template).toContain("Missing context is not by itself a validated blocked conclusion.");
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
it("gives each real Goal wake a concrete entry and same-turn advancement rule", () => {
|
|
147
|
+
expect(GOAL_STARTED_PROMPT_TEMPLATE).toContain("## Wake Entry - Goal Started");
|
|
148
|
+
expect(GOAL_STARTED_PROMPT_TEMPLATE).toContain("Start at Plan/Replan because activation already confirmed the Contract.");
|
|
149
|
+
expect(GOAL_STARTED_PROMPT_TEMPLATE).toContain("Do not finish by merely restating the Goal or producing a Plan");
|
|
150
|
+
expect(GOAL_FEEDBACK_PROMPT_TEMPLATE).toContain("## Wake Entry - Goal Feedback");
|
|
151
|
+
expect(GOAL_FEEDBACK_PROMPT_TEMPLATE).toContain("new fact or Evidence -> observe and checkpoint");
|
|
152
|
+
expect(GOAL_FEEDBACK_PROMPT_TEMPLATE).toContain("Do not merely acknowledge feedback");
|
|
153
|
+
expect(GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE).toContain("## Wake Entry - Goal Change Decision");
|
|
154
|
+
expect(GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE).toContain("If the decision is approved and applied");
|
|
155
|
+
expect(GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE).toContain("If the proposal was rejected, preserve the current Contract");
|
|
156
|
+
expect(GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE).toContain("Acknowledging the decision alone is not advancement");
|
|
157
|
+
expect(GOAL_CONTINUATION_PROMPT_TEMPLATE).toContain("## Wake Entry - Goal Continuation");
|
|
158
|
+
expect(GOAL_CONTINUATION_PROMPT_TEMPLATE).toContain("persisted a checkpoint");
|
|
159
|
+
expect(GOAL_CONTINUATION_PROMPT_TEMPLATE).toContain("Do not replay the prior action blindly");
|
|
160
|
+
});
|
|
88
161
|
it("renders a Goal start wake with the outcome, current contract, and continuation", () => {
|
|
89
162
|
const context = {
|
|
90
163
|
wakeReason: "goal_started",
|
|
@@ -101,6 +174,10 @@ describe("server-utils prompt contracts", () => {
|
|
|
101
174
|
summary: "Run the public installation verification.",
|
|
102
175
|
wakeCondition: null,
|
|
103
176
|
},
|
|
177
|
+
goalPlan: {
|
|
178
|
+
revision: 1,
|
|
179
|
+
summary: "Verify the public installer before proposing a result.",
|
|
180
|
+
},
|
|
104
181
|
};
|
|
105
182
|
const template = selectPromptTemplate(undefined, context);
|
|
106
183
|
const rendered = renderTemplate(template, {
|
|
@@ -113,7 +190,10 @@ describe("server-utils prompt contracts", () => {
|
|
|
113
190
|
expect(rendered).toContain("**Goal ID:** goal-started-1");
|
|
114
191
|
expect(rendered).toContain("Customers can install the verified release.");
|
|
115
192
|
expect(rendered).toContain('"contractRevision":3');
|
|
193
|
+
expect(rendered).toContain('"revision":1');
|
|
194
|
+
expect(rendered).toContain("Verify the public installer before proposing a result.");
|
|
116
195
|
expect(rendered).toContain("action: Run the public installation verification.");
|
|
196
|
+
expect(rendered).toContain("Validate and use the persisted initial Plan before replacing it.");
|
|
117
197
|
expect(rendered).not.toContain("Continue your Rudder work.");
|
|
118
198
|
});
|
|
119
199
|
it("renders a Goal feedback wake with runtime feedback body and id", () => {
|
|
@@ -132,6 +212,10 @@ describe("server-utils prompt contracts", () => {
|
|
|
132
212
|
summary: "Repeat the restart acceptance run.",
|
|
133
213
|
wakeCondition: null,
|
|
134
214
|
},
|
|
215
|
+
goalPlan: {
|
|
216
|
+
revision: 4,
|
|
217
|
+
summary: "Exercise restart recovery and compare the runtime identity.",
|
|
218
|
+
},
|
|
135
219
|
goalFeedback: {
|
|
136
220
|
id: "feedback-77",
|
|
137
221
|
body: "Verify the restart path before proposing completion.",
|
|
@@ -148,11 +232,42 @@ describe("server-utils prompt contracts", () => {
|
|
|
148
232
|
expect(rendered).toContain("New feedback requires your review on a Goal you own.");
|
|
149
233
|
expect(rendered).toContain("Goal activation remains reliable after restart.");
|
|
150
234
|
expect(rendered).toContain('"contractRevision":5');
|
|
235
|
+
expect(rendered).toContain('"revision":4');
|
|
236
|
+
expect(rendered).toContain("Exercise restart recovery and compare the runtime identity.");
|
|
151
237
|
expect(rendered).toContain("verification: Repeat the restart acceptance run.");
|
|
152
238
|
expect(rendered).toContain("**Feedback ID:** feedback-77");
|
|
153
239
|
expect(rendered).toContain("Verify the restart path before proposing completion.");
|
|
154
240
|
expect(rendered).not.toContain("Continue your Rudder work.");
|
|
155
241
|
});
|
|
242
|
+
it("routes a continuation wake with checkpoint facts into the same advancement protocol", () => {
|
|
243
|
+
const context = {
|
|
244
|
+
wakeReason: "goal_continuation",
|
|
245
|
+
goal: {
|
|
246
|
+
id: "goal-continuation-1",
|
|
247
|
+
title: "Verify the next bounded release step",
|
|
248
|
+
outcomeStatement: "The release remains verifiable across runs.",
|
|
249
|
+
contractRevision: 2,
|
|
250
|
+
},
|
|
251
|
+
goalPlan: { revision: 3, summary: "Run the recovery verification." },
|
|
252
|
+
goalContinuation: { kind: "verification", summary: "Repeat the recovery check.", wakeCondition: null },
|
|
253
|
+
goalCheckpoint: {
|
|
254
|
+
id: "checkpoint-9",
|
|
255
|
+
summary: "Persisted recovery evidence and queued the next verification.",
|
|
256
|
+
evidenceRefs: ["artifact://release/recovery"],
|
|
257
|
+
planRevision: 3,
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
const template = selectPromptTemplate(undefined, context);
|
|
261
|
+
const rendered = renderTemplate(template, {
|
|
262
|
+
agent: { id: "agent-continuation-owner", name: "Owner" },
|
|
263
|
+
context,
|
|
264
|
+
});
|
|
265
|
+
expect(template).toContain("## Wake Entry - Goal Continuation");
|
|
266
|
+
expect(rendered).toContain("## Wake Entry - Goal Continuation");
|
|
267
|
+
expect(rendered).toContain("Persisted recovery evidence and queued the next verification.");
|
|
268
|
+
expect(rendered).toContain('"revision":3');
|
|
269
|
+
expect(rendered).toContain("Repeat the recovery check.");
|
|
270
|
+
});
|
|
156
271
|
it("selects the Goal prompt when only a nested payload indicates the wake kind", () => {
|
|
157
272
|
const context = {
|
|
158
273
|
payload: {
|
|
@@ -197,6 +312,10 @@ describe("server-utils prompt contracts", () => {
|
|
|
197
312
|
kind: "action",
|
|
198
313
|
summary: "Continue with the approved release boundary.",
|
|
199
314
|
},
|
|
315
|
+
goalPlan: {
|
|
316
|
+
revision: 2,
|
|
317
|
+
summary: "Verify installation and rollback against the accepted candidate.",
|
|
318
|
+
},
|
|
200
319
|
goalDecision: {
|
|
201
320
|
proposalId: "proposal-1",
|
|
202
321
|
decision: "approve",
|
|
@@ -213,6 +332,8 @@ describe("server-utils prompt contracts", () => {
|
|
|
213
332
|
expect(GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE).toContain("## Goal Change Decision");
|
|
214
333
|
expect(rendered).toContain("A human decided a proposed change");
|
|
215
334
|
expect(rendered).toContain('"contractRevision":4');
|
|
335
|
+
expect(rendered).toContain('"revision":2');
|
|
336
|
+
expect(rendered).toContain("Verify installation and rollback against the accepted candidate.");
|
|
216
337
|
expect(rendered).toContain("**Decision:** approve");
|
|
217
338
|
expect(rendered).toContain("**Decision status:** applied");
|
|
218
339
|
expect(rendered).toContain("Keep rollback evidence visible in the final result.");
|
|
@@ -224,7 +345,7 @@ describe("server-utils prompt contracts", () => {
|
|
|
224
345
|
payload: { event: "daily_check" },
|
|
225
346
|
})).toBe(DEFAULT_AGENT_PROMPT_TEMPLATE);
|
|
226
347
|
});
|
|
227
|
-
it("
|
|
348
|
+
it("uses managed Goal context for missing wake facts without inventing a blocked conclusion", () => {
|
|
228
349
|
const rendered = renderTemplate(selectPromptTemplate(undefined, {
|
|
229
350
|
wakeReason: "goal_feedback",
|
|
230
351
|
goal: { id: "goal-missing-context" },
|
|
@@ -232,11 +353,14 @@ describe("server-utils prompt contracts", () => {
|
|
|
232
353
|
agent: { id: "agent-missing-context", name: "Fallback Guard" },
|
|
233
354
|
context: {},
|
|
234
355
|
});
|
|
235
|
-
expect(rendered).toContain("report the missing outcome
|
|
236
|
-
expect(rendered).toContain("report the missing
|
|
237
|
-
expect(rendered).toContain("
|
|
356
|
+
expect(rendered).toContain("load managed Goal context once; otherwise report the missing outcome");
|
|
357
|
+
expect(rendered).toContain("load managed Goal context once; otherwise report the missing current Plan");
|
|
358
|
+
expect(rendered).toContain("load managed Goal context once; otherwise report the missing continuation");
|
|
359
|
+
expect(rendered).toContain("load managed Goal context once; otherwise report the missing feedback body");
|
|
360
|
+
expect(rendered).toContain("Missing context is not by itself a validated blocked conclusion.");
|
|
238
361
|
expect(rendered).not.toContain("load the Goal's current");
|
|
239
362
|
expect(rendered).not.toContain("load the triggering feedback entry");
|
|
363
|
+
expect(rendered).toContain("Do not use shell, Bash, curl, or the `rudder` CLI to read or mutate Goal state");
|
|
240
364
|
});
|
|
241
365
|
it("renders explicit issue ownership and timestamp metadata for issue-aware wakes", () => {
|
|
242
366
|
const issue = {
|