pomaster 0.6.0 → 0.6.1
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 +14 -1
- package/dist/bin.js +695 -104
- package/package.json +1 -1
- package/seeds/baseline/frontend/design-tokens.yaml +92 -65
- package/seeds/manifest.json +5 -5
package/dist/bin.js
CHANGED
|
@@ -6461,7 +6461,7 @@ var require_compile = __commonJS({
|
|
|
6461
6461
|
const schOrFunc = root.refs[ref];
|
|
6462
6462
|
if (schOrFunc)
|
|
6463
6463
|
return schOrFunc;
|
|
6464
|
-
let _sch =
|
|
6464
|
+
let _sch = resolve4.call(this, root, ref);
|
|
6465
6465
|
if (_sch === void 0) {
|
|
6466
6466
|
const schema2 = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
6467
6467
|
const { schemaId } = this.opts;
|
|
@@ -6488,7 +6488,7 @@ var require_compile = __commonJS({
|
|
|
6488
6488
|
function sameSchemaEnv(s1, s2) {
|
|
6489
6489
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
6490
6490
|
}
|
|
6491
|
-
function
|
|
6491
|
+
function resolve4(root, ref) {
|
|
6492
6492
|
let sch;
|
|
6493
6493
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
6494
6494
|
ref = sch;
|
|
@@ -7313,7 +7313,7 @@ var require_fast_uri = __commonJS({
|
|
|
7313
7313
|
}
|
|
7314
7314
|
return uri;
|
|
7315
7315
|
}
|
|
7316
|
-
function
|
|
7316
|
+
function resolve4(baseURI, relativeURI, options) {
|
|
7317
7317
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
7318
7318
|
const {
|
|
7319
7319
|
parsed: baseParsed,
|
|
@@ -7675,7 +7675,7 @@ var require_fast_uri = __commonJS({
|
|
|
7675
7675
|
var fastUri = {
|
|
7676
7676
|
SCHEMES,
|
|
7677
7677
|
normalize,
|
|
7678
|
-
resolve:
|
|
7678
|
+
resolve: resolve4,
|
|
7679
7679
|
resolveComponent,
|
|
7680
7680
|
equal,
|
|
7681
7681
|
serialize,
|
|
@@ -18805,7 +18805,7 @@ var init_design_tokens_schema = __esm({
|
|
|
18805
18805
|
});
|
|
18806
18806
|
|
|
18807
18807
|
// packages/schemas/dist/src/vocab.js
|
|
18808
|
-
var IR_SCHEMA_DIALECT, LIFECYCLE_VALUES, CONFIDENCE_VALUES, EVIDENCE_VALUES, CHANGE_VALUES, LIFECYCLE_TRANSITIONS, SOURCE_TYPE_ALL_VALUES, SOURCE_TYPE_FORBIDDEN_VALUES, GOVERNED_ID_PREFIXES, ALIASES_V0, TRUTH_BODY_KINDS, CATALOG_ENFORCEMENT_VALUES, CATALOG_CLASSIFICATION_VALUES, CATALOG_LANE_VALUES, CATALOG_CHANGE_CLASS_VALUES, CATALOG_GOVERNANCE_PROFILE_VALUES, RECONCILE_DELTA_KINDS, VERDICT_VALUES, ORIGIN_VALUES, VERIFICATION_VERDICT_VALUES, PRODUCER_KIND_VALUES, ACTOR_TYPE_VALUES, RUN_TRIGGER_VALUES, DENOMINATOR_STATUS_VALUES, DISCOVERY_CHAIN_VALUES, DISCOVERY_CHAIN_TRANSITIONS, DISCOVERY_PROMOTION_BASIS_VALUES, BLUEPRINT_ENVELOPE_STATUS_VALUES, RESEARCH_FINDING_CONFIDENCE_VALUES, RESEARCH_EVIDENCE_LEVEL_VALUES, RESEARCH_AUTHORITY_EFFECT_VALUES, RESEARCH_MODE_VALUES, EXCEPTION_CLASSIFICATION_VALUES, KNOWLEDGE_KIND_VALUES, KNOWLEDGE_STATUS_VALUES, KNOWLEDGE_TRANSITIONS, KNOWLEDGE_PROMOTION_AUTHORITY_VALUES, KNOWLEDGE_CONFIDENCE_VALUES, EXECUTION_RUNTIME_VALUES, EXECUTION_IDENTITY_KIND_VALUES, EXECUTION_ROLE_VALUES, LOCK_KIND_VALUES, AGENT_ROLE_POOL_VALUES, RUNTIME_CAPABILITY_VALUES, RUNTIME_DEGRADATION_RULE_IDS, WORD_FORM_DOMAIN_VALUES, EQUIVALENCE_STATUS_VALUES, PORTABILITY_CANONICAL_SET_VALUES, PORTABILITY_RUNTIME_REBUILD_VALUES, PORTABILITY_FORBIDDEN_DEPENDENCY_VALUES, MEMORY_DRIFT, HARVEST_BUCKET_VALUES, HARVEST_PRIMARY_BUCKETS, HARVEST_SPECIAL_EXIT_VALUES, MEMORY_CLASS_VALUES, REVIEW_STATE_VALUES, HARVEST_SOURCE_VALUES, HARVEST_CONFIDENCE_VALUES, MEMORY_CLI_ERROR_VALUES, OWNER_ESCALATION_REQUIRED, PHASE_TIMELINE_VALUES, PRODUCTION_SIGNAL_SOURCE_VALUES, DIAGNOSIS_KIND_VALUES, BAND_PREDICATE_OPERATOR_VALUES, CONTROL_BAND_EVALUATION_STATUS_VALUES, CAPABILITY_OUTCOME_METRIC_STATUS_VALUES, CAPABILITY_OUTCOME_METRIC_KEY_VALUES, SELF_IMPROVEMENT_SIGNAL_VALUES, SELF_IMPROVEMENT_SIGNAL_PRD_LABELS, POMASTER_SELF_IMPROVEMENT_CANDIDATE, DETECTED_BY_TOOL_SIGNAL, PRODUCTION_CLI_ERROR_VALUES, RELATION_TYPE_VALUES, RELATION_ORIGIN_VALUES, RELATION_ENDPOINT_DOMAIN_VALUES, RELATION_CONFIDENCE_VALUES, SUBSTRATE_LAYER_VALUES, RESOLUTION_MATCH_CLASS_VALUES, OBJECT_FAMILY_VALUES, CATALOG_KIND_VALUES;
|
|
18808
|
+
var IR_SCHEMA_DIALECT, LIFECYCLE_VALUES, CONFIDENCE_VALUES, EVIDENCE_VALUES, CHANGE_VALUES, LIFECYCLE_TRANSITIONS, SOURCE_TYPE_ALL_VALUES, SOURCE_TYPE_FORBIDDEN_VALUES, BINDING_CLASS_VALUES, BINDING_STATUS_VALUES, GOVERNED_ID_PREFIXES, ALIASES_V0, TRUTH_BODY_KINDS, CATALOG_ENFORCEMENT_VALUES, CATALOG_CLASSIFICATION_VALUES, CATALOG_LANE_VALUES, CATALOG_CHANGE_CLASS_VALUES, CATALOG_GOVERNANCE_PROFILE_VALUES, RECONCILE_DELTA_KINDS, VERDICT_VALUES, ORIGIN_VALUES, VERIFICATION_VERDICT_VALUES, PRODUCER_KIND_VALUES, ACTOR_TYPE_VALUES, RUN_TRIGGER_VALUES, DENOMINATOR_STATUS_VALUES, DISCOVERY_CHAIN_VALUES, DISCOVERY_CHAIN_TRANSITIONS, DISCOVERY_PROMOTION_BASIS_VALUES, BLUEPRINT_ENVELOPE_STATUS_VALUES, RESEARCH_FINDING_CONFIDENCE_VALUES, RESEARCH_EVIDENCE_LEVEL_VALUES, RESEARCH_AUTHORITY_EFFECT_VALUES, RESEARCH_MODE_VALUES, EXCEPTION_CLASSIFICATION_VALUES, KNOWLEDGE_KIND_VALUES, KNOWLEDGE_STATUS_VALUES, KNOWLEDGE_TRANSITIONS, KNOWLEDGE_PROMOTION_AUTHORITY_VALUES, KNOWLEDGE_CONFIDENCE_VALUES, EXECUTION_RUNTIME_VALUES, EXECUTION_IDENTITY_KIND_VALUES, EXECUTION_ROLE_VALUES, LOCK_KIND_VALUES, AGENT_ROLE_POOL_VALUES, RUNTIME_CAPABILITY_VALUES, RUNTIME_DEGRADATION_RULE_IDS, WORD_FORM_DOMAIN_VALUES, EQUIVALENCE_STATUS_VALUES, PORTABILITY_CANONICAL_SET_VALUES, PORTABILITY_RUNTIME_REBUILD_VALUES, PORTABILITY_FORBIDDEN_DEPENDENCY_VALUES, MEMORY_DRIFT, HARVEST_BUCKET_VALUES, HARVEST_PRIMARY_BUCKETS, HARVEST_SPECIAL_EXIT_VALUES, MEMORY_CLASS_VALUES, REVIEW_STATE_VALUES, HARVEST_SOURCE_VALUES, HARVEST_CONFIDENCE_VALUES, MEMORY_CLI_ERROR_VALUES, OWNER_ESCALATION_REQUIRED, PHASE_TIMELINE_VALUES, PRODUCTION_SIGNAL_SOURCE_VALUES, DIAGNOSIS_KIND_VALUES, BAND_PREDICATE_OPERATOR_VALUES, CONTROL_BAND_EVALUATION_STATUS_VALUES, CAPABILITY_OUTCOME_METRIC_STATUS_VALUES, CAPABILITY_OUTCOME_METRIC_KEY_VALUES, SELF_IMPROVEMENT_SIGNAL_VALUES, SELF_IMPROVEMENT_SIGNAL_PRD_LABELS, POMASTER_SELF_IMPROVEMENT_CANDIDATE, DETECTED_BY_TOOL_SIGNAL, PRODUCTION_CLI_ERROR_VALUES, RELATION_TYPE_VALUES, RELATION_ORIGIN_VALUES, RELATION_ENDPOINT_DOMAIN_VALUES, RELATION_CONFIDENCE_VALUES, SUBSTRATE_LAYER_VALUES, RESOLUTION_MATCH_CLASS_VALUES, OBJECT_FAMILY_VALUES, CATALOG_KIND_VALUES;
|
|
18809
18809
|
var init_vocab = __esm({
|
|
18810
18810
|
"packages/schemas/dist/src/vocab.js"() {
|
|
18811
18811
|
"use strict";
|
|
@@ -18850,6 +18850,12 @@ var init_vocab = __esm({
|
|
|
18850
18850
|
"prototype_html_scrape",
|
|
18851
18851
|
"ai_invention"
|
|
18852
18852
|
];
|
|
18853
|
+
BINDING_CLASS_VALUES = [
|
|
18854
|
+
"page_to_dir",
|
|
18855
|
+
"contract_operation_to_operationId",
|
|
18856
|
+
"capability_to_file"
|
|
18857
|
+
];
|
|
18858
|
+
BINDING_STATUS_VALUES = ["confirmed", "derived", "stale"];
|
|
18853
18859
|
GOVERNED_ID_PREFIXES = [
|
|
18854
18860
|
"PAGE",
|
|
18855
18861
|
"CAPABILITY",
|
|
@@ -32816,17 +32822,17 @@ async function doctorProbes(store) {
|
|
|
32816
32822
|
return { probes, ok };
|
|
32817
32823
|
}
|
|
32818
32824
|
function defaultRunner(command, args) {
|
|
32819
|
-
return new Promise((
|
|
32825
|
+
return new Promise((resolve4) => {
|
|
32820
32826
|
try {
|
|
32821
32827
|
const child = spawn(command, [...args], { shell: false, timeout: 1e4 });
|
|
32822
32828
|
let stdout = "";
|
|
32823
32829
|
child.stdout?.on("data", (chunk) => {
|
|
32824
32830
|
stdout += chunk.toString("utf8");
|
|
32825
32831
|
});
|
|
32826
|
-
child.on("error", () =>
|
|
32827
|
-
child.on("close", (code) =>
|
|
32832
|
+
child.on("error", () => resolve4({ code: -1, stdout: "" }));
|
|
32833
|
+
child.on("close", (code) => resolve4({ code: code ?? -1, stdout }));
|
|
32828
32834
|
} catch {
|
|
32829
|
-
|
|
32835
|
+
resolve4({ code: -1, stdout: "" });
|
|
32830
32836
|
}
|
|
32831
32837
|
});
|
|
32832
32838
|
}
|
|
@@ -47236,7 +47242,7 @@ function readCliPackageVersion() {
|
|
|
47236
47242
|
}
|
|
47237
47243
|
function resolveCliVersion() {
|
|
47238
47244
|
if (true) {
|
|
47239
|
-
return "0.6.
|
|
47245
|
+
return "0.6.1";
|
|
47240
47246
|
}
|
|
47241
47247
|
return readCliPackageVersion();
|
|
47242
47248
|
}
|
|
@@ -49269,7 +49275,7 @@ var COMMAND_PANORAMA_LINES = [
|
|
|
49269
49275
|
"pomaster handoff <task> --to <role>",
|
|
49270
49276
|
"pomaster session attach/refresh/list",
|
|
49271
49277
|
"pomaster lock acquire/heartbeat/release/steal/list",
|
|
49272
|
-
"pomaster execution begin/end/list",
|
|
49278
|
+
"pomaster execution begin/end/list/audit",
|
|
49273
49279
|
"pomaster trace show/list"
|
|
49274
49280
|
];
|
|
49275
49281
|
var CAPABILITY_OVERVIEW = [
|
|
@@ -49729,7 +49735,7 @@ var SKILL_MANIFEST = [
|
|
|
49729
49735
|
"pomaster agents status",
|
|
49730
49736
|
"pomaster session attach/refresh/list",
|
|
49731
49737
|
"pomaster lock acquire/heartbeat/release/steal/list",
|
|
49732
|
-
"pomaster execution begin/end/list",
|
|
49738
|
+
"pomaster execution begin/end/list/audit",
|
|
49733
49739
|
"pomaster trace show/list",
|
|
49734
49740
|
"pomaster run <task>",
|
|
49735
49741
|
"pomaster handoff <task> --to <role>"
|
|
@@ -49836,10 +49842,10 @@ var FACET_DIR = {
|
|
|
49836
49842
|
};
|
|
49837
49843
|
async function countSeededAssets(rootDir) {
|
|
49838
49844
|
const { readdir: readdir3 } = await import("node:fs/promises");
|
|
49839
|
-
const { join:
|
|
49845
|
+
const { join: join18 } = await import("node:path");
|
|
49840
49846
|
const pomasterDir = toPosix(buildStorePaths(rootDir).pomasterDir);
|
|
49841
49847
|
async function countFiles(relative3) {
|
|
49842
|
-
const absolute =
|
|
49848
|
+
const absolute = join18(pomasterDir, ...relative3.split("/"));
|
|
49843
49849
|
let entries;
|
|
49844
49850
|
try {
|
|
49845
49851
|
entries = await readdir3(absolute, { withFileTypes: true });
|
|
@@ -49869,11 +49875,11 @@ function seededAssetsHumanLine(counts) {
|
|
|
49869
49875
|
}
|
|
49870
49876
|
async function countLegacySpecFiles(rootDir) {
|
|
49871
49877
|
const { readdir: readdir3 } = await import("node:fs/promises");
|
|
49872
|
-
const { join:
|
|
49878
|
+
const { join: join18 } = await import("node:path");
|
|
49873
49879
|
const pomasterDir = toPosix(buildStorePaths(rootDir).pomasterDir);
|
|
49874
49880
|
const legacyDirs = ["specs/hard/frontend", "specs/hard/backend"];
|
|
49875
49881
|
async function countFiles(relative3) {
|
|
49876
|
-
const absolute =
|
|
49882
|
+
const absolute = join18(pomasterDir, ...relative3.split("/"));
|
|
49877
49883
|
let entries;
|
|
49878
49884
|
try {
|
|
49879
49885
|
entries = await readdir3(absolute, { withFileTypes: true });
|
|
@@ -50229,6 +50235,14 @@ import { writeFile } from "node:fs/promises";
|
|
|
50229
50235
|
|
|
50230
50236
|
// packages/cli/dist/fs-cas.js
|
|
50231
50237
|
import { existsSync as existsSync10, linkSync as linkSync2, readFileSync as readFileSync10, renameSync as renameSync3, rmSync as rmSync4, writeFileSync as writeFileSync4 } from "node:fs";
|
|
50238
|
+
var nodeCasSwapFs = {
|
|
50239
|
+
writeFileSync: writeFileSync4,
|
|
50240
|
+
renameSync: renameSync3,
|
|
50241
|
+
readFileSync: readFileSync10,
|
|
50242
|
+
linkSync: linkSync2,
|
|
50243
|
+
existsSync: existsSync10,
|
|
50244
|
+
rmSync: rmSync4
|
|
50245
|
+
};
|
|
50232
50246
|
var CLAIM_RETRY_DELAYS_MS = [20, 50, 100];
|
|
50233
50247
|
function sleepSync2(ms) {
|
|
50234
50248
|
if (ms <= 0)
|
|
@@ -50242,29 +50256,40 @@ function sleepSync2(ms) {
|
|
|
50242
50256
|
}
|
|
50243
50257
|
}
|
|
50244
50258
|
}
|
|
50259
|
+
function errnoOf(error) {
|
|
50260
|
+
if (typeof error !== "object" || error === null || !("code" in error))
|
|
50261
|
+
return null;
|
|
50262
|
+
const code = error.code;
|
|
50263
|
+
return typeof code === "string" ? code : null;
|
|
50264
|
+
}
|
|
50245
50265
|
function isNotFoundError2(error) {
|
|
50246
|
-
return
|
|
50266
|
+
return errnoOf(error) === "ENOENT";
|
|
50247
50267
|
}
|
|
50248
50268
|
function isTransientClaimError(error) {
|
|
50249
|
-
|
|
50250
|
-
return false;
|
|
50251
|
-
const code = error.code;
|
|
50269
|
+
const code = errnoOf(error);
|
|
50252
50270
|
return code === "EPERM" || code === "EACCES";
|
|
50253
50271
|
}
|
|
50254
|
-
function
|
|
50255
|
-
|
|
50272
|
+
function classifyContentionOrFault(error, stepCause) {
|
|
50273
|
+
const code = errnoOf(error);
|
|
50274
|
+
if (code === "ENOENT" || code === "EPERM" || code === "EACCES") {
|
|
50275
|
+
return { kind: "contended", cause: `${stepCause}\uFF08${code}\uFF09\u2014\u2014\u5E76\u53D1\u4EA4\u9519/\u77AC\u65F6\u9501\uFF0C\u6574\u94FE\u91CD\u8BFB\u91CD\u7B97` };
|
|
50276
|
+
}
|
|
50277
|
+
return { kind: "fault", code: code ?? "UNKNOWN", cause: `${stepCause}\u2014\u2014\u6301\u7EED\u73AF\u5883\u6545\u969C\uFF08\u91CD\u8BD5\u65E0\u76CA\uFF09` };
|
|
50278
|
+
}
|
|
50279
|
+
function renameWithLiarDefense(fs, op, dst) {
|
|
50280
|
+
withBoundedRetry2(fs, () => {
|
|
50256
50281
|
try {
|
|
50257
50282
|
op();
|
|
50258
50283
|
} catch (error) {
|
|
50259
|
-
if (isNotFoundError2(error) &&
|
|
50284
|
+
if (isNotFoundError2(error) && fs.existsSync(dst))
|
|
50260
50285
|
return;
|
|
50261
50286
|
throw error;
|
|
50262
50287
|
}
|
|
50263
50288
|
});
|
|
50264
50289
|
}
|
|
50265
|
-
function removeBestEffort2(path) {
|
|
50290
|
+
function removeBestEffort2(fs, path) {
|
|
50266
50291
|
try {
|
|
50267
|
-
|
|
50292
|
+
fs.rmSync(path, { force: true });
|
|
50268
50293
|
} catch {
|
|
50269
50294
|
}
|
|
50270
50295
|
}
|
|
@@ -50273,7 +50298,7 @@ function uniqueAdjacentPath2(target, tag) {
|
|
|
50273
50298
|
casSequence += 1;
|
|
50274
50299
|
return `${target}.${tag}-${process.pid}-${casSequence}`;
|
|
50275
50300
|
}
|
|
50276
|
-
function withBoundedRetry2(op) {
|
|
50301
|
+
function withBoundedRetry2(fs, op) {
|
|
50277
50302
|
for (let attempt = 0; ; attempt += 1) {
|
|
50278
50303
|
try {
|
|
50279
50304
|
op();
|
|
@@ -50285,45 +50310,76 @@ function withBoundedRetry2(op) {
|
|
|
50285
50310
|
}
|
|
50286
50311
|
}
|
|
50287
50312
|
}
|
|
50288
|
-
function casSwapFile(target, expected, next) {
|
|
50313
|
+
function casSwapFile(target, expected, next, fs = nodeCasSwapFs) {
|
|
50289
50314
|
const tmp = uniqueAdjacentPath2(target, "r1tmp");
|
|
50290
50315
|
try {
|
|
50291
|
-
|
|
50316
|
+
fs.writeFileSync(tmp, next, "utf8");
|
|
50292
50317
|
} catch (error) {
|
|
50293
|
-
removeBestEffort2(tmp);
|
|
50294
|
-
|
|
50318
|
+
removeBestEffort2(fs, tmp);
|
|
50319
|
+
return classifyContentionOrFault(error, "tmp \u843D\u76D8\u5931\u8D25\uFF08\u8BA4\u9886\u524D\u843D\u76D8\u4F4D\uFF09");
|
|
50295
50320
|
}
|
|
50296
50321
|
const claim = uniqueAdjacentPath2(target, "r1claim");
|
|
50297
50322
|
try {
|
|
50298
|
-
renameWithLiarDefense(() =>
|
|
50323
|
+
renameWithLiarDefense(fs, () => fs.renameSync(target, claim), claim);
|
|
50299
50324
|
} catch (error) {
|
|
50300
|
-
removeBestEffort2(tmp);
|
|
50325
|
+
removeBestEffort2(fs, tmp);
|
|
50301
50326
|
if (isNotFoundError2(error))
|
|
50302
50327
|
return { kind: "absent" };
|
|
50303
|
-
|
|
50328
|
+
if (isTransientClaimError(error)) {
|
|
50329
|
+
return {
|
|
50330
|
+
kind: "contended",
|
|
50331
|
+
cause: `\u8BA4\u9886 rename \u77AC\u65F6\u9501\u6709\u754C\u91CD\u8BD5\u8017\u5C3D\uFF08${errnoOf(error) ?? "UNKNOWN"}\uFF09\u2014\u2014\u76EE\u6807\u6301\u7EED\u88AB\u5E76\u53D1\u65B9\u9501\u4F4F`
|
|
50332
|
+
};
|
|
50333
|
+
}
|
|
50334
|
+
return {
|
|
50335
|
+
kind: "fault",
|
|
50336
|
+
code: errnoOf(error) ?? "UNKNOWN",
|
|
50337
|
+
cause: "\u8BA4\u9886 rename \u6301\u7EED\u73AF\u5883\u6545\u969C\uFF08\u91CD\u8BD5\u65E0\u76CA\uFF09"
|
|
50338
|
+
};
|
|
50304
50339
|
}
|
|
50305
50340
|
let claimedBytes = null;
|
|
50306
50341
|
try {
|
|
50307
|
-
claimedBytes =
|
|
50342
|
+
claimedBytes = fs.readFileSync(claim, "utf8");
|
|
50308
50343
|
} catch {
|
|
50309
50344
|
claimedBytes = null;
|
|
50310
50345
|
}
|
|
50311
50346
|
if (claimedBytes !== expected) {
|
|
50312
|
-
|
|
50313
|
-
|
|
50347
|
+
try {
|
|
50348
|
+
renameWithLiarDefense(fs, () => fs.renameSync(claim, target), target);
|
|
50349
|
+
} catch (error) {
|
|
50350
|
+
removeBestEffort2(fs, tmp);
|
|
50351
|
+
if (isNotFoundError2(error)) {
|
|
50352
|
+
return {
|
|
50353
|
+
kind: "contended",
|
|
50354
|
+
cause: "\u56DE\u88C5\u6B65\u8BA4\u9886\u6587\u4EF6\u88AB\u5E76\u53D1\u65B9\u4EA4\u9519\u53D6\u8D70\uFF08claim \u4F4D ENOENT \u4E14 target \u7F3A\u5E2D\uFF09\u2014\u2014\u4E16\u4EE3\u968F\u5BF9\u624B\u8BA4\u9886\u6536\u655B\uFF0C\u6574\u94FE\u91CD\u8BFB"
|
|
50355
|
+
};
|
|
50356
|
+
}
|
|
50357
|
+
if (isTransientClaimError(error)) {
|
|
50358
|
+
return {
|
|
50359
|
+
kind: "contended",
|
|
50360
|
+
cause: `\u56DE\u88C5\u5F52\u8FD8\u539F\u4F4D rename \u77AC\u65F6\u9501\u6709\u754C\u91CD\u8BD5\u8017\u5C3D\uFF08${errnoOf(error) ?? "UNKNOWN"}\uFF09\u2014\u2014claim \u539F\u6837\u7559\u76D8`
|
|
50361
|
+
};
|
|
50362
|
+
}
|
|
50363
|
+
return {
|
|
50364
|
+
kind: "fault",
|
|
50365
|
+
code: errnoOf(error) ?? "UNKNOWN",
|
|
50366
|
+
cause: "\u56DE\u88C5\u5F52\u8FD8\u539F\u4F4D rename \u6301\u7EED\u73AF\u5883\u6545\u969C\u2014\u2014claim \u539F\u6837\u7559\u76D8\uFF08\u8BA4\u9886\u5185\u5BB9\u672A\u53D7\u635F\uFF09"
|
|
50367
|
+
};
|
|
50368
|
+
}
|
|
50369
|
+
removeBestEffort2(fs, tmp);
|
|
50314
50370
|
return { kind: "conflict" };
|
|
50315
50371
|
}
|
|
50316
50372
|
try {
|
|
50317
|
-
|
|
50373
|
+
fs.linkSync(tmp, target);
|
|
50318
50374
|
} catch (error) {
|
|
50319
|
-
removeBestEffort2(tmp);
|
|
50320
|
-
if (error
|
|
50375
|
+
removeBestEffort2(fs, tmp);
|
|
50376
|
+
if (errnoOf(error) === "EEXIST") {
|
|
50321
50377
|
return { kind: "conflict" };
|
|
50322
50378
|
}
|
|
50323
|
-
|
|
50379
|
+
return classifyContentionOrFault(error, "link \u56DE\u88C5\u5931\u8D25\uFF08\u5B89\u88C5\u4F4D\uFF09\u2014\u2014claim \u539F\u6837\u7559\u76D8\uFF08\u8BA4\u9886\u5185\u5BB9\u672A\u53D7\u635F\uFF09");
|
|
50324
50380
|
}
|
|
50325
|
-
removeBestEffort2(tmp);
|
|
50326
|
-
removeBestEffort2(claim);
|
|
50381
|
+
removeBestEffort2(fs, tmp);
|
|
50382
|
+
removeBestEffort2(fs, claim);
|
|
50327
50383
|
return { kind: "swapped" };
|
|
50328
50384
|
}
|
|
50329
50385
|
|
|
@@ -51654,7 +51710,7 @@ var BASELINE_SET_TX_BACKOFF_MS = [20, 50, 100];
|
|
|
51654
51710
|
function settled(outcome) {
|
|
51655
51711
|
return { kind: "settled", outcome };
|
|
51656
51712
|
}
|
|
51657
|
-
async function baselineSetAttempt(rootDir, input, lane, attempt) {
|
|
51713
|
+
async function baselineSetAttempt(rootDir, input, lane, attempt, casFs = nodeCasSwapFs) {
|
|
51658
51714
|
const stackRelative = baselineStackRelative(lane);
|
|
51659
51715
|
const stackFile = await readTextFile(`${rootDir}/${stackRelative}`);
|
|
51660
51716
|
if (stackFile.kind !== "ok") {
|
|
@@ -51737,17 +51793,23 @@ async function baselineSetAttempt(rootDir, input, lane, attempt) {
|
|
|
51737
51793
|
}
|
|
51738
51794
|
let manifestCommitted = false;
|
|
51739
51795
|
if (nextManifest !== manifestFile.text) {
|
|
51740
|
-
const cas = casSwapFile(`${rootDir}/${BASELINE_MANIFEST_RELATIVE}`, manifestFile.text, nextManifest);
|
|
51796
|
+
const cas = casSwapFile(`${rootDir}/${BASELINE_MANIFEST_RELATIVE}`, manifestFile.text, nextManifest, casFs);
|
|
51797
|
+
if (cas.kind === "fault") {
|
|
51798
|
+
return settled(failBaselineSet("BASELINE_WRITE_CONFLICT", `baseline \u63D0\u4EA4\u9047\u6301\u7EED\u6587\u4EF6\u7CFB\u7EDF\u6545\u969C\uFF08${BASELINE_MANIFEST_RELATIVE}\uFF1A${cas.cause}\uFF1Berrno=${cas.code}\uFF09\u2014\u2014\u975E\u5E76\u53D1\u4EA4\u9519\uFF0C\u91CD\u8BD5\u65E0\u76CA`, "\u5148\u5904\u7F6E\u6587\u4EF6\u7CFB\u7EDF\u6545\u969C\uFF08\u78C1\u76D8\u7A7A\u95F4/\u6743\u9650/\u6740\u8F6F\u9501\uFF09\uFF0C\u518D\u91CD\u8DD1\u672C\u547D\u4EE4\uFF1A\u91CD\u8DD1\u5728\u65B0\u9C9C\u76D8\u9762\u4E0A\u91CD\u653E\u540C\u4E00\u5224\u5377\u94FE\uFF08\u5E76\u53D1\u4FEE\u6539\u6309\u4E32\u884C\u91CD\u8BD5\u6536\u655B\uFF09\u3002", input));
|
|
51799
|
+
}
|
|
51741
51800
|
if (cas.kind !== "swapped") {
|
|
51742
|
-
return { kind: "contended" };
|
|
51801
|
+
return cas.kind === "contended" ? { kind: "contended", viaCasCause: `manifest\uFF1A${cas.cause}` } : { kind: "contended" };
|
|
51743
51802
|
}
|
|
51744
51803
|
manifestCommitted = true;
|
|
51745
51804
|
change = "UPDATED";
|
|
51746
51805
|
}
|
|
51747
51806
|
if (nextStack !== stackFile.text) {
|
|
51748
|
-
const cas = casSwapFile(`${rootDir}/${stackRelative}`, stackFile.text, nextStack);
|
|
51807
|
+
const cas = casSwapFile(`${rootDir}/${stackRelative}`, stackFile.text, nextStack, casFs);
|
|
51808
|
+
if (cas.kind === "fault") {
|
|
51809
|
+
return settled(failBaselineSet("BASELINE_WRITE_CONFLICT", `baseline \u63D0\u4EA4\u9047\u6301\u7EED\u6587\u4EF6\u7CFB\u7EDF\u6545\u969C\uFF08${stackRelative}\uFF1A${cas.cause}\uFF1Berrno=${cas.code}\uFF09\u2014\u2014\u975E\u5E76\u53D1\u4EA4\u9519\uFF0C\u91CD\u8BD5\u65E0\u76CA`, "\u5148\u5904\u7F6E\u6587\u4EF6\u7CFB\u7EDF\u6545\u969C\uFF08\u78C1\u76D8\u7A7A\u95F4/\u6743\u9650/\u6740\u8F6F\u9501\uFF09\uFF0C\u518D\u91CD\u8DD1\u672C\u547D\u4EE4\uFF1A\u91CD\u8DD1\u5728\u65B0\u9C9C\u76D8\u9762\u4E0A\u91CD\u653E\u540C\u4E00\u5224\u5377\u94FE\uFF08\u5E76\u53D1\u4FEE\u6539\u6309\u4E32\u884C\u91CD\u8BD5\u6536\u655B\uFF09\u3002", input));
|
|
51810
|
+
}
|
|
51749
51811
|
if (cas.kind !== "swapped") {
|
|
51750
|
-
return { kind: "contended" };
|
|
51812
|
+
return cas.kind === "contended" ? { kind: "contended", viaCasCause: `stack\uFF1A${cas.cause}` } : { kind: "contended" };
|
|
51751
51813
|
}
|
|
51752
51814
|
change = "UPDATED";
|
|
51753
51815
|
}
|
|
@@ -51775,7 +51837,7 @@ async function baselineSetAttempt(rootDir, input, lane, attempt) {
|
|
|
51775
51837
|
];
|
|
51776
51838
|
return settled(okOutcome("baseline set", result2, human));
|
|
51777
51839
|
}
|
|
51778
|
-
async function runBaselineSet(rootDir, input) {
|
|
51840
|
+
async function runBaselineSet(rootDir, input, casFs = nodeCasSwapFs) {
|
|
51779
51841
|
if (!BASELINE_LANES.includes(input.lane)) {
|
|
51780
51842
|
return failBaselineSet("SCHEMA_INVALID", `\u975E\u6CD5 lane \u8BCD\u5F62\uFF1A${input.lane}\uFF1B\u5408\u6CD5\u8BCD\u5F62\uFF1A${BASELINE_LANES.join(" | ")}`, "\u793A\u4F8B\uFF1Apomaster baseline set --lane frontend --key framework --value vue3", input);
|
|
51781
51843
|
}
|
|
@@ -51791,21 +51853,24 @@ async function runBaselineSet(rootDir, input) {
|
|
|
51791
51853
|
return failBaselineSet("SCHEMA_INVALID", `\u503C\u8BCD\u5F62\u975E\u6CD5\uFF1A${input.value}\uFF08\u5141\u8BB8 [A-Za-z0-9] \u8D77\u59CB\u3001[A-Za-z0-9 _./+#()-]\u3001\u2264${STACK_VALUE_MAX_LENGTH} \u5B57\u7B26\uFF09`, "\u793A\u4F8B\uFF1A--value vue3\u3001--value 'Spring Boot'\u3001--value none", input);
|
|
51792
51854
|
}
|
|
51793
51855
|
let lastContendedViaStackAbsent = false;
|
|
51856
|
+
let lastContendedCasCause = null;
|
|
51794
51857
|
for (let attempt = 0; ; attempt += 1) {
|
|
51795
51858
|
if (attempt >= BASELINE_SET_TX_ATTEMPTS) {
|
|
51796
51859
|
if (lastContendedViaStackAbsent) {
|
|
51797
51860
|
return failBaselineSet("BASELINE_WRITE_CONFLICT", `baseline \u5199\u5165\u94FE\u672A\u6536\u655B\uFF08${BASELINE_SET_TX_ATTEMPTS} \u8F6E\u6709\u754C\u91CD\u8BD5\u5185 ${baselineStackRelative(lane)} \u6301\u7EED\u7F3A\u5E2D\uFF09\uFF1A\u53EF\u80FD\u4E3A\u5E76\u53D1 CAS \u8BA4\u9886\u7A97\u53E3\u672A\u6536\u655B\uFF0C\u4E5F\u53EF\u80FD\u4E3A\u8BE5\u6587\u4EF6\u88AB\u771F\u5B9E\u5220\u9664\u2014\u2014\u7F3A\u5E2D\u4E0D\u731C\u6D4B\u91CD\u5199`, "\u7A0D\u540E\u91CD\u8DD1\u672C\u547D\u4EE4\u5373\u53EF\uFF1A\u8BA4\u9886\u7A97\u53E3\u6536\u655B\u540E\u91CD\u8DD1\u5728\u65B0\u9C9C\u76D8\u9762\u4E0A\u6309\u4E32\u884C\u8BED\u4E49\u843D\u76D8\uFF1B\u82E5\u91CD\u8DD1\u4ECD\u62A5\u672C\u9519\u8BEF\uFF0C\u8BE5\u6587\u4EF6\u5F88\u53EF\u80FD\u5DF2\u88AB\u771F\u5B9E\u5220\u9664\u2014\u2014\u4ECE git \u6062\u590D\u6216\u91CD\u8DD1 pomaster init \u64AD\u79CD\uFF08seed-once-missing-only\uFF09\u3002", input);
|
|
51798
51861
|
}
|
|
51799
|
-
|
|
51862
|
+
const causeNote = lastContendedCasCause === null ? "" : `\uFF08\u6700\u8FD1\u8BA4\u9886\u4EA4\u9519\u6210\u56E0\uFF1A${lastContendedCasCause}\uFF09`;
|
|
51863
|
+
return failBaselineSet("BASELINE_WRITE_CONFLICT", `baseline \u5E76\u53D1\u5199\u5165\u51B2\u7A81\uFF08${BASELINE_SET_TX_ATTEMPTS} \u8F6E\u91CD\u8BFB\u91CD\u7B97\u540E\u4ECD\u4E0E\u4ED6\u4EBA\u5199\u5165\u4EA4\u9519\uFF1B${baselineStackRelative(lane)} \u4E0E ${BASELINE_MANIFEST_RELATIVE} \u7684\u8BFB-\u6539-\u5199\u94FE\uFF09${causeNote}`, "\u7A0D\u540E\u91CD\u8DD1\u672C\u547D\u4EE4\u5373\u53EF\uFF1A\u91CD\u8DD1\u5728\u65B0\u9C9C\u76D8\u9762\u4E0A\u91CD\u653E\u540C\u4E00\u5224\u5377\u94FE\uFF08\u5E76\u53D1\u4FEE\u6539\u6309\u4E32\u884C\u91CD\u8BD5\u6536\u655B\u2014\u2014\u5BA1\u8BA1 R1 \u4FEE\u590D\u8BED\u4E49\uFF09\u3002", input);
|
|
51800
51864
|
}
|
|
51801
51865
|
if (attempt > 0) {
|
|
51802
51866
|
sleepSync2(BASELINE_SET_TX_BACKOFF_MS[Math.min(attempt - 1, BASELINE_SET_TX_BACKOFF_MS.length - 1)]);
|
|
51803
51867
|
}
|
|
51804
|
-
const attemptOutcome = await baselineSetAttempt(rootDir, input, lane, attempt);
|
|
51868
|
+
const attemptOutcome = await baselineSetAttempt(rootDir, input, lane, attempt, casFs);
|
|
51805
51869
|
if (attemptOutcome.kind === "settled") {
|
|
51806
51870
|
return attemptOutcome.outcome;
|
|
51807
51871
|
}
|
|
51808
51872
|
lastContendedViaStackAbsent = attemptOutcome.viaStackAbsent === true;
|
|
51873
|
+
lastContendedCasCause = attemptOutcome.viaCasCause ?? null;
|
|
51809
51874
|
}
|
|
51810
51875
|
}
|
|
51811
51876
|
function renderBaselineQuizHumanLine(baseline) {
|
|
@@ -59582,9 +59647,524 @@ async function runReconSbom(rootDir, input) {
|
|
|
59582
59647
|
}
|
|
59583
59648
|
}
|
|
59584
59649
|
|
|
59650
|
+
// packages/cli/dist/execution-audit.js
|
|
59651
|
+
init_dist2();
|
|
59652
|
+
init_dist();
|
|
59653
|
+
init_src();
|
|
59654
|
+
import { spawnSync as spawnSync15 } from "node:child_process";
|
|
59655
|
+
import { readdirSync as readdirSync20, readFileSync as readFileSync26, realpathSync, statSync as statSync5 } from "node:fs";
|
|
59656
|
+
import { join as join11, resolve as resolve2 } from "node:path";
|
|
59657
|
+
var EXECUTION_AUDIT_SENSOR_CAPABILITY = "SENSOR.BUILD.STATIC";
|
|
59658
|
+
var EXECUTION_AUDIT_OPERATION = "audit_mutation_scope";
|
|
59659
|
+
var EXECUTION_AUDIT_ADAPTER = "pomaster-cli";
|
|
59660
|
+
var EXECUTION_AUDIT_GIT_TIMEOUT_MS = 12e4;
|
|
59661
|
+
var EXECUTION_AUDIT_PRESENTATION_CAP = 20;
|
|
59662
|
+
var KEYBINDINGS_DIR_RELATIVE = `${TRUTH_OBJECTS_DIR_RELATIVE.replace(/\/objects$/, "")}/keybindings`;
|
|
59663
|
+
var KEYBINDING_ROW_ID_PATTERN = /^KEYBINDING\.[A-Z][A-Z0-9_]{0,31}\.[A-Z][A-Z0-9_]{0,31}(\.[A-Z][A-Z0-9_]{0,31})*$/;
|
|
59664
|
+
var KEYBINDING_OPERATION_ID_TOKEN_PATTERN = /^[A-Za-z][A-Za-z0-9_.-]*$/;
|
|
59665
|
+
if (!SENSOR_ID_PATTERN.test(EXECUTION_AUDIT_SENSOR_CAPABILITY)) {
|
|
59666
|
+
throw new Error(`EXECUTION_AUDIT_SENSOR_CAPABILITY \u8BCD\u5F62\u6F02\u79FB\uFF08\u987B SENSOR.<DOMAIN>.<KIND>\uFF09\uFF1A${EXECUTION_AUDIT_SENSOR_CAPABILITY}`);
|
|
59667
|
+
}
|
|
59668
|
+
function emptyExecutionAuditResult() {
|
|
59669
|
+
return {
|
|
59670
|
+
observation: null,
|
|
59671
|
+
observation_id: null,
|
|
59672
|
+
receipt_path: null,
|
|
59673
|
+
execution_id: null,
|
|
59674
|
+
diff_base: null,
|
|
59675
|
+
diff_base_resolved: null,
|
|
59676
|
+
captured_at_seq: null,
|
|
59677
|
+
changed_files: null,
|
|
59678
|
+
in_scope: null,
|
|
59679
|
+
out_of_scope: null,
|
|
59680
|
+
unmapped: null,
|
|
59681
|
+
excluded_skip_dirs: null,
|
|
59682
|
+
tracked_changed: null,
|
|
59683
|
+
untracked: null,
|
|
59684
|
+
binding_files: null,
|
|
59685
|
+
binding_rows: null,
|
|
59686
|
+
binding_rows_path_anchored: null,
|
|
59687
|
+
binding_rows_non_path: null,
|
|
59688
|
+
binding_rows_malformed: null,
|
|
59689
|
+
permits: null,
|
|
59690
|
+
permits_missing: null,
|
|
59691
|
+
out_of_scope_items: [],
|
|
59692
|
+
report_blob: null,
|
|
59693
|
+
out_of_scope_stdout_capped: false
|
|
59694
|
+
};
|
|
59695
|
+
}
|
|
59696
|
+
function executionAuditFail(error) {
|
|
59697
|
+
return failOutcome("execution audit", emptyExecutionAuditResult(), [error], [`execution audit: FAILED \u2014 ${error.code}
|
|
59698
|
+
hint: ${error.hint}`]);
|
|
59699
|
+
}
|
|
59700
|
+
function isPlainObject9(value) {
|
|
59701
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
59702
|
+
}
|
|
59703
|
+
function isRepoRelativePosixAnchor(value) {
|
|
59704
|
+
return value.length > 0 && !value.includes("\\") && !value.startsWith("/") && !/^[A-Za-z]:[\\/]/.test(value);
|
|
59705
|
+
}
|
|
59706
|
+
function loadKeybindingTable(rootDir) {
|
|
59707
|
+
const dir = join11(rootDir, ...KEYBINDINGS_DIR_RELATIVE.split("/"));
|
|
59708
|
+
let names;
|
|
59709
|
+
try {
|
|
59710
|
+
names = readdirSync20(dir).filter((name) => name.endsWith(".json")).sort();
|
|
59711
|
+
} catch {
|
|
59712
|
+
return { present: false, files: 0, rows: [], malformed: [] };
|
|
59713
|
+
}
|
|
59714
|
+
if (names.length === 0) {
|
|
59715
|
+
return { present: false, files: 0, rows: [], malformed: [] };
|
|
59716
|
+
}
|
|
59717
|
+
const rows = [];
|
|
59718
|
+
const malformed2 = [];
|
|
59719
|
+
for (const name of names) {
|
|
59720
|
+
const file = `${KEYBINDINGS_DIR_RELATIVE}/${name}`;
|
|
59721
|
+
let parsed;
|
|
59722
|
+
try {
|
|
59723
|
+
parsed = JSON.parse(readFileSync26(join11(dir, name), "utf8"));
|
|
59724
|
+
} catch (error) {
|
|
59725
|
+
malformed2.push({
|
|
59726
|
+
file,
|
|
59727
|
+
reason: `json_parse_failed (${error instanceof Error ? error.message : String(error)})`
|
|
59728
|
+
});
|
|
59729
|
+
continue;
|
|
59730
|
+
}
|
|
59731
|
+
if (!isPlainObject9(parsed)) {
|
|
59732
|
+
malformed2.push({ file, reason: "row_not_object" });
|
|
59733
|
+
continue;
|
|
59734
|
+
}
|
|
59735
|
+
const id = parsed["id"];
|
|
59736
|
+
const bindingClass = parsed["binding_class"];
|
|
59737
|
+
const canonicalId = parsed["canonical_id"];
|
|
59738
|
+
const physicalPath = parsed["physical_path"];
|
|
59739
|
+
const bindingStatus = parsed["binding_status"];
|
|
59740
|
+
if (typeof id !== "string" || !KEYBINDING_ROW_ID_PATTERN.test(id)) {
|
|
59741
|
+
malformed2.push({ file, reason: `id \u8BCD\u5F62\u975E\u6CD5\uFF08\u987B KEYBINDING.<DOMAIN>.<NAME> \u81F3\u5C11\u4E24\u6BB5\uFF09: ${JSON.stringify(id ?? null)}` });
|
|
59742
|
+
continue;
|
|
59743
|
+
}
|
|
59744
|
+
if (typeof bindingClass !== "string" || !BINDING_CLASS_VALUES.includes(bindingClass)) {
|
|
59745
|
+
malformed2.push({ file, reason: `binding_class \u8BCD\u8868\u5916: ${JSON.stringify(bindingClass ?? null)}` });
|
|
59746
|
+
continue;
|
|
59747
|
+
}
|
|
59748
|
+
if (typeof canonicalId !== "string") {
|
|
59749
|
+
malformed2.push({ file, reason: "canonical_id \u7F3A\u5E2D\u6216\u975E\u5B57\u7B26\u4E32" });
|
|
59750
|
+
continue;
|
|
59751
|
+
}
|
|
59752
|
+
try {
|
|
59753
|
+
parseGovernedId(canonicalId);
|
|
59754
|
+
} catch {
|
|
59755
|
+
malformed2.push({ file, reason: `canonical_id \u975E closed-world governed id: ${canonicalId}` });
|
|
59756
|
+
continue;
|
|
59757
|
+
}
|
|
59758
|
+
if (typeof physicalPath !== "string") {
|
|
59759
|
+
malformed2.push({ file, reason: "physical_path \u7F3A\u5E2D\u6216\u975E\u5B57\u7B26\u4E32" });
|
|
59760
|
+
continue;
|
|
59761
|
+
}
|
|
59762
|
+
if (bindingClass === "contract_operation_to_operationId") {
|
|
59763
|
+
if (!KEYBINDING_OPERATION_ID_TOKEN_PATTERN.test(physicalPath)) {
|
|
59764
|
+
malformed2.push({ file, reason: `operationId token \u8BCD\u5F62\u975E\u6CD5: ${JSON.stringify(physicalPath)}` });
|
|
59765
|
+
continue;
|
|
59766
|
+
}
|
|
59767
|
+
} else if (!isRepoRelativePosixAnchor(physicalPath)) {
|
|
59768
|
+
malformed2.push({ file, reason: `physical_path \u975E repo \u76F8\u5BF9 posix \u951A: ${JSON.stringify(physicalPath)}` });
|
|
59769
|
+
continue;
|
|
59770
|
+
}
|
|
59771
|
+
if (typeof bindingStatus !== "string" || !BINDING_STATUS_VALUES.includes(bindingStatus)) {
|
|
59772
|
+
malformed2.push({ file, reason: `binding_status \u8BCD\u8868\u5916: ${JSON.stringify(bindingStatus ?? null)}` });
|
|
59773
|
+
continue;
|
|
59774
|
+
}
|
|
59775
|
+
rows.push({ file, id, bindingClass, canonicalId, physicalPath, bindingStatus });
|
|
59776
|
+
}
|
|
59777
|
+
return { present: true, files: names.length, rows, malformed: malformed2 };
|
|
59778
|
+
}
|
|
59779
|
+
function bindingMatchesPath(row2, posixPath) {
|
|
59780
|
+
if (row2.bindingClass === "contract_operation_to_operationId")
|
|
59781
|
+
return false;
|
|
59782
|
+
if (row2.bindingClass === "capability_to_file")
|
|
59783
|
+
return row2.physicalPath === posixPath;
|
|
59784
|
+
return posixPath === row2.physicalPath || posixPath.startsWith(`${row2.physicalPath}/`);
|
|
59785
|
+
}
|
|
59786
|
+
function loadPermitScopes(rootDir, permitIds, currentSeq) {
|
|
59787
|
+
let raw;
|
|
59788
|
+
try {
|
|
59789
|
+
raw = readFileSync26(join11(rootDir, ...PERMITS_RELATIVE.split("/")), "utf8");
|
|
59790
|
+
} catch {
|
|
59791
|
+
return { scopes: [], missing: [...permitIds] };
|
|
59792
|
+
}
|
|
59793
|
+
let parsed;
|
|
59794
|
+
try {
|
|
59795
|
+
parsed = JSON.parse(raw);
|
|
59796
|
+
} catch (error) {
|
|
59797
|
+
return {
|
|
59798
|
+
error: {
|
|
59799
|
+
code: "SCHEMA_INVALID",
|
|
59800
|
+
message: `state/permits.json \u65E0\u6CD5\u89E3\u6790\uFF08\u635F\u574F\u6216\u624B\u6539\uFF09\uFF1A${error instanceof Error ? error.message : String(error)}`,
|
|
59801
|
+
hint: "\u8BB8\u53EF\u53F0\u8D26\u7531 kernel \u4E8B\u52A1\u7EF4\u62A4\uFF1B\u4ECE git \u6062\u590D\u540E\u91CD\u8BD5\u3002"
|
|
59802
|
+
}
|
|
59803
|
+
};
|
|
59804
|
+
}
|
|
59805
|
+
const record = isPlainObject9(parsed) ? parsed : null;
|
|
59806
|
+
const permits = record === null ? null : record["permits"];
|
|
59807
|
+
if (!Array.isArray(permits)) {
|
|
59808
|
+
return {
|
|
59809
|
+
error: {
|
|
59810
|
+
code: "SCHEMA_INVALID",
|
|
59811
|
+
message: "state/permits.json \u7ED3\u6784\u975E\u6CD5\uFF08permits \u975E\u6570\u7EC4\uFF09",
|
|
59812
|
+
hint: "\u8BB8\u53EF\u53F0\u8D26\u7531 kernel \u4E8B\u52A1\u7EF4\u62A4\uFF1B\u4ECE git \u6062\u590D\u540E\u91CD\u8BD5\u3002"
|
|
59813
|
+
}
|
|
59814
|
+
};
|
|
59815
|
+
}
|
|
59816
|
+
const scopes = [];
|
|
59817
|
+
const missing = [];
|
|
59818
|
+
for (const permitId of permitIds) {
|
|
59819
|
+
const row2 = permits.find((entry) => isPlainObject9(entry) && entry["permit_ref"] === permitId);
|
|
59820
|
+
if (row2 === void 0 || !isPlainObject9(row2)) {
|
|
59821
|
+
missing.push(permitId);
|
|
59822
|
+
continue;
|
|
59823
|
+
}
|
|
59824
|
+
const scope = row2["scope"];
|
|
59825
|
+
const subjectIdsRaw = isPlainObject9(scope) ? scope["subject_ids"] : void 0;
|
|
59826
|
+
const subjectIds = Array.isArray(subjectIdsRaw) ? subjectIdsRaw.filter((entry) => typeof entry === "string") : [];
|
|
59827
|
+
const stolenAtSeq = row2["stolen_at_seq"];
|
|
59828
|
+
const expiresAtSeq = row2["expires_at_seq"];
|
|
59829
|
+
const status = typeof stolenAtSeq === "number" ? "stolen" : typeof expiresAtSeq === "number" && currentSeq >= expiresAtSeq ? "expired" : "active";
|
|
59830
|
+
scopes.push({ permit_ref: permitId, subject_ids: subjectIds, status });
|
|
59831
|
+
}
|
|
59832
|
+
return { scopes, missing };
|
|
59833
|
+
}
|
|
59834
|
+
function judgeMutationScope(changedPaths, rows, scopes) {
|
|
59835
|
+
const pathAnchoredRows = rows.filter((row2) => row2.bindingClass !== "contract_operation_to_operationId");
|
|
59836
|
+
const scopeSurface = scopes.length === 0 ? "\u7A7A scope \u9762\uFF08execution \u65E0\u5728\u518C permit \u6216\u5F15\u7528\u672A\u89E3\u6790\u2014\u2014scope \u9762\u4E3A\u7A7A\uFF0C\u4EFB\u4F55\u6620\u5C04\u5747\u4E0D\u53EF\u6388\u4E88 in-scope\uFF09" : scopes.map((permit) => `${permit.permit_ref}[${permit.status}]`).join(", ");
|
|
59837
|
+
return changedPaths.map((path) => {
|
|
59838
|
+
const matched = pathAnchoredRows.filter((row2) => bindingMatchesPath(row2, path));
|
|
59839
|
+
if (matched.length === 0) {
|
|
59840
|
+
return {
|
|
59841
|
+
path,
|
|
59842
|
+
classification: "unmapped",
|
|
59843
|
+
mappings: [],
|
|
59844
|
+
basis: `unmapped\uFF1A\u65E0 KEYBINDING \u5728\u518C\u7ED1\u5B9A\u547D\u4E2D\uFF08path-anchored \u884C ${String(pathAnchoredRows.length)} \u884C\u5206\u6BCD\uFF09\u2014\u2014\u8BDA\u5B9E\u6E05\u5355\u975E\u9519\u8BEF\uFF08recon unmapped \u540C\u6B3E\u7981\u9759\u9ED8\u4E22\u5F03\uFF09`
|
|
59845
|
+
};
|
|
59846
|
+
}
|
|
59847
|
+
const mappings = matched.map((row2) => {
|
|
59848
|
+
const hit = scopes.find((permit) => permit.subject_ids.includes(row2.canonicalId));
|
|
59849
|
+
return {
|
|
59850
|
+
governed_id: row2.canonicalId,
|
|
59851
|
+
binding_id: row2.id,
|
|
59852
|
+
binding_class: row2.bindingClass,
|
|
59853
|
+
binding_status: row2.bindingStatus,
|
|
59854
|
+
in_scope: hit !== void 0,
|
|
59855
|
+
permit_ref: hit?.permit_ref ?? null,
|
|
59856
|
+
permit_status: hit?.status ?? null
|
|
59857
|
+
};
|
|
59858
|
+
});
|
|
59859
|
+
const inScope = mappings.some((mapping) => mapping.in_scope);
|
|
59860
|
+
const basis = inScope ? `in-scope\uFF1A${mappings.filter((mapping) => mapping.in_scope).map((mapping) => `${mapping.governed_id}\uFF08${mapping.binding_id}\xB7${mapping.binding_status}\uFF09\u2208 ${mapping.permit_ref}[${mapping.permit_status}] scope.subject_ids`).join("; ")}` : `out-of-scope\uFF1A${mappings.map((mapping) => `${mapping.governed_id}\uFF08${mapping.binding_id}\xB7${mapping.binding_status}\uFF09`).join("; ")} \u2209 ${scopeSurface}\u2014\u2014\u5224\u5B9A\u4F9D\u636E = kernel checkPermit scope.subject_ids \u6210\u5458\u5224\u636E`;
|
|
59861
|
+
return {
|
|
59862
|
+
path,
|
|
59863
|
+
classification: inScope ? "in_scope" : "out_of_scope",
|
|
59864
|
+
mappings,
|
|
59865
|
+
basis
|
|
59866
|
+
};
|
|
59867
|
+
});
|
|
59868
|
+
}
|
|
59869
|
+
function gitRun(rootDir, args) {
|
|
59870
|
+
const res = spawnSync15("git", [...args], {
|
|
59871
|
+
cwd: rootDir,
|
|
59872
|
+
timeout: EXECUTION_AUDIT_GIT_TIMEOUT_MS,
|
|
59873
|
+
maxBuffer: SPAWN_MAX_BUFFER_BYTES,
|
|
59874
|
+
encoding: "utf8",
|
|
59875
|
+
windowsHide: true
|
|
59876
|
+
});
|
|
59877
|
+
return {
|
|
59878
|
+
status: res.status,
|
|
59879
|
+
stdout: res.stdout ?? "",
|
|
59880
|
+
stderr: res.stderr ?? "",
|
|
59881
|
+
error: res.error?.message ?? null
|
|
59882
|
+
};
|
|
59883
|
+
}
|
|
59884
|
+
function splitNulList(stdout) {
|
|
59885
|
+
return stdout.split("\0").filter((entry) => entry.length > 0).map((entry) => toPosix(entry));
|
|
59886
|
+
}
|
|
59887
|
+
function pathHasSkippedSegment(posixPath) {
|
|
59888
|
+
return posixPath.split("/").some((segment) => RECON_SKIP_DIRS.has(segment));
|
|
59889
|
+
}
|
|
59890
|
+
function normalizedDirIdentity(path) {
|
|
59891
|
+
let resolved = path;
|
|
59892
|
+
try {
|
|
59893
|
+
resolved = realpathSync(path);
|
|
59894
|
+
} catch {
|
|
59895
|
+
resolved = resolve2(path);
|
|
59896
|
+
}
|
|
59897
|
+
return toPosix(resolved).toLowerCase().replace(/\/$/, "");
|
|
59898
|
+
}
|
|
59899
|
+
function sameDirectoryIdentity(a, b) {
|
|
59900
|
+
if (normalizedDirIdentity(a) === normalizedDirIdentity(b))
|
|
59901
|
+
return true;
|
|
59902
|
+
try {
|
|
59903
|
+
const sa = statSync5(a, { bigint: true });
|
|
59904
|
+
const sb = statSync5(b, { bigint: true });
|
|
59905
|
+
return sa.dev === sb.dev && sa.ino === sb.ino && sa.ino !== 0n;
|
|
59906
|
+
} catch {
|
|
59907
|
+
return false;
|
|
59908
|
+
}
|
|
59909
|
+
}
|
|
59910
|
+
async function runExecutionAudit(rootDir, input) {
|
|
59911
|
+
const executionResolution = resolveExecutionId(input.executionId, void 0);
|
|
59912
|
+
if ("fail" in executionResolution || executionResolution.executionId === null) {
|
|
59913
|
+
return executionAuditFail({
|
|
59914
|
+
code: "SCHEMA_INVALID",
|
|
59915
|
+
message: "fail" in executionResolution ? executionResolution.fail : `execution_id \u7F3A\u5E2D\uFF08OBS \u56DE\u6267 execution_id \u5FC5\u586B\u2014\u2014\xA76.13 \u8BC1\u660E\u4E49\u52A1\uFF09`,
|
|
59916
|
+
hint: "\u5148 pomaster execution begin \u767B\u8BB0\u6267\u884C\u8EAB\u4EFD\uFF08AGX-n\uFF09\uFF0C\u518D\u4EE5 --execution-id \u4F20\u5165\uFF08S1 \u7981\u81EA\u9020\u8EAB\u4EFD\uFF09\u3002"
|
|
59917
|
+
});
|
|
59918
|
+
}
|
|
59919
|
+
const executionId = executionResolution.executionId;
|
|
59920
|
+
const diffBase = typeof input.diffBase === "string" ? input.diffBase.trim() : "";
|
|
59921
|
+
if (diffBase.length === 0) {
|
|
59922
|
+
return executionAuditFail({
|
|
59923
|
+
code: "MUTATION_SCOPE_NO_ANCHOR",
|
|
59924
|
+
message: "--diff-base \u7F3A\u5E2D\uFF08git diff \u8D77\u59CB\u951A\u5FC5\u586B\u2014\u2014execution record \u5B9E\u8BFB\u786E\u8BA4\u65E0 ref/seq \u951A\u5B57\u6BB5\uFF0C\u951A\u7531\u8C03\u7528\u65B9\u7533\u62A5\uFF09",
|
|
59925
|
+
hint: "\u4EE5 execution begin \u65F6\u523B\u7684\u5DE5\u4F5C\u533A\u57FA\u7EBF ref\uFF08commit/branch/tag\uFF09\u4F20\u5165 --diff-base\uFF1B\u975E git \u5DE5\u4F5C\u533A\u5BA1\u8BA1\u4E0D\u53EF\u7528\uFF08PRD Out of Scope\uFF1A\u65E0\u7248\u672C\u951A\u663E\u5F0F\u62A5\u9519\uFF0C\u4E0D\u505A fs \u5FEB\u7167\u515C\u5E95\uFF09\u3002"
|
|
59926
|
+
});
|
|
59927
|
+
}
|
|
59928
|
+
const initialized = await requireInitialized(rootDir);
|
|
59929
|
+
if ("error" in initialized)
|
|
59930
|
+
return executionAuditFail(initialized.error);
|
|
59931
|
+
let executionRecord;
|
|
59932
|
+
try {
|
|
59933
|
+
executionRecord = readExecutionRecordById(buildStorePaths(rootDir), executionId);
|
|
59934
|
+
} catch (error) {
|
|
59935
|
+
if (error instanceof GovernanceError)
|
|
59936
|
+
return executionAuditFail(governanceErrorToCliError(error));
|
|
59937
|
+
throw error;
|
|
59938
|
+
}
|
|
59939
|
+
if (executionRecord === null) {
|
|
59940
|
+
return executionAuditFail({
|
|
59941
|
+
code: "EXECUTION_NOT_FOUND",
|
|
59942
|
+
message: `execution_id \u672A\u767B\u8BB0\uFF08executions/ \u6863\u6848\u7F3A\u5931\uFF09\uFF1A${executionId}`,
|
|
59943
|
+
hint: "\u5148 pomaster execution begin \u767B\u8BB0\u6267\u884C\u8EAB\u4EFD\uFF08.pomaster/executions/AGX-*.json \u662F\u8EAB\u4EFD\u552F\u4E00\u4E8B\u5B9E\u6E90\uFF09\uFF1B\u5DF2\u5C01\u53E3\u6267\u884C\u5141\u8BB8\u4E8B\u540E\u5BA1\u8BA1\u3002"
|
|
59944
|
+
});
|
|
59945
|
+
}
|
|
59946
|
+
const toplevel = gitRun(rootDir, ["rev-parse", "--show-toplevel"]);
|
|
59947
|
+
if (toplevel.error !== null || toplevel.status !== 0 || toplevel.stdout.trim().length === 0) {
|
|
59948
|
+
return executionAuditFail({
|
|
59949
|
+
code: "MUTATION_SCOPE_NOT_GIT_WORKTREE",
|
|
59950
|
+
message: `\u975E git \u5DE5\u4F5C\u533A\uFF08git rev-parse --show-toplevel \u5931\u8D25\uFF1A${toplevel.error ?? `exit ${String(toplevel.status)}`}\uFF09\u2014\u2014\u65E0\u7248\u672C\u951A\u5BA1\u8BA1\u4E0D\u53EF\u7528\uFF0C\u96F6\u843D\u76D8`,
|
|
59951
|
+
hint: "PRD Out of Scope\uFF1A\u975E git \u5DE5\u4F5C\u533A\u663E\u5F0F\u62A5\u9519\uFF0C\u4E0D\u505A fs \u5FEB\u7167\u515C\u5E95\uFF1B\u786E\u8BA4\u5BBF\u4E3B\u9879\u76EE\u4E3A git \u4ED3\u5E93\u540E\u91CD\u8DD1\u3002"
|
|
59952
|
+
});
|
|
59953
|
+
}
|
|
59954
|
+
if (!sameDirectoryIdentity(toplevel.stdout.trim(), rootDir)) {
|
|
59955
|
+
return executionAuditFail({
|
|
59956
|
+
code: "MUTATION_SCOPE_NOT_WORKTREE_ROOT",
|
|
59957
|
+
message: `store \u6839\u975E worktree \u6839\uFF08toplevel=${toPosix(toplevel.stdout.trim())} \u2260 root=${toPosix(resolve2(rootDir))}\uFF09\u2014\u2014diff \u8DEF\u5F84\u9762\u53EA\u5BF9 worktree \u6839\u6210\u7ACB\uFF0C\u7981\u8DEF\u5F84\u524D\u7F00\u63A8\u65AD`,
|
|
59958
|
+
hint: "\u5728 git worktree \u6839\uFF08.pomaster/ \u6240\u5728\u7684\u4ED3\u5E93\u6839\uFF09\u91CD\u8DD1\uFF1B\u5B50\u76EE\u5F55 store \u4E0D\u5728\u672C\u901A\u8DEF\u652F\u6301\u9762\u3002"
|
|
59959
|
+
});
|
|
59960
|
+
}
|
|
59961
|
+
const baseResolved = gitRun(rootDir, ["rev-parse", "--verify", "--quiet", diffBase]);
|
|
59962
|
+
const baseResolvedSha = baseResolved.stdout.trim();
|
|
59963
|
+
if (baseResolved.error !== null || baseResolved.status !== 0 || baseResolvedSha.length === 0) {
|
|
59964
|
+
return executionAuditFail({
|
|
59965
|
+
code: "MUTATION_SCOPE_BAD_BASE",
|
|
59966
|
+
message: `--diff-base \u65E0\u6CD5\u89E3\u6790\u4E3A\u5BF9\u8C61\uFF08git rev-parse --verify ${diffBase} \u5931\u8D25\uFF1A${baseResolved.error ?? `exit ${String(baseResolved.status)}`}\uFF09\u2014\u2014\u96F6\u843D\u76D8`,
|
|
59967
|
+
hint: "\u8D77\u59CB\u951A\u987B\u4E3A\u53EF\u89E3\u6790\u7684 commit/branch/tag\uFF08\u5982 execution begin \u65F6\u7684 HEAD sha\uFF09\uFF1Bgit rev-parse <ref> \u53EF\u5148\u884C\u4EBA\u5DE5\u5BF9\u8D26\u3002"
|
|
59968
|
+
});
|
|
59969
|
+
}
|
|
59970
|
+
const trackedRun = gitRun(rootDir, ["diff", "--name-only", "-z", baseResolvedSha]);
|
|
59971
|
+
if (trackedRun.error !== null || trackedRun.status !== 0) {
|
|
59972
|
+
return executionAuditFail({
|
|
59973
|
+
code: "MUTATION_SCOPE_GIT_FAILED",
|
|
59974
|
+
message: `git diff \u6536\u96C6\u5931\u8D25\uFF08exit=${String(trackedRun.status)}, error=${trackedRun.error ?? "unknown"}\uFF09\u2014\u2014diff \u9762\u4E0D\u53EF\u5F97\u96F6\u843D\u76D8${trackedRun.stderr.trim().length > 0 ? `\uFF1Bstderr \u6458\u5F55\uFF1A${trackedRun.stderr.trim().slice(0, 200)}` : ""}`,
|
|
59975
|
+
hint: "\u6838\u67E5 git \u53EF\u7528\u6027\u4E0E\u4ED3\u5E93\u5065\u5EB7\uFF08git status\uFF09\u540E\u91CD\u8DD1\uFF1B\u8D85\u65F6\u4E0A\u754C 120s\u3002"
|
|
59976
|
+
});
|
|
59977
|
+
}
|
|
59978
|
+
const untrackedRun = gitRun(rootDir, ["ls-files", "--others", "--exclude-standard", "-z"]);
|
|
59979
|
+
if (untrackedRun.error !== null || untrackedRun.status !== 0) {
|
|
59980
|
+
return executionAuditFail({
|
|
59981
|
+
code: "MUTATION_SCOPE_GIT_FAILED",
|
|
59982
|
+
message: `git ls-files \u6536\u96C6\u5931\u8D25\uFF08untracked \u9762\uFF1Bexit=${String(untrackedRun.status)}, error=${untrackedRun.error ?? "unknown"}\uFF09\u2014\u2014diff \u9762\u4E0D\u53EF\u5F97\u96F6\u843D\u76D8`,
|
|
59983
|
+
hint: "\u6838\u67E5 git \u53EF\u7528\u6027\u540E\u91CD\u8DD1\u3002"
|
|
59984
|
+
});
|
|
59985
|
+
}
|
|
59986
|
+
const trackedPaths = splitNulList(trackedRun.stdout);
|
|
59987
|
+
const untrackedPaths = splitNulList(untrackedRun.stdout);
|
|
59988
|
+
const merged = [.../* @__PURE__ */ new Set([...trackedPaths, ...untrackedPaths])];
|
|
59989
|
+
const excludedPaths = merged.filter((path) => pathHasSkippedSegment(path)).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
59990
|
+
const changedPaths = merged.filter((path) => !pathHasSkippedSegment(path)).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
59991
|
+
const table = loadKeybindingTable(rootDir);
|
|
59992
|
+
const permitLoad = loadPermitScopes(rootDir, executionRecord.permit_ids, initialized.seq);
|
|
59993
|
+
if ("error" in permitLoad)
|
|
59994
|
+
return executionAuditFail(permitLoad.error);
|
|
59995
|
+
const scopes = permitLoad.scopes;
|
|
59996
|
+
const missingPermits = permitLoad.missing;
|
|
59997
|
+
const judgments = judgeMutationScope(changedPaths, table.rows, scopes);
|
|
59998
|
+
const inScopeItems = judgments.filter((item) => item.classification === "in_scope");
|
|
59999
|
+
const outScopeItems = judgments.filter((item) => item.classification === "out_of_scope");
|
|
60000
|
+
const unmappedItems = judgments.filter((item) => item.classification === "unmapped");
|
|
60001
|
+
try {
|
|
60002
|
+
const storePaths = buildStorePaths(rootDir);
|
|
60003
|
+
const reportBytes = Buffer.from(`${JSON.stringify({
|
|
60004
|
+
audit_surface: "mutation-scope",
|
|
60005
|
+
execution_id: executionRecord.execution_id,
|
|
60006
|
+
execution_started_at: executionRecord.started_at,
|
|
60007
|
+
execution_ended_at: executionRecord.ended_at,
|
|
60008
|
+
diff_base: diffBase,
|
|
60009
|
+
diff_base_resolved: baseResolvedSha,
|
|
60010
|
+
counts: {
|
|
60011
|
+
tracked_changed: trackedPaths.length,
|
|
60012
|
+
untracked: untrackedPaths.length,
|
|
60013
|
+
changed_files: changedPaths.length,
|
|
60014
|
+
in_scope: inScopeItems.length,
|
|
60015
|
+
out_of_scope: outScopeItems.length,
|
|
60016
|
+
unmapped: unmappedItems.length,
|
|
60017
|
+
excluded_skip_dirs: excludedPaths.length,
|
|
60018
|
+
binding_files: table.files,
|
|
60019
|
+
binding_rows: table.rows.length,
|
|
60020
|
+
binding_rows_path_anchored: table.rows.filter((row2) => row2.bindingClass !== "contract_operation_to_operationId").length,
|
|
60021
|
+
binding_rows_non_path: table.rows.filter((row2) => row2.bindingClass === "contract_operation_to_operationId").length,
|
|
60022
|
+
binding_rows_malformed: table.malformed.length,
|
|
60023
|
+
permits: scopes.length,
|
|
60024
|
+
permits_missing: missingPermits.length
|
|
60025
|
+
},
|
|
60026
|
+
in_scope: inScopeItems,
|
|
60027
|
+
out_of_scope: outScopeItems,
|
|
60028
|
+
unmapped: unmappedItems,
|
|
60029
|
+
excluded_paths: excludedPaths,
|
|
60030
|
+
malformed_rows: table.malformed,
|
|
60031
|
+
binding_table_present: table.present,
|
|
60032
|
+
permits_view: scopes.map((permit) => ({
|
|
60033
|
+
permit_ref: permit.permit_ref,
|
|
60034
|
+
status: permit.status,
|
|
60035
|
+
subject_ids: permit.subject_ids
|
|
60036
|
+
}))
|
|
60037
|
+
}, null, 2)}
|
|
60038
|
+
`, "utf8");
|
|
60039
|
+
const blob = persistEvidenceArtifact(storePaths.evidenceDir, {
|
|
60040
|
+
media: "json",
|
|
60041
|
+
bytes: reportBytes
|
|
60042
|
+
});
|
|
60043
|
+
const observationId = allocateObservationId(storePaths.observationsDir);
|
|
60044
|
+
const receipt = buildObservationReceipt({
|
|
60045
|
+
observationId,
|
|
60046
|
+
executionId,
|
|
60047
|
+
sensorCapability: EXECUTION_AUDIT_SENSOR_CAPABILITY,
|
|
60048
|
+
adapter: EXECUTION_AUDIT_ADAPTER,
|
|
60049
|
+
operation: EXECUTION_AUDIT_OPERATION,
|
|
60050
|
+
surface: "STRUCTURAL_REALITY",
|
|
60051
|
+
result: "OBSERVED",
|
|
60052
|
+
capturedAtSeq: initialized.seq,
|
|
60053
|
+
artifactRefs: [
|
|
60054
|
+
{
|
|
60055
|
+
sha256: blob.sha256,
|
|
60056
|
+
media: blob.media,
|
|
60057
|
+
byteSize: blob.byteSize,
|
|
60058
|
+
storagePath: blob.storagePath
|
|
60059
|
+
}
|
|
60060
|
+
],
|
|
60061
|
+
normalizedFacts: [
|
|
60062
|
+
"audit_surface: mutation-scope",
|
|
60063
|
+
`diff_base_resolved: ${baseResolvedSha}`,
|
|
60064
|
+
`tracked_changed: ${String(trackedPaths.length)}`,
|
|
60065
|
+
`untracked: ${String(untrackedPaths.length)}`,
|
|
60066
|
+
`changed_files: ${String(changedPaths.length)}`,
|
|
60067
|
+
`in_scope: ${String(inScopeItems.length)}`,
|
|
60068
|
+
`out_of_scope: ${String(outScopeItems.length)}`,
|
|
60069
|
+
`unmapped: ${String(unmappedItems.length)}`,
|
|
60070
|
+
`excluded_skip_dirs: ${String(excludedPaths.length)}`,
|
|
60071
|
+
`binding_rows: ${String(table.rows.length)}`,
|
|
60072
|
+
`binding_rows_malformed: ${String(table.malformed.length)}`,
|
|
60073
|
+
`permits: ${String(scopes.length)}`,
|
|
60074
|
+
`permits_missing: ${String(missingPermits.length)}`,
|
|
60075
|
+
...changedPaths.length === 0 ? ["zero_diff: true"] : []
|
|
60076
|
+
]
|
|
60077
|
+
});
|
|
60078
|
+
const persisted = persistObservationRecord(storePaths.evidenceDir, observationRecordOf(receipt));
|
|
60079
|
+
const receiptPath = `${POMASTER_DIR}/evidence/${persisted.relativePath}`;
|
|
60080
|
+
const human = [
|
|
60081
|
+
`execution audit: OBSERVED \u2014 \u53D8\u66F4\u6587\u4EF6 ${String(changedPaths.length)}\uFF08in ${String(inScopeItems.length)} / out ${String(outScopeItems.length)} / unmapped ${String(unmappedItems.length)}\uFF1Bexcluded ${String(excludedPaths.length)}\u2014\u2014node_modules/dist/.git/coverage/.pomaster \u6392\u9664\u95ED\u5305\uFF09`,
|
|
60082
|
+
`diff \u951A: ${diffBase} \u2192 ${baseResolvedSha}\uFF08execution ${executionRecord.execution_id} started_at=${executionRecord.started_at}\u2014\u2014\u951A\u7531\u8C03\u7528\u65B9\u7533\u62A5\uFF0Cexecution record \u65E0 ref/seq \u951A\u5B57\u6BB5\uFF09`
|
|
60083
|
+
];
|
|
60084
|
+
if (outScopeItems.length > 0) {
|
|
60085
|
+
human.push(`\u8D8A\u754C\uFF08${String(outScopeItems.length)} \u9879\u2014\u2014\u53D8\u66F4\u8DEF\u5F84 \u2209 permit scope\uFF0C\u5904\u7F6E\u5F52 Owner\uFF09\uFF1A`);
|
|
60086
|
+
for (const item of outScopeItems.slice(0, EXECUTION_AUDIT_PRESENTATION_CAP)) {
|
|
60087
|
+
human.push(` - ${item.path} \u2014 ${item.basis}`);
|
|
60088
|
+
}
|
|
60089
|
+
if (outScopeItems.length > EXECUTION_AUDIT_PRESENTATION_CAP) {
|
|
60090
|
+
human.push(` \u2026\uFF08\u5176\u4F59 ${String(outScopeItems.length - EXECUTION_AUDIT_PRESENTATION_CAP)} \u6761\u89C1 report blob ${blob.storagePath}\uFF09`);
|
|
60091
|
+
}
|
|
60092
|
+
}
|
|
60093
|
+
if (unmappedItems.length > 0) {
|
|
60094
|
+
human.push(`unmapped\uFF08${String(unmappedItems.length)} \u6761\u2014\u2014\u65E0 KEYBINDING \u5728\u518C\u7ED1\u5B9A\u547D\u4E2D\uFF0C\u8BDA\u5B9E\u6E05\u5355\u975E\u9519\u8BEF${table.present ? "" : "\uFF1B\u672C\u5DE5\u4F5C\u533A\u65E0 KEYBINDING \u7ED1\u5B9A\u8868\uFF08\u5168 unmapped \u5408\u6CD5\u6001\uFF09"}\uFF09\uFF1A`);
|
|
60095
|
+
for (const item of unmappedItems.slice(0, EXECUTION_AUDIT_PRESENTATION_CAP)) {
|
|
60096
|
+
human.push(` - ${item.path}`);
|
|
60097
|
+
}
|
|
60098
|
+
if (unmappedItems.length > EXECUTION_AUDIT_PRESENTATION_CAP) {
|
|
60099
|
+
human.push(` \u2026\uFF08\u5176\u4F59 ${String(unmappedItems.length - EXECUTION_AUDIT_PRESENTATION_CAP)} \u6761\u89C1 report blob ${blob.storagePath}\uFF09`);
|
|
60100
|
+
}
|
|
60101
|
+
}
|
|
60102
|
+
human.push(`binding \u8868: ${String(table.files)} \u6587\u4EF6 / ${String(table.rows.length)} \u884C\uFF08path-anchored ${String(table.rows.length - table.rows.filter((row2) => row2.bindingClass === "contract_operation_to_operationId").length)} / non-path(operationId) ${String(table.rows.filter((row2) => row2.bindingClass === "contract_operation_to_operationId").length)} / malformed ${String(table.malformed.length)}${table.present ? "" : "\uFF1B\u76EE\u5F55\u7F3A\u5E2D=\u65E0\u8868"})`, `permit scope \u9762: ${String(scopes.length)} \u4E2A permit\uFF08${scopes.map((permit) => `${permit.permit_ref}:${permit.status}`).join(", ") || "\u65E0"}\uFF09+ missing ${String(missingPermits.length)}`, `report blob: ${blob.storagePath}\uFF08${blob.sha256}\uFF1Bmedia=json\u2014\u2014\u4E09\u5206\u7C7B\u5168\u91CF\u6E05\u5355/\u6392\u9664\u6E05\u5355/malformed \u884C\u8F7D\u4F53\uFF09`, `observation receipt: ${receiptPath}\uFF08result=OBSERVED\uFF1Bsurface=STRUCTURAL_REALITY\uFF1Bcaptured_at_seq=${String(initialized.seq)}\uFF09`, "\u96F6\u6743\u5A01\u5199\u53E3\uFF1A\u4EA7\u7269\u53EA\u843D evidence/{blobs,observations}/ sidecar\uFF08\u5B57\u8282\u5FEB\u7167\u6D4B\u8BD5\u9489\uFF09\uFF1B\u8D8A\u754C\u5448\u62A5\u4E0D\u963B\u65AD\u2014\u2014\u5904\u7F6E\u5F52 Owner\uFF08Detection \u534A\u8FB9\uFF09");
|
|
60103
|
+
const warnings = [];
|
|
60104
|
+
if (missingPermits.length > 0) {
|
|
60105
|
+
warnings.push({
|
|
60106
|
+
code: "PERMIT_REF_UNRESOLVED",
|
|
60107
|
+
message: `execution.permit_ids \u5F15\u7528\u7684 ${String(missingPermits.length)} \u4E2A permit \u672A\u5728\u53F0\u8D26\u89E3\u6790\uFF08scope \u9762\u6536\u7A84\u2014\u2014\u7F3A\u5931 scope \u4E0D\u6388\u4E88 in-scope\uFF09\uFF1A${missingPermits.join("; ")}`,
|
|
60108
|
+
hint: "\u6838\u67E5 execution begin --permit \u4E0E permit issue \u53F0\u8D26\uFF08state/permits.json\uFF09\u5BF9\u8D26\uFF1B\u5F15\u7528\u7F3A\u5931\u5C5E\u62AB\u9732\u975E\u653E\u884C\u3002"
|
|
60109
|
+
});
|
|
60110
|
+
}
|
|
60111
|
+
if (table.malformed.length > 0) {
|
|
60112
|
+
warnings.push({
|
|
60113
|
+
code: "KEYBINDING_ROW_MALFORMED",
|
|
60114
|
+
message: `${String(table.malformed.length)} \u4E2A KEYBINDING \u884C\u8BCD\u5F62\u6821\u9A8C\u5931\u8D25\uFF08\u5DF2\u62AB\u9732\u975E\u9759\u9ED8\u8DF3\u8FC7\uFF0C\u4E0D\u5165\u6620\u5C04\u5206\u6BCD\uFF09\uFF1A${table.malformed.map((row2) => row2.file).join("; ")}`,
|
|
60115
|
+
hint: "04-keybinding \u884C\u5BF9\u8C61\u8BCD\u5F62\u5951\u7EA6\u89C1 packages/schemas/assets/04-keybinding.schema.json\uFF1Bmalformed \u6E05\u5355\u5DF2\u968F report blob \u843D\u76D8\u3002"
|
|
60116
|
+
});
|
|
60117
|
+
}
|
|
60118
|
+
const result2 = {
|
|
60119
|
+
observation: "OBSERVED",
|
|
60120
|
+
observation_id: receipt.observation_id,
|
|
60121
|
+
receipt_path: receiptPath,
|
|
60122
|
+
execution_id: executionRecord.execution_id,
|
|
60123
|
+
diff_base: diffBase,
|
|
60124
|
+
diff_base_resolved: baseResolvedSha,
|
|
60125
|
+
captured_at_seq: initialized.seq,
|
|
60126
|
+
changed_files: changedPaths.length,
|
|
60127
|
+
in_scope: inScopeItems.length,
|
|
60128
|
+
out_of_scope: outScopeItems.length,
|
|
60129
|
+
unmapped: unmappedItems.length,
|
|
60130
|
+
excluded_skip_dirs: excludedPaths.length,
|
|
60131
|
+
tracked_changed: trackedPaths.length,
|
|
60132
|
+
untracked: untrackedPaths.length,
|
|
60133
|
+
binding_files: table.files,
|
|
60134
|
+
binding_rows: table.rows.length,
|
|
60135
|
+
binding_rows_path_anchored: table.rows.filter((row2) => row2.bindingClass !== "contract_operation_to_operationId").length,
|
|
60136
|
+
binding_rows_non_path: table.rows.filter((row2) => row2.bindingClass === "contract_operation_to_operationId").length,
|
|
60137
|
+
binding_rows_malformed: table.malformed.length,
|
|
60138
|
+
permits: scopes.length,
|
|
60139
|
+
permits_missing: missingPermits.length,
|
|
60140
|
+
out_of_scope_items: outScopeItems,
|
|
60141
|
+
report_blob: {
|
|
60142
|
+
sha256: blob.sha256,
|
|
60143
|
+
storage_path: blob.storagePath,
|
|
60144
|
+
byte_size: blob.byteSize
|
|
60145
|
+
},
|
|
60146
|
+
out_of_scope_stdout_capped: outScopeItems.length > EXECUTION_AUDIT_PRESENTATION_CAP
|
|
60147
|
+
};
|
|
60148
|
+
if (outScopeItems.length > 0) {
|
|
60149
|
+
return failOutcome("execution audit", result2, [
|
|
60150
|
+
{
|
|
60151
|
+
code: "MUTATION_SCOPE_OUT_OF_SCOPE",
|
|
60152
|
+
message: `\u8D8A\u754C\u53D8\u66F4 ${String(outScopeItems.length)} \u9879\uFF08execution ${executionRecord.execution_id} vs \u951A ${diffBase}\uFF09\uFF1A${outScopeItems.map((item) => item.path).join("; ")}`,
|
|
60153
|
+
hint: "\u8D8A\u754C\u660E\u7EC6\u89C1 stdout/result/report blob\uFF1B\u628A\u76EE\u6807\u5BF9\u8C61\u7EB3\u5165 permit \u8303\u56F4\u987B\u56DE FRAMEWORK LOCK \u91CD\u5BA1\u5347\u7EA7\uFF08D20\uFF09\uFF0C\u4E0D\u5F97\u65C1\u8DEF\u6269\u6743\u2014\u2014\u672C\u547D\u4EE4\u53EA\u89C2\u5BDF\u5448\u62A5\uFF0C\u5904\u7F6E\u5F52 Owner\u3002"
|
|
60154
|
+
}
|
|
60155
|
+
], human, warnings);
|
|
60156
|
+
}
|
|
60157
|
+
return okOutcome("execution audit", result2, human, warnings);
|
|
60158
|
+
} catch (error) {
|
|
60159
|
+
if (error instanceof GovernanceError)
|
|
60160
|
+
return executionAuditFail(governanceErrorToCliError(error));
|
|
60161
|
+
throw error;
|
|
60162
|
+
}
|
|
60163
|
+
}
|
|
60164
|
+
|
|
59585
60165
|
// packages/cli/dist/record.js
|
|
59586
60166
|
init_dist();
|
|
59587
|
-
import { existsSync as existsSync20, readFileSync as
|
|
60167
|
+
import { existsSync as existsSync20, readFileSync as readFileSync27 } from "node:fs";
|
|
59588
60168
|
function emptyGateRunResult() {
|
|
59589
60169
|
return {
|
|
59590
60170
|
grn: null,
|
|
@@ -59603,7 +60183,7 @@ function gateRunFail(error) {
|
|
|
59603
60183
|
}
|
|
59604
60184
|
function readFromBytes(path) {
|
|
59605
60185
|
try {
|
|
59606
|
-
return { bytes:
|
|
60186
|
+
return { bytes: readFileSync27(path, "utf8") };
|
|
59607
60187
|
} catch (err) {
|
|
59608
60188
|
return {
|
|
59609
60189
|
code: EVIDENCE_MALFORMED_CODE,
|
|
@@ -59741,7 +60321,7 @@ async function runRecordGateRun(rootDir, input) {
|
|
|
59741
60321
|
grn = input.grn;
|
|
59742
60322
|
let targetBytes = null;
|
|
59743
60323
|
try {
|
|
59744
|
-
targetBytes =
|
|
60324
|
+
targetBytes = readFileSync27(`${runsDir}/${grn}.json`, "utf8");
|
|
59745
60325
|
} catch {
|
|
59746
60326
|
targetBytes = null;
|
|
59747
60327
|
}
|
|
@@ -59963,7 +60543,7 @@ async function runRecordClaim(rootDir, input) {
|
|
|
59963
60543
|
clm = input.clm;
|
|
59964
60544
|
let targetBytes = null;
|
|
59965
60545
|
try {
|
|
59966
|
-
targetBytes =
|
|
60546
|
+
targetBytes = readFileSync27(`${claimsDir}/${clm}.json`, "utf8");
|
|
59967
60547
|
} catch {
|
|
59968
60548
|
targetBytes = null;
|
|
59969
60549
|
}
|
|
@@ -60077,7 +60657,7 @@ async function runRecordVerification(rootDir, input) {
|
|
|
60077
60657
|
const claimPath = `${claimsDirPath(rootDir)}/${input.clm}.json`;
|
|
60078
60658
|
let bytes = null;
|
|
60079
60659
|
try {
|
|
60080
|
-
bytes =
|
|
60660
|
+
bytes = readFileSync27(claimPath, "utf8");
|
|
60081
60661
|
} catch {
|
|
60082
60662
|
bytes = null;
|
|
60083
60663
|
}
|
|
@@ -60184,9 +60764,9 @@ async function runRecordVerification(rootDir, input) {
|
|
|
60184
60764
|
// packages/cli/dist/closeout.js
|
|
60185
60765
|
init_dist();
|
|
60186
60766
|
init_src();
|
|
60187
|
-
import { readdirSync as
|
|
60767
|
+
import { readdirSync as readdirSync21 } from "node:fs";
|
|
60188
60768
|
import { readFile as readFile13 } from "node:fs/promises";
|
|
60189
|
-
import { join as
|
|
60769
|
+
import { join as join12 } from "node:path";
|
|
60190
60770
|
function emptyResult4(task) {
|
|
60191
60771
|
return {
|
|
60192
60772
|
task,
|
|
@@ -60251,7 +60831,7 @@ function grnOrdinal(grn) {
|
|
|
60251
60831
|
var GRN_SIDECAR_PATTERN = /^GRN-[0-9]+(?:\..+)?$/;
|
|
60252
60832
|
function listGrnSidecarFiles(runsDir) {
|
|
60253
60833
|
try {
|
|
60254
|
-
return
|
|
60834
|
+
return readdirSync21(runsDir).filter((name) => GRN_SIDECAR_PATTERN.test(name) && !name.endsWith(".json")).sort();
|
|
60255
60835
|
} catch {
|
|
60256
60836
|
return [];
|
|
60257
60837
|
}
|
|
@@ -60259,7 +60839,7 @@ function listGrnSidecarFiles(runsDir) {
|
|
|
60259
60839
|
async function readRunRecord(runsDir, fileName) {
|
|
60260
60840
|
let parsed;
|
|
60261
60841
|
try {
|
|
60262
|
-
parsed = JSON.parse(await readFile13(
|
|
60842
|
+
parsed = JSON.parse(await readFile13(join12(runsDir, fileName), "utf8"));
|
|
60263
60843
|
} catch (err) {
|
|
60264
60844
|
return { damage: `evidence/runs/${fileName}: JSON \u65E0\u6CD5\u89E3\u6790 \u2014 ${err instanceof Error ? err.message : String(err)}` };
|
|
60265
60845
|
}
|
|
@@ -60280,7 +60860,7 @@ async function readRunRecord(runsDir, fileName) {
|
|
|
60280
60860
|
async function readClaimRecord(claimsDir, fileName) {
|
|
60281
60861
|
let bytes;
|
|
60282
60862
|
try {
|
|
60283
|
-
bytes = await readFile13(
|
|
60863
|
+
bytes = await readFile13(join12(claimsDir, fileName), "utf8");
|
|
60284
60864
|
} catch {
|
|
60285
60865
|
return { missing: true };
|
|
60286
60866
|
}
|
|
@@ -60343,7 +60923,7 @@ async function runCloseout(rootDir, input) {
|
|
|
60343
60923
|
hint: "change \u7684\u5B8C\u6210\u5224\u5377\u7ECF\u7531\u5176 affected TASKs \u9010\u4EFB\u52A1 closeout\uFF1Bkind \u8BCD\u5F62\u89C1 02b kind-payloads\u3002"
|
|
60344
60924
|
}, withKind);
|
|
60345
60925
|
}
|
|
60346
|
-
const bodyPath =
|
|
60926
|
+
const bodyPath = join12(rootDir, POMASTER_DIR, ...row2.bodyRef.split("/"));
|
|
60347
60927
|
let bodyRaw;
|
|
60348
60928
|
try {
|
|
60349
60929
|
bodyRaw = await readFile13(bodyPath, "utf8");
|
|
@@ -60480,7 +61060,7 @@ async function runCloseout(rootDir, input) {
|
|
|
60480
61060
|
const claimsDirForSpec = claimsDirPath(rootDir);
|
|
60481
61061
|
const specRows = index.objects.filter((row3) => row3.id.startsWith("SPEC."));
|
|
60482
61062
|
for (const specRow of specRows) {
|
|
60483
|
-
const specBodyPath =
|
|
61063
|
+
const specBodyPath = join12(rootDir, POMASTER_DIR, ...specRow.bodyRef.split("/"));
|
|
60484
61064
|
let specRaw;
|
|
60485
61065
|
try {
|
|
60486
61066
|
specRaw = await readFile13(specBodyPath, "utf8");
|
|
@@ -60866,7 +61446,7 @@ function kernelErrorOf2(err) {
|
|
|
60866
61446
|
// packages/cli/dist/catalog.js
|
|
60867
61447
|
init_dist();
|
|
60868
61448
|
import { writeFileSync as writeFileSync5 } from "node:fs";
|
|
60869
|
-
import { join as
|
|
61449
|
+
import { join as join13 } from "node:path";
|
|
60870
61450
|
function emptyMaterial() {
|
|
60871
61451
|
return {
|
|
60872
61452
|
title_zh: null,
|
|
@@ -61084,7 +61664,7 @@ async function runCatalogRelock(deps) {
|
|
|
61084
61664
|
try {
|
|
61085
61665
|
catalogRoot = catalogRootOf(deps);
|
|
61086
61666
|
report = relockCatalog(catalogRoot);
|
|
61087
|
-
writeFileSync5(
|
|
61667
|
+
writeFileSync5(join13(catalogRoot, LOCK_FILE_NAME), `${JSON.stringify(report.next, null, 2)}
|
|
61088
61668
|
`, "utf8");
|
|
61089
61669
|
verification = verifyCatalogLock(catalogRoot);
|
|
61090
61670
|
} catch (error) {
|
|
@@ -61433,7 +62013,7 @@ async function runGraph(input) {
|
|
|
61433
62013
|
}
|
|
61434
62014
|
|
|
61435
62015
|
// packages/cli/dist/eval.js
|
|
61436
|
-
import { existsSync as existsSync21, readFileSync as
|
|
62016
|
+
import { existsSync as existsSync21, readFileSync as readFileSync28 } from "node:fs";
|
|
61437
62017
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
61438
62018
|
init_dist();
|
|
61439
62019
|
var EVAL_SUITES = ["behavioral"];
|
|
@@ -61454,7 +62034,7 @@ function loadSeeds(seedsPath = BEHAVIORAL_SEEDS_PATH) {
|
|
|
61454
62034
|
if (lower.endsWith(".yaml") || lower.endsWith(".yml")) {
|
|
61455
62035
|
throw new Error(`eval \u547D\u4EE4\u6D88\u8D39\u9762\u4E3A seeds.json\uFF0C\u4E0D\u63A5\u53D7 yaml \u8F7D\u7269\uFF08${seedsPath}\uFF09\u3002PRD \xA794.2 yaml \u8F7D\u7269\uFF08tests/behavioral/eval-cases.yaml\uFF09\u662F\u767B\u8BB0\u5F62\u6001\uFF1Aschema \u6821\u9A8C\u4E0E json \u540C\u6784\u951A\u5B9A\u5728 tests/behavioral/eval-carrier.spec.ts\uFF08js-yaml devDependency + ajv\uFF0Ctests \u9762\uFF09\uFF1B\u5224\u5377\u8BF7\u6CE8\u5165 seeds.json \u6216\u7701\u7565 seedsPath \u7528\u4ED3\u5E93\u7F3A\u7701\u8D26\u672C\u3002`);
|
|
61456
62036
|
}
|
|
61457
|
-
const raw = JSON.parse(
|
|
62037
|
+
const raw = JSON.parse(readFileSync28(seedsPath, "utf8"));
|
|
61458
62038
|
const file = raw;
|
|
61459
62039
|
if (!Array.isArray(file.seeds)) {
|
|
61460
62040
|
throw new Error(`seeds.json \u5F62\u6001\u975E\u6CD5\uFF1A\u7F3A seeds \u6570\u7EC4\uFF08${seedsPath}\uFF09`);
|
|
@@ -62025,7 +62605,7 @@ async function runAuditTask(rootDir, input) {
|
|
|
62025
62605
|
init_dist();
|
|
62026
62606
|
init_src();
|
|
62027
62607
|
import { readFile as readFile15 } from "node:fs/promises";
|
|
62028
|
-
import { join as
|
|
62608
|
+
import { join as join14 } from "node:path";
|
|
62029
62609
|
async function runLedgerRecord(rootDir, input, deps) {
|
|
62030
62610
|
const emptyResult6 = {
|
|
62031
62611
|
ledger_ref: "",
|
|
@@ -62114,7 +62694,7 @@ async function runLedgerRecord(rootDir, input, deps) {
|
|
|
62114
62694
|
}
|
|
62115
62695
|
async function runLedgerList(rootDir, input) {
|
|
62116
62696
|
const classificationFilter = input.classification?.trim() ? input.classification.trim() : null;
|
|
62117
|
-
const path =
|
|
62697
|
+
const path = join14(rootDir, POMASTER_DIR, "state", "exception-ledger.json");
|
|
62118
62698
|
let raw;
|
|
62119
62699
|
try {
|
|
62120
62700
|
raw = await readFile15(path, "utf8");
|
|
@@ -62204,30 +62784,30 @@ async function runLedgerList(rootDir, input) {
|
|
|
62204
62784
|
// packages/cli/dist/knowledge.js
|
|
62205
62785
|
init_dist();
|
|
62206
62786
|
import { existsSync as existsSync24 } from "node:fs";
|
|
62207
|
-
import { join as
|
|
62787
|
+
import { join as join17 } from "node:path";
|
|
62208
62788
|
|
|
62209
62789
|
// packages/cli/dist/research.js
|
|
62210
62790
|
init_src();
|
|
62211
62791
|
init_dist();
|
|
62212
62792
|
import { existsSync as existsSync23 } from "node:fs";
|
|
62213
62793
|
import { mkdir as mkdir2, readFile as readFile17, readdir as readdir2, writeFile as writeFile5 } from "node:fs/promises";
|
|
62214
|
-
import { join as
|
|
62794
|
+
import { join as join16 } from "node:path";
|
|
62215
62795
|
|
|
62216
62796
|
// packages/cli/dist/brainstorm.js
|
|
62217
62797
|
init_src();
|
|
62218
62798
|
init_dist();
|
|
62219
62799
|
import { existsSync as existsSync22 } from "node:fs";
|
|
62220
62800
|
import { mkdir, readdir, readFile as readFile16, writeFile as writeFile4 } from "node:fs/promises";
|
|
62221
|
-
import { isAbsolute, join as
|
|
62801
|
+
import { isAbsolute, join as join15, relative as relative2, resolve as resolve3 } from "node:path";
|
|
62222
62802
|
var PROMOTE_TARGETS = ["CHANGE", "TASK"];
|
|
62223
62803
|
function scratchpadRefOf(id) {
|
|
62224
62804
|
return `.pomaster/discovery/scratchpads/${id}/`;
|
|
62225
62805
|
}
|
|
62226
62806
|
function stateFilePath(rootDir, id) {
|
|
62227
|
-
return
|
|
62807
|
+
return join15(discoveryScratchpadDirPath(rootDir, id), "state.json");
|
|
62228
62808
|
}
|
|
62229
62809
|
function metaFilePath(rootDir, id) {
|
|
62230
|
-
return
|
|
62810
|
+
return join15(discoveryScratchpadDirPath(rootDir, id), "meta.json");
|
|
62231
62811
|
}
|
|
62232
62812
|
function cliError(err) {
|
|
62233
62813
|
if (err instanceof GovernedIdParseError) {
|
|
@@ -62851,7 +63431,7 @@ async function runBrainstormPromote(rootDir, input) {
|
|
|
62851
63431
|
let txPath = null;
|
|
62852
63432
|
let txOutError = null;
|
|
62853
63433
|
if (input.txOut !== void 0) {
|
|
62854
|
-
const resolvedTx =
|
|
63434
|
+
const resolvedTx = resolve3(rootDir, input.txOut);
|
|
62855
63435
|
const relPosix = relative2(rootDir, resolvedTx).split("\\").join("/");
|
|
62856
63436
|
const escapes = relPosix.length === 0 || relPosix === ".." || relPosix.startsWith("../") || isAbsolute(relPosix);
|
|
62857
63437
|
if (escapes) {
|
|
@@ -62881,7 +63461,7 @@ async function runBrainstormPromote(rootDir, input) {
|
|
|
62881
63461
|
return fail6(txOutError, [`brainstorm promote: FAILED \u2014 SCHEMA_INVALID (--tx-out)`]);
|
|
62882
63462
|
}
|
|
62883
63463
|
if (txPath === null) {
|
|
62884
|
-
txPath =
|
|
63464
|
+
txPath = join15(discoveryScratchpadDirPath(rootDir, input.discoveryId), "promote-tx.json");
|
|
62885
63465
|
}
|
|
62886
63466
|
try {
|
|
62887
63467
|
await mkdir(discoveryScratchpadDirPath(rootDir, input.discoveryId), { recursive: true });
|
|
@@ -63008,11 +63588,11 @@ var UNKNOWN_TRIAGE_KEYS = [
|
|
|
63008
63588
|
];
|
|
63009
63589
|
var DECISION_GRAPH_FILENAME = "decision-graph.json";
|
|
63010
63590
|
function decisionGraphPath(rootDir, id) {
|
|
63011
|
-
return
|
|
63591
|
+
return join15(discoveryScratchpadDirPath(rootDir, id), DECISION_GRAPH_FILENAME);
|
|
63012
63592
|
}
|
|
63013
63593
|
var DECISION_INPUTS_FILENAME = "decision-inputs.json";
|
|
63014
63594
|
function decisionInputsPath(rootDir, id) {
|
|
63015
|
-
return
|
|
63595
|
+
return join15(discoveryScratchpadDirPath(rootDir, id), DECISION_INPUTS_FILENAME);
|
|
63016
63596
|
}
|
|
63017
63597
|
async function loadDecisionGraph(rootDir, id) {
|
|
63018
63598
|
const graphPath = decisionGraphPath(rootDir, id);
|
|
@@ -63757,7 +64337,7 @@ async function resolveResearchHost(rootDir, hostOption) {
|
|
|
63757
64337
|
}
|
|
63758
64338
|
};
|
|
63759
64339
|
}
|
|
63760
|
-
if (!existsSync23(
|
|
64340
|
+
if (!existsSync23(join16(rootDir, ...host.split("/")))) {
|
|
63761
64341
|
return {
|
|
63762
64342
|
error: {
|
|
63763
64343
|
code: "RESEARCH_HOST_NOT_FOUND",
|
|
@@ -63782,7 +64362,7 @@ async function resolveResearchHost(rootDir, hostOption) {
|
|
|
63782
64362
|
const active = [];
|
|
63783
64363
|
for (const id of entries) {
|
|
63784
64364
|
try {
|
|
63785
|
-
const raw = JSON.parse(await readFile17(
|
|
64365
|
+
const raw = JSON.parse(await readFile17(join16(padsDir, id, "state.json"), "utf8"));
|
|
63786
64366
|
if (typeof raw.state === "string" && (raw.state === "DISCOVERY" || raw.state === "READY_TO_PROMOTE")) {
|
|
63787
64367
|
active.push(id);
|
|
63788
64368
|
}
|
|
@@ -63897,10 +64477,10 @@ async function runResearchStart(rootDir, input) {
|
|
|
63897
64477
|
const created = [];
|
|
63898
64478
|
const skipped = [];
|
|
63899
64479
|
try {
|
|
63900
|
-
const researchDir =
|
|
64480
|
+
const researchDir = join16(rootDir, ...artifactRoot.split("/"));
|
|
63901
64481
|
await mkdir2(researchDir, { recursive: true });
|
|
63902
64482
|
for (const fileName of RESEARCH_ARTIFACT_FILES) {
|
|
63903
|
-
const filePath =
|
|
64483
|
+
const filePath = join16(researchDir, fileName);
|
|
63904
64484
|
if (existsSync23(filePath)) {
|
|
63905
64485
|
skipped.push(`${artifactRoot}${fileName}`);
|
|
63906
64486
|
continue;
|
|
@@ -63972,7 +64552,7 @@ async function runResearchList(rootDir, hostArg) {
|
|
|
63972
64552
|
], [`research list: FAILED \u2014 SCHEMA_INVALID`]);
|
|
63973
64553
|
}
|
|
63974
64554
|
const hostRef = normalizeDir(hostArg);
|
|
63975
|
-
const hostDir =
|
|
64555
|
+
const hostDir = join16(rootDir, ...hostRef.split("/"));
|
|
63976
64556
|
if (!existsSync23(hostDir)) {
|
|
63977
64557
|
return failOutcome("research list", { host_ref: hostRef, artifacts: [] }, [
|
|
63978
64558
|
{
|
|
@@ -63982,7 +64562,7 @@ async function runResearchList(rootDir, hostArg) {
|
|
|
63982
64562
|
}
|
|
63983
64563
|
], [`research list: FAILED \u2014 RESEARCH_HOST_NOT_FOUND (${hostRef})`]);
|
|
63984
64564
|
}
|
|
63985
|
-
const indexPath =
|
|
64565
|
+
const indexPath = join16(hostDir, "research", "index.yaml");
|
|
63986
64566
|
const index = await readIndexYaml(indexPath);
|
|
63987
64567
|
const artifacts = [];
|
|
63988
64568
|
if (index !== null) {
|
|
@@ -64039,7 +64619,7 @@ async function runResearchInspect(rootDir, researchId) {
|
|
|
64039
64619
|
}
|
|
64040
64620
|
], [`research inspect: FAILED \u2014 SCHEMA_INVALID`]);
|
|
64041
64621
|
}
|
|
64042
|
-
const hostDir =
|
|
64622
|
+
const hostDir = join16(rootDir, ...hostRef.split("/"));
|
|
64043
64623
|
if (!existsSync23(hostDir)) {
|
|
64044
64624
|
return failOutcome("research inspect", {
|
|
64045
64625
|
research_id: researchId,
|
|
@@ -64057,8 +64637,8 @@ async function runResearchInspect(rootDir, researchId) {
|
|
|
64057
64637
|
}
|
|
64058
64638
|
], [`research inspect: FAILED \u2014 RESEARCH_HOST_NOT_FOUND (${hostRef})`]);
|
|
64059
64639
|
}
|
|
64060
|
-
const researchDir =
|
|
64061
|
-
const indexPath =
|
|
64640
|
+
const researchDir = join16(hostDir, "research");
|
|
64641
|
+
const indexPath = join16(researchDir, "index.yaml");
|
|
64062
64642
|
if (!existsSync23(indexPath)) {
|
|
64063
64643
|
return failOutcome("research inspect", {
|
|
64064
64644
|
research_id: researchId,
|
|
@@ -64113,7 +64693,7 @@ async function runResearchInspect(rootDir, researchId) {
|
|
|
64113
64693
|
}
|
|
64114
64694
|
const files = RESEARCH_ARTIFACT_FILES.map((f) => ({
|
|
64115
64695
|
file: f,
|
|
64116
|
-
present: existsSync23(
|
|
64696
|
+
present: existsSync23(join16(researchDir, f))
|
|
64117
64697
|
}));
|
|
64118
64698
|
const missing = files.filter((f) => !f.present).map((f) => f.file);
|
|
64119
64699
|
const rawFindings = Array.isArray(index.findings) ? index.findings : [];
|
|
@@ -64222,7 +64802,7 @@ async function runResearchInspect(rootDir, researchId) {
|
|
|
64222
64802
|
}, human, warnings);
|
|
64223
64803
|
}
|
|
64224
64804
|
async function scratchpadDiscoveryState(rootDir, id) {
|
|
64225
|
-
const statePath =
|
|
64805
|
+
const statePath = join16(discoveryScratchpadDirPath(rootDir, id), "state.json");
|
|
64226
64806
|
if (!existsSync23(statePath)) {
|
|
64227
64807
|
return {
|
|
64228
64808
|
error: {
|
|
@@ -64298,7 +64878,7 @@ async function mutateIndexRequests(indexPath, artifactRoot, hostRef, mutate) {
|
|
|
64298
64878
|
const changed = mutate(index);
|
|
64299
64879
|
if (!changed && !created)
|
|
64300
64880
|
return { created, changed: false };
|
|
64301
|
-
await mkdir2(
|
|
64881
|
+
await mkdir2(join16(indexPath, ".."), { recursive: true });
|
|
64302
64882
|
await writeFile5(indexPath, `${JSON.stringify(index, null, 2)}
|
|
64303
64883
|
`, "utf8");
|
|
64304
64884
|
return { created, changed: true };
|
|
@@ -64367,7 +64947,7 @@ async function runResearchRequest(rootDir, input) {
|
|
|
64367
64947
|
hint: `\u8DEF\u7531\u952E\u8BCD\u5F62\uFF1A${Object.keys(RESEARCH_MODE_ROUTE_HINTS).join(" | ")}\u3002`
|
|
64368
64948
|
}, [`research request: FAILED \u2014 SCHEMA_INVALID (--gap)`]);
|
|
64369
64949
|
}
|
|
64370
|
-
const indexPath =
|
|
64950
|
+
const indexPath = join16(discoveryScratchpadDirPath(rootDir, input.discoveryId), "research", "index.yaml");
|
|
64371
64951
|
let existingIndex = null;
|
|
64372
64952
|
if (existsSync23(indexPath)) {
|
|
64373
64953
|
try {
|
|
@@ -64612,7 +65192,7 @@ async function runResearchHandoff(rootDir, input) {
|
|
|
64612
65192
|
}
|
|
64613
65193
|
}
|
|
64614
65194
|
}
|
|
64615
|
-
const indexPath =
|
|
65195
|
+
const indexPath = join16(discoveryScratchpadDirPath(rootDir, input.discoveryId), "research", "index.yaml");
|
|
64616
65196
|
const statusMap = /* @__PURE__ */ new Map();
|
|
64617
65197
|
for (const id of handoff.answered_requests)
|
|
64618
65198
|
statusMap.set(id, "answered");
|
|
@@ -64913,7 +65493,7 @@ async function loadResearchFinding(rootDir, researchId, findingNumber) {
|
|
|
64913
65493
|
}
|
|
64914
65494
|
};
|
|
64915
65495
|
}
|
|
64916
|
-
const indexPath =
|
|
65496
|
+
const indexPath = join17(rootDir, ...artifactRoot.split("/"), "index.yaml");
|
|
64917
65497
|
if (!existsSync24(indexPath)) {
|
|
64918
65498
|
return {
|
|
64919
65499
|
error: {
|
|
@@ -65129,7 +65709,7 @@ async function runKnowledgeDemote(rootDir, input, deps) {
|
|
|
65129
65709
|
|
|
65130
65710
|
// packages/cli/dist/memory.js
|
|
65131
65711
|
init_dist();
|
|
65132
|
-
import { readFileSync as
|
|
65712
|
+
import { readFileSync as readFileSync29 } from "node:fs";
|
|
65133
65713
|
import { homedir as homedir3 } from "node:os";
|
|
65134
65714
|
var [MEMORY_ENTRY_NOT_FOUND, MEMORY_ALREADY_REVIEWED, MEMORY_REVIEW_REQUIRED, MEMORY_ALREADY_PROMOTED, MEMORY_PROMOTE_OWNER_REQUIRED, MEMORY_CAPTURE_DUPLICATE, MEMORY_HARVEST_NOT_RUN] = MEMORY_CLI_ERROR_VALUES;
|
|
65135
65715
|
function toCliError2(err, docSection) {
|
|
@@ -65198,7 +65778,7 @@ function readStdinText() {
|
|
|
65198
65778
|
};
|
|
65199
65779
|
}
|
|
65200
65780
|
try {
|
|
65201
|
-
return { text:
|
|
65781
|
+
return { text: readFileSync29(0, "utf8") };
|
|
65202
65782
|
} catch (err) {
|
|
65203
65783
|
return {
|
|
65204
65784
|
error: {
|
|
@@ -65776,7 +66356,7 @@ async function runMemoryAudit(rootDir, input) {
|
|
|
65776
66356
|
|
|
65777
66357
|
// packages/cli/dist/production.js
|
|
65778
66358
|
init_dist();
|
|
65779
|
-
import { readFileSync as
|
|
66359
|
+
import { readFileSync as readFileSync30 } from "node:fs";
|
|
65780
66360
|
var [BAND_SCHEMA_INVALID, BAND_NOT_FOUND, OBSERVATION_NOT_EVALUABLE, CHALLENGE_REJECTED, EVIDENCE_NOT_FOUND] = PRODUCTION_CLI_ERROR_VALUES;
|
|
65781
66361
|
var NO_AUTO_APPLY_NOTE = "\u5448\u62A5\u6001\u2014\u2014\u4E0D\u5F97\u81EA\u52A8\u5E94\u7528\uFF08PRD \xA790.4 L5695 \u9010\u5B57\uFF09\uFF1APOMASTER_SELF_IMPROVEMENT_CANDIDATE \u65E0\u4EFB\u4F55\u81EA\u52A8\u5E94\u7528\u901A\u8DEF\uFF0C\u300C\u5E94\u7528\u300D\u6C38\u8FDC\u662F\u4EBA/Owner \u7ECF\u6CBB\u7406\u9762\u7684\u663E\u5F0F\u52A8\u4F5C";
|
|
65782
66362
|
function fail5(result2, command, error) {
|
|
@@ -66038,7 +66618,7 @@ async function runProductionEvaluate(rootDir, input) {
|
|
|
66038
66618
|
const filePath = input.observationsFile.trim();
|
|
66039
66619
|
let text;
|
|
66040
66620
|
try {
|
|
66041
|
-
text =
|
|
66621
|
+
text = readFileSync30(filePath, "utf8");
|
|
66042
66622
|
} catch (err) {
|
|
66043
66623
|
return fail5(empty, command, {
|
|
66044
66624
|
code: OBSERVATION_NOT_EVALUABLE,
|
|
@@ -66622,7 +67202,7 @@ async function runTraceList(rootDir) {
|
|
|
66622
67202
|
|
|
66623
67203
|
// packages/cli/dist/agents.js
|
|
66624
67204
|
init_dist();
|
|
66625
|
-
import { existsSync as existsSync25, readFileSync as
|
|
67205
|
+
import { existsSync as existsSync25, readFileSync as readFileSync31, writeFileSync as writeFileSync6 } from "node:fs";
|
|
66626
67206
|
var GATEKEEPER_DRIFT_OBSERVED = "GATEKEEPER_DRIFT_OBSERVED";
|
|
66627
67207
|
var SUPERVISOR_TRIGGER_OBSERVED = "SUPERVISOR_TRIGGER_OBSERVED";
|
|
66628
67208
|
async function runAgentsStatus(rootDir, input = {}) {
|
|
@@ -66785,7 +67365,7 @@ async function referenceSection(rootDir, taskId, warnings) {
|
|
|
66785
67365
|
if (existsSync25(manifestPath)) {
|
|
66786
67366
|
let generatedAtSeq = null;
|
|
66787
67367
|
try {
|
|
66788
|
-
const parsed = JSON.parse(
|
|
67368
|
+
const parsed = JSON.parse(readFileSync31(manifestPath, "utf8"));
|
|
66789
67369
|
const seq2 = isRecord6(parsed) ? parsed.generated_at_seq : void 0;
|
|
66790
67370
|
if (typeof seq2 === "number")
|
|
66791
67371
|
generatedAtSeq = seq2;
|
|
@@ -68202,6 +68782,17 @@ function createProgram(runs, io = defaultIo) {
|
|
|
68202
68782
|
asJson: command.opts().json === true
|
|
68203
68783
|
});
|
|
68204
68784
|
});
|
|
68785
|
+
execution.command("audit").description("\u53D8\u66F4\u8D8A\u754C\u5BA1\u8BA1\uFF08Detection \u534A\u8FB9\uFF09\uFF1Agit diff \u8D77\u59CB\u951A\u6536\u96C6\u6267\u884C\u671F\u5B9E\u9645\u53D8\u66F4\u6587\u4EF6\u96C6\uFF08--diff-base \u8C03\u7528\u65B9\u7533\u62A5\u2014\u2014execution record \u65E0 ref/seq \u951A\u5B57\u6BB5\uFF1Buntracked \u540C\u6536\uFF1B\u8DEF\u5F84\u6E05\u6D17\u6CBF recon \u679A\u4E3E\u6392\u9664\u95ED\u5305 node_modules/dist/.git/coverage/.pomaster\uFF09\u2192 KEYBINDING \u5728\u518C\u7ED1\u5B9A\u89E3\u6790 governed id\uFF08\u672A\u547D\u4E2D unmapped \u8BDA\u5B9E\u6E05\u5355\u7981\u9759\u9ED8\u4E22\u5F03\uFF1B\u65E0\u7ED1\u5B9A\u8868\u5DE5\u4F5C\u533A\u5168 unmapped \u8BDA\u5B9E\u5448\u73B0\u975E\u9519\u8BEF\uFF09\u2192 \u5BF9\u7167 execution.permit_ids \u7684 permit scope.subject_ids \u5224 in/out-of-scope\uFF08\u5224\u5377\u951A kernel checkPermit \u6210\u5458\u5224\u5B9A\u5355\u4E00\u5B9E\u73B0\uFF09\u2192 \u5BA1\u8BA1\u62A5\u544A blob + OBS \u56DE\u6267\u843D 17 sidecar\uFF08result=OBSERVED \u5E26 blob ref\uFF09+ stdout \u8D8A\u754C\u9010\u6761\u660E\u7EC6\uFF08path + \u5224\u5B9A\u4F9D\u636E\uFF09\uFF1B\u8D8A\u754C\u5B58\u5728 exit 1 \u4E0D\u4F2A\u9020\u7EFF\uFF1B\u975E git \u5DE5\u4F5C\u533A/\u951A\u7F3A\u5E2D/\u951A\u65E0\u6548 fail-closed \u96F6\u843D\u76D8\uFF08\u4E0D\u505A fs \u5FEB\u7167\u515C\u5E95\uFF09").requiredOption("--execution-id <AGX-n>", "\u6267\u884C\u8EAB\u4EFD\u951A\uFF08AGX-<\u5E74\u4EFD>-<\u5E8F\u53F7>\uFF1BOBS \u56DE\u6267 execution_id \u5FC5\u586B\u2014\u2014S1 \u7981\u81EA\u9020\u8EAB\u4EFD\uFF0C\u987B\u4E3A executions/ \u5DF2\u767B\u8BB0\u6863\u6848\uFF0C\u5DF2\u5C01\u53E3\u6267\u884C\u5141\u8BB8\u4E8B\u540E\u5BA1\u8BA1\uFF09").requiredOption("--diff-base <git-ref>", "diff \u8D77\u59CB\u951A\uFF08commit/branch/tag\u2014\u2014execution begin \u65F6\u523B\u7684\u5DE5\u4F5C\u533A\u57FA\u7EBF ref\uFF1Bexecution record \u5B9E\u8BFB\u65E0 ref/seq \u951A\u5B57\u6BB5\uFF0C\u951A\u7531\u8C03\u7528\u65B9\u7533\u62A5\uFF1A\u7F3A\u5E2D/\u65E0\u6548 = \u663E\u5F0F\u62A5\u9519\u96F6\u843D\u76D8\uFF09").option("--json", "machine-readable JSON output (\xA745)").action(async (opts, command) => {
|
|
68786
|
+
const outcome = await runExecutionAudit(resolveDir(command), {
|
|
68787
|
+
executionId: opts.executionId,
|
|
68788
|
+
diffBase: opts.diffBase
|
|
68789
|
+
});
|
|
68790
|
+
record({
|
|
68791
|
+
command: "execution audit",
|
|
68792
|
+
outcome,
|
|
68793
|
+
asJson: command.opts().json === true
|
|
68794
|
+
});
|
|
68795
|
+
});
|
|
68205
68796
|
const trace = program2.command("trace").description("Execution Trace \u547D\u4EE4\u9762\uFF08\xA78/\xA714 P0.5-3\uFF09\uFF1Ashow = \u6D3E\u751F\u6295\u5F71\u7EAF\u8BFB\uFF08\u5C01\u5B58\u5728\u5EA7=\u5C01\u5B58\u5FEB\u7167+stale \u5BF9\u8D26\u663E\u5F0F\uFF1B--seal --retention <\u56DB\u6863> = \u663E\u5F0F\u7269\u5316\u5BA1\u8BA1\u5FEB\u7167\uFF09/ list = \u5C01\u5B58\u6E05\u5355\uFF1BTrace \u662F Identity \u7684\u6D3E\u751F\u6295\u5F71\u4FA7\u8F66\uFF08A19 Identity Is Not Trace\uFF09\uFF0CCLI \u96F6\u5224\u5377\u96F6 GC");
|
|
68206
68797
|
trace.command("show").description("\u6309 AGX \u5448\u73B0 Execution Trace Manifest\uFF08\xA78.2 \u95ED\u5F62\u6001 12 \u952E\uFF09\uFF1A\u7F3A\u7701 = \u7EAF\u6295\u5F71 on-demand\uFF08journal TX_APPLIED \u5199\u8DB3\u8FF9 + evidence GRN/CLM \u6536\u636E\u2014\u2014\u96F6\u65B0\u91C7\u96C6\u5668\uFF0C\u540C state \u91CD\u653E\u5B57\u8282\u7A33\u5B9A\uFF09\uFF1B\u5C01\u5B58\u5728\u5EA7 = \u5C01\u5B58\u5FEB\u7167 + canonical \u91CD\u653E\u5BF9\u8D26\uFF08stale \u663E\u5F0F\u5448\u73B0\u975E\u9519\u8BEF\u2014\u2014\u5FEB\u7167\u4E0D\u5192\u5145\u65B0\u9C9C\uFF09\uFF1B--seal --retention <\u6863> = \u663E\u5F0F\u7269\u5316\uFF08retention \u5FC5\u586B\u6210\u5BF9\uFF1AEPHEMERAL\u2192runtime/traces \u53EF\u4E22\u5F03\uFF0CTASK/INCIDENT/AUDIT_RETENTION\u2192traces/ durable \u8FDB Git\uFF1B\u4EC5\u8BB0\u5F55\u4E0D GC\u2014\u2014\u88C1\u51B3 8 \u2461\uFF09\uFF1B\u8BCD\u5F62\u975E\u6CD5/\u672A\u767B\u8BB0\u6863\u6848/\u8BCD\u8868\u5916/\u91CD\u590D\u5C01\u5B58\u539F\u7801\u900F\u4F20\uFF08SCHEMA_INVALID/EXECUTION_NOT_FOUND/VOCAB_INVALID_VALUE/TRACE_ALREADY_SEALED\uFF09").argument("<execution-id>", "\u6267\u884C\u8EAB\u4EFD\uFF08AGX-<4\u4F4D\u5E74\u4EFD>-<\u5E8F\u53F7>\uFF1B\u7981\u81EA\u9020\u7B2C\u4E8C\u79CD EXEC-* \u8EAB\u4EFD\u2014\u2014\xA716 Case A\uFF09").option("--seal", "\u663E\u5F0F\u5C01\u5B58\uFF1A\u7269\u5316\u5F53\u524D\u6295\u5F71\u4E3A\u5BA1\u8BA1\u5FEB\u7167\uFF08\u4E0E --retention \u6210\u5BF9\u5FC5\u586B\uFF1B\u91CD\u590D\u5C01\u5B58 TRACE_ALREADY_SEALED \u663E\u5F0F\u62D2\u7EDD\uFF09").option("--retention <retention>", "\u7559\u5B58\u6863\uFF08PRD \xA78.3 \u56DB\u6863\u9010\u5B57\uFF1AEPHEMERAL | TASK_RETENTION | INCIDENT_RETENTION | AUDIT_RETENTION\uFF1B\u8BCD\u8868\u5916 VOCAB_INVALID_VALUE fail-closed\u2014\u2014\u4EC5\u8BB0\u5F55\u4E0D GC\uFF09").option("--json", "machine-readable JSON output (\xA745)").action(async (executionId, opts, command) => {
|
|
68207
68798
|
const outcome = await runTraceShow(resolveDir(command), executionId, {
|
|
@@ -68299,12 +68890,12 @@ function collectValues(value, previous) {
|
|
|
68299
68890
|
}
|
|
68300
68891
|
function readLineFromStdin() {
|
|
68301
68892
|
const rl = createInterface({ input: process.stdin });
|
|
68302
|
-
return new Promise((
|
|
68893
|
+
return new Promise((resolve4) => {
|
|
68303
68894
|
rl.once("line", (line) => {
|
|
68304
|
-
|
|
68895
|
+
resolve4(line);
|
|
68305
68896
|
rl.close();
|
|
68306
68897
|
});
|
|
68307
|
-
rl.once("close", () =>
|
|
68898
|
+
rl.once("close", () => resolve4(null));
|
|
68308
68899
|
});
|
|
68309
68900
|
}
|
|
68310
68901
|
function takeKeyToken(buffer) {
|
|
@@ -68322,7 +68913,7 @@ function takeKeyToken(buffer) {
|
|
|
68322
68913
|
return head === void 0 ? null : { token: head, rest: buffer.slice(1) };
|
|
68323
68914
|
}
|
|
68324
68915
|
function pumpStdinKeys(handler) {
|
|
68325
|
-
return new Promise((
|
|
68916
|
+
return new Promise((resolve4) => {
|
|
68326
68917
|
let buffer = "";
|
|
68327
68918
|
const cleanup = () => {
|
|
68328
68919
|
process.stdin.removeListener("data", onData);
|
|
@@ -68331,7 +68922,7 @@ function pumpStdinKeys(handler) {
|
|
|
68331
68922
|
};
|
|
68332
68923
|
const onDone = () => {
|
|
68333
68924
|
cleanup();
|
|
68334
|
-
|
|
68925
|
+
resolve4();
|
|
68335
68926
|
};
|
|
68336
68927
|
const onData = (chunk) => {
|
|
68337
68928
|
buffer += typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
@@ -68342,7 +68933,7 @@ function pumpStdinKeys(handler) {
|
|
|
68342
68933
|
buffer = token.rest;
|
|
68343
68934
|
if (!handler(token.token)) {
|
|
68344
68935
|
cleanup();
|
|
68345
|
-
|
|
68936
|
+
resolve4();
|
|
68346
68937
|
return;
|
|
68347
68938
|
}
|
|
68348
68939
|
}
|