@xfey/tutti 0.1.92 → 0.1.94
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/collaboration-state/clarification-records.d.ts +2 -1
- package/dist/collaboration-state/clarification-records.js +18 -0
- package/dist/collaboration-state/index.d.ts +1 -1
- package/dist/collaboration-state/index.js +1 -1
- package/dist/control-plane/run-start.js +15 -1
- package/dist/control-plane/task-compile-clarification-context.d.ts +4 -0
- package/dist/control-plane/task-compile-clarification-context.js +9 -22
- package/dist/control-plane/task-compile-continuation.js +2 -0
- package/dist/control-plane/task-compile-start.js +2 -0
- package/dist/control-plane/task-source-context-types.d.ts +11 -0
- package/dist/control-plane/task-source-context-types.js +2 -0
- package/dist/control-plane/task-source-context.d.ts +7 -0
- package/dist/control-plane/task-source-context.js +31 -0
- package/dist/control-plane/types.d.ts +3 -0
- package/dist/control-plane/workflows/openai.js +1 -0
- package/dist/control-plane/workflows/types.d.ts +6 -14
- package/dist/run-pipeline/task-run-invocation.js +17 -0
- package/dist/server-shell/local-console/server.d.ts +1 -1
- package/dist/server-shell/local-console/server.js +8 -2
- package/package.json +1 -1
- package/prompts/README.md +3 -1
- package/prompts/artifacts/README.md +1 -1
- package/prompts/artifacts/applicability.md +1 -1
- package/prompts/procedures/README.md +3 -3
- package/prompts/procedures/follow-up-check.md +1 -1
- package/prompts/procedures/reference-file-summary.md +1 -1
- package/prompts/procedures/task-compile.md +7 -7
- package/prompts/prompt-flow-map.md +16 -10
- package/prompts/runs/README.md +1 -1
- package/prompts/runs/task-continuation.md +4 -2
- package/prompts/runs/task-retry.md +4 -2
- package/prompts/runs/task-run.md +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClarificationRoundRef, ClarificationThreadRef } from "@tutti/shared/ids";
|
|
1
|
+
import type { ClarificationRoundRef, ClarificationThreadRef, WorkflowInvocationRef } from "@tutti/shared/ids";
|
|
2
2
|
import type { ActiveClarificationProjection, ClarificationRoundProjection, ClarificationThreadProjection, GetClarificationThreadResponse } from "@tutti/shared/schemas/api";
|
|
3
3
|
import type { SqliteDatabase } from "../store/index.js";
|
|
4
4
|
import type { SealedClarificationRoundWithoutSuccessor } from "./types.js";
|
|
@@ -14,5 +14,6 @@ export declare function readClarificationRoundProjection(db: SqliteDatabase, rou
|
|
|
14
14
|
export declare function readClarificationRoundsForThread(db: SqliteDatabase, threadId: ClarificationThreadRef, options?: {
|
|
15
15
|
throughRoundIndex?: number;
|
|
16
16
|
}): ClarificationRoundProjection[];
|
|
17
|
+
export declare function readTaskCompileClarificationRoundsByWorkflowRef(db: SqliteDatabase, workflowRef: WorkflowInvocationRef): ClarificationRoundProjection[];
|
|
17
18
|
export declare function readClarificationThreadResponse(db: SqliteDatabase, threadId: ClarificationThreadRef): GetClarificationThreadResponse | null;
|
|
18
19
|
//# sourceMappingURL=clarification-records.d.ts.map
|
|
@@ -165,6 +165,24 @@ export function readClarificationRoundsForThread(db, threadId, options = {}) {
|
|
|
165
165
|
.all(threadId, options.throughRoundIndex);
|
|
166
166
|
return rows.map((row) => mapClarificationRoundRow(row));
|
|
167
167
|
}
|
|
168
|
+
export function readTaskCompileClarificationRoundsByWorkflowRef(db, workflowRef) {
|
|
169
|
+
const threads = db
|
|
170
|
+
.prepare(`
|
|
171
|
+
SELECT id
|
|
172
|
+
FROM clarification_threads
|
|
173
|
+
WHERE owner_kind = 'task_compile'
|
|
174
|
+
AND owner_workflow_ref = ?
|
|
175
|
+
ORDER BY created_at ASC, id ASC
|
|
176
|
+
`)
|
|
177
|
+
.all(workflowRef);
|
|
178
|
+
if (threads.length === 0) {
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
if (threads.length !== 1 || threads[0] === undefined) {
|
|
182
|
+
throw new Error("Task Compile workflow has multiple clarification threads");
|
|
183
|
+
}
|
|
184
|
+
return readClarificationRoundsForThread(db, threads[0].id);
|
|
185
|
+
}
|
|
168
186
|
export function readClarificationThreadResponse(db, threadId) {
|
|
169
187
|
const threadRow = readClarificationThreadRow(db, threadId);
|
|
170
188
|
if (threadRow === null) {
|
|
@@ -4,7 +4,7 @@ export { createMainChatAgentMessage, createMainChatMessage, createMainChatSystem
|
|
|
4
4
|
export { createEmptyScratchpadProjection, readScratchpadReceiptSourceRefs, readScratchpadProjection, upsertScratchpadProjection, } from "./scratchpad.js";
|
|
5
5
|
export { markScratchpadRefreshFailed, markScratchpadRefreshStarted, markScratchpadRefreshSucceeded, markScratchpadSourceDirty, readScratchpadSourceState, } from "./scratchpad-source-state.js";
|
|
6
6
|
export { captureTaskCompileContext, completeTaskCompileContext, readActiveTaskCompileContext, readCurrentScratchpadSourceRefs, rollbackTaskCompileContext, taskCompileContextSnapshot, } from "./task-compile-context.js";
|
|
7
|
-
export { deleteStaleClarificationSubmitReplayHints, readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readClarificationThreadResponse, readSealedClarificationRoundsWithoutSuccessor, } from "./clarification-records.js";
|
|
7
|
+
export { deleteStaleClarificationSubmitReplayHints, readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readClarificationThreadResponse, readTaskCompileClarificationRoundsByWorkflowRef, readSealedClarificationRoundsWithoutSuccessor, } from "./clarification-records.js";
|
|
8
8
|
export { createClarificationRoundAgentMessage, createClarificationRoundMessage, readClarificationRoundMessagesWindow, } from "./clarification-messages.js";
|
|
9
9
|
export { openNextTaskBoundClarificationRound, openNextTaskCompileClarificationRound, openTaskCompileClarificationRound, } from "./clarification-rounds.js";
|
|
10
10
|
export { closeTaskBoundClarificationAsRetaskingRequired, materializeClarificationSuccessor, materializeTaskBoundRunSuccessor, submitClarificationRound, } from "./clarification-successors.js";
|
|
@@ -4,7 +4,7 @@ export { createMainChatAgentMessage, createMainChatMessage, createMainChatSystem
|
|
|
4
4
|
export { createEmptyScratchpadProjection, readScratchpadReceiptSourceRefs, readScratchpadProjection, upsertScratchpadProjection, } from "./scratchpad.js";
|
|
5
5
|
export { markScratchpadRefreshFailed, markScratchpadRefreshStarted, markScratchpadRefreshSucceeded, markScratchpadSourceDirty, readScratchpadSourceState, } from "./scratchpad-source-state.js";
|
|
6
6
|
export { captureTaskCompileContext, completeTaskCompileContext, readActiveTaskCompileContext, readCurrentScratchpadSourceRefs, rollbackTaskCompileContext, taskCompileContextSnapshot, } from "./task-compile-context.js";
|
|
7
|
-
export { deleteStaleClarificationSubmitReplayHints, readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readClarificationThreadResponse, readSealedClarificationRoundsWithoutSuccessor, } from "./clarification-records.js";
|
|
7
|
+
export { deleteStaleClarificationSubmitReplayHints, readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readClarificationThreadResponse, readTaskCompileClarificationRoundsByWorkflowRef, readSealedClarificationRoundsWithoutSuccessor, } from "./clarification-records.js";
|
|
8
8
|
export { createClarificationRoundAgentMessage, createClarificationRoundMessage, readClarificationRoundMessagesWindow, } from "./clarification-messages.js";
|
|
9
9
|
export { openNextTaskBoundClarificationRound, openNextTaskCompileClarificationRound, openTaskCompileClarificationRound, } from "./clarification-rounds.js";
|
|
10
10
|
export { closeTaskBoundClarificationAsRetaskingRequired, materializeClarificationSuccessor, materializeTaskBoundRunSuccessor, submitClarificationRound, } from "./clarification-successors.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { readScratchpadReceiptSourceRefs } from "../collaboration-state/index.js";
|
|
1
2
|
import { materializeWorkflowRecentReferences } from "./recent-references.js";
|
|
3
|
+
import { readCompletedTaskCompileClarificationRounds } from "./task-compile-clarification-context.js";
|
|
4
|
+
import { materializePromptSourceMessages } from "./task-source-context.js";
|
|
2
5
|
import { recordRunPipelineFailure, recordRunPipelineResult, } from "./run-result-recording.js";
|
|
3
6
|
import { projectBriefShouldRefreshForUpdatedPaths, refreshProjectBriefProjection, } from "./project-brief-refresh.js";
|
|
4
7
|
function runLineageFields(lineage) {
|
|
@@ -80,12 +83,19 @@ export function startControlPlaneRunForTask(input) {
|
|
|
80
83
|
const pipelineStartedAt = input.now();
|
|
81
84
|
input.logger?.info(lifecycleFields, "Run pipeline started");
|
|
82
85
|
try {
|
|
86
|
+
const workflowRef = input.run.task
|
|
87
|
+
.created_from_workflow_ref;
|
|
88
|
+
const sourceMessages = materializePromptSourceMessages(input.store.db, readScratchpadReceiptSourceRefs(input.store.db, workflowRef));
|
|
89
|
+
const clarificationRounds = readCompletedTaskCompileClarificationRounds({
|
|
90
|
+
store: input.store,
|
|
91
|
+
workflowRef,
|
|
92
|
+
});
|
|
83
93
|
const recentReferences = input.projectContext === undefined
|
|
84
94
|
? []
|
|
85
95
|
: materializeWorkflowRecentReferences({
|
|
86
96
|
db: input.store.db,
|
|
87
97
|
workspaceRoot: input.projectContext.workspaceRoot,
|
|
88
|
-
workflowRef
|
|
98
|
+
workflowRef,
|
|
89
99
|
now: input.now,
|
|
90
100
|
});
|
|
91
101
|
const pipelineResult = await input.run.runner.runTask({
|
|
@@ -97,6 +107,10 @@ export function startControlPlaneRunForTask(input) {
|
|
|
97
107
|
...(input.run.continuation_context === undefined
|
|
98
108
|
? {}
|
|
99
109
|
: { continuation_context: input.run.continuation_context }),
|
|
110
|
+
...(sourceMessages.length === 0 ? {} : { source_messages: sourceMessages }),
|
|
111
|
+
...(clarificationRounds.length === 0
|
|
112
|
+
? {}
|
|
113
|
+
: { clarification_rounds: clarificationRounds }),
|
|
100
114
|
...(recentReferences.length === 0
|
|
101
115
|
? {}
|
|
102
116
|
: { recent_references: recentReferences }),
|
|
@@ -6,4 +6,8 @@ export declare function readTaskCompileClarificationRounds(input: {
|
|
|
6
6
|
workflowRef: WorkflowInvocationRef;
|
|
7
7
|
throughRoundId: ClarificationRoundRef;
|
|
8
8
|
}): NonNullable<TaskCompileWorkflowInput["clarification_rounds"]>;
|
|
9
|
+
export declare function readCompletedTaskCompileClarificationRounds(input: {
|
|
10
|
+
store: HostProjectStore;
|
|
11
|
+
workflowRef: WorkflowInvocationRef;
|
|
12
|
+
}): NonNullable<TaskCompileWorkflowInput["clarification_rounds"]>;
|
|
9
13
|
//# sourceMappingURL=task-compile-clarification-context.d.ts.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readMessageProjectionById, } from "../collaboration-state/index.js";
|
|
2
|
-
import { ScratchpadSourceBudgetExceededError, truncateTextMiddle } from "./scratchpad-source-messages.js";
|
|
3
|
-
const MAX_CLARIFICATION_MESSAGE_CHARS = 4_000;
|
|
4
|
-
const MAX_CLARIFICATION_MESSAGES_TOTAL_CHARS = 16_000;
|
|
5
|
-
const MIN_CLARIFICATION_MESSAGE_CHARS = 160;
|
|
1
|
+
import { readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readMessageProjectionById, readTaskCompileClarificationRoundsByWorkflowRef, } from "../collaboration-state/index.js";
|
|
6
2
|
function answerMessage(store, messageId, roundId) {
|
|
7
3
|
const message = readMessageProjectionById(store.db, messageId);
|
|
8
4
|
if (message === null ||
|
|
@@ -36,14 +32,17 @@ export function readTaskCompileClarificationRounds(input) {
|
|
|
36
32
|
const rounds = readClarificationRoundsForThread(input.store.db, throughRound.thread_id, {
|
|
37
33
|
throughRoundIndex: throughRound.round_index,
|
|
38
34
|
});
|
|
39
|
-
|
|
35
|
+
return materializeTaskCompileClarificationRounds(input.store, rounds);
|
|
36
|
+
}
|
|
37
|
+
function materializeTaskCompileClarificationRounds(store, rounds) {
|
|
38
|
+
return rounds.map((round) => {
|
|
40
39
|
if (round.status !== "sealed") {
|
|
41
40
|
throw new Error("Task Compile clarification context cannot include a writable round");
|
|
42
41
|
}
|
|
43
42
|
const answerMessages = (round.submitted_message_refs ?? [])
|
|
44
43
|
.filter((messageId) => messageId !== round.opening_message_id && messageId !== round.card_message_id)
|
|
45
44
|
.flatMap((messageId) => {
|
|
46
|
-
const mapped = answerMessage(
|
|
45
|
+
const mapped = answerMessage(store, messageId, round.id);
|
|
47
46
|
return mapped === null ? [] : [mapped];
|
|
48
47
|
});
|
|
49
48
|
return {
|
|
@@ -51,20 +50,8 @@ export function readTaskCompileClarificationRounds(input) {
|
|
|
51
50
|
answer_messages: answerMessages,
|
|
52
51
|
};
|
|
53
52
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
if (answerCount * MIN_CLARIFICATION_MESSAGE_CHARS > MAX_CLARIFICATION_MESSAGES_TOTAL_CHARS) {
|
|
59
|
-
throw new ScratchpadSourceBudgetExceededError();
|
|
60
|
-
}
|
|
61
|
-
const perMessageChars = Math.min(MAX_CLARIFICATION_MESSAGE_CHARS, Math.floor(MAX_CLARIFICATION_MESSAGES_TOTAL_CHARS / answerCount));
|
|
62
|
-
return contextRounds.map((round) => ({
|
|
63
|
-
request_payload: round.request_payload,
|
|
64
|
-
answer_messages: round.answer_messages.map((message) => ({
|
|
65
|
-
...message,
|
|
66
|
-
text: truncateTextMiddle(message.text, perMessageChars),
|
|
67
|
-
})),
|
|
68
|
-
}));
|
|
53
|
+
}
|
|
54
|
+
export function readCompletedTaskCompileClarificationRounds(input) {
|
|
55
|
+
return materializeTaskCompileClarificationRounds(input.store, readTaskCompileClarificationRoundsByWorkflowRef(input.store.db, input.workflowRef));
|
|
69
56
|
}
|
|
70
57
|
//# sourceMappingURL=task-compile-clarification-context.js.map
|
|
@@ -3,6 +3,7 @@ import { withHostStoreTransaction } from "../store/index.js";
|
|
|
3
3
|
import { clarificationInvalidates } from "./invalidations.js";
|
|
4
4
|
import { applyTaskCompileProcedureOutput } from "./task-compile-output.js";
|
|
5
5
|
import { readTaskCompileClarificationRounds } from "./task-compile-clarification-context.js";
|
|
6
|
+
import { materializePromptSourceMessages } from "./task-source-context.js";
|
|
6
7
|
import { logProcedureExecutionError } from "./procedure-logging.js";
|
|
7
8
|
import { materializeRecentReferences, readRecentReferenceSources, } from "./recent-references.js";
|
|
8
9
|
export function startControlPlaneTaskCompileContinuation(options) {
|
|
@@ -54,6 +55,7 @@ export function startControlPlaneTaskCompileContinuation(options) {
|
|
|
54
55
|
const output = await runnerResolution.runner.runTaskCompile({
|
|
55
56
|
workflow_ref: workflowRef,
|
|
56
57
|
scratchpad: taskCompileContext.scratchpad_snapshot,
|
|
58
|
+
source_messages: materializePromptSourceMessages(options.store.db, taskCompileContext.sources),
|
|
57
59
|
worklist: readWorklistProjection(options.store.db),
|
|
58
60
|
...(recentReferences.length === 0
|
|
59
61
|
? {}
|
|
@@ -6,6 +6,7 @@ import { projectBriefShouldRefreshForUpdatedPaths, refreshProjectBriefProjection
|
|
|
6
6
|
import { applyProjectDocsInitializationResult, buildProjectDocsInitializationContext, tryProjectContextBootstrapDocuments, } from "./project-context-bootstrap.js";
|
|
7
7
|
import { readActiveScratchpadRefreshActivityRef, readControlPlaneScratchpadSourceBatch, runControlPlaneScratchpadRefreshProcedure, } from "./scratchpad-refresh-start.js";
|
|
8
8
|
import { applyTaskCompileProcedureOutput } from "./task-compile-output.js";
|
|
9
|
+
import { materializePromptSourceMessages } from "./task-source-context.js";
|
|
9
10
|
import { materializeRecentReferences, readPendingRecentReferenceSummaryPaths, readRecentReferenceSources, } from "./recent-references.js";
|
|
10
11
|
import { startReferenceSummaryRefreshProcedure } from "./reference-summary-refresh.js";
|
|
11
12
|
export function startControlPlaneTaskCompile(options) {
|
|
@@ -431,6 +432,7 @@ export async function runControlPlaneTaskCompileProcedure(options) {
|
|
|
431
432
|
const output = await options.runner.runTaskCompile({
|
|
432
433
|
workflow_ref: options.workflowRef,
|
|
433
434
|
scratchpad: context.scratchpad_snapshot,
|
|
435
|
+
source_messages: materializePromptSourceMessages(options.store.db, context.sources),
|
|
434
436
|
worklist: readWorklistProjection(options.store.db),
|
|
435
437
|
...(recentReferences.length === 0
|
|
436
438
|
? {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ClarificationRequestPayload } from "@tutti/shared/schemas/api";
|
|
2
|
+
export type PromptSourceMessage = {
|
|
3
|
+
role: "human" | "tutti";
|
|
4
|
+
author_display_name?: string;
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
export type TaskCompileClarificationContext = {
|
|
8
|
+
request_payload: ClarificationRequestPayload;
|
|
9
|
+
answer_messages: PromptSourceMessage[];
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=task-source-context-types.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SqliteDatabase } from "../store/index.js";
|
|
2
|
+
import type { PromptSourceMessage } from "./task-source-context-types.js";
|
|
3
|
+
export type TaskSourceMessageRef = {
|
|
4
|
+
message_id: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function materializePromptSourceMessages(db: SqliteDatabase, sources: TaskSourceMessageRef[]): PromptSourceMessage[];
|
|
7
|
+
//# sourceMappingURL=task-source-context.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { readMessageProjectionById } from "../collaboration-state/index.js";
|
|
2
|
+
function promptSourceMessage(db, source) {
|
|
3
|
+
const message = readMessageProjectionById(db, source.message_id);
|
|
4
|
+
if (message === null) {
|
|
5
|
+
throw new Error("Task source message is unavailable");
|
|
6
|
+
}
|
|
7
|
+
if (message.scope.kind !== "main_chat") {
|
|
8
|
+
throw new Error("Task source message is outside main chat");
|
|
9
|
+
}
|
|
10
|
+
if (message.message_kind === "user_text" && message.author.kind === "human") {
|
|
11
|
+
const displayName = message.author.display_name?.trim();
|
|
12
|
+
return {
|
|
13
|
+
role: "human",
|
|
14
|
+
...(displayName === undefined || displayName === ""
|
|
15
|
+
? {}
|
|
16
|
+
: { author_display_name: displayName }),
|
|
17
|
+
text: message.body,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (message.message_kind === "agent_text" && message.author.kind === "agent") {
|
|
21
|
+
return {
|
|
22
|
+
role: "tutti",
|
|
23
|
+
text: message.body,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
throw new Error("Task source message has an unsupported kind or author");
|
|
27
|
+
}
|
|
28
|
+
export function materializePromptSourceMessages(db, sources) {
|
|
29
|
+
return sources.map((source) => promptSourceMessage(db, source));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=task-source-context.js.map
|
|
@@ -5,6 +5,7 @@ import type { ActiveApprovalProjection, ClarificationRequestPayload, ExecutionRu
|
|
|
5
5
|
import type { HostProjectStore } from "../store/index.js";
|
|
6
6
|
import type { WorkspaceEventBus } from "../server-shell/http/workspace-events.js";
|
|
7
7
|
import type { RecentReferenceContext } from "./reference-context-types.js";
|
|
8
|
+
import type { PromptSourceMessage, TaskCompileClarificationContext } from "./task-source-context-types.js";
|
|
8
9
|
import type { ProcedureWorkflowRunnerResolver } from "./workflows/index.js";
|
|
9
10
|
export type Phase5ControlPlaneOptions = {
|
|
10
11
|
store: HostProjectStore;
|
|
@@ -105,6 +106,8 @@ export type RunPipelineInput = {
|
|
|
105
106
|
dispatch_context: RunDispatchContext;
|
|
106
107
|
continuation_context?: RunContinuationContext;
|
|
107
108
|
correction_context?: RunCorrectionContext;
|
|
109
|
+
source_messages?: PromptSourceMessage[];
|
|
110
|
+
clarification_rounds?: TaskCompileClarificationContext[];
|
|
108
111
|
recent_references?: RecentReferenceContext[];
|
|
109
112
|
on_stage?: (progress: RunPipelineStageProgress) => void;
|
|
110
113
|
};
|
|
@@ -153,6 +153,7 @@ export function buildTaskCompilePromptInput(input) {
|
|
|
153
153
|
open_questions: input.scratchpad.open_questions,
|
|
154
154
|
task_changes: input.scratchpad.task_changes,
|
|
155
155
|
},
|
|
156
|
+
source_messages: input.source_messages.map((message) => ({ ...message })),
|
|
156
157
|
worklist: {
|
|
157
158
|
modules: input.worklist.modules.map((entry) => ({
|
|
158
159
|
id: entry.module.id,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExecutionRuntimeSnapshot, MessageProjection, RunResultProjection, TaskDetailProjection, WorklistProjection } from "@tutti/shared/schemas/api";
|
|
2
2
|
import type { RecentReferenceContext } from "../reference-context-types.js";
|
|
3
|
+
import type { PromptSourceMessage, TaskCompileClarificationContext } from "../task-source-context-types.js";
|
|
3
4
|
import type { ClarificationRequestPayload, TaskContractProjection } from "@tutti/shared/schemas/api";
|
|
4
5
|
import type { ProjectDocKey } from "@tutti/shared/schemas/api";
|
|
5
6
|
import type { ActivityRef, ClarificationRoundRef, ClarificationThreadRef, MessageId, TaskId, TaskModuleId, WorkflowInvocationRef } from "@tutti/shared/ids";
|
|
@@ -28,11 +29,7 @@ export type ScratchpadRefreshWorklistInput = {
|
|
|
28
29
|
}>;
|
|
29
30
|
}>;
|
|
30
31
|
};
|
|
31
|
-
export type ScratchpadRefreshSourceMessageInput =
|
|
32
|
-
role: "human" | "tutti";
|
|
33
|
-
author_display_name?: string;
|
|
34
|
-
text: string;
|
|
35
|
-
};
|
|
32
|
+
export type ScratchpadRefreshSourceMessageInput = PromptSourceMessage;
|
|
36
33
|
export type ScratchpadRefreshWorkflowContext = {
|
|
37
34
|
workflow_ref: WorkflowInvocationRef;
|
|
38
35
|
activity_ref: ActivityRef;
|
|
@@ -80,12 +77,10 @@ export type TaskCompileProposalTask = {
|
|
|
80
77
|
export type TaskCompileWorkflowInput = {
|
|
81
78
|
workflow_ref: WorkflowInvocationRef;
|
|
82
79
|
scratchpad: ScratchpadWorkflowSnapshot;
|
|
80
|
+
source_messages: PromptSourceMessage[];
|
|
83
81
|
worklist: WorklistProjection;
|
|
84
82
|
recent_references?: RecentReferenceContext[];
|
|
85
|
-
clarification_rounds?:
|
|
86
|
-
request_payload: ClarificationRequestPayload;
|
|
87
|
-
answer_messages: TaskCompilePromptClarificationMessage[];
|
|
88
|
-
}>;
|
|
83
|
+
clarification_rounds?: TaskCompileClarificationContext[];
|
|
89
84
|
};
|
|
90
85
|
export type TaskCompileWorkflowOutput = {
|
|
91
86
|
decision: "ready";
|
|
@@ -102,6 +97,7 @@ export type TaskCompilePromptInput = {
|
|
|
102
97
|
open_questions: string[];
|
|
103
98
|
task_changes: string[];
|
|
104
99
|
};
|
|
100
|
+
source_messages: PromptSourceMessage[];
|
|
105
101
|
worklist: {
|
|
106
102
|
modules: Array<{
|
|
107
103
|
id: TaskModuleId;
|
|
@@ -125,11 +121,7 @@ export type TaskCompilePromptInput = {
|
|
|
125
121
|
answer_messages: TaskCompilePromptClarificationMessage[];
|
|
126
122
|
}>;
|
|
127
123
|
};
|
|
128
|
-
export type TaskCompilePromptClarificationMessage =
|
|
129
|
-
role: "human" | "tutti";
|
|
130
|
-
author_display_name?: string;
|
|
131
|
-
text: string;
|
|
132
|
-
};
|
|
124
|
+
export type TaskCompilePromptClarificationMessage = PromptSourceMessage;
|
|
133
125
|
export type TaskCompileStructuredOutput = {
|
|
134
126
|
result: {
|
|
135
127
|
proposal: TaskCompileStructuredProposal;
|
|
@@ -6,6 +6,23 @@ function taskContractRunInput(input) {
|
|
|
6
6
|
title: input.task.title,
|
|
7
7
|
goal: input.task_detail.detail.contract.goal,
|
|
8
8
|
scope: input.task_detail.detail.contract.scope,
|
|
9
|
+
...(input.source_messages === undefined || input.source_messages.length === 0
|
|
10
|
+
? {}
|
|
11
|
+
: { source_messages: input.source_messages.map((message) => ({ ...message })) }),
|
|
12
|
+
...(input.clarification_rounds === undefined || input.clarification_rounds.length === 0
|
|
13
|
+
? {}
|
|
14
|
+
: {
|
|
15
|
+
clarification_rounds: input.clarification_rounds.map((round) => ({
|
|
16
|
+
request: {
|
|
17
|
+
...(round.request_payload.title === undefined
|
|
18
|
+
? {}
|
|
19
|
+
: { title: round.request_payload.title }),
|
|
20
|
+
summary: round.request_payload.summary,
|
|
21
|
+
request: round.request_payload.request,
|
|
22
|
+
},
|
|
23
|
+
answer_messages: round.answer_messages.map((message) => ({ ...message })),
|
|
24
|
+
})),
|
|
25
|
+
}),
|
|
9
26
|
...(input.recent_references === undefined || input.recent_references.length === 0
|
|
10
27
|
? {}
|
|
11
28
|
: { recent_references: input.recent_references }),
|
|
@@ -25,7 +25,7 @@ type LocalConsoleServerOptions = {
|
|
|
25
25
|
startPackageUpdate?: (preparation: LocalConsolePackageUpdatePreparation) => Promise<{
|
|
26
26
|
pid: number;
|
|
27
27
|
}>;
|
|
28
|
-
|
|
28
|
+
packageUpdateCompletion?: PackageUpdateCompletionResult;
|
|
29
29
|
};
|
|
30
30
|
export declare function createLocalConsoleServer(options: LocalConsoleServerOptions): FastifyInstance;
|
|
31
31
|
export declare function runLocalConsoleProcess(options?: {
|
|
@@ -84,6 +84,7 @@ export function createLocalConsoleServer(options) {
|
|
|
84
84
|
operations,
|
|
85
85
|
...(options.env === undefined ? {} : { env: options.env }),
|
|
86
86
|
});
|
|
87
|
+
let pendingPackageUpdateCompletion = options.packageUpdateCompletion;
|
|
87
88
|
const startPackageUpdate = options.startPackageUpdate ??
|
|
88
89
|
(async (preparation) => {
|
|
89
90
|
try {
|
|
@@ -274,7 +275,12 @@ export function createLocalConsoleServer(options) {
|
|
|
274
275
|
});
|
|
275
276
|
app.get(`${LOCAL_CONSOLE_API_BASE}/bootstrap`, (request) => {
|
|
276
277
|
const session = requireSession(request);
|
|
277
|
-
const packageUpdateCompletion =
|
|
278
|
+
const packageUpdateCompletion = session.accountReady
|
|
279
|
+
? pendingPackageUpdateCompletion
|
|
280
|
+
: undefined;
|
|
281
|
+
if (packageUpdateCompletion !== undefined) {
|
|
282
|
+
pendingPackageUpdateCompletion = undefined;
|
|
283
|
+
}
|
|
278
284
|
return {
|
|
279
285
|
account_gate: session.accountReady
|
|
280
286
|
? {
|
|
@@ -487,7 +493,7 @@ export async function runLocalConsoleProcess(options = {}) {
|
|
|
487
493
|
lastActivityAt = now().getTime();
|
|
488
494
|
},
|
|
489
495
|
onShutdown: () => requestClose(),
|
|
490
|
-
|
|
496
|
+
...(packageUpdateCompletion === undefined ? {} : { packageUpdateCompletion }),
|
|
491
497
|
...(options.now === undefined ? {} : { now: options.now }),
|
|
492
498
|
});
|
|
493
499
|
await app.listen({ host: "127.0.0.1", port: 0 });
|
package/package.json
CHANGED
package/prompts/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Prompt / skill 改造后的 live 实验计划与记录见 [prompt-flow-experimen
|
|
|
15
15
|
|
|
16
16
|
- `procedures/`:`scratchpad_refresh`、`project_brief_refresh`、`task_compile`、`project_context_bootstrap`、`context_sync`、`reference_summary_refresh`、`follow_up_check` 等 Procedure / workflow prompt。
|
|
17
17
|
- `artifacts/`:候选实现完成后的 transient Artifact applicability 判断;只接收 bounded task / diff / repo evidence,不写回 Task contract 或 repo。
|
|
18
|
-
- `runs/`:正式 task `Run`、task-bound continuation 与 pipeline self-correction retry 等 Run pipeline prompt;task contract 可附带 receipt-derived compact `recent_references`,两类 retry
|
|
18
|
+
- `runs/`:正式 task `Run`、task-bound continuation 与 pipeline self-correction retry 等 Run pipeline prompt;task contract 可附带 receipt-derived `source_messages`、已完成 Task Compile `clarification_rounds` 与 compact `recent_references`,两类 retry 都保留它们。provider transient retry 不新增 prompt,而是复用失败 attempt 的同一 prompt family。所有 Run prompt都以持久 project workspace为 cwd contract,不设计 promotion reconcile prompt。
|
|
19
19
|
- `codex/`:Codex app-server smoke 等 adapter / spike prompt。
|
|
20
20
|
- `skills/`:Tutti packaged built-in Codex skills;由 server-side app-server skill selection 选择,不在 Web Skills 页面展示,也不保存 user skills。
|
|
21
21
|
- `chat-assistant.md`:主群聊与 clarification round 内 `@tutti` 只读项目问答 prompt;它不是 Procedure / Run prompt。
|
|
@@ -35,3 +35,5 @@ Prompt / skill 改造后的 live 实验计划与记录见 [prompt-flow-experimen
|
|
|
35
35
|
- prompt 文件不得保存 provider secret、credential ref、host 绝对路径、project workspace path、join token、cookie 或 provider raw event。
|
|
36
36
|
- built-in skill 文件不得保存 context API token、host-local URL、provider secret、host 绝对路径或 user skill 内容。
|
|
37
37
|
- workflow 语义和 prompt 选择归 `control-plane/workflows`;provider adapter 只执行渲染后的 provider request。
|
|
38
|
+
- prompt 应说明本轮实际 direct input、目标和真实能力边界。对 server-side selection 未提供且 direct input 已从结构上排除的能力,不写假设性的“不得读取”指令;安全、workspace、任务契约、证据和输出 schema 等真实边界仍需明确。
|
|
39
|
+
- active app-server prompt 中显式命名的 built-in skill 必须属于对应 server-side selection;该映射由 prompt contract tests 与 `providers/openai/app-server/skills.ts` 共同约束。
|
|
@@ -4,4 +4,4 @@ This directory contains model-facing prompts used by the internal Artifact candi
|
|
|
4
4
|
|
|
5
5
|
- `applicability.md` makes one read-only, non-persistent decision after a candidate diff exists and only when deterministic evidence cannot decide whether a browser-viewable Artifact is applicable.
|
|
6
6
|
|
|
7
|
-
The prompt receives
|
|
7
|
+
The prompt receives the frozen task `title / goal / scope`, bounded changed paths, bounded Git diff facts, and limited repository evidence. Its instructions base the decision on those supplied fields without enumerating inaccessible collaboration sources. Task / activity ids, host paths, run workspace paths, credentials, provider output, and secrets remain excluded by input construction. Applicability output is transient pipeline state; it is not written back to the Task contract or repository.
|
|
@@ -18,7 +18,7 @@ Decide whether the completed repository candidate should provide a browser-viewa
|
|
|
18
18
|
- Return `not_applicable` only when the evidence clearly describes a library without a browser entry, a CLI, a migration or data script, an API-only service without a Web client, docs-only maintenance, or another task with no reasonable browser presentation surface.
|
|
19
19
|
- Existing browser application evidence is relevant even if the changed path is a server entry, API handler, build configuration, or other behavior required by that application.
|
|
20
20
|
- Ambiguity must resolve to `artifact_required`. Do not use a missing field, `unknown`, or a confidence score to avoid the decision.
|
|
21
|
-
-
|
|
21
|
+
- Base the decision only on the supplied task, diff, and repository evidence. Do not propose implementation changes.
|
|
22
22
|
|
|
23
23
|
# Output
|
|
24
24
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
- `scratchpad-refresh.md`:根据当前周期完整主群聊消息、Project Brief、精简 Worklist 与可选 active Task Compile Context 重建唯一 Current Scratchpad。
|
|
8
8
|
- `project-brief-refresh.md`:根据四个 baseline Project Docs 的 bounded 正文和可读状态生成 host-local Project Brief 短摘要。
|
|
9
|
-
- `task-compile.md`:使用 Codex app-server read-only adapter
|
|
9
|
+
- `task-compile.md`:使用 Codex app-server read-only adapter,根据直接输入的冻结 source messages、Scratchpad / Worklist 与按需读取的项目上下文文件生成追加式 task compile proposal,或请求 workflow-bound clarification;执行面仅为 app-server read-only。
|
|
10
10
|
- `project-context-bootstrap.md`:使用 Codex app-server read-only adapter 为缺失 baseline context files 生成完整文件内容计划;实际写入和 commit 由 `workspace-ops` 受控完成。
|
|
11
11
|
- `context-sync.md`:使用 Codex app-server read-only adapter 生成文档同步更新计划;实际文件写入和 commit 由 `workspace-ops` 受控完成。
|
|
12
12
|
- `reference-file-summary.md`:使用 Codex app-server read-only adapter 读取单个 reference 文件并生成“包含什么”的抽象 summary;不复现原句、表格行、个人信息、标识符或 secret-like value,正文敏感本身不构成 unavailable,只有无法访问、解码或理解才返回该分支。实际 README summary 索引写入和 commit 由 `workspace-ops` 受控完成。
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
`project_context_bootstrap` 的 provider path 只让 Codex app-server read-only adapter 生成缺失文档内容;如果该计划不可用,Control Plane 会回退到本地保守模板。
|
|
16
16
|
`project_context_bootstrap` 的 read-only 输入只包含项目名、非空时的 `missing_docs` 与刷新后的 Scratchpad;prompt 会要求 app-server 只读探索仓库,并可通过 `read-project-docs` / `read-references` skill 按需读取现有文档和参考文件。输出只包含 `documents[].doc_key/content`,固定 path 由 Control Plane 后处理生成。
|
|
17
|
-
`task_compile` 的 read-only
|
|
17
|
+
`task_compile` 的 read-only 输入包含 durable context 固定的完整有序 `source_messages`、五字段 Scratchpad、当前 Worklist、可选 compact `recent_references` 和可选完整有序 `clarification_rounds`。消息与 answers 统一使用 `role / optional author_display_name / text`,不含 message/workflow ids、时间戳或完整 projection;reference 项只含 path、最终 name 与 available/unavailable summary。每次 continuation 由 Host 物化同一 pinned refs 并追加 sealed rounds,因此 boundary 后的新聊天或上传不会进入旧 workflow,无需 `read-main-chat` / `read-scratchpad` skill 或假设性禁止文本。精确正文由 source fields 承接,task `title / goal / scope` 保持简洁正式。prompt 暴露 `read-project-docs` / `read-worklist` / `read-references` skills 供 app-server 必要时读取项目上下文文件、既有任务 contract / latest result 或相关 reference 正文;拟议工作实质依赖 reference 时必须在冻结 contract 前读取 source,不以 summary 替代原文。只有现有上下文支持一个 coherent formal contract 时才 proposal;重大歧义或冲突若必须替用户选择意图,则请求最少 clarification,低影响、可逆或已有 convention 覆盖的细节继续写成有界假设。later round 可以纠正 earlier round,明确撤回时允许空 proposal 正常结束。provider raw output 使用 `{ result: ... }` 互斥分支;proposal 分支用 `module_ref` 指向新模块或既有模块,task 只输出 `title / goal / scope`,runner adapter 再映射为 Control Plane 内部 proposal:`goal` 同时作为内部 task summary 和 contract goal,`scope` 作为内部 contract scope。
|
|
18
18
|
`context_sync` 没有 provider-facing direct input;workflow ref、activity ref、触发原因、安全元数据、checked paths、skipped paths 和 open questions 都不进入 prompt,只用于运行时追踪、调度或审计。prompt 说明通用文档同步目标、目标项目文档落点和 canonical docs 职责,由 app-server 主动探索 repo,并通过 `read-project-docs` / `read-worklist` / `read-references` skill 按需读取现有文档、正式任务上下文和参考文件。Worklist / task result 只作为阶段性完成背景和稳定结果线索,不写成长文档里的逐任务流水。
|
|
19
19
|
`context_sync` prompt 只返回 `summary` 与 `updates[].path/content`;空 `updates` 表示无需同步,非空 `updates` 由 Control Plane 调用 `workspace-ops` 做 path policy、mainline clean 检查、文件写入和 Git commit。
|
|
20
20
|
`project_brief_refresh` 只走 OpenAI SDK structured output,不使用 Codex app-server,不读取 repo 或 skills。它接收四个 baseline Project Docs 的 bounded source 内容与状态,输出 `product_summary / tech_summary / structure_summary / principles_summary`,由 Control Plane 写入 host-local `project_brief` projection;Project Docs 创建、同步、被成功 Run promotion 修改,或 provider setup 后需要 backfill 时可以触发。provider 不可用、source 不可用、brief 已经 fresh 或刷新失败都不影响 Project Docs 写入结果。
|
|
21
21
|
`reference_summary_refresh` 不接收 provider-facing workflow input。Control Plane 内部保留 workflow / activity trace anchors 与单个 reference file metadata 用于定位、审计和写回;runner 会把目标文件复制到一个临时目录,并以该目录作为 app-server `cwd`,prompt 只说明读取当前目录中的唯一目标文件、禁用写入和网络,并返回 bounded structured summary 输出。
|
|
22
22
|
Phase 6.5 的 reference upload message 可以作为普通聊天事实进入 `scratchpad_refresh`,但 prompt 明确禁止模型在未读取文件的情况下推断文件正文。
|
|
23
|
-
`scratchpad_refresh`
|
|
23
|
+
`scratchpad_refresh` 在压缩上下文时应保留任务执行和验收必需的用户提供细节。它读取当前周期完整、有序的主群聊 `messages`,并按 `messages > active_task_compile > worklist > project_brief` 理解上下文;只有 `messages` 可以产生新的 `task_changes`。每条超长消息先做保留头尾的中间截断,再合并连续作者;不得静默删除较早消息。`task_compile` 则从 durable refs 直接物化原消息正文和完整 clarification answers,不把大段原文复制进 task contract。需要排除的是 secret、provider 细节、raw log 和 Tutti runtime / internal path。
|
|
24
24
|
`follow_up_check` 的 provider-facing 输入只包含展平后的 `title / goal / scope`、上一 `Run.needs_human` 的 `summary`、原 `clarification_request_payload` 和压缩后的 `answers[]`;workflow ref、task id/status、activity ref、result kind、Run lineage、message id、作者 identity 和时间戳不进入 prompt。它只判断原 human decision 是否在同一 frozen contract 内解决:已解决为 `resume`,同一决策仍可在 contract 内补充为 `needs_more_input`,采纳回答会改变 goal / scope 为 `requires_retasking`;不得请求 Run 自己负责的实现选择。provider raw output 使用 `{ result: ... }` 互斥分支,runner adapter 再映射为 Control Plane 内部 outcome。控制面负责把三个结果分别物化为 continuation、下一轮 round 或 retasking-required closure。`Run.failed` / `Task.failed` 当前不再通过 follow-up retry 复活。
|
|
25
25
|
|
|
26
26
|
## 输入变量
|
|
@@ -32,7 +32,7 @@ Fields:
|
|
|
32
32
|
|
|
33
33
|
# Decision Rules
|
|
34
34
|
|
|
35
|
-
-
|
|
35
|
+
- `workflow_input_json` is the complete context for this decision.
|
|
36
36
|
- Treat `goal` and `scope` as the frozen task contract, `previous_run.summary` and `previous_run.clarification_request_payload` as the identified human decision, and `answers` as the submitted human reply.
|
|
37
37
|
- Evaluate only whether the answers resolve that decision within the same frozen task contract.
|
|
38
38
|
- Return `resume` when the blocker is resolved without changing the contract.
|
|
@@ -12,7 +12,7 @@ You summarize one human-uploaded Tutti reference file.
|
|
|
12
12
|
|
|
13
13
|
- The current working directory is an isolated temporary directory created for this turn.
|
|
14
14
|
- It contains exactly one copied target reference file.
|
|
15
|
-
-
|
|
15
|
+
- The copied file is the only evidence for this summary.
|
|
16
16
|
- The original reference path, file metadata, workflow refs, and activity refs are intentionally not part of the prompt.
|
|
17
17
|
|
|
18
18
|
# Task
|
|
@@ -18,18 +18,18 @@ You compile Tutti's Scratchpad into an append-only Worklist proposal for post-ba
|
|
|
18
18
|
|
|
19
19
|
# Context Sources
|
|
20
20
|
|
|
21
|
-
- `
|
|
21
|
+
- `source_messages` contains the frozen discussion submitted for this workflow. Messages remain in chronological order and preserve their original boundaries.
|
|
22
|
+
- `scratchpad` is the immutable five-field summary pinned for the same submission. It has already removed message ids, timestamps, activity refs, and refresh state.
|
|
22
23
|
- `worklist.modules[]` is the current formal Worklist. Module `id` values are the only valid existing module keys. Module names and task titles are historical anchors for resolving short references in the current Scratchpad.
|
|
23
24
|
- `recent_references`, when present, identifies human-uploaded files from the same pinned Scratchpad cycle and provides a terminal summary status for each source.
|
|
24
25
|
- `clarification_rounds`, when present, contains every sealed workflow-bound clarification round for this same pinned Scratchpad, ordered from earliest to latest. Each round keeps its request separate from its ordered submitted answer messages.
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- Treat the provided Scratchpad and Worklist as authoritative. Do not use skills to reread them.
|
|
26
|
+
- Use source messages and clarification answers when exact wording, values, lists, or decisions matter. Later explicit clarification takes precedence over earlier material.
|
|
27
|
+
- Use the direct Worklist projection for current topology.
|
|
28
28
|
- Use `read-worklist` only when an existing task's contract or latest result would clarify the current task's subject, boundary, or delivery relationship. Do not duplicate tasks already covered by the Worklist.
|
|
29
29
|
- Use `read-project-docs` or `read-references` only when task scope, acceptance, product intent, technical stack, repo structure, agent working rules, or reference contents matter and are not clear from direct input.
|
|
30
30
|
- When proposed work materially depends on a recent reference, read the relevant source before freezing the task contract; do not rely on its summary alone.
|
|
31
31
|
- Preserve user-provided non-secret details when they are needed to execute or accept the task. Do not generalize them into vague labels.
|
|
32
|
-
-
|
|
32
|
+
- Exclude credentials, provider internals, raw logs, and Tutti runtime/internal paths.
|
|
33
33
|
|
|
34
34
|
# Delivery Surface Context
|
|
35
35
|
|
|
@@ -49,7 +49,7 @@ Return a `proposal` only when the available context supports one coherent formal
|
|
|
49
49
|
Return `clarification_request_payload` only when all are true:
|
|
50
50
|
|
|
51
51
|
- Resolving the issue would materially change goal, scope, user-visible behavior, visual or interaction direction, technical shape, data or asset source, acceptance criteria, safety boundary, or external side effect.
|
|
52
|
-
- Scratchpad, Worklist, Project Docs, repo facts, and relevant references do not answer it.
|
|
52
|
+
- Source messages, clarification rounds, Scratchpad, Worklist, Project Docs, repo facts, and relevant references do not answer it.
|
|
53
53
|
- Guessing would likely cause rework, risk, or user surprise.
|
|
54
54
|
- A concise human answer can unblock task creation.
|
|
55
55
|
|
|
@@ -80,7 +80,7 @@ Never create tasks for Tutti internal procedures or control-plane steps, includi
|
|
|
80
80
|
- `goal`: exact task outcome in one concise sentence. Tutti uses this as the internal task summary and task contract goal.
|
|
81
81
|
- `scope`: 3-7 short items that together cover implementation surfaces, important constraints / non-goals / assumptions, and observable acceptance signals.
|
|
82
82
|
|
|
83
|
-
Avoid repeating the same idea across `title`, `goal`, and `scope`.
|
|
83
|
+
Avoid repeating the same idea across `title`, `goal`, and `scope`. Keep the task contract concise. When execution depends on exact supplied material, describe how it should be used without copying the full material into the task.
|
|
84
84
|
|
|
85
85
|
# Output
|
|
86
86
|
|
|
@@ -22,12 +22,12 @@ Provider validation 也使用 OpenAI Responses API,但它只是启动前 crede
|
|
|
22
22
|
- `scratchpad_refresh`:保持 OpenAI SDK structured output;已收敛为纯主群聊周期的轻量观察者,输入为完整 current-cycle messages、精简 Worklist、可选 ready Project Brief 和可选 active Task Compile Context,不再递归使用 previous Scratchpad 或读取 clarification。
|
|
23
23
|
- `project_brief_refresh`:使用 OpenAI SDK structured output;从四个 canonical Project Docs 的 bounded source 派生 host-local Project Brief,不使用 Codex app-server、不写目标 repo。
|
|
24
24
|
- `project_context_bootstrap`:已对齐为 Codex app-server read-only + `read-project-docs` / `read-references` skills;只生成缺失 baseline context files 计划,写入仍归 `workspace-ops`。
|
|
25
|
-
- `task_compile`:已对齐为 Codex app-server read-only + `read-project-docs` / `read-worklist` / `read-references` skills;
|
|
25
|
+
- `task_compile`:已对齐为 Codex app-server read-only + `read-project-docs` / `read-worklist` / `read-references` skills;Host 从 workflow-owned durable Task Compile Context 物化完整有序 `source_messages` 与五字段 Scratchpad,Worklist 使用最新紧凑视图,continuation 复用同一来源并追加完整有序 clarification rounds;任务化 readiness 内聚在该 workflow 中,不新增独立 gate。
|
|
26
26
|
- `context_sync`:已对齐为 Codex app-server read-only + `read-project-docs` / `read-worklist` / `read-references` skills;provider-facing direct input 为空,让 app-server 只读探索 repo,并输出 `summary` 与 `updates[].path/content`。
|
|
27
|
-
- `workspace_write_run`:已对齐为 workspace-write + 精简 task contract
|
|
28
|
-
- `follow_up_run`:已对齐为 workspace-write +
|
|
27
|
+
- `workspace_write_run`:已对齐为 workspace-write + 精简 task contract + receipt-derived `source_messages` / completed Task Compile `clarification_rounds` / `recent_references` + Project Docs / Worklist skills + user skills;存在 user skills 时通过 `skills/list.perCwdExtraUserRoots` 预热当前项目 `<TUTTI_HOME>/projects/<project_id>/skills`;Reference Files 不再通过 built-in skill 暴露,若任务或项目文档指向 `docs/reference/` 中资料,Codex 可直接读取相关 repo 文件。
|
|
28
|
+
- `follow_up_run`:已对齐为 workspace-write + 同一 compile-time source context + continuation block + Project Docs / Worklist skills + user skills;存在 user skills 时同样预热当前项目 `<TUTTI_HOME>/projects/<project_id>/skills` extra root;Reference Files 不再通过 built-in skill 暴露,若任务、项目文档或 clarification answer 指向 `docs/reference/` 中资料,Codex 可直接读取相关 repo 文件。
|
|
29
29
|
- `artifact_applicability`:候选缺少 manifest 且 deterministic evidence 无法明确判定时,使用 `artifacts/applicability.md` 做 transient read-only structured-output 判断;判断不写入 Task contract,失败时 fail closed。
|
|
30
|
-
- `pipeline_self_correction`:已对齐为 workspace-write +
|
|
30
|
+
- `pipeline_self_correction`:已对齐为 workspace-write + 同一 compile-time source context + 必填 correction diagnostic;使用 `runs/task-retry.md` 和 `workspace_write_run` selection,在同一 active Run 记录终态前处理 Artifact gate、checks 前后无 candidate diff、checks 失败或 accepted-checkpoint failure 等可自纠 feedback,并在同一持久 project workspace 中保留前一 attempt 的 source 与 repo-local runtime state。
|
|
31
31
|
- `follow_up_check`:保持 OpenAI SDK structured output;已收敛为只判断上游 `Run.needs_human` 的 task-bound answer,不接入 skill,不重查代码或协作上下文;provider-facing input 只保留精简 task contract、previous Run pause reason、原 clarification request 和 answers,provider raw output 使用 `{ result: ... }` 互斥分支,failed-task retry 从 active path 移除。
|
|
32
32
|
- `reference_summary_refresh`:已对齐为 Codex app-server read-only + 单文件临时 `cwd`;workflow / activity refs、原始 path、blob、media type 和 file metadata 只留在 Control Plane 内部,不进入 prompt;provider raw output 使用 `{ result: ... }` 互斥分支,只输出 `summarized.summary` 或 `unavailable.reason`。
|
|
33
33
|
|
|
@@ -54,6 +54,7 @@ Provider validation 也使用 OpenAI Responses API,但它只是启动前 crede
|
|
|
54
54
|
- 2026-08-01:Run pipeline 完成持久 project workspace cutover;本条取代上述历史记录中的 attempt workspace cleanup、fresh run workspace、result commit / fast-forward promotion 与 reconcile candidate 语义。initial、continuation、provider transient retry 和 self-correction 现在复用同一项目目录;candidate Artifact、checks 与正式 preview 共享目录身份,通过 gate 后创建 accepted commit + immutable activity tag。
|
|
55
55
|
- 2026-08-10:Scratchpad / task compile 上下文边界完成重构。Scratchpad 只从当前主群聊周期完整重建,输入收敛为 `project_brief? / worklist / active_task_compile? / messages`;Submit 固定 durable Task Compile Context,bootstrap / compile / continuation 复用 pinned snapshot,continuation 使用完整 `clarification_rounds`,receipt / sources 从 context 生成,clarification 不再回写 Scratchpad。
|
|
56
56
|
- 2026-08-12:Submit 在 Task Compile 前等待 pinned-cycle references 对当前 blob 形成 summary terminal;Task Compile 与对应 Run 接收 compact `recent_references`,initial / continuation / provider retry / self-correction 保留同一 source set。
|
|
57
|
+
- 2026-08-18:Task Compile 与 descendant Run source context 完成贯通。Host 从 pinned / receipt refs 物化相同的有序 `source_messages`,从 workflow-owned closed clarification chain 恢复完整 Task Compile rounds;initial Run、task-bound continuation、provider transient retry 和 pipeline self-correction 均保留这些字段。Task Compile / Run 不新增 `read-main-chat` 或 `read-scratchpad` skill;active prompt 已按实际 direct input 与 server-side selection 审计,移除描述不存在读取能力的禁止文本。
|
|
57
58
|
|
|
58
59
|
后续逐项讨论时,默认从尚未在本节标为已完成的环节继续推进,避免重复分析已经收口的 prompt。
|
|
59
60
|
|
|
@@ -274,14 +275,15 @@ Submit gate 在缺失 baseline context files 且当前主群聊周期存在尚
|
|
|
274
275
|
|
|
275
276
|
当前输入:
|
|
276
277
|
|
|
278
|
+
- `workflow_input_json.source_messages`:Task Compile Context 固定的完整、有序主群聊 source;每条只包含 `role / optional author_display_name / text`,保留正文与消息边界,不含 message id、cursor、timestamp 或 workflow ref。初次 compile 和所有 continuation 都由 Host 从同一组 pinned refs 物化。
|
|
277
279
|
- `workflow_input_json.scratchpad`:当前 workflow-owned Task Compile Context 固定的五个业务字段:`topic / background_summary / current_consensus / open_questions / task_changes`。初次 compile 和所有 continuation 都读取同一 snapshot。
|
|
278
280
|
- `workflow_input_json.worklist.modules[]`:当前正式 Worklist 的紧凑模块视图,仅包含模块 `id / name / optional summary / archived` 与任务 `title / summary / status`;模块名和任务标题作为短指代解析的历史锚点。
|
|
279
281
|
- `workflow_input_json.recent_references`:可选当前 pinned Scratchpad cycle human uploads,按 source message 顺序稳定生成;每项只含 repo-relative `path`、最终 `name` 与对应 source blob 的 `available.text` 或 `unavailable.reason`,不含 blob oid、message id 或 workflow audit fields。
|
|
280
282
|
- `workflow_input_json.clarification_rounds`:可选 workflow-bound continuation 上下文,按 round index 包含截至当前 sealed round 的全部 `request` 和 submitted answer messages;answer message 只包含 `role / optional author_display_name / text`。opening/card refs 被排除,later round 可修正 earlier round,但不得丢失较早轮次。
|
|
281
283
|
- 可通过 `read-project-docs` / `read-worklist` / `read-references` skills 按需读取当前项目上下文文件正文、既有任务 contract / latest result 或相关 reference 正文,用于理解产品目标、技术栈、结构、agent 工作规则、阶段性任务背景或用户提供的参考资料。
|
|
282
|
-
-
|
|
284
|
+
- Worklist 紧凑视图以直接输入为准,task detail 只在需要理解既有任务细节时读取;main chat 与 Scratchpad read skills 不属于该 selection,因为冻结消息和摘要已经是 direct input。
|
|
283
285
|
|
|
284
|
-
不进入 prompt 的字段:`context_entry_json`、workflow ref、activity ref、Task Compile Context source window / refs / submitted time、Scratchpad `id/state/updated_*`、Worklist module/task order、时间戳、latest run result、created-from workflow ref、clarification message id / refs / created_at 等审计或调度字段。
|
|
286
|
+
不进入 prompt 的字段:`context_entry_json`、workflow ref、activity ref、Task Compile Context source window / refs / submitted time、Scratchpad `id/state/updated_*`、Worklist module/task order、时间戳、latest run result、created-from workflow ref、clarification message id / refs / created_at 等审计或调度字段。Host 只展开 pinned refs,因此 Current Scratchpad 与 boundary 后消息不会混入旧 workflow。
|
|
285
287
|
|
|
286
288
|
Provider raw 输出:根对象只包含 `result`;`result` 内二选一输出 `proposal` 或 `clarification_request_payload`,不输出 `decision`。proposal 只包含新模块和新任务;新模块字段为 `temp_key`、`name`,任务使用 `module_ref: { kind: "new" | "existing", key }` 指向本次新模块或现有 Worklist module。任务字段只包含 `title / goal / scope`;`goal` 是一句话任务目标,`scope` 同时承接实施范围、关键约束 / 非目标 / 假设和可观察验收信号。
|
|
287
289
|
|
|
@@ -293,9 +295,9 @@ Provider raw 输出:根对象只包含 `result`;`result` 内二选一输出
|
|
|
293
295
|
|
|
294
296
|
- `task_compile` selection 开放 `read-project-docs` / `read-worklist` / `read-references`,但 prompt 不预设读取顺序或人工拼装上下文;只说明在必要时可以读取。
|
|
295
297
|
- 任务化 readiness 内聚在 `task_compile`:能冻结没有重大隐藏假设的正式 task contract 才生成 proposal;无法从现有上下文可靠推断的高影响缺失决策走现有 workflow-bound clarification,不新增 workflow / gate / schema。
|
|
296
|
-
- task `scope`
|
|
298
|
+
- task `goal / scope` 保持正式、简洁并决定执行边界;执行依赖的精确原文、列表或数值由同一 source context 传给 Run,不复制成长任务描述。
|
|
297
299
|
- clarification 明确撤回 pinned submission 时,provider 可以返回 empty proposal 并正常结束当前 workflow;不得把 concurrent Current Scratchpad 中的新方向借给旧 chain。
|
|
298
|
-
- clarification answers
|
|
300
|
+
- clarification answers 保持原消息边界与完整正文,不跨 round 合并,也不只保留最后一轮;later explicit round 可以修正 earlier material。
|
|
299
301
|
- Project Docs 缺失通常不会进入本环节,因为 Submit gate 会先通过 `project_context_bootstrap` 与 `workspace-ops.initializeProjectDocs` 补齐缺失 baseline paths。gate 检查的是固定路径存在性,不保证内容质量。
|
|
300
302
|
- Project Docs unreadable / unavailable 应是少见状态,通常来自编码或二进制异常、path policy、repo snapshot / viewer、IO 或 scope 配置问题。模型应在 Scratchpad / Worklist 与其他允许证据足够时继续任务化;只有无法定义目标、范围、约束或验收时才请求 workflow-bound clarification。
|
|
301
303
|
- Project Docs 中的 `To be confirmed.` 等占位是开放上下文,不是阻塞项,也不能当作已确认事实。
|
|
@@ -367,11 +369,13 @@ Provider raw 输出:根对象只包含 `result`;`result` 内二选一输出
|
|
|
367
369
|
- `run_input_json.title`:短任务标题,用于快速定位任务意图。
|
|
368
370
|
- `run_input_json.goal`:正式任务目标。
|
|
369
371
|
- `run_input_json.scope`:正式任务边界,同时承接关键约束、非目标、假设和可观察验收信号。
|
|
372
|
+
- `run_input_json.source_messages?`:通过 `Task.created_from_workflow_ref -> receipt sources` 恢复的原提交讨论,只含有序 `role / optional author_display_name / text`。
|
|
373
|
+
- `run_input_json.clarification_rounds?`:该 Task 创建前已经完成的 Task Compile clarification questions / answers,按 round 顺序保留。
|
|
370
374
|
- `run_input_json.recent_references?`:由 task 的 Task Compile receipt sources 恢复的本轮 human uploads;每项只含 path、最终 name 与 available/unavailable summary,必要时 Run 仍按 path 核对原文件。
|
|
371
375
|
- 不传入 `context_entry_json`、task id、task summary、workflow / activity refs、Run lineage、dispatch context 或 project workspace 绝对路径。
|
|
372
376
|
- 通过 `workspace_write_run` selection 可读取 Project Docs 与 Worklist,并可加载所有 enabled user skills;存在 user skills 时,app-server `skills/list` 会先收到当前项目 `<TUTTI_HOME>/projects/<project_id>/skills` extra user root。
|
|
373
377
|
- Reference Files 不通过 built-in skill 暴露;若任务契约或 Project Docs 指向 `docs/reference/` 中资料,Codex 可直接读取相关 repo 文件正文。
|
|
374
|
-
-
|
|
378
|
+
- `goal / scope` 决定本次执行边界;`source_messages` 与 compile `clarification_rounds` 只提供该边界引用的精确材料,不自动扩展任务目标。
|
|
375
379
|
|
|
376
380
|
输出:根对象只包含 `result`;`result` 内四选一输出 `completed.{summary,user_note_candidate}`、`completed_no_repo_changes.{summary,user_note_candidate}`、`needs_human.{title,summary,request}` 或 `failed.summary`。`user_note_candidate` 是可选最终反馈候选,字段必填但可为 `null`;生成给用户直接查看的文件应写入 `docs/reference/tutti/`。`completed_no_repo_changes` 只用于任务契约不要求 repository file changes 的情况。`needs_human` payload 必须能直接作为 task-bound clarification request 使用:解释为什么 frozen contract 下无法安全继续,并提出一个具体、可回答、非 secret 的问题。
|
|
377
381
|
|
|
@@ -397,6 +401,7 @@ provider transient retry:如果本环节的 Codex app-server workspace-write t
|
|
|
397
401
|
当前输入:
|
|
398
402
|
|
|
399
403
|
- `run_input_json.title` / `goal` / `scope`:同初次 Task Run,是 frozen task contract 的完整 provider-facing 表达。
|
|
404
|
+
- `run_input_json.source_messages?` / `clarification_rounds?`:与 initial Run 相同的 Task Compile source context。
|
|
400
405
|
- `run_input_json.recent_references?`:与 initial Run 相同的 receipt-derived source set;task-bound continuation 不读取后续上传。
|
|
401
406
|
- `run_input_json.continuation.previous_run`:上一 Run 的 needs-human summary 与原 clarification request payload,说明为什么暂停。
|
|
402
407
|
- `run_input_json.continuation.clarification.resolved_rounds[]`:截至当前 round 的已提交 task-bound clarification rounds;每轮包含 request payload 和人类回答消息原文。
|
|
@@ -404,7 +409,7 @@ provider transient retry:如果本环节的 Codex app-server workspace-write t
|
|
|
404
409
|
- 不传入 `context_entry_json`、task id、task summary、workflow / activity refs、Run lineage、dispatch context 或 project workspace 绝对路径。
|
|
405
410
|
- 通过 `follow_up_run` selection 可读取 Project Docs 与 Worklist,并可加载所有 enabled user skills;存在 user skills 时,app-server `skills/list` 会先收到当前项目 `<TUTTI_HOME>/projects/<project_id>/skills` extra user root。
|
|
406
411
|
- Reference Files 不通过 built-in skill 暴露;若任务契约、Project Docs 或 clarification answer 指向 `docs/reference/` 中资料,Codex 可直接读取相关 repo 文件正文。
|
|
407
|
-
-
|
|
412
|
+
- compile-time source context 继续只作为 frozen contract 引用的材料;task-bound `continuation` 负责当前 Run 暂停后的补充。
|
|
408
413
|
|
|
409
414
|
输出:同初次 Task Run 的 `{ result: ... }` 互斥分支 schema。continuation 不再自报 `docs` 或 `changed_paths`。
|
|
410
415
|
|
|
@@ -431,6 +436,7 @@ provider transient retry:continuation 的 retryable app-server failure 只在
|
|
|
431
436
|
当前输入:
|
|
432
437
|
|
|
433
438
|
- `run_input_json.title` / `goal` / `scope`:同一 frozen task contract。
|
|
439
|
+
- `run_input_json.source_messages?` / `clarification_rounds?`:与原 attempt 相同的 Task Compile source context;pipeline self-correction 与其 provider transient retry 均保留。
|
|
434
440
|
- `run_input_json.recent_references?`:与原 attempt 相同的 receipt-derived source set;pipeline self-correction 与其 provider transient retry 均保留。
|
|
435
441
|
- `run_input_json.correction.summary`:上一 attempt 的 bounded failure summary。
|
|
436
442
|
- `run_input_json.correction.reason_code`:Run pipeline 生成的 feedback 短码,来源包括 Artifact gate、checks 前后无 candidate diff、checks 失败或 accepted-checkpoint failure。
|
package/prompts/runs/README.md
CHANGED
|
@@ -8,7 +8,7 @@ These templates are used by task `Run` execution.
|
|
|
8
8
|
Templates in this directory may describe task contracts, repo evidence, check expectations, artifact declaration rules, and documentation update responsibilities. They must never include provider credentials or host-local secret material.
|
|
9
9
|
|
|
10
10
|
`task-run.md` keeps implementation judgment inside the frozen contract with Codex. Human clarification is reserved for interpreting contract intent, choosing among incompatible requirements or source facts, supplying required non-secret context, relaxing an explicit constraint, or accepting a material risk or external effect. Technical difficulty, tooling failure, and validation failure stay with the Run when they can be handled; otherwise the result is `failed`, not a question for the user. If the task contract does not require repository file changes, the output can use `completed_no_repo_changes`; otherwise a completed implementation is expected to produce a candidate diff. If the candidate is complete but Codex self-validation commands are unavailable or blocked, the task-run output should still be `completed`; Tutti checks are the authoritative validation gate.
|
|
11
|
-
Initial `task-run.md`, active `task-continuation.md`, and active pipeline `task-retry.md` receive the compact task contract fields `title / goal / scope` plus optional receipt-derived `recent_references
|
|
11
|
+
Initial `task-run.md`, active `task-continuation.md`, and active pipeline `task-retry.md` receive the compact task contract fields `title / goal / scope` plus optional receipt-derived `source_messages`, completed Task Compile `clarification_rounds`, and `recent_references`. Source messages and clarification answers preserve the exact submitted material in ordered `role / optional author_display_name / text` entries; each reference includes only path, final name and available/unavailable summary. The contract defines execution scope, while these fields supply exact content referenced by it. Continuation adds the required task-bound `continuation` block, and pipeline self-correction retry adds the required `correction` block with the previous failure summary, machine-generated reason code, correction guidance, a required redacted / bounded diagnostic, and `promotion_failure` as either a complete object or explicit `null`. Provider transient retry and self-correction both preserve all compile-time source context. Provider-facing prompts do not receive task ids, task summaries, Run lineage, workflow anchors, blob ids, message ids, changed paths, docs status, checks status, or the safety audit context entry.
|
|
12
12
|
All three Run templates use a slim mutually exclusive structured output schema under `result`: exactly one of `completed.{summary,user_note_candidate}`, `completed_no_repo_changes.{summary,user_note_candidate}`, `needs_human.{title,summary,request}`, or `failed.summary`. The `summary` is a concise, human-readable result note for project members who may not inspect the code. Completed branches also require `user_note_candidate`, which is either a short user-facing final-card sentence or `null`; it must not repeat `summary` or include file paths. Checks, docs, promotion, changed paths, and other Tutti status stay in structured fields derived by the Run pipeline. They do not ask Codex to self-report docs status or changed paths; both come from Run pipeline Git diff and derived projection.
|
|
13
13
|
Run templates describe `docs/reference/` as a user-visible file exchange area. Human uploads remain under `docs/reference/files/` and `docs/reference/images/`; `docs/reference/tutti/**` is for Tutti-generated files intended for direct member review in References, not temporary output, internal notes, logs, or canonical project documentation. Generated user-visible files must be written under `docs/reference/tutti/`, with `docs/reference/tutti/<meaningful-folder>/...` used when the folder name should be shown as a References UI group. Generated files under `docs/reference/tutti/` are discovered from promoted changed paths, rendered by References automatically, and may be listed in completed task result cards.
|
|
14
14
|
Initial `task-run.md`, active `task-continuation.md`, and active pipeline `task-retry.md` also instruct Codex to write or update the single active `tutti.artifact.json` manifest only when the task creates or updates a member-viewable visual artifact. Each template includes the complete strict static and server JSON shapes: every behavior field is required, `network` is always an explicit boolean, and server `script / ready_path / port` fields are forbidden. A server package instead declares the fixed `artifact:preview` npm script in its own `package.json` and listens on the injected `HOST / PORT`. The manifest remains repo truth and is not reported through the structured output schema.
|
|
@@ -23,6 +23,8 @@ Fields:
|
|
|
23
23
|
- `title`: short task title for orientation.
|
|
24
24
|
- `goal`: formal task outcome to implement.
|
|
25
25
|
- `scope`: formal task boundary. Scope lines may include implementation surfaces, constraints, non-goals, assumptions, and observable acceptance signals.
|
|
26
|
+
- `source_messages`, when present: the frozen submission discussion associated with this task.
|
|
27
|
+
- `clarification_rounds`, when present: questions and answers completed before the task contract was created.
|
|
26
28
|
- `recent_references`, when present: human-uploaded files from the Task Compile source cycle, with a terminal summary status for each source.
|
|
27
29
|
- `continuation`: previous Run pause reason, submitted clarification answers, and the `follow_up_check.resume` summary.
|
|
28
30
|
|
|
@@ -39,10 +41,10 @@ Human clarification answers may clarify or confirm work inside the frozen task c
|
|
|
39
41
|
|
|
40
42
|
# Execution Boundary
|
|
41
43
|
|
|
42
|
-
-
|
|
44
|
+
- `goal` and `scope` define the execution boundary.
|
|
43
45
|
- Use `title` only for orientation; it does not expand the contract.
|
|
44
46
|
- Use clarification answers only within the frozen contract.
|
|
45
|
-
-
|
|
47
|
+
- `source_messages` and `clarification_rounds`, when present, provide the submitted material referenced by that boundary. Use them for exact content without treating them as additional objectives.
|
|
46
48
|
- Work only inside the provided project workspace.
|
|
47
49
|
- This workspace is the persistent development state. It may retain unaccepted source changes and project-local dependency or runtime state from the paused or failed work; inspect and continue from that state within the frozen task contract.
|
|
48
50
|
- Do not reset, checkout, stash, clean, or otherwise discard existing workspace state. Do not remove changes merely because they were created before this continuation.
|
|
@@ -23,6 +23,8 @@ Fields:
|
|
|
23
23
|
- `title`: short task title for orientation.
|
|
24
24
|
- `goal`: formal task outcome to implement.
|
|
25
25
|
- `scope`: formal task boundary. Scope lines may include implementation surfaces, constraints, non-goals, assumptions, and observable acceptance signals.
|
|
26
|
+
- `source_messages`, when present: the frozen submission discussion associated with this task.
|
|
27
|
+
- `clarification_rounds`, when present: questions and answers completed before the task contract was created.
|
|
26
28
|
- `recent_references`, when present: human-uploaded files from the Task Compile source cycle, with a terminal summary status for each source.
|
|
27
29
|
- `correction`: bounded pipeline feedback from the previous attempt and the immediate retry guidance.
|
|
28
30
|
|
|
@@ -47,11 +49,11 @@ Correct the existing candidate in place, using `correction.summary`, `correction
|
|
|
47
49
|
|
|
48
50
|
# Execution Boundary
|
|
49
51
|
|
|
50
|
-
-
|
|
52
|
+
- `goal` and `scope` define the execution boundary.
|
|
51
53
|
- Use `title` only for orientation; it does not expand the contract.
|
|
52
54
|
- Use `correction` only to fix the pipeline feedback; it does not change the frozen contract.
|
|
53
55
|
- Do not repeat the previous candidate blindly.
|
|
54
|
-
-
|
|
56
|
+
- `source_messages` and `clarification_rounds`, when present, provide the submitted material referenced by that boundary. Use them for exact content without treating them as additional objectives.
|
|
55
57
|
- Work only inside the provided project workspace.
|
|
56
58
|
- Do not reset, checkout, stash, clean, or otherwise discard the previous attempt's source, dependency, or runtime state. Remove or replace existing changes only when that is directly required to correct the candidate within the frozen task contract.
|
|
57
59
|
- Before returning, inspect the final Git status. Maintain the repository's own `.gitignore` for project-local state that should not be versioned, following existing project conventions; keep files Git-visible when they are intentional versioned source. Do not assume fixed runtime path names.
|
package/prompts/runs/task-run.md
CHANGED
|
@@ -23,13 +23,15 @@ Fields:
|
|
|
23
23
|
- `title`: short task title for orientation.
|
|
24
24
|
- `goal`: formal task outcome to implement.
|
|
25
25
|
- `scope`: formal task boundary. Scope lines may include implementation surfaces, constraints, non-goals, assumptions, and observable acceptance signals.
|
|
26
|
+
- `source_messages`, when present: the frozen submission discussion associated with this task.
|
|
27
|
+
- `clarification_rounds`, when present: questions and answers completed before the task contract was created.
|
|
26
28
|
- `recent_references`, when present: human-uploaded files from the Task Compile source cycle, with a terminal summary status for each source.
|
|
27
29
|
|
|
28
30
|
# Execution Boundary
|
|
29
31
|
|
|
30
|
-
-
|
|
32
|
+
- `goal` and `scope` define the execution boundary.
|
|
31
33
|
- Use `title` only for orientation; it does not expand the contract.
|
|
32
|
-
-
|
|
34
|
+
- `source_messages` and `clarification_rounds`, when present, provide the submitted material referenced by that boundary. Use them for exact content without treating them as additional objectives.
|
|
33
35
|
- Work only inside the provided project workspace.
|
|
34
36
|
- This workspace is the persistent development state. It may already contain unaccepted source changes or project-local dependency and runtime state left by an earlier failed Run; inspect and continue from that state when it is relevant to the frozen task contract.
|
|
35
37
|
- Do not reset, checkout, stash, clean, or otherwise discard existing workspace state. Do not remove changes merely because they predate this Run or are not part of the immediate fix.
|