fix: deduplicate mandatory task context and clarify check-plan evidence
This commit is contained in:
@@ -335,13 +335,16 @@ export class Runtime {
|
||||
const unknown = [...this.store.core.tool.values()].filter(tool => tool.taskId === task.id && tool.requiresVerification)
|
||||
.map(tool => ({ invocation_id: tool.id, call_id: tool.callId, tool: tool.tool, status: tool.state, requires_verification: true }));
|
||||
const fileResults = this.fileResults().inspect(session);
|
||||
// Keep the complete goal once in this request view. The stored contract
|
||||
// still contains its original goal for intent and evidence verification.
|
||||
const { goal, ...contract } = taskContract(task);
|
||||
const context = this.provider.redact(projectContext(run.project) + (run.worker ? '\n受限子任务执行契约(宿主权限,不可扩展):' + JSON.stringify({
|
||||
parent_task_id: run.worker.parentTaskId, worker_id: run.worker.id, write_paths: run.worker.paths, budget: run.worker.budget,
|
||||
rule: '只有范围内提案、审查应用和当前工程检查构成完成;不得请求任意终端、独立Git提交、外部工具或嵌套协作。',
|
||||
}) : '') + '\n当前项目/会话/任务身份:' + JSON.stringify({
|
||||
project_id: run.project.id, session_id: session.id, task_id: task.id, workspace: projectWorkspaceIdentity(run.project) }) + '\n当前Task文件提案状态:' + JSON.stringify(state)
|
||||
+ '\n当前任务目标与全部追加要求(用户任务数据,完整保留):\n' + JSON.stringify({
|
||||
goal: taskContract(task).goal, instructions: task.instructions.filter(instruction => instruction.source !== 'review-action'), constraints: task.constraints ?? [], acceptance: task.acceptance ?? [], contract: taskContract(task),
|
||||
goal, instructions: task.instructions.filter(instruction => instruction.source !== 'review-action'), constraints: task.constraints ?? [], acceptance: task.acceptance ?? [], contract,
|
||||
}) + (run.record.purpose === 'diagnostic' ? '\n本次仅回答运行诊断问题,允许读取所属结果;不得修改文件、执行命令或将解释视为原任务交付。诊断问题:' + run.record.question : '')
|
||||
+ '\n结果未知的调用,不得假定成功或重放:' + JSON.stringify(unknown)
|
||||
+ (deliveryProgress ? '\n已应用修改后的当前交付依据(每次请求重新核对,非操作授权):\n' + JSON.stringify(deliveryProgress) : '')
|
||||
@@ -349,7 +352,7 @@ export class Runtime {
|
||||
current: fileResults.results.slice(0, 8).map(row => ({ id: row.id, taskId: row.taskId, runId: row.runId, verification: row.verification, error: row.error, reason: row.reason, files: row.files.map(({ path, sha256, origin }) => ({ path, sha256, origin })) })),
|
||||
sources: fileResults.sources.slice(0, 4),
|
||||
}) : '')
|
||||
+ '\n' + sessionContext(session, run.project, config, value => this.provider.redact(value))
|
||||
+ '\n' + sessionContext(session, run.project, config, value => this.provider.redact(value), { taskPlanIncluded: !!taskPlan })
|
||||
+ (task.readProgress?.warning ? '\n当前读取进展:' + task.readProgress.warning : '')
|
||||
+ (readCoverage ? '\n本次Run实际返回的已读区间(读取事实,非新指令):\n' + JSON.stringify(readCoverage) : '')
|
||||
+ (taskPlan ? '\n当前Task依赖计划与尚未核验的原步骤(任务数据,不授权额外操作):\n' + JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user