@akagilnc/pi-workflow-roles 0.1.5357 → 0.1.5365
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/acp-host/production-host.js +109 -223
- package/dist/doctor-contracts.js +22 -34
- package/dist/headless-host/production-host.js +109 -223
- package/dist/merger-contracts.js +11 -6
- package/dist/migrate-book-topology.js +54 -98
- package/dist/open-tool-schema.js +1 -25
- package/dist/package-contracts/fixer-output.js +21 -35
- package/dist/public-cli/main.js +63 -107
- package/package.json +1 -1
- package/src/diarist-role.ts +12 -49
- package/src/doctor-contracts.ts +38 -49
- package/src/gleaner-left-role.ts +10 -11
- package/src/merger-contracts.ts +19 -12
- package/src/open-tool-schema.ts +8 -32
- package/src/package-contracts/fixer-output.ts +49 -52
- package/src/reviewer-role.ts +16 -35
- package/src/secretariat-role.ts +16 -12
- package/src/worker-role.ts +14 -29
- package/src/worker-submission-gates.ts +14 -3
|
@@ -8010,29 +8010,6 @@ function described(name, schema) {
|
|
|
8010
8010
|
if (typeof schema.description === "string") return schema;
|
|
8011
8011
|
throw new Error(`Tool field ${name} has no semantic description at its schema owner`);
|
|
8012
8012
|
}
|
|
8013
|
-
function declarationIdentity(schema) {
|
|
8014
|
-
const { description: _description, ...semantic } = schema;
|
|
8015
|
-
return JSON.stringify(semantic);
|
|
8016
|
-
}
|
|
8017
|
-
function openToolObjectFromUnion(schema) {
|
|
8018
|
-
const declarations = /* @__PURE__ */ new Map();
|
|
8019
|
-
for (const variant of schema.anyOf) {
|
|
8020
|
-
for (const [name, declaration] of Object.entries(variant.properties ?? {})) {
|
|
8021
|
-
const entries = declarations.get(name) ?? [];
|
|
8022
|
-
const identity = declarationIdentity(declaration);
|
|
8023
|
-
if (!entries.some((entry) => declarationIdentity(entry) === identity)) entries.push(declaration);
|
|
8024
|
-
declarations.set(name, entries);
|
|
8025
|
-
}
|
|
8026
|
-
}
|
|
8027
|
-
const properties = Object.fromEntries([...declarations].map(([name, entries]) => {
|
|
8028
|
-
const descriptions = [...new Set(entries.map((entry) => entry.description).filter((value2) => typeof value2 === "string"))].join(" ");
|
|
8029
|
-
const declaration = entries.length === 1 ? entries[0] : typebox_exports.Union(entries, descriptions === "" ? {} : { description: descriptions });
|
|
8030
|
-
return [name, typebox_exports.Optional(described(name, declaration))];
|
|
8031
|
-
}));
|
|
8032
|
-
const object2 = typebox_exports.Object(properties, { additionalProperties: true });
|
|
8033
|
-
object2.required = [];
|
|
8034
|
-
return object2;
|
|
8035
|
-
}
|
|
8036
8013
|
function openToolObject(schema) {
|
|
8037
8014
|
const object2 = typebox_exports.Object(
|
|
8038
8015
|
Object.fromEntries(Object.entries(schema.properties).map(([name, declaration]) => [
|
|
@@ -8202,7 +8179,7 @@ var init_reviewer_output = __esm({
|
|
|
8202
8179
|
});
|
|
8203
8180
|
|
|
8204
8181
|
// src/package-contracts/fixer-output.ts
|
|
8205
|
-
var FIXER_OUTPUT_TOOL_NAME,
|
|
8182
|
+
var FIXER_OUTPUT_TOOL_NAME, PARTIALLY_COMPLETED_DEFINITION, FIXER_STATUS_DESCRIPTION, fixerOutputObject, fixerOutputSchema;
|
|
8206
8183
|
var init_fixer_output = __esm({
|
|
8207
8184
|
"src/package-contracts/fixer-output.ts"() {
|
|
8208
8185
|
"use strict";
|
|
@@ -8210,43 +8187,29 @@ var init_fixer_output = __esm({
|
|
|
8210
8187
|
init_open_tool_schema();
|
|
8211
8188
|
init_terminating_infrastructure();
|
|
8212
8189
|
FIXER_OUTPUT_TOOL_NAME = "ak_fixer_output";
|
|
8213
|
-
transportString = typebox_exports.String();
|
|
8214
|
-
authorityBlockerSchema = typebox_exports.Object({ cause: typebox_exports.Optional(typebox_exports.Literal("authority_violation")), evidence: typebox_exports.Optional(transportString) });
|
|
8215
|
-
prerequisiteBlockerSchema = typebox_exports.Object({ cause: typebox_exports.Optional(typebox_exports.Literal("prerequisite_unmet")), prerequisiteId: typebox_exports.Optional(transportString), evidence: typebox_exports.Optional(transportString) });
|
|
8216
|
-
blockerSchema = typebox_exports.Union([authorityBlockerSchema, prerequisiteBlockerSchema]);
|
|
8217
|
-
exceptionSchema = typebox_exports.Object({ where: typebox_exports.Optional(transportString), reason: typebox_exports.Optional(transportString) });
|
|
8218
|
-
testEvidenceSchema = typebox_exports.Object({
|
|
8219
|
-
contract: typebox_exports.Optional(typebox_exports.String({ description: "\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6" })),
|
|
8220
|
-
minimumNecessaryCost: typebox_exports.Optional(typebox_exports.String({ description: "\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C" })),
|
|
8221
|
-
measuredDuration: typebox_exports.Optional(typebox_exports.String({ description: "\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F" }))
|
|
8222
|
-
}, { description: "\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1Bdiff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u63D0\u4EA4\uFF1B\u673A\u5668\u4E0D\u6838\u9A8C\u3002" });
|
|
8223
|
-
completedClassResultSchema = typebox_exports.Object({
|
|
8224
|
-
name: typebox_exports.Optional(transportString),
|
|
8225
|
-
disposition: typebox_exports.Optional(typebox_exports.Literal("completed")),
|
|
8226
|
-
searchScope: typebox_exports.Optional(transportString),
|
|
8227
|
-
exceptions: typebox_exports.Optional(typebox_exports.Array(exceptionSchema)),
|
|
8228
|
-
commitSha: typebox_exports.Optional(transportString)
|
|
8229
|
-
});
|
|
8230
|
-
refusedClassResultSchema = typebox_exports.Object({
|
|
8231
|
-
name: typebox_exports.Optional(transportString),
|
|
8232
|
-
disposition: typebox_exports.Optional(typebox_exports.Literal("refused")),
|
|
8233
|
-
remainingScope: typebox_exports.Optional(transportString),
|
|
8234
|
-
blocker: typebox_exports.Optional(blockerSchema)
|
|
8235
|
-
});
|
|
8236
|
-
classResultSchema = typebox_exports.Union([completedClassResultSchema, refusedClassResultSchema]);
|
|
8237
|
-
completedClassResultsSchema = typebox_exports.Array(completedClassResultSchema);
|
|
8238
8190
|
PARTIALLY_COMPLETED_DEFINITION = "partially_completed \u53EA\u80FD\u5728\u6709\u5408\u6CD5\u62D2\u7EDD\u9879\uFF08\u5B8C\u6210\u9879\u4E0E\u5408\u6CD5\u62D2\u7EDD\u9879\u5E76\u5B58\uFF09\u65F6\u7528\uFF0C\u522B\u7684\u60C5\u51B5\u4E0D\u51C6\u7528\u3002";
|
|
8239
8191
|
FIXER_STATUS_DESCRIPTION = `planned | completed | refused | unfinished | partially_completed\u3002unfinished \u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u65F6\u53EF\u7528\uFF0C\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002${PARTIALLY_COMPLETED_DEFINITION}`;
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8192
|
+
fixerOutputObject = typebox_exports.Object({
|
|
8193
|
+
status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }),
|
|
8194
|
+
report: typebox_exports.Unknown({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }),
|
|
8195
|
+
remainingScope: typebox_exports.Unknown({
|
|
8196
|
+
description: "\u672C\u5C40\u540E\u5269\u4F59\u5DE5\u4F5C\uFF1B\u4F9D\u6CD5\u4E0D\u80FD\u5B8C\u6210\u7684\u8303\u56F4\u4E5F\u5199\u6B64\u5904\u3002"
|
|
8197
|
+
}),
|
|
8198
|
+
blocker: typebox_exports.Unknown({
|
|
8199
|
+
description: "\u5408\u6CD5\u963B\u65AD\u5B8C\u6210\u7684 blocker\uFF0C\u539F\u6837\u7559\u5B58\u3002\u53EF\u5199 cause\uFF08authority_violation \u6216 prerequisite_unmet\uFF09\u3001evidence\uFF1Bprerequisite_unmet \u8FD8\u53EF\u5199 prerequisiteId\u3002"
|
|
8200
|
+
}),
|
|
8201
|
+
reason: typebox_exports.Unknown({
|
|
8202
|
+
description: "\u963B\u65AD\u539F\u56E0\uFF1A\u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u3002\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002"
|
|
8203
|
+
}),
|
|
8204
|
+
classResults: typebox_exports.Unknown({
|
|
8205
|
+
description: "\u5404\u7C7B class \u7ED3\u7B97\uFF0C\u539F\u6837\u7559\u5B58\u3002\u5B8C\u6210\u9879\u7684 disposition \u4E3A completed\uFF0C\u53EF\u5199 name\u3001searchScope\u3001exceptions\uFF08where\u3001reason\uFF09\u3001commitSha\u3002\u62D2\u7EDD\u9879\u7684 disposition \u4E3A refused\uFF0C\u53EF\u5199 name\u3001remainingScope\u3001blocker\u3002"
|
|
8206
|
+
}),
|
|
8207
|
+
testEvidence: typebox_exports.Unknown({
|
|
8208
|
+
description: "\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1Bdiff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u63D0\u4EA4\uFF1B\u673A\u5668\u4E0D\u6838\u9A8C\u3002\u53EF\u5199 contract\uFF08\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6\uFF09\u3001minimumNecessaryCost\uFF08\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C\uFF09\u3001measuredDuration\uFF08\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F\uFF09\u3002"
|
|
8209
|
+
})
|
|
8210
|
+
});
|
|
8248
8211
|
fixerOutputSchema = withTerminatingOutputDeclarations(
|
|
8249
|
-
|
|
8212
|
+
openToolObject(fixerOutputObject)
|
|
8250
8213
|
);
|
|
8251
8214
|
}
|
|
8252
8215
|
});
|
|
@@ -13665,7 +13628,7 @@ var init_canonical_json = __esm({
|
|
|
13665
13628
|
});
|
|
13666
13629
|
|
|
13667
13630
|
// src/doctor-contracts.ts
|
|
13668
|
-
var DOCTOR_OUTPUT_TOOL_NAME, DOCTOR_AUDIT_TOOL_NAME, DOCTOR_TARGET_KINDS,
|
|
13631
|
+
var DOCTOR_OUTPUT_TOOL_NAME, DOCTOR_AUDIT_TOOL_NAME, DOCTOR_TARGET_KINDS, DOCTOR_DISPOSITIONS, DOCTOR_PRESCRIPTION_KINDS, biteActual, biteNone, DOCTOR_BITE_KINDS, DOCTOR_STATUS_DESCRIPTION, doctorSubmissionObject, doctorSubmissionSchema, doctorEvidenceReadSchema;
|
|
13669
13632
|
var init_doctor_contracts = __esm({
|
|
13670
13633
|
"src/doctor-contracts.ts"() {
|
|
13671
13634
|
"use strict";
|
|
@@ -13676,41 +13639,29 @@ var init_doctor_contracts = __esm({
|
|
|
13676
13639
|
DOCTOR_OUTPUT_TOOL_NAME = "ak_doctor_output";
|
|
13677
13640
|
DOCTOR_AUDIT_TOOL_NAME = "ak_doctor_audit_decision";
|
|
13678
13641
|
DOCTOR_TARGET_KINDS = ["law", "gate", "template", "station", "seat"];
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
typebox_exports.Object({ kind: typebox_exports.Optional(typebox_exports.Literal("noRealBite")), targetKey: nonblank, eligibleEvidenceIds: evidenceIds }, { additionalProperties: true })
|
|
13685
|
-
]);
|
|
13686
|
-
assetKinds = DOCTOR_TARGET_KINDS;
|
|
13687
|
-
findingBody = {
|
|
13688
|
-
evidenceIds,
|
|
13689
|
-
disposition: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("keep"), typebox_exports.Literal("thin"), typebox_exports.Literal("delete")])),
|
|
13690
|
-
guardrails: typebox_exports.Optional(typebox_exports.Object({ reproducibleFailure: guardrail, owningSeamOrInvariant: guardrail, deletionOrSimplificationSuffices: guardrail }, { additionalProperties: true })),
|
|
13691
|
-
prescription: typebox_exports.Optional(typebox_exports.Object({ kind: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("retain"), typebox_exports.Literal("delete"), typebox_exports.Literal("simplify"), typebox_exports.Literal("patch"), typebox_exports.Literal("addMechanism")])), recommendation: nonblank, necessityExplanation: nonblank }, { additionalProperties: true })),
|
|
13692
|
-
lastRealBite: typebox_exports.Optional(lastRealBite)
|
|
13693
|
-
};
|
|
13694
|
-
finding = typebox_exports.Union([
|
|
13695
|
-
typebox_exports.Object({ targetKey: nonblank, observation: nonblank, evidenceIds }, { additionalProperties: true }),
|
|
13696
|
-
typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), assetEvidence: typebox_exports.Optional(typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), evidenceId: nonblank }, { additionalProperties: true })), ...findingBody }, { additionalProperties: true })
|
|
13697
|
-
]);
|
|
13698
|
-
caseIdentity = typebox_exports.Object({ issueNumber: typebox_exports.Optional(typebox_exports.Integer()), runsPath: nonblank }, { additionalProperties: true });
|
|
13642
|
+
DOCTOR_DISPOSITIONS = ["keep", "thin", "delete"];
|
|
13643
|
+
DOCTOR_PRESCRIPTION_KINDS = ["retain", "delete", "simplify", "patch", "addMechanism"];
|
|
13644
|
+
biteActual = "actual";
|
|
13645
|
+
biteNone = "noRealBite";
|
|
13646
|
+
DOCTOR_BITE_KINDS = [biteActual, biteNone];
|
|
13699
13647
|
DOCTOR_STATUS_DESCRIPTION = "completed | refused\u3002completed \u5141\u8BB8\u7A7A findings\uFF1Brefused \u4EC5\u5F53\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u6848\u8BC1\u8BCD";
|
|
13700
|
-
|
|
13701
|
-
typebox_exports.
|
|
13702
|
-
|
|
13703
|
-
|
|
13704
|
-
|
|
13705
|
-
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
},
|
|
13711
|
-
|
|
13648
|
+
doctorSubmissionObject = typebox_exports.Object({
|
|
13649
|
+
status: typebox_exports.Unknown({ description: DOCTOR_STATUS_DESCRIPTION }),
|
|
13650
|
+
case: typebox_exports.Unknown({
|
|
13651
|
+
description: "\u7559\u5B58\u592A\u533B\u7F72\u6848\u8EAB\u4EFD\uFF0C\u539F\u6837\u7559\u5B58\uFF08\u5982 issueNumber\u3001runsPath\uFF09\u3002\u673A\u68B0\u5C42\u53E6\u6309\u7ED1\u5B9A run \u6295\u5F71\u6848\u8EAB\u4EFD\uFF0C\u4E0D\u5728\u672C\u5B57\u6BB5\u91CD\u5224\u3002"
|
|
13652
|
+
}),
|
|
13653
|
+
findings: typebox_exports.Unknown({
|
|
13654
|
+
description: `\u9010\u6761\u8D44\u4EA7\u89C2\u5BDF\u4E0E\u5904\u65B9\uFF0C\u539F\u6837\u7559\u5B58\u3002\u4E00\u6761\u53EF\u542B targetKey\u3001targetKind\uFF08${DOCTOR_TARGET_KINDS.join(" | ")}\uFF09\u3001observation\u3001evidenceIds\u3001disposition\uFF08${DOCTOR_DISPOSITIONS.join(" | ")}\uFF09\u3001assetEvidence\uFF08targetKey\u3001targetKind\u3001evidenceId\uFF09\u3001guardrails\uFF08reproducibleFailure\u3001owningSeamOrInvariant\u3001deletionOrSimplificationSuffices\uFF0C\u5404\u9879\u53EF\u542B answer\u3001evidenceIds\u3001explanation\uFF09\u3001prescription\uFF08kind \u4E3A ${DOCTOR_PRESCRIPTION_KINDS.join(" | ")}\uFF0C\u53E6\u53EF\u5199 recommendation\u3001necessityExplanation\uFF09\u3001lastRealBite\uFF08kind \u4E3A ${DOCTOR_BITE_KINDS.join(" | ")}\uFF0C\u53E6\u53EF\u5199 targetKey\u3001evidenceId\u3001eligibleEvidenceIds\uFF09\u3002\u4E0D\u8981\u6C42\u4EFB\u4F55\u5904\u65B9\u6216\u53EF\u590D\u7528 finding\uFF1B\u7F3A\u53EF\u590D\u7528\u8D44\u4EA7\u6216 bounded-bite \u8BC1\u636E\u53EA\u6392\u9664\u5BF9\u5E94\u8D44\u4EA7\u5904\u65B9\u3002\u673A\u5668\u4E0D\u6838\u9A8C\u3002`
|
|
13655
|
+
}),
|
|
13656
|
+
reason: typebox_exports.Unknown({
|
|
13657
|
+
description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u8BC1\u8BCD\u7684\u539F\u56E0\uFF1B\u4EC5 refused \u65F6\u7528\u3002"
|
|
13658
|
+
}),
|
|
13659
|
+
missingEvidence: typebox_exports.Unknown({
|
|
13660
|
+
description: "\u5982\u5B9E\u8BC1\u8BCD\u6240\u9700\u800C\u5C1A\u7F3A\u7684\u8BC1\u636E\uFF0C\u539F\u6837\u7559\u5B58\uFF08\u5982\u6BCF\u9879 need\u3001targetKeys\uFF09\u3002"
|
|
13661
|
+
})
|
|
13662
|
+
});
|
|
13712
13663
|
doctorSubmissionSchema = withTerminatingOutputDeclarations(
|
|
13713
|
-
|
|
13664
|
+
openToolObject(doctorSubmissionObject)
|
|
13714
13665
|
);
|
|
13715
13666
|
doctorEvidenceReadSchema = typebox_exports.Object({ evidenceId: typebox_exports.String({ minLength: 1, description: "\u5F85\u8BFB\u7559\u5B58\u8BC1\u636E\u6807\u8BC6" }), offset: typebox_exports.Optional(typebox_exports.Integer({ minimum: 0, description: "\u8D77\u59CB\u5B57\u8282\u504F\u79FB\uFF08\u4ECE 0 \u8BA1\uFF09" })), limit: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "\u8FD4\u56DE\u5B57\u8282\u6570\uFF08\u65E0\u4E0A\u9650\uFF09" })) }, { additionalProperties: true });
|
|
13716
13667
|
}
|
|
@@ -13726,7 +13677,7 @@ var init_exact_utf8 = __esm({
|
|
|
13726
13677
|
});
|
|
13727
13678
|
|
|
13728
13679
|
// src/merger-contracts.ts
|
|
13729
|
-
var materialSchema, checkSchema, mergerInputSchema, MERGER_STATUS_DESCRIPTION,
|
|
13680
|
+
var materialSchema, checkSchema, mergerInputSchema, MERGER_STATUS_DESCRIPTION, mergerOutputObject, mergerOutputSchema, MERGER_OUTPUT_TOOL_NAME;
|
|
13730
13681
|
var init_merger_contracts = __esm({
|
|
13731
13682
|
"src/merger-contracts.ts"() {
|
|
13732
13683
|
"use strict";
|
|
@@ -13746,11 +13697,16 @@ var init_merger_contracts = __esm({
|
|
|
13746
13697
|
authorizedChecks: typebox_exports.Array(checkSchema)
|
|
13747
13698
|
}, { additionalProperties: false });
|
|
13748
13699
|
MERGER_STATUS_DESCRIPTION = "completed | escalate";
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
|
|
13700
|
+
mergerOutputObject = typebox_exports.Object({
|
|
13701
|
+
status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }),
|
|
13702
|
+
attemptId: typebox_exports.Unknown({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }),
|
|
13703
|
+
report: typebox_exports.Unknown({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }),
|
|
13704
|
+
mergeCommitId: typebox_exports.Unknown({ description: "\u5B8C\u6210\u5408\u5E76 commit object ID" }),
|
|
13705
|
+
diagnosis: typebox_exports.Unknown({
|
|
13706
|
+
description: "\u5408\u5E76\u65E0\u6CD5\u6216\u4E0D\u5E94\u7531\u672C\u5E2D\u5B8C\u6210\u7684\u539F\u56E0\uFF08\u542B\u65E0\u8FDB\u884C\u4E2D\u5408\u5E76\u3001\u65E0\u6D3B\u53EF\u5E72\u3001\u9700\u65B0\u7684\u4EA7\u54C1/\u6743\u529B\u51B3\u5B9A\uFF09"
|
|
13707
|
+
})
|
|
13708
|
+
});
|
|
13709
|
+
mergerOutputSchema = withTerminatingOutputDeclarations(openToolObject(mergerOutputObject));
|
|
13754
13710
|
MERGER_OUTPUT_TOOL_NAME = "ak_merger_output";
|
|
13755
13711
|
}
|
|
13756
13712
|
});
|
package/dist/open-tool-schema.js
CHANGED
|
@@ -3,29 +3,6 @@ function described(name, schema) {
|
|
|
3
3
|
if (typeof schema.description === "string") return schema;
|
|
4
4
|
throw new Error(`Tool field ${name} has no semantic description at its schema owner`);
|
|
5
5
|
}
|
|
6
|
-
function declarationIdentity(schema) {
|
|
7
|
-
const { description: _description, ...semantic } = schema;
|
|
8
|
-
return JSON.stringify(semantic);
|
|
9
|
-
}
|
|
10
|
-
function openToolObjectFromUnion(schema) {
|
|
11
|
-
const declarations = /* @__PURE__ */ new Map();
|
|
12
|
-
for (const variant of schema.anyOf) {
|
|
13
|
-
for (const [name, declaration] of Object.entries(variant.properties ?? {})) {
|
|
14
|
-
const entries = declarations.get(name) ?? [];
|
|
15
|
-
const identity = declarationIdentity(declaration);
|
|
16
|
-
if (!entries.some((entry) => declarationIdentity(entry) === identity)) entries.push(declaration);
|
|
17
|
-
declarations.set(name, entries);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const properties = Object.fromEntries([...declarations].map(([name, entries]) => {
|
|
21
|
-
const descriptions = [...new Set(entries.map((entry) => entry.description).filter((value) => typeof value === "string"))].join(" ");
|
|
22
|
-
const declaration = entries.length === 1 ? entries[0] : Type.Union(entries, descriptions === "" ? {} : { description: descriptions });
|
|
23
|
-
return [name, Type.Optional(described(name, declaration))];
|
|
24
|
-
}));
|
|
25
|
-
const object = Type.Object(properties, { additionalProperties: true });
|
|
26
|
-
object.required = [];
|
|
27
|
-
return object;
|
|
28
|
-
}
|
|
29
6
|
function openToolObject(schema) {
|
|
30
7
|
const object = Type.Object(
|
|
31
8
|
Object.fromEntries(Object.entries(schema.properties).map(([name, declaration]) => [
|
|
@@ -38,6 +15,5 @@ function openToolObject(schema) {
|
|
|
38
15
|
return object;
|
|
39
16
|
}
|
|
40
17
|
export {
|
|
41
|
-
openToolObject
|
|
42
|
-
openToolObjectFromUnion
|
|
18
|
+
openToolObject
|
|
43
19
|
};
|
|
@@ -1,44 +1,30 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
|
-
import {
|
|
2
|
+
import { openToolObject } from "../open-tool-schema.js";
|
|
3
3
|
import { withTerminatingOutputDeclarations } from "./terminating-infrastructure.js";
|
|
4
4
|
const FIXER_OUTPUT_TOOL_NAME = "ak_fixer_output";
|
|
5
|
-
const transportString = Type.String();
|
|
6
|
-
const authorityBlockerSchema = Type.Object({ cause: Type.Optional(Type.Literal("authority_violation")), evidence: Type.Optional(transportString) });
|
|
7
|
-
const prerequisiteBlockerSchema = Type.Object({ cause: Type.Optional(Type.Literal("prerequisite_unmet")), prerequisiteId: Type.Optional(transportString), evidence: Type.Optional(transportString) });
|
|
8
|
-
const blockerSchema = Type.Union([authorityBlockerSchema, prerequisiteBlockerSchema]);
|
|
9
|
-
const exceptionSchema = Type.Object({ where: Type.Optional(transportString), reason: Type.Optional(transportString) });
|
|
10
|
-
const testEvidenceSchema = Type.Object({
|
|
11
|
-
contract: Type.Optional(Type.String({ description: "\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6" })),
|
|
12
|
-
minimumNecessaryCost: Type.Optional(Type.String({ description: "\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C" })),
|
|
13
|
-
measuredDuration: Type.Optional(Type.String({ description: "\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F" }))
|
|
14
|
-
}, { description: "\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1Bdiff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u63D0\u4EA4\uFF1B\u673A\u5668\u4E0D\u6838\u9A8C\u3002" });
|
|
15
|
-
const completedClassResultSchema = Type.Object({
|
|
16
|
-
name: Type.Optional(transportString),
|
|
17
|
-
disposition: Type.Optional(Type.Literal("completed")),
|
|
18
|
-
searchScope: Type.Optional(transportString),
|
|
19
|
-
exceptions: Type.Optional(Type.Array(exceptionSchema)),
|
|
20
|
-
commitSha: Type.Optional(transportString)
|
|
21
|
-
});
|
|
22
|
-
const refusedClassResultSchema = Type.Object({
|
|
23
|
-
name: Type.Optional(transportString),
|
|
24
|
-
disposition: Type.Optional(Type.Literal("refused")),
|
|
25
|
-
remainingScope: Type.Optional(transportString),
|
|
26
|
-
blocker: Type.Optional(blockerSchema)
|
|
27
|
-
});
|
|
28
|
-
const classResultSchema = Type.Union([completedClassResultSchema, refusedClassResultSchema]);
|
|
29
|
-
const completedClassResultsSchema = Type.Array(completedClassResultSchema);
|
|
30
5
|
const PARTIALLY_COMPLETED_DEFINITION = "partially_completed \u53EA\u80FD\u5728\u6709\u5408\u6CD5\u62D2\u7EDD\u9879\uFF08\u5B8C\u6210\u9879\u4E0E\u5408\u6CD5\u62D2\u7EDD\u9879\u5E76\u5B58\uFF09\u65F6\u7528\uFF0C\u522B\u7684\u60C5\u51B5\u4E0D\u51C6\u7528\u3002";
|
|
31
6
|
const FIXER_STATUS_DESCRIPTION = `planned | completed | refused | unfinished | partially_completed\u3002unfinished \u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u65F6\u53EF\u7528\uFF0C\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002${PARTIALLY_COMPLETED_DEFINITION}`;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
7
|
+
const fixerOutputObject = Type.Object({
|
|
8
|
+
status: Type.Unknown({ description: FIXER_STATUS_DESCRIPTION }),
|
|
9
|
+
report: Type.Unknown({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }),
|
|
10
|
+
remainingScope: Type.Unknown({
|
|
11
|
+
description: "\u672C\u5C40\u540E\u5269\u4F59\u5DE5\u4F5C\uFF1B\u4F9D\u6CD5\u4E0D\u80FD\u5B8C\u6210\u7684\u8303\u56F4\u4E5F\u5199\u6B64\u5904\u3002"
|
|
12
|
+
}),
|
|
13
|
+
blocker: Type.Unknown({
|
|
14
|
+
description: "\u5408\u6CD5\u963B\u65AD\u5B8C\u6210\u7684 blocker\uFF0C\u539F\u6837\u7559\u5B58\u3002\u53EF\u5199 cause\uFF08authority_violation \u6216 prerequisite_unmet\uFF09\u3001evidence\uFF1Bprerequisite_unmet \u8FD8\u53EF\u5199 prerequisiteId\u3002"
|
|
15
|
+
}),
|
|
16
|
+
reason: Type.Unknown({
|
|
17
|
+
description: "\u963B\u65AD\u539F\u56E0\uFF1A\u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u3002\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002"
|
|
18
|
+
}),
|
|
19
|
+
classResults: Type.Unknown({
|
|
20
|
+
description: "\u5404\u7C7B class \u7ED3\u7B97\uFF0C\u539F\u6837\u7559\u5B58\u3002\u5B8C\u6210\u9879\u7684 disposition \u4E3A completed\uFF0C\u53EF\u5199 name\u3001searchScope\u3001exceptions\uFF08where\u3001reason\uFF09\u3001commitSha\u3002\u62D2\u7EDD\u9879\u7684 disposition \u4E3A refused\uFF0C\u53EF\u5199 name\u3001remainingScope\u3001blocker\u3002"
|
|
21
|
+
}),
|
|
22
|
+
testEvidence: Type.Unknown({
|
|
23
|
+
description: "\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1Bdiff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u63D0\u4EA4\uFF1B\u673A\u5668\u4E0D\u6838\u9A8C\u3002\u53EF\u5199 contract\uFF08\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6\uFF09\u3001minimumNecessaryCost\uFF08\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C\uFF09\u3001measuredDuration\uFF08\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F\uFF09\u3002"
|
|
24
|
+
})
|
|
25
|
+
});
|
|
40
26
|
const fixerOutputSchema = withTerminatingOutputDeclarations(
|
|
41
|
-
|
|
27
|
+
openToolObject(fixerOutputObject)
|
|
42
28
|
);
|
|
43
29
|
function validateFixerOutput(value, _phase) {
|
|
44
30
|
return value;
|
package/dist/public-cli/main.js
CHANGED
|
@@ -8431,29 +8431,6 @@ function described(name, schema) {
|
|
|
8431
8431
|
if (typeof schema.description === "string") return schema;
|
|
8432
8432
|
throw new Error(`Tool field ${name} has no semantic description at its schema owner`);
|
|
8433
8433
|
}
|
|
8434
|
-
function declarationIdentity(schema) {
|
|
8435
|
-
const { description: _description, ...semantic } = schema;
|
|
8436
|
-
return JSON.stringify(semantic);
|
|
8437
|
-
}
|
|
8438
|
-
function openToolObjectFromUnion(schema) {
|
|
8439
|
-
const declarations = /* @__PURE__ */ new Map();
|
|
8440
|
-
for (const variant of schema.anyOf) {
|
|
8441
|
-
for (const [name, declaration] of Object.entries(variant.properties ?? {})) {
|
|
8442
|
-
const entries = declarations.get(name) ?? [];
|
|
8443
|
-
const identity = declarationIdentity(declaration);
|
|
8444
|
-
if (!entries.some((entry) => declarationIdentity(entry) === identity)) entries.push(declaration);
|
|
8445
|
-
declarations.set(name, entries);
|
|
8446
|
-
}
|
|
8447
|
-
}
|
|
8448
|
-
const properties = Object.fromEntries([...declarations].map(([name, entries]) => {
|
|
8449
|
-
const descriptions = [...new Set(entries.map((entry) => entry.description).filter((value) => typeof value === "string"))].join(" ");
|
|
8450
|
-
const declaration = entries.length === 1 ? entries[0] : typebox_exports.Union(entries, descriptions === "" ? {} : { description: descriptions });
|
|
8451
|
-
return [name, typebox_exports.Optional(described(name, declaration))];
|
|
8452
|
-
}));
|
|
8453
|
-
const object = typebox_exports.Object(properties, { additionalProperties: true });
|
|
8454
|
-
object.required = [];
|
|
8455
|
-
return object;
|
|
8456
|
-
}
|
|
8457
8434
|
function openToolObject(schema) {
|
|
8458
8435
|
const object = typebox_exports.Object(
|
|
8459
8436
|
Object.fromEntries(Object.entries(schema.properties).map(([name, declaration]) => [
|
|
@@ -8623,7 +8600,7 @@ var init_reviewer_output = __esm({
|
|
|
8623
8600
|
});
|
|
8624
8601
|
|
|
8625
8602
|
// src/package-contracts/fixer-output.ts
|
|
8626
|
-
var FIXER_OUTPUT_TOOL_NAME,
|
|
8603
|
+
var FIXER_OUTPUT_TOOL_NAME, PARTIALLY_COMPLETED_DEFINITION, FIXER_STATUS_DESCRIPTION, fixerOutputObject, fixerOutputSchema;
|
|
8627
8604
|
var init_fixer_output = __esm({
|
|
8628
8605
|
"src/package-contracts/fixer-output.ts"() {
|
|
8629
8606
|
"use strict";
|
|
@@ -8631,43 +8608,29 @@ var init_fixer_output = __esm({
|
|
|
8631
8608
|
init_open_tool_schema();
|
|
8632
8609
|
init_terminating_infrastructure();
|
|
8633
8610
|
FIXER_OUTPUT_TOOL_NAME = "ak_fixer_output";
|
|
8634
|
-
transportString = typebox_exports.String();
|
|
8635
|
-
authorityBlockerSchema = typebox_exports.Object({ cause: typebox_exports.Optional(typebox_exports.Literal("authority_violation")), evidence: typebox_exports.Optional(transportString) });
|
|
8636
|
-
prerequisiteBlockerSchema = typebox_exports.Object({ cause: typebox_exports.Optional(typebox_exports.Literal("prerequisite_unmet")), prerequisiteId: typebox_exports.Optional(transportString), evidence: typebox_exports.Optional(transportString) });
|
|
8637
|
-
blockerSchema = typebox_exports.Union([authorityBlockerSchema, prerequisiteBlockerSchema]);
|
|
8638
|
-
exceptionSchema = typebox_exports.Object({ where: typebox_exports.Optional(transportString), reason: typebox_exports.Optional(transportString) });
|
|
8639
|
-
testEvidenceSchema = typebox_exports.Object({
|
|
8640
|
-
contract: typebox_exports.Optional(typebox_exports.String({ description: "\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6" })),
|
|
8641
|
-
minimumNecessaryCost: typebox_exports.Optional(typebox_exports.String({ description: "\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C" })),
|
|
8642
|
-
measuredDuration: typebox_exports.Optional(typebox_exports.String({ description: "\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F" }))
|
|
8643
|
-
}, { description: "\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1Bdiff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u63D0\u4EA4\uFF1B\u673A\u5668\u4E0D\u6838\u9A8C\u3002" });
|
|
8644
|
-
completedClassResultSchema = typebox_exports.Object({
|
|
8645
|
-
name: typebox_exports.Optional(transportString),
|
|
8646
|
-
disposition: typebox_exports.Optional(typebox_exports.Literal("completed")),
|
|
8647
|
-
searchScope: typebox_exports.Optional(transportString),
|
|
8648
|
-
exceptions: typebox_exports.Optional(typebox_exports.Array(exceptionSchema)),
|
|
8649
|
-
commitSha: typebox_exports.Optional(transportString)
|
|
8650
|
-
});
|
|
8651
|
-
refusedClassResultSchema = typebox_exports.Object({
|
|
8652
|
-
name: typebox_exports.Optional(transportString),
|
|
8653
|
-
disposition: typebox_exports.Optional(typebox_exports.Literal("refused")),
|
|
8654
|
-
remainingScope: typebox_exports.Optional(transportString),
|
|
8655
|
-
blocker: typebox_exports.Optional(blockerSchema)
|
|
8656
|
-
});
|
|
8657
|
-
classResultSchema = typebox_exports.Union([completedClassResultSchema, refusedClassResultSchema]);
|
|
8658
|
-
completedClassResultsSchema = typebox_exports.Array(completedClassResultSchema);
|
|
8659
8611
|
PARTIALLY_COMPLETED_DEFINITION = "partially_completed \u53EA\u80FD\u5728\u6709\u5408\u6CD5\u62D2\u7EDD\u9879\uFF08\u5B8C\u6210\u9879\u4E0E\u5408\u6CD5\u62D2\u7EDD\u9879\u5E76\u5B58\uFF09\u65F6\u7528\uFF0C\u522B\u7684\u60C5\u51B5\u4E0D\u51C6\u7528\u3002";
|
|
8660
8612
|
FIXER_STATUS_DESCRIPTION = `planned | completed | refused | unfinished | partially_completed\u3002unfinished \u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u65F6\u53EF\u7528\uFF0C\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002${PARTIALLY_COMPLETED_DEFINITION}`;
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8613
|
+
fixerOutputObject = typebox_exports.Object({
|
|
8614
|
+
status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }),
|
|
8615
|
+
report: typebox_exports.Unknown({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }),
|
|
8616
|
+
remainingScope: typebox_exports.Unknown({
|
|
8617
|
+
description: "\u672C\u5C40\u540E\u5269\u4F59\u5DE5\u4F5C\uFF1B\u4F9D\u6CD5\u4E0D\u80FD\u5B8C\u6210\u7684\u8303\u56F4\u4E5F\u5199\u6B64\u5904\u3002"
|
|
8618
|
+
}),
|
|
8619
|
+
blocker: typebox_exports.Unknown({
|
|
8620
|
+
description: "\u5408\u6CD5\u963B\u65AD\u5B8C\u6210\u7684 blocker\uFF0C\u539F\u6837\u7559\u5B58\u3002\u53EF\u5199 cause\uFF08authority_violation \u6216 prerequisite_unmet\uFF09\u3001evidence\uFF1Bprerequisite_unmet \u8FD8\u53EF\u5199 prerequisiteId\u3002"
|
|
8621
|
+
}),
|
|
8622
|
+
reason: typebox_exports.Unknown({
|
|
8623
|
+
description: "\u963B\u65AD\u539F\u56E0\uFF1A\u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u3002\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002"
|
|
8624
|
+
}),
|
|
8625
|
+
classResults: typebox_exports.Unknown({
|
|
8626
|
+
description: "\u5404\u7C7B class \u7ED3\u7B97\uFF0C\u539F\u6837\u7559\u5B58\u3002\u5B8C\u6210\u9879\u7684 disposition \u4E3A completed\uFF0C\u53EF\u5199 name\u3001searchScope\u3001exceptions\uFF08where\u3001reason\uFF09\u3001commitSha\u3002\u62D2\u7EDD\u9879\u7684 disposition \u4E3A refused\uFF0C\u53EF\u5199 name\u3001remainingScope\u3001blocker\u3002"
|
|
8627
|
+
}),
|
|
8628
|
+
testEvidence: typebox_exports.Unknown({
|
|
8629
|
+
description: "\u6D4B\u8BD5\u8BC1\u636E\u6761\uFF1Bdiff \u542B\u6D4B\u8BD5\u6539\u52A8\u65F6\u63D0\u4EA4\uFF1B\u673A\u5668\u4E0D\u6838\u9A8C\u3002\u53EF\u5199 contract\uFF08\u6D4B\u8BD5\u6539\u52A8\u6240\u8BC1\u660E\u7684\u5951\u7EA6\uFF09\u3001minimumNecessaryCost\uFF08\u6D4B\u8BD5\u6539\u52A8\u7684\u4E00\u884C\u6700\u5C0F\u5FC5\u8981\u6210\u672C\uFF09\u3001measuredDuration\uFF08\u805A\u7126\u9A8C\u8BC1\u5B9E\u6D4B\u65F6\u957F\uFF09\u3002"
|
|
8630
|
+
})
|
|
8631
|
+
});
|
|
8669
8632
|
fixerOutputSchema = withTerminatingOutputDeclarations(
|
|
8670
|
-
|
|
8633
|
+
openToolObject(fixerOutputObject)
|
|
8671
8634
|
);
|
|
8672
8635
|
}
|
|
8673
8636
|
});
|
|
@@ -14683,7 +14646,7 @@ var init_canonical_json = __esm({
|
|
|
14683
14646
|
});
|
|
14684
14647
|
|
|
14685
14648
|
// src/doctor-contracts.ts
|
|
14686
|
-
var DOCTOR_OUTPUT_TOOL_NAME, DOCTOR_AUDIT_TOOL_NAME, DOCTOR_TARGET_KINDS,
|
|
14649
|
+
var DOCTOR_OUTPUT_TOOL_NAME, DOCTOR_AUDIT_TOOL_NAME, DOCTOR_TARGET_KINDS, DOCTOR_DISPOSITIONS, DOCTOR_PRESCRIPTION_KINDS, biteActual, biteNone, DOCTOR_BITE_KINDS, DOCTOR_STATUS_DESCRIPTION, doctorSubmissionObject, doctorSubmissionSchema, doctorEvidenceReadSchema;
|
|
14687
14650
|
var init_doctor_contracts = __esm({
|
|
14688
14651
|
"src/doctor-contracts.ts"() {
|
|
14689
14652
|
"use strict";
|
|
@@ -14694,41 +14657,29 @@ var init_doctor_contracts = __esm({
|
|
|
14694
14657
|
DOCTOR_OUTPUT_TOOL_NAME = "ak_doctor_output";
|
|
14695
14658
|
DOCTOR_AUDIT_TOOL_NAME = "ak_doctor_audit_decision";
|
|
14696
14659
|
DOCTOR_TARGET_KINDS = ["law", "gate", "template", "station", "seat"];
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
typebox_exports.Object({ kind: typebox_exports.Optional(typebox_exports.Literal("noRealBite")), targetKey: nonblank, eligibleEvidenceIds: evidenceIds }, { additionalProperties: true })
|
|
14703
|
-
]);
|
|
14704
|
-
assetKinds = DOCTOR_TARGET_KINDS;
|
|
14705
|
-
findingBody = {
|
|
14706
|
-
evidenceIds,
|
|
14707
|
-
disposition: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("keep"), typebox_exports.Literal("thin"), typebox_exports.Literal("delete")])),
|
|
14708
|
-
guardrails: typebox_exports.Optional(typebox_exports.Object({ reproducibleFailure: guardrail, owningSeamOrInvariant: guardrail, deletionOrSimplificationSuffices: guardrail }, { additionalProperties: true })),
|
|
14709
|
-
prescription: typebox_exports.Optional(typebox_exports.Object({ kind: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("retain"), typebox_exports.Literal("delete"), typebox_exports.Literal("simplify"), typebox_exports.Literal("patch"), typebox_exports.Literal("addMechanism")])), recommendation: nonblank, necessityExplanation: nonblank }, { additionalProperties: true })),
|
|
14710
|
-
lastRealBite: typebox_exports.Optional(lastRealBite)
|
|
14711
|
-
};
|
|
14712
|
-
finding = typebox_exports.Union([
|
|
14713
|
-
typebox_exports.Object({ targetKey: nonblank, observation: nonblank, evidenceIds }, { additionalProperties: true }),
|
|
14714
|
-
typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), assetEvidence: typebox_exports.Optional(typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), evidenceId: nonblank }, { additionalProperties: true })), ...findingBody }, { additionalProperties: true })
|
|
14715
|
-
]);
|
|
14716
|
-
caseIdentity = typebox_exports.Object({ issueNumber: typebox_exports.Optional(typebox_exports.Integer()), runsPath: nonblank }, { additionalProperties: true });
|
|
14660
|
+
DOCTOR_DISPOSITIONS = ["keep", "thin", "delete"];
|
|
14661
|
+
DOCTOR_PRESCRIPTION_KINDS = ["retain", "delete", "simplify", "patch", "addMechanism"];
|
|
14662
|
+
biteActual = "actual";
|
|
14663
|
+
biteNone = "noRealBite";
|
|
14664
|
+
DOCTOR_BITE_KINDS = [biteActual, biteNone];
|
|
14717
14665
|
DOCTOR_STATUS_DESCRIPTION = "completed | refused\u3002completed \u5141\u8BB8\u7A7A findings\uFF1Brefused \u4EC5\u5F53\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u6848\u8BC1\u8BCD";
|
|
14718
|
-
|
|
14719
|
-
typebox_exports.
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
},
|
|
14729
|
-
|
|
14666
|
+
doctorSubmissionObject = typebox_exports.Object({
|
|
14667
|
+
status: typebox_exports.Unknown({ description: DOCTOR_STATUS_DESCRIPTION }),
|
|
14668
|
+
case: typebox_exports.Unknown({
|
|
14669
|
+
description: "\u7559\u5B58\u592A\u533B\u7F72\u6848\u8EAB\u4EFD\uFF0C\u539F\u6837\u7559\u5B58\uFF08\u5982 issueNumber\u3001runsPath\uFF09\u3002\u673A\u68B0\u5C42\u53E6\u6309\u7ED1\u5B9A run \u6295\u5F71\u6848\u8EAB\u4EFD\uFF0C\u4E0D\u5728\u672C\u5B57\u6BB5\u91CD\u5224\u3002"
|
|
14670
|
+
}),
|
|
14671
|
+
findings: typebox_exports.Unknown({
|
|
14672
|
+
description: `\u9010\u6761\u8D44\u4EA7\u89C2\u5BDF\u4E0E\u5904\u65B9\uFF0C\u539F\u6837\u7559\u5B58\u3002\u4E00\u6761\u53EF\u542B targetKey\u3001targetKind\uFF08${DOCTOR_TARGET_KINDS.join(" | ")}\uFF09\u3001observation\u3001evidenceIds\u3001disposition\uFF08${DOCTOR_DISPOSITIONS.join(" | ")}\uFF09\u3001assetEvidence\uFF08targetKey\u3001targetKind\u3001evidenceId\uFF09\u3001guardrails\uFF08reproducibleFailure\u3001owningSeamOrInvariant\u3001deletionOrSimplificationSuffices\uFF0C\u5404\u9879\u53EF\u542B answer\u3001evidenceIds\u3001explanation\uFF09\u3001prescription\uFF08kind \u4E3A ${DOCTOR_PRESCRIPTION_KINDS.join(" | ")}\uFF0C\u53E6\u53EF\u5199 recommendation\u3001necessityExplanation\uFF09\u3001lastRealBite\uFF08kind \u4E3A ${DOCTOR_BITE_KINDS.join(" | ")}\uFF0C\u53E6\u53EF\u5199 targetKey\u3001evidenceId\u3001eligibleEvidenceIds\uFF09\u3002\u4E0D\u8981\u6C42\u4EFB\u4F55\u5904\u65B9\u6216\u53EF\u590D\u7528 finding\uFF1B\u7F3A\u53EF\u590D\u7528\u8D44\u4EA7\u6216 bounded-bite \u8BC1\u636E\u53EA\u6392\u9664\u5BF9\u5E94\u8D44\u4EA7\u5904\u65B9\u3002\u673A\u5668\u4E0D\u6838\u9A8C\u3002`
|
|
14673
|
+
}),
|
|
14674
|
+
reason: typebox_exports.Unknown({
|
|
14675
|
+
description: "\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u8BC1\u8BCD\u7684\u539F\u56E0\uFF1B\u4EC5 refused \u65F6\u7528\u3002"
|
|
14676
|
+
}),
|
|
14677
|
+
missingEvidence: typebox_exports.Unknown({
|
|
14678
|
+
description: "\u5982\u5B9E\u8BC1\u8BCD\u6240\u9700\u800C\u5C1A\u7F3A\u7684\u8BC1\u636E\uFF0C\u539F\u6837\u7559\u5B58\uFF08\u5982\u6BCF\u9879 need\u3001targetKeys\uFF09\u3002"
|
|
14679
|
+
})
|
|
14680
|
+
});
|
|
14730
14681
|
doctorSubmissionSchema = withTerminatingOutputDeclarations(
|
|
14731
|
-
|
|
14682
|
+
openToolObject(doctorSubmissionObject)
|
|
14732
14683
|
);
|
|
14733
14684
|
doctorEvidenceReadSchema = typebox_exports.Object({ evidenceId: typebox_exports.String({ minLength: 1, description: "\u5F85\u8BFB\u7559\u5B58\u8BC1\u636E\u6807\u8BC6" }), offset: typebox_exports.Optional(typebox_exports.Integer({ minimum: 0, description: "\u8D77\u59CB\u5B57\u8282\u504F\u79FB\uFF08\u4ECE 0 \u8BA1\uFF09" })), limit: typebox_exports.Optional(typebox_exports.Integer({ minimum: 1, description: "\u8FD4\u56DE\u5B57\u8282\u6570\uFF08\u65E0\u4E0A\u9650\uFF09" })) }, { additionalProperties: true });
|
|
14734
14685
|
}
|
|
@@ -14775,7 +14726,7 @@ function validateMergerInput(value) {
|
|
|
14775
14726
|
const authorizedChecks = Array.isArray(value.authorizedChecks) ? value.authorizedChecks.filter((check) => record(check)).map((c) => ({ name: asString(c.name), argv: asStringArray(c.argv).filter((a) => a.trim().length > 0) })).filter((c) => c.name.trim().length > 0 && c.argv.length > 0) : [];
|
|
14776
14727
|
return deepFreeze(structuredClone({ attemptId: value.attemptId.trim(), targetObjectId: asString(value.targetObjectId), sourceObjectId: asString(value.sourceObjectId), materials, expectedConflictPaths: asStringArray(value.expectedConflictPaths), resolutionScope: asStringArray(value.resolutionScope), authorizedChecks }));
|
|
14777
14728
|
}
|
|
14778
|
-
var materialSchema, checkSchema, mergerInputSchema, MERGER_STATUS_DESCRIPTION,
|
|
14729
|
+
var materialSchema, checkSchema, mergerInputSchema, MERGER_STATUS_DESCRIPTION, mergerOutputObject, mergerOutputSchema, MERGER_OUTPUT_TOOL_NAME, record, blank, MergerInputContractError, asString, asStringArray;
|
|
14779
14730
|
var init_merger_contracts = __esm({
|
|
14780
14731
|
"src/merger-contracts.ts"() {
|
|
14781
14732
|
"use strict";
|
|
@@ -14795,11 +14746,16 @@ var init_merger_contracts = __esm({
|
|
|
14795
14746
|
authorizedChecks: typebox_exports.Array(checkSchema)
|
|
14796
14747
|
}, { additionalProperties: false });
|
|
14797
14748
|
MERGER_STATUS_DESCRIPTION = "completed | escalate";
|
|
14798
|
-
|
|
14799
|
-
|
|
14800
|
-
|
|
14801
|
-
|
|
14802
|
-
|
|
14749
|
+
mergerOutputObject = typebox_exports.Object({
|
|
14750
|
+
status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }),
|
|
14751
|
+
attemptId: typebox_exports.Unknown({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }),
|
|
14752
|
+
report: typebox_exports.Unknown({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }),
|
|
14753
|
+
mergeCommitId: typebox_exports.Unknown({ description: "\u5B8C\u6210\u5408\u5E76 commit object ID" }),
|
|
14754
|
+
diagnosis: typebox_exports.Unknown({
|
|
14755
|
+
description: "\u5408\u5E76\u65E0\u6CD5\u6216\u4E0D\u5E94\u7531\u672C\u5E2D\u5B8C\u6210\u7684\u539F\u56E0\uFF08\u542B\u65E0\u8FDB\u884C\u4E2D\u5408\u5E76\u3001\u65E0\u6D3B\u53EF\u5E72\u3001\u9700\u65B0\u7684\u4EA7\u54C1/\u6743\u529B\u51B3\u5B9A\uFF09"
|
|
14756
|
+
})
|
|
14757
|
+
});
|
|
14758
|
+
mergerOutputSchema = withTerminatingOutputDeclarations(openToolObject(mergerOutputObject));
|
|
14803
14759
|
MERGER_OUTPUT_TOOL_NAME = "ak_merger_output";
|
|
14804
14760
|
record = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
14805
14761
|
blank = (v) => typeof v !== "string" || v.trim().length === 0;
|
|
@@ -20751,7 +20707,7 @@ async function admitPublicRole(role, parsed, env, override) {
|
|
|
20751
20707
|
if (parsed.runs === void 0) {
|
|
20752
20708
|
ensureRealDirectoryTree(placed.ledgerHome, caseRunsPath);
|
|
20753
20709
|
}
|
|
20754
|
-
let
|
|
20710
|
+
let caseIdentity;
|
|
20755
20711
|
try {
|
|
20756
20712
|
const patient = await loadDoctorCase(caseRunsPath);
|
|
20757
20713
|
if (patient.identity.issueNumber !== issueNumber) {
|
|
@@ -20759,7 +20715,7 @@ async function admitPublicRole(role, parsed, env, override) {
|
|
|
20759
20715
|
`doctor case issue ${patient.identity.issueNumber} does not match --issue ${issueNumber}`
|
|
20760
20716
|
);
|
|
20761
20717
|
}
|
|
20762
|
-
|
|
20718
|
+
caseIdentity = patient.identity;
|
|
20763
20719
|
caseRunsPath = await realpath4(caseRunsPath);
|
|
20764
20720
|
} catch (error) {
|
|
20765
20721
|
if (error instanceof CliUsageError) throw error;
|
|
@@ -20773,7 +20729,7 @@ async function admitPublicRole(role, parsed, env, override) {
|
|
|
20773
20729
|
return {
|
|
20774
20730
|
issueNumber,
|
|
20775
20731
|
caseRunsPath,
|
|
20776
|
-
caseIdentity
|
|
20732
|
+
caseIdentity,
|
|
20777
20733
|
attachments: persistedAttachmentRefs(frozenAttachments)
|
|
20778
20734
|
};
|
|
20779
20735
|
}
|
|
@@ -27502,7 +27458,7 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
27502
27458
|
let waitWindowMs;
|
|
27503
27459
|
let issueNumber;
|
|
27504
27460
|
let caseRunsPath;
|
|
27505
|
-
let
|
|
27461
|
+
let caseIdentity;
|
|
27506
27462
|
let sourceRunPath;
|
|
27507
27463
|
let sourceRun;
|
|
27508
27464
|
try {
|
|
@@ -27573,7 +27529,7 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
27573
27529
|
if (record4.caseIdentity !== null && typeof record4.caseIdentity === "object" && !Array.isArray(record4.caseIdentity)) {
|
|
27574
27530
|
const ci = record4.caseIdentity;
|
|
27575
27531
|
if (typeof ci.issueNumber === "number" && Number.isSafeInteger(ci.issueNumber) && ci.issueNumber >= 1 && typeof ci.runsPath === "string" && ci.runsPath.trim() !== "") {
|
|
27576
|
-
|
|
27532
|
+
caseIdentity = { issueNumber: ci.issueNumber, runsPath: ci.runsPath };
|
|
27577
27533
|
}
|
|
27578
27534
|
}
|
|
27579
27535
|
if (typeof record4.sourceRunPath === "string" && record4.sourceRunPath.trim() !== "") {
|
|
@@ -27702,7 +27658,7 @@ async function loadResumableRunRecord(home, runId, authority) {
|
|
|
27702
27658
|
...waitWindowMs === void 0 ? {} : { waitWindowMs },
|
|
27703
27659
|
...issueNumber === void 0 ? {} : { issueNumber },
|
|
27704
27660
|
...caseRunsPath === void 0 ? {} : { caseRunsPath },
|
|
27705
|
-
...
|
|
27661
|
+
...caseIdentity === void 0 ? {} : { caseIdentity },
|
|
27706
27662
|
...sourceRunPath === void 0 ? {} : { sourceRunPath },
|
|
27707
27663
|
...sourceRun === void 0 ? {} : { sourceRun },
|
|
27708
27664
|
...model === void 0 ? {} : { model }
|
|
@@ -27924,8 +27880,8 @@ function admitResumedRole(loaded) {
|
|
|
27924
27880
|
return admitted;
|
|
27925
27881
|
}
|
|
27926
27882
|
case "case-identity": {
|
|
27927
|
-
const { issueNumber, caseRunsPath, caseIdentity
|
|
27928
|
-
if (issueNumber === void 0 || caseRunsPath === void 0 ||
|
|
27883
|
+
const { issueNumber, caseRunsPath, caseIdentity } = fields;
|
|
27884
|
+
if (issueNumber === void 0 || caseRunsPath === void 0 || caseIdentity === void 0) {
|
|
27929
27885
|
throw new CliUsageError(
|
|
27930
27886
|
`role run admitted doctor case identity is missing: ${runId}`
|
|
27931
27887
|
);
|
|
@@ -27935,7 +27891,7 @@ function admitResumedRole(loaded) {
|
|
|
27935
27891
|
...base,
|
|
27936
27892
|
issueNumber,
|
|
27937
27893
|
caseRunsPath,
|
|
27938
|
-
caseIdentity
|
|
27894
|
+
caseIdentity
|
|
27939
27895
|
};
|
|
27940
27896
|
return admitted;
|
|
27941
27897
|
}
|