---
title: "观察接口的边界"
---

> Documentation Index
> Fetch the complete documentation index at: https://koine.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# 观察接口的边界

## 背景

观察接口可以围绕存储格式设计，也可以围绕查询设计。`view` 可以属于描述层或执行层；`find` 和 `explore` 可以合并成一个查询，也可以分开。

## 选项

- 先定编码，再定接口。
- 先定接口，再定编码。
- 把 view 当执行策略。
- 把 find 和 explore 合并。

## 决定

先定义世界、transition、路径、差异、view，再定具体存储格式。view 进描述层，只做关系子集。find 与 explore 分开：find 属于描述层，explore 属于驱动层。

## 理由

- “客户看到什么、财务看到什么”是业务结构，不是执行策略。
- 接口只回答“有什么”，存储可以增量，接口必须给完整世界。
- find 是“是否存在”，explore 是“实际能走到哪些”，失败模式和成本不同。

## 后果

观察接口稳定，存储实现可以换。view 不做行级过滤、计算或重命名。find 和 explore 各自有独立的查询边界。

Source: https://koine.systems/notes/decisions/0013-observation-boundaries/index.mdx
