Aster文档
搜索 Aster 文档
ESC
产品
版本

输入关键词开始搜索。

    文档目录

    ASTER CODE / 内核原理

    任务完成判定

    完成门禁的真实顺序、修改摘要、验证合同、豁免、资源结清与目标完成。

    最终答复要接受代码中的检查

    模型给出最终答复后,Core 核对该次运行的依据。 检查结果决定运行是否支持结束。 文字中的“测试通过”不能生成通过报告。 旧报告也不能自动覆盖后来的修改。

    架构图结束前必须逐项核对这是门禁的判定顺序。任一前置条件未满足,运行保留缺口。
    结束前必须逐项核对这是门禁的判定顺序。任一前置条件未满足,运行保留缺口。副作用已结清原始回执外部观察已处理当前对象子任务已观察工作区影响修改观察完整完整摘要验证或豁免匹配当前摘要允许结束最终完成状态
    1. 01先处理结果不明的操作

      副作用、外部观察和子任务分别检查。最终答复不会消除未决事项。

      harness_loop.rs L1591 ↗
    2. 02确认观察覆盖全部修改

      部分文件列表不能代表完整的修改摘要。

    3. 03再绑定验证依据

      有修改时,报告或豁免必须匹配当前摘要。无修改也要先通过前置检查。

      harness_loop.rs L1591 ↗

    下载 SVG ↗

    真实判断顺序决定哪些捷径无效

    次序检查对象未满足时的结果
    1未解决的工具效果Incomplete
    2仍阻止成功的外部观察Continue 或 Incomplete
    3未观察的工作区子任务Incomplete
    4修改观察是否完整Incomplete
    5是否存在工作区修改无修改时支持 Narrative
    6当前摘要是否有宿主豁免匹配时支持 Waived
    7当前摘要是否有通过报告匹配时支持 Verified
    8仍缺少依据Incomplete,并说明下一步

    前四项发生在无修改判断之前。 无修改的运行也必须清除前置缺口。 一个结果不明的外部操作仍可能阻止完成。

    源码漫游

    完成门禁源码漫游

    按真实判断顺序阅读。每一项都可能阻止结束。

    未解决的工具效果直接返回 Incomplete。

    缺失结果不能用最终答复填补。

    harness_loop.rs L1599-L1618 ↗
    RS
    crates/code/core/src/harness_loop.rs
    L1599-L1618 ↗
    if let Some(error) = ToolEffectUnresolved::from_ledger(ledger) {
    return CompletionGate::Incomplete {
    message: error.to_string(),
    };
    }
    let open = crate::external_observation::still_open(observations, waivers, ledger.digest());
    if crate::external_observation::blocks_success(&open) {
    let digest = open
    .iter()
    .map(|observation| observation.digest.as_str())
    .collect::<Vec<_>>()
    .join(",");
    let message = format!(
    "completion gate: external observation {digest} still requires a workspace change. A final answer does not clear it. Bind a newer observation of the same subject or a host waiver for the observation digest."
    );
    return if allow_continuation {
    CompletionGate::Continue { message }
    } else {
    CompletionGate::Incomplete { message }
    };

    开放子任务和不完整观察都会阻止结束。

    部分文件列表对应的摘要不足以代表全部修改。

    harness_loop.rs L1620-L1643 ↗
    RS
    crates/code/core/src/harness_loop.rs
    L1620-L1643 ↗
    if ledger.has_open_children() {
    let ids = ledger
    .open_children
    .iter()
    .map(|child| child.task_id.as_str())
    .collect::<Vec<_>>()
    .join(",");
    let message = format!(
    "completion gate: background workspace task {ids} has not been observed. A final answer does not observe its writes."
    );
    return CompletionGate::Incomplete { message };
    }
    if ledger.observation_incomplete() {
    return CompletionGate::Incomplete {
    message: "completion gate: workspace observation is incomplete, so this digest is not the effect. A final answer, a waiver, or a verification of a partial list does not close it.".to_string(),
    };
    }
    if ledger.is_empty() {
    return CompletionGate::Allow(CompletionTerminal::Narrative);
    }
    let digest = ledger.digest().to_string();
    if waivers.iter().any(|waiver| waiver.effect_digest == digest) {
    return CompletionGate::Allow(CompletionTerminal::Waived {
    effect_digest: digest,

    无修改返回 Narrative。有修改时核对当前摘要。

    Waived 表示接受缺口,不表示检查通过。

    harness_loop.rs L1637-L1666 ↗
    RS
    crates/code/core/src/harness_loop.rs
    L1637-L1666 ↗
    if ledger.is_empty() {
    return CompletionGate::Allow(CompletionTerminal::Narrative);
    }
    let digest = ledger.digest().to_string();
    if waivers.iter().any(|waiver| waiver.effect_digest == digest) {
    return CompletionGate::Allow(CompletionTerminal::Waived {
    effect_digest: digest,
    });
    }
    if reports
    .iter()
    .any(|report| report_binds_pass(report, &digest))
    {
    return CompletionGate::Allow(CompletionTerminal::Verified {
    effect_digest: digest,
    });
    }
    let paths = mutation_paths_for_gate(ledger);
    let next = if contracts.is_empty() {
    unbound_mutation_next_step(ledger)
    } else {
    host_contract_next_step(ledger, contracts)
    };
    let message = format!(
    "{UNBOUND_MUTATION_GATE}{digest}{paths} has no bound Passed verification and no host waiver. Assistant text does not count. Bind a verification_report.effect_digest to this digest with required checks Passed, or obtain a host waiver for this digest.{next}"
    );
    // A host waiver is not model-grantable, and editor-authored reports are
    // rejected. Built-in bash may bind a digest only when an existence check
    // matches a mutated path *and* on-disk content matches the ledger digest.
    // The optional verifier turn already ran or was skipped before this

    没有匹配报告或豁免时,门禁返回 Incomplete。

    宿主声明的检查与权限仍分别生效。

    harness_loop.rs L1654-L1677 ↗
    RS
    crates/code/core/src/harness_loop.rs
    L1654-L1677 ↗
    let paths = mutation_paths_for_gate(ledger);
    let next = if contracts.is_empty() {
    unbound_mutation_next_step(ledger)
    } else {
    host_contract_next_step(ledger, contracts)
    };
    let message = format!(
    "{UNBOUND_MUTATION_GATE}{digest}{paths} has no bound Passed verification and no host waiver. Assistant text does not count. Bind a verification_report.effect_digest to this digest with required checks Passed, or obtain a host waiver for this digest.{next}"
    );
    // A host waiver is not model-grantable, and editor-authored reports are
    // rejected. Built-in bash may bind a digest only when an existence check
    // matches a mutated path *and* on-disk content matches the ledger digest.
    // The optional verifier turn already ran or was skipped before this
    // decision. Spending the one continuation here cannot close the gate; it
    // only invites another tool call. An open external observation still
    // continues, because a workspace write can satisfy that subject.
    CompletionGate::Incomplete { message }
    }
    const UNBOUND_MUTATION_GATE: &str = "completion gate: workspace mutation ";
    fn host_contract_next_step(
    ledger: &MutationLedger,
    contracts: &[crate::verification::VerificationContractV1],

    源码与本文版本一致,保留原始行号。

    修改摘要为什么必须精确绑定

    修改账本保存该次运行观察到的工作区影响。 摘要代表当前这组影响。 验证报告需要绑定这份摘要。 模型继续修改文件后,应重新核对报告绑定。

    例如,日期函数已通过跨月测试。 模型随后又修改格式化逻辑。 旧报告证明旧状态通过检查。 新的内容需要对应的新依据。

    验证合同、报告和豁免是不同对象

    对象谁提供含义
    Verification contract宿主准入声明检查命令和覆盖范围
    Verification report受控检查路径记录本次检查及所绑定摘要
    Completion waiver宿主或用户明确接受对指定摘要接受验证缺口

    合同声明“应该运行什么”。 报告说明“本次实际检查了什么”。 豁免说明“接受哪一份尚未验证的修改”。 模型无法仅凭生成一段文本创建有效豁免。

    四个终态应怎样显示

    状态准确含义容易造成的误解
    Narrative无修改,且前置缺口已清除不是“代码通过了测试”
    Verified当前摘要有匹配的通过依据不代表所有可能缺陷都已排除
    Waived当前摘要得到明确豁免不代表验证通过
    Incomplete仍有明确缺口不等同于用户暂停

    宿主应显示具体缺口。 只显示“失败”会丢失后续处理所需的信息。

    完成判定与资源结清怎样配合

    完成门禁检查任务证据。 资源作用域管理该次运行所属的进程、工具和资源。 宿主还要等待所属资源完成收尾。 模型文本、门禁结果和资源终态分别记录。

    这一区分在取消时尤其重要。 停止生成后,工具可能仍在协作退出。 界面应保留取消中的状态,直到原资源结清。 资源设计见验证与资源寿命。

    长期目标还有额外的完成条件

    一次 Run 的 Verified 只说明该次修改的检查依据。 目标还要接受每个计划步骤。 最后一步还要覆盖目标自身的接受条件。 全部等待与全部切片也要结清。 实现:目标完成条件 L34 ↗。

    面向宿主的排查顺序

    1. 读取原始完成门禁消息。
    2. 核对未决效果与外部观察。
    3. 检查子任务的工作区影响。
    4. 核对修改观察是否完整。
    5. 对照当前修改摘要。
    6. 检查报告或豁免的绑定。
    7. 核对资源结清状态。
    8. 读取目标的当前完成条件。

    完整依据来自原始运行记录。 界面文案应忠实反映该次结果。