@amaster.ai/employee-runtime-connector 0.1.1-beta.154 → 0.1.1-beta.156
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/amaster-runtime-daemon.mjs +454 -69
- package/dist/amaster-runtime.mjs +1 -1
- package/package.json +1 -1
|
@@ -8370,7 +8370,8 @@ var ISSUE_RECOVERY_ACTION_KINDS = [
|
|
|
8370
8370
|
"workspace_validation",
|
|
8371
8371
|
"active_run_watchdog",
|
|
8372
8372
|
"issue_graph_liveness",
|
|
8373
|
-
"finalization_operator"
|
|
8373
|
+
"finalization_operator",
|
|
8374
|
+
"initialization_no_progress"
|
|
8374
8375
|
];
|
|
8375
8376
|
var ISSUE_PROGRESS_FINDING_CODES = [
|
|
8376
8377
|
"terminal",
|
|
@@ -10476,11 +10477,33 @@ var requestConfirmationResultSchema = external_exports.object({
|
|
|
10476
10477
|
"accepted",
|
|
10477
10478
|
"changes_requested",
|
|
10478
10479
|
"rejected",
|
|
10480
|
+
"deferred",
|
|
10479
10481
|
"superseded_by_comment",
|
|
10480
10482
|
"superseded_by_confirmation",
|
|
10481
10483
|
"stale_target"
|
|
10482
10484
|
]),
|
|
10483
10485
|
reason: external_exports.string().trim().max(4e3).nullable().optional(),
|
|
10486
|
+
decision: external_exports.enum([
|
|
10487
|
+
"confirm_open",
|
|
10488
|
+
"mark_not_applicable",
|
|
10489
|
+
"confirm_observed_effect",
|
|
10490
|
+
"not_observed",
|
|
10491
|
+
"attribute_to_criterion",
|
|
10492
|
+
"not_goal_effect",
|
|
10493
|
+
"correct_facts",
|
|
10494
|
+
"defer"
|
|
10495
|
+
]).nullable().optional(),
|
|
10496
|
+
evaluationDecision: external_exports.enum([
|
|
10497
|
+
"satisfied",
|
|
10498
|
+
"waiting_for_observation",
|
|
10499
|
+
"unsupported",
|
|
10500
|
+
"no_action",
|
|
10501
|
+
"deferred"
|
|
10502
|
+
]).nullable().optional(),
|
|
10503
|
+
remindAt: external_exports.string().datetime({ offset: true }).nullable().optional(),
|
|
10504
|
+
idempotencyKey: external_exports.string().trim().min(1).max(200).nullable().optional(),
|
|
10505
|
+
resultingContractId: external_exports.string().uuid().nullable().optional(),
|
|
10506
|
+
resultingAuthorityRevision: external_exports.number().int().positive().nullable().optional(),
|
|
10484
10507
|
supplementalComment: external_exports.string().trim().min(1).max(4e3).nullable().optional(),
|
|
10485
10508
|
commentId: external_exports.string().uuid().nullable().optional(),
|
|
10486
10509
|
supersededByInteractionId: external_exports.string().uuid().nullable().optional(),
|
|
@@ -11313,6 +11336,11 @@ var operatingAccountingReadModelSchema = external_exports.object({
|
|
|
11313
11336
|
var GOAL_GAP_METRIC_KINDS = ["count", "amount", "ratio", "boolean_milestone"];
|
|
11314
11337
|
var GOAL_GAP_STATUSES = ["open", "satisfied", "invalidated", "unknown"];
|
|
11315
11338
|
var GOAL_GAP_PROJECTOR_MODES = ["off", "shadow", "enforce"];
|
|
11339
|
+
var GOAL_GAP_EVALUATION_TYPES = [
|
|
11340
|
+
"deliverable_milestone",
|
|
11341
|
+
"observed_business_state",
|
|
11342
|
+
"human_judgment"
|
|
11343
|
+
];
|
|
11316
11344
|
var GOAL_GAP_PROJECTOR_DECISIONS = [
|
|
11317
11345
|
"disabled",
|
|
11318
11346
|
"shadow",
|
|
@@ -11378,6 +11406,41 @@ var goalGapAcceptanceContractSchema = external_exports.discriminatedUnion("verdi
|
|
|
11378
11406
|
acceptanceAuthority: external_exports.object({ kind: external_exports.literal("company_board") }).strict()
|
|
11379
11407
|
}).strict()
|
|
11380
11408
|
]);
|
|
11409
|
+
var goalGapEvaluationContractSchema = external_exports.object({
|
|
11410
|
+
schemaVersion: external_exports.literal("goal-gap-evaluation-v1"),
|
|
11411
|
+
criterionIndex: external_exports.number().int().min(0).max(9),
|
|
11412
|
+
evaluationType: external_exports.enum(GOAL_GAP_EVALUATION_TYPES),
|
|
11413
|
+
machineVerifiable: external_exports.boolean(),
|
|
11414
|
+
businessSubjectScope: boundedRecordSchema,
|
|
11415
|
+
targetCondition: goalGapTargetConditionSchema,
|
|
11416
|
+
window: boundedRecordSchema,
|
|
11417
|
+
observationPolicy: external_exports.object({
|
|
11418
|
+
kind: external_exports.enum([
|
|
11419
|
+
"accepted_causal_delivery",
|
|
11420
|
+
"independent_readback",
|
|
11421
|
+
"board_or_independent_readback",
|
|
11422
|
+
"board_judgment"
|
|
11423
|
+
])
|
|
11424
|
+
}).strict(),
|
|
11425
|
+
compilerRevision: external_exports.string().min(1).max(120),
|
|
11426
|
+
evaluationContractHash: sha256Schema4,
|
|
11427
|
+
targetHash: sha256Schema4
|
|
11428
|
+
}).strict().superRefine((value, ctx) => {
|
|
11429
|
+
if (value.evaluationType === "human_judgment" && value.machineVerifiable) {
|
|
11430
|
+
ctx.addIssue({
|
|
11431
|
+
code: external_exports.ZodIssueCode.custom,
|
|
11432
|
+
path: ["machineVerifiable"],
|
|
11433
|
+
message: "Human judgment cannot be marked machine-verifiable"
|
|
11434
|
+
});
|
|
11435
|
+
}
|
|
11436
|
+
if (value.evaluationType !== "human_judgment" && !value.machineVerifiable) {
|
|
11437
|
+
ctx.addIssue({
|
|
11438
|
+
code: external_exports.ZodIssueCode.custom,
|
|
11439
|
+
path: ["machineVerifiable"],
|
|
11440
|
+
message: "Automatic evaluation requires a machine-verifiable target"
|
|
11441
|
+
});
|
|
11442
|
+
}
|
|
11443
|
+
});
|
|
11381
11444
|
var deterministicGoalGapAcceptanceContract = {
|
|
11382
11445
|
verdictRequirement: "deterministic_evidence",
|
|
11383
11446
|
acceptanceAuthority: null
|
|
@@ -11391,7 +11454,8 @@ var goalGapDefinitionSchema = external_exports.object({
|
|
|
11391
11454
|
window: boundedRecordSchema,
|
|
11392
11455
|
currentObservationRef: goalGapObservationRefSchema.nullable(),
|
|
11393
11456
|
status: external_exports.enum(GOAL_GAP_STATUSES),
|
|
11394
|
-
acceptanceContract: goalGapAcceptanceContractSchema.default(deterministicGoalGapAcceptanceContract)
|
|
11457
|
+
acceptanceContract: goalGapAcceptanceContractSchema.default(deterministicGoalGapAcceptanceContract),
|
|
11458
|
+
evaluationContract: goalGapEvaluationContractSchema.nullable().optional().default(null)
|
|
11395
11459
|
}).strict().superRefine((value, ctx) => {
|
|
11396
11460
|
const targetKind = value.targetCondition.kind;
|
|
11397
11461
|
if (targetKind !== value.metricOrStateKind) {
|
|
@@ -11401,10 +11465,64 @@ var goalGapDefinitionSchema = external_exports.object({
|
|
|
11401
11465
|
ctx.addIssue({ code: "custom", path: ["currentObservationRef"], message: "A determinate status requires an observation ref" });
|
|
11402
11466
|
}
|
|
11403
11467
|
});
|
|
11468
|
+
var boardGoalGapSourceRefSchema = external_exports.object({
|
|
11469
|
+
kind: external_exports.string().trim().min(1).max(80),
|
|
11470
|
+
id: external_exports.string().trim().min(1).max(240),
|
|
11471
|
+
revision: external_exports.string().trim().min(1).max(240)
|
|
11472
|
+
}).strict();
|
|
11473
|
+
var boardGoalGapObservationBaseSchema = external_exports.object({
|
|
11474
|
+
expectedAuthorityRevision: external_exports.number().int().positive(),
|
|
11475
|
+
expectedContractId: external_exports.string().uuid(),
|
|
11476
|
+
gapKey: external_exports.string().regex(/^[a-z0-9][a-z0-9._:-]{0,119}$/),
|
|
11477
|
+
evaluationContractHash: sha256Schema4,
|
|
11478
|
+
targetHash: sha256Schema4,
|
|
11479
|
+
observedAt: external_exports.string().datetime({ offset: true }),
|
|
11480
|
+
sourceRefs: external_exports.array(boardGoalGapSourceRefSchema).max(20),
|
|
11481
|
+
rationale: external_exports.string().trim().min(1).max(2e3),
|
|
11482
|
+
interactionId: external_exports.string().uuid(),
|
|
11483
|
+
resolutionRevision: external_exports.number().int().positive(),
|
|
11484
|
+
idempotencyKey: external_exports.string().trim().min(1).max(200)
|
|
11485
|
+
});
|
|
11486
|
+
var boardObserveGoalGapEffectSchema = external_exports.discriminatedUnion("decision", [
|
|
11487
|
+
boardGoalGapObservationBaseSchema.extend({
|
|
11488
|
+
decision: external_exports.literal("confirm_observed_effect"),
|
|
11489
|
+
observedValue: external_exports.boolean()
|
|
11490
|
+
}).strict(),
|
|
11491
|
+
boardGoalGapObservationBaseSchema.extend({
|
|
11492
|
+
decision: external_exports.literal("not_observed"),
|
|
11493
|
+
observedValue: external_exports.boolean()
|
|
11494
|
+
}).strict(),
|
|
11495
|
+
boardGoalGapObservationBaseSchema.extend({
|
|
11496
|
+
decision: external_exports.literal("correct_facts"),
|
|
11497
|
+
observedValue: external_exports.boolean().optional()
|
|
11498
|
+
}).strict(),
|
|
11499
|
+
boardGoalGapObservationBaseSchema.extend({
|
|
11500
|
+
decision: external_exports.literal("defer"),
|
|
11501
|
+
observedValue: external_exports.boolean().optional(),
|
|
11502
|
+
remindAt: external_exports.string().datetime({ offset: true }).optional()
|
|
11503
|
+
}).strict()
|
|
11504
|
+
]);
|
|
11505
|
+
var goalGapCausalSourceSchema = external_exports.discriminatedUnion("kind", [
|
|
11506
|
+
external_exports.object({ kind: external_exports.literal("work_family"), workFamilyKey: sha256Schema4 }).strict(),
|
|
11507
|
+
external_exports.object({
|
|
11508
|
+
kind: external_exports.literal("board_direct"),
|
|
11509
|
+
interactionId: external_exports.string().uuid(),
|
|
11510
|
+
resolutionRevision: external_exports.number().int().positive()
|
|
11511
|
+
}).strict()
|
|
11512
|
+
]);
|
|
11513
|
+
var goalGapWorkIdentitySchema = external_exports.object({
|
|
11514
|
+
schemaVersion: external_exports.literal("goal-gap-work-identity-v1"),
|
|
11515
|
+
intentFamilyKey: sha256Schema4,
|
|
11516
|
+
workPurposeKey: external_exports.string().regex(/^[a-z0-9][a-z0-9._:-]{0,119}$/),
|
|
11517
|
+
workFamilyKey: sha256Schema4,
|
|
11518
|
+
workInstanceKey: sha256Schema4,
|
|
11519
|
+
admissionObservationKey: sha256Schema4,
|
|
11520
|
+
relationshipToExisting: external_exports.enum(["new", "follow_on", "replacement", "reopen"])
|
|
11521
|
+
}).strict();
|
|
11404
11522
|
var replaceGoalGapContractBaseSchema = external_exports.object({
|
|
11405
11523
|
expectedAuthorityRevision: external_exports.number().int().min(0),
|
|
11406
11524
|
idempotencyKey: external_exports.string().min(1).max(200),
|
|
11407
|
-
sourceKind: external_exports.enum(["board_confirmed", "supported_projector"]),
|
|
11525
|
+
sourceKind: external_exports.enum(["board_confirmed", "supported_projector", "supported_evaluator"]),
|
|
11408
11526
|
gaps: external_exports.array(goalGapDefinitionSchema).max(10)
|
|
11409
11527
|
}).strict();
|
|
11410
11528
|
function validateUniqueGapIdentities(value, ctx) {
|
|
@@ -11417,6 +11535,58 @@ function validateUniqueGapIdentities(value, ctx) {
|
|
|
11417
11535
|
}
|
|
11418
11536
|
var replaceGoalGapContractSchema = replaceGoalGapContractBaseSchema.superRefine(validateUniqueGapIdentities);
|
|
11419
11537
|
var boardReplaceGoalGapContractSchema = replaceGoalGapContractBaseSchema.omit({ sourceKind: true }).superRefine(validateUniqueGapIdentities);
|
|
11538
|
+
var boardDecideGoalGapPortfolioSchema = external_exports.object({
|
|
11539
|
+
expectedAuthorityRevision: external_exports.number().int().min(0),
|
|
11540
|
+
expectedContractId: external_exports.string().uuid().nullable(),
|
|
11541
|
+
criterionIndex: external_exports.number().int().min(0).max(9),
|
|
11542
|
+
decision: external_exports.enum(["confirm_open", "mark_not_applicable"]),
|
|
11543
|
+
rationale: external_exports.string().trim().min(1).max(2e3),
|
|
11544
|
+
observedAt: external_exports.string().datetime({ offset: true }),
|
|
11545
|
+
idempotencyKey: external_exports.string().trim().min(1).max(200)
|
|
11546
|
+
}).strict();
|
|
11547
|
+
var boardResolveGoalGapAuthorityBaseSchema = external_exports.object({
|
|
11548
|
+
expectedAuthorityRevision: external_exports.number().int().min(0),
|
|
11549
|
+
expectedContractId: external_exports.string().uuid().nullable(),
|
|
11550
|
+
criterionIndex: external_exports.number().int().min(0).max(9),
|
|
11551
|
+
candidateGapKey: external_exports.string().regex(/^[a-z0-9][a-z0-9._:-]{0,119}$/),
|
|
11552
|
+
rationale: external_exports.string().trim().min(1).max(2e3),
|
|
11553
|
+
observedAt: external_exports.string().datetime({ offset: true }),
|
|
11554
|
+
interactionId: external_exports.string().uuid(),
|
|
11555
|
+
resolutionRevision: external_exports.number().int().positive(),
|
|
11556
|
+
idempotencyKey: external_exports.string().trim().min(1).max(200)
|
|
11557
|
+
});
|
|
11558
|
+
var boardResolveGoalGapAuthoritySchema = external_exports.discriminatedUnion("decision", [
|
|
11559
|
+
boardResolveGoalGapAuthorityBaseSchema.extend({ decision: external_exports.literal("confirm_open") }).strict(),
|
|
11560
|
+
boardResolveGoalGapAuthorityBaseSchema.extend({ decision: external_exports.literal("mark_not_applicable") }).strict(),
|
|
11561
|
+
boardResolveGoalGapAuthorityBaseSchema.extend({ decision: external_exports.literal("correct_facts") }).strict(),
|
|
11562
|
+
boardResolveGoalGapAuthorityBaseSchema.extend({
|
|
11563
|
+
decision: external_exports.literal("defer"),
|
|
11564
|
+
remindAt: external_exports.string().datetime({ offset: true }).optional()
|
|
11565
|
+
}).strict()
|
|
11566
|
+
]);
|
|
11567
|
+
var boardResolveLegacyOutcomeGapBaseSchema = external_exports.object({
|
|
11568
|
+
expectedAuthorityRevision: external_exports.number().int().min(0),
|
|
11569
|
+
expectedContractId: external_exports.string().uuid().nullable(),
|
|
11570
|
+
readinessStateId: external_exports.string().uuid(),
|
|
11571
|
+
expectedReadinessRevision: external_exports.number().int().positive(),
|
|
11572
|
+
interactionId: external_exports.string().uuid(),
|
|
11573
|
+
resolutionRevision: external_exports.number().int().positive(),
|
|
11574
|
+
rationale: external_exports.string().trim().min(1).max(2e3),
|
|
11575
|
+
observedAt: external_exports.string().datetime({ offset: true }),
|
|
11576
|
+
idempotencyKey: external_exports.string().trim().min(1).max(200)
|
|
11577
|
+
});
|
|
11578
|
+
var boardResolveLegacyOutcomeGapSchema = external_exports.discriminatedUnion("decision", [
|
|
11579
|
+
boardResolveLegacyOutcomeGapBaseSchema.extend({
|
|
11580
|
+
decision: external_exports.literal("attribute_to_criterion"),
|
|
11581
|
+
criterionIndex: external_exports.number().int().min(0).max(9)
|
|
11582
|
+
}).strict(),
|
|
11583
|
+
boardResolveLegacyOutcomeGapBaseSchema.extend({ decision: external_exports.literal("not_goal_effect") }).strict(),
|
|
11584
|
+
boardResolveLegacyOutcomeGapBaseSchema.extend({ decision: external_exports.literal("correct_facts") }).strict(),
|
|
11585
|
+
boardResolveLegacyOutcomeGapBaseSchema.extend({
|
|
11586
|
+
decision: external_exports.literal("defer"),
|
|
11587
|
+
remindAt: external_exports.string().datetime({ offset: true }).optional()
|
|
11588
|
+
}).strict()
|
|
11589
|
+
]);
|
|
11420
11590
|
var transitionGoalGapSchema = external_exports.object({
|
|
11421
11591
|
expectedAuthorityRevision: external_exports.number().int().min(0),
|
|
11422
11592
|
expectedContractId: external_exports.string().uuid().nullable(),
|
|
@@ -11455,7 +11625,7 @@ var goalGapContractRevisionSchema = external_exports.object({
|
|
|
11455
11625
|
goalId: external_exports.string().uuid(),
|
|
11456
11626
|
authorityRevision: external_exports.number().int().positive(),
|
|
11457
11627
|
compilerRevision: external_exports.string().min(1),
|
|
11458
|
-
sourceKind: external_exports.enum(["board_confirmed", "supported_projector"]),
|
|
11628
|
+
sourceKind: external_exports.enum(["board_confirmed", "supported_projector", "supported_evaluator"]),
|
|
11459
11629
|
contractHash: sha256Schema4,
|
|
11460
11630
|
status: external_exports.enum(["current", "superseded"]),
|
|
11461
11631
|
idempotencyKey: external_exports.string().min(1),
|
|
@@ -11514,8 +11684,59 @@ var goalGapProjectorReceiptSchema = external_exports.object({
|
|
|
11514
11684
|
}).strict();
|
|
11515
11685
|
var goalGapContractReadResponseSchema = external_exports.object({
|
|
11516
11686
|
contract: goalGapContractRevisionSchema.nullable(),
|
|
11687
|
+
gapEvidence: external_exports.array(external_exports.object({
|
|
11688
|
+
gapKey: external_exports.string(),
|
|
11689
|
+
reasonSummary: external_exports.string().min(1),
|
|
11690
|
+
observedAt: external_exports.string().datetime().nullable(),
|
|
11691
|
+
sourceName: external_exports.string().nullable(),
|
|
11692
|
+
relatedWork: external_exports.array(external_exports.object({
|
|
11693
|
+
issueId: external_exports.string().uuid(),
|
|
11694
|
+
identifier: external_exports.string().min(1),
|
|
11695
|
+
title: external_exports.string().min(1),
|
|
11696
|
+
status: external_exports.string().min(1)
|
|
11697
|
+
}).strict()).max(20)
|
|
11698
|
+
}).strict()),
|
|
11517
11699
|
readiness: external_exports.array(goalGapReadinessStateSchema.omit({ materialHash: true })),
|
|
11518
|
-
projectorReceipts: external_exports.array(goalGapProjectorReceiptSchema)
|
|
11700
|
+
projectorReceipts: external_exports.array(goalGapProjectorReceiptSchema),
|
|
11701
|
+
pendingDecisions: external_exports.array(external_exports.discriminatedUnion("kind", [
|
|
11702
|
+
external_exports.object({
|
|
11703
|
+
kind: external_exports.literal("observed_effect"),
|
|
11704
|
+
interactionId: external_exports.string().uuid(),
|
|
11705
|
+
gapKey: external_exports.string(),
|
|
11706
|
+
title: external_exports.string(),
|
|
11707
|
+
summary: external_exports.string(),
|
|
11708
|
+
resolutionRevision: external_exports.number().int().nonnegative(),
|
|
11709
|
+
evaluationContractHash: sha256Schema4,
|
|
11710
|
+
targetHash: sha256Schema4,
|
|
11711
|
+
stale: external_exports.boolean(),
|
|
11712
|
+
href: external_exports.string().min(1)
|
|
11713
|
+
}).strict(),
|
|
11714
|
+
external_exports.object({
|
|
11715
|
+
kind: external_exports.literal("gap_authority"),
|
|
11716
|
+
interactionId: external_exports.string().uuid(),
|
|
11717
|
+
gapKey: external_exports.string(),
|
|
11718
|
+
criterionIndex: external_exports.number().int().min(0).max(9),
|
|
11719
|
+
title: external_exports.string(),
|
|
11720
|
+
summary: external_exports.string(),
|
|
11721
|
+
resolutionRevision: external_exports.number().int().nonnegative(),
|
|
11722
|
+
stale: external_exports.boolean(),
|
|
11723
|
+
href: external_exports.string().min(1)
|
|
11724
|
+
}).strict(),
|
|
11725
|
+
external_exports.object({
|
|
11726
|
+
kind: external_exports.literal("legacy_outcome_attribution"),
|
|
11727
|
+
interactionId: external_exports.string().uuid(),
|
|
11728
|
+
readinessStateId: external_exports.string().uuid(),
|
|
11729
|
+
readinessRevision: external_exports.number().int().positive(),
|
|
11730
|
+
outcomeId: external_exports.string().uuid(),
|
|
11731
|
+
sourceIssueId: external_exports.string().uuid(),
|
|
11732
|
+
sourceIssueTitle: external_exports.string().min(1),
|
|
11733
|
+
title: external_exports.string(),
|
|
11734
|
+
summary: external_exports.string(),
|
|
11735
|
+
resolutionRevision: external_exports.number().int().nonnegative(),
|
|
11736
|
+
stale: external_exports.boolean(),
|
|
11737
|
+
href: external_exports.string().min(1)
|
|
11738
|
+
}).strict()
|
|
11739
|
+
]))
|
|
11519
11740
|
}).strict();
|
|
11520
11741
|
|
|
11521
11742
|
// ../shared/src/ceo-periodic-auto-work.ts
|
|
@@ -11688,6 +11909,48 @@ var ceoPeriodicRoutingRosterEntrySchema = external_exports.object({
|
|
|
11688
11909
|
maxQueuedWorkCount: external_exports.number().int().nonnegative().max(CEO_PERIODIC_MAX_CANDIDATES_PER_OBSERVATION),
|
|
11689
11910
|
unacceptedOutcomeCount: external_exports.number().int().nonnegative()
|
|
11690
11911
|
}).strict();
|
|
11912
|
+
var ceoPeriodicPortfolioAdmissionSchema = external_exports.object({
|
|
11913
|
+
outcomeClass: external_exports.enum(["internal_enablement", "governed_decision", "external_action", "observed_business_result"]),
|
|
11914
|
+
outcomeFamilyIdentity: external_exports.object({
|
|
11915
|
+
normalizedBusinessSubjectRef: operatingNormalizedBusinessSubjectRefSchema
|
|
11916
|
+
}).strict(),
|
|
11917
|
+
expectedBusinessChange: operatingStateTransitionSchema,
|
|
11918
|
+
causalGoalGapRef: external_exports.object({
|
|
11919
|
+
gapKey: external_exports.string().regex(/^[a-z0-9][a-z0-9._:-]{0,119}$/u),
|
|
11920
|
+
authorityRevision: external_exports.number().int().min(0),
|
|
11921
|
+
observationRef: external_exports.object({
|
|
11922
|
+
kind: external_exports.enum(["provider_object", "governed_business_state", "effect_event", "board_assertion"]),
|
|
11923
|
+
id: external_exports.string().min(1).max(240),
|
|
11924
|
+
revision: external_exports.string().min(1).max(240)
|
|
11925
|
+
}).strict()
|
|
11926
|
+
}).strict(),
|
|
11927
|
+
relationshipToExisting: external_exports.enum(["new", "continuation", "follow_on", "replacement", "reopen"]).transform((value) => value === "continuation" ? "follow_on" : value),
|
|
11928
|
+
promotionReason: external_exports.object({
|
|
11929
|
+
kind: external_exports.literal("unlocks_external_execution"),
|
|
11930
|
+
blockerRef: ceoPeriodicWorkSourceRefSchema
|
|
11931
|
+
}).strict().nullable(),
|
|
11932
|
+
observationPolicy: external_exports.object({
|
|
11933
|
+
kind: external_exports.enum(["none", "provider_readback", "governed_state_readback", "board_verification"]),
|
|
11934
|
+
dueAt: external_exports.string().datetime({ offset: true }).nullable()
|
|
11935
|
+
}).strict()
|
|
11936
|
+
}).strict().superRefine((value, ctx) => {
|
|
11937
|
+
if (value.outcomeClass === "internal_enablement" && !value.promotionReason) {
|
|
11938
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["promotionReason"], message: "Internal enablement must identify the external execution blocker it unlocks" });
|
|
11939
|
+
}
|
|
11940
|
+
if (value.outcomeClass !== "internal_enablement" && value.promotionReason) {
|
|
11941
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["promotionReason"], message: "Only internal enablement uses a promotion reason" });
|
|
11942
|
+
}
|
|
11943
|
+
if (["external_action", "observed_business_result"].includes(value.outcomeClass) && value.observationPolicy.kind === "none") {
|
|
11944
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["observationPolicy", "kind"], message: "External results require an authoritative readback policy" });
|
|
11945
|
+
}
|
|
11946
|
+
if (value.causalGoalGapRef.authorityRevision === 0 && !["internal_enablement", "governed_decision"].includes(value.outcomeClass)) {
|
|
11947
|
+
ctx.addIssue({
|
|
11948
|
+
code: external_exports.ZodIssueCode.custom,
|
|
11949
|
+
path: ["causalGoalGapRef", "authorityRevision"],
|
|
11950
|
+
message: "Only low-risk work may cite a provisional Goal Gap candidate"
|
|
11951
|
+
});
|
|
11952
|
+
}
|
|
11953
|
+
});
|
|
11691
11954
|
var ceoPeriodicDiscoveredWorkInputSchema = external_exports.object({
|
|
11692
11955
|
workKind: external_exports.string().trim().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/u),
|
|
11693
11956
|
title: external_exports.string().trim().min(1).max(240),
|
|
@@ -11701,49 +11964,25 @@ var ceoPeriodicDiscoveredWorkInputSchema = external_exports.object({
|
|
|
11701
11964
|
capabilityNeeds: external_exports.array(external_exports.string().trim().regex(/^[a-z0-9][a-z0-9._-]{0,159}$/u)).max(20).default([]),
|
|
11702
11965
|
expectedOutcomeAt: external_exports.string().datetime({ offset: true }),
|
|
11703
11966
|
priority: external_exports.enum(["critical", "high", "medium", "low"]).default("medium"),
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
}).strict().nullable(),
|
|
11724
|
-
observationPolicy: external_exports.object({
|
|
11725
|
-
kind: external_exports.enum(["none", "provider_readback", "governed_state_readback", "board_verification"]),
|
|
11726
|
-
dueAt: external_exports.string().datetime({ offset: true }).nullable()
|
|
11727
|
-
}).strict()
|
|
11728
|
-
}).strict().superRefine((value, ctx) => {
|
|
11729
|
-
if (value.outcomeClass === "internal_enablement" && !value.promotionReason) {
|
|
11730
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["promotionReason"], message: "Internal enablement must identify the external execution blocker it unlocks" });
|
|
11731
|
-
}
|
|
11732
|
-
if (value.outcomeClass !== "internal_enablement" && value.promotionReason) {
|
|
11733
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["promotionReason"], message: "Only internal enablement uses a promotion reason" });
|
|
11734
|
-
}
|
|
11735
|
-
if (["external_action", "observed_business_result"].includes(value.outcomeClass) && value.observationPolicy.kind === "none") {
|
|
11736
|
-
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["observationPolicy", "kind"], message: "External results require an authoritative readback policy" });
|
|
11737
|
-
}
|
|
11738
|
-
if (value.causalGoalGapRef.authorityRevision === 0 && !["internal_enablement", "governed_decision"].includes(value.outcomeClass)) {
|
|
11739
|
-
ctx.addIssue({
|
|
11740
|
-
code: external_exports.ZodIssueCode.custom,
|
|
11741
|
-
path: ["causalGoalGapRef", "authorityRevision"],
|
|
11742
|
-
message: "Only low-risk work may cite a provisional Goal Gap candidate"
|
|
11743
|
-
});
|
|
11744
|
-
}
|
|
11745
|
-
}).optional()
|
|
11746
|
-
}).strict();
|
|
11967
|
+
executionShape: external_exports.enum(["direct", "team_decomposition", "agent_decides"]).default("agent_decides"),
|
|
11968
|
+
completionStrategy: external_exports.enum(["single_aggregation", "multi_acceptance"]).nullable().default(null),
|
|
11969
|
+
portfolioAdmission: ceoPeriodicPortfolioAdmissionSchema.optional()
|
|
11970
|
+
}).strict().superRefine((value, ctx) => {
|
|
11971
|
+
if (value.executionShape === "team_decomposition" && !value.completionStrategy) {
|
|
11972
|
+
ctx.addIssue({
|
|
11973
|
+
code: external_exports.ZodIssueCode.custom,
|
|
11974
|
+
path: ["completionStrategy"],
|
|
11975
|
+
message: "Team decomposition requires an explicit completion strategy"
|
|
11976
|
+
});
|
|
11977
|
+
}
|
|
11978
|
+
if (value.executionShape !== "team_decomposition" && value.completionStrategy !== null) {
|
|
11979
|
+
ctx.addIssue({
|
|
11980
|
+
code: external_exports.ZodIssueCode.custom,
|
|
11981
|
+
path: ["completionStrategy"],
|
|
11982
|
+
message: "Only team decomposition may declare a completion strategy"
|
|
11983
|
+
});
|
|
11984
|
+
}
|
|
11985
|
+
});
|
|
11747
11986
|
var ceoPeriodicGoalGapCandidateSchema = external_exports.object({
|
|
11748
11987
|
candidateGapKey: external_exports.string().regex(/^[a-z0-9][a-z0-9._:-]{0,119}$/u),
|
|
11749
11988
|
criterionIndex: external_exports.number().int().min(0).max(9),
|
|
@@ -12181,10 +12420,16 @@ var governedBusinessTaskLineageSchema = external_exports.discriminatedUnion("kin
|
|
|
12181
12420
|
authorityRevision: external_exports.number().int().positive().nullable(),
|
|
12182
12421
|
contractHash: sha256Schema5.nullable(),
|
|
12183
12422
|
gapKey: stableIdentitySchema2.nullable(),
|
|
12184
|
-
sourceKind: external_exports.enum(["board_confirmed", "supported_projector"]).nullable(),
|
|
12423
|
+
sourceKind: external_exports.enum(["board_confirmed", "supported_projector", "supported_evaluator"]).nullable(),
|
|
12185
12424
|
projectedVerdictRequirement: external_exports.enum(["deterministic_evidence", "human_verdict_required"]),
|
|
12186
12425
|
effectiveVerdictRequirement: external_exports.enum(["deterministic_evidence", "human_verdict_required"])
|
|
12187
12426
|
}).strict().optional(),
|
|
12427
|
+
controllerIssueId: external_exports.string().uuid().optional(),
|
|
12428
|
+
routineRunId: external_exports.string().uuid().nullable().optional(),
|
|
12429
|
+
workPurposeKey: stableIdentitySchema2.optional(),
|
|
12430
|
+
intentFamilyKey: sha256Schema5.optional(),
|
|
12431
|
+
workFamilyKey: sha256Schema5.optional(),
|
|
12432
|
+
workInstanceKey: sha256Schema5.optional(),
|
|
12188
12433
|
supersedesDiscoveredWorkId: external_exports.string().uuid().optional(),
|
|
12189
12434
|
replacementContractRevision: stableIdentitySchema2.optional(),
|
|
12190
12435
|
requiredResponsibilityKey: stableIdentitySchema2.optional(),
|
|
@@ -19966,22 +20211,39 @@ function hostFrontmatterField(frontmatter, field) {
|
|
|
19966
20211
|
function hostEscapeXml(value) {
|
|
19967
20212
|
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
19968
20213
|
}
|
|
20214
|
+
function readManagedPiSkillMetadata(filePath) {
|
|
20215
|
+
const resolvedFilePath = realpathSync2(filePath);
|
|
20216
|
+
const source = readFileSync7(resolvedFilePath, "utf8");
|
|
20217
|
+
const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
20218
|
+
if (!match) {
|
|
20219
|
+
return {
|
|
20220
|
+
filePath: resolvedFilePath,
|
|
20221
|
+
hasFrontmatter: false,
|
|
20222
|
+
name: null,
|
|
20223
|
+
description: null,
|
|
20224
|
+
hidden: false
|
|
20225
|
+
};
|
|
20226
|
+
}
|
|
20227
|
+
return {
|
|
20228
|
+
filePath: resolvedFilePath,
|
|
20229
|
+
hasFrontmatter: true,
|
|
20230
|
+
name: hostFrontmatterField(match[1], "name"),
|
|
20231
|
+
description: hostFrontmatterField(match[1], "description"),
|
|
20232
|
+
hidden: hostFrontmatterField(match[1], "disable-model-invocation")?.toLowerCase() === "true"
|
|
20233
|
+
};
|
|
20234
|
+
}
|
|
19969
20235
|
function measureManagedPiRoleSkillMetadata(expectedSkills) {
|
|
19970
20236
|
const entries = expectedSkills.map((expected) => {
|
|
19971
|
-
const
|
|
19972
|
-
|
|
19973
|
-
if (!
|
|
19974
|
-
const name = hostFrontmatterField(match[1], "name");
|
|
19975
|
-
const description = hostFrontmatterField(match[1], "description");
|
|
19976
|
-
const hidden = hostFrontmatterField(match[1], "disable-model-invocation")?.toLowerCase() === "true";
|
|
19977
|
-
if (name !== expected.name || !description || expected.requireHidden !== false && !hidden) {
|
|
20237
|
+
const metadata = readManagedPiSkillMetadata(expected.filePath);
|
|
20238
|
+
if (!metadata.hasFrontmatter) throw new Error(`managed skill frontmatter missing: ${expected.name}`);
|
|
20239
|
+
if (metadata.name !== expected.name || typeof metadata.description !== "string" || !metadata.description.trim() || expected.requireHidden !== false && !metadata.hidden) {
|
|
19978
20240
|
throw new Error(`managed skill metadata mismatch: ${expected.name}`);
|
|
19979
20241
|
}
|
|
19980
20242
|
return [
|
|
19981
20243
|
" <skill>",
|
|
19982
|
-
` <name>${hostEscapeXml(name)}</name>`,
|
|
19983
|
-
` <description>${hostEscapeXml(description)}</description>`,
|
|
19984
|
-
` <location>${hostEscapeXml(
|
|
20244
|
+
` <name>${hostEscapeXml(metadata.name)}</name>`,
|
|
20245
|
+
` <description>${hostEscapeXml(metadata.description)}</description>`,
|
|
20246
|
+
` <location>${hostEscapeXml(metadata.filePath)}</location>`,
|
|
19985
20247
|
" </skill>"
|
|
19986
20248
|
].join("\n");
|
|
19987
20249
|
}).join("\n");
|
|
@@ -20053,7 +20315,10 @@ function readRoleSkill(expected) {
|
|
|
20053
20315
|
const name = frontmatterField(match[1], "name");
|
|
20054
20316
|
const description = frontmatterField(match[1], "description");
|
|
20055
20317
|
const hidden = frontmatterField(match[1], "disable-model-invocation")?.toLowerCase() === "true";
|
|
20056
|
-
if (name !== expected.name
|
|
20318
|
+
if (name !== expected.name
|
|
20319
|
+
|| typeof description !== "string"
|
|
20320
|
+
|| !description.trim()
|
|
20321
|
+
|| (expected.requireHidden !== false && !hidden)) {
|
|
20057
20322
|
throw new Error("managed skill metadata mismatch: " + expected.name);
|
|
20058
20323
|
}
|
|
20059
20324
|
return {
|
|
@@ -21326,10 +21591,29 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
21326
21591
|
function readMainSkills(piHome) {
|
|
21327
21592
|
const skillsRoot = resolve6(piHome, "skills");
|
|
21328
21593
|
if (!existsSync6(skillsRoot)) return [];
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
|
|
21332
|
-
|
|
21594
|
+
const entriesByName = /* @__PURE__ */ new Map();
|
|
21595
|
+
for (const directory of readdirSync3(skillsRoot).sort()) {
|
|
21596
|
+
const source = join7(skillsRoot, directory);
|
|
21597
|
+
const skillFilePath = join7(source, "SKILL.md");
|
|
21598
|
+
if (!existsSync6(skillFilePath)) continue;
|
|
21599
|
+
const metadata = readManagedPiSkillMetadata(skillFilePath);
|
|
21600
|
+
if (!metadata.hasFrontmatter || typeof metadata.name !== "string" || !/^[a-z0-9-]+$/.test(metadata.name) || typeof metadata.description !== "string" || !metadata.description.trim()) {
|
|
21601
|
+
throw new Error(`pi_managed_mcp_main_skill_metadata_invalid:${directory}`);
|
|
21602
|
+
}
|
|
21603
|
+
const existing = entriesByName.get(metadata.name);
|
|
21604
|
+
if (existing) {
|
|
21605
|
+
if (existing.filePath !== metadata.filePath) {
|
|
21606
|
+
throw new Error(`pi_managed_mcp_main_skill_conflict:${metadata.name}`);
|
|
21607
|
+
}
|
|
21608
|
+
continue;
|
|
21609
|
+
}
|
|
21610
|
+
entriesByName.set(metadata.name, {
|
|
21611
|
+
name: metadata.name,
|
|
21612
|
+
filePath: metadata.filePath,
|
|
21613
|
+
requireHidden: false
|
|
21614
|
+
});
|
|
21615
|
+
}
|
|
21616
|
+
return [...entriesByName.values()];
|
|
21333
21617
|
}
|
|
21334
21618
|
function resolveManagedRoleSkills(piHome, skillProfiles) {
|
|
21335
21619
|
const entriesByName = /* @__PURE__ */ new Map();
|
|
@@ -21351,11 +21635,19 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
21351
21635
|
}
|
|
21352
21636
|
}
|
|
21353
21637
|
for (const entry of readMainSkills(piHome)) {
|
|
21354
|
-
|
|
21638
|
+
const existing = entriesByName.get(entry.name);
|
|
21639
|
+
if (existing) {
|
|
21640
|
+
const existingFilePath = realpathSync3(join7(existing.source, "SKILL.md"));
|
|
21641
|
+
if (existingFilePath !== entry.filePath) {
|
|
21642
|
+
throw new Error(`pi_managed_mcp_main_skill_conflict:${entry.name}`);
|
|
21643
|
+
}
|
|
21644
|
+
continue;
|
|
21645
|
+
}
|
|
21646
|
+
entriesByName.set(entry.name, entry);
|
|
21355
21647
|
}
|
|
21356
21648
|
const entries = [...entriesByName.values()].map((entry) => ({
|
|
21357
21649
|
name: entry.name,
|
|
21358
|
-
filePath: realpathSync3(join7(entry.source, "SKILL.md")),
|
|
21650
|
+
filePath: entry.filePath ?? realpathSync3(join7(entry.source, "SKILL.md")),
|
|
21359
21651
|
...entry.requireHidden === false ? { requireHidden: false } : {}
|
|
21360
21652
|
}));
|
|
21361
21653
|
const metadata = measureManagedPiRoleSkillMetadata(entries);
|
|
@@ -24393,7 +24685,10 @@ function runtimeAuthorizationText(context, mode, {
|
|
|
24393
24685
|
].join("\n") : "";
|
|
24394
24686
|
const initializationAuthorization = asRecord(envelope.initializationAuthorization);
|
|
24395
24687
|
const initializationAuthority = asRecord(context.companyInitializationAuthority);
|
|
24396
|
-
const
|
|
24688
|
+
const organizationMutationAuthorityMode = readString(
|
|
24689
|
+
initializationAuthority.organizationMutationAuthorityMode
|
|
24690
|
+
);
|
|
24691
|
+
const initializationPlanAuthorizationWithoutExactReplay = readString(envelope.sourceKind) === COMPANY_INITIALIZATION_ORIGIN_KIND && readString(initializationAuthority.schemaVersion) === "mirrorx.company-initialization-authority.v1" && (organizationMutationAuthorityMode === "initialization_plan" || organizationMutationAuthorityMode === null && readString(initializationAuthorization.runId) && readString(initializationAuthorization.signature)) && (!Array.isArray(envelope.authorizedOrganizationIntents) || envelope.authorizedOrganizationIntents.length === 0);
|
|
24397
24692
|
const exactOrganizationReplay = replayAlreadyInTask || initializationPlanAuthorizationWithoutExactReplay ? "" : renderExactOrganizationIntentReplayBlock(envelope);
|
|
24398
24693
|
return [
|
|
24399
24694
|
completionContract,
|
|
@@ -24712,6 +25007,64 @@ function sectionText(section) {
|
|
|
24712
25007
|
return section.title ? `## ${section.title}
|
|
24713
25008
|
${section.content}` : section.content;
|
|
24714
25009
|
}
|
|
25010
|
+
var COMPANY_INITIALIZATION_PRE_AUTHORITY_SECTIONS = /* @__PURE__ */ new Set([
|
|
25011
|
+
"recovery_instruction",
|
|
25012
|
+
"approval_continuation",
|
|
25013
|
+
"wake_comments",
|
|
25014
|
+
"task",
|
|
25015
|
+
"task_acceptance_contract",
|
|
25016
|
+
"governed_business_state",
|
|
25017
|
+
"continuation_postcondition_gap",
|
|
25018
|
+
"continuation_summary",
|
|
25019
|
+
"resolved_dependencies",
|
|
25020
|
+
"runtime_delivery_readiness",
|
|
25021
|
+
"verified_company_context",
|
|
25022
|
+
"governed_reads",
|
|
25023
|
+
"optional_task_wiki_context",
|
|
25024
|
+
"attachments"
|
|
25025
|
+
]);
|
|
25026
|
+
var COMPANY_INITIALIZATION_POST_AUTHORITY_SECTIONS = /* @__PURE__ */ new Set([
|
|
25027
|
+
"runtime_rules",
|
|
25028
|
+
"runtime_authorization",
|
|
25029
|
+
"runtime_decomposition_requirement",
|
|
25030
|
+
"task_context_authority",
|
|
25031
|
+
"pi_mcp_usage",
|
|
25032
|
+
"runtime_template_catalog",
|
|
25033
|
+
"agent_instructions",
|
|
25034
|
+
"on_demand_refs",
|
|
25035
|
+
"raw_snapshot"
|
|
25036
|
+
]);
|
|
25037
|
+
function companyInitializationAuthoritySectionClass(name) {
|
|
25038
|
+
if (name === "company_initialization_authority") return "current_authority_sink";
|
|
25039
|
+
if (COMPANY_INITIALIZATION_PRE_AUTHORITY_SECTIONS.has(name)) return "historical_prose";
|
|
25040
|
+
if (COMPANY_INITIALIZATION_POST_AUTHORITY_SECTIONS.has(name)) return "runtime_contract";
|
|
25041
|
+
return null;
|
|
25042
|
+
}
|
|
25043
|
+
function validateCompanyInitializationAuthoritySectionOrder(sections) {
|
|
25044
|
+
const sinkIndexes = sections.flatMap((section, index) => section?.name === "company_initialization_authority" ? [index] : []);
|
|
25045
|
+
if (sinkIndexes.length === 0) return;
|
|
25046
|
+
if (sinkIndexes.length !== 1) {
|
|
25047
|
+
const error = new Error("Company initialization prompt must contain exactly one final authority sink");
|
|
25048
|
+
error.code = "company_initialization_authority_section_order_invalid";
|
|
25049
|
+
throw error;
|
|
25050
|
+
}
|
|
25051
|
+
const sinkIndex = sinkIndexes[0];
|
|
25052
|
+
for (const [index, section] of sections.entries()) {
|
|
25053
|
+
const name = readString(section?.name);
|
|
25054
|
+
const sectionClass = companyInitializationAuthoritySectionClass(name);
|
|
25055
|
+
if (sectionClass === "current_authority_sink") continue;
|
|
25056
|
+
if (!sectionClass) {
|
|
25057
|
+
const error = new Error(`Unclassified Company initialization prompt section: ${name ?? "missing"}`);
|
|
25058
|
+
error.code = "company_initialization_authority_section_unclassified";
|
|
25059
|
+
throw error;
|
|
25060
|
+
}
|
|
25061
|
+
if (sectionClass === "historical_prose" && index > sinkIndex || sectionClass === "runtime_contract" && index < sinkIndex) {
|
|
25062
|
+
const error = new Error(`Company initialization prompt section is on the wrong side of the final authority sink: ${name}`);
|
|
25063
|
+
error.code = "company_initialization_authority_section_order_invalid";
|
|
25064
|
+
throw error;
|
|
25065
|
+
}
|
|
25066
|
+
}
|
|
25067
|
+
}
|
|
24715
25068
|
function companyInitializationAuthoritySection(context) {
|
|
24716
25069
|
const authority = asRecord(context.companyInitializationAuthority);
|
|
24717
25070
|
const authorization = asRecord(context.authorizationEnvelope);
|
|
@@ -24722,6 +25075,13 @@ function companyInitializationAuthoritySection(context) {
|
|
|
24722
25075
|
const targetAgentCount = Number(authority.targetAgentCount);
|
|
24723
25076
|
const maxAgentCount = Number(authority.maxAgentCount);
|
|
24724
25077
|
const sourceRevision = readString(authorization.sourceRevision);
|
|
25078
|
+
const rawOrganizationMutationAuthorityMode = authority.organizationMutationAuthorityMode;
|
|
25079
|
+
const organizationMutationAuthorityMode = readString(rawOrganizationMutationAuthorityMode);
|
|
25080
|
+
if (rawOrganizationMutationAuthorityMode != null && organizationMutationAuthorityMode !== "initialization_plan" && organizationMutationAuthorityMode !== "exact_intent_replay") {
|
|
25081
|
+
const error = new Error("Matched Company initialization authority has an unsupported organization mutation mode");
|
|
25082
|
+
error.code = "company_initialization_authority_mode_unsupported";
|
|
25083
|
+
throw error;
|
|
25084
|
+
}
|
|
24725
25085
|
if (readString(authority.schemaVersion) !== "mirrorx.company-initialization-authority.v1" || readString(authorization.sourceKind) !== "company_initialization" || readString(authorization.sourceId) !== initializationId || sourceRevision !== `${revision}:${organizationVersion}` || !initializationId || !Number.isInteger(revision) || revision < 1 || !Number.isInteger(organizationVersion) || organizationVersion < 1 || !Number.isInteger(minAgentCount) || !Number.isInteger(targetAgentCount) || !Number.isInteger(maxAgentCount) || minAgentCount < 1 || targetAgentCount < minAgentCount || targetAgentCount > maxAgentCount) return null;
|
|
24726
25086
|
const executionPolicy = asRecord(authority.executionPolicy);
|
|
24727
25087
|
const executionPolicyRef = readString(executionPolicy.ref);
|
|
@@ -24736,6 +25096,13 @@ function companyInitializationAuthoritySection(context) {
|
|
|
24736
25096
|
error.code = "company_initialization_authority_not_fresh";
|
|
24737
25097
|
throw error;
|
|
24738
25098
|
}
|
|
25099
|
+
const exactOrganizationIntentCount = Array.isArray(authorization.authorizedOrganizationIntents) ? authorization.authorizedOrganizationIntents.length : 0;
|
|
25100
|
+
const organizationMutationAuthorized = Array.isArray(authorization.allowedActionClasses) && authorization.allowedActionClasses.includes("organization_mutation");
|
|
25101
|
+
if (organizationMutationAuthorityMode && (!organizationMutationAuthorized || organizationMutationAuthorityMode === "initialization_plan" && exactOrganizationIntentCount !== 0 || organizationMutationAuthorityMode === "exact_intent_replay" && exactOrganizationIntentCount === 0)) {
|
|
25102
|
+
const error = new Error("Matched Company initialization authority mode conflicts with its authorization envelope");
|
|
25103
|
+
error.code = "company_initialization_authority_mode_mismatch";
|
|
25104
|
+
throw error;
|
|
25105
|
+
}
|
|
24739
25106
|
const remainingReadyPostconditions = Array.isArray(authority.remainingReadyPostconditions) ? authority.remainingReadyPostconditions.map(asRecord).flatMap((postcondition) => {
|
|
24740
25107
|
const key = readString(postcondition.key);
|
|
24741
25108
|
return key ? [{ key }] : [];
|
|
@@ -24749,6 +25116,10 @@ function companyInitializationAuthoritySection(context) {
|
|
|
24749
25116
|
`- Initialization id: ${JSON.stringify(initializationId)}`,
|
|
24750
25117
|
`- Input revision: ${revision}`,
|
|
24751
25118
|
`- Organization version: ${organizationVersion}`,
|
|
25119
|
+
...organizationMutationAuthorityMode ? [
|
|
25120
|
+
`- Organization mutation authority mode: ${organizationMutationAuthorityMode}`,
|
|
25121
|
+
`- Exact organization-intent replay required for this run: ${organizationMutationAuthorityMode === "exact_intent_replay" ? "true" : "false"}`
|
|
25122
|
+
] : [],
|
|
24752
25123
|
`- Team mode: ${JSON.stringify(mode)}`,
|
|
24753
25124
|
agentCountLine,
|
|
24754
25125
|
`- Organization Plan artifact state: ${artifactStateKind ?? "unknown"}`,
|
|
@@ -25070,7 +25441,6 @@ ${resolvedDependencies.details.content}` : resolvedDependencies.details.content
|
|
|
25070
25441
|
{ name: "approval_continuation", title: "Approved Runtime Action Continuation", priority: 99, sourceRef: `run:${input.runId ?? "unknown"}`, content: approvalContinuationText(input), truncationReason: mode === "continuation" ? null : "mode_selection" },
|
|
25071
25442
|
{ name: "wake_comments", title: wakeDeltaTitle, priority: interactionResolution ? 99 : 95, sourceRef: wakeDeltaSourceRefs, originalContent: wakeDeltaOriginal, content: wakeDeltaContent, truncationReason: commentsSelected ? null : "duplicate_task_context" },
|
|
25072
25443
|
{ name: "task", title: "Task Context", priority: 90, sourceRef: taskSourceRefs, originalContent: [taskText, taskCommentRefGuidance(input, taskText)].filter(Boolean).join("\n"), content: includeTask ? [taskText, taskCommentRefGuidance(input, taskText)].filter(Boolean).join("\n") : "", truncationReason: includeTask ? null : "mode_selection" },
|
|
25073
|
-
...companyInitializationAuthority && !includeTask ? [companyInitializationAuthority] : [],
|
|
25074
25444
|
...taskAcceptanceContract ? [{ name: "task_acceptance_contract", title: "Task Acceptance Contract", priority: 100, ...taskAcceptanceContract }] : [],
|
|
25075
25445
|
...governedBusinessState ? [{ name: "governed_business_state", title: "Governed Business State", priority: 99, ...governedBusinessState }] : [],
|
|
25076
25446
|
...continuationPostconditionGap ? [{ name: "continuation_postcondition_gap", title: "Continuation Postcondition Gap", priority: 100, ...continuationPostconditionGap }] : [],
|
|
@@ -25082,6 +25452,7 @@ ${resolvedDependencies.details.content}` : resolvedDependencies.details.content
|
|
|
25082
25452
|
...resolvedDependencySection
|
|
25083
25453
|
}] : [],
|
|
25084
25454
|
...deliveryReadinessContent ? [{ name: "runtime_delivery_readiness", title: "Current Delivery Readiness", priority: 99, sourceRef: `issue:${input.issueId ?? "unknown"}:delivery`, content: deliveryReadinessContent }] : [],
|
|
25455
|
+
...companyInitializationAuthority && !includeTask ? [companyInitializationAuthority] : [],
|
|
25085
25456
|
{ name: "runtime_rules", title: "", priority: 100, sourceRef: `command:${input.commandId}`, content: fixedRules(input, !hasTask) },
|
|
25086
25457
|
{ name: "runtime_authorization", title: "Runtime Action Contract", priority: 98, sourceRef: `run:${input.runId ?? "unknown"}`, content: runtimeAuthorizationText(context, mode, {
|
|
25087
25458
|
replayAlreadyInTask: includeTask && taskText.includes(EXACT_ORGANIZATION_INTENT_REPLAY_MARKER),
|
|
@@ -25115,6 +25486,20 @@ ${resolvedDependencies.details.content}` : resolvedDependencies.details.content
|
|
|
25115
25486
|
},
|
|
25116
25487
|
{ name: "raw_snapshot", title: "Raw Context Snapshot", priority: 0, sourceRef: `run:${input.runId ?? "unknown"}`, originalChars: jsonCharLength(context), content: "", truncationReason: "on_demand_large_object" }
|
|
25117
25488
|
];
|
|
25489
|
+
if (rawSections.some((section) => section.name === "company_initialization_authority")) {
|
|
25490
|
+
const rank = {
|
|
25491
|
+
historical_prose: 0,
|
|
25492
|
+
current_authority_sink: 1,
|
|
25493
|
+
runtime_contract: 2
|
|
25494
|
+
};
|
|
25495
|
+
rawSections.sort((left, right) => {
|
|
25496
|
+
const leftClass = companyInitializationAuthoritySectionClass(left.name);
|
|
25497
|
+
const rightClass = companyInitializationAuthoritySectionClass(right.name);
|
|
25498
|
+
if (!leftClass || !rightClass) return 0;
|
|
25499
|
+
return rank[leftClass] - rank[rightClass];
|
|
25500
|
+
});
|
|
25501
|
+
}
|
|
25502
|
+
validateCompanyInitializationAuthoritySectionOrder(rawSections);
|
|
25118
25503
|
for (const section of rawSections) {
|
|
25119
25504
|
section.scope ??= contextScope;
|
|
25120
25505
|
section.freshness ??= snapshotFreshness;
|
|
@@ -29893,7 +30278,7 @@ function createSourceCompletionStopPolicy({
|
|
|
29893
30278
|
}
|
|
29894
30279
|
|
|
29895
30280
|
// src/amaster-runtime-daemon.mjs
|
|
29896
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
30281
|
+
var CONNECTOR_VERSION = "0.1.1-beta.156";
|
|
29897
30282
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
29898
30283
|
var SOURCE_ACQUISITION_CAPABILITY2 = source_acquisition_compatibility_default.profileVersion;
|
|
29899
30284
|
var daemonRequire = createRequire(import.meta.url);
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { homedir, hostname } from "node:os";
|
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { BUILD_SUPPORTED_CAPABILITIES } from "./amaster-runtime-daemon/capability-registry.mjs";
|
|
9
9
|
|
|
10
|
-
const CONNECTOR_VERSION = "0.1.1-beta.
|
|
10
|
+
const CONNECTOR_VERSION = "0.1.1-beta.156";
|
|
11
11
|
|
|
12
12
|
const CONFIG_KEY_MAP = new Map([
|
|
13
13
|
["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
|