@tea-agent/loop-agent 0.28.2-beta.1 → 0.28.3
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/AGENTS.md +1 -1
- package/CHANGELOG.md +37 -0
- package/README.md +11 -1
- package/dist/cli/command-definitions.js +2 -1
- package/dist/commands/client-recovery.js +111 -8
- package/dist/commands/dag-init-hybrid.js +1 -1
- package/dist/commands/init-upgrade.js +2479 -0
- package/dist/commands/init.js +120 -9
- package/dist/governance/manifest-types.js +65 -0
- package/dist/shared/operator/capabilities.js +350 -2
- package/dist/task/worktree.js +256 -39
- package/dist/worker/cli.js +22 -12
- package/dist/worker/console/chat/workspace-landing.js +16 -6
- package/dist/worker/console/observe-health-match.js +2 -0
- package/dist/worker/console/observe-link.js +4 -0
- package/dist/worker/console/operator-actions.js +183 -4
- package/dist/worker/console/operator-selection.js +13 -0
- package/dist/worker/console/static/assets/index-BfRgtLF4.js +29 -0
- package/dist/worker/console/static/index.html +1 -1
- package/dist/worker/observe/health.js +1 -0
- package/dist/worker/observe/night-jobs.js +104 -0
- package/dist/worker/observe/routes.js +48 -0
- package/dist/worker/observe/static/app.js +3 -0
- package/dist/worker/observe/static/constants.js +1 -0
- package/dist/worker/observe/static/index.html +47 -0
- package/dist/worker/observe/static/router.js +10 -0
- package/dist/worker/observe/static/shell-chrome.js +1 -0
- package/dist/worker/observe/static/views/night.js +201 -0
- package/dist/worker/report/morning-report.js +56 -16
- package/dist/worker/run-task/execute-prepared-task.js +153 -0
- package/dist/worker/runner/single-task-attempt.js +147 -0
- package/dist/worker/scheduler/admission.js +538 -0
- package/dist/worker/scheduler/auto-followup.js +99 -0
- package/dist/worker/scheduler/cli.js +539 -0
- package/dist/worker/scheduler/dispatcher.js +503 -0
- package/dist/worker/scheduler/doctor.js +346 -0
- package/dist/worker/scheduler/evidence.js +170 -0
- package/dist/worker/scheduler/git-base.js +90 -0
- package/dist/worker/scheduler/index.js +23 -0
- package/dist/worker/scheduler/lease.js +114 -0
- package/dist/worker/scheduler/lifecycle.js +348 -0
- package/dist/worker/scheduler/lock.js +80 -0
- package/dist/worker/scheduler/morning-window.js +161 -0
- package/dist/worker/scheduler/night-git-finalizer.js +88 -0
- package/dist/worker/scheduler/night-harvest.js +412 -0
- package/dist/worker/scheduler/paths.js +84 -0
- package/dist/worker/scheduler/prepared-attempt-recovery.js +471 -0
- package/dist/worker/scheduler/recovery.js +277 -0
- package/dist/worker/scheduler/reservation.js +146 -0
- package/dist/worker/scheduler/retry.js +199 -0
- package/dist/worker/scheduler/scheduler-loop.js +272 -0
- package/dist/worker/scheduler/store.js +275 -0
- package/dist/worker/scheduler/traceability.js +54 -0
- package/dist/worker/scheduler/trigger.js +258 -0
- package/dist/worker/scheduler/types.js +369 -0
- package/dist/worker/scheduler/workspace-adapter.js +91 -0
- package/dist/workflows/dag/frontend-implementation-contract.js +2 -102
- package/docs/architecture/runtime-boundaries.md +9 -0
- package/docs/init-surface.manifest.json +9 -2
- package/docs/templates/harness.schema.json +107 -0
- package/docs/templates/init-managed-agents.md +18 -8
- package/harness.json +22 -0
- package/package.json +1 -1
- package/skills/loop-agent/SKILL.md +28 -36
- package/skills/loop-agent/references/command-reference.md +40 -16
- package/skills/loop-agent/references/hybrid-dag.md +1 -1
- package/dist/worker/console/static/assets/index-CNO7n6qB.js +0 -29
|
@@ -286,6 +286,38 @@ const OFFICIAL_ACTIONS = [
|
|
|
286
286
|
"read",
|
|
287
287
|
"model-callable",
|
|
288
288
|
],
|
|
289
|
+
// Night Scheduler (Phase 5) — read surfaces via official CLI coverage;
|
|
290
|
+
// mutations use dedicated capability entries below (mutation-gate).
|
|
291
|
+
[
|
|
292
|
+
"workerAdmissionShow",
|
|
293
|
+
"agent-worker admission show",
|
|
294
|
+
"read",
|
|
295
|
+
"model-callable",
|
|
296
|
+
],
|
|
297
|
+
[
|
|
298
|
+
"workerSchedulerList",
|
|
299
|
+
"agent-worker scheduler list",
|
|
300
|
+
"read",
|
|
301
|
+
"model-callable",
|
|
302
|
+
],
|
|
303
|
+
[
|
|
304
|
+
"workerSchedulerStatus",
|
|
305
|
+
"agent-worker scheduler status",
|
|
306
|
+
"read",
|
|
307
|
+
"model-callable",
|
|
308
|
+
],
|
|
309
|
+
[
|
|
310
|
+
"workerSchedulerLedger",
|
|
311
|
+
"agent-worker scheduler ledger",
|
|
312
|
+
"read",
|
|
313
|
+
"model-callable",
|
|
314
|
+
],
|
|
315
|
+
[
|
|
316
|
+
"workerSchedulerDoctor",
|
|
317
|
+
"agent-worker scheduler doctor",
|
|
318
|
+
"read",
|
|
319
|
+
"model-callable",
|
|
320
|
+
],
|
|
289
321
|
],
|
|
290
322
|
].map(([action, cli, kind, coverage]) => officialAction(action, cli, kind, coverage));
|
|
291
323
|
/** Shared constants so dag + dagSpecVersions cannot diverge. */
|
|
@@ -955,13 +987,13 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
955
987
|
resultSchemaVersion: 1,
|
|
956
988
|
envelopeSchemaVersion: 1,
|
|
957
989
|
requiredErrorCodes: ["INVALID_INPUT", "NOT_FOUND"],
|
|
958
|
-
description: "Prepare a one-shot Human Gate receipt for standaloneTaskRerun / workerTaskRetry. Model may prepare; only the browser mutation gate may consume.",
|
|
990
|
+
description: "Prepare a one-shot Human Gate receipt for standaloneTaskRerun / workerTaskRetry / Night Scheduler mutations. Model may prepare; only the browser mutation gate may consume.",
|
|
959
991
|
inputParams: [
|
|
960
992
|
{
|
|
961
993
|
name: "action",
|
|
962
994
|
type: "string",
|
|
963
995
|
required: true,
|
|
964
|
-
description: "target action: standaloneTaskRerun | workerTaskRetry",
|
|
996
|
+
description: "target action: standaloneTaskRerun | workerTaskRetry | workerAdmissionPrepare | workerSchedulerAdd | workerSchedulerCancel | workerSchedulerHarvest | workerSchedulerDiscard",
|
|
965
997
|
},
|
|
966
998
|
{
|
|
967
999
|
name: "actionParams",
|
|
@@ -973,6 +1005,234 @@ export function buildOperatorCapabilitiesDocument() {
|
|
|
973
1005
|
modelCallable: "always",
|
|
974
1006
|
humanConfirmation: "none",
|
|
975
1007
|
},
|
|
1008
|
+
{
|
|
1009
|
+
action: "workerAdmissionPrepare",
|
|
1010
|
+
cli: 'agent-worker admission prepare --repo . --feature-dir <path> --task-id <id> --at "YYYY-MM-DD HH:mm" [--tz Asia/Shanghai] [--task-card <ref>]',
|
|
1011
|
+
kind: "long-running",
|
|
1012
|
+
inputSchemaVersion: 1,
|
|
1013
|
+
resultSchemaVersion: 1,
|
|
1014
|
+
envelopeSchemaVersion: 1,
|
|
1015
|
+
requiredErrorCodes: [
|
|
1016
|
+
...COMMON_MUTATION_ERRORS,
|
|
1017
|
+
"INVALID_INPUT",
|
|
1018
|
+
"HUMAN_CONFIRMATION_REQUIRED",
|
|
1019
|
+
],
|
|
1020
|
+
description: "Daytime Night Scheduler admission prepare: freeze worktree + DAG writeSet gate receipt (no execute).",
|
|
1021
|
+
inputParams: [
|
|
1022
|
+
{
|
|
1023
|
+
name: "featureDir",
|
|
1024
|
+
type: "string",
|
|
1025
|
+
required: true,
|
|
1026
|
+
description: "feature directory path",
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
name: "taskId",
|
|
1030
|
+
type: "string",
|
|
1031
|
+
required: true,
|
|
1032
|
+
description: "task id",
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
name: "at",
|
|
1036
|
+
type: "string",
|
|
1037
|
+
required: true,
|
|
1038
|
+
description: 'local execute time "YYYY-MM-DD HH:mm"',
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
name: "tz",
|
|
1042
|
+
type: "string",
|
|
1043
|
+
required: false,
|
|
1044
|
+
description: "IANA timezone (default Asia/Shanghai)",
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
name: "taskCard",
|
|
1048
|
+
type: "string",
|
|
1049
|
+
required: false,
|
|
1050
|
+
description: "company task card / work item ref",
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
name: "confirmationId",
|
|
1054
|
+
type: "string",
|
|
1055
|
+
required: true,
|
|
1056
|
+
description: "mutation-gate receipt id from prepareMutationGate",
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
name: "humanGateToken",
|
|
1060
|
+
type: "object",
|
|
1061
|
+
required: true,
|
|
1062
|
+
description: "server-signed human-gate token from prepareMutationGate",
|
|
1063
|
+
},
|
|
1064
|
+
],
|
|
1065
|
+
modelCallable: "prepare-only",
|
|
1066
|
+
humanConfirmation: "required",
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
action: "workerSchedulerAdd",
|
|
1070
|
+
cli: "agent-worker scheduler add <schedule-id> --repo . --approve-gate <token>",
|
|
1071
|
+
kind: "mutation",
|
|
1072
|
+
inputSchemaVersion: 1,
|
|
1073
|
+
resultSchemaVersion: 1,
|
|
1074
|
+
envelopeSchemaVersion: 1,
|
|
1075
|
+
requiredErrorCodes: [
|
|
1076
|
+
...COMMON_MUTATION_ERRORS,
|
|
1077
|
+
"INVALID_INPUT",
|
|
1078
|
+
"HUMAN_CONFIRMATION_REQUIRED",
|
|
1079
|
+
],
|
|
1080
|
+
description: "Approve frozen night admission gate and reserve Task Pool Queued (no DAG execute).",
|
|
1081
|
+
inputParams: [
|
|
1082
|
+
{
|
|
1083
|
+
name: "scheduleId",
|
|
1084
|
+
type: "string",
|
|
1085
|
+
required: true,
|
|
1086
|
+
description: "schedule id",
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
name: "approveGate",
|
|
1090
|
+
type: "string",
|
|
1091
|
+
required: true,
|
|
1092
|
+
description: "gate token from admission prepare review packet",
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
name: "confirmationId",
|
|
1096
|
+
type: "string",
|
|
1097
|
+
required: true,
|
|
1098
|
+
description: "mutation-gate receipt id from prepareMutationGate",
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
name: "humanGateToken",
|
|
1102
|
+
type: "object",
|
|
1103
|
+
required: true,
|
|
1104
|
+
description: "server-signed human-gate token from prepareMutationGate",
|
|
1105
|
+
},
|
|
1106
|
+
],
|
|
1107
|
+
modelCallable: "prepare-only",
|
|
1108
|
+
humanConfirmation: "required",
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
action: "workerSchedulerCancel",
|
|
1112
|
+
cli: "agent-worker scheduler cancel <schedule-id> --repo . [--reason <text>]",
|
|
1113
|
+
kind: "mutation",
|
|
1114
|
+
inputSchemaVersion: 1,
|
|
1115
|
+
resultSchemaVersion: 1,
|
|
1116
|
+
envelopeSchemaVersion: 1,
|
|
1117
|
+
requiredErrorCodes: [
|
|
1118
|
+
...COMMON_MUTATION_ERRORS,
|
|
1119
|
+
"INVALID_INPUT",
|
|
1120
|
+
"HUMAN_CONFIRMATION_REQUIRED",
|
|
1121
|
+
],
|
|
1122
|
+
description: "Cancel a non-dispatched night schedule and release Task Pool Queued reservation when bound.",
|
|
1123
|
+
inputParams: [
|
|
1124
|
+
{
|
|
1125
|
+
name: "scheduleId",
|
|
1126
|
+
type: "string",
|
|
1127
|
+
required: true,
|
|
1128
|
+
description: "schedule id",
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
name: "reason",
|
|
1132
|
+
type: "string",
|
|
1133
|
+
required: false,
|
|
1134
|
+
description: "cancel reason",
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: "confirmationId",
|
|
1138
|
+
type: "string",
|
|
1139
|
+
required: true,
|
|
1140
|
+
description: "mutation-gate receipt id from prepareMutationGate",
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
name: "humanGateToken",
|
|
1144
|
+
type: "object",
|
|
1145
|
+
required: true,
|
|
1146
|
+
description: "server-signed human-gate token from prepareMutationGate",
|
|
1147
|
+
},
|
|
1148
|
+
],
|
|
1149
|
+
modelCallable: "prepare-only",
|
|
1150
|
+
humanConfirmation: "required",
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
action: "workerSchedulerHarvest",
|
|
1154
|
+
cli: "agent-worker scheduler harvest <schedule-id> --repo .",
|
|
1155
|
+
kind: "mutation",
|
|
1156
|
+
inputSchemaVersion: 1,
|
|
1157
|
+
resultSchemaVersion: 1,
|
|
1158
|
+
envelopeSchemaVersion: 1,
|
|
1159
|
+
requiredErrorCodes: [
|
|
1160
|
+
...COMMON_MUTATION_ERRORS,
|
|
1161
|
+
"INVALID_INPUT",
|
|
1162
|
+
"HUMAN_CONFIRMATION_REQUIRED",
|
|
1163
|
+
],
|
|
1164
|
+
description: "Morning harvest of a succeeded night branch via exact-base fast-forward only.",
|
|
1165
|
+
inputParams: [
|
|
1166
|
+
{
|
|
1167
|
+
name: "scheduleId",
|
|
1168
|
+
type: "string",
|
|
1169
|
+
required: true,
|
|
1170
|
+
description: "schedule id",
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
name: "confirmationId",
|
|
1174
|
+
type: "string",
|
|
1175
|
+
required: true,
|
|
1176
|
+
description: "mutation-gate receipt id from prepareMutationGate",
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
name: "humanGateToken",
|
|
1180
|
+
type: "object",
|
|
1181
|
+
required: true,
|
|
1182
|
+
description: "server-signed human-gate token from prepareMutationGate",
|
|
1183
|
+
},
|
|
1184
|
+
],
|
|
1185
|
+
modelCallable: "prepare-only",
|
|
1186
|
+
humanConfirmation: "required",
|
|
1187
|
+
},
|
|
1188
|
+
{
|
|
1189
|
+
action: "workerSchedulerDiscard",
|
|
1190
|
+
cli: 'agent-worker scheduler discard <schedule-id> --repo . --reason "..." [--force]',
|
|
1191
|
+
kind: "mutation",
|
|
1192
|
+
inputSchemaVersion: 1,
|
|
1193
|
+
resultSchemaVersion: 1,
|
|
1194
|
+
envelopeSchemaVersion: 1,
|
|
1195
|
+
requiredErrorCodes: [
|
|
1196
|
+
...COMMON_MUTATION_ERRORS,
|
|
1197
|
+
"INVALID_INPUT",
|
|
1198
|
+
"HUMAN_CONFIRMATION_REQUIRED",
|
|
1199
|
+
],
|
|
1200
|
+
description: "Discard night worktree/branch after retaining evidence; --force required for failed/human_required.",
|
|
1201
|
+
inputParams: [
|
|
1202
|
+
{
|
|
1203
|
+
name: "scheduleId",
|
|
1204
|
+
type: "string",
|
|
1205
|
+
required: true,
|
|
1206
|
+
description: "schedule id",
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
name: "reason",
|
|
1210
|
+
type: "string",
|
|
1211
|
+
required: true,
|
|
1212
|
+
description: "discard reason",
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
name: "force",
|
|
1216
|
+
type: "boolean",
|
|
1217
|
+
required: false,
|
|
1218
|
+
description: "force discard for failed/human_required",
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
name: "confirmationId",
|
|
1222
|
+
type: "string",
|
|
1223
|
+
required: true,
|
|
1224
|
+
description: "mutation-gate receipt id from prepareMutationGate",
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
name: "humanGateToken",
|
|
1228
|
+
type: "object",
|
|
1229
|
+
required: true,
|
|
1230
|
+
description: "server-signed human-gate token from prepareMutationGate",
|
|
1231
|
+
},
|
|
1232
|
+
],
|
|
1233
|
+
modelCallable: "prepare-only",
|
|
1234
|
+
humanConfirmation: "required",
|
|
1235
|
+
},
|
|
976
1236
|
{
|
|
977
1237
|
action: "standaloneTaskRerun",
|
|
978
1238
|
cli: "loop-agent dag rerun-task --run-id <id> --reason <text> --request-id <id> [--profile auto] [--task-id <id>] --json",
|
|
@@ -1216,6 +1476,13 @@ export const OPERATOR_COMMAND_COVERAGE = Object.freeze([
|
|
|
1216
1476
|
source: "loop-agent",
|
|
1217
1477
|
exclusionReason: "Not exposed to Operator Chat in M5.",
|
|
1218
1478
|
},
|
|
1479
|
+
{
|
|
1480
|
+
command: "loop-agent init upgrade",
|
|
1481
|
+
coverage: "excluded",
|
|
1482
|
+
action: null,
|
|
1483
|
+
source: "loop-agent",
|
|
1484
|
+
exclusionReason: "Not exposed to Operator Chat in M5.",
|
|
1485
|
+
},
|
|
1219
1486
|
{
|
|
1220
1487
|
command: "loop-agent examples list",
|
|
1221
1488
|
coverage: "excluded",
|
|
@@ -1841,6 +2108,87 @@ export const OPERATOR_COMMAND_COVERAGE = Object.freeze([
|
|
|
1841
2108
|
action: "workerReportMetrics",
|
|
1842
2109
|
source: "agent-worker",
|
|
1843
2110
|
},
|
|
2111
|
+
{
|
|
2112
|
+
command: "agent-worker admission prepare",
|
|
2113
|
+
coverage: "human-gated-required",
|
|
2114
|
+
action: "workerAdmissionPrepare",
|
|
2115
|
+
source: "agent-worker",
|
|
2116
|
+
},
|
|
2117
|
+
{
|
|
2118
|
+
command: "agent-worker admission show",
|
|
2119
|
+
coverage: "model-callable",
|
|
2120
|
+
action: "workerAdmissionShow",
|
|
2121
|
+
source: "agent-worker",
|
|
2122
|
+
},
|
|
2123
|
+
{
|
|
2124
|
+
command: "agent-worker scheduler list",
|
|
2125
|
+
coverage: "model-callable",
|
|
2126
|
+
action: "workerSchedulerList",
|
|
2127
|
+
source: "agent-worker",
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
command: "agent-worker scheduler status",
|
|
2131
|
+
coverage: "model-callable",
|
|
2132
|
+
action: "workerSchedulerStatus",
|
|
2133
|
+
source: "agent-worker",
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
command: "agent-worker scheduler ledger",
|
|
2137
|
+
coverage: "model-callable",
|
|
2138
|
+
action: "workerSchedulerLedger",
|
|
2139
|
+
source: "agent-worker",
|
|
2140
|
+
},
|
|
2141
|
+
{
|
|
2142
|
+
command: "agent-worker scheduler doctor",
|
|
2143
|
+
coverage: "model-callable",
|
|
2144
|
+
action: "workerSchedulerDoctor",
|
|
2145
|
+
source: "agent-worker",
|
|
2146
|
+
},
|
|
2147
|
+
{
|
|
2148
|
+
command: "agent-worker scheduler add",
|
|
2149
|
+
coverage: "human-gated-required",
|
|
2150
|
+
action: "workerSchedulerAdd",
|
|
2151
|
+
source: "agent-worker",
|
|
2152
|
+
},
|
|
2153
|
+
{
|
|
2154
|
+
command: "agent-worker scheduler cancel",
|
|
2155
|
+
coverage: "human-gated-required",
|
|
2156
|
+
action: "workerSchedulerCancel",
|
|
2157
|
+
source: "agent-worker",
|
|
2158
|
+
},
|
|
2159
|
+
{
|
|
2160
|
+
command: "agent-worker scheduler harvest",
|
|
2161
|
+
coverage: "human-gated-required",
|
|
2162
|
+
action: "workerSchedulerHarvest",
|
|
2163
|
+
source: "agent-worker",
|
|
2164
|
+
},
|
|
2165
|
+
{
|
|
2166
|
+
command: "agent-worker scheduler discard",
|
|
2167
|
+
coverage: "human-gated-required",
|
|
2168
|
+
action: "workerSchedulerDiscard",
|
|
2169
|
+
source: "agent-worker",
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
command: "agent-worker scheduler tick",
|
|
2173
|
+
coverage: "excluded",
|
|
2174
|
+
action: null,
|
|
2175
|
+
source: "agent-worker",
|
|
2176
|
+
exclusionReason: "Daemon/clock path; not exposed to Operator Chat (use CLI/cron).",
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
command: "agent-worker scheduler submit",
|
|
2180
|
+
coverage: "excluded",
|
|
2181
|
+
action: null,
|
|
2182
|
+
source: "agent-worker",
|
|
2183
|
+
exclusionReason: "Low-level planning fact; use admission prepare.",
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
command: "agent-worker scheduler transition",
|
|
2187
|
+
coverage: "excluded",
|
|
2188
|
+
action: null,
|
|
2189
|
+
source: "agent-worker",
|
|
2190
|
+
exclusionReason: "Internal lifecycle mutation; not Operator-facing.",
|
|
2191
|
+
},
|
|
1844
2192
|
{
|
|
1845
2193
|
command: "agent-worker observe serve",
|
|
1846
2194
|
coverage: "excluded",
|