driftseal 2.0.0 → 2.1.0
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.md +60 -10
- package/README.zh-CN.md +53 -8
- package/bin/driftseal-mcp.js +117 -4
- package/bin/driftseal.js +1026 -199
- package/package.json +1 -1
- package/skills/use-driftseal/SKILL.md +4 -1
package/README.md
CHANGED
|
@@ -28,9 +28,12 @@ DriftSeal v2 is an outcome log rather than an intent-per-step log.
|
|
|
28
28
|
decision link to the currently open outcome.
|
|
29
29
|
- Every extension changes the contract hash and invalidates earlier verification
|
|
30
30
|
and MADR reconciliation.
|
|
31
|
-
- Stored events use `logVersion: 2
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
- Stored events use `logVersion: 2`. Compatible clients accept `schemaVersion`
|
|
32
|
+
`1` or `2`; lane events and non-default `begin.lane` use `schemaVersion: 2`.
|
|
33
|
+
- The generated `AGENTS.md` protocol series is `2.1`. `driftseal init` upgrades
|
|
34
|
+
recognized `2.0` blocks.
|
|
35
|
+
- Named lanes partition outcome history on the same WAL. The default lane is
|
|
36
|
+
`main`; `driftseal log` follows the current lane.
|
|
34
37
|
- The public CLI, Node API, MCP tools, and MCP resources use outcome terminology.
|
|
35
38
|
v1 names and storage paths are not runtime aliases.
|
|
36
39
|
|
|
@@ -121,6 +124,45 @@ The scope belongs to the worktree, not to the agent process. Agents and subagent
|
|
|
121
124
|
working in the same worktree resume its matching open outcome. Separate worktrees
|
|
122
125
|
hold separate outcomes.
|
|
123
126
|
|
|
127
|
+
## Lanes
|
|
128
|
+
|
|
129
|
+
Orthogonal long-lived capabilities can share one append-only log without sharing
|
|
130
|
+
narrative context. Each outcome belongs to one named lane. Untagged history lives
|
|
131
|
+
on `main`. `status` and `log --last 3` follow the current lane, which is local to
|
|
132
|
+
the worktree.
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
driftseal lane add index --desc "On-disk inverted index"
|
|
136
|
+
driftseal lane switch index
|
|
137
|
+
driftseal begin "Ship the inverted index" --accept "lookups return stored postings" --verify "npm test"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Close the open outcome before switching. Later work on the same capability
|
|
141
|
+
switches back and begins a new outcome on that lane; it does not reopen a closed
|
|
142
|
+
record. `driftseal lane assign <id> <name>` moves a closed outcome. Cross-cutting
|
|
143
|
+
work stays on `main`. An open outcome stays visible in `log` even when it belongs
|
|
144
|
+
to another lane; `status` prints that lane when it differs from the current one.
|
|
145
|
+
|
|
146
|
+
Lanes cannot be renamed or removed. A typo in `lane add` stays in `driftseal lane`
|
|
147
|
+
output; add the intended name and stop using the old one.
|
|
148
|
+
|
|
149
|
+
If a `begin` names a lane whose `lane_add` is missing, DriftSeal infers the lane
|
|
150
|
+
so `status`, `log`, and `lane` still work, and `lane add` can write the missing
|
|
151
|
+
event. Duplicate `lane_add` records last-write the description instead of failing
|
|
152
|
+
the fold. A `lane_assign` that names an unknown lane infers it the same way.
|
|
153
|
+
If the worktree's current-lane pointer names a lane the WAL no longer
|
|
154
|
+
has, `status`, `log`, and `lane` fall back to `main` with a warning; `begin`
|
|
155
|
+
still refuses until you `lane switch main` or add the lane. `log --last N` can
|
|
156
|
+
return more than N records when an open outcome sits on another lane.
|
|
157
|
+
|
|
158
|
+
A derived lane index caches fold state in Git metadata (or beside a custom
|
|
159
|
+
seal). Incremental rebuilds follow `indexedThrough` and `indexedLines`; a full
|
|
160
|
+
rebuild happens when the log identity changes. Per-lane heads, reverse links,
|
|
161
|
+
and WAL byte ranges are stored for a seek path that is not consumed yet. The
|
|
162
|
+
index is reconstructable and is not committed with the log. Custom-home
|
|
163
|
+
sidecars sit next to `events.jsonl`. When that directory is inside a Git
|
|
164
|
+
worktree, they are listed in its `.gitignore`.
|
|
165
|
+
|
|
124
166
|
## Decisions and MADR
|
|
125
167
|
|
|
126
168
|
Use a MADR only for context that the outcome log and Git cannot recover: a
|
|
@@ -152,8 +194,9 @@ driftseal decision update 1 --status accepted --note "Confirmed by the final imp
|
|
|
152
194
|
| `driftseal extend "<addition>" [--accept "..."] [--verify "..."] [--decision id]` | Append scope to the same outcome and invalidate earlier verification. |
|
|
153
195
|
| `driftseal verify [--allow-tracked-command]` | Execute the declared cumulative verifier and bind evidence. |
|
|
154
196
|
| `driftseal end [id] [-s status] [-n note] [-r verify-result]` | Close an outcome honestly. |
|
|
155
|
-
| `driftseal status` | Show the outcome in progress. |
|
|
156
|
-
| `driftseal log [--last N] [--all]` | Review outcome history. |
|
|
197
|
+
| `driftseal status` | Show the outcome in progress and the current lane. |
|
|
198
|
+
| `driftseal log [--last N] [--all] [--all-lanes]` | Review outcome history (current lane unless `--all-lanes`). |
|
|
199
|
+
| `driftseal lane add\|switch\|assign\|show` | Partition history by long-lived capability. |
|
|
157
200
|
| `driftseal reclaim [id ...] --reason "..." [--force]` | Hide meaningless closed records with append-only markers. |
|
|
158
201
|
| `driftseal unreclaim <id> --reason "..."` | Restore a reclaimed record. |
|
|
159
202
|
| `driftseal absorb [other-events.jsonl] [--decisions dir] [--abandon-theirs\|--abandon-ours]` | Merge another lineage and remap colliding outcome or MADR ids. |
|
|
@@ -266,24 +309,31 @@ seal.begin({
|
|
|
266
309
|
seal.extend({ extension: 'Document token expiry' });
|
|
267
310
|
```
|
|
268
311
|
|
|
269
|
-
The API also exposes `status`, `verify`, `end`, `log`, `
|
|
270
|
-
decision, init, and migration
|
|
312
|
+
The API also exposes `status`, `verify`, `end`, `log`, `lane`, `laneAdd`,
|
|
313
|
+
`laneSwitch`, `laneAssign`, `absorb`, reclaim, decision, init, and migration
|
|
314
|
+
methods.
|
|
271
315
|
|
|
272
316
|
The stdio MCP server fixes all operations to one repository root. Its v2 tools
|
|
273
317
|
include `driftseal_status`, `driftseal_begin`, `driftseal_extend`,
|
|
274
|
-
`driftseal_verify`, `driftseal_end`, outcome history and absorb tools,
|
|
275
|
-
tools, and the three migration tools. Resources are:
|
|
318
|
+
`driftseal_verify`, `driftseal_end`, outcome history, lane, and absorb tools,
|
|
319
|
+
MADR tools, and the three migration tools. Resources are:
|
|
276
320
|
|
|
277
321
|
- `driftseal://outcome/current`
|
|
278
322
|
- `driftseal://outcomes/recent`
|
|
323
|
+
- `driftseal://lanes`
|
|
279
324
|
- `driftseal://madr`
|
|
280
325
|
|
|
281
326
|
## Storage and trust boundary
|
|
282
327
|
|
|
283
328
|
- `.seal/outcomes/events.jsonl` is the append-only outcome log. Access it through
|
|
284
|
-
DriftSeal; use `reclaim`, `unreclaim`, and `absorb` instead of manual edits.
|
|
329
|
+
DriftSeal; use `reclaim`, `unreclaim`, `lane`, and `absorb` instead of manual edits.
|
|
285
330
|
- `.seal/madr/` stores numbered MADR documents.
|
|
286
331
|
- `$DRIFTSEAL_HOME` replaces the `.seal` root.
|
|
332
|
+
- The current lane and derived lane index live in Git metadata for a default
|
|
333
|
+
repository seal, or beside a custom seal (`outcomes/.current-lane` and
|
|
334
|
+
`outcomes/.lane-index.json`). When the custom seal sits inside a Git
|
|
335
|
+
worktree, those sidecars are gitignored. They are reconstructable and are not
|
|
336
|
+
part of the committed WAL.
|
|
287
337
|
- Advisory hooks remind agents about lifecycle state but never broaden the
|
|
288
338
|
repository's `AGENTS.md` policy.
|
|
289
339
|
|
package/README.zh-CN.md
CHANGED
|
@@ -23,8 +23,11 @@ DriftSeal v2 从“按步骤记录 intent”改为“按交付记录 outcome”
|
|
|
23
23
|
目录;migration 时需要显式传入旧位置,之后再 unset 或替换这个变量。
|
|
24
24
|
- `driftseal extend` 可以向当前 outcome 追加步骤、acceptance、verifier 或 decision link。
|
|
25
25
|
- 每次 extend 都会改变 contract hash,并让之前的 verification 与 MADR reconciliation 失效。
|
|
26
|
-
- event 使用 `logVersion: 2
|
|
27
|
-
|
|
26
|
+
- event 使用 `logVersion: 2`。兼容客户端接受 `schemaVersion` `1` 或 `2`;lane
|
|
27
|
+
事件以及非默认的 `begin.lane` 使用 `schemaVersion: 2`。
|
|
28
|
+
- `AGENTS.md` 的新协议版本是 `2.1`。`driftseal init` 会升级可识别的 `2.0` block。
|
|
29
|
+
- 具名 lane 在同一条 WAL 上切分 outcome 历史。默认 lane 是 `main`;`driftseal log`
|
|
30
|
+
跟随当前 lane。
|
|
28
31
|
- CLI、Node API、MCP tool 与 resource 全部使用 outcome 命名;v1 名称和路径不会作为
|
|
29
32
|
runtime alias 保留。
|
|
30
33
|
|
|
@@ -109,6 +112,40 @@ driftseal log --last 3
|
|
|
109
112
|
作用域属于 worktree,而不是某一个 agent process。同一 worktree 内的 agent 与
|
|
110
113
|
subagent 重新锚定并继续匹配的 open outcome;不同 worktree 各自持有 outcome。
|
|
111
114
|
|
|
115
|
+
## Lane
|
|
116
|
+
|
|
117
|
+
彼此正交、会长期回来接着做的能力,可以共用一条 append-only log,而不共用叙事上下文。
|
|
118
|
+
每个 outcome 只属于一条具名 lane。未打标签的历史在 `main` 上。`status` 与
|
|
119
|
+
`log --last 3` 跟随当前 lane,指针是 worktree 本地的。
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
driftseal lane add index --desc "On-disk inverted index"
|
|
123
|
+
driftseal lane switch index
|
|
124
|
+
driftseal begin "Ship the inverted index" --accept "lookups return stored postings" --verify "npm test"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
有 open outcome 时不能切 lane。以后回到同一能力,是切回去再 `begin` 新的 outcome,
|
|
128
|
+
而不是重开已关闭的记录。`driftseal lane assign <id> <name>` 可以把已关闭的 outcome
|
|
129
|
+
移过去。跨切工作留在 `main`。open outcome 即使属于别的 lane,也会出现在 `log` 里;
|
|
130
|
+
若它和当前 lane 不同,`status` 会写出它的 lane。
|
|
131
|
+
|
|
132
|
+
lane 不能改名或删除。`lane add` 打错的名字会一直出现在 `driftseal lane` 输出里;
|
|
133
|
+
补上正确名字,旧名字不要再用。
|
|
134
|
+
|
|
135
|
+
如果 `begin` 引用了 WAL 里没有 `lane_add` 的 lane,DriftSeal 会推断这条 lane,
|
|
136
|
+
让 `status` / `log` / `lane` 仍可读,也允许再用 `lane add` 补上缺失事件。重复的
|
|
137
|
+
`lane_add` 只更新 description,不会让 fold 失败;没有前置 `lane_add` 的
|
|
138
|
+
`lane_assign` 同样会推断该 lane。若 worktree 的 current-lane 指针指向 WAL 里已
|
|
139
|
+
不存在的 lane,`status` / `log` / `lane` 会警告并回落到 `main`;`begin` 仍会拒绝,
|
|
140
|
+
直到 `lane switch main` 或把该 lane 加回来。`log --last N` 在 open outcome 属于
|
|
141
|
+
别的 lane 时,返回条数可以多于 N。
|
|
142
|
+
|
|
143
|
+
派生的 lane index 缓存 fold 状态,放在 Git metadata(或自定义 seal 旁边)。
|
|
144
|
+
增量重建跟随 `indexedThrough` 和 `indexedLines`;log 身份变化时全量重建。每条
|
|
145
|
+
lane 的 head、反向链接和 WAL byte range 会写入 index,供尚未接入的 seek 路径使用。
|
|
146
|
+
它可以重建,不会随 log 一起提交。自定义 home 下的 sidecar 放在 `events.jsonl`
|
|
147
|
+
旁边;该目录在 Git worktree 内时,由目录里的 `.gitignore` 忽略。
|
|
148
|
+
|
|
112
149
|
## Decision 与 MADR
|
|
113
150
|
|
|
114
151
|
只有当 outcome log 与 Git 无法还原重要上下文时才建立 MADR,例如值得以后重访的
|
|
@@ -139,8 +176,9 @@ driftseal decision update 1 --status accepted --note "Confirmed by the final imp
|
|
|
139
176
|
| `driftseal extend "<addition>" [--accept "..."] [--verify "..."] [--decision id]` | 向同一 outcome 追加内容,并让旧 verification 失效。 |
|
|
140
177
|
| `driftseal verify [--allow-tracked-command]` | 执行累计 verifier 并绑定证据。 |
|
|
141
178
|
| `driftseal end [id] [-s status] [-n note] [-r verify-result]` | 诚实关闭 outcome。 |
|
|
142
|
-
| `driftseal status` | 查看进行中的 outcome。 |
|
|
143
|
-
| `driftseal log [--last N] [--all]` | 查看 outcome
|
|
179
|
+
| `driftseal status` | 查看进行中的 outcome 和当前 lane。 |
|
|
180
|
+
| `driftseal log [--last N] [--all] [--all-lanes]` | 查看 outcome 历史(默认当前 lane)。 |
|
|
181
|
+
| `driftseal lane add\|switch\|assign\|show` | 按长期能力切分历史。 |
|
|
144
182
|
| `driftseal reclaim [id ...] --reason "..." [--force]` | 通过 append-only marker 隐藏无意义的已关闭记录。 |
|
|
145
183
|
| `driftseal unreclaim <id> --reason "..."` | 恢复 reclaimed record。 |
|
|
146
184
|
| `driftseal absorb [other-events.jsonl] [--decisions dir] [--abandon-theirs\|--abandon-ours]` | 合并另一条 lineage 并处理撞号。 |
|
|
@@ -243,23 +281,30 @@ seal.begin({
|
|
|
243
281
|
seal.extend({ extension: 'Document token expiry' });
|
|
244
282
|
```
|
|
245
283
|
|
|
246
|
-
API 还提供 `status`、`verify`、`end`、`log`、`
|
|
247
|
-
migration 方法。
|
|
284
|
+
API 还提供 `status`、`verify`、`end`、`log`、`lane`、`laneAdd`、`laneSwitch`、
|
|
285
|
+
`laneAssign`、`absorb`、reclaim、decision、init 与 migration 方法。
|
|
248
286
|
|
|
249
287
|
stdio MCP server 会把所有操作固定在一个 repo root。v2 tools 包括
|
|
250
288
|
`driftseal_status`、`driftseal_begin`、`driftseal_extend`、`driftseal_verify`、
|
|
251
|
-
`driftseal_end`、outcome history
|
|
289
|
+
`driftseal_end`、outcome history、lane、absorb、MADR,以及三个 migration tools。
|
|
290
|
+
resources 为:
|
|
252
291
|
|
|
253
292
|
- `driftseal://outcome/current`
|
|
254
293
|
- `driftseal://outcomes/recent`
|
|
294
|
+
- `driftseal://lanes`
|
|
255
295
|
- `driftseal://madr`
|
|
256
296
|
|
|
257
297
|
## 存储与信任边界
|
|
258
298
|
|
|
259
299
|
- `.seal/outcomes/events.jsonl` 是 append-only outcome log。通过 DriftSeal 访问它;
|
|
260
|
-
|
|
300
|
+
需要调整可见性、切分 lane 或处理 merge 时使用 `reclaim`、`unreclaim`、`lane`、
|
|
301
|
+
`absorb`,不要手改。
|
|
261
302
|
- `.seal/madr/` 保存编号化 MADR。
|
|
262
303
|
- `$DRIFTSEAL_HOME` 替换整个 `.seal` root。
|
|
304
|
+
- 当前 lane 与派生 lane index 对默认 repo seal 存在 Git metadata 里,对自定义 seal
|
|
305
|
+
则放在旁边(`outcomes/.current-lane` 与 `outcomes/.lane-index.json`)。自定义
|
|
306
|
+
seal 在 Git worktree 内时,这些 sidecar 会被 gitignore。它们可以重建,不是
|
|
307
|
+
committed WAL 的一部分。
|
|
263
308
|
- advisory hook 只提示 lifecycle 状态,不会扩大 repo 中 `AGENTS.md` 的政策边界。
|
|
264
309
|
|
|
265
310
|
DriftSeal 不会替你判断 verification command 是否安全,也不会判断测试本身是否充分。
|
package/bin/driftseal-mcp.js
CHANGED
|
@@ -94,6 +94,7 @@ function registerTools(server, api, z) {
|
|
|
94
94
|
const outcomeRecord = z.object({
|
|
95
95
|
id: z.string(),
|
|
96
96
|
outcome: z.string(),
|
|
97
|
+
lane: z.string().optional(),
|
|
97
98
|
extensions: z.array(extensionRecord),
|
|
98
99
|
acceptance: z.array(z.string()),
|
|
99
100
|
verify: z.string().nullable(),
|
|
@@ -281,10 +282,14 @@ function registerTools(server, api, z) {
|
|
|
281
282
|
{
|
|
282
283
|
title: 'List DriftSeal outcome history',
|
|
283
284
|
description:
|
|
284
|
-
'Review recent or complete DriftSeal outcome history. Reclaimed records are hidden unless includeReclaimed is set.',
|
|
285
|
+
'Review recent or complete DriftSeal outcome history. Defaults to the current lane. Reclaimed records are hidden unless includeReclaimed is set.',
|
|
285
286
|
inputSchema: {
|
|
286
287
|
last: z.number().int().positive().max(100).optional(),
|
|
287
288
|
includeReclaimed: z.boolean().default(false),
|
|
289
|
+
allLanes: z
|
|
290
|
+
.boolean()
|
|
291
|
+
.default(false)
|
|
292
|
+
.describe('Show outcomes from every lane instead of the current lane.'),
|
|
288
293
|
},
|
|
289
294
|
outputSchema: {
|
|
290
295
|
root: z.string(),
|
|
@@ -295,7 +300,11 @@ function registerTools(server, api, z) {
|
|
|
295
300
|
},
|
|
296
301
|
async (input) =>
|
|
297
302
|
guarded(() => {
|
|
298
|
-
const outcomes = api.log({
|
|
303
|
+
const outcomes = api.log({
|
|
304
|
+
last: input.last,
|
|
305
|
+
all: input.includeReclaimed,
|
|
306
|
+
allLanes: input.allLanes,
|
|
307
|
+
});
|
|
299
308
|
const readOnly = api.readOnly;
|
|
300
309
|
const summary = `Found ${outcomes.length} DriftSeal outcome records.`;
|
|
301
310
|
return success(
|
|
@@ -305,6 +314,103 @@ function registerTools(server, api, z) {
|
|
|
305
314
|
})
|
|
306
315
|
);
|
|
307
316
|
|
|
317
|
+
const laneRecord = z.object({
|
|
318
|
+
name: z.string(),
|
|
319
|
+
description: z.string().nullable(),
|
|
320
|
+
addedAt: z.string().nullable(),
|
|
321
|
+
inferred: z.boolean().optional(),
|
|
322
|
+
visible: z.number().int().nonnegative(),
|
|
323
|
+
count: z.number().int().nonnegative(),
|
|
324
|
+
current: z.boolean().optional(),
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
server.registerTool(
|
|
328
|
+
'driftseal_lane',
|
|
329
|
+
{
|
|
330
|
+
title: 'Show DriftSeal lanes',
|
|
331
|
+
description:
|
|
332
|
+
'List named outcome lanes and the current lane. Re-anchoring and log history follow the current lane.',
|
|
333
|
+
inputSchema: {},
|
|
334
|
+
outputSchema: {
|
|
335
|
+
root: z.string(),
|
|
336
|
+
current: z.string(),
|
|
337
|
+
missingCurrentLane: z.string().nullable().optional(),
|
|
338
|
+
lanes: z.array(laneRecord),
|
|
339
|
+
total: z.number().int().nonnegative(),
|
|
340
|
+
readOnly: z.boolean().optional(),
|
|
341
|
+
},
|
|
342
|
+
annotations: readOnly,
|
|
343
|
+
},
|
|
344
|
+
async () =>
|
|
345
|
+
guarded(() => {
|
|
346
|
+
const snapshot = api.lane();
|
|
347
|
+
const readOnly = api.readOnly;
|
|
348
|
+
return success(
|
|
349
|
+
{ root: api.root, ...snapshot, ...(readOnly ? { readOnly: true } : {}) },
|
|
350
|
+
`Current DriftSeal lane is ${snapshot.current}.`
|
|
351
|
+
);
|
|
352
|
+
})
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
server.registerTool(
|
|
356
|
+
'driftseal_lane_add',
|
|
357
|
+
{
|
|
358
|
+
title: 'Add a DriftSeal lane',
|
|
359
|
+
description:
|
|
360
|
+
'Create a named lane for a long-lived capability. The default lane main always exists.',
|
|
361
|
+
inputSchema: {
|
|
362
|
+
name: nonEmpty.describe('Lane name: a lowercase letter, then letters, digits, or hyphens.'),
|
|
363
|
+
description: nonEmpty.optional(),
|
|
364
|
+
},
|
|
365
|
+
outputSchema: { root: z.string(), name: z.string(), description: z.string().nullable() },
|
|
366
|
+
annotations: localWrite,
|
|
367
|
+
},
|
|
368
|
+
async (input) =>
|
|
369
|
+
guarded(() => {
|
|
370
|
+
const lane = api.laneAdd({ name: input.name, description: input.description });
|
|
371
|
+
return success({ root: api.root, ...lane }, `Added DriftSeal lane ${lane.name}.`);
|
|
372
|
+
})
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
server.registerTool(
|
|
376
|
+
'driftseal_lane_switch',
|
|
377
|
+
{
|
|
378
|
+
title: 'Switch the current DriftSeal lane',
|
|
379
|
+
description:
|
|
380
|
+
'Move this worktree onto an existing lane. Refused while an outcome is open.',
|
|
381
|
+
inputSchema: { name: nonEmpty },
|
|
382
|
+
outputSchema: { root: z.string(), current: z.string() },
|
|
383
|
+
annotations: localWrite,
|
|
384
|
+
},
|
|
385
|
+
async (input) =>
|
|
386
|
+
guarded(() => {
|
|
387
|
+
const result = api.laneSwitch({ name: input.name });
|
|
388
|
+
return success({ root: api.root, ...result }, `Switched to DriftSeal lane ${result.current}.`);
|
|
389
|
+
})
|
|
390
|
+
);
|
|
391
|
+
|
|
392
|
+
server.registerTool(
|
|
393
|
+
'driftseal_lane_assign',
|
|
394
|
+
{
|
|
395
|
+
title: 'Assign a closed outcome to a lane',
|
|
396
|
+
description: 'Move a closed outcome onto an existing lane with an append-only assign event.',
|
|
397
|
+
inputSchema: {
|
|
398
|
+
id: nonEmpty.describe('Closed outcome id.'),
|
|
399
|
+
lane: nonEmpty,
|
|
400
|
+
},
|
|
401
|
+
outputSchema: { root: z.string(), outcome: outcomeRecord },
|
|
402
|
+
annotations: localWrite,
|
|
403
|
+
},
|
|
404
|
+
async (input) =>
|
|
405
|
+
guarded(() => {
|
|
406
|
+
const outcome = api.laneAssign({ id: input.id, lane: input.lane });
|
|
407
|
+
return success(
|
|
408
|
+
{ root: api.root, outcome },
|
|
409
|
+
`Assigned outcome ${outcome.id} to lane ${outcome.lane}.`
|
|
410
|
+
);
|
|
411
|
+
})
|
|
412
|
+
);
|
|
413
|
+
|
|
308
414
|
server.registerTool(
|
|
309
415
|
'driftseal_absorb',
|
|
310
416
|
{
|
|
@@ -568,9 +674,16 @@ function registerResources(server, api) {
|
|
|
568
674
|
'recent-outcomes',
|
|
569
675
|
'driftseal://outcomes/recent',
|
|
570
676
|
'Recent DriftSeal outcomes',
|
|
571
|
-
'The ten most recent outcome records
|
|
677
|
+
'The ten most recent outcome records on the current lane.',
|
|
572
678
|
() => ({ root: api.root, outcomes: api.log({ last: 10 }) })
|
|
573
679
|
);
|
|
680
|
+
registerJson(
|
|
681
|
+
'outcome-lanes',
|
|
682
|
+
'driftseal://lanes',
|
|
683
|
+
'DriftSeal outcome lanes',
|
|
684
|
+
'Named lanes that partition outcome history, including the current lane.',
|
|
685
|
+
() => ({ root: api.root, ...api.lane() })
|
|
686
|
+
);
|
|
574
687
|
registerJson(
|
|
575
688
|
'decision-catalog',
|
|
576
689
|
'driftseal://madr',
|
|
@@ -592,7 +705,7 @@ async function createServer({ root }) {
|
|
|
592
705
|
{ name: SERVER_NAME, version: SERVER_VERSION },
|
|
593
706
|
{
|
|
594
707
|
instructions:
|
|
595
|
-
'Use driftseal_status before durable project changes or after context loss. Open one coherent outcome with driftseal_begin and append same-outcome steps with driftseal_extend. Reconcile linked decisions after the final extension, inspect the cumulative verifier, use driftseal_verify for fresh contract-bound evidence, and close honestly with driftseal_end.',
|
|
708
|
+
'Use driftseal_status before durable project changes or after context loss. Open one coherent outcome with driftseal_begin and append same-outcome steps with driftseal_extend. Reconcile linked decisions after the final extension, inspect the cumulative verifier, use driftseal_verify for fresh contract-bound evidence, and close honestly with driftseal_end. Named lanes isolate orthogonal capability history; driftseal_log follows the current lane.',
|
|
596
709
|
}
|
|
597
710
|
);
|
|
598
711
|
registerTools(server, api, z);
|