@resolveio/server-lib 22.3.189 → 22.3.190
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/package.json
CHANGED
|
@@ -2308,22 +2308,30 @@ function aicoderNextActionContractGate(contract, now) {
|
|
|
2308
2308
|
var requiresHumanApproval = booleanFlag((_b = contract.requiresHumanApproval) !== null && _b !== void 0 ? _b : contract.requires_human_approval) === true;
|
|
2309
2309
|
var canRunWithoutCodexMonitor = booleanFlag((_c = contract.canRunWithoutCodexMonitor) !== null && _c !== void 0 ? _c : contract.can_run_without_codex_monitor) === true;
|
|
2310
2310
|
var codexFallbackRequired = booleanFlag((_d = contract.codexFallbackRequired) !== null && _d !== void 0 ? _d : contract.codex_fallback_required) === true;
|
|
2311
|
-
var
|
|
2311
|
+
var sourceBlockers = cleanStringList(contract.blockers, 40, 500);
|
|
2312
2312
|
var primaryCommand = cleanText(contract.primaryCommand || contract.primary_command, 200);
|
|
2313
|
-
var
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2313
|
+
var liveHotfixBlockedUntilCommit = booleanFlag((_g = (_f = (_e = contract.liveHotfixBlockedUntilCommit) !== null && _e !== void 0 ? _e : contract.live_hotfix_blocked_until_commit) !== null && _f !== void 0 ? _f : plainObject(contract.decisionBasis || contract.decision_basis).liveHotfixBlockedUntilCommit) !== null && _g !== void 0 ? _g : plainObject(contract.decisionBasis || contract.decision_basis).live_hotfix_blocked_until_commit) === true;
|
|
2314
|
+
var safetyBlockers = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((safeToAutoRun ? [] : ['AICoder next action is not marked safe to auto-run.'])), false), __read((canRunWithoutCodexMonitor ? [] : ['AICoder next action requires Codex fallback/monitoring instead of manager-only execution.'])), false), __read((codexFallbackRequired ? [cleanText(contract.codexFallbackReason || contract.codex_fallback_reason, 1000) || 'AICoder next action contract requires Codex fallback.'] : [])), false), __read((requiresHumanApproval ? ['AICoder next action requires human approval.'] : [])), false), __read((liveHotfixBlockedUntilCommit ? ['Live AICoder hotfix is blocked until GitHub commit and push proof is recorded.'] : [])), false))).filter(Boolean).slice(0, 40);
|
|
2315
|
+
var contractBlockers = safetyBlockers.length
|
|
2316
|
+
? Array.from(new Set(__spreadArray(__spreadArray([], __read(sourceBlockers), false), __read(safetyBlockers), false))).slice(0, 40)
|
|
2317
|
+
: [];
|
|
2318
|
+
var missingSafetyFlags = [
|
|
2319
|
+
contract.safeToAutoRun === undefined && contract.safe_to_auto_run === undefined ? 'safeToAutoRun' : '',
|
|
2320
|
+
contract.canRunWithoutCodexMonitor === undefined && contract.can_run_without_codex_monitor === undefined ? 'canRunWithoutCodexMonitor' : '',
|
|
2321
|
+
contract.codexFallbackRequired === undefined && contract.codex_fallback_required === undefined ? 'codexFallbackRequired' : ''
|
|
2322
|
+
].filter(Boolean);
|
|
2323
|
+
var gateStatus = contractBlockers.length
|
|
2324
|
+
? 'blocked'
|
|
2325
|
+
: missingSafetyFlags.length
|
|
2326
|
+
? 'warn'
|
|
2327
|
+
: 'pass';
|
|
2320
2328
|
return {
|
|
2321
2329
|
key: 'aicoder_next_action_contract',
|
|
2322
2330
|
label: 'AICoder next action contract',
|
|
2323
2331
|
status: gateStatus,
|
|
2324
2332
|
reason: gateStatus === 'pass'
|
|
2325
2333
|
? "AICoder can run ".concat(primaryCommand || 'the next action', " without a Codex monitor.")
|
|
2326
|
-
: (
|
|
2334
|
+
: (contractBlockers.join(' ') || cleanText(contract.codexFallbackReason || contract.codex_fallback_reason || contract.expectedStateTransition || contract.expected_state_transition, 1200) || 'AICoder next action is not safe to run unattended.'),
|
|
2327
2335
|
evidenceRefs: cleanStringList(__spreadArray(__spreadArray(__spreadArray([], __read(asArray(contract.preconditions)), false), __read(asArray(contract.successEvidence || contract.success_evidence)), false), __read(asArray(contract.stopConditions || contract.stop_conditions)), false), 40, 500),
|
|
2328
2336
|
recordedAt: isoNow(now || contract.createdAt || contract.created_at || contract.recordedAt || contract.recorded_at),
|
|
2329
2337
|
metadata: {
|
|
@@ -2339,9 +2347,9 @@ function aicoderNextActionContractGate(contract, now) {
|
|
|
2339
2347
|
codexFallbackRequired: codexFallbackRequired,
|
|
2340
2348
|
codexFallbackReason: cleanText(contract.codexFallbackReason || contract.codex_fallback_reason, 1000),
|
|
2341
2349
|
costRisk: cleanText(contract.costRisk || contract.cost_risk, 120),
|
|
2342
|
-
workflowFirstSatisfied: booleanFlag((
|
|
2343
|
-
hotfixCommitRequired: booleanFlag((
|
|
2344
|
-
liveHotfixBlockedUntilCommit:
|
|
2350
|
+
workflowFirstSatisfied: booleanFlag((_h = contract.workflowFirstSatisfied) !== null && _h !== void 0 ? _h : contract.workflow_first_satisfied) === true,
|
|
2351
|
+
hotfixCommitRequired: booleanFlag((_l = (_k = (_j = contract.hotfixCommitRequired) !== null && _j !== void 0 ? _j : contract.hotfix_commit_required) !== null && _k !== void 0 ? _k : plainObject(contract.decisionBasis || contract.decision_basis).hotfixCommitRequired) !== null && _l !== void 0 ? _l : plainObject(contract.decisionBasis || contract.decision_basis).hotfix_commit_required) === true,
|
|
2352
|
+
liveHotfixBlockedUntilCommit: liveHotfixBlockedUntilCommit,
|
|
2345
2353
|
decisionBasis: plainObject(contract.decisionBasis || contract.decision_basis),
|
|
2346
2354
|
preconditions: cleanStringList(contract.preconditions, 40, 500),
|
|
2347
2355
|
expectedStateTransition: cleanText(contract.expectedStateTransition || contract.expected_state_transition, 1000),
|
|
@@ -2350,7 +2358,10 @@ function aicoderNextActionContractGate(contract, now) {
|
|
|
2350
2358
|
stopConditions: cleanStringList(contract.stopConditions || contract.stop_conditions, 40, 500),
|
|
2351
2359
|
forbiddenActions: cleanStringList(contract.forbiddenActions || contract.forbidden_actions, 40, 500),
|
|
2352
2360
|
nextCommands: cleanStringList(contract.nextCommands || contract.next_commands, 40, 240),
|
|
2353
|
-
blockers:
|
|
2361
|
+
blockers: contractBlockers,
|
|
2362
|
+
contextBlockers: sourceBlockers,
|
|
2363
|
+
safetyBlockers: safetyBlockers,
|
|
2364
|
+
missingSafetyFlags: missingSafetyFlags,
|
|
2354
2365
|
ownerFiles: cleanStringList(contract.ownerFiles || contract.owner_files, 40, 500)
|
|
2355
2366
|
}
|
|
2356
2367
|
};
|