Skip to content

Commit b11a15e

Browse files
committed
docs: explain context feedback lifecycle
1 parent 20622b0 commit b11a15e

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

docs/reference/context-feedback.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Context Feedback
2+
3+
[中文](context-feedback.zh-CN.md) | English
4+
5+
Context feedback records whether a Context entry, companion file, retrieval result, or intervention suggestion was useful. It is a quality signal, not verification evidence.
6+
7+
## Labels
8+
9+
Supported labels are `useful`, `not-useful`, `outdated`, `inaccurate`, `incomplete`, `wrong-version`, `wrong-example`, and `irrelevant`.
10+
11+
Each record contains only `entryId`, `source`, optional version, content revision, optional relative file, target identifier, label, generated ID, and timestamp. It does not contain task text, source code, file content, absolute repository paths, credentials, or arbitrary comments.
12+
13+
## Desktop Use
14+
15+
OpenCode Desktop exposes `opencode_plusplus_context_feedback`. Call it explicitly after using Context:
16+
17+
```json
18+
{
19+
"entryId": "official/payments",
20+
"source": "official",
21+
"version": "2.0.0",
22+
"revision": 3,
23+
"target": "entry",
24+
"label": "useful"
25+
}
26+
```
27+
28+
The tool writes the local record and returns current local statistics plus network submission status. It does not call a model. The same application service is available to the development-only MCP compatibility surface.
29+
30+
## Storage
31+
32+
Feedback is stored atomically under `.agent-context/context-registry/feedback/`. The store has `schemaVersion` and `revision`; duplicate feedback IDs are idempotent, and corrupt JSON produces a diagnostic instead of an empty result.
33+
34+
Local annotations remain under `.agent-context/knowledge/annotations/`. An annotation is user-written Context that can be explicitly injected as untrusted information. Feedback is maintainer-facing quality metadata and is never injected.
35+
36+
## Network Boundary
37+
38+
Network submission is disabled unless `feedback.telemetry`, `feedback.network`, and `feedback.endpoint` are all explicitly configured. Only the same safe feedback metadata is sent. Endpoint URLs cannot contain credentials. Offline or failed submission preserves the local record.
39+
40+
## Ranking Boundary
41+
42+
Feedback statistics do not affect retrieval by default. `feedback.useLocalQualitySignals: true` enables a bounded score in the `localFeedback` score breakdown. It cannot override an exact ID and has no authority over commands, evidence, Guard gates, Policy, interventions, or finalize.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Context Feedback
2+
3+
[English](context-feedback.md) | 中文
4+
5+
Context feedback 用于评价 Context entry、附属文件、检索结果或 intervention 建议是否有用。它是质量信号,不是验证证据。
6+
7+
## 标签
8+
9+
支持 `useful``not-useful``outdated``inaccurate``incomplete``wrong-version``wrong-example``irrelevant`
10+
11+
每条记录只包含 `entryId`、source、可选版本、内容 revision、可选相对文件、目标标识、label、生成 ID 和时间戳。不包含任务原文、源码、文件正文、仓库绝对路径、凭据或任意评论。
12+
13+
## Desktop 使用
14+
15+
OpenCode Desktop 提供 `opencode_plusplus_context_feedback`,在使用 Context 后显式调用:
16+
17+
```json
18+
{
19+
"entryId": "official/payments",
20+
"source": "official",
21+
"version": "2.0.0",
22+
"revision": 3,
23+
"target": "entry",
24+
"label": "useful"
25+
}
26+
```
27+
28+
工具写入本地反馈,并返回当前本地统计和网络提交状态。它不会调用模型。开发兼容用途的 MCP 入口复用同一个 application service。
29+
30+
## 存储
31+
32+
反馈通过 atomic store 写入 `.agent-context/context-registry/feedback/`。store 包含 `schemaVersion``revision`;重复 feedback ID 幂等,损坏 JSON 返回诊断,不会被当成空结果。
33+
34+
本地 annotation 仍保存在 `.agent-context/knowledge/annotations/`。annotation 是用户编写、可显式注入但始终不可信的 Context;feedback 是面向维护者的质量元数据,永远不会注入模型上下文。
35+
36+
## 网络边界
37+
38+
只有同时显式配置 `feedback.telemetry``feedback.network``feedback.endpoint` 才会发送网络反馈。网络只发送相同的安全元数据;endpoint URL 不能包含凭据。离线或发送失败不会删除本地记录。
39+
40+
## 排序边界
41+
42+
反馈统计默认不影响检索。设置 `feedback.useLocalQualitySignals: true` 后,检索的 `localFeedback` 分项会使用有边界的轻量分数。它不能覆盖 exact ID,也没有命令、evidence、Guard、Policy、intervention 或 finalize 权限。

0 commit comments

Comments
 (0)