kiokuko 1.0.43 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +21 -159
- package/README.ko.md +21 -125
- package/README.md +21 -196
- package/README.zh-CN.md +21 -126
- package/dist/assurance/contracts.d.ts +1 -1
- package/dist/assurance/doctor.d.ts +1 -1
- package/dist/assurance/inspect.d.ts +1 -1
- package/dist/assurance/service.d.ts +1 -1
- package/dist/assurance/verification-contracts.d.ts +1 -1
- package/dist/assurance/verification.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +43 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/code-version.d.ts +6 -0
- package/dist/commands/code-version.d.ts.map +1 -0
- package/dist/commands/code-version.js +66 -0
- package/dist/commands/code-version.js.map +1 -0
- package/dist/commands/doctor.d.ts +12 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +75 -30
- package/dist/commands/doctor.js.map +1 -1
- package/dist/ledger/checkpoint-contract.d.ts +8 -8
- package/dist/mcp/chatgpt-contract.d.ts +1 -1
- package/dist/mcp/request-deadline.d.ts +1 -1
- package/dist/mcp/request-deadline.d.ts.map +1 -1
- package/dist/mcp/request-deadline.js +1 -0
- package/dist/mcp/request-deadline.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +42 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/memory/applicability-context.d.ts +24 -0
- package/dist/memory/applicability-context.d.ts.map +1 -0
- package/dist/memory/applicability-context.js +129 -0
- package/dist/memory/applicability-context.js.map +1 -0
- package/dist/memory/checkpoint-contract.d.ts +42 -12
- package/dist/memory/checkpoint-contract.d.ts.map +1 -1
- package/dist/memory/checkpoint-contract.js +5 -0
- package/dist/memory/checkpoint-contract.js.map +1 -1
- package/dist/memory/code-versions.d.ts +79 -0
- package/dist/memory/code-versions.d.ts.map +1 -0
- package/dist/memory/code-versions.js +159 -0
- package/dist/memory/code-versions.js.map +1 -0
- package/dist/memory/entry-history.d.ts +29 -0
- package/dist/memory/entry-history.d.ts.map +1 -0
- package/dist/memory/entry-history.js +66 -0
- package/dist/memory/entry-history.js.map +1 -0
- package/dist/memory/federated-retrieval.d.ts.map +1 -1
- package/dist/memory/federated-retrieval.js +14 -1
- package/dist/memory/federated-retrieval.js.map +1 -1
- package/dist/memory/handoff.d.ts +1 -1
- package/dist/memory/history-delivery.d.ts +57 -0
- package/dist/memory/history-delivery.d.ts.map +1 -0
- package/dist/memory/history-delivery.js +85 -0
- package/dist/memory/history-delivery.js.map +1 -0
- package/dist/memory/hybrid-retrieval.d.ts +5 -0
- package/dist/memory/hybrid-retrieval.d.ts.map +1 -1
- package/dist/memory/hybrid-retrieval.js +28 -9
- package/dist/memory/hybrid-retrieval.js.map +1 -1
- package/dist/memory/interaction-contract.d.ts +22 -12
- package/dist/memory/interaction-contract.d.ts.map +1 -1
- package/dist/memory/lesson-derivation.d.ts +1 -1
- package/dist/memory/lifecycle.d.ts.map +1 -1
- package/dist/memory/lifecycle.js +18 -1
- package/dist/memory/lifecycle.js.map +1 -1
- package/dist/memory/observation-contract.d.ts +4 -4
- package/dist/memory/retrieval.d.ts +11 -0
- package/dist/memory/retrieval.d.ts.map +1 -1
- package/dist/memory/retrieval.js +11 -6
- package/dist/memory/retrieval.js.map +1 -1
- package/dist/memory/structured-memory.d.ts +5 -0
- package/dist/memory/structured-memory.d.ts.map +1 -1
- package/dist/memory/structured-memory.js +28 -6
- package/dist/memory/structured-memory.js.map +1 -1
- package/docs/README.ja.md +2 -0
- package/docs/README.md +2 -0
- package/docs/cli-contract.md +24 -5
- package/docs/context-delivery.md +7 -0
- package/docs/getting-started.ja.md +8 -5
- package/docs/getting-started.md +11 -8
- package/docs/history-evidence.md +139 -0
- package/docs/setup-notes.ja.md +122 -0
- package/docs/setup-notes.ko.md +107 -0
- package/docs/setup-notes.md +133 -0
- package/docs/setup-notes.zh-CN.md +107 -0
- package/migrations/014_code_version_evidence.sql +26 -0
- package/package.json +1 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Setup and troubleshooting
|
|
2
|
+
|
|
3
|
+
<a id="setup-messages"></a>
|
|
4
|
+
|
|
5
|
+
### npm notices and setup errors
|
|
6
|
+
|
|
7
|
+
`install scripts not yet covered by allowScripts` means npm has no recorded
|
|
8
|
+
approval for those dependency scripts. `esbuild` is a build tool; `fsevents`
|
|
9
|
+
supports macOS file watching. The notice alone does not mean setup failed.
|
|
10
|
+
|
|
11
|
+
Run this in the package directory that produced the notice:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install-scripts ls
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
If it lists `esbuild` and `fsevents`, and you have reviewed and want to allow their
|
|
18
|
+
scripts, record approval with:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install-scripts approve esbuild fsevents
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Approval updates that directory's `package.json`. For a global macOS Kiokuko
|
|
25
|
+
install, use the installed Kiokuko directory shown in the error; running these
|
|
26
|
+
commands in another project reviews and changes that project's policy.
|
|
27
|
+
See [npm's script approval guide](https://docs.npmjs.com/cli/v11/commands/npm-install-scripts/).
|
|
28
|
+
|
|
29
|
+
If setup ends with `Local semantic retrieval dependencies remain unavailable`
|
|
30
|
+
and `Cannot find package ... @huggingface/hub/index.js`, the embedding runtime
|
|
31
|
+
could not load and semantic setup is incomplete. Script approval is not a
|
|
32
|
+
confirmed fix for this import error. Report the full error and the output of
|
|
33
|
+
`kiokuko --version`, `node --version`, and `npm --version` when requesting help.
|
|
34
|
+
|
|
35
|
+
### Saved runtime for Codex
|
|
36
|
+
|
|
37
|
+
To keep Codex MCP and lifecycle hooks on one version while npm replaces its installation, prepare a separate runtime in a private application-data directory. Finish current work and stop Codex before changing its configuration:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
kiokuko runtime-prepare --runtime-root "$HOME/Library/Application Support/Kiokuko/runtimes" --json
|
|
41
|
+
kiokuko setup --clients codex --no-embeddings --no-standard-skills --runtime-manifest /absolute/path/to/runtime/manifest.json --client-stopped
|
|
42
|
+
kiokuko runtime-diagnose --manifest /absolute/path/to/runtime/manifest.json --json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
On Linux, use `${XDG_DATA_HOME:-$HOME/.local/share}/kiokuko/runtimes` as the runtime root. Replace the manifest example with the `manifestPath` printed by the first command. If the current Node executable depends on libraries outside its own binary, preparation fails; supply a standalone Node binary with `--node /absolute/path/to/node`. Preparation never changes client settings. The setup command verifies the saved files, updates the managed MCP and all lifecycle hooks together, and restores previous configuration files if the update fails. Restart Codex only when the diagnostic reports `readyForRestart: true`. Existing custom MCP commands are preserved and require separate migration.
|
|
46
|
+
|
|
47
|
+
An npm update alone does not switch the saved version. To upgrade, stop Codex after current work, prepare the new version, run the setup command with its new manifest, then restart. Keep the old saved directory for recovery; old versions are not deleted automatically. If the new version migrated the memory database, check database compatibility before returning to an older version. Allow several hundred megabytes per saved version, depending on Node and installed optional dependencies; check the actual directory size before keeping multiple versions.
|
|
48
|
+
|
|
49
|
+
### Repository instruction files
|
|
50
|
+
|
|
51
|
+
`kiokuko use` keeps a short, stable pointer in the repository's `AGENTS.md`
|
|
52
|
+
(or the configured agent file). Generated instructions live in `.kiokuko/AGENTS.md`.
|
|
53
|
+
Template and repository identity updates refresh that generated file; older
|
|
54
|
+
versioned blocks migrate to the pointer on the next use/setup refresh. Keep custom
|
|
55
|
+
instructions outside Kiokuko's managed markers; user text and other products'
|
|
56
|
+
sections are preserved.
|
|
57
|
+
|
|
58
|
+
Routine setup skips a missing root instruction file. Ordinary `kiokuko doctor`
|
|
59
|
+
automatically creates missing registered root/generated instruction files, in both
|
|
60
|
+
TTY and non-TTY use, without a confirmation prompt or an extra repair flag.
|
|
61
|
+
Recovery requires a matching registered repository ID, workspace, binding and
|
|
62
|
+
canonical path. It creates only absent files, preserves existing custom content,
|
|
63
|
+
and cannot restore deleted custom instructions. Permission failures, unsafe
|
|
64
|
+
symlinks and concurrent changes are reported for each target while other targets
|
|
65
|
+
continue. Missing/conflicting bindings are diagnosed rather than guessed.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
kiokuko doctor
|
|
69
|
+
kiokuko doctor --json
|
|
70
|
+
kiokuko doctor --fix --repair-root /absolute/path/to/project
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`kiokuko doctor --json` diagnoses without creating missing instructions. `--fix`
|
|
74
|
+
is the explicit registered-binding repair mode; `--repair-root` requires `--fix`.
|
|
75
|
+
Combining `--fix` with `--json` still permits that binding repair. Existing section
|
|
76
|
+
updates remain a separate interactive confirmation; non-TTY use does not approve
|
|
77
|
+
them. Missing generated instructions can also be restored by use/setup. Uninstall
|
|
78
|
+
removes only Kiokuko's managed regions from both files. See
|
|
79
|
+
[the CLI contract](cli-contract.md) for repair details.
|
|
80
|
+
|
|
81
|
+
## Uninstall
|
|
82
|
+
|
|
83
|
+
Stop clients using Kiokuko and any `kiokuko serve` process first.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
kiokuko uninstall --dry-run
|
|
87
|
+
kiokuko uninstall
|
|
88
|
+
# After selecting all agents and completing cleanup, run the printed command:
|
|
89
|
+
npm uninstall --global kiokuko
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Use Up/Down to move, Space to toggle, Enter to submit, and Esc to cancel. All choices start unchecked.
|
|
93
|
+
Only selected agents' managed settings and Skills are removed. **Selecting all four also deletes shared memory, embedding models, and managed project bindings**, then prints the npm removal command. Partial selection retains shared data and the npm package. User content is preserved.
|
|
94
|
+
For scripts, use `kiokuko uninstall --clients opencode,claude` or `kiokuko uninstall --all` for complete cleanup.
|
|
95
|
+
Use the same environment overrides as setup for custom locations. See [cleanup scope and failures](cli-contract.md#uninstall).
|
|
96
|
+
|
|
97
|
+
<a id="chatgpt"></a>
|
|
98
|
+
|
|
99
|
+
## Use with ChatGPT (preview)
|
|
100
|
+
|
|
101
|
+
Connect a personal plugin in Developer mode to save and recall memory. No store-distributed plugin is available.
|
|
102
|
+
|
|
103
|
+
1. **Prepare Kiokuko.** Use a version whose `kiokuko mcp --help` lists `--profile` and `--access`; otherwise [install from source](chatgpt.md). Run `kiokuko init` if you do not have a database.
|
|
104
|
+
2. **Install the Tunnel client.** On macOS, use the [official Homebrew instructions](https://github.com/openai/tunnel-client#install-with-homebrew):
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
brew install openai/tools/tunnel-client
|
|
108
|
+
tunnel-client --version
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
For other operating systems, see the [official releases](https://github.com/openai/tunnel-client/releases/latest). In [Tunnel settings](https://platform.openai.com/settings/organization/tunnels), obtain a Tunnel ID associated with your ChatGPT workspace and a [runtime API key](https://platform.openai.com/settings/organization/api-keys) with Tunnels Read + Use permission.
|
|
112
|
+
|
|
113
|
+
3. **Start the connection on your computer.** Replace `<tunnel_id>` and `<runtime_api_key>` with your values.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
export CONTROL_PLANE_API_KEY="<runtime_api_key>"
|
|
117
|
+
tunnel-client init \
|
|
118
|
+
--sample sample_mcp_stdio_local \
|
|
119
|
+
--profile kiokuko-chatgpt \
|
|
120
|
+
--tunnel-id "<tunnel_id>" \
|
|
121
|
+
--mcp-command "kiokuko mcp --profile chatgpt-memory --access read-write"
|
|
122
|
+
tunnel-client doctor --profile kiokuko-chatgpt --explain
|
|
123
|
+
kiokuko chatgpt run --profile kiokuko-chatgpt
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Keep it running while using the connection. In a new terminal, set the API key again and execute the final `run` command.
|
|
127
|
+
|
|
128
|
+
4. **Register in ChatGPT.** Enable **Settings → Security and login → Developer mode**. Under **Plugins → +**, name it `Kiokuko`, describe it as “Save and recall memory”, and choose **Connection → Tunnel** with the same ID. Select Kiokuko from the tools menu in a new conversation. [Official UI instructions](https://developers.openai.com/plugins/deploy/connect-chatgpt)
|
|
129
|
+
|
|
130
|
+
Try: “Save this information in Kiokuko” or “Search Kiokuko for memories about [topic].” Review and approve write requests when prompted.
|
|
131
|
+
|
|
132
|
+
For search only, change `read-write` to `read` in the launch command. This does not change ChatGPT's built-in memory storage. **Live ChatGPT connection testing is pending.** [Troubleshooting](chatgpt.md)
|
|
133
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# 设置与故障排查
|
|
2
|
+
|
|
3
|
+
<a id="setup-messages"></a>
|
|
4
|
+
|
|
5
|
+
### npm 提示与设置错误
|
|
6
|
+
|
|
7
|
+
`install scripts not yet covered by allowScripts` 表示 npm 尚未记录这些依赖脚本的执行许可。
|
|
8
|
+
`esbuild` 是构建工具,`fsevents` 用于 macOS 文件监控。仅出现此提示不代表设置失败。
|
|
9
|
+
|
|
10
|
+
在产生提示的包目录中运行:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install-scripts ls
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
如果列出了 `esbuild` 和 `fsevents`,并且你已检查脚本、决定允许执行,可运行:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install-scripts approve esbuild fsevents
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
许可会写入该目录的 `package.json`。在 macOS 上全局安装 Kiokuko 时,请在错误信息显示的 Kiokuko 安装目录中操作;
|
|
23
|
+
在其他项目中运行这些命令,查看和修改的是那个项目的许可设置。
|
|
24
|
+
详情请参阅 [npm 脚本许可指南](https://docs.npmjs.com/cli/v11/commands/npm-install-scripts/)。
|
|
25
|
+
|
|
26
|
+
如果设置最终报出 `Local semantic retrieval dependencies remain unavailable` 和 `Cannot find package ... @huggingface/hub/index.js`,
|
|
27
|
+
说明嵌入运行时无法加载,semantic 检索尚未配置完成。尚未确认批准脚本能解决此导入错误。
|
|
28
|
+
寻求帮助时,请附上完整错误信息以及 `kiokuko --version`、`node --version`、`npm --version` 的输出。
|
|
29
|
+
|
|
30
|
+
### 仓库指令文件
|
|
31
|
+
|
|
32
|
+
`kiokuko use`在仓库的`AGENTS.md`(或配置的指令文件)中保留简短、稳定的引用,
|
|
33
|
+
生成的指令存放在`.kiokuko/AGENTS.md`。模板及仓库身份更新会刷新生成文件;
|
|
34
|
+
旧的带版本管理块会在下次use/setup更新时迁移为引用。请将自定义指令放在Kiokuko管理标记之外;
|
|
35
|
+
用户文本和其他产品的内容会保留。
|
|
36
|
+
|
|
37
|
+
常规setup会跳过缺失的根指令文件。普通`kiokuko doctor`在交互式和非TTY运行中,
|
|
38
|
+
都会自动创建已注册仓库缺失的根指令及生成指令文件,无需确认或额外修复标志。
|
|
39
|
+
前提是注册仓库ID、workspace、binding及规范路径一致。恢复只创建缺失文件,保留已有自定义内容,
|
|
40
|
+
无法恢复已删除的自定义指令。权限不足、不安全的符号链接和并发修改会按目标报告,
|
|
41
|
+
并继续处理其他目标。缺失或冲突的binding仅被诊断,不会凭猜测替换。
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
kiokuko doctor
|
|
45
|
+
kiokuko doctor --json
|
|
46
|
+
kiokuko doctor --fix --repair-root /absolute/path/to/project
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`kiokuko doctor --json`只诊断,不创建缺失指令。`--fix`是显式修复已注册binding的模式;
|
|
50
|
+
`--repair-root`必须配合`--fix`使用。`--fix --json`仍会执行binding修复。
|
|
51
|
+
更新现有管理部分仍需单独的交互确认,非TTY运行不视为批准。
|
|
52
|
+
缺失的生成指令也可通过use/setup恢复。卸载只移除两个文件中的Kiokuko管理部分。
|
|
53
|
+
详见[CLI契约(英文)](cli-contract.md)。
|
|
54
|
+
|
|
55
|
+
## 卸载
|
|
56
|
+
|
|
57
|
+
先退出使用 Kiokuko 的客户端和 `kiokuko serve`。
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
kiokuko uninstall --dry-run
|
|
61
|
+
kiokuko uninstall
|
|
62
|
+
# 选中全部代理并完成清理后,执行最后显示的命令:
|
|
63
|
+
npm uninstall --global kiokuko
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
↑↓ 移动,Space 切换选择,Enter 确认,Esc 取消。默认全部未选中。
|
|
67
|
+
仅删除所选代理的受管理配置和 Skill。**选中全部四个代理时,还会删除共享记忆数据库、嵌入模型和项目绑定**,最后显示 npm 卸载命令。部分选择会保留共享数据和 npm 包。用户内容保持不变。
|
|
68
|
+
脚本中使用 `kiokuko uninstall --clients opencode,claude`,完全清理使用 `kiokuko uninstall --all`。自定义路径需要使用与 setup 相同的环境变量。
|
|
69
|
+
详见[清理范围](cli-contract.md#uninstall)。
|
|
70
|
+
|
|
71
|
+
<a id="chatgpt"></a>
|
|
72
|
+
|
|
73
|
+
## 在 ChatGPT 中使用(预览)
|
|
74
|
+
|
|
75
|
+
通过 Developer mode 添加个人插件连接,保存和搜索记忆。目前没有商店分发版。
|
|
76
|
+
|
|
77
|
+
1. **准备 Kiokuko。** 使用 `kiokuko mcp --help` 中包含 `--profile` 和 `--access` 的版本;否则[从源码安装](chatgpt.md)。尚无数据库时运行 `kiokuko init`。
|
|
78
|
+
2. **安装 Tunnel 客户端。** macOS 使用[官方 Homebrew 安装方式](https://github.com/openai/tunnel-client#install-with-homebrew):
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
brew install openai/tools/tunnel-client
|
|
82
|
+
tunnel-client --version
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
其他系统参见[官方发布页](https://github.com/openai/tunnel-client/releases/latest)。在 [Tunnel 设置](https://platform.openai.com/settings/organization/tunnels)中准备关联到 ChatGPT workspace 的 Tunnel ID,以及具有 Tunnels Read + Use 权限的[运行用 API 密钥](https://platform.openai.com/settings/organization/api-keys)。
|
|
86
|
+
|
|
87
|
+
3. **在电脑上启动连接。** 将 `<tunnel_id>` 和 `<runtime_api_key>` 替换为取得的值。
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
export CONTROL_PLANE_API_KEY="<runtime_api_key>"
|
|
91
|
+
tunnel-client init \
|
|
92
|
+
--sample sample_mcp_stdio_local \
|
|
93
|
+
--profile kiokuko-chatgpt \
|
|
94
|
+
--tunnel-id "<tunnel_id>" \
|
|
95
|
+
--mcp-command "kiokuko mcp --profile chatgpt-memory --access read-write"
|
|
96
|
+
tunnel-client doctor --profile kiokuko-chatgpt --explain
|
|
97
|
+
kiokuko chatgpt run --profile kiokuko-chatgpt
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
使用期间保持运行。在新终端中,先重新设置 API 密钥,再执行最后一行 `run` 命令。
|
|
101
|
+
|
|
102
|
+
4. **在 ChatGPT 中添加。** 开启 **Settings → Security and login → Developer mode**。在 **Plugins → +** 中填写名称 `Kiokuko`、说明“保存和搜索记忆”,再通过 **Connection → Tunnel** 指定同一个 ID。在新对话的工具菜单中选择 Kiokuko。[官方界面步骤](https://developers.openai.com/plugins/deploy/connect-chatgpt)
|
|
103
|
+
|
|
104
|
+
使用示例:“把这些内容保存到 Kiokuko”或“在 Kiokuko 中查找关于[主题]的记忆”。出现写入确认时,检查内容后批准。
|
|
105
|
+
|
|
106
|
+
只需搜索时,将启动命令中的 `read-write` 改为 `read`。这不会更改 ChatGPT 内置记忆的保存位置。**尚未在 ChatGPT 中实测连接。** [故障排查](chatgpt.md)
|
|
107
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
-- Raw code evidence is operational history, never an approved memory or execution permission.
|
|
2
|
+
CREATE TABLE code_version_evidence (
|
|
3
|
+
version_id TEXT PRIMARY KEY,
|
|
4
|
+
evidence_id TEXT NOT NULL UNIQUE REFERENCES ledger_evidence(evidence_id) ON DELETE CASCADE,
|
|
5
|
+
run_id TEXT NOT NULL REFERENCES ledger_runs(run_id) ON DELETE CASCADE,
|
|
6
|
+
entry_id TEXT REFERENCES entries(id) ON DELETE CASCADE,
|
|
7
|
+
workspace TEXT NOT NULL,
|
|
8
|
+
repository_id TEXT NOT NULL REFERENCES repositories(repository_id) ON DELETE CASCADE,
|
|
9
|
+
owner_id TEXT NOT NULL,
|
|
10
|
+
branch TEXT,
|
|
11
|
+
parent_version_id TEXT,
|
|
12
|
+
path TEXT NOT NULL,
|
|
13
|
+
reported_outcome TEXT NOT NULL CHECK(reported_outcome IN ('accepted','rejected','failed','unknown')),
|
|
14
|
+
reason TEXT NOT NULL,
|
|
15
|
+
environment_json TEXT NOT NULL CHECK(json_valid(environment_json)),
|
|
16
|
+
required_environment_json TEXT CHECK(required_environment_json IS NULL OR json_valid(required_environment_json)),
|
|
17
|
+
diff_text TEXT NOT NULL,
|
|
18
|
+
diff_digest TEXT NOT NULL CHECK(length(diff_digest)=64),
|
|
19
|
+
binding_digest TEXT NOT NULL CHECK(length(binding_digest)=64),
|
|
20
|
+
created_at TEXT NOT NULL
|
|
21
|
+
) STRICT;
|
|
22
|
+
CREATE INDEX code_version_recall ON code_version_evidence(owner_id,repository_id,workspace,branch,entry_id,created_at DESC,version_id ASC);
|
|
23
|
+
CREATE TRIGGER code_version_immutable BEFORE UPDATE ON code_version_evidence
|
|
24
|
+
BEGIN SELECT RAISE(ABORT,'Code version evidence is immutable'); END;
|
|
25
|
+
|
|
26
|
+
CREATE INDEX entry_supersession_history ON entries(workspace,superseded_by,id) WHERE status='superseded';
|