@zq-silk/yui 1.1.2 → 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/ARCHITECTURE.md +2 -1
- package/ARCHITECTURE.zh-CN.md +2 -1
- package/README.md +2 -0
- package/dist/cli/commandCatalog.js +344 -324
- package/dist/cli/commandDiscovery.js +69 -0
- package/dist/cli/completion.js +22 -227
- package/dist/cli/dynamicCompletion.js +12 -6
- package/dist/cli/invocationAuthority.js +2 -2
- package/dist/cli/invocationRouter.js +18 -7
- package/dist/cli/managedDiagnostics.js +2 -1
- package/dist/cli/updatePorts.js +0 -5
- package/dist/cli.js +184 -130
- package/dist/commands/capabilityCommands.js +5 -5
- package/dist/commands/controllerCommands.js +2 -1
- package/dist/commands/globalRoleCommands.js +86 -44
- package/dist/commands/grantCommands.js +48 -8
- package/dist/commands/taskCommands.js +157 -196
- package/dist/commands/taskContextCommand.js +29 -6
- package/dist/commands/taskFactCommands.js +10 -69
- package/dist/commands/taskInputCommands.js +26 -35
- package/dist/commands/taskPublicationCommands.js +2 -35
- package/dist/commands/taskPublicationVerifyCommand.js +1 -2
- package/dist/commands/taskUpstreamCommands.js +2 -1
- package/dist/context/runContextPack.js +8 -29
- package/dist/context/sessionBootstrapManifest.js +5 -101
- package/dist/context/taskContext.js +104 -41
- package/dist/controller/clientRuntime.js +16 -8
- package/dist/controller/fileSchedulerStoreAdapter.js +24 -0
- package/dist/controller/runtime.js +6 -0
- package/dist/core/controllerClient.js +46 -21
- package/dist/core/protocol.js +12 -7
- package/dist/doctor/doctor.js +4 -3
- package/dist/errors/cliError.js +4 -4
- package/dist/errors/cliFailure.js +213 -0
- package/dist/executor/fileRoleLaunchPlanner.js +1 -4
- package/dist/grant/capabilityGrant.js +13 -0
- package/dist/grant/taskAuthorization.js +127 -0
- package/dist/kernel/accessAssessment.js +1 -0
- package/dist/kernel/builtinCapabilities.js +88 -9
- package/dist/kernel/capabilityRegistry.js +64 -19
- package/dist/kernel/kernelPorts.js +2 -2
- package/dist/nativeAgent/agent.js +173 -0
- package/dist/nativeAgent/contracts.js +1 -0
- package/dist/nativeAgent/demo.js +29 -0
- package/dist/nativeAgent/index.js +3 -0
- package/dist/nativeAgent/mockProvider.js +43 -0
- package/dist/nativeAgent/textTools.js +156 -0
- package/dist/nativeAgent/validation.js +95 -0
- package/dist/output/boundedRead.js +118 -0
- package/dist/plugins/pluginService.js +98 -8
- package/dist/release/releaseWorkflowEngine.js +8 -1
- package/dist/resources/projectResourceService.js +23 -1
- package/dist/runtime/managedCaller.js +2 -2
- package/dist/runtime/managedIdentity.js +6 -0
- package/dist/runtime/runtimeCoherence.js +10 -8
- package/dist/storage/sqliteSchema.js +10 -0
- package/dist/storage/storageVersions.js +1 -1
- package/dist/storage/taskStore.js +3 -0
- package/dist/surface/surfaceContributions.js +3 -0
- package/dist/task/leaderArchive.js +111 -0
- package/dist/task/leaderArchiveAuthority.js +24 -0
- package/dist/task/taskAuthority.js +5 -10
- package/dist/tmux/commandExecutor.js +7 -5
- package/dist/web/assets/assetManifest.js +38 -22
- package/dist/web/assets/client/api.js +115 -0
- package/dist/web/assets/client/app.js +555 -863
- package/dist/web/assets/client/components.js +323 -897
- package/dist/web/assets/client/detail.js +333 -0
- package/dist/web/assets/client/dock.js +225 -0
- package/dist/web/assets/client/dom.js +55 -3
- package/dist/web/assets/client/evidence.js +172 -0
- package/dist/web/assets/client/format.js +25 -14
- package/dist/web/assets/client/forms.js +230 -0
- package/dist/web/assets/client/i18n.js +1020 -791
- package/dist/web/assets/client/overview.js +115 -0
- package/dist/web/assets/client/records.js +63 -0
- package/dist/web/assets/client/sections.js +313 -0
- package/dist/web/assets/client/sidebar.js +117 -0
- package/dist/web/assets/client/theme.js +61 -22
- package/dist/web/assets/icons.js +39 -0
- package/dist/web/assets/shell.js +124 -118
- package/dist/web/assets/styles/base.js +41 -0
- package/dist/web/assets/styles/components.js +167 -0
- package/dist/web/assets/styles/layout.js +49 -77
- package/dist/web/assets/styles/markdown.js +16 -24
- package/dist/web/assets/styles/responsive.js +33 -44
- package/dist/web/assets/styles/tokens.js +65 -89
- package/dist/web/assets/styles/views.js +289 -0
- package/dist/web/webServer.js +2 -1
- package/docs/architecture/README.md +1 -0
- package/docs/architecture/README.zh-CN.md +1 -0
- package/docs/cli-information-contract.md +107 -0
- package/docs/cli-information-contract.zh-CN.md +81 -0
- package/docs/managed-turn-and-session-runtime.md +9 -0
- package/docs/managed-turn-and-session-runtime.zh-CN.md +6 -0
- package/docs/plugin-sdk.md +7 -3
- package/docs/plugin-sdk.zh-CN.md +5 -2
- package/docs/release-workflow.md +42 -9
- package/docs/release-workflow.zh-CN.md +30 -7
- package/docs/storage-baseline.md +5 -0
- package/docs/testing/verification-levels.md +2 -2
- package/i18n/README.zh-CN.md +2 -0
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +8 -1
- package/skills/yui-leader/references/authorization.md +64 -0
- package/skills/yui-leader/references/execution.md +18 -4
- package/skills/yui-leader/references/task-plugins.md +4 -2
- package/skills/yui-operator/SKILL.md +9 -2
- package/skills/yui-runtime/SKILL.md +77 -9
- package/skills/yui-runtime/references/publication.md +3 -1
- package/dist/web/assets/client/taskSummary.js +0 -350
- package/dist/web/assets/client/taskSurface.js +0 -616
- package/dist/web/assets/client/view.js +0 -608
- package/dist/web/assets/styles/cards.js +0 -247
- package/dist/web/assets/styles/widgets.js +0 -168
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# CLI 信息契约
|
|
2
|
+
|
|
3
|
+
Yui 将命令的效果、发现和完整证据读取分开。查询不会消费 Message,也不启动后续工作。
|
|
4
|
+
变更回执说明 saved/requested/accepted/unknown 等真实事实;`ok: true` 只说明这次
|
|
5
|
+
CLI 调用成功,不代表 Task、原生 Turn 或远端投递完成。
|
|
6
|
+
|
|
7
|
+
这是当前通信契约,不是兼容模式。已保存的 Task、Message、结果、Snapshot 和 Session
|
|
8
|
+
历史保持不变;没有持久 schema 迁移,也没有新增快照或缓存存储。
|
|
9
|
+
|
|
10
|
+
## 日常读取路径
|
|
11
|
+
|
|
12
|
+
| 问题 | 入口 | 默认信息与下一步 |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| 找哪个 Task? | `task list` | 既有有界目录、过滤器、attention 与游标 |
|
|
15
|
+
| 当前有什么? | `task context <task>` | 当前 Task/Brief/Role/Project/工作区事实、活跃工作与 Run、开放输入、有效决策、未解决 Job、近期 Message 引用;不倾倒事件或终态 Run |
|
|
16
|
+
| 有哪些记录? | `task context list <task> --store <family>` | 一种获授权的记录、摘要与带 digest 的确切引用 |
|
|
17
|
+
| 原文是什么? | `task context inspect <task> --store <family> --ref <id> --digest <digest>` | 确切当前记录,含原始结果展开;长文档分页 |
|
|
18
|
+
| 发生了什么变化? | `task context delta <task> --after <cursor>` | 固定上界内的不可变事件,不是可变当前状态的快照 |
|
|
19
|
+
| Global 收到了什么? | `session context <role>` | 身份、Profile、权限、当前原生 Turn/retry,以及分别有界的 pending/recent Message 页 |
|
|
20
|
+
| 读取 Global 输入 | `role message list <role> [--pending]`、`role message show <role> <id>` | 在自身范围内发现,再读完整原文;队列接受不删除历史 |
|
|
21
|
+
| 本次唤醒带来什么? | `task wake show <task> <wake>` | 固定窗口与 Message/Run/Event 读取指针,不重复正文 |
|
|
22
|
+
| 分配了什么? | `task run context <task>/<run>` | 冻结授权与一份带摘要的 `pointers` 目录;`deltaRefs` 表示变化身份;当前观察独立 |
|
|
23
|
+
| 实际配置是什么? | `task role session inspect <task> <role>` | Task/Role 身份、期望绑定、冻结 Session、当前 Provider 绑定、retry 与显式 Host 观察;不复制整个 Task/Role 或 Provider 会话历史 |
|
|
24
|
+
|
|
25
|
+
Task Message、事件、WorkItem、Run、决策、里程碑、publication 和 InputRequest 列表
|
|
26
|
+
共用摘要/引用分页。Role 状态与 wake 历史列表也分页,并给出详情命令。
|
|
27
|
+
Role 发现返回 `recordedHealth` 与 `hostObservation: "not-requested"`,不是实时 Host
|
|
28
|
+
健康度。记录状态正常也不能排除 Host 失败或终态未确认;需沿条目的 `task role status`
|
|
29
|
+
读取指针检查。
|
|
30
|
+
Context 列表还暴露候选、Review、Job、Project Knowledge、工作区等获授权的记录。
|
|
31
|
+
`--status`、`--after`、`--work-item` 缩小发现范围;续读必须保留过滤条件。
|
|
32
|
+
Run 列表接受 Task 或 `task/work` 目标。
|
|
33
|
+
|
|
34
|
+
当前 Context 的 `attention.messages` 统计全部获授权 Message,不仅是未投递输入。
|
|
35
|
+
`collections` 计数与 `omitted` 明确表达发现不完整。近期抽样不能证明没有更早的待处理
|
|
36
|
+
或相关输入。读取相关固定 wake 与原始 Message;更广的需求/历史审计使用分类发现。
|
|
37
|
+
|
|
38
|
+
## 预算与续读
|
|
39
|
+
|
|
40
|
+
- 发现页默认 20 条,可选 1–100,紧凑 JSON 预算 32 KiB。条目包含摘要,不含完整报告正文。
|
|
41
|
+
- 当前 Task Context 至多 64 条,记录与 attention 共 24 KiB,响应预算 32 KiB。
|
|
42
|
+
单个内联值至多 2 KiB;大值及 Message/Run/WorkItem/Knowledge 正文用引用。
|
|
43
|
+
入口每个集合最多抽样八条。
|
|
44
|
+
- Global 入口分别抽样八条 pending 与八条 recent;独立续读,历史不能挤掉待处理输入。
|
|
45
|
+
- 不超过 16 KiB 的详情保持普通 JSON。更大详情返回 `contentPage`:确切来源、
|
|
46
|
+
SHA-256 digest、JSON 字符偏移、总字节数/字符数、文本、完整性与下一游标。
|
|
47
|
+
每块最多 4096 个 UTF-16 单元,不拆代理对,转义后的输出低于 32 KiB。
|
|
48
|
+
不再因 4 MiB 上限而永久无法读取合法原文。
|
|
49
|
+
- Task 元信息/next-action/remote-delivery、Brief、WorkItem、Message、Run、
|
|
50
|
+
决策/里程碑/事件、Role show/status/Session 检查、wake 详情、InputRequest、
|
|
51
|
+
Run Context 与冻结展开使用有界详情读取。
|
|
52
|
+
|
|
53
|
+
使用 `--json` 读取顶层 `data`;Run Context 和展开使用 `data.context`,Run Context delta 使用 `data.contextDelta`。
|
|
54
|
+
长详情用同一读取命令加 `--cursor <contentPage.nextCursor>` 继续。按 offset 顺序拼接
|
|
55
|
+
`text`,校验相同 source 与 digest,最后一次性解析 JSON。不要分别解析块,也不要把
|
|
56
|
+
第一块当成完整报告。
|
|
57
|
+
|
|
58
|
+
列表包含 `items`、`total`、`complete`、`nextCursor`。计数、条目和游标校验处于同一
|
|
59
|
+
授权范围。游标是不透明位置,不是通行令牌:每页重新授权。集合或文档改变时明确报错,
|
|
60
|
+
重新读取,不混合版本;无需持久分页 Session。可变集合不保证并发写入期间无中断遍历。
|
|
61
|
+
追加事件遍历使用固定上界 Context delta。目前分类发现扫描选定的授权集合来计算指纹;
|
|
62
|
+
有界的是输出,不是总存储读取成本。
|
|
63
|
+
|
|
64
|
+
## 效果与例外
|
|
65
|
+
|
|
66
|
+
Message send/queue/steer 回执保留身份、digest、正文字节数及原有提交/投递/control
|
|
67
|
+
状态,不回显正文。Brief 更新返回 saved 引用。没有新增等待、重试、确认或审批阶段。
|
|
68
|
+
重复读游标绝不能重放变更。
|
|
69
|
+
|
|
70
|
+
激活、完成、集成和输入控制仍是完整事务业务操作,即使内部有多步工程机制。
|
|
71
|
+
其特定状态回执与已有未知效果诊断保留,不压平成通用“已执行”标志。
|
|
72
|
+
|
|
73
|
+
本次覆盖日常 Agent Context、协作发现和原始证据读取,并非产品全部诊断或导出。
|
|
74
|
+
既有日志尾部/artifact 限制、Task 目录分页、有界错误诊断保留各自契约。
|
|
75
|
+
配置目录、Project/config 管理、资源清单、归档诊断、发布操作和专用集成/change-set
|
|
76
|
+
读取仍有自己的用途契约;不宣称它们全部受 32 KiB 限制。Web 全详情投影是独立消费者,
|
|
77
|
+
不会被 CLI 摘要悄悄替代。大 Project Knowledge 与 Task 证据用定向 Context 发现。
|
|
78
|
+
|
|
79
|
+
典型通知读取一次当前 Context、一次固定 wake,再逐条读取相关原文(或其全部文档页)。
|
|
80
|
+
不要为了入口故意省略的详情重复读聚合。只有原文超过内联预算才增加原文分页调用;
|
|
81
|
+
摘要不能代替完整原文。
|
|
@@ -41,6 +41,7 @@ automatically create Runs. Explicit dispatch loads one exact Run Context Pack.
|
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
43
|
yui task context <task> --json
|
|
44
|
+
yui task context list <task> --store <store> [--cursor <cursor>]
|
|
44
45
|
yui task context delta <task> --after <coreCursor>
|
|
45
46
|
yui task context inspect <task> --store <store> --ref <id>
|
|
46
47
|
yui task run context <task/run> --json
|
|
@@ -52,6 +53,14 @@ Delta pages immutable events through a fixed upper bound; inspect expands a
|
|
|
52
53
|
current record and can require an exact digest. Runtime observations state their
|
|
53
54
|
own coverage and do not become another durable snapshot.
|
|
54
55
|
|
|
56
|
+
Entry Context samples current facts; it is not a complete historical inventory.
|
|
57
|
+
List one authorized record family, then inspect the relevant originals. Large
|
|
58
|
+
details use `contentPage` and `--cursor`; concatenate all exact text chunks before
|
|
59
|
+
parsing. Global `session context` likewise separates bounded pending/recent
|
|
60
|
+
discovery from `role message show`. See the
|
|
61
|
+
[CLI information contract](cli-information-contract.md) for budgets, scope,
|
|
62
|
+
continuations and the complete-original reading protocol.
|
|
63
|
+
|
|
55
64
|
Run Context freezes Assignment, source references, effective configuration and
|
|
56
65
|
workspace boundaries. A Role edit does not rewrite an existing Assignment.
|
|
57
66
|
Reading either Context does not acknowledge input or create execution authority.
|
|
@@ -33,6 +33,7 @@ Run Context Pack。
|
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
35
|
yui task context <task> --json
|
|
36
|
+
yui task context list <task> --store <store> [--cursor <cursor>]
|
|
36
37
|
yui task context delta <task> --after <coreCursor>
|
|
37
38
|
yui task context inspect <task> --store <store> --ref <id>
|
|
38
39
|
yui task run context <task/run> --json
|
|
@@ -43,6 +44,11 @@ Task Context 是一个有界的、获授权的工作集,带有当前 core 游
|
|
|
43
44
|
上界内分页不可变事件;inspect 展开一条当前记录,并可要求确切摘要。运行时观察声明
|
|
44
45
|
自己的覆盖范围,不会成为另一份持久快照。
|
|
45
46
|
|
|
47
|
+
入口 Context 抽样当前事实,不是完整历史目录。先列出一种获授权的记录,再展开相关原文。
|
|
48
|
+
长详情使用 `contentPage` 与 `--cursor`;必须拼接全部确切文本分块后再解析 JSON。
|
|
49
|
+
Global `session context` 同样把有界 pending/recent 发现与 `role message show` 原文分开。
|
|
50
|
+
预算、范围、续读及完整原文协议见 [CLI 信息契约](cli-information-contract.zh-CN.md)。
|
|
51
|
+
|
|
46
52
|
Run Context 冻结 Assignment、来源引用、生效配置和工作区边界。一次 Role 编辑不改写
|
|
47
53
|
既有 Assignment。读取任一 Context 都不确认输入或创建执行权限。每一条受管输入都指向
|
|
48
54
|
确切的 Session Manifest 和 CLI 入口。Run Pack 是一个参考目录:动手前先读相关的需求
|
package/docs/plugin-sdk.md
CHANGED
|
@@ -87,7 +87,9 @@ changed source does not inherit an old digest's authorization. The boundaries
|
|
|
87
87
|
around resources, network, global configuration and the core namespace are
|
|
88
88
|
unchanged; when existing authority is sufficient it is not re-approved, and when a
|
|
89
89
|
new permission is missing the specific gap is reported rather than impersonating
|
|
90
|
-
the Operator or
|
|
90
|
+
the Operator or inventing user authorization. An original user authorization
|
|
91
|
+
can support a bounded [Leader grant](../skills/yui-leader/references/authorization.md)
|
|
92
|
+
without another Operator signature.
|
|
91
93
|
|
|
92
94
|
On validation failure the Agent preserves the original error and judges the fix;
|
|
93
95
|
an unknown or partial effect must not be auto-rerun. After using a new capability
|
|
@@ -323,8 +325,10 @@ Because trusted-local does not bound direct host effects, this grant must allow
|
|
|
323
325
|
statement that every call actually produces an irreversible effect. `none` or
|
|
324
326
|
`reversible` must not be read as unlimited local execution authority.
|
|
325
327
|
|
|
326
|
-
An Operator explicitly authorized by the user uses the original grant ingress
|
|
327
|
-
|
|
328
|
+
An Operator explicitly authorized by the user uses the original grant ingress.
|
|
329
|
+
A current delivery Leader can use that same ingress with `--source-message`,
|
|
330
|
+
a verbatim `--purpose`, stable `--request-id`, expiry and finite uses, limited
|
|
331
|
+
to the user's actual authorization. For example, the Operator path for a single validation:
|
|
328
332
|
|
|
329
333
|
```text
|
|
330
334
|
<checkout>/output/dev/bin/yui task grant issue T --action plugin.execute --param pluginId=demo --param digest=SOURCE_SHA256 --param environmentRef=T/P --param trust=trusted-local --param phase=validate --max-uses 1 --irreversibility-ceiling irreversible
|
package/docs/plugin-sdk.zh-CN.md
CHANGED
|
@@ -66,7 +66,8 @@ Leader 先通过稳定 `capability search/describe` 读取当前目录和契约
|
|
|
66
66
|
Task-local 管理权限不等于执行信任:可执行包仍逐阶段核对下面定义的精确
|
|
67
67
|
`plugin.execute` grant,源码改变后不会继承旧摘要授权。资源、网络、全局
|
|
68
68
|
配置及核心 namespace 的边界不变;已有授权充分时不重复批准,缺少新权限则
|
|
69
|
-
报告具体缺口,不冒充 Operator
|
|
69
|
+
报告具体缺口,不冒充 Operator 或虚构授权。原始用户授权已覆盖时,可使用
|
|
70
|
+
[有界 Leader Grant](../skills/yui-leader/references/authorization.md),无需 Operator 再次签字。
|
|
70
71
|
|
|
71
72
|
验证失败由 Agent 保存原错误并判断修复;不可把 unknown/部分效果自动重跑。
|
|
72
73
|
使用新增能力取得实际业务结果后,通过 `artifact.save` 将独立内容保存为文件产物
|
|
@@ -245,7 +246,9 @@ package scope 替代资源授信。因 trusted-local 不约束直接宿主效果
|
|
|
245
246
|
必须允许 `irreversibilityCeiling: irreversible`:这是能力上限,不表示每次调用
|
|
246
247
|
实际产生不可逆效果。`none/reversible` 不得解释为无限本机执行权。
|
|
247
248
|
|
|
248
|
-
|
|
249
|
+
获明确授权的 Operator 保留原 grant 入口;当前 delivery Leader 也可使用同一入口,
|
|
250
|
+
附上 `--source-message`、逐字授权引文 `--purpose`、稳定 `--request-id`、有效期及有限次数,
|
|
251
|
+
范围必须来自真实用户授权。以下是 Operator 只允许一次验证的示例:
|
|
249
252
|
|
|
250
253
|
```text
|
|
251
254
|
<checkout>/output/dev/bin/yui task grant issue T --action plugin.execute --param pluginId=demo --param digest=SOURCE_SHA256 --param environmentRef=T/P --param trust=trusted-local --param phase=validate --max-uses 1 --irreversibility-ceiling irreversible
|
package/docs/release-workflow.md
CHANGED
|
@@ -27,6 +27,29 @@ system sits behind `ReleaseWorkflowPorts`
|
|
|
27
27
|
external ports exercise recovery without real GitHub, npm, git, Controller,
|
|
28
28
|
or model effects.
|
|
29
29
|
|
|
30
|
+
## Yui's default release boundary
|
|
31
|
+
|
|
32
|
+
For development of Yui itself, the repository's `AGENTS.md` owns the release policy:
|
|
33
|
+
do not release a version by default. Development, tests, acceptance, PR creation
|
|
34
|
+
and merge do not include changing version numbers, creating release tags or
|
|
35
|
+
GitHub Releases, or publishing to npm. Each external effect still requires the
|
|
36
|
+
Task's actual authorization. A workflow containing only PR, CI and merge steps
|
|
37
|
+
is a valid delivery plan; its `ReleaseWorkflow` name does not authorize any
|
|
38
|
+
package release, global CLI update or Controller replacement.
|
|
39
|
+
|
|
40
|
+
When the user explicitly asks to release a new version without naming its
|
|
41
|
+
level, select only minor or patch according to the actual changes and project
|
|
42
|
+
version rules. A major release requires explicit user authorization for major
|
|
43
|
+
or a specific major version. If breaking changes cannot honestly be represented
|
|
44
|
+
by minor/patch, explain the compatibility conflict and wait for the necessary
|
|
45
|
+
explicit user choice: neither silently publish major nor mislabel incompatible
|
|
46
|
+
behavior as compatible. This does not require adding historical compatibility
|
|
47
|
+
mechanisms. Package release versions are distinct from storage migration
|
|
48
|
+
versions; the storage rules below do not authorize a package release.
|
|
49
|
+
|
|
50
|
+
The operations and examples below describe how to execute already-authorized
|
|
51
|
+
effects, not a default sequence to run after completing or merging a Task.
|
|
52
|
+
|
|
30
53
|
## Stable 1.0 baseline and release evidence
|
|
31
54
|
|
|
32
55
|
Package 1.0.0 defines the storage **1.0** contract directly. The runtime and
|
|
@@ -149,9 +172,12 @@ protection remain enforced.
|
|
|
149
172
|
|
|
150
173
|
Storage upgrades are limited to the current major's explicit minor steps.
|
|
151
174
|
Cross-major conversion is independently authorized and is not a runtime fallback.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
175
|
+
New Sessions use the ordinary `yui` entry from their launch environment; updates
|
|
176
|
+
do not generate or retarget per-Session CLI scripts. Global Context commands
|
|
177
|
+
remain self-contained for remote TUI/Desktop use. Correct PATH and Home selection
|
|
178
|
+
are required: protocol/storage checks do not distinguish every same-contract
|
|
179
|
+
installation. Development uses an explicit isolated checkout entry.
|
|
180
|
+
Runtime diagnostics do not interpret `schema.json`, `state.json`, or a whole-map release
|
|
155
181
|
idempotency file; current SQLite data and per-key release receipts remain the
|
|
156
182
|
authorities, and unrelated files are left untouched.
|
|
157
183
|
|
|
@@ -275,18 +301,25 @@ grouped by Role/AgentRun, and process owners use PID/start identity. Storage
|
|
|
275
301
|
changes follow the [single explicit upgrade boundary](sqlite-control-plane-design.md);
|
|
276
302
|
ordinary commands never rewrite the Home schema.
|
|
277
303
|
|
|
278
|
-
|
|
304
|
+
Operator grant issue and revoke retain their existing authority. They require
|
|
279
305
|
the current registered global Operator conversation. Its native session ID
|
|
280
306
|
must match the durable live session binding: Codex commands use `CODEX_THREAD_ID`
|
|
281
307
|
when present, otherwise `YUI_NATIVE_SESSION_ID`; Claude uses `YUI_NATIVE_SESSION_ID`.
|
|
282
308
|
Host generation and launch-time Agent labels are not caller identity. Resuming
|
|
283
309
|
the same conversation through another entry point does not revoke its authority.
|
|
284
310
|
An unregistered, replaced, or ended conversation has no such authority.
|
|
285
|
-
A
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
311
|
+
A current delivery Leader can instead issue finite, expiring grants for its own
|
|
312
|
+
Task from an original user/Operator Message, using `--source-message`,
|
|
313
|
+
`--purpose` (a verbatim authorization quotation), and `--request-id`. It must
|
|
314
|
+
choose only the actions actually authorized by that source. Source validation
|
|
315
|
+
is not natural-language approval; development intent is not publication intent.
|
|
316
|
+
Release scope requires Task Projects and their repositories; package/version
|
|
317
|
+
effects also need explicit package/version bounds. Global update, Controller
|
|
318
|
+
replacement and migration remain Operator-only. The Leader may revoke only
|
|
319
|
+
Leader-issued grants in its Task. Empty environments, Worker/Reviewer or
|
|
320
|
+
planning/replaced Sessions confer no such authority. Granter/revoker attribution
|
|
321
|
+
comes from the current Session; there is no `--granter`/`--by` label to spoof.
|
|
322
|
+
See the [complete source/ordinary archive contract](../skills/yui-leader/references/authorization.md).
|
|
290
323
|
|
|
291
324
|
```sh
|
|
292
325
|
# 1. The Operator session issues the authority for the release chain.
|
|
@@ -20,6 +20,22 @@ Agent 选择一个预先声明的计划,设施从持久状态驱动该计划
|
|
|
20
20
|
(`src/release/releaseWorkflowPorts.ts`)之后。可用临时 SQLite 和确定性的外部端口测试
|
|
21
21
|
恢复逻辑,无需真实 GitHub、npm、git、Controller 或模型效果。
|
|
22
22
|
|
|
23
|
+
## Yui 的默认发版边界
|
|
24
|
+
|
|
25
|
+
开发 Yui 本身时,发版规则以仓库中的 `AGENTS.md` 为准:默认不发布新版本。
|
|
26
|
+
开发、测试、验收、创建 PR 和合并不包含修改版本号、创建发布 tag 或 GitHub Release、
|
|
27
|
+
发布 npm;每项外部效果仍需 Task 的实际授权。仅包含 PR、CI 和合并步骤也是合法的交付
|
|
28
|
+
计划,`ReleaseWorkflow` 这个名称不授予包发布、全局 CLI 更新或 Controller 替换权限。
|
|
29
|
+
|
|
30
|
+
用户明确要求「发布新版本」但没有指定级别时,根据实际变更和项目版本规则,仅选择
|
|
31
|
+
minor(中版本)或 patch(小版本)。major(大版本)必须得到用户对大版本或具体 major
|
|
32
|
+
版本号的明确授权。如果破坏性变更无法诚实地用 minor/patch 表达,说明兼容性冲突,
|
|
33
|
+
等待必要的明确用户选择:既不能静默发布 major,也不能把不兼容行为冒称为兼容。
|
|
34
|
+
这不要求为了回避选择而新增历史兼容机制。包发布版本与存储迁移版本是不同契约,
|
|
35
|
+
下文的存储规则不授予包发布权限。
|
|
36
|
+
|
|
37
|
+
下文操作及示例说明如何执行已经获授权的效果,不是 Task 完成或合并后默认运行的步骤。
|
|
38
|
+
|
|
23
39
|
## 稳定的 1.0 基线与发布证据
|
|
24
40
|
|
|
25
41
|
1.0.0 软件包直接定义存储 **1.0** 契约。运行包和当前源码不携带任何历史
|
|
@@ -113,8 +129,10 @@ Controller RPC 版本 1。Host 不打开 Home 数据库,包括进程归属、
|
|
|
113
129
|
|
|
114
130
|
存储升级仅包含同主版本内明确的小版本步骤。跨主版本转换独立授权,
|
|
115
131
|
不构成运行时回退。
|
|
116
|
-
Session
|
|
117
|
-
|
|
132
|
+
新 Session 使用启动环境中的普通 `yui` 入口;升级不生成或重定向会话 CLI 脚本。
|
|
133
|
+
Global Context 命令保持自足,供远端 TUI/Desktop 使用。必须正确选择 PATH 和 Home:
|
|
134
|
+
协议及存储校验不能区分所有同合约安装;开发使用显式隔离的 checkout 入口。
|
|
135
|
+
运行时诊断不解释 `schema.json`、`state.json` 或整表 release 幂等文件;
|
|
118
136
|
当前 SQLite 与逐 key release 回执仍是权威,无关文件保持原样。
|
|
119
137
|
|
|
120
138
|
`task role status`、`task role list` 和 `task role session inspect` 在持久 Run 状态旁
|
|
@@ -209,14 +227,19 @@ Session 权威依据当前持久绑定检查。Telemetry 按 Role/AgentRun 分
|
|
|
209
227
|
PID/start 身份。存储变更遵循[唯一的显式升级边界](sqlite-control-plane-design.zh-CN.md);
|
|
210
228
|
普通命令绝不改写 Home schema。
|
|
211
229
|
|
|
212
|
-
grant
|
|
230
|
+
Operator 的 grant 签发与撤销保留现有权威边界,需要当前已登记的全局 Operator 对话。它的
|
|
213
231
|
原生 session ID 必须与持久的活动 session 绑定匹配:Codex 命令在存在时使用
|
|
214
232
|
`CODEX_THREAD_ID`,否则使用 `YUI_NATIVE_SESSION_ID`;Claude 使用 `YUI_NATIVE_SESSION_ID`。
|
|
215
233
|
Host generation 和启动时的 Agent 标签不是调用者身份。通过另一个入口恢复同一段对话
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
234
|
+
不撤销其权威。未登记、被替换或已结束的对话没有这种权威。
|
|
235
|
+
本 Task 当前 delivery Leader 也可引用真实用户/Operator 原消息,以
|
|
236
|
+
`--source-message`、`--purpose`(逐字授权引文)、`--request-id` 签发有有效期及有限次数的
|
|
237
|
+
有界 Grant,并撤销本 Task 的 Leader Grant。语义判断仍由 Agent 负责:引文匹配只是来源
|
|
238
|
+
验证,开发指令不是发布许可。发布必须限定 Task Project/repository,包与版本操作另须明确
|
|
239
|
+
package/version 边界;全局升级、共享 Controller 替换、迁移仍不开放。
|
|
240
|
+
Worker/Reviewer、规划/失效 Session 和清空环境不获得授权;身份来自当前持久 Session,
|
|
241
|
+
不存在可伪造的 `--granter`/`--by` 标签。参见
|
|
242
|
+
[完整来源与普通归档契约](../skills/yui-leader/references/authorization.md)。
|
|
220
243
|
|
|
221
244
|
```sh
|
|
222
245
|
# 1. Operator session 为发布链签发权威。
|
package/docs/storage-baseline.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Storage baseline 1.0
|
|
4
4
|
|
|
5
|
+
Current storage is 1.2. The declared 1.1 → 1.2 transition adds optional
|
|
6
|
+
CapabilityGrant authorization-source evidence and native-human input/archive
|
|
7
|
+
audit records. Existing valid Operator grants remain unchanged; migration does
|
|
8
|
+
not infer or invent past user authority. The SQL layout is unchanged.
|
|
9
|
+
|
|
5
10
|
Yui 1.0.0 starts from one clean persistent contract. The package version,
|
|
6
11
|
storage schema, record envelopes and Controller protocol are separate
|
|
7
12
|
identities; none is inferred from another.
|
|
@@ -50,12 +50,12 @@ is required.
|
|
|
50
50
|
## Permanent core smoke
|
|
51
51
|
|
|
52
52
|
`npm test` and `npm run test:core` build the checkout and run the maintained suite.
|
|
53
|
-
The stable suite owns current storage 1.
|
|
53
|
+
The stable suite owns current storage 1.2 and its declared 1.0/1.1 minor
|
|
54
54
|
transition. It contains no undeclared historical format compatibility path.
|
|
55
55
|
|
|
56
56
|
Current coverage includes:
|
|
57
57
|
|
|
58
|
-
1. Fresh storage 1.
|
|
58
|
+
1. Fresh storage 1.2, exact schema/record validation, no initialization over
|
|
59
59
|
unknown data, and rejection of old integer formats without mutation.
|
|
60
60
|
2. Exact-version staging, mismatched-target refusal, same-major contiguous
|
|
61
61
|
minor preflight, explicit maintenance-owner identity across handover, and
|
package/i18n/README.zh-CN.md
CHANGED
|
@@ -345,6 +345,8 @@ Yui 面向一个受信任本地用户,不是 OS 沙箱,也不是远程多用
|
|
|
345
345
|
[总体架构](../ARCHITECTURE.zh-CN.md)介绍端到端设计,
|
|
346
346
|
[文档导航](../docs/architecture/README.zh-CN.md)提供配置、执行、交付、存储和插件的
|
|
347
347
|
当前合同。想直接操作 CLI 时,使用 `yui --help` 查看命令。
|
|
348
|
+
[CLI 信息契约](../docs/cli-information-contract.zh-CN.md)说明当前 Context、分页发现、
|
|
349
|
+
完整原文读取和变更回执。
|
|
348
350
|
|
|
349
351
|
Yui 默认将控制面数据保存在 `~/.yui`,通过 `YUI_HOME` 选择另一个实例。
|
|
350
352
|
切换构建或更新已有 Home 前,请查看[存储与升级](../docs/sqlite-control-plane-design.md)。
|
package/package.json
CHANGED
|
@@ -7,11 +7,18 @@ description: Lead one Yui Task through authorized planning, activation handoff,
|
|
|
7
7
|
|
|
8
8
|
Follow [yui-runtime](../yui-runtime/SKILL.md) first. Load the exact Context Pack
|
|
9
9
|
for an explicitly dispatched AgentRun; for direct conversation or a Task
|
|
10
|
-
notification, read current Task context
|
|
10
|
+
notification, read current Task context using `yui task context <task-id> --json`.
|
|
11
11
|
No self-dispatch or old completed Run is needed. Read the actual Task
|
|
12
12
|
requirements, current Brief and relevant user/Operator Messages, not just
|
|
13
13
|
their summaries. Resolve links relative to the file containing them.
|
|
14
14
|
|
|
15
|
+
Current Context is a bounded working set, not all Task history. Use
|
|
16
|
+
`task context list <task> --store <store>` or a domain list for discovery,
|
|
17
|
+
then an exact detail read. A wake contains original Message/Run read pointers,
|
|
18
|
+
not copied reports. Follow Runtime's `nextCursor` and `contentPage` rules:
|
|
19
|
+
read the full relevant window and originals before disposition, without
|
|
20
|
+
unconditionally walking unrelated history.
|
|
21
|
+
|
|
15
22
|
## Select the applicable stage
|
|
16
23
|
|
|
17
24
|
Use current lifecycle, latest intent and the Session's actual planning/delivery
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Source-authorized Task actions
|
|
2
|
+
|
|
3
|
+
Read the original user/Operator Message in full. A development request, local
|
|
4
|
+
completion, Role report, quoted third-party text, or publication permission
|
|
5
|
+
alone does not authorize another effect. Decide whether the user authorized
|
|
6
|
+
the particular action, resource, trust and scope. Engineering verifies source
|
|
7
|
+
and fixed bounds, not natural-language meaning: a matching quotation proves
|
|
8
|
+
origin, not that your interpretation is correct. Do not issue publication or
|
|
9
|
+
resource grants from a request that only asks to develop.
|
|
10
|
+
|
|
11
|
+
For actual authorization, the current delivery Leader uses:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
yui task grant issue <task> --source-message <message-id> \
|
|
15
|
+
--purpose "<verbatim explicit authorization>" --request-id <stable-id> \
|
|
16
|
+
--action <action> --expires-at <timestamp> --max-uses <finite-count> \
|
|
17
|
+
<exact scope, parameter bounds and irreversible ceiling>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The existing Grant records source identity/digest, quotation, Session and fixed
|
|
21
|
+
bounds. Replaying the request id returns the same grant; it never replenishes
|
|
22
|
+
expired, exhausted or revoked authority. Do not change ids to evade limits.
|
|
23
|
+
A changed plan needs a new bounded decision within the user's scope, or a real
|
|
24
|
+
InputRequest if new authority is missing. Operator retains issue/revoke.
|
|
25
|
+
The current Leader may revoke this Task's Leader-issued grants, including
|
|
26
|
+
after Session replacement, but cannot revoke Operator grants.
|
|
27
|
+
|
|
28
|
+
Release grants require explicit Task Projects/repositories and `sourceCommit`
|
|
29
|
+
bounds (checked against the workflow source, never a step's claimed value); package effects
|
|
30
|
+
also require packages and concrete version bounds. All steps sharing a
|
|
31
|
+
version-bound grant must pass that version. Global installation, shared
|
|
32
|
+
Controller replacement, migration and other Tasks remain outside this path.
|
|
33
|
+
Preserve source/artifact integrity, changed-candidate acceptance, CI,
|
|
34
|
+
Publication and unknown-effect reconciliation.
|
|
35
|
+
|
|
36
|
+
Plugin execution requires exact pluginId, digest, environmentRef, trust and
|
|
37
|
+
phase. Directory grants require the resourceId, canonical path and read/write
|
|
38
|
+
action. An explicitly authorized unregistered directory can be registered with
|
|
39
|
+
`resource.local.register` using `sourceMessage` and a verbatim `purpose`;
|
|
40
|
+
registration grants no access or Project configuration authority. Then use the
|
|
41
|
+
existing prepare/adopt/bind/release operations. A Home, stable Project or
|
|
42
|
+
managed workspace cannot be registered through this Leader path.
|
|
43
|
+
|
|
44
|
+
Human input through the Host's human-owned console is persisted before the
|
|
45
|
+
Provider write. Read that original Message. Provider-visible userMessage items
|
|
46
|
+
alone cannot prove human authorship: managed prompts use them too. Never
|
|
47
|
+
transcribe unproven input into a Role report and call it user authority. Use
|
|
48
|
+
the authenticated user input surface when transport provenance is unavailable.
|
|
49
|
+
|
|
50
|
+
For an explicitly authorized ordinary archive, first save acceptance/delivery
|
|
51
|
+
evidence and complete the Task:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
yui task archive <task> --integrated --source-message <message-id> \
|
|
55
|
+
--purpose "<verbatim archive authorization>" --request-id <stable-id>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This single Controller operation checks settlement, delivery and clean
|
|
59
|
+
workspaces, records the source, stops the requesting Leader and applies normal
|
|
60
|
+
cleanup/archive checks. The conversation can end before the CLI response.
|
|
61
|
+
Inspect `task.leader-archive-started`, `task.leader-archive-result`,
|
|
62
|
+
`task.archived` and cleanup receipts. A started operation without a result is
|
|
63
|
+
uncertain; inspect its effects before recovery, never replay with a new id.
|
|
64
|
+
No automatic retry, force or abandonment authority is implied.
|
|
@@ -22,6 +22,17 @@ implementation patterns, scheduling options, review routing, or recoverable
|
|
|
22
22
|
runtime actions. Create an InputRequest only for a real product choice, new
|
|
23
23
|
authority, irreversible external effect, or unavailable external fact.
|
|
24
24
|
|
|
25
|
+
Task Messages and the Brief are durable records, not delivery receipts to the
|
|
26
|
+
Operator. For a genuinely missing user choice, resource, credential or scope,
|
|
27
|
+
use `task input request`; the Controller notifies the Operator through the
|
|
28
|
+
existing durable notification path with references to the original records.
|
|
29
|
+
Completion and existing blocked-work notifications use that same path. Do not
|
|
30
|
+
invent an InputRequest just to announce progress or ask again for authority
|
|
31
|
+
already granted. A failed global input call does not mean Task notifications
|
|
32
|
+
are broken: a Task Leader must not call global `role message queue`, `steer`
|
|
33
|
+
or `role interrupt`, impersonate Operator, or clear identity environment
|
|
34
|
+
variables to bypass that boundary.
|
|
35
|
+
|
|
25
36
|
## Separate the work unit, executor, and concurrency
|
|
26
37
|
|
|
27
38
|
Honor the user's explicit choice of direct work or delegation. Otherwise make
|
|
@@ -286,8 +297,9 @@ Use `capability search`, `describe`, and `call` to inspect current tools.
|
|
|
286
297
|
Prefer existing tools, composition or a one-off script when sufficient.
|
|
287
298
|
For reusable Task-local capabilities, read [Task plugins](task-plugins.md)
|
|
288
299
|
before creation, validation or activation. Plugin management permission does
|
|
289
|
-
not grant code execution or broader external effects.
|
|
290
|
-
|
|
300
|
+
not grant code execution or broader external effects. Use
|
|
301
|
+
[source-authorized capabilities](authorization.md) for existing explicit user
|
|
302
|
+
authority. Never invent authorization, impersonate Operator, or modify the core installation to obtain a tool.
|
|
291
303
|
|
|
292
304
|
## Validate and make the review judgment
|
|
293
305
|
|
|
@@ -369,7 +381,9 @@ after its final report. Cleanup can remain advisory at completion. Ordinary
|
|
|
369
381
|
archive requires settled resources; explicitly authorized force archive preserves
|
|
370
382
|
unresolved resources and diagnostics under the shared
|
|
371
383
|
[archive contract](../../yui-runtime/references/publication.md). The Leader
|
|
372
|
-
does not gain independent archive authorization.
|
|
384
|
+
does not gain independent archive authorization. An original explicit user
|
|
385
|
+
archive request can authorize the Controller-owned ordinary archive described
|
|
386
|
+
in [source-authorized capabilities](authorization.md).
|
|
373
387
|
|
|
374
388
|
Complete only when the Task outcome is satisfied, required checks and review
|
|
375
389
|
contracts are settled, WorkItems are accepted or deliberately retired, latest
|
|
@@ -381,7 +395,7 @@ yui task complete <task-id> \
|
|
|
381
395
|
```
|
|
382
396
|
|
|
383
397
|
Completion records the exact Project heads. Archive is a separate,
|
|
384
|
-
user-authorized
|
|
398
|
+
user-authorized action, never an implication of completion or publication.
|
|
385
399
|
|
|
386
400
|
Completion is offline by default. `--refresh-remote` only refreshes remote
|
|
387
401
|
freshness observations; neither path rebases or starts Integration checks.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Task-local capabilities
|
|
2
2
|
|
|
3
3
|
Read this before creating, validating or activating a Task-local plugin.
|
|
4
|
-
Use the
|
|
4
|
+
Use the `yui` CLI's capability directory and read the exact schema
|
|
5
5
|
before each unfamiliar operation. Prefer an existing tool, composition or
|
|
6
6
|
one-off script unless a reusable named capability is useful.
|
|
7
7
|
|
|
@@ -17,7 +17,9 @@ the exact plugin id, digest, environment, trust and phase, within its remaining
|
|
|
17
17
|
uses and validity. A source change cannot inherit an old digest's grant.
|
|
18
18
|
Trusted-local subprocesses are not an OS sandbox.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Use [source-authorized capabilities](authorization.md) when original user input
|
|
21
|
+
already authorizes the exact Task plugin/resource. Never invent grants,
|
|
22
|
+
impersonate Operator, change global configuration,
|
|
21
23
|
or modify the core installation, namespace or carrying Endpoint to obtain a
|
|
22
24
|
tool. Request only a genuinely missing resource or trust boundary, not authority
|
|
23
25
|
already available. Plugin grants do not authorize unrelated external effects.
|
|
@@ -227,8 +227,15 @@ a dormant Role and verify the complete binding before the next launch.
|
|
|
227
227
|
|
|
228
228
|
## Present current progress
|
|
229
229
|
|
|
230
|
-
Use JSON reads and their top-level `data` field.
|
|
231
|
-
|
|
230
|
+
Use JSON reads and their top-level `data` field.
|
|
231
|
+
Use Global Context's `pending`/`recent` pages to find Messages, then
|
|
232
|
+
`role message show operator <id>` for the original. A successful send receipt
|
|
233
|
+
contains saved identity and delivery/control facts, not another copy of the
|
|
234
|
+
submitted body. Follow Runtime's bounded-read contract for list continuations
|
|
235
|
+
and long `contentPage` details; do not decode `output` as nested JSON or print
|
|
236
|
+
an entire Context again merely to extract one already-returned reference.
|
|
237
|
+
|
|
238
|
+
Report the facts needed to understand the outcome:
|
|
232
239
|
|
|
233
240
|
- Task ID, Projects, recorded bases, and lifecycle;
|
|
234
241
|
- current WorkItems, ownership, dependencies, and acceptance state;
|