@principles/host-runtime 0.14.2 → 0.14.4
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { buildRuleHostAction, buildToolSemanticRegistry, deriveToolHintsFromCanonicalKind, estimateLineChanges, mergeDecisions, SqliteConnection, UNAVAILABLE_RULE_CONTEXT, validateRuleContextV2, validateRuleHostResult, verifyPiArtifactRowDigest, } from '@principles/core/runtime-v2';
|
|
3
|
+
import { buildRuleHostAction, buildToolSemanticRegistry, deriveToolHintsFromCanonicalKind, estimateLineChanges, mergeDecisions, SqliteConnection, UNAVAILABLE_RULE_CONTEXT, validateRuleContextV2, validateRuleHostResult, verifyPiArtifactRowDigest, RECOVERY_CONTROL_SURFACES, } from '@principles/core/runtime-v2';
|
|
4
4
|
import { isSensitiveSystemPath } from '@principles/core/runtime-v2/internalization/rule-host-input-builder';
|
|
5
5
|
import { classifyBashRisk } from '@principles/core/runtime-v2/internalization/bash-risk';
|
|
6
6
|
import { scanRetiredContractSymbols } from './legacy-rule-contract-symbols.js';
|
|
@@ -10,6 +10,13 @@ const WARNING_LIMIT = 500;
|
|
|
10
10
|
const MAX_WARNINGS = 16;
|
|
11
11
|
const GATE_DEADLINE_MS = 3_000;
|
|
12
12
|
const ARTIFACT_CONTENT_BYTES = 512 * 1024;
|
|
13
|
+
// Check the actual imported builder, not an installed-package version string:
|
|
14
|
+
// a mixed host-runtime/core deployment must not claim input-v2 support.
|
|
15
|
+
const RECOVERY_INPUT_V2_AVAILABLE = RECOVERY_CONTROL_SURFACES
|
|
16
|
+
.filter(surface => surface.channel === 'cli')
|
|
17
|
+
.every(surface => typeof surface.cliCommand === 'string'
|
|
18
|
+
&& buildRuleHostAction('recovery-contract-probe', { command: surface.cliCommand }, '/', { canonicalKind: 'execute' })
|
|
19
|
+
.recoveryControl === surface.capabilityId);
|
|
13
20
|
function boundedWarning(reason, nextAction) {
|
|
14
21
|
return `${reason}; nextAction=${nextAction}`.replace(/\s+/g, ' ').slice(0, WARNING_LIMIT);
|
|
15
22
|
}
|
|
@@ -378,7 +385,9 @@ export function createProductionRuleHostGate(options = {}) {
|
|
|
378
385
|
contentBindingVerified = false;
|
|
379
386
|
}
|
|
380
387
|
}
|
|
381
|
-
if (!isRecord(contract)
|
|
388
|
+
if (!isRecord(contract)
|
|
389
|
+
|| (contract.version !== 1 && !(contract.version === 2 && RECOVERY_INPUT_V2_AVAILABLE))
|
|
390
|
+
|| contract.contextVersion !== 2
|
|
382
391
|
|| !Array.isArray(hosts) || !hosts.every((host) => typeof host === 'string')
|
|
383
392
|
|| !hosts.includes(options.hostKind) || row.owner_approved !== 1
|
|
384
393
|
|| !contentBindingVerified) {
|
|
@@ -36,7 +36,10 @@ export function computeWorkbuddyWorkerStatusMode(input) {
|
|
|
36
36
|
}
|
|
37
37
|
const { flags } = computeFeatureFlagsFromConfig(config.effective);
|
|
38
38
|
if (flags['host.workbuddy']?.enabled !== true) {
|
|
39
|
-
|
|
39
|
+
// PRI-1063 (review fix): single-line flow mapping — the dotted id is ONE
|
|
40
|
+
// flat key inside the existing `features:` block; a second `features:`
|
|
41
|
+
// block would be a duplicate-key YAML error.
|
|
42
|
+
return { mode: 'paused', reason: 'host.workbuddy_disabled', nextAction: 'Enable WorkBuddy PD behavior in the governance workspace .pd/config.yaml — in the existing "features:" block set host.workbuddy: {enabled: true} (one flat key, not nested).' };
|
|
40
43
|
}
|
|
41
44
|
if (flags.internalization_auto_consumer?.enabled !== true) {
|
|
42
45
|
return { mode: 'paused', reason: 'internalization_auto_consumer_disabled', nextAction: 'Automatic execution is paused; manual commands remain available: pd diagnose, pd runtime internalization run-once.' };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principles/host-runtime",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"description": "Shared host-neutral orchestration for Principles Disciple MVP-Core hook paths.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"lint": "eslint \"src/**/*.ts\""
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@principles/core": "^1.
|
|
34
|
+
"@principles/core": "^1.298.1",
|
|
35
35
|
"@principles/install-layout": "^0.4.0",
|
|
36
36
|
"better-sqlite3": "^13.0.3",
|
|
37
37
|
"js-yaml": "^5.4.3"
|