@akagilnc/pi-workflow-roles 0.1.5241 → 0.1.5252
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/README.zh-CN.md +2 -3
- package/dist/acp-host/production-host.js +482 -3141
- package/dist/collector-config.js +0 -1
- package/dist/headless-host/production-host.js +590 -3249
- package/dist/migrate-book-topology.js +40 -107
- package/dist/navigator-invocation-identity.js +0 -57
- package/dist/package-contracts/collector-output.js +1 -90
- package/dist/package-contracts/terminating-tools.js +2 -2
- package/dist/packaged-role-registry.js +8 -11
- package/dist/public-cli/invocation.js +2 -22
- package/dist/public-cli/main.js +256 -749
- package/dist/public-cli/option-definitions.js +4 -19
- package/dist/public-cli/settlement.js +12 -138
- package/package.json +1 -1
- package/resources/collector-bot-handbook.md +4 -2
- package/src/collector-config.ts +0 -1
- package/src/collector-role.ts +40 -535
- package/src/collector-tool-schemas.ts +7 -117
- package/src/gh-api-runner.ts +102 -0
- package/src/navigator-invocation-identity.ts +4 -121
- package/src/package-contracts/collector-output.ts +15 -174
- package/src/package-contracts/terminating-tools.ts +0 -2
- package/src/packaged-role-registry.ts +7 -10
- package/src/public-cli/invocation.ts +3 -27
- package/src/public-cli/option-definitions.ts +4 -19
- package/src/public-cli/settlement.ts +11 -177
- package/src/role-runtime-dependencies.ts +0 -4
- package/src/role-runtime.ts +39 -103
- package/src/ticket-snapshot.ts +1 -1
- package/dist/collector-evidence.js +0 -319
- package/dist/collector-github.js +0 -725
- package/dist/collector-identity.js +0 -92
- package/dist/collector-ledger.js +0 -888
- package/dist/collector-target.js +0 -169
- package/src/collector-evidence.ts +0 -466
- package/src/collector-github.ts +0 -1032
- package/src/collector-handbook.ts +0 -194
- package/src/collector-identity.ts +0 -151
- package/src/collector-ledger.ts +0 -1186
- package/src/collector-target.ts +0 -207
|
@@ -8080,72 +8080,6 @@ var init_collector_output = __esm({
|
|
|
8080
8080
|
}
|
|
8081
8081
|
});
|
|
8082
8082
|
|
|
8083
|
-
// src/collector-evidence.ts
|
|
8084
|
-
var COLLECTOR_DEFAULT_WAIT_WINDOW_MS;
|
|
8085
|
-
var init_collector_evidence = __esm({
|
|
8086
|
-
"src/collector-evidence.ts"() {
|
|
8087
|
-
"use strict";
|
|
8088
|
-
COLLECTOR_DEFAULT_WAIT_WINDOW_MS = 10 * 60 * 1e3;
|
|
8089
|
-
}
|
|
8090
|
-
});
|
|
8091
|
-
|
|
8092
|
-
// src/collector-github.ts
|
|
8093
|
-
var init_collector_github = __esm({
|
|
8094
|
-
"src/collector-github.ts"() {
|
|
8095
|
-
"use strict";
|
|
8096
|
-
init_collector_config();
|
|
8097
|
-
}
|
|
8098
|
-
});
|
|
8099
|
-
|
|
8100
|
-
// src/readable-gate-item.ts
|
|
8101
|
-
var init_readable_gate_item = __esm({
|
|
8102
|
-
"src/readable-gate-item.ts"() {
|
|
8103
|
-
"use strict";
|
|
8104
|
-
}
|
|
8105
|
-
});
|
|
8106
|
-
|
|
8107
|
-
// src/submission-errors.ts
|
|
8108
|
-
var init_submission_errors = __esm({
|
|
8109
|
-
"src/submission-errors.ts"() {
|
|
8110
|
-
"use strict";
|
|
8111
|
-
init_readable_gate_item();
|
|
8112
|
-
}
|
|
8113
|
-
});
|
|
8114
|
-
|
|
8115
|
-
// src/submission-correctable-error.ts
|
|
8116
|
-
var correctableSubmissionErrorBrand, CorrectableSubmissionError;
|
|
8117
|
-
var init_submission_correctable_error = __esm({
|
|
8118
|
-
"src/submission-correctable-error.ts"() {
|
|
8119
|
-
"use strict";
|
|
8120
|
-
init_submission_errors();
|
|
8121
|
-
correctableSubmissionErrorBrand = /* @__PURE__ */ Symbol("ak-roles.correctable-submission-error");
|
|
8122
|
-
CorrectableSubmissionError = class extends Error {
|
|
8123
|
-
[correctableSubmissionErrorBrand] = true;
|
|
8124
|
-
};
|
|
8125
|
-
}
|
|
8126
|
-
});
|
|
8127
|
-
|
|
8128
|
-
// src/collector-identity.ts
|
|
8129
|
-
var init_collector_identity = __esm({
|
|
8130
|
-
"src/collector-identity.ts"() {
|
|
8131
|
-
"use strict";
|
|
8132
|
-
init_submission_correctable_error();
|
|
8133
|
-
}
|
|
8134
|
-
});
|
|
8135
|
-
|
|
8136
|
-
// src/collector-ledger.ts
|
|
8137
|
-
var COLLECTOR_WAIT_TOOL;
|
|
8138
|
-
var init_collector_ledger = __esm({
|
|
8139
|
-
"src/collector-ledger.ts"() {
|
|
8140
|
-
"use strict";
|
|
8141
|
-
init_collector_evidence();
|
|
8142
|
-
init_collector_github();
|
|
8143
|
-
init_collector_identity();
|
|
8144
|
-
init_collector_output();
|
|
8145
|
-
COLLECTOR_WAIT_TOOL = "ak_collector_wait";
|
|
8146
|
-
}
|
|
8147
|
-
});
|
|
8148
|
-
|
|
8149
8083
|
// src/open-tool-schema.ts
|
|
8150
8084
|
function described(name, schema) {
|
|
8151
8085
|
if (typeof schema.description === "string") return schema;
|
|
@@ -13968,7 +13902,6 @@ var init_packaged_role_registry = __esm({
|
|
|
13968
13902
|
"src/packaged-role-registry.ts"() {
|
|
13969
13903
|
"use strict";
|
|
13970
13904
|
init_collector_output();
|
|
13971
|
-
init_collector_ledger();
|
|
13972
13905
|
init_gatekeeper_output();
|
|
13973
13906
|
init_navigator_output();
|
|
13974
13907
|
init_judge_output();
|
|
@@ -14164,23 +14097,18 @@ var init_packaged_role_registry = __esm({
|
|
|
14164
14097
|
]
|
|
14165
14098
|
},
|
|
14166
14099
|
// ak-collector-repo is GitHub owner/repo identity, not a local material path (#438).
|
|
14100
|
+
// #1088: seat + request-manifest kept; code no longer collects — LLM uses host CLI.
|
|
14167
14101
|
{
|
|
14168
14102
|
role: "collector",
|
|
14169
14103
|
inCallAutoResume: false,
|
|
14170
14104
|
presentSettled: "always",
|
|
14171
14105
|
summonResume: false,
|
|
14172
14106
|
admission: "collect-target",
|
|
14173
|
-
/** Public no_receipt projects a durable bind-target rejection. */
|
|
14174
|
-
projectTargetBindRejection: true,
|
|
14175
14107
|
sameParent: "none",
|
|
14176
14108
|
phases: [null],
|
|
14177
14109
|
bareCommand: false,
|
|
14178
14110
|
outputTool: COLLECTOR_OUTPUT_TOOL,
|
|
14179
|
-
settlement: "
|
|
14180
|
-
/** #633: a prior wait-tool residual must not mask this attempt. */
|
|
14181
|
-
residualScan: "current-attempt",
|
|
14182
|
-
residualTool: COLLECTOR_WAIT_TOOL,
|
|
14183
|
-
runnerFailure: "collector-known-first",
|
|
14111
|
+
settlement: "sealed",
|
|
14184
14112
|
artifactFace: {
|
|
14185
14113
|
evidenceRole: true,
|
|
14186
14114
|
leaves: [
|
|
@@ -14195,11 +14123,14 @@ var init_packaged_role_registry = __esm({
|
|
|
14195
14123
|
activationFlags: [
|
|
14196
14124
|
{ field: "repo", from: "repository.display", flag: "ak-collector-repo" },
|
|
14197
14125
|
{ field: "pr", from: "prNumber", text: true, flag: "ak-collector-pr" },
|
|
14198
|
-
{ field: "requestManifestPath", flag: "ak-collector-request-manifest" }
|
|
14199
|
-
{ field: "waitMs", from: "waitWindowMs", text: true, flag: "ak-collector-wait-ms" }
|
|
14126
|
+
{ field: "requestManifestPath", flag: "ak-collector-request-manifest" }
|
|
14200
14127
|
],
|
|
14201
14128
|
activationStage: "load-and-install",
|
|
14202
|
-
sessionMaterials: [
|
|
14129
|
+
sessionMaterials: [
|
|
14130
|
+
"CLAUDE.md",
|
|
14131
|
+
"souls/collector.md",
|
|
14132
|
+
"resources/collector-bot-handbook.md"
|
|
14133
|
+
]
|
|
14203
14134
|
},
|
|
14204
14135
|
{
|
|
14205
14136
|
role: "doctor",
|
|
@@ -14493,6 +14424,21 @@ var init_packaged_role_registry = __esm({
|
|
|
14493
14424
|
}
|
|
14494
14425
|
});
|
|
14495
14426
|
|
|
14427
|
+
// src/readable-gate-item.ts
|
|
14428
|
+
var init_readable_gate_item = __esm({
|
|
14429
|
+
"src/readable-gate-item.ts"() {
|
|
14430
|
+
"use strict";
|
|
14431
|
+
}
|
|
14432
|
+
});
|
|
14433
|
+
|
|
14434
|
+
// src/submission-errors.ts
|
|
14435
|
+
var init_submission_errors = __esm({
|
|
14436
|
+
"src/submission-errors.ts"() {
|
|
14437
|
+
"use strict";
|
|
14438
|
+
init_readable_gate_item();
|
|
14439
|
+
}
|
|
14440
|
+
});
|
|
14441
|
+
|
|
14496
14442
|
// src/run-terminal-artifacts.ts
|
|
14497
14443
|
var init_run_terminal_artifacts = __esm({
|
|
14498
14444
|
"src/run-terminal-artifacts.ts"() {
|
|
@@ -14902,6 +14848,19 @@ var init_sha256 = __esm({
|
|
|
14902
14848
|
}
|
|
14903
14849
|
});
|
|
14904
14850
|
|
|
14851
|
+
// src/submission-correctable-error.ts
|
|
14852
|
+
var correctableSubmissionErrorBrand, CorrectableSubmissionError;
|
|
14853
|
+
var init_submission_correctable_error = __esm({
|
|
14854
|
+
"src/submission-correctable-error.ts"() {
|
|
14855
|
+
"use strict";
|
|
14856
|
+
init_submission_errors();
|
|
14857
|
+
correctableSubmissionErrorBrand = /* @__PURE__ */ Symbol("ak-roles.correctable-submission-error");
|
|
14858
|
+
CorrectableSubmissionError = class extends Error {
|
|
14859
|
+
[correctableSubmissionErrorBrand] = true;
|
|
14860
|
+
};
|
|
14861
|
+
}
|
|
14862
|
+
});
|
|
14863
|
+
|
|
14905
14864
|
// src/package-contracts/terminating-tools.ts
|
|
14906
14865
|
var TERMINATING_TOOL_NAMES;
|
|
14907
14866
|
var init_terminating_tools = __esm({
|
|
@@ -14947,16 +14906,6 @@ var init_github_remote = __esm({
|
|
|
14947
14906
|
}
|
|
14948
14907
|
});
|
|
14949
14908
|
|
|
14950
|
-
// src/collector-target.ts
|
|
14951
|
-
var init_collector_target = __esm({
|
|
14952
|
-
"src/collector-target.ts"() {
|
|
14953
|
-
"use strict";
|
|
14954
|
-
init_collector_github();
|
|
14955
|
-
init_cli_errors();
|
|
14956
|
-
init_github_remote();
|
|
14957
|
-
}
|
|
14958
|
-
});
|
|
14959
|
-
|
|
14960
14909
|
// src/git-object-id.ts
|
|
14961
14910
|
var init_git_object_id = __esm({
|
|
14962
14911
|
"src/git-object-id.ts"() {
|
|
@@ -15343,13 +15292,12 @@ var init_option_definitions = __esm({
|
|
|
15343
15292
|
canonical: "--pr",
|
|
15344
15293
|
aliases: [],
|
|
15345
15294
|
valueMetavar: "number",
|
|
15346
|
-
// #676 D1: optional when context uniquely determines the PR; ambiguous → require explicit.
|
|
15347
15295
|
required: false,
|
|
15348
15296
|
repeatable: false,
|
|
15349
15297
|
form: "option",
|
|
15350
15298
|
description: {
|
|
15351
|
-
en: "Positive GitHub pull request number. Optional when
|
|
15352
|
-
zh: "\u6B63\u6574\u6570 GitHub PR \u53F7\u3002\
|
|
15299
|
+
en: "Positive GitHub pull request number. Optional when the Collector role locates the PR via host CLI from task materials.",
|
|
15300
|
+
zh: "\u6B63\u6574\u6570 GitHub PR \u53F7\u3002\u53EF\u9009\uFF1B\u7701\u7565\u65F6\u7531\u901A\u8FDB\u53F8\u7ECF\u5BBF\u4E3B CLI \u4ECE\u4EFB\u52A1\u6750\u6599\u81EA\u884C\u5B9A\u4F4D\u3002"
|
|
15353
15301
|
}
|
|
15354
15302
|
},
|
|
15355
15303
|
{
|
|
@@ -15376,22 +15324,8 @@ var init_option_definitions = __esm({
|
|
|
15376
15324
|
repeatable: false,
|
|
15377
15325
|
form: "option",
|
|
15378
15326
|
description: {
|
|
15379
|
-
en: "Optional request manifest JSON path ({requests:[{id,body}]}).
|
|
15380
|
-
zh: "\u53EF\u9009 request manifest JSON \u8DEF\u5F84\uFF08{requests:[{id,body}]}\uFF09\u3002\
|
|
15381
|
-
}
|
|
15382
|
-
},
|
|
15383
|
-
{
|
|
15384
|
-
id: "wait-ms",
|
|
15385
|
-
owner: "collector",
|
|
15386
|
-
canonical: "--wait-ms",
|
|
15387
|
-
aliases: [],
|
|
15388
|
-
valueMetavar: "ms",
|
|
15389
|
-
required: false,
|
|
15390
|
-
repeatable: false,
|
|
15391
|
-
form: "option",
|
|
15392
|
-
description: {
|
|
15393
|
-
en: "Wait-window duration in milliseconds after the work step opens (default 600000 = 10 minutes). Does not require a code change to adjust.",
|
|
15394
|
-
zh: "\u5DE5\u4F5C\u6B65\u9AA4\u5F00\u542F\u540E\u7684\u7B49\u5F85\u7A97\u65F6\u957F\uFF08\u6BEB\u79D2\uFF1B\u9ED8\u8BA4 600000\uFF1D\u5341\u5206\u949F\uFF09\u3002\u6539\u914D\u7F6E\u5373\u53EF\uFF0C\u65E0\u9700\u6539\u4EE3\u7801\u3002"
|
|
15327
|
+
en: "Optional request manifest JSON path ({requests:[{id,body}]}). Parsed for semantics and passed to the Collector as materials \u2014 not a machine collection directive.",
|
|
15328
|
+
zh: "\u53EF\u9009 request manifest JSON \u8DEF\u5F84\uFF08{requests:[{id,body}]}\uFF09\u3002\u6309\u8BED\u4E49\u89E3\u6790\u540E\u4F5C\u4E3A\u6750\u6599\u9012\u7ED9\u901A\u8FDB\u53F8\uFF0C\u4E0D\u662F\u673A\u5668\u4EE3\u6536 finding \u7684\u6307\u4EE4\u3002"
|
|
15395
15329
|
}
|
|
15396
15330
|
}
|
|
15397
15331
|
];
|
|
@@ -15858,7 +15792,6 @@ var init_invocation = __esm({
|
|
|
15858
15792
|
init_doctor_evidence();
|
|
15859
15793
|
init_diarist_contracts();
|
|
15860
15794
|
init_collector_config();
|
|
15861
|
-
init_collector_target();
|
|
15862
15795
|
init_github_remote();
|
|
15863
15796
|
init_fixer_packet();
|
|
15864
15797
|
init_merger_git_state();
|
|
@@ -146,47 +146,6 @@ function findLatestDurablePackagedRoleTerminal(entries) {
|
|
|
146
146
|
}
|
|
147
147
|
return void 0;
|
|
148
148
|
}
|
|
149
|
-
function bindCurrentDurableTerminalToMarker(entries) {
|
|
150
|
-
const terminal = findLatestDurablePackagedRoleTerminal(entries);
|
|
151
|
-
if (terminal === void 0) return { kind: "absent" };
|
|
152
|
-
let markerIndex = -1;
|
|
153
|
-
for (let i = terminal.index - 1; i >= 0; i -= 1) {
|
|
154
|
-
if (isInvocationMarkerEntry(entries[i])) {
|
|
155
|
-
markerIndex = i;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if (markerIndex < 0) {
|
|
160
|
-
return { kind: "unbound", terminal };
|
|
161
|
-
}
|
|
162
|
-
const marker = parseInvocationMarkerIdentity(entries[markerIndex]?.data);
|
|
163
|
-
if (marker === void 0) {
|
|
164
|
-
return { kind: "unbound", terminal };
|
|
165
|
-
}
|
|
166
|
-
let windowEnd = entries.length;
|
|
167
|
-
for (let i = markerIndex + 1; i < entries.length; i += 1) {
|
|
168
|
-
if (isInvocationMarkerEntry(entries[i])) {
|
|
169
|
-
windowEnd = i;
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
let durableCount = 0;
|
|
174
|
-
for (let i = markerIndex + 1; i < windowEnd; i += 1) {
|
|
175
|
-
if (durableTerminalAt(entries, i) !== void 0) durableCount += 1;
|
|
176
|
-
}
|
|
177
|
-
if (durableCount !== 1) return { kind: "ambiguous" };
|
|
178
|
-
if (terminal.index <= markerIndex || terminal.index >= windowEnd) {
|
|
179
|
-
return { kind: "ambiguous" };
|
|
180
|
-
}
|
|
181
|
-
return {
|
|
182
|
-
kind: "bound",
|
|
183
|
-
terminal,
|
|
184
|
-
marker: { ...marker, index: markerIndex }
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
function isReceiptSettlementBindingClear(entries) {
|
|
188
|
-
return bindCurrentDurableTerminalToMarker(entries).kind !== "ambiguous";
|
|
189
|
-
}
|
|
190
149
|
function resolveLifecycleInvocationPrincipal(entries, expected) {
|
|
191
150
|
const markerIndex = latestInvocationMarkerIndex(entries);
|
|
192
151
|
if (markerIndex < 0) {
|
|
@@ -206,35 +165,19 @@ function resolveLifecycleInvocationPrincipal(entries, expected) {
|
|
|
206
165
|
}
|
|
207
166
|
return { invocationId: marker.invocationId, resume: true };
|
|
208
167
|
}
|
|
209
|
-
function currentInvocationPrincipalFromSession(entries, beforeIndex = entries.length) {
|
|
210
|
-
return currentInvocationMarkerFromSession(entries, beforeIndex)?.invocationId;
|
|
211
|
-
}
|
|
212
|
-
function currentInvocationMarkerFromSession(entries, beforeIndex = entries.length) {
|
|
213
|
-
const limit = Math.min(Math.max(beforeIndex, 0), entries.length);
|
|
214
|
-
for (let i = limit - 1; i >= 0; i -= 1) {
|
|
215
|
-
const entry = entries[i];
|
|
216
|
-
if (!isInvocationMarkerEntry(entry)) continue;
|
|
217
|
-
return parseInvocationMarkerIdentity(entry?.data);
|
|
218
|
-
}
|
|
219
|
-
return void 0;
|
|
220
|
-
}
|
|
221
168
|
export {
|
|
222
169
|
NAVIGATOR_INFRASTRUCTURE_FAILURE_EVIDENCE_KEYS,
|
|
223
170
|
NAVIGATOR_INFRASTRUCTURE_FAILURE_KIND,
|
|
224
171
|
NAVIGATOR_INVOCATION_ENTRY,
|
|
225
172
|
NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY,
|
|
226
|
-
bindCurrentDurableTerminalToMarker,
|
|
227
173
|
buildNavigatorInfrastructureFailureFact,
|
|
228
174
|
classifyPackagedRoleTerminalResult,
|
|
229
|
-
currentInvocationMarkerFromSession,
|
|
230
|
-
currentInvocationPrincipalFromSession,
|
|
231
175
|
extractInfrastructureFailureEvidence,
|
|
232
176
|
findLatestDurablePackagedRoleTerminal,
|
|
233
177
|
hasNavigatorInfrastructureFailureBase,
|
|
234
178
|
isAcceptedPackagedRoleTerminalResult,
|
|
235
179
|
isDurablePackagedRoleTerminalResult,
|
|
236
180
|
isNavigatorInfrastructureFailureFact,
|
|
237
|
-
isReceiptSettlementBindingClear,
|
|
238
181
|
markerMatchesExpectedIdentity,
|
|
239
182
|
mintNavigatorInvocationId,
|
|
240
183
|
parseInvocationMarkerIdentity,
|
|
@@ -1,93 +1,4 @@
|
|
|
1
1
|
const COLLECTOR_OUTPUT_TOOL = "ak_collector_output";
|
|
2
|
-
const COLLECTOR_HOST = "github.com";
|
|
3
|
-
function safeGet(value, key) {
|
|
4
|
-
if (typeof value !== "object" && typeof value !== "function" || value === null) return void 0;
|
|
5
|
-
try {
|
|
6
|
-
return value[key];
|
|
7
|
-
} catch {
|
|
8
|
-
return void 0;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
function records(value) {
|
|
12
|
-
return Array.isArray(value) ? value.filter((item) => item !== null && typeof item === "object") : [];
|
|
13
|
-
}
|
|
14
|
-
function strings(value) {
|
|
15
|
-
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
16
|
-
}
|
|
17
|
-
function validateAcceptedCollectorReceipt(value) {
|
|
18
|
-
const rawGroups = safeGet(value, "groups");
|
|
19
|
-
if (!Array.isArray(rawGroups)) throw new Error("Collector receipt has no typed groups terminal discriminator");
|
|
20
|
-
const groups = records(rawGroups).map((group) => ({
|
|
21
|
-
identity: safeGet(group, "identity") ?? null,
|
|
22
|
-
...typeof safeGet(group, "displayLogin") === "string" ? { displayLogin: safeGet(group, "displayLogin") } : {},
|
|
23
|
-
attendance: true,
|
|
24
|
-
materials: records(safeGet(group, "materials")),
|
|
25
|
-
findings: records(safeGet(group, "findings"))
|
|
26
|
-
}));
|
|
27
|
-
const unfinishedRaw = safeGet(value, "unfinishedReasons");
|
|
28
|
-
const unfinishedReasons = strings(unfinishedRaw);
|
|
29
|
-
const submissionProjection = projectSubmissionProjection(safeGet(value, "submissionProjection"));
|
|
30
|
-
const prStateRaw = safeGet(value, "prState");
|
|
31
|
-
const prState = typeof prStateRaw === "string" ? prStateRaw : void 0;
|
|
32
|
-
return {
|
|
33
|
-
host: safeGet(value, "host"),
|
|
34
|
-
repository: safeGet(value, "repository"),
|
|
35
|
-
prNumber: safeGet(value, "prNumber"),
|
|
36
|
-
...prState === void 0 ? {} : { prState },
|
|
37
|
-
manifestDigest: safeGet(value, "manifestDigest"),
|
|
38
|
-
activationTime: safeGet(value, "activationTime"),
|
|
39
|
-
deadlineTime: safeGet(value, "deadlineTime"),
|
|
40
|
-
finalObservationTime: safeGet(value, "finalObservationTime"),
|
|
41
|
-
finalSnapshotId: safeGet(value, "finalSnapshotId"),
|
|
42
|
-
targetHead: safeGet(value, "targetHead"),
|
|
43
|
-
groups,
|
|
44
|
-
...unfinishedReasons.length > 0 ? { unfinishedReasons } : {},
|
|
45
|
-
...submissionProjection === void 0 ? {} : { submissionProjection },
|
|
46
|
-
requestAttempts: records(safeGet(value, "requestAttempts")),
|
|
47
|
-
snapshots: records(safeGet(value, "snapshots")).map((snapshot) => ({
|
|
48
|
-
snapshotId: safeGet(snapshot, "snapshotId"),
|
|
49
|
-
observedAt: safeGet(snapshot, "observedAt"),
|
|
50
|
-
completedAt: safeGet(snapshot, "completedAt"),
|
|
51
|
-
completedMono: safeGet(snapshot, "completedMono"),
|
|
52
|
-
host: safeGet(snapshot, "host"),
|
|
53
|
-
repository: safeGet(snapshot, "repository"),
|
|
54
|
-
prNumber: safeGet(snapshot, "prNumber"),
|
|
55
|
-
prState: safeGet(snapshot, "prState"),
|
|
56
|
-
headOid: safeGet(snapshot, "headOid"),
|
|
57
|
-
complete: safeGet(snapshot, "complete"),
|
|
58
|
-
evidenceIds: strings(safeGet(snapshot, "evidenceIds")),
|
|
59
|
-
pageDiagnostics: records(safeGet(snapshot, "pageDiagnostics")),
|
|
60
|
-
normalizedByteLength: safeGet(snapshot, "normalizedByteLength")
|
|
61
|
-
})),
|
|
62
|
-
evidenceRecords: records(safeGet(value, "evidenceRecords")).map((record) => ({ evidenceId: safeGet(record, "evidenceId"), kind: safeGet(record, "kind"), versionId: safeGet(record, "versionId"), contentDigest: safeGet(record, "contentDigest"), firstObservedAt: safeGet(record, "firstObservedAt"), githubId: safeGet(record, "githubId"), authorLogin: safeGet(record, "authorLogin"), htmlUrl: safeGet(record, "htmlUrl"), authoritativeTime: safeGet(record, "authoritativeTime") }))
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function projectSubmissionProjection(raw) {
|
|
66
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return void 0;
|
|
67
|
-
const p = raw;
|
|
68
|
-
const out = {};
|
|
69
|
-
if (p["findingsSource"] === "absent" || p["findingsSource"] === "array" || p["findingsSource"] === "unreadable") {
|
|
70
|
-
out.findingsSource = p["findingsSource"];
|
|
71
|
-
}
|
|
72
|
-
if (typeof p["findingsProjectedCount"] === "number") {
|
|
73
|
-
out.findingsProjectedCount = p["findingsProjectedCount"];
|
|
74
|
-
}
|
|
75
|
-
if (typeof p["findingsUnprojected"] === "boolean") {
|
|
76
|
-
out.findingsUnprojected = p["findingsUnprojected"];
|
|
77
|
-
}
|
|
78
|
-
if (p["unfinishedReasonsSource"] === "absent" || p["unfinishedReasonsSource"] === "array" || p["unfinishedReasonsSource"] === "unreadable") {
|
|
79
|
-
out.unfinishedReasonsSource = p["unfinishedReasonsSource"];
|
|
80
|
-
}
|
|
81
|
-
if (typeof p["unfinishedReasonsProjectedCount"] === "number") {
|
|
82
|
-
out.unfinishedReasonsProjectedCount = p["unfinishedReasonsProjectedCount"];
|
|
83
|
-
}
|
|
84
|
-
if (typeof p["unfinishedReasonsUnprojected"] === "boolean") {
|
|
85
|
-
out.unfinishedReasonsUnprojected = p["unfinishedReasonsUnprojected"];
|
|
86
|
-
}
|
|
87
|
-
return Object.keys(out).length > 0 ? out : void 0;
|
|
88
|
-
}
|
|
89
2
|
export {
|
|
90
|
-
|
|
91
|
-
COLLECTOR_OUTPUT_TOOL,
|
|
92
|
-
validateAcceptedCollectorReceipt
|
|
3
|
+
COLLECTOR_OUTPUT_TOOL
|
|
93
4
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Package-owned terminating tool registry.
|
|
3
3
|
* Package roles share these terminating leaves.
|
|
4
4
|
*/
|
|
5
|
-
import { COLLECTOR_OUTPUT_TOOL,
|
|
5
|
+
import { COLLECTOR_OUTPUT_TOOL, } from "./collector-output.js";
|
|
6
6
|
import { JUDGE_OUTPUT_TOOL_NAME, } from "./judge-output.js";
|
|
7
7
|
import { REVIEWER_OUTPUT_TOOL_NAME, validateReviewerIntent, } from "./reviewer-output.js";
|
|
8
8
|
import { LEGACY_REVIEW_OUTPUT_ROLES, PACKAGED_ROLE_REGISTRY } from "../packaged-role-registry.js";
|
|
@@ -19,7 +19,7 @@ import { INSPECTOR_OUTPUT_TOOL_NAME, validateRecordedInspectorOutput } from "../
|
|
|
19
19
|
import { DIARIST_OUTPUT_TOOL_NAME, validateRecordedDiaristOutput } from "../diarist-contracts.js";
|
|
20
20
|
import { SECRETARIAT_OUTPUT_TOOL_NAME } from "../secretariat-contracts.js";
|
|
21
21
|
import { CODER_OUTPUT_TOOL_NAME, FIXER_OUTPUT_TOOL_NAME, validateAcceptedWorkerDetails, } from "./worker-output.js";
|
|
22
|
-
export { CODER_OUTPUT_TOOL_NAME, COLLECTOR_OUTPUT_TOOL, FIXER_OUTPUT_TOOL_NAME, JUDGE_OUTPUT_TOOL_NAME, REVIEWER_OUTPUT_TOOL_NAME, MERGER_OUTPUT_TOOL_NAME,
|
|
22
|
+
export { CODER_OUTPUT_TOOL_NAME, COLLECTOR_OUTPUT_TOOL, FIXER_OUTPUT_TOOL_NAME, JUDGE_OUTPUT_TOOL_NAME, REVIEWER_OUTPUT_TOOL_NAME, MERGER_OUTPUT_TOOL_NAME, validateReviewerIntent, validateAcceptedWorkerDetails, validateDoctorSubmissionShape, validateRecordedDoctorOutput, validateMergerOutput, validateRecordedNotaryOutput, validateRecordedCountersignOutput, validateRecordedGleanerLeftOutput, validateRecordedInspectorOutput, validateRecordedGatekeeperOutput, validateRecordedNavigatorOutput, validateRecordedAuditorOutput, validateRecordedDiaristOutput, };
|
|
23
23
|
export const TERMINATING_TOOL_NAMES = [...new Set([
|
|
24
24
|
...PACKAGED_ROLE_REGISTRY.map((entry) => entry.outputTool),
|
|
25
25
|
...LEGACY_REVIEW_OUTPUT_ROLES.keys(),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { COLLECTOR_OUTPUT_TOOL } from "./package-contracts/collector-output.js";
|
|
2
|
-
import { COLLECTOR_WAIT_TOOL } from "./collector-ledger.js";
|
|
3
2
|
import { GATEKEEPER_OUTPUT_TOOL_NAME } from "./package-contracts/gatekeeper-output.js";
|
|
4
3
|
import { NAVIGATOR_OUTPUT_TOOL_NAME } from "./package-contracts/navigator-output.js";
|
|
5
4
|
import { JUDGE_OUTPUT_TOOL_NAME } from "./package-contracts/judge-output.js";
|
|
@@ -195,23 +194,18 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
195
194
|
]
|
|
196
195
|
},
|
|
197
196
|
// ak-collector-repo is GitHub owner/repo identity, not a local material path (#438).
|
|
197
|
+
// #1088: seat + request-manifest kept; code no longer collects — LLM uses host CLI.
|
|
198
198
|
{
|
|
199
199
|
role: "collector",
|
|
200
200
|
inCallAutoResume: false,
|
|
201
201
|
presentSettled: "always",
|
|
202
202
|
summonResume: false,
|
|
203
203
|
admission: "collect-target",
|
|
204
|
-
/** Public no_receipt projects a durable bind-target rejection. */
|
|
205
|
-
projectTargetBindRejection: true,
|
|
206
204
|
sameParent: "none",
|
|
207
205
|
phases: [null],
|
|
208
206
|
bareCommand: false,
|
|
209
207
|
outputTool: COLLECTOR_OUTPUT_TOOL,
|
|
210
|
-
settlement: "
|
|
211
|
-
/** #633: a prior wait-tool residual must not mask this attempt. */
|
|
212
|
-
residualScan: "current-attempt",
|
|
213
|
-
residualTool: COLLECTOR_WAIT_TOOL,
|
|
214
|
-
runnerFailure: "collector-known-first",
|
|
208
|
+
settlement: "sealed",
|
|
215
209
|
artifactFace: {
|
|
216
210
|
evidenceRole: true,
|
|
217
211
|
leaves: [
|
|
@@ -226,11 +220,14 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
226
220
|
activationFlags: [
|
|
227
221
|
{ field: "repo", from: "repository.display", flag: "ak-collector-repo" },
|
|
228
222
|
{ field: "pr", from: "prNumber", text: true, flag: "ak-collector-pr" },
|
|
229
|
-
{ field: "requestManifestPath", flag: "ak-collector-request-manifest" }
|
|
230
|
-
{ field: "waitMs", from: "waitWindowMs", text: true, flag: "ak-collector-wait-ms" }
|
|
223
|
+
{ field: "requestManifestPath", flag: "ak-collector-request-manifest" }
|
|
231
224
|
],
|
|
232
225
|
activationStage: "load-and-install",
|
|
233
|
-
sessionMaterials: [
|
|
226
|
+
sessionMaterials: [
|
|
227
|
+
"CLAUDE.md",
|
|
228
|
+
"souls/collector.md",
|
|
229
|
+
"resources/collector-bot-handbook.md"
|
|
230
|
+
]
|
|
234
231
|
},
|
|
235
232
|
{
|
|
236
233
|
role: "doctor",
|
|
@@ -16,7 +16,6 @@ import { rewriteRunDirectoryPathFields, rewriteRunDirectoryPathValue, } from "..
|
|
|
16
16
|
import { loadDoctorCase, } from "../doctor-evidence.js";
|
|
17
17
|
import { projectCourtTicketNumbers } from "../diarist-contracts.js";
|
|
18
18
|
import { emptyCollectorManifest, loadCollectorManifest, parseCollectorPrNumber, parseCollectorRepository, } from "../collector-config.js";
|
|
19
|
-
import { resolveCollectorTarget } from "../collector-target.js";
|
|
20
19
|
import { ownerRepoFromGitHubRemoteUrl } from "./github-remote.js";
|
|
21
20
|
import { FixerPacketValidationError, parseFixerPrerequisites, } from "../package-contracts/fixer-packet.js";
|
|
22
21
|
import { createProductionMergerGitState } from "../merger-git-state.js";
|
|
@@ -445,17 +444,6 @@ function assignPublicSeatOption(owner, taken, fields) {
|
|
|
445
444
|
case "request-manifest":
|
|
446
445
|
fields.requestManifestPath = requireOptionPath(taken.def.canonical, value);
|
|
447
446
|
return;
|
|
448
|
-
case "wait-ms": {
|
|
449
|
-
if (value === undefined || !/^[1-9]\d*$/.test(value.trim())) {
|
|
450
|
-
throw new CliUsageError("--wait-ms requires a positive safe-integer millisecond value");
|
|
451
|
-
}
|
|
452
|
-
const parsed = Number(value.trim());
|
|
453
|
-
if (!Number.isSafeInteger(parsed) || parsed < 1) {
|
|
454
|
-
throw new CliUsageError("--wait-ms requires a positive safe-integer millisecond value");
|
|
455
|
-
}
|
|
456
|
-
fields.waitWindowMs = parsed;
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
447
|
case "issue": {
|
|
460
448
|
if (value === undefined || value.trim() === "") {
|
|
461
449
|
throw new CliUsageError("doctor --issue requires a positive integer");
|
|
@@ -549,7 +537,6 @@ export function parsePublicSeatArgv(owner, args) {
|
|
|
549
537
|
...(fields.prNumber === undefined ? {} : { prNumber: fields.prNumber }),
|
|
550
538
|
...(fields.repo === undefined ? {} : { repo: fields.repo }),
|
|
551
539
|
...(fields.requestManifestPath === undefined ? {} : { requestManifestPath: fields.requestManifestPath }),
|
|
552
|
-
...(fields.waitWindowMs === undefined ? {} : { waitWindowMs: fields.waitWindowMs }),
|
|
553
540
|
...(fields.issueNumber === undefined ? {} : { issueNumber: fields.issueNumber }),
|
|
554
541
|
...(fields.runs === undefined ? {} : { runs: fields.runs }),
|
|
555
542
|
...(fields.sourceRun === undefined ? {} : { sourceRun: fields.sourceRun }),
|
|
@@ -935,24 +922,17 @@ export async function admitPublicRole(role, parsed, env, override) {
|
|
|
935
922
|
attachmentPaths,
|
|
936
923
|
...project,
|
|
937
924
|
placedFields: async (placed) => {
|
|
938
|
-
//
|
|
939
|
-
const target = await resolveCollectorTarget({
|
|
940
|
-
projectRoot,
|
|
941
|
-
repository,
|
|
942
|
-
...(explicitPrNumber === undefined ? {} : { explicitPrNumber }),
|
|
943
|
-
});
|
|
944
|
-
const prNumber = target.kind === "bound" ? target.prNumber : undefined;
|
|
925
|
+
// #1088: explicit --pr only. Unbound PR is located by the LLM via host CLI.
|
|
945
926
|
let requestManifestPath;
|
|
946
927
|
if (manifestCanonicalJson !== undefined) {
|
|
947
928
|
requestManifestPath = join(placed.runDirectory, "request-manifest.json");
|
|
948
929
|
await writeFile(requestManifestPath, manifestCanonicalJson, "utf8");
|
|
949
930
|
}
|
|
950
931
|
return {
|
|
951
|
-
...(
|
|
932
|
+
...(explicitPrNumber === undefined ? {} : { prNumber: explicitPrNumber }),
|
|
952
933
|
repository: repository.canonical,
|
|
953
934
|
repositoryDisplay: repository.display,
|
|
954
935
|
...(requestManifestPath === undefined ? {} : { requestManifestPath }),
|
|
955
|
-
...(parsed.waitWindowMs === undefined ? {} : { waitWindowMs: parsed.waitWindowMs }),
|
|
956
936
|
manifestDigest,
|
|
957
937
|
};
|
|
958
938
|
},
|