Skip to content

设计:confidence 计数需要事件证据模型,避免自证 #9

Description

@TbusOS

背景

SPEC §4.8 定义了 confidence block:validated_countcontradicted_countlast_validatedusage_count。SPEC §11.4 进一步规定 LLM invocation、human review、Consistency Engine 都可能更新 confidence。

问题

当前 contract 容易让 confidence 变成“计数结果”,但缺少足够的证据模型。尤其是:

  • LLM/adapter 可根据任务成功上报 validated_count++,但任务成功不一定由该 asset 贡献。
  • asset 被频繁加载会提高 usage,但不代表内容正确。
  • 同一个 task 可能加载多个 asset,成功或失败如何归因不清楚。
  • Consistency Engine 可在 dismiss false positive 后更新 confidence,这需要更强的审计记录。

长期看,错误或宽泛的 memory 可能因频繁加载和模糊成功信号获得较高 confidence。

建议

把 frontmatter 里的 confidence 视为派生缓存,真实证据写入 append-only usage.jsonl。每条事件至少包含:

{
  "asset_id": "...",
  "task_hash": "...",
  "event_type": "loaded|validated|contradicted",
  "actor_type": "human|llm|workflow|consistency_engine",
  "evidence_kind": "explicit_user_confirmation|explicit_user_correction|workflow_fixture_pass|task_success_heuristic|false_positive_dismissed",
  "trust_weight": 1.0,
  "timestamp": "..."
}

然后由 batch pipeline 计算 frontmatter 中的缓存值。建议权重:

  • 用户明确纠错:高权重 negative。
  • 用户明确确认:高权重 positive。
  • workflow fixture pass:中高权重 positive。
  • LLM 自报 task success:低权重 positive。
  • 单纯 loaded:只增加 exposure,不增加 correctness。

需要补充的 SPEC 点

  • confidence 是否是 authoritative,还是 derived cache。建议明确为 derived。
  • validated_count 是否允许小数权重,还是保留整数并另存 weighted score。
  • 多 asset 同时参与一次 task 时,如何记录归因。
  • confidence_score 下降是否影响 Relevance Gate 排序,影响到什么程度。

参考

  • SPEC.md §4.8:Confidence Field Schema。
  • SPEC.md §11.4:Confidence and Evidence。
  • TASKS.md T-98:Usage outcome journal 到 confidence update pipeline 仍待实现,适合在实现前收紧 contract。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions