@amaster.ai/employee-runtime-connector 0.1.1-beta.150 → 0.1.1-beta.152
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 +150 -49
- package/dist/amaster-runtime.mjs +1 -1
- package/package.json +1 -1
|
@@ -5410,6 +5410,10 @@ var companyStageSchema = external_exports.enum(COMPANY_STAGES);
|
|
|
5410
5410
|
var coldStartStageSchema = external_exports.enum(COLD_START_STAGES);
|
|
5411
5411
|
var coldStartExpectedActionSchema = external_exports.enum(COMPANY_COLD_START_ACTIONS);
|
|
5412
5412
|
var companyColdStartFactSlotSchema = external_exports.enum(COMPANY_COLD_START_FACT_SLOTS);
|
|
5413
|
+
var companyColdStartFactSlotsSchema = external_exports.array(companyColdStartFactSlotSchema).min(1).max(COMPANY_COLD_START_FACT_SLOTS.length).transform((slots) => {
|
|
5414
|
+
const selected = new Set(slots);
|
|
5415
|
+
return COMPANY_COLD_START_FACT_SLOTS.filter((slot) => selected.has(slot));
|
|
5416
|
+
});
|
|
5413
5417
|
var COLD_START_FACT_COVERAGE_DISPOSITIONS = [
|
|
5414
5418
|
"established",
|
|
5415
5419
|
"explicit_unknown",
|
|
@@ -11159,6 +11163,14 @@ var issueDeliveryAcceptanceGovernanceFindingSchema = external_exports.object({
|
|
|
11159
11163
|
code: external_exports.literal("business_outcome_acceptance_policy_mismatch"),
|
|
11160
11164
|
message: external_exports.string().min(1)
|
|
11161
11165
|
}).strict();
|
|
11166
|
+
var issueDeliveryColdStartFactCoverageContextSchema = external_exports.object({
|
|
11167
|
+
worksetId: uuidSchema3,
|
|
11168
|
+
worksetItemId: uuidSchema3,
|
|
11169
|
+
factSlots: external_exports.array(external_exports.object({
|
|
11170
|
+
slot: companyColdStartFactSlotSchema,
|
|
11171
|
+
allowedDispositions: external_exports.array(coldStartFactCoverageDispositionSchema).min(1).max(3)
|
|
11172
|
+
}).strict()).min(1).max(6)
|
|
11173
|
+
}).strict();
|
|
11162
11174
|
var issueDeliveryAcceptanceReadModelSchema = external_exports.object({
|
|
11163
11175
|
companyId: uuidSchema3,
|
|
11164
11176
|
issueId: uuidSchema3,
|
|
@@ -11175,7 +11187,8 @@ var issueDeliveryAcceptanceReadModelSchema = external_exports.object({
|
|
|
11175
11187
|
}).strict(),
|
|
11176
11188
|
pendingInteractions: external_exports.array(issueDeliveryAcceptancePendingInteractionSchema),
|
|
11177
11189
|
forceDone: issueForceDoneEvidenceSchema.nullable(),
|
|
11178
|
-
nextOwner: issueDeliveryAcceptanceNextOwnerSchema
|
|
11190
|
+
nextOwner: issueDeliveryAcceptanceNextOwnerSchema,
|
|
11191
|
+
coldStartFactCoverage: issueDeliveryColdStartFactCoverageContextSchema.nullable().default(null)
|
|
11179
11192
|
}).strict();
|
|
11180
11193
|
|
|
11181
11194
|
// ../shared/src/operating-accounting.ts
|
|
@@ -19929,22 +19942,39 @@ function hostFrontmatterField(frontmatter, field) {
|
|
|
19929
19942
|
function hostEscapeXml(value) {
|
|
19930
19943
|
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
19931
19944
|
}
|
|
19945
|
+
function readManagedPiSkillMetadata(filePath) {
|
|
19946
|
+
const resolvedFilePath = realpathSync2(filePath);
|
|
19947
|
+
const source = readFileSync7(resolvedFilePath, "utf8");
|
|
19948
|
+
const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
19949
|
+
if (!match) {
|
|
19950
|
+
return {
|
|
19951
|
+
filePath: resolvedFilePath,
|
|
19952
|
+
hasFrontmatter: false,
|
|
19953
|
+
name: null,
|
|
19954
|
+
description: null,
|
|
19955
|
+
hidden: false
|
|
19956
|
+
};
|
|
19957
|
+
}
|
|
19958
|
+
return {
|
|
19959
|
+
filePath: resolvedFilePath,
|
|
19960
|
+
hasFrontmatter: true,
|
|
19961
|
+
name: hostFrontmatterField(match[1], "name"),
|
|
19962
|
+
description: hostFrontmatterField(match[1], "description"),
|
|
19963
|
+
hidden: hostFrontmatterField(match[1], "disable-model-invocation")?.toLowerCase() === "true"
|
|
19964
|
+
};
|
|
19965
|
+
}
|
|
19932
19966
|
function measureManagedPiRoleSkillMetadata(expectedSkills) {
|
|
19933
19967
|
const entries = expectedSkills.map((expected) => {
|
|
19934
|
-
const
|
|
19935
|
-
|
|
19936
|
-
if (!
|
|
19937
|
-
|
|
19938
|
-
const description = hostFrontmatterField(match[1], "description");
|
|
19939
|
-
const hidden = hostFrontmatterField(match[1], "disable-model-invocation")?.toLowerCase() === "true";
|
|
19940
|
-
if (name !== expected.name || !description || !hidden) {
|
|
19941
|
-
throw new Error(`role skill metadata mismatch: ${expected.name}`);
|
|
19968
|
+
const metadata = readManagedPiSkillMetadata(expected.filePath);
|
|
19969
|
+
if (!metadata.hasFrontmatter) throw new Error(`managed skill frontmatter missing: ${expected.name}`);
|
|
19970
|
+
if (metadata.name !== expected.name || typeof metadata.description !== "string" || !metadata.description.trim() || expected.requireHidden !== false && !metadata.hidden) {
|
|
19971
|
+
throw new Error(`managed skill metadata mismatch: ${expected.name}`);
|
|
19942
19972
|
}
|
|
19943
19973
|
return [
|
|
19944
19974
|
" <skill>",
|
|
19945
|
-
` <name>${hostEscapeXml(name)}</name>`,
|
|
19946
|
-
` <description>${hostEscapeXml(description)}</description>`,
|
|
19947
|
-
` <location>${hostEscapeXml(
|
|
19975
|
+
` <name>${hostEscapeXml(metadata.name)}</name>`,
|
|
19976
|
+
` <description>${hostEscapeXml(metadata.description)}</description>`,
|
|
19977
|
+
` <location>${hostEscapeXml(metadata.filePath)}</location>`,
|
|
19948
19978
|
" </skill>"
|
|
19949
19979
|
].join("\n");
|
|
19950
19980
|
}).join("\n");
|
|
@@ -20012,12 +20042,15 @@ function readRoleSkill(expected) {
|
|
|
20012
20042
|
const filePath = realpathSync(expected.filePath);
|
|
20013
20043
|
const source = readFileSync(filePath, "utf8");
|
|
20014
20044
|
const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
20015
|
-
if (!match) throw new Error("
|
|
20045
|
+
if (!match) throw new Error("managed skill frontmatter missing: " + expected.name);
|
|
20016
20046
|
const name = frontmatterField(match[1], "name");
|
|
20017
20047
|
const description = frontmatterField(match[1], "description");
|
|
20018
20048
|
const hidden = frontmatterField(match[1], "disable-model-invocation")?.toLowerCase() === "true";
|
|
20019
|
-
if (name !== expected.name
|
|
20020
|
-
|
|
20049
|
+
if (name !== expected.name
|
|
20050
|
+
|| typeof description !== "string"
|
|
20051
|
+
|| !description.trim()
|
|
20052
|
+
|| (expected.requireHidden !== false && !hidden)) {
|
|
20053
|
+
throw new Error("managed skill metadata mismatch: " + expected.name);
|
|
20021
20054
|
}
|
|
20022
20055
|
return {
|
|
20023
20056
|
name,
|
|
@@ -20214,6 +20247,7 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
20214
20247
|
const ownershipStatSyncImpl = typeof options.ownershipStatSync === "function" ? options.ownershipStatSync : statSync4;
|
|
20215
20248
|
const nowImpl = typeof options.now === "function" ? options.now : Date.now;
|
|
20216
20249
|
const warnImpl = typeof options.warn === "function" ? options.warn : console.warn;
|
|
20250
|
+
const sourceAcquisitionExtensionDigest = options.sourceAcquisitionExtensionDigest === void 0 ? process.env.AMASTER_SOURCE_ACQUISITION_EXTENSION_DIGEST : options.sourceAcquisitionExtensionDigest;
|
|
20217
20251
|
const SUPPORTED_SCHEMA_VERSION2 = "amaster.governed-mcp.v1";
|
|
20218
20252
|
const SUPPORTED_SERVER_NAME2 = "amaster";
|
|
20219
20253
|
const DIRECT_CATALOG_SCHEMA_VERSION = "amaster.governed-mcp-direct-catalog.v1";
|
|
@@ -20406,10 +20440,21 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
20406
20440
|
if (mode !== 384) throw new Error(`pi_managed_mcp_permissions_failed: ${filePath} mode=${mode.toString(8)}`);
|
|
20407
20441
|
}
|
|
20408
20442
|
function resolveSourceAcquisitionExtension(sharedPiHome, sourceAcquisition) {
|
|
20409
|
-
const
|
|
20410
|
-
|
|
20443
|
+
const profileDigestValue = sourceAcquisition?.profile?.connectorAdmission?.sourceExtensionDigest;
|
|
20444
|
+
const runtimeDigestValue = sourceAcquisitionExtensionDigest;
|
|
20445
|
+
const runtimeDigestProvided = runtimeDigestValue !== void 0 && runtimeDigestValue !== null;
|
|
20446
|
+
const profileDigest = typeof profileDigestValue === "string" && /^[a-f0-9]{64}$/i.test(profileDigestValue) ? profileDigestValue.toLowerCase() : null;
|
|
20447
|
+
const runtimeDigest = typeof runtimeDigestValue === "string" && /^[a-f0-9]{64}$/i.test(runtimeDigestValue) ? runtimeDigestValue.toLowerCase() : null;
|
|
20448
|
+
if (profileDigestValue !== void 0 && !profileDigest) {
|
|
20411
20449
|
throw new Error("source_acquisition_extension_profile_digest_invalid");
|
|
20412
20450
|
}
|
|
20451
|
+
if (!profileDigest && !runtimeDigest) {
|
|
20452
|
+
throw new Error("source_acquisition_extension_profile_digest_invalid");
|
|
20453
|
+
}
|
|
20454
|
+
if (runtimeDigestProvided && (!runtimeDigest || profileDigest && profileDigest !== runtimeDigest)) {
|
|
20455
|
+
throw new Error("source_acquisition_extension_digest_mismatch");
|
|
20456
|
+
}
|
|
20457
|
+
const expectedDigest = profileDigest ?? runtimeDigest;
|
|
20413
20458
|
const extensionPath = join7(sharedPiHome, "extensions", "amaster-source-acquisition.js");
|
|
20414
20459
|
let extensionStat;
|
|
20415
20460
|
try {
|
|
@@ -20428,7 +20473,7 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
20428
20473
|
if (error?.code === "ENOENT") throw new Error("source_acquisition_extension_missing");
|
|
20429
20474
|
throw new Error("source_acquisition_extension_unsafe");
|
|
20430
20475
|
}
|
|
20431
|
-
if (sha2565(extensionBytes) !== expectedDigest
|
|
20476
|
+
if (sha2565(extensionBytes) !== expectedDigest) {
|
|
20432
20477
|
throw new Error("source_acquisition_extension_digest_mismatch");
|
|
20433
20478
|
}
|
|
20434
20479
|
return extensionBytes;
|
|
@@ -21274,6 +21319,33 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
21274
21319
|
return existsSync6(join7(source, "SKILL.md")) ? [{ name, source }] : [];
|
|
21275
21320
|
});
|
|
21276
21321
|
}
|
|
21322
|
+
function readMainSkills(piHome) {
|
|
21323
|
+
const skillsRoot = resolve6(piHome, "skills");
|
|
21324
|
+
if (!existsSync6(skillsRoot)) return [];
|
|
21325
|
+
const entriesByName = /* @__PURE__ */ new Map();
|
|
21326
|
+
for (const directory of readdirSync3(skillsRoot).sort()) {
|
|
21327
|
+
const source = join7(skillsRoot, directory);
|
|
21328
|
+
const skillFilePath = join7(source, "SKILL.md");
|
|
21329
|
+
if (!existsSync6(skillFilePath)) continue;
|
|
21330
|
+
const metadata = readManagedPiSkillMetadata(skillFilePath);
|
|
21331
|
+
if (!metadata.hasFrontmatter || typeof metadata.name !== "string" || !/^[a-z0-9-]+$/.test(metadata.name) || typeof metadata.description !== "string" || !metadata.description.trim()) {
|
|
21332
|
+
throw new Error(`pi_managed_mcp_main_skill_metadata_invalid:${directory}`);
|
|
21333
|
+
}
|
|
21334
|
+
const existing = entriesByName.get(metadata.name);
|
|
21335
|
+
if (existing) {
|
|
21336
|
+
if (existing.filePath !== metadata.filePath) {
|
|
21337
|
+
throw new Error(`pi_managed_mcp_main_skill_conflict:${metadata.name}`);
|
|
21338
|
+
}
|
|
21339
|
+
continue;
|
|
21340
|
+
}
|
|
21341
|
+
entriesByName.set(metadata.name, {
|
|
21342
|
+
name: metadata.name,
|
|
21343
|
+
filePath: metadata.filePath,
|
|
21344
|
+
requireHidden: false
|
|
21345
|
+
});
|
|
21346
|
+
}
|
|
21347
|
+
return [...entriesByName.values()];
|
|
21348
|
+
}
|
|
21277
21349
|
function resolveManagedRoleSkills(piHome, skillProfiles) {
|
|
21278
21350
|
const entriesByName = /* @__PURE__ */ new Map();
|
|
21279
21351
|
for (const skillProfile of skillProfiles) {
|
|
@@ -21288,12 +21360,26 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
21288
21360
|
entriesByName.set(entry.name, entry);
|
|
21289
21361
|
}
|
|
21290
21362
|
}
|
|
21291
|
-
|
|
21292
|
-
|
|
21363
|
+
if (skillProfiles.length > 0) {
|
|
21364
|
+
for (const entry of readCommonRoleSkills(piHome)) {
|
|
21365
|
+
if (!entriesByName.has(entry.name)) entriesByName.set(entry.name, entry);
|
|
21366
|
+
}
|
|
21367
|
+
}
|
|
21368
|
+
for (const entry of readMainSkills(piHome)) {
|
|
21369
|
+
const existing = entriesByName.get(entry.name);
|
|
21370
|
+
if (existing) {
|
|
21371
|
+
const existingFilePath = realpathSync3(join7(existing.source, "SKILL.md"));
|
|
21372
|
+
if (existingFilePath !== entry.filePath) {
|
|
21373
|
+
throw new Error(`pi_managed_mcp_main_skill_conflict:${entry.name}`);
|
|
21374
|
+
}
|
|
21375
|
+
continue;
|
|
21376
|
+
}
|
|
21377
|
+
entriesByName.set(entry.name, entry);
|
|
21293
21378
|
}
|
|
21294
21379
|
const entries = [...entriesByName.values()].map((entry) => ({
|
|
21295
21380
|
name: entry.name,
|
|
21296
|
-
filePath: realpathSync3(join7(entry.source, "SKILL.md"))
|
|
21381
|
+
filePath: entry.filePath ?? realpathSync3(join7(entry.source, "SKILL.md")),
|
|
21382
|
+
...entry.requireHidden === false ? { requireHidden: false } : {}
|
|
21297
21383
|
}));
|
|
21298
21384
|
const metadata = measureManagedPiRoleSkillMetadata(entries);
|
|
21299
21385
|
return {
|
|
@@ -21317,9 +21403,9 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
21317
21403
|
return [];
|
|
21318
21404
|
}
|
|
21319
21405
|
function skillProfilesAttestation(skillProfiles, enabledSkills, enabledSkillMetadataBytes, enabledSkillMetadataSha256) {
|
|
21320
|
-
if (
|
|
21406
|
+
if (!Array.isArray(enabledSkills) || enabledSkills.length === 0) return {};
|
|
21321
21407
|
return {
|
|
21322
|
-
skillProfiles,
|
|
21408
|
+
...skillProfiles.length > 0 ? { skillProfiles } : {},
|
|
21323
21409
|
enabledSkillsDigest: createHash8("sha256").update(JSON.stringify(enabledSkills)).digest("hex"),
|
|
21324
21410
|
enabledSkillMetadataBytes,
|
|
21325
21411
|
enabledSkillMetadataSha256
|
|
@@ -21873,15 +21959,17 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
21873
21959
|
let enabledRoleSkillMetadataBytes = 0;
|
|
21874
21960
|
let enabledRoleSkillMetadataSha256 = null;
|
|
21875
21961
|
const skillProfiles = roleSkillProfilesForRun(input);
|
|
21876
|
-
if (
|
|
21962
|
+
if (!input.sourceAcquisition) {
|
|
21877
21963
|
const roleSkills = resolveManagedRoleSkills(sharedRuntime.home, skillProfiles);
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
|
|
21884
|
-
|
|
21964
|
+
if (roleSkills.entries.length > 0) {
|
|
21965
|
+
writeProfileExtension(
|
|
21966
|
+
MANAGED_PI_ROLE_SKILLS_VISIBILITY_FILENAME,
|
|
21967
|
+
managedPiRoleSkillsVisibilityExtensionSource(roleSkills.entries)
|
|
21968
|
+
);
|
|
21969
|
+
enabledRoleSkills = roleSkills.enabled;
|
|
21970
|
+
enabledRoleSkillMetadataBytes = roleSkills.serializedMetadataBytes;
|
|
21971
|
+
enabledRoleSkillMetadataSha256 = roleSkills.serializedMetadataSha256;
|
|
21972
|
+
}
|
|
21885
21973
|
}
|
|
21886
21974
|
if (input.sourceAcquisition && effectiveToolsAttestorExtensionPath) {
|
|
21887
21975
|
const attestorPathIndex = extensionArgs.indexOf(effectiveToolsAttestorExtensionPath);
|
|
@@ -22263,19 +22351,21 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
|
|
|
22263
22351
|
let enabledRoleSkills = null;
|
|
22264
22352
|
let enabledRoleSkillMetadataBytes = 0;
|
|
22265
22353
|
let enabledRoleSkillMetadataSha256 = null;
|
|
22266
|
-
if (
|
|
22354
|
+
if (!input.sourceAcquisition) {
|
|
22267
22355
|
const roleSkills = resolveManagedRoleSkills(sourcePiHome, skillProfiles);
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
|
|
22278
|
-
|
|
22356
|
+
if (roleSkills.entries.length > 0) {
|
|
22357
|
+
const extensionsDir = join7(profileRoot, "extensions");
|
|
22358
|
+
const extensionPath = join7(extensionsDir, MANAGED_PI_ROLE_SKILLS_VISIBILITY_FILENAME);
|
|
22359
|
+
mkdirSync3(extensionsDir, { recursive: true, mode: 448 });
|
|
22360
|
+
writePrivateFile2(
|
|
22361
|
+
extensionPath,
|
|
22362
|
+
managedPiRoleSkillsVisibilityExtensionSource(roleSkills.entries)
|
|
22363
|
+
);
|
|
22364
|
+
extensionArgs.push("--extension", extensionPath);
|
|
22365
|
+
enabledRoleSkills = roleSkills.enabled;
|
|
22366
|
+
enabledRoleSkillMetadataBytes = roleSkills.serializedMetadataBytes;
|
|
22367
|
+
enabledRoleSkillMetadataSha256 = roleSkills.serializedMetadataSha256;
|
|
22368
|
+
}
|
|
22279
22369
|
}
|
|
22280
22370
|
const env = {
|
|
22281
22371
|
...input.baseEnv,
|
|
@@ -23430,6 +23520,8 @@ function taskAcceptanceContractSection(context, input) {
|
|
|
23430
23520
|
const requirementCompletion = asRecord(requirements.completion);
|
|
23431
23521
|
const delivery = asRecord(contract.delivery);
|
|
23432
23522
|
const acceptance = asRecord(contract.acceptance);
|
|
23523
|
+
const outcomeAuthority = asRecord(contract.outcome_authority);
|
|
23524
|
+
const completionReview = asRecord(contract.completion_review);
|
|
23433
23525
|
const criteria = Array.isArray(contract.acceptance_criteria) ? contract.acceptance_criteria.map(asRecord) : [];
|
|
23434
23526
|
const allowedKinds = Array.isArray(delivery.allowed_kinds) ? delivery.allowed_kinds.map(readString).filter(Boolean) : [];
|
|
23435
23527
|
const acceptanceContracts = Array.isArray(delivery.acceptance_contracts) ? delivery.acceptance_contracts : [];
|
|
@@ -23440,7 +23532,7 @@ function taskAcceptanceContractSection(context, input) {
|
|
|
23440
23532
|
const sourceRef = readString(contract.source_ref);
|
|
23441
23533
|
const validCriteria = criteria.length > 0 && criteria.every((criterion) => readString(criterion.ref) && readString(criterion.text));
|
|
23442
23534
|
const validEnrollmentIdentity = schemaVersion === "mirrorx.task-acceptance-contract.v1" && readString(enrollment.id) && Number.isInteger(enrollment.revision) && enrollmentRequirementRevision && readString(enrollment.request_hash) && sourceRef === `business_task_enrollment:${readString(enrollment.id)}@${enrollmentRequirementRevision}`;
|
|
23443
|
-
const validParentGovernedChildIdentity = schemaVersion === "mirrorx.task-acceptance-contract.
|
|
23535
|
+
const validParentGovernedChildIdentity = schemaVersion === "mirrorx.task-acceptance-contract.v3" && Object.keys(enrollment).length === 0 && Object.keys(acceptance).length === 0 && readString(authority.kind) === "parent_governed_child" && parentRequirementRevision && readString(authority.requirements_hash) === canonicalSha256(requirements) && ["required_execution", "final_aggregation"].includes(readString(authority.completion_role)) && ["none", "package", "own_deliverable", "delegated_final_aggregation"].includes(readString(authority.review_authority)) && sourceRef === `parent_governed_child:${readString(contract.issue_id)}@${parentRequirementRevision}`;
|
|
23444
23536
|
const validIdentity2 = readString(contract.company_id) && readString(contract.issue_id) && Number.isInteger(contract.execution_epoch) && readString(contract.observed_at) && requirementRevision && Boolean(validEnrollmentIdentity || validParentGovernedChildIdentity);
|
|
23445
23537
|
const noManifestDelivery = delivery.contract_state === "not_required";
|
|
23446
23538
|
const uniqueAllowedKinds = new Set(allowedKinds).size === allowedKinds.length;
|
|
@@ -23448,9 +23540,17 @@ function taskAcceptanceContractSection(context, input) {
|
|
|
23448
23540
|
const validManifestDelivery = allowedKinds.length > 0 && (delivery.contract_state === "explicit_typed" || delivery.contract_state === "acceptance_refs_only") && (delivery.contract_state !== "explicit_typed" || acceptanceContracts.length > 0);
|
|
23449
23541
|
const validDelivery = uniqueAllowedKinds && (validNoManifestDelivery || validManifestDelivery);
|
|
23450
23542
|
const validOwnedAcceptance = readString(acceptance.owner_agent_id) && Object.keys(asRecord(acceptance.policy)).length > 0 && readString(acceptance.expected_outcome_at);
|
|
23451
|
-
const
|
|
23452
|
-
const
|
|
23453
|
-
|
|
23543
|
+
const validParentDelegatedOutcomeAuthority = validParentGovernedChildIdentity && readString(requirementIntent.reason) === "parent_governed_child" && ["required_execution", "final_aggregation"].includes(readString(requirementCompletion.role)) && readString(requirementOutcome.mode) === "none" && readString(outcomeAuthority.mode) === "delegated_to_parent" && outcomeAuthority.owner_agent_id === null && outcomeAuthority.policy === null && outcomeAuthority.expected_outcome_at === null;
|
|
23544
|
+
const validIndependentOutcomeAuthority = validParentGovernedChildIdentity && readString(outcomeAuthority.mode) === "independent" && readString(outcomeAuthority.owner_agent_id) && Object.keys(asRecord(outcomeAuthority.policy)).length > 0 && readString(outcomeAuthority.expected_outcome_at);
|
|
23545
|
+
const expectedCompletionReview = {
|
|
23546
|
+
none: { required_before_done: false, request_owner: "none", decision_owner: "none" },
|
|
23547
|
+
package: { required_before_done: true, request_owner: "this_issue_agent", decision_owner: "board" },
|
|
23548
|
+
own_deliverable: { required_before_done: false, request_owner: "this_issue_agent", decision_owner: "board" },
|
|
23549
|
+
delegated_final_aggregation: { required_before_done: false, request_owner: "final_aggregation_child", decision_owner: "board" }
|
|
23550
|
+
}[readString(authority.review_authority)];
|
|
23551
|
+
const validCompletionReview = validParentGovernedChildIdentity && expectedCompletionReview && sameCanonicalJson(completionReview, expectedCompletionReview);
|
|
23552
|
+
const validAcceptanceAuthority = validEnrollmentIdentity ? validOwnedAcceptance : validParentDelegatedOutcomeAuthority || validIndependentOutcomeAuthority;
|
|
23553
|
+
if (!validIdentity2 || !validCriteria || !validDelivery || !validAcceptanceAuthority || validParentGovernedChildIdentity && !validCompletionReview) {
|
|
23454
23554
|
throw taskAcceptanceContractError(
|
|
23455
23555
|
"task_acceptance_contract_invalid",
|
|
23456
23556
|
"Task Acceptance Contract is incomplete or internally inconsistent"
|
|
@@ -23469,7 +23569,8 @@ function taskAcceptanceContractSection(context, input) {
|
|
|
23469
23569
|
...validParentGovernedChildIdentity ? [asRecord(requirementIntent.source), asRecord(requirementCompletion.source)] : []
|
|
23470
23570
|
].every((source) => readString(source.revision) === requirementRevision);
|
|
23471
23571
|
const parentAuthorityMatches = !validParentGovernedChildIdentity || readString(authority.completion_role) === readString(requirementCompletion.role) && readString(authority.review_authority) === readString(requirementCompletion.reviewAuthority);
|
|
23472
|
-
|
|
23572
|
+
const parentOutcomeAuthorityMatches = !validParentGovernedChildIdentity || validParentDelegatedOutcomeAuthority || readString(requirementOutcome.mode) === "required" && readString(requirementOutcome.acceptanceOwnerAgentId) === readString(outcomeAuthority.owner_agent_id) && readString(requirementOutcome.expectedOutcomeAt) === readString(outcomeAuthority.expected_outcome_at) && sameCanonicalJson(requirementOutcome.acceptancePolicy, outcomeAuthority.policy);
|
|
23573
|
+
if (!revisionsMatch || !parentAuthorityMatches || (noManifestDelivery ? readString(requirementDelivery.mode) !== "none" || requirementAcceptanceRefs.length > 0 : !sameCanonicalJson(criterionRefs, requirementAcceptanceRefs)) || validParentGovernedChildIdentity && !sameCanonicalJson(criteria, requirementCriteria) || !sameCanonicalJson(allowedKinds, requirementAllowedKinds) || !sameCanonicalJson(acceptanceContracts, requirementContracts) || !parentOutcomeAuthorityMatches || validEnrollmentIdentity && (readString(requirementOutcome.acceptanceOwnerAgentId) !== readString(acceptance.owner_agent_id) || readString(requirementOutcome.expectedOutcomeAt) !== readString(acceptance.expected_outcome_at) || !sameCanonicalJson(requirementOutcome.acceptancePolicy, acceptance.policy))) {
|
|
23473
23574
|
throw taskAcceptanceContractError(
|
|
23474
23575
|
"task_acceptance_contract_invalid",
|
|
23475
23576
|
"Task Acceptance Contract does not match the active Task requirement projection"
|
|
@@ -29811,7 +29912,7 @@ function createSourceCompletionStopPolicy({
|
|
|
29811
29912
|
}
|
|
29812
29913
|
|
|
29813
29914
|
// src/amaster-runtime-daemon.mjs
|
|
29814
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
29915
|
+
var CONNECTOR_VERSION = "0.1.1-beta.152";
|
|
29815
29916
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
29816
29917
|
var SOURCE_ACQUISITION_CAPABILITY2 = source_acquisition_compatibility_default.profileVersion;
|
|
29817
29918
|
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.152";
|
|
11
11
|
|
|
12
12
|
const CONFIG_KEY_MAP = new Map([
|
|
13
13
|
["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
|