@piagent/platform 1.1.6 → 1.1.8

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.
@@ -15,7 +15,7 @@ Package source examples:
15
15
  # Installs the stable tag after resolving it to a commit SHA.
16
16
 
17
17
  # Pin a specific release:
18
- scripts/install-global.sh --version v1.1.6 --resolve-tag
18
+ scripts/install-global.sh --version v1.1.8 --resolve-tag
19
19
 
20
20
  # Preview the planned install/update without changing user config:
21
21
  scripts/install-global.sh --stable --dry-run
@@ -127,7 +127,7 @@ detect_runtime_surface() {
127
127
  printf 'native-windows/%s (not release-gated; terminal helpers require Bash semantics)' "$arch_name"
128
128
  ;;
129
129
  *)
130
- printf '%s/%s (outside v1.1.6 release matrix)' "$os_name" "$arch_name"
130
+ printf '%s/%s (outside v1.1.8 release matrix)' "$os_name" "$arch_name"
131
131
  ;;
132
132
  esac
133
133
  }
@@ -135,7 +135,7 @@ detect_runtime_surface() {
135
135
  warn_runtime_surface_if_needed() {
136
136
  local surface="$1"
137
137
  case "$surface" in
138
- *"supported target"*|*"experimental"*|*"not release-gated"*|*"outside v1.1.6 release matrix"*)
138
+ *"supported target"*|*"experimental"*|*"not release-gated"*|*"outside v1.1.8 release matrix"*)
139
139
  echo "WARN: runtime surface is $surface." >&2
140
140
  echo "WARN: For team rollout, run piagent-doctor plus the project smoke/verify suite on this machine before relying on it." >&2
141
141
  ;;
@@ -19,12 +19,22 @@ if [[ ! -f "$PROFILE_PATH" ]]; then
19
19
  exit 1
20
20
  fi
21
21
 
22
- node --input-type=module - "$PROJECT_PATH" "$PROFILE_PATH" <<'NODE'
22
+ PLATFORM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
23
+
24
+ node --input-type=module - "$PROJECT_PATH" "$PROFILE_PATH" "$PLATFORM_ROOT" <<'NODE'
23
25
  import fs from "node:fs";
24
26
  import path from "node:path";
27
+ import { pathToFileURL } from "node:url";
28
+
29
+ const [projectPath, profilePath, platformRoot] = process.argv.slice(2);
30
+ const stored = JSON.parse(fs.readFileSync(profilePath, "utf8"));
25
31
 
26
- const [projectPath, profilePath] = process.argv.slice(2);
27
- const profile = JSON.parse(fs.readFileSync(profilePath, "utf8"));
32
+ // A profile that names an adapter is checked as the document that will actually
33
+ // be enforced, not as the few lines the project happens to store.
34
+ const { resolveProjectProfileDocument } = await import(
35
+ pathToFileURL(path.join(platformRoot, "packages", "piagent-core", "capabilities", "project-profile.js")).href
36
+ );
37
+ const profile = resolveProjectProfileDocument(platformRoot, stored).profile;
28
38
 
29
39
  const errors = [];
30
40
  const warnings = [];
@@ -25,11 +25,20 @@ bash "$ROOT/scripts/profile-doctor.sh" "$PROJECT" >/dev/null
25
25
  bash "$ROOT/scripts/quality-benchmark.sh" "$PROJECT" --init >/dev/null
26
26
  bash "$ROOT/scripts/quality-benchmark.sh" "$PROJECT" --record --scenario smoke --surface pi --result pass --tokens 1 --verify "test -s README.md" >/dev/null
27
27
 
28
- node --input-type=module - "$PROJECT/.pi/piagent-profile.json" "$PROJECT/.pi/benchmarks/quality-runs.jsonl" <<'NODE'
28
+ node --input-type=module - "$PROJECT/.pi/piagent-profile.json" "$PROJECT/.pi/benchmarks/quality-runs.jsonl" "$ROOT" <<'NODE'
29
29
  import fs from "node:fs";
30
+ import path from "node:path";
31
+ import { pathToFileURL } from "node:url";
30
32
 
31
- const [profilePath, benchmarkPath] = process.argv.slice(2);
32
- const profile = JSON.parse(fs.readFileSync(profilePath, "utf8"));
33
+ const [profilePath, benchmarkPath, platformRoot] = process.argv.slice(2);
34
+ const stored = JSON.parse(fs.readFileSync(profilePath, "utf8"));
35
+
36
+ // A project that names an adapter stores identity and overrides only. The policy
37
+ // the runtime enforces is the resolved document, so that is what gets checked.
38
+ const { resolveProjectProfileDocument } = await import(
39
+ pathToFileURL(path.join(platformRoot, "packages", "piagent-core", "capabilities", "project-profile.js")).href
40
+ );
41
+ const profile = resolveProjectProfileDocument(platformRoot, stored).profile;
33
42
  for (const capability of ["filesystem-readonly", "filesystem-write", "shell", "memory"]) {
34
43
  if (!profile.mcpCapabilities.includes(capability)) {
35
44
  throw new Error(`missing capability ${capability}`);
@@ -137,7 +137,7 @@ function runtimeMatrixStatus() {
137
137
  surface: `${platform}/${arch}`,
138
138
  status: "outside-release-matrix",
139
139
  teamRolloutReady: false,
140
- note: "This runtime is outside the documented v1.1.6 support matrix."
140
+ note: "This runtime is outside the documented v1.1.8 support matrix."
141
141
  };
142
142
  }
143
143
 
@@ -313,7 +313,12 @@ if (foreignAgentConfig.length > 0) {
313
313
  const projectProfilePath = path.join(projectPath, ".pi", "piagent-profile.json");
314
314
  let projectProfile = null;
315
315
  if (fs.existsSync(projectProfilePath)) {
316
- const profile = readJson(projectProfilePath);
316
+ // Check the document that will be enforced. A profile that names an adapter
317
+ // stores only its own identity and overrides.
318
+ const { resolveProjectProfileDocument } = await import(
319
+ pathToFileURL(path.join(platformRoot, "packages", "piagent-core", "capabilities", "project-profile.js")).href
320
+ );
321
+ const profile = resolveProjectProfileDocument(platformRoot, readJson(projectProfilePath)).profile;
317
322
  projectProfile = profile;
318
323
  for (const field of ["schemaVersion", "projectId", "displayName", "mode"]) {
319
324
  if (profile[field] === undefined || profile[field] === "") errors.push(`project profile missing ${field}`);
@@ -333,7 +338,11 @@ if (fs.existsSync(projectProfilePath)) {
333
338
  try {
334
339
  const lock = readJson(projectLockPath);
335
340
  const verification = verifyCapabilityLock(platformRoot, projectProfilePath, lock, { packageSource: projectPackageSource });
336
- if (!verification.ok) errors.push("project capability lock is stale or does not match the configured package source");
341
+ if (verification.status === "blocked") {
342
+ errors.push(`project capability lock no longer matches what the project agreed to: ${verification.reasons.join("; ")}`);
343
+ } else if (verification.status === "repin") {
344
+ warnings.push(`project capability lock is behind the installed platform and will be re-pinned on the next Pi session (${verification.reasons.join("; ")})`);
345
+ }
337
346
  } catch (error) {
338
347
  errors.push(`project capability lock validation failed: ${error instanceof Error ? error.message : String(error)}`);
339
348
  }