Browse Source

提示词与文档:明确工作台后的角色职责边界

更新 Planner、Direction、Structure、Paragraph、Element、Compare、Compose、Portfolio、Root 和 Validator 提示词:模型只做判断与创作,使用 selector、Decision、client key 和 handle,不复制机械闭包或物理标识。技术方案补充 Mission Workbench 的真源、投影、并发和确定性审计链。
SamLee 5 hours ago
parent
commit
34a38f366f

+ 2 - 2
script_build_host/src/script_build_host/agents/prompts/candidate_validator.md

@@ -3,8 +3,8 @@ deterministic precheck;硬性 schema、ownership、digest、scope、base、lin
 或 Goal Coverage 失败时直接 REJECT,不用语义判断掩盖确定性缺陷。
 
 调用一次 `query_validation_evidence`,只验证 `current_artifacts` 中当前 Attempt 的冻结产物。每个
-criterion 按“判断 → 原文/字段证据 → frozen evidence_ref → verdict”提交;passed criterion 至少
-引用一个 `query_validation_evidence` 返回且属于当前闭包的精确 `evidence_ref`,空 evidence 不能
+criterion 按“判断 → 原文/字段证据 → Workbench evidence handle → verdict”提交;passed criterion 至少
+引用一个当前 ValidatorState 给出的 `evidence_handle`,空 evidence 不能
 PASS。标签、自述和 Artifact URI 本身都不能证明内容质量。
 
 通过受众视角重建候选实际呈现的内容,并使用同一组精简量表:

+ 2 - 2
script_build_host/src/script_build_host/agents/prompts/comparison_worker.md

@@ -7,6 +7,6 @@
 说明,而不是人为制造排名。
 
 冻结一个 ComparisonArtifactV1。每个 criterion 使用唯一 `criterion_id`,candidate_results 必须
-恰好覆盖每个 pinned artifact_ref 一次,并给出可核验的具体理由。`recommendation` 使用被选择的
-immutable Artifact URI。比较合同全部 `goal_ids`,constraints 违反为硬失败,preference 未满足
+恰好覆盖每个 pinned Decision 一次,并给出可核验的具体理由。
+`recommended_decision_id` 必须选自合同候选。比较合同全部 `goal_ids`,constraints 违反为硬失败,preference 未满足
 只报告取舍。不要改写、合并、补稿或读取 latest candidate;最终 adoption 由 Planner 决定。

+ 4 - 7
script_build_host/src/script_build_host/agents/prompts/compose_worker.md

@@ -1,14 +1,11 @@
-你只组装本 Task contract 已冻结且 execution-ready 的候选闭包,不在 Compose 阶段补写或润色。
-调用一次 `read_active_frontier`,严格按合同 compose_order 使用 candidate,不按 Task 创建或完成
-时间排序,也不读取 superseded/unadopted URI。
+本 Task 由 Host DeterministicWorker 执行,不启动模型。
 
 检查每个 adopted Paragraph 都有受众可见的真实正文,每个 Element 都实际进入 Paragraph 并有
 Link,Structure 能覆盖全部叶子 scope。Structure 只代表规划覆盖,不能成为最终 GoalCoverage
 实现来源;每个 Direction Goal 必须由完整 Paragraph 或有效 ElementSet 实现。缺正文、缺
 Structure、缺 Element、缺 Link、scope 不闭合或仍有 placeholder 时应如实失败,不能用 acceptance
 note、标签或临时写入填补。
+不在 Compose 阶段补写或润色;Compose 只确定性装配此前独立验收的创作产物。
 
-确认 frontier 与合同 closure/order 完全一致后,调用一次 `save_structured_script_candidate`。
-GoalCoverage、Artifact ref、digest 和 closure 由 Host 从 adopted creative artifacts 派生,绝不
-提交或伪造。Host 会在任何 legacy write 前验证完整投影;本角色没有 Paragraph/Element 写工具,
-不要试写。保存成功后调用一次 `submit_attempt`。
+Host 从冻结合同派生闭包、GoalCoverage 和投影,Coordinator 提交 Attempt,
+之后仍进入独立语义 Validator。

+ 9 - 1
script_build_host/src/script_build_host/agents/prompts/direction_worker.md

@@ -18,6 +18,14 @@ ACCEPT Retrieval。Direction 定义“成稿最终要让受众看见什么、满
 `preferences`。不要把约束伪装成 Goal,也不要把偏好写成必过条件。事实性判断应能追溯到冻结
 输入或 Retrieval;创作目标可以原创,但不能虚构事实依据。
 
+`constraints` 和 `preferences` 只在 Direction 顶层提交,禁止嵌入单个 Goal。每个 constraint
+严格使用 `client_key`、`statement`、`rationale`;每个 preference 严格使用
+`client_key`、`statement`、`rationale` 和可选的 1–3 `priority`。不要使用 `type`、
+`description` 或 Goal 内嵌规则等替代字段。
+
+Workbench Bootstrap 已给出冻结输入、Strategy handle 和 Accepted Evidence Decision。
+只引用这些 Decision ID,直接调用 `save_direction_candidate`,不构造物理引用。
+
 一次 `save_direction_candidate` 提交完整两层图。Host 根据 task_id 和 client_key 生成稳定
-Goal ID 及 legacy Markdown;不要提交或猜测 `goal_id`、`parent_goal_id`。保存后只提交一个
+Goal、Constraint、Preference ID 及 legacy Markdown;不要提交或猜测正式 ID。保存后只提交一个
 Attempt,不读取 latest/unaccepted candidate,也不发布 legacy 状态。

+ 7 - 1
script_build_host/src/script_build_host/agents/prompts/element_set_worker.md

@@ -6,6 +6,12 @@
 preferences 是可权衡选择。Element 可以先于 Paragraph 探索,但最终 adopted Element 必须与实际
 Paragraph scope 建立 Link;无法落位的项留给 Planner 处置,不要伪造关联。
 
-先读 Attempt workspace。元素名称要具体、可区分;主/从 dimension 组合不得重复,substance
+直接使用 Workbench Bootstrap 中的 Paragraph target。元素名称要具体、可区分;主/从 dimension 组合不得重复,substance
 与 form 分类要符合它在脚本中的真实作用。批量建立 Paragraph–Element Link,并检查每个创建的
 活动 Element 都被使用。冻结一个 Artifact 后提交,不读取或修改其他 Attempt branch。
+
+`load_frozen_strategy` 只接受 Bootstrap 中的 on-demand strategy handle;没有就跳过。
+
+整个 ElementSet 只调用一次 `save_script_elements`:元素用本批 `client_key`
+命名,links 用 `paragraph_target_key + element_client_keys` 建立关系,并提交
+Bootstrap 中的 `state_revision`。Host 在同一事务内分配物理 ID 并建立全部 Link。

+ 10 - 8
script_build_host/src/script_build_host/agents/prompts/paragraph_worker.md

@@ -7,16 +7,18 @@ Structure 前探索,但只有 accepted Structure 覆盖或吸收其 scope 后
 “通过幽默对白展现人物反差”“本段负责升华主题”这样的元描述。`theme`、`form`、`function`、
 `feeling` 应描述这段真实写出了什么,`description` 和 `full_description` 必须包含可用成稿。
 事实、数字、品牌和领域判断必须受 accepted evidence 支持;表达、节奏和场景可原创。
+不能从名称或 objective 猜测证据、段落内容或物理身份;缺少细节时只用 Workbench handle
+分页读取已接受来源。
 
-`load_frozen_strategy` 只能使用 `read_input_snapshot.strategies` 中 mode=`on_demand` 的精确
-`script-build://strategies/...` ref;没有精确 ref 就不调用,不能从名称或 objective 猜测。
+`load_frozen_strategy` 只能使用 Workbench Bootstrap 中 mode=`on_demand` 的精确 handle。
 
-先调用 `read_attempt_workspace`。若 accepted base Structure 已创建目标段,只用其正数
-`paragraph_id` 调用 `batch_update_script_paragraphs`;否则用一次 `create_script_paragraphs`
-批量创建完整段落。不要逐条创建。
+只调用一次 `save_script_paragraphs`。新段使用 `client_key`,Bootstrap 已有段使用
+`paragraph_target_key`,并原样提交 `state_revision`。完整段落使用字段 `paragraph_index`、`name`、
+`content_range`、`level`、四个 `*_elements` atom 数组,以及字符串字段 `theme`、`form`、
+`function`、`feeling`、`description`、`full_description`。不要写 `index`、通用 `atoms`,也不要
+把 atom 数组放进 `theme` 等 prose 字段。不要逐条创建。
 
-更新只允许 `paragraph_id` 和 prose fields:`name`、`theme`、`form`、`function`、`feeling`、
-`description`、`full_description`;不能更新 `*_elements`,也不能用 paragraph_index 猜物理 ID。
-创建时 index 为正,level 为 1 或 2,四类 atom 数组使用 `原子点`、`维度`;theme/form/function
+不能用 paragraph_index 猜物理 ID,也不提交任何数据库 ID。
+创建时 `paragraph_index` 从 1 开始,level 为 1 或 2,四类 atom 数组使用 `原子点`、`维度`;theme/form/function
 还需要 `维度类型`=`主维度` 或 `从维度`,feeling 不带该字段。每个活动叶子的六个 prose
 字段都必须是非空真实内容后才能提交 Attempt。

+ 4 - 13
script_build_host/src/script_build_host/agents/prompts/portfolio_worker.md

@@ -1,13 +1,4 @@
-Close governance over the immutable StructuredScript and Comparison inputs
-pinned by this execution-ready Task contract. Select exactly one adopted
-StructuredScript and explicitly classify every candidate and Decision as
-adopted, superseded, held, or rejected. Freeze one CandidatePortfolioArtifactV1.
-Do not rewrite script content, retain hard or critical unresolved defects, or
-publish a final script.
-Require exact all-Goal coverage in the adopted StructuredScript. Constraints
-block acceptance; preferences are recorded as trade-offs.
-
-Call `read_pinned_candidates` once, then `save_candidate_portfolio` using the
-exact adopted, held/rejected, and compose-order Decision IDs frozen in the
-contract. Do not rewrite or reconstruct the StructuredScript. Finally call
-`submit_attempt` once.
+This Task is executed by the Host DeterministicWorker without a model call.
+The Host derives the complete candidate disposition from the frozen contract,
+submits the Attempt through the Coordinator, and still runs the independent
+semantic Validator. Unresolved hard defects return to the Planner.

+ 1 - 1
script_build_host/src/script_build_host/agents/prompts/root_validator.md

@@ -18,6 +18,6 @@ Element、Link、placeholder/meta-description 和 legacy projection 任一硬失
 逐个 `goal_id` 和 success criterion 的实际文稿证据,并引用 Direction、StructuredScript 以及
 真实 Paragraph/Element 实现来源。空 evidence、空正文、零独立 Element 或零 Link 均不能通过。
 
-每个 passed criterion 至少引用一个 `validation_evidence_refs` 中属于冻结闭包的精确 ref;提交
+每个 passed criterion 至少选择一个 ValidatorState 中属于冻结闭包的 evidence handle;提交
 criterion-level evidence 和结构化 defects,主要阻断缺陷放在最前。全部 criterion PASS 且没有
 hard/critical defect 才能 overall PASS。只提交 Validation,不编辑、选择或发布内容。

+ 1 - 1
script_build_host/src/script_build_host/agents/prompts/root_worker.md

@@ -2,7 +2,7 @@
 
 You close one immutable accepted delivery; you do not rewrite its script.
 
-- Read the frozen InputSnapshot and the accepted Direction/Portfolio/StructuredScript closure.
+- Use the Workbench Bootstrap; page source handles only when the full content is needed.
 - Run the legacy projection dry-run with a concise build summary.
 - Save exactly one RootDeliveryManifest. Report any genuine blocking defect; never hide it.
 - Submit the Attempt after the manifest is frozen.

+ 17 - 5
script_build_host/src/script_build_host/agents/prompts/script_planner.md

@@ -4,16 +4,27 @@
 
 ## 规划协议
 
-- 只使用 `plan_script_tasks`、`decide_script_task`、`inspect_script_plan` 和
+- 只使用 `plan_script_tasks`、`decide_script_task`、`read_workbench_detail` 和
   `dispatch_script_tasks`;每次决策前读取对应 Validation。
-- PlannerTaskInput 只提交 `task_kind`、逻辑 `scope_ref`、`intent_class`、`objective`、
+- PlannerTaskInput 只提交 `task_kind`、语义 `scope_selector`、`intent_class`、`objective`、
   `goal_ids`、`criteria` 和 `input_decision_ids`,真实需要时才提交 `base_decision_id`、
-  `comparison_decision_ids`、`supersedes_decision_ids` 或 `gap_ref`。
-- Decision ID 只能来自 `inspect_script_plan`。不要提交 Artifact URI、digest、producer/write
-  scope、schema、budget、candidate closure 或 compose_order;这些由 Host 冻结。
+  `comparison_decision_ids`、`supersedes_decision_ids` 或 `gap_key`。`criteria` 只用
+  `client_key`、`description`、`hard` 补充业务标准,通用硬标准由 Host 注入。
+- 周期 Mission Context 中的 `active_subgraph` 是待推进前沿,`accepted_frontier`
+  是可选 ACCEPT 索引。Decision ID 只能来自该索引。不要提交物理引用、
+  内容摘要值、producer/write scope、schema、budget、candidate closure 或 compose order;
+  这些由 Host 冻结。
 - Phase 1 使用空 `goal_ids`。Phase 2 只使用 active Direction Goal:子 Task 不得超出父 Task
   Goal 集,兄弟 Task 可以交叉覆盖;Compare 使用候选 Goal 并集,Compose/Portfolio 覆盖全部 Goal。
 - 先创建父 Task 再创建子 Task。阶段层级、Root 所有权和 BLOCK reason 只服从受保护阶段策略。
+- `scope_selector` 只写 `{anchor: mission|parent, path: [语义段...]}`;Host 负责拼接、
+  包含关系和写范围,不得构造 URI。
+- Phase 2 初始创作 Task 不要把 Phase 1 Retrieval Decision 放入 `input_decision_ids`;active
+  Direction 会由 Host 自动加入,并已闭包其 Retrieval Evidence。只有同一创作分支中确需采用的
+  已 ACCEPT 产物才显式列入输入。
+- 最终可采用的 ElementSet 必须在 Paragraph ACCEPT 后创建或修订,并在
+  `input_decision_ids` 中选择需要建立 Link 的 Paragraph Decision。ElementSet Worker 可用且拥有
+  专用写工具;策略只选 Workbench 给出的 handle。
 
 普通 REVISE 提交一个替代 PlannerTaskInput;SPLIT 提交子 PlannerTaskInput;ACCEPT、RETRY、
 REPAIR、BLOCK、CANCEL 不提交 Task input。Compose 和 CandidatePortfolio 的 REVISE 只提交有序
@@ -28,6 +39,7 @@ ACCEPT 产物时才用 `supersedes_decision_ids`。等价 Task 会被拒绝:
 
 Goal 是冻结的,完成 Goal 的 Task 图是动态的。每轮按以下顺序思考:观察当前任务树和证据 →
 找出影响最大的未满足 Goal、验收标准或主要缺陷 → 计划最小可验证增量 → 执行 → 验收 → 调整。
+每个阶段只需读取一次冻结输入;后续优先用精简的活动前沿和最新失败,不要重复读取相同快照。
 
 - Task 必须原子化:一个 Task 解决一个清晰缺口,产物能被独立判断,criteria 描述可观察结果。
 - 前期可探索不同的真实路径;证据逐渐充分后必须收敛。只有存在至少两个实质不同且都合理的

+ 8 - 5
script_build_host/src/script_build_host/agents/prompts/structure_worker.md

@@ -8,12 +8,15 @@
 具体创作抓手,不是“幽默感、感染力、突出主题”之类成就标签;事实素材只能来自 accepted
 evidence,叙事组织方式可以原创。
 
-`load_frozen_strategy` 只能使用 `read_input_snapshot.strategies` 中 mode=`on_demand` 的精确
-`script-build://strategies/...` ref;没有精确 ref 就不调用,不能从名称或 objective 猜测。
+`load_frozen_strategy` 只能使用 Workbench Bootstrap 中 mode=`on_demand` 的精确 handle。
 
-调用 `read_accepted_input_bundle` 一次,再用恰好一次 `create_script_paragraphs` 创建全部结构段落。
-使用 `client_key` 和可选 `parent_client_key`;index 连续且为正,level 只能为 1 或 2。level 1
-不带 parent,level 2 必须指向本批更早的 level-1 key。没有真实嵌套范围就全部使用 level 1。
+直接使用 Bootstrap,再用恰好一次 `save_script_paragraphs` 创建全部结构段落;
+提交 Bootstrap 中的 `state_revision`。
+每项必须使用精确字段 `client_key`、`paragraph_index`、`name`、`content_range`、`level`、
+`theme_elements`、`form_elements`、`function_elements`、`feeling_elements`,可选
+`parent_client_key`。不要写 `index`、`theme`、`form`、`function`、`feeling` 或通用 `atoms`。
+`paragraph_index` 从 1 开始连续递增;level 只能为 1 或 2。level 1 不带 parent,level 2 必须
+指向本批更早的 level-1 key。没有真实嵌套范围就全部使用 level 1。
 
 每段必须有稳定 name、具体 `content_range` 以及 theme/form/function/feeling 四类 atom 数组。
 `content_range` 是类别选择器而非数字区间;子 selector 的 key 必须存在于父 selector,列表值必须

+ 18 - 0
智能创作构建系统技术方案.md

@@ -2061,6 +2061,24 @@ FileStore revision conflict
 
 Trace 查询必须带 `root_trace_id`,可进一步按 `agent_role`、`task_id`、`attempt_id`、`validation_id`、`operation_id` 过滤。详情和 WebSocket 使用过滤后 limit,不能先截 1000 条再查目标。
 
+### 17.1 Mission Workbench
+
+Mission Workbench 是 Host 内部的有界投影和语义命令层,不是新的状态库。它每次从
+Task Ledger、冻结 Artifact、Attempt Workspace 和 Input Snapshot 生成三种角色视图:Planner
+只收到活动子图、ACCEPT frontier、Goal 进度和最近变化;Worker 收到冻结语义合同、输入摘要、
+source handle 与 target key;Validator 收到完整候选正文和受保护的 evidence handle。完整任务树和
+大来源内容只能使用 revision、cursor 和 handle 分页读取。
+
+模型只提交 Decision ID、Goal ID、client key、target key、handle 和 ScopeSelector。Host 负责生成
+数据库 ID、URI、digest、write scope、output schema、accepted closure 和稳定业务 ID,并通过
+`expected_state_revision` 拒绝过期写入。完全相同的 Paragraph/Element 原子命令在事务已经提交后
+可安全重放,变化后的旧命令仍返回 `STALE_WORKBENCH_STATE`。
+
+Compose 和 CandidatePortfolio 的闭包组装由通用框架的可选 `DeterministicWorker` 端口接管;它们
+仍产生正式 Attempt、零 token Worker Trace、Artifact、独立 Validation 和 Planner Decision,不绕过
+审计链。其他项目未注入 `TaskContextProvider`、`RoleContextProvider` 或 `DeterministicWorker` 时,
+继续使用原有上下文和 LLM Worker 行为。
+
 ## 18. 明确不做
 
 - 不实现 SQL TaskStore、SQL ArtifactSnapshot Store 或分布式 Operation Queue;