@zq-silk/yui 2.8.0 → 2.9.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/dist/cli/commandCatalog.js +35 -12
- package/dist/cli/interactionPolicy.js +2 -2
- package/dist/cli/updatePorts.js +20 -0
- package/dist/commands/durableJobCommands.js +50 -0
- package/dist/commands/projectCommands.js +4 -33
- package/dist/commands/scheduleCommands.js +45 -0
- package/dist/commands/taskActivationCommands.js +19 -5
- package/dist/commands/taskCommands.js +2 -1
- package/dist/commands/taskFactCommands.js +24 -12
- package/dist/commands/taskPublicationCommands.js +6 -3
- package/dist/commands/taskPublicationVerifyCommand.js +74 -28
- package/dist/context/runContextPack.js +24 -4
- package/dist/context/taskContext.js +52 -15
- package/dist/context/taskPhase.js +99 -0
- package/dist/controlPlaneCli.js +24 -5
- package/dist/controller/controller.js +35 -0
- package/dist/controller/fileSchedulerStoreAdapter.js +16 -1
- package/dist/controller/jobControl.js +42 -12
- package/dist/controller/jobDefinitionControl.js +304 -0
- package/dist/controller/jobSupervisor.js +47 -32
- package/dist/controller/runtime.js +11 -2
- package/dist/controller/scheduleControl.js +176 -0
- package/dist/coordination/workMailbox.js +3 -3
- package/dist/external/githubPublicationVerifier.js +14 -5
- package/dist/external/gitlabPublicationVerifier.js +2 -1
- package/dist/interaction/notificationPresentation.js +3 -3
- package/dist/interaction/operatorPresentation.js +5 -0
- package/dist/job/builtinJob.js +58 -0
- package/dist/job/durableJob.js +72 -49
- package/dist/job/jobDefinition.js +68 -0
- package/dist/job/jobRunner.js +2 -1
- package/dist/job/projectRefreshRunner.js +48 -0
- package/dist/repository/projectRefresh.js +58 -0
- package/dist/repository/taskWorkspacePreparer.js +2 -1
- package/dist/schedule/schedule.js +108 -0
- package/dist/scheduler/operatorEvent.js +2 -0
- package/dist/scheduler/operatorInputNotificationProcessor.js +8 -0
- package/dist/storage/contextRecords.js +8 -0
- package/dist/storage/jobSchema.js +15 -0
- package/dist/storage/maintenanceCaller.js +69 -0
- package/dist/storage/recordValidation.js +5 -0
- package/dist/storage/scheduleSchema.js +12 -0
- package/dist/storage/sqliteSchema.js +75 -25
- package/dist/storage/sqliteStore.js +110 -9
- package/dist/storage/storageVersions.js +1 -1
- package/dist/storage/storeRpc.js +5 -0
- package/dist/storage/upgrade/jobDefinitionMigration.js +22 -0
- package/dist/task/publicationToolObservation.js +128 -0
- package/dist/task/taskActivationService.js +35 -0
- package/dist/web/assets/client/app/settings.js +7 -1
- package/dist/web/assets/client/i18n/en.js +61 -0
- package/dist/web/assets/client/i18n/zh-CN.js +61 -0
- package/dist/web/assets/client/index.js +2 -0
- package/dist/web/assets/client/views/jobs.js +222 -0
- package/dist/web/assets/client/views/task/page.js +11 -1
- package/dist/web/assets/shared/manageNav.js +1 -0
- package/dist/web/assets/shared/taskTabs.js +2 -2
- package/dist/web/assets/shell/settingsContent.js +3 -0
- package/dist/web/assets/styles/index.js +2 -0
- package/dist/web/assets/styles/views/jobs.js +19 -0
- package/dist/web/webJobs.js +52 -0
- package/dist/web/webServer.js +31 -0
- package/docs/cli-information-contract.md +43 -2
- package/docs/cli-information-contract.zh-CN.md +32 -1
- package/docs/job-runs.md +224 -0
- package/docs/release-workflow.md +65 -0
- package/docs/release-workflow.zh-CN.md +49 -0
- package/docs/schedules.md +132 -0
- package/docs/storage-baseline.md +18 -1
- package/docs/storage-baseline.zh-CN.md +15 -1
- package/docs/task-delivery.md +68 -2
- package/docs/task-delivery.zh-CN.md +33 -1
- package/docs/testing/verification-levels.md +6 -2
- package/docs/testing/verification-levels.zh-CN.md +6 -3
- package/package.json +4 -3
- package/skills/yui-leader/SKILL.md +18 -1
- package/skills/yui-leader/VERSION +1 -1
- package/skills/yui-leader/references/planning.md +9 -1
- package/skills/yui-reviewer/SKILL.md +4 -0
- package/skills/yui-reviewer/VERSION +1 -1
- package/skills/yui-runtime/SKILL.md +9 -3
- package/skills/yui-runtime/VERSION +1 -1
- package/skills/yui-runtime/references/context-ordering.md +103 -0
- package/skills/yui-runtime/references/publication.md +44 -4
- package/skills/yui-worker/SKILL.md +5 -0
- package/skills/yui-worker/VERSION +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { activeLiveRoleAgentSession } from "../executor/agentExecutor.js";
|
|
2
|
+
import { createJobDefinitionControl } from "../controller/jobDefinitionControl.js";
|
|
3
|
+
import { createScheduleControl } from "../controller/scheduleControl.js";
|
|
4
|
+
import { requireKnownFields } from "../domain/validation.js";
|
|
5
|
+
import { WebRequestRejected, webLocalMutation } from "./webMutation.js";
|
|
6
|
+
/** Local-user ingress only, behind the Web token/origin boundary. Never use
|
|
7
|
+
* this adapter for managed RPC callers. The route fixes scope; the server
|
|
8
|
+
* resolves the current Operator binding on every request. No invented Session
|
|
9
|
+
* or durable second authority: the public services revalidate the binding.
|
|
10
|
+
*/
|
|
11
|
+
export function createWebJobs(store, home) {
|
|
12
|
+
function invoke(scope, family, value, write, now) {
|
|
13
|
+
const apply = (tx) => {
|
|
14
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
15
|
+
throw new Error("Expected an operation.");
|
|
16
|
+
requireKnownFields(value, family === "jobs"
|
|
17
|
+
? ["op", "id", "title", "configuration", "expectedRevision", "runId", "requestId"]
|
|
18
|
+
: ["op", "id", "jobId", "rule", "expectedRevision"], "Web Job/Schedule request");
|
|
19
|
+
const input = value;
|
|
20
|
+
const reads = family === "jobs" ? ["list", "show", "runs", "run-get", "logs"] : ["list", "show"];
|
|
21
|
+
const writes = family === "jobs" ? ["define", "update", "run", "run-cancel"] : ["create", "update", "enable", "disable"];
|
|
22
|
+
if (!(write ? writes : reads).includes(String(input.op)))
|
|
23
|
+
throw new Error("Operation is not available on this endpoint.");
|
|
24
|
+
if (scope.kind === "task" && !tx.getTask(scope.taskId))
|
|
25
|
+
throw new Error("Task not found.");
|
|
26
|
+
const session = activeLiveRoleAgentSession(tx.getGlobalRoleSessionSet("operator"));
|
|
27
|
+
if (!session)
|
|
28
|
+
throw new Error("A current Operator Session is required for Job management.");
|
|
29
|
+
const caller = { scope: "global", role: "operator", nativeSessionId: session.nativeSessionId,
|
|
30
|
+
agentId: session.agentId, adapterId: session.adapterId };
|
|
31
|
+
const { requestId, ...fields } = input;
|
|
32
|
+
if (input.op === "run" && (typeof requestId !== "string" || !requestId.trim() || requestId.length > 200)) {
|
|
33
|
+
throw new Error("Immediate execution requires a stable requestId.");
|
|
34
|
+
}
|
|
35
|
+
const params = { ...fields, scope, caller,
|
|
36
|
+
...(input.op === "run" ? { trigger: { source: "manual", key: requestId } } : {}) };
|
|
37
|
+
return (family === "jobs" ? createJobDefinitionControl(tx, home) : createScheduleControl(tx, home))(params, now);
|
|
38
|
+
};
|
|
39
|
+
if (write)
|
|
40
|
+
return webLocalMutation(store, apply);
|
|
41
|
+
try {
|
|
42
|
+
return store.transaction(apply);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
throw new WebRequestRejected(error instanceof Error ? error.message : String(error));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
read: (scope, family, value, now) => invoke(scope, family, value, false, now),
|
|
50
|
+
mutate: (scope, family, value, now) => invoke(scope, family, value, true, now)
|
|
51
|
+
};
|
|
52
|
+
}
|
package/dist/web/webServer.js
CHANGED
|
@@ -252,6 +252,37 @@ async function handleHttpRequest(request, response, store, dependencies, token,
|
|
|
252
252
|
}
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
|
+
const jobTarget = /^\/api\/(?:settings|(tasks)\/([^/]+))\/(jobs|schedules)$/.exec(pathname);
|
|
256
|
+
if (jobTarget) {
|
|
257
|
+
try {
|
|
258
|
+
if (!dependencies.jobs)
|
|
259
|
+
throw new WebRequestRejected("Job management unavailable.");
|
|
260
|
+
const scope = jobTarget[1] ? { kind: "task", taskId: decodeURIComponent(jobTarget[2]) }
|
|
261
|
+
: { kind: "global" };
|
|
262
|
+
const family = jobTarget[3];
|
|
263
|
+
let value;
|
|
264
|
+
if (method === "GET") {
|
|
265
|
+
const query = new URL(request.url, "http://localhost").searchParams;
|
|
266
|
+
if ([...query.keys()].some(key => !["op", "id", "runId"].includes(key)))
|
|
267
|
+
throw new WebRequestRejected("Unknown Job query.");
|
|
268
|
+
value = dependencies.jobs.read(scope, family, Object.fromEntries(query), now());
|
|
269
|
+
}
|
|
270
|
+
else if (method === "POST") {
|
|
271
|
+
if (headerValue(request, "origin") !== `http://${headerValue(request, "host")}`) {
|
|
272
|
+
throw new WebRequestRejected("Job changes require a same-origin request.");
|
|
273
|
+
}
|
|
274
|
+
value = dependencies.jobs.mutate(scope, family, await readMutationBody(request), now());
|
|
275
|
+
}
|
|
276
|
+
else
|
|
277
|
+
throw new WebRequestRejected("Method not allowed.");
|
|
278
|
+
sendJson(response, 200, value, false);
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
sendJson(response, 409, { error: error instanceof Error ? error.message : "Job operation failed.",
|
|
282
|
+
disposition: error instanceof WebRequestRejected ? "not-submitted" : "unknown" }, false);
|
|
283
|
+
}
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
255
286
|
if (pathname === "/api/settings" || pathname === "/api/settings/group" || pathname === "/api/settings/capabilities") {
|
|
256
287
|
try {
|
|
257
288
|
if (!dependencies.settings)
|
|
@@ -6,8 +6,9 @@ saved/requested/accepted/unknown facts; `ok: true` means the CLI invocation
|
|
|
6
6
|
succeeded, not that a Task, native Turn or remote delivery completed.
|
|
7
7
|
|
|
8
8
|
This is the current wire contract, not a compatibility mode. Stored Tasks,
|
|
9
|
-
Messages, results, Snapshots and Session histories are unchanged.
|
|
10
|
-
|
|
9
|
+
Messages, results, Snapshots and Session histories are unchanged. Read projections
|
|
10
|
+
add no snapshot/cache store. New activation-source event attributes use the
|
|
11
|
+
declared storage 1.10 → 1.11 transition; historical sources are never invented.
|
|
11
12
|
|
|
12
13
|
## Daily read path
|
|
13
14
|
|
|
@@ -91,6 +92,46 @@ concurrent writes. For append-only event traversal use fixed-bound Context delta
|
|
|
91
92
|
Discovery currently scans the selected authorized family to fingerprint it;
|
|
92
93
|
its output, not total storage-reading cost, is bounded.
|
|
93
94
|
|
|
95
|
+
## Intent, source and temporal consistency
|
|
96
|
+
|
|
97
|
+
Current Leader/public Task context projects `phase` (lifecycle, gate, activation
|
|
98
|
+
source and Brief freshness) separately from the managed `caller`'s actual
|
|
99
|
+
execution authority. These are facts, not a semantic permission decision.
|
|
100
|
+
Old Message records carry recording/revision relationships to the adopted
|
|
101
|
+
activation, not an automatic “superseded” verdict.
|
|
102
|
+
|
|
103
|
+
Activation requests accept either `--source-message <id>` or
|
|
104
|
+
`--source-text <exact-input>`; a Leader must provide one. Develop submissions
|
|
105
|
+
link their saved Message automatically. Exact text is retained in the existing
|
|
106
|
+
immutable event with caller attribution, including native Session identity for
|
|
107
|
+
Leader captures. It is not a Provider-verified user Message and is never queued
|
|
108
|
+
again. Same-request retries cannot change that source. The activation wake
|
|
109
|
+
references the event/original explicitly. Missing or changed sources have a
|
|
110
|
+
diagnostic and original-read route, not a fabricated approval or rejection.
|
|
111
|
+
|
|
112
|
+
`task brief show` returns `writeGuard`; `task brief update` requires
|
|
113
|
+
`--if-current <writeGuard>`. New semantic input/results, phase changes or edits
|
|
114
|
+
invalidate stale writers transactionally, independently of timestamps and
|
|
115
|
+
runtime heartbeats. On rejection, reread and reconcile intended fields.
|
|
116
|
+
Task Job saves append a semantic event for status, result, cancellation or
|
|
117
|
+
acknowledgement changes, not for heartbeat, checkpoint or notification receipts.
|
|
118
|
+
Core indicates `refresh-needed`; Leader maintains the actual summary at
|
|
119
|
+
meaningful boundaries. No completion gate or automatic prose rewrite is added.
|
|
120
|
+
|
|
121
|
+
Task event cursors bind the Home and Task. Delta returns `kind: event-history`,
|
|
122
|
+
`fromCursor`, `complete`, `stateChanged` and a fixed `throughCursor`. Keep the
|
|
123
|
+
original `--after` across every `--continuation`; advance only on completion.
|
|
124
|
+
New arrivals remain outside that window. Empty events do not erase a baseline,
|
|
125
|
+
and shared state can change without Task events. Invalid/old cursors require a
|
|
126
|
+
fresh bounded current read. Event numeric IDs order recording within one Task,
|
|
127
|
+
not occurrence, delivery, handling or unrelated Tasks.
|
|
128
|
+
|
|
129
|
+
Run delta uses its exact frozen parent Snapshot and returns complete changed
|
|
130
|
+
`refs` plus `removedRefs`, with normal document pagination. The clipped launch
|
|
131
|
+
`deltaRefs` remains a hint only. Mutable Task facts never widen that Assignment.
|
|
132
|
+
Focused wakes with exact refs no longer absorb other messages merely because
|
|
133
|
+
timestamps overlap; `--history` retains timestamp-window discovery.
|
|
134
|
+
|
|
94
135
|
## Runtime diagnostics
|
|
95
136
|
|
|
96
137
|
Global failure evidence remains ordinary record-only Messages; no aggregate
|
|
@@ -5,7 +5,8 @@ Yui 将命令的效果、发现和完整证据读取分开。查询不会消费
|
|
|
5
5
|
CLI 调用成功,不代表 Task、原生 Turn 或远端投递完成。
|
|
6
6
|
|
|
7
7
|
这是当前通信契约,不是兼容模式。已保存的 Task、Message、结果、Snapshot 和 Session
|
|
8
|
-
|
|
8
|
+
历史保持不变;读取投影没有新增快照或缓存存储。新激活事件的来源字段使用已声明的
|
|
9
|
+
存储 1.10 → 1.11 迁移,不补造历史来源。
|
|
9
10
|
|
|
10
11
|
## 日常读取路径
|
|
11
12
|
|
|
@@ -70,6 +71,36 @@ Run 列表接受 Task 或 `task/work` 目标。
|
|
|
70
71
|
追加事件遍历使用固定上界 Context delta。目前分类发现扫描选定的授权集合来计算指纹;
|
|
71
72
|
有界的是输出,不是总存储读取成本。
|
|
72
73
|
|
|
74
|
+
## 意图、来源与时序一致性
|
|
75
|
+
|
|
76
|
+
Leader/公开 Task 当前视图的 `phase` 投影生命周期、执行开关、激活来源与 Brief
|
|
77
|
+
新鲜度;`caller` 单独展示当前 Session 的实际权限,不代替语义授权判断。
|
|
78
|
+
旧 Message 标明与激活请求的记录/修订先后关系,不自动判为整体失效。
|
|
79
|
+
|
|
80
|
+
激活请求接受 `--source-message <id>` 或 `--source-text <exact-input>`,Leader
|
|
81
|
+
必须提供其一。develop 提交自动关联已保存的 Message。直接原生输入原文保存在既有
|
|
82
|
+
不可变事件中,带调用者及 Leader Session 归属,不伪装成 Provider 验证过的用户
|
|
83
|
+
Message,也不再次入队。相同 request ID 重试不得更换来源。交接 wake 显式引用
|
|
84
|
+
原始事件/Message;缺失或变更来源有诊断和原文入口,不自动批准或拒绝开发。
|
|
85
|
+
|
|
86
|
+
`task brief show` 返回 `writeGuard`;更新必须携带 `--if-current <writeGuard>`。
|
|
87
|
+
新语义输入、结果、阶段变化或编辑在事务中使旧写入失效,不依赖墙钟时间。
|
|
88
|
+
Task Job 状态、结果、取消请求和确认处置在保存事务中追加语义事件;
|
|
89
|
+
心跳、checkpoint 和通知回执不使 guard 反复失效。
|
|
90
|
+
拒绝后重读并协调目标字段。Core 只提示 `refresh-needed`,
|
|
91
|
+
Leader 在关键节点维护实际摘要,不新增完成门禁或自动改写原文。
|
|
92
|
+
|
|
93
|
+
Task 事件游标绑定 Home 与 Task。增量返回 `kind: event-history`、`fromCursor`、
|
|
94
|
+
`complete`、`stateChanged` 和固定 `throughCursor`。续页保留最初的 `--after`,
|
|
95
|
+
用 `--continuation` 读完再推进游标;并发新输入留在下一窗口。空增量不清空基线,
|
|
96
|
+
共享状态也可能在没有 Task 事件时变化。失效游标须重新读取有界当前视图。
|
|
97
|
+
事件序号只表达单 Task 记录顺序,不混同发生、投递、消费或跨 Task 因果关系。
|
|
98
|
+
|
|
99
|
+
Run 增量基于精确父 Snapshot,返回完整变更 `refs` 与 `removedRefs`,长文档照常
|
|
100
|
+
分页;截断的 `deltaRefs` 仅作启动提示。可变 Task 事实不扩大冻结 Assignment。
|
|
101
|
+
带精确引用的 focused wake 不再仅因时间戳重叠纳入其他 Message;`--history`
|
|
102
|
+
仍可发现时间窗口历史。
|
|
103
|
+
|
|
73
104
|
## 重复运行时诊断
|
|
74
105
|
|
|
75
106
|
`role message list <role> --diagnostics` 从原始 record-only Message 派生故障组,
|
package/docs/job-runs.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Job definitions and exact execution Runs
|
|
2
|
+
|
|
3
|
+
A Job is a stable, scoped definition. A JobRun is one execution, with its own
|
|
4
|
+
ID, configuration revision, trigger, immutable execution specification,
|
|
5
|
+
process identity, artifacts and terminal result. Changing a definition never
|
|
6
|
+
changes an admitted Run. No Schedule is needed for immediate execution.
|
|
7
|
+
|
|
8
|
+
## CLI and ownership
|
|
9
|
+
|
|
10
|
+
Commands operate through the Controller's `job.definition` RPC:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
yui job define --global --job probe --title "Local probe" \
|
|
14
|
+
--input '{"kind":"builtin","action":"system.noop","input":{}}'
|
|
15
|
+
yui job run --global --job probe --request-id first
|
|
16
|
+
yui job runs --global --job probe
|
|
17
|
+
yui job run-get --global --job probe --run <exact-run-id>
|
|
18
|
+
yui job logs --global --job probe --run <exact-run-id>
|
|
19
|
+
yui job run-cancel --global --job probe --run <exact-run-id>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use `--task task-N` instead of `--global` for a Task Job. Its configuration is
|
|
23
|
+
`{kind:"shell",owner,projectId,head,workspace,env,steps}`, with the same managed
|
|
24
|
+
workspace, Project, Assignment and delivery-Session requirements as `job start`.
|
|
25
|
+
The Project target is not the ownership scope. Definitions can be inspected
|
|
26
|
+
with `job show`, listed with `job list`, and revised with `job update --revision
|
|
27
|
+
<observed-revision> --title ... --input ...`. A definition ID is required on
|
|
28
|
+
creation; replaying an identical creation is idempotent. Scope cannot be updated.
|
|
29
|
+
|
|
30
|
+
Global Job management requires the current authenticated Operator Session.
|
|
31
|
+
Other GlobalRoles cannot inspect or manage Task Job definitions either, matching
|
|
32
|
+
the existing Task Context authorization boundary.
|
|
33
|
+
Users can request it through Operator. Literal `caller.scope=user` is not a
|
|
34
|
+
credential on the existing Controller socket. Task Sessions cannot inspect,
|
|
35
|
+
create, modify or run global Jobs. The initial global action is `system.noop`,
|
|
36
|
+
a fixed local no-op implemented by the same standalone runner. It accepts only
|
|
37
|
+
empty input and no Project; it does not call a model or external service.
|
|
38
|
+
`project.refresh` is the controlled Project maintenance action below. Arbitrary global commands,
|
|
39
|
+
environments, workspaces and Agent calls are not accepted.
|
|
40
|
+
|
|
41
|
+
`job run --request-id` is a stable trigger identity within the scoped Job.
|
|
42
|
+
Replay returns the original Run; reusing that identity after a configuration
|
|
43
|
+
change or with a different retry target is a conflict. A new key after a
|
|
44
|
+
terminal result admits a new Run. Queued, running or unknown-effect executions
|
|
45
|
+
return `{created:false,reason:"overlap",run:<existing>}` rather than queueing.
|
|
46
|
+
Returning an existing Run (including replay or overlap) requires permission to
|
|
47
|
+
read that exact Run's original Assignment. If a definition was retargeted and
|
|
48
|
+
the caller cannot read the earlier Run, admission fails with `UNAUTHORIZED`
|
|
49
|
+
without exposing its snapshot or creating another Run.
|
|
50
|
+
Unknown outcomes are never automatically replayed, even after acknowledgement.
|
|
51
|
+
Explicit retry uses `--retry-of <exact-failed-cancelled-or-timed-out-run>`.
|
|
52
|
+
Cancellation addresses a Run, not a future Schedule. Log reads return up to
|
|
53
|
+
64 KiB per completed/checkpointed step; a currently uncheckpointed step is not
|
|
54
|
+
included.
|
|
55
|
+
|
|
56
|
+
The existing `job start` remains the one-shot Task entry point. It creates a
|
|
57
|
+
definition and one Run, and its `job` response is still the **Run**. Existing
|
|
58
|
+
`job get/cancel/acknowledge --task ... --job ...` address exact Runs, not
|
|
59
|
+
definitions or “latest”. `jobs list/retry` is unchanged: it manages Leader
|
|
60
|
+
wake/recovery records and is not this Job module.
|
|
61
|
+
|
|
62
|
+
## Storage and existing consumers
|
|
63
|
+
|
|
64
|
+
Storage **1.8 → 1.9** appends two tables without modifying the published
|
|
65
|
+
baseline: `job_definitions` and `global_job_runs`. `durable_jobs` remains the
|
|
66
|
+
authoritative Task Run table, with `definitionId`, `definitionRevision` and
|
|
67
|
+
`trigger` added to each payload. This retains every Task-local Run ID and
|
|
68
|
+
artifact location. Global Runs have `scope:"global"` and no `taskId`, Task or
|
|
69
|
+
Assignment. They use the same execution state machine and supervisor; their
|
|
70
|
+
terminal notices enter the Operator mailbox, never a Task Leader mailbox.
|
|
71
|
+
|
|
72
|
+
The centralized transactional migration maps each old DurableJob to one
|
|
73
|
+
definition with the same local ID and one preserved Run. Equal commands are
|
|
74
|
+
not grouped. Original payload bytes are retained in `storage_migration_archive`
|
|
75
|
+
under migration 9 / family `durable_jobs`; old results, process evidence and
|
|
76
|
+
Integration references retain their identities. Frozen Context snapshots are
|
|
77
|
+
not rewritten. Ordinary readers accept only current storage; there is no
|
|
78
|
+
dual-format reader. A failed migration rolls back without advancing storage.
|
|
79
|
+
Actual Home upgrades require their own authorization and backup; this change
|
|
80
|
+
does not authorize or perform one.
|
|
81
|
+
|
|
82
|
+
IntegrationAttempt and verification consumers still use
|
|
83
|
+
`getDurableJob(taskId, exactRunId)`. Existing Task Context `job` entries,
|
|
84
|
+
execution audit, readiness/archive checks and HTTP preview tickets likewise
|
|
85
|
+
refer to exact Runs. Definitions alone never count as active execution or block
|
|
86
|
+
Task completion. Started Runs and retained unknown process evidence keep the
|
|
87
|
+
existing Task lifecycle and physical-cleanup boundaries. The management UI
|
|
88
|
+
retains exact references rather than replacing them with latest.
|
|
89
|
+
|
|
90
|
+
## Extension seams for Schedule, Project refresh and management UI
|
|
91
|
+
|
|
92
|
+
- `src/job/jobDefinition.ts`: `JobDefinition`, `JobScope`, `JobConfiguration`
|
|
93
|
+
and `JobTrigger`. Definition revision is optimistic concurrency, not a Run
|
|
94
|
+
status. Project targets stay in configuration.
|
|
95
|
+
- `src/controller/jobDefinitionControl.ts`: `admitJobRun(store, home, scope,
|
|
96
|
+
definitionId, caller, trigger, now, retryOf?)` returns `RunAdmission`.
|
|
97
|
+
It authenticates current scope, rechecks domain prerequisites, finds exact
|
|
98
|
+
trigger replay and excludes overlap inside the Store transaction. Schedule
|
|
99
|
+
can call it inside its own `store.transaction` with advancement in that same
|
|
100
|
+
transaction; no process starts until commit and supervisor reconciliation.
|
|
101
|
+
A rollback discards both. `source:"schedule"` is an internal seam, not an
|
|
102
|
+
accepted manual RPC assertion. Schedule must supply a legitimate current
|
|
103
|
+
authority; it must not invent a Session or reuse a revoked identity. Any
|
|
104
|
+
additional durable scheduled-intent authorization belongs to that feature.
|
|
105
|
+
- `src/job/builtinJob.ts`: controlled action compilation. Add a narrowly
|
|
106
|
+
validated builtin here; snapshot its target/input and compile runner steps
|
|
107
|
+
from trusted code, never caller-supplied shell. Revalidate before spawn.
|
|
108
|
+
A non-Git action uses an explicit all-zero `head` sentinel, never a Project
|
|
109
|
+
commit or Integration proof.
|
|
110
|
+
- `JobRun = DurableJob | GlobalJobRun` shares transitions, heartbeat, timeout,
|
|
111
|
+
cancel, checkpoints, exact OS identity and unknown-effect recovery. Store
|
|
112
|
+
methods preserve distinct scope storage; neither table mirrors the other.
|
|
113
|
+
- `createJobDefinitionControl` backs CLI JSON reads/mutations. A future
|
|
114
|
+
authenticated Web ingress must resolve its own caller and enforce these
|
|
115
|
+
service boundaries; it must not forward arbitrary browser-supplied identity.
|
|
116
|
+
|
|
117
|
+
The independent [Schedule module](schedules.md) adds time rules and transactional
|
|
118
|
+
due admission after this 1.9 foundation. It does not introduce an independent
|
|
119
|
+
daemon, cross-Task dependency engine or release behavior.
|
|
120
|
+
|
|
121
|
+
## Controlled Project refresh
|
|
122
|
+
|
|
123
|
+
An authenticated Operator can explicitly install one maintenance definition
|
|
124
|
+
per registered managed Project, inspect it, and request independent Runs:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
yui job define --global --job project-refresh-project-7 --title "Refresh Project 7" \
|
|
128
|
+
--input '{"kind":"builtin","action":"project.refresh","projectId":"project-7","input":{}}'
|
|
129
|
+
yui job show --global --job project-refresh-project-7
|
|
130
|
+
yui job run --global --job project-refresh-project-7 --request-id refresh-001
|
|
131
|
+
yui job runs --global --job project-refresh-project-7
|
|
132
|
+
yui job run-get --global --job project-refresh-project-7 --run <exact-run-id>
|
|
133
|
+
yui job logs --global --job project-refresh-project-7 --run <exact-run-id>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
These examples configure intent; installation, migration and Project registration
|
|
137
|
+
never install or run a default Job or Schedule. Task Sessions cannot use this
|
|
138
|
+
entry point. The Job remains global; `configuration.projectId` identifies its
|
|
139
|
+
target, not an owning Task. Duplicate refresh definitions for the same Project
|
|
140
|
+
are refused with the existing Job ID; `job list --global` also discovers it.
|
|
141
|
+
|
|
142
|
+
Empty action input explicitly binds the current catalog's Project ID, path,
|
|
143
|
+
ownership, lifecycle, remote URL and stable/development branches into
|
|
144
|
+
`input.targetDigest`. The digest is generated from authoritative configuration,
|
|
145
|
+
not a caller-supplied checkout path. Each Run retains this immutable input.
|
|
146
|
+
Admission, pre-spawn authorization and the domain action after lock acquisition
|
|
147
|
+
recheck the current target. Missing/retired/external Projects and changed targets
|
|
148
|
+
fail closed. After inspecting an intentional configuration change, use
|
|
149
|
+
`job update --revision <observed-revision>` with the same action and empty input
|
|
150
|
+
to bind it explicitly. Run/retry never silently rebinds an old definition.
|
|
151
|
+
|
|
152
|
+
`project refresh <project>` and the Job call the same Project domain service and
|
|
153
|
+
maintenance lock. The existing manual external-Project behavior is unchanged;
|
|
154
|
+
automatic writes require active **managed** ownership. Both require matching
|
|
155
|
+
stable and development branches. Git checks clean/untracked state, exact branch
|
|
156
|
+
and HEAD; fetch isolates FETCH_HEAD, unrelated tracking refs and maintenance;
|
|
157
|
+
only verified fast-forward and compare-and-swap tracking updates are allowed.
|
|
158
|
+
There is no reset, rebase, guessed checkout, user remote rewrite or semantic
|
|
159
|
+
Knowledge/Skill update. Lock waiting is bounded and never retries the Git action.
|
|
160
|
+
|
|
161
|
+
The existing detached Job runner invokes a fixed Project-domain executable.
|
|
162
|
+
That action reads current catalog/Run authority through a read-only Store and
|
|
163
|
+
writes Git only through the shared service. The generic runner remains
|
|
164
|
+
artifact-only. Runtime-owned PATH, HOME, SSH agent socket and Git config
|
|
165
|
+
locations are passed for Git discovery/authentication; callers cannot supply
|
|
166
|
+
commands or environment. Interactive Git prompts are disabled, and the action
|
|
167
|
+
has a ten-minute timeout. At most four supervised Project refresh attempts
|
|
168
|
+
are started concurrently; one Project's failure does not stop another.
|
|
169
|
+
Cancellation/timeout uses the existing process-group and unknown-effect contract.
|
|
170
|
+
|
|
171
|
+
For UI consumers (Task129), the action label is `project.refresh`, target is
|
|
172
|
+
`configuration.projectId`, and `job show/list` adds a **derived** `refresh`
|
|
173
|
+
projection with `lastAttempt` and `lastSuccessfulRefresh` exact Run references,
|
|
174
|
+
revision, trigger, status and timestamps. It is not separately stored.
|
|
175
|
+
A projection includes only refresh Runs for the definition's exact Project and
|
|
176
|
+
target digest; changing action or rebinding a remote/path/branch does not inherit
|
|
177
|
+
another target's successful observation. Full history remains in `job runs`.
|
|
178
|
+
A failed or unknown attempt never advances success. The Run supplies trigger
|
|
179
|
+
source, status, terminal error and artifact identity. `job logs` returns bounded
|
|
180
|
+
step output: successful refresh JSON contains `projectId`, `trigger`, observed
|
|
181
|
+
time, verified remote commit and `refresh.fromCommit/toCommit/tracking`.
|
|
182
|
+
Git-stage failures include `details.refresh` with observed partial HEAD/tracking
|
|
183
|
+
effects and any retained temporary ref. Earlier refusals have no successful
|
|
184
|
+
remote observation. Missing exit evidence, timeout or cancellation must not be
|
|
185
|
+
presented as successful synchronization; inspect retained evidence before retry.
|
|
186
|
+
The Run's all-zero `head` is not a Project revision; use the action's observations.
|
|
187
|
+
|
|
188
|
+
No persistent envelope/table change is needed: action input and output use the
|
|
189
|
+
existing JobDefinition/JobRun JSON and logs. Schedule should reference this same
|
|
190
|
+
global definition and use its existing admission seam, never a second Project
|
|
191
|
+
automation state. The isolated core scenario covers interval-triggered refresh
|
|
192
|
+
Runs, missed-period coalescing and disable behavior against a local Git remote.
|
|
193
|
+
This does not enable a cadence for any real Project.
|
|
194
|
+
|
|
195
|
+
## Local Web management
|
|
196
|
+
|
|
197
|
+
The Task's **Jobs** tab manages only that Task. **Settings → Jobs & schedules**
|
|
198
|
+
manages global definitions. Both use the same component and public services.
|
|
199
|
+
Create/edit a definition, run it immediately, select an exact historical Run
|
|
200
|
+
and read its snapshot/results/logs, or request cancellation of that Run.
|
|
201
|
+
Task shell configuration uses the same explicit managed-workspace specification
|
|
202
|
+
as the CLI; global creation offers only `system.noop` and `project.refresh`.
|
|
203
|
+
Creating or reading a Job never executes it.
|
|
204
|
+
|
|
205
|
+
The HTTP routes are `/api/tasks/:taskId/jobs|schedules` and
|
|
206
|
+
`/api/settings/jobs|schedules`. GET takes `op`, `id` and optional `runId`; POST
|
|
207
|
+
takes the corresponding public operation fields, with `requestId` for manual
|
|
208
|
+
Run admission. Routes fix scope. Browser-supplied `caller`, `scope` or trigger
|
|
209
|
+
authority is rejected. The loopback token authenticates the local-user ingress,
|
|
210
|
+
and writes additionally require an exact same Origin. The adapter resolves the
|
|
211
|
+
current Operator Session from the server store on every call; if none is
|
|
212
|
+
available, management reports that prerequisite rather than fabricating one.
|
|
213
|
+
Its accepted Jobs/Schedules retain the normal Operator binding/revocation
|
|
214
|
+
semantics. Managed RPC callers retain their existing authentication and cannot
|
|
215
|
+
borrow this local-user adapter.
|
|
216
|
+
|
|
217
|
+
Schedule forms support once, anchored interval and five-field cron with an
|
|
218
|
+
explicit timezone. Displayed next due and last success come from the service.
|
|
219
|
+
Disable affects future admissions, cancellation affects one exact Run, and a
|
|
220
|
+
manual Run does not move the cadence. Once `completed` means admitted, not
|
|
221
|
+
successful. Errors retain the draft; an unknown write is not automatically
|
|
222
|
+
resent. Refresh only reads facts and keeps the selected Run exact. No new
|
|
223
|
+
tables, scheduling loop, Project switch, implicit refresh or deletion semantics
|
|
224
|
+
are introduced.
|
package/docs/release-workflow.md
CHANGED
|
@@ -51,6 +51,71 @@ merely to avoid a version decision. Package versions remain distinct from protoc
|
|
|
51
51
|
and persistent-storage contracts: their compatibility checks and required migrations
|
|
52
52
|
are unchanged, and the storage rules below do not authorize a package release.
|
|
53
53
|
|
|
54
|
+
### 2.9.0 compatibility and migration notes
|
|
55
|
+
|
|
56
|
+
This stable minor includes scoped Job definitions and exact execution Runs,
|
|
57
|
+
persistent Schedules, controlled Project refresh, and their Task/settings
|
|
58
|
+
management UI. It also includes Task124's activation-source and bounded
|
|
59
|
+
temporal-context changes (PR #458) and Task130's tool-neutral publication
|
|
60
|
+
verification (PR #459).
|
|
61
|
+
|
|
62
|
+
There are deliberate interface changes. Job definitions and Runs have distinct
|
|
63
|
+
identities; existing `job start/get/cancel/acknowledge` continue to address
|
|
64
|
+
one-shot Task executions, while `job define/run/runs/run-get` manage the new
|
|
65
|
+
definition/Run model. Schedules reference scoped Jobs and do not replace Run
|
|
66
|
+
results. `task brief update` now requires the `writeGuard` from `task brief show`
|
|
67
|
+
as `--if-current`; reread and reconcile after a stale-guard rejection. Activation
|
|
68
|
+
requests require explicit source provenance for Leaders. Context consumers must
|
|
69
|
+
respect bounded pages, frozen references and Home/Task-bound event continuations.
|
|
70
|
+
See [Jobs](job-runs.md), [Schedules](schedules.md) and
|
|
71
|
+
[CLI information contracts](cli-information-contract.md).
|
|
72
|
+
|
|
73
|
+
Leaders may verify a PR/MR through any authorized CLI/API and record exact
|
|
74
|
+
structured evidence with `task publication verify --observation`. Built-in
|
|
75
|
+
gh/glab adapters remain optional. `publication upsert --verified` can no longer
|
|
76
|
+
assert verification without evidence; use the verification entry point instead.
|
|
77
|
+
Existing historical evidence is retained. Candidate/object binding, immutable
|
|
78
|
+
history, observation freshness and ordinary archive safety remain enforced;
|
|
79
|
+
tool output interpretation remains the authorized Leader's responsibility.
|
|
80
|
+
|
|
81
|
+
Storage advances from **1.8 to 1.11** through the centralized contiguous
|
|
82
|
+
migrations: **1.9** adds Job definitions/global Runs and preserves each old
|
|
83
|
+
Task execution's identity and original payload; **1.10** adds Schedules;
|
|
84
|
+
**1.11** declares activation-source event provenance without inventing historical
|
|
85
|
+
sources or rewriting frozen digests. Supported **1.0–1.10** Homes use the
|
|
86
|
+
existing same-major update path. With update authorization, run
|
|
87
|
+
`yui update --version 2.9.0`; the updater owns preflight, backup, migration and
|
|
88
|
+
Controller handover. Do not open an upgraded Home with an older binary or edit
|
|
89
|
+
storage manually. Missing historical provenance remains an explicit diagnostic.
|
|
90
|
+
|
|
91
|
+
Release validation uses exact-commit Core CI and the existing fresh-install
|
|
92
|
+
matrix for the same runtime tarball on Linux x64, macOS x64/arm64 and Node
|
|
93
|
+
20/22/24/26, with checksums and npm provenance. This is not real-model or company
|
|
94
|
+
API validation. Package publication does not itself update any global CLI,
|
|
95
|
+
Home or Controller; that is a separately authorized Operator operation.
|
|
96
|
+
|
|
97
|
+
### 2.8.1 compatibility and migration notes
|
|
98
|
+
|
|
99
|
+
This patch fixes maintenance startup for an existing Operator conversation
|
|
100
|
+
that supplies only its native identity, including Codex Desktop. `doctor`,
|
|
101
|
+
`upgrade` and `update` authenticate against the supported Home before requiring
|
|
102
|
+
current storage, so an older Home can reach the updater's read-only preflight.
|
|
103
|
+
Structured preflight failures retain their original diagnosis and recovery
|
|
104
|
+
guidance. Ordinary commands still require current storage and current authority.
|
|
105
|
+
|
|
106
|
+
Storage remains **1.8**. The existing contiguous **1.0 through 1.8** migration
|
|
107
|
+
chain, backup, maintenance lock and exact Controller handover are unchanged.
|
|
108
|
+
Use `yui update --version 2.8.1`; no manual intermediate upgrade or replacement
|
|
109
|
+
native Session is required for supported Homes. Pre-1.0 / 0.x Home formats are
|
|
110
|
+
outside this release's supported migration contract; no historical authorization
|
|
111
|
+
exception or legacy conversion is introduced.
|
|
112
|
+
|
|
113
|
+
Verification includes an isolated published 2.7.1 CLI with storage 1.7 and a
|
|
114
|
+
live Controller/Host: one native-only update preserves the original Host and
|
|
115
|
+
native conversation, migrates storage and processes new input afterward.
|
|
116
|
+
Only the external Provider is simulated. Publishing does not update a user's
|
|
117
|
+
global CLI, Home or production Controller.
|
|
118
|
+
|
|
54
119
|
### 2.8.0 compatibility and migration notes
|
|
55
120
|
|
|
56
121
|
This minor adds native metabridge model management: provider configuration,
|
|
@@ -36,6 +36,55 @@ Agent 选择一个预先声明的计划,设施从持久状态驱动该计划
|
|
|
36
36
|
不能将不兼容冒称为兼容,也不为回避版本选择新增历史兼容机制。包版本与协议、
|
|
37
37
|
持久存储契约仍然独立:兼容性检查和必要迁移要求不变,下文存储规则不授予发版权限。
|
|
38
38
|
|
|
39
|
+
### 2.9.0 兼容性及迁移说明
|
|
40
|
+
|
|
41
|
+
本稳定 minor 包含分作用域的 Job 定义与精确执行 Run、持久 Schedule、受控 Project
|
|
42
|
+
刷新,以及 Task/设置页中的管理界面。同时纳入 Task124 的激活来源与有界时序
|
|
43
|
+
上下文改动(PR #458)和 Task130 的工具中立交付验证(PR #459)。
|
|
44
|
+
|
|
45
|
+
本版包含明确的接口变化:Job 定义与 Run 使用不同身份;原有
|
|
46
|
+
`job start/get/cancel/acknowledge` 仍针对单次 Task 执行,新
|
|
47
|
+
`job define/run/runs/run-get` 管理定义/Run 模型。Schedule 引用同作用域的 Job,
|
|
48
|
+
不替代执行结果。`task brief update` 现在必须把 `task brief show` 返回的
|
|
49
|
+
`writeGuard` 作为 `--if-current` 提交;旧 guard 被拒绝后需重读并协调修改。
|
|
50
|
+
Leader 的激活请求必须提供明确来源。上下文消费者须遵循有界分页、冻结引用、
|
|
51
|
+
Home/Task 绑定的事件续读契约。详见 [Jobs](job-runs.md)、
|
|
52
|
+
[Schedules](schedules.md) 和 [CLI 信息契约](cli-information-contract.zh-CN.md)。
|
|
53
|
+
|
|
54
|
+
Leader 可通过任意已获授权的 CLI/API 核验 PR/MR,再用
|
|
55
|
+
`task publication verify --observation` 保存精确结构化证据;内置 gh/glab
|
|
56
|
+
适配器仍为可选路径。`publication upsert --verified` 不再允许无证据声明验证,
|
|
57
|
+
应改用正式验证入口。已有历史证据保留;候选/对象绑定、不可变历史、观察时效和
|
|
58
|
+
普通归档安全边界继续执行,工具输出的语义判断仍由获授权 Leader 负责。
|
|
59
|
+
|
|
60
|
+
存储经集中式连续迁移从 **1.8 升至 1.11**:**1.9** 新增 Job 定义/全局 Run,
|
|
61
|
+
保留每个旧 Task 执行身份及原始 payload;**1.10** 新增 Schedule;**1.11**
|
|
62
|
+
声明激活来源事件属性,不猜造历史来源或改写冻结摘要。受支持的 **1.0–1.10**
|
|
63
|
+
Home 沿用同 major 更新路径。获更新授权后执行 `yui update --version 2.9.0`,
|
|
64
|
+
由更新器负责预检、备份、迁移与 Controller 交接;不要用旧程序打开已升级 Home,
|
|
65
|
+
也不要手工编辑存储。缺失的历史来源仍明确报告为诊断。
|
|
66
|
+
|
|
67
|
+
发布验证使用精确提交的 Core CI,以及针对同一 runtime tarball 的既有全新安装
|
|
68
|
+
矩阵,覆盖 Linux x64、macOS x64/arm64 和 Node 20/22/24/26,并保留校验和及 npm
|
|
69
|
+
来源证明;不冒称真实模型或公司 API 验证。包发布本身不会更新任何全局 CLI、
|
|
70
|
+
Home 或 Controller,这由另行获授权的 Operator 操作负责。
|
|
71
|
+
|
|
72
|
+
### 2.8.1 兼容性及迁移说明
|
|
73
|
+
|
|
74
|
+
本 patch 修复已有 Operator 会话仅携带 native 身份(包括 Codex Desktop)时的
|
|
75
|
+
维护启动循环。`doctor`、`upgrade`、`update` 先在受支持的旧 Home 上验证调用者,
|
|
76
|
+
不再要求存储已经升级才能进入只读预检。结构化预检失败保留原始诊断与恢复指引;
|
|
77
|
+
普通业务命令仍要求当前存储格式和有效权限。
|
|
78
|
+
|
|
79
|
+
存储仍为 **1.8**,已有 **1.0 至 1.8** 连续迁移链、备份、维护锁和精确 Controller
|
|
80
|
+
交接保持不变。可使用 `yui update --version 2.8.1`;受支持的 Home 不需要手工先做
|
|
81
|
+
中间升级或更换 native 会话。1.0 之前/0.x Home 格式不在本次迁移支持范围内,
|
|
82
|
+
本版本不引入旧格式转换或历史授权例外。
|
|
83
|
+
|
|
84
|
+
隔离验证使用真实已发布的 2.7.1 CLI、1.7 Home 和运行中的 Controller/Host:
|
|
85
|
+
一次 native-only update 保留原 Host 与 native 会话,完成存储迁移并继续处理新输入。
|
|
86
|
+
仅外部 Provider 使用确定性模拟。发布不会更新用户真实全局 CLI、Home 或生产 Controller。
|
|
87
|
+
|
|
39
88
|
### 2.8.0 兼容性及迁移说明
|
|
40
89
|
|
|
41
90
|
本 minor 新增原生 metabridge 模型管理:提供商配置、模型目录缓存,以及经受支持
|