dsh-completion-guard 0.4.2 → 0.4.3

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,7 +1,8 @@
1
+ import { createRequire } from "node:module";
1
2
  import { createHash } from "node:crypto";
2
3
  import * as path from "node:path";
3
- import { dirname, join, resolve, sep } from "node:path";
4
- import { existsSync, readFileSync, renameSync, writeFileSync } from "node:fs";
4
+ import { dirname, isAbsolute, join, resolve, sep } from "node:path";
5
+ import { existsSync, lstatSync, readFileSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
5
6
  import { fileURLToPath } from "node:url";
6
7
 
7
8
  //#region src/domain/canonicalize.ts
@@ -235,7 +236,7 @@ const SUPPORTED_EVIDENCE_ADAPTERS = {
235
236
  "context-guard.git.v1": "1.0.0",
236
237
  "context-guard.package.v1": "1.0.0",
237
238
  "context-guard.artifact.v1": "1.0.0",
238
- "context-guard.service.v1": "1.0.0",
239
+ "context-guard.service.v2": "2.0.0",
239
240
  "context-guard.registry.v1": "1.0.0"
240
241
  };
241
242
  const SEMANTIC_ACTIONS = [
@@ -3787,7 +3788,7 @@ const ALPHA2_DSHMARKET_139_HOST_PACKAGES = ALPHA2_HOST_PACKAGES.map((row) => row
3787
3788
  * rows, duplicate rows, or use identities outside every registered cohort
3788
3789
  * fail closed.
3789
3790
  */
3790
- const HOST_COHORTS = [
3791
+ const LEGACY_HOST_COHORTS = [
3791
3792
  defineCohort("dsh-0.1.1-rc.2", ["0.1.1-rc.2"], ["posix", "windows"], [
3792
3793
  {
3793
3794
  name: "@deepseek-ai/cordis",
@@ -3965,6 +3966,33 @@ const HOST_COHORTS = [
3965
3966
  defineCohort("dsh-0.1.2-alpha.3", ["0.1.2-alpha.3"], ["posix", "windows"], ALPHA3_HOST_PACKAGES),
3966
3967
  defineCohort("dsh-0.1.2-rc.1", ["0.1.2-rc.1"], ["posix", "windows"], RC1_HOST_PACKAGES)
3967
3968
  ];
3969
+ /** Core-lock/v1 separates optional market identity from the audited DSH graph.
3970
+ * Legacy rows remain available for historical verification; they are never
3971
+ * silently re-labelled as a newly accepted core lock.
3972
+ */
3973
+ const HOST_COHORTS = LEGACY_HOST_COHORTS.filter((cohort) => !cohort.id.includes("-dshmarket-")).map((cohort) => ({
3974
+ ...cohort,
3975
+ id: `${cohort.id}-core-v1`,
3976
+ manifestVersion: 2,
3977
+ packages: cohort.packages.filter((row) => row.name !== "dshmarket"),
3978
+ capabilities: [
3979
+ {
3980
+ name: "host_cohort",
3981
+ value: {
3982
+ k: "s",
3983
+ v: `${cohort.id}-core-v1`
3984
+ }
3985
+ },
3986
+ {
3987
+ name: "host_lock_policy",
3988
+ value: {
3989
+ k: "s",
3990
+ v: "dsh-core/v1"
3991
+ }
3992
+ },
3993
+ ...AUDITED_CAPABILITY_ROWS
3994
+ ]
3995
+ }));
3968
3996
  /**
3969
3997
  * rc.2 audited package identities (first registry cohort). The audited
3970
3998
  * cohort is an atomic whole-graph contract (CG-DSH-001): any drifted,
@@ -3982,7 +4010,7 @@ const HOST_CAPABILITY_PACKAGE_GROUPS = {
3982
4010
  terminal_windows: packageNames("@deepseek-ai/dsh-tool-pwsh", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-subprocess-local", "@deepseek-ai/dsh-pwsh-sandbox", "@deepseek-ai/dsh-shell-env"),
3983
4011
  dsh_cli: packageNames("@deepseek-ai/dsh"),
3984
4012
  plugin_inventory: packageNames("@deepseek-ai/dsh-host-plugin-inventory"),
3985
- web_control: packageNames("dshmarket", "@deepseek-ai/dsh-host-webserver", "@deepseek-ai/dsh-web-app"),
4013
+ web_control: packageNames("@deepseek-ai/dsh-host-webserver", "@deepseek-ai/dsh-web-app"),
3986
4014
  jobs: packageNames("@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-tool-jobs"),
3987
4015
  filesystem: packageNames("@deepseek-ai/dsh-tool-fs", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-fs-local", "@deepseek-ai/dsh-fs-sandbox", "@deepseek-ai/dsh-fs-observation-policy", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-system-prompt")
3988
4016
  };
@@ -3996,6 +4024,7 @@ const HOST_CAPABILITY_PACKAGE_GROUPS = {
3996
4024
  * consistently.
3997
4025
  */
3998
4026
  function selectHostCohort(rows, platform) {
4027
+ rows = rows.filter((row) => row.name !== "dshmarket");
3999
4028
  const registryNames = new Set(HOST_COHORTS.flatMap((cohort) => cohort.packages.map((row) => row.name)));
4000
4029
  if (rows.some((row) => !registryNames.has(row.name))) return {
4001
4030
  cohort: HOST_COHORTS[0],
@@ -4011,7 +4040,8 @@ function selectHostCohort(rows, platform) {
4011
4040
  const unboundCount = rows.length - bound.length;
4012
4041
  const versionMatches = bound.map((row) => HOST_COHORTS.filter((cohort) => cohort.packages.some((p) => p.name === row.name && p.version === row.version)));
4013
4042
  const identityMatches = bound.map((row, index) => versionMatches[index].filter((cohort) => cohort.packages.some((p) => p.name === row.name && p.version === row.version && p.integrity === row.integrity)));
4014
- const consistentCohort = HOST_COHORTS.find((cohort) => identityMatches.every((matches) => matches.includes(cohort)));
4043
+ const candidates = HOST_COHORTS.filter((cohort) => identityMatches.every((matches) => matches.includes(cohort)));
4044
+ const consistentCohort = candidates.filter((cohort) => cohort.packages.length === rows.length && cohort.packages.every((expected) => rows.filter((row) => row.name === expected.name).length === 1))[0] ?? candidates[0];
4015
4045
  if (consistentCohort !== void 0 && unboundCount === 0) {
4016
4046
  if (platform && !consistentCohort.auditedPlatforms.includes(platform)) return {
4017
4047
  cohort: consistentCohort,
@@ -4115,7 +4145,7 @@ function cohortForEvaluation(evaluation) {
4115
4145
  return HOST_COHORTS.find((cohort) => cohort.id === evaluation.cohortId) ?? HOST_COHORTS[0];
4116
4146
  }
4117
4147
  function evaluateHostLock(rows, context = {}) {
4118
- const supplied = stableRows(rows);
4148
+ const supplied = stableRows(rows.filter((row) => row.name !== "dshmarket"));
4119
4149
  const selection = selectHostCohort(supplied, context.platform);
4120
4150
  const cohort = selection.cohort;
4121
4151
  const capabilities = capabilityEvaluations(supplied, cohort);
@@ -4247,7 +4277,7 @@ function evaluateHostCapability(evaluation, request) {
4247
4277
  if (request.action === "create" || request.action === "modify") groups.push("filesystem");
4248
4278
  if (request.action === "install" || request.action === "apply") groups.push("dsh_cli");
4249
4279
  if (request.action === "apply") groups.push("plugin_inventory");
4250
- if ((request.action === "apply" || request.action === "restart") && profileKind === "web") groups.push("web_control");
4280
+ if (request.action === "restart" && profileKind === "web") groups.push("web_control");
4251
4281
  if (request.action === "restart" && profileKind !== "web") return {
4252
4282
  id: "action.restart",
4253
4283
  status: "unavailable",
@@ -6426,7 +6456,7 @@ function findUp(start, filename) {
6426
6456
  * v9 lockfile. Multiple resolved versions are preserved as separate rows so
6427
6457
  * callers cannot silently select a nearest instance.
6428
6458
  */
6429
- function packageRowsFromPnpmLock(text) {
6459
+ function packageRowsFromPnpmLock(text, names = CRITICAL_NAMES) {
6430
6460
  const rows = /* @__PURE__ */ new Map();
6431
6461
  const lines = text.split(/\r?\n/);
6432
6462
  const packagesStart = lines.findIndex((line) => line === "packages:");
@@ -6435,7 +6465,7 @@ function packageRowsFromPnpmLock(text) {
6435
6465
  const end = snapshotsStart > packagesStart ? snapshotsStart : lines.length;
6436
6466
  for (let index = packagesStart + 1; index < end; index += 1) {
6437
6467
  const match = lines[index].match(/^ '?((?:@[^/'\s]+\/)?[^@'\s]+)@([^':\s]+)'?:\s*$/);
6438
- if (!match || !CRITICAL_NAMES.includes(match[1])) continue;
6468
+ if (!match || !names.includes(match[1])) continue;
6439
6469
  let integrity;
6440
6470
  for (let cursor = index + 1; cursor < lines.length && !/^ \S/.test(lines[cursor]); cursor += 1) {
6441
6471
  const resolution = lines[cursor].match(/^ resolution: \{[^}]*\bintegrity: ([^,}\s]+)[^}]*\}\s*$/);
@@ -6452,7 +6482,7 @@ function packageRowsFromPnpmLock(text) {
6452
6482
  });
6453
6483
  rows.set(match[1], entries);
6454
6484
  }
6455
- return CRITICAL_NAMES.flatMap((name) => {
6485
+ return names.flatMap((name) => {
6456
6486
  const entries = rows.get(name) ?? [];
6457
6487
  if (entries.length === 0) return [];
6458
6488
  return entries;
@@ -6467,36 +6497,47 @@ function resolveInstalledHostLock(moduleUrl = import.meta.url) {
6467
6497
  return evaluateHostLock([]);
6468
6498
  }
6469
6499
  }
6470
- /**
6471
- * Resolve only package identities reachable from the active pnpm importer.
6472
- * Historical snapshots elsewhere in the lockfile are deliberately ignored;
6473
- * two reachable peer variants of a critical package remain a duplicate and
6474
- * are returned twice so evaluateHostLock can fail closed with a bounded code.
6475
- */
6476
- function packageRowsFromActiveGraph(packageMapText, lockText, nodeModulesRoot) {
6500
+ function activeGraphRecords(packageMapText) {
6477
6501
  let document;
6478
6502
  try {
6479
6503
  document = JSON.parse(packageMapText);
6480
6504
  } catch {
6481
- return [];
6505
+ throw new HostProfileError("active_graph_invalid", "invalid package map");
6482
6506
  }
6483
- if (!document || typeof document !== "object") return [];
6507
+ if (!document || typeof document !== "object") throw new HostProfileError("active_graph_invalid", "invalid reachable package map");
6484
6508
  const packages = document.packages;
6485
- if (!packages || typeof packages !== "object" || Array.isArray(packages)) return [];
6509
+ if (!packages || typeof packages !== "object" || Array.isArray(packages)) throw new HostProfileError("active_graph_invalid", "invalid reachable package map");
6486
6510
  const records = packages;
6487
- if (!records["."] || Object.keys(records).length > 2e4) return [];
6511
+ if (!records["."] || Object.keys(records).length > 2e4) throw new HostProfileError("active_graph_invalid", "invalid reachable package map");
6488
6512
  const reachable = /* @__PURE__ */ new Set();
6489
6513
  const queue = ["."];
6490
6514
  while (queue.length > 0 && reachable.size <= 2e4) {
6491
6515
  const id = queue.shift();
6492
6516
  if (reachable.has(id)) continue;
6493
6517
  const record = records[id];
6494
- if (!record || typeof record !== "object") return [];
6518
+ if (!record || typeof record !== "object") throw new HostProfileError("active_graph_invalid", "invalid reachable package map");
6495
6519
  reachable.add(id);
6496
- if (!record.dependencies || typeof record.dependencies !== "object" || Array.isArray(record.dependencies)) continue;
6497
- for (const target of Object.values(record.dependencies)) if (typeof target === "string" && target !== "." && !reachable.has(target)) queue.push(target);
6520
+ if (!record.dependencies || typeof record.dependencies !== "object" || Array.isArray(record.dependencies)) throw new HostProfileError("active_graph_invalid", "invalid reachable dependencies");
6521
+ for (const target of Object.values(record.dependencies)) {
6522
+ if (typeof target !== "string" || !target) throw new HostProfileError("active_graph_invalid", "invalid dependency target");
6523
+ if (target !== "." && !reachable.has(target)) queue.push(target);
6524
+ }
6498
6525
  }
6499
- if (queue.length > 0) return [];
6526
+ if (queue.length > 0) throw new HostProfileError("active_graph_invalid", "invalid reachable package map");
6527
+ return {
6528
+ records,
6529
+ reachable
6530
+ };
6531
+ }
6532
+ /**
6533
+ * Resolve only package identities reachable from the active pnpm importer.
6534
+ * Historical snapshots elsewhere in the lockfile are deliberately ignored;
6535
+ * two reachable peer variants of a critical package remain a duplicate and
6536
+ * are returned twice so evaluateHostLock can fail closed with a bounded code.
6537
+ */
6538
+ function packageRowsFromActiveGraph(packageMapText, lockText, nodeModulesRoot) {
6539
+ const { records, reachable } = activeGraphRecords(packageMapText);
6540
+ if (!/^lockfileVersion: ['"]?9\.0['"]?\s*$/m.test(lockText) || !/^packages:(?:\s*\{\})?\s*$/m.test(lockText)) throw new HostProfileError("active_graph_invalid", "invalid pnpm lockfile shape");
6500
6541
  const locked = packageRowsFromPnpmLock(lockText);
6501
6542
  const rows = [];
6502
6543
  for (const name of CRITICAL_NAMES) {
@@ -6511,8 +6552,8 @@ function packageRowsFromActiveGraph(packageMapText, lockText, nodeModulesRoot) {
6511
6552
  continue;
6512
6553
  }
6513
6554
  try {
6514
- const modules = resolve(nodeModulesRoot);
6515
- const manifestPath = resolve(modules, record.url, "package.json");
6555
+ const modules = realpathSync(nodeModulesRoot);
6556
+ const manifestPath = realpathSync(resolve(modules, record.url, "package.json"));
6516
6557
  if (!manifestPath.startsWith(`${modules}${sep}`)) {
6517
6558
  rows.push({ name });
6518
6559
  continue;
@@ -6545,6 +6586,117 @@ function packageRowsFromActiveGraph(packageMapText, lockText, nodeModulesRoot) {
6545
6586
  }
6546
6587
  return rows;
6547
6588
  }
6589
+ /** Read exact reachable critical rows without requiring Guard installation.
6590
+ * Used by target preflight before a legacy profile can be migrated.
6591
+ */
6592
+ function readActiveHostGraph(runtimeRoot, profileRoot) {
6593
+ const runtime = resolve(runtimeRoot);
6594
+ const profile = resolve(profileRoot);
6595
+ const mapPath = join(runtime, "node_modules", ".package-map.json");
6596
+ const lockPath = join(runtime, "pnpm-lock.yaml");
6597
+ const profileMapPath = join(profile, "node_modules", ".package-map.json");
6598
+ const profileLockPath = join(profile, "pnpm-lock.yaml");
6599
+ const runtimeRows = packageRowsFromActiveGraph(readFileSync(mapPath, "utf8"), readFileSync(lockPath, "utf8"), join(runtime, "node_modules"));
6600
+ const profileRows = packageRowsFromActiveGraph(readFileSync(profileMapPath, "utf8"), readFileSync(profileLockPath, "utf8"), join(profile, "node_modules"));
6601
+ const runtimeKeys = new Set(runtimeRows.map((row) => `${row.name}\u0000${row.version ?? ""}\u0000${row.integrity ?? ""}`));
6602
+ return [...runtimeRows, ...profileRows.filter((row) => !runtimeKeys.has(`${row.name}\u0000${row.version ?? ""}\u0000${row.integrity ?? ""}`))];
6603
+ }
6604
+ function pathPresent(path$1) {
6605
+ try {
6606
+ lstatSync(path$1);
6607
+ return true;
6608
+ } catch (error) {
6609
+ if (error.code === "ENOENT") return false;
6610
+ throw error;
6611
+ }
6612
+ }
6613
+ function within(root, path$1) {
6614
+ return path$1.startsWith(`${root}${sep}`);
6615
+ }
6616
+ /** Same static lookup order as DSH; do not load/normalize/heal a daily profile. */
6617
+ function packageFromAnchor(anchor, name) {
6618
+ for (const directory of createRequire(anchor).resolve.paths(name) ?? []) {
6619
+ const candidate = join(directory, name);
6620
+ if (pathPresent(candidate)) {
6621
+ if (!existsSync(join(candidate, "package.json"))) throw new HostProfileError("target_bundle_unresolved", "invalid resolver-visible package");
6622
+ return realpathSync(candidate);
6623
+ }
6624
+ }
6625
+ }
6626
+ /**
6627
+ * Pre-install inspection only. A fresh rc.1 Headless profile can use its two
6628
+ * installation-owned bundles without a private importer. Never extend this
6629
+ * absence rule to inject or runtime replay, which still call the strict reader.
6630
+ */
6631
+ function inspectTargetHostGraph(runtimeRoot, profileRoot) {
6632
+ const runtime = realpathSync(runtimeRoot);
6633
+ const profile = realpathSync(profileRoot);
6634
+ const mapPath = join(profile, "node_modules", ".package-map.json");
6635
+ const lockPath = join(profile, "pnpm-lock.yaml");
6636
+ if (pathPresent(mapPath) && pathPresent(lockPath)) return {
6637
+ packages: readActiveHostGraph(runtime, profile),
6638
+ profileGraph: { state: "active_importer" }
6639
+ };
6640
+ if (pathPresent(mapPath) || pathPresent(lockPath)) throw new HostProfileError("active_graph_missing", "partial profile importer");
6641
+ if (pathPresent(join(profile, "node_modules")) || pathPresent(join(profile, ".dsh-module-fallback"))) throw new HostProfileError("target_profile_unmanaged_modules", "profile modules exist without an importer");
6642
+ const manifestPath = join(profile, "package.json");
6643
+ const manifest = readJsonObject(manifestPath, "profile_manifest_invalid");
6644
+ for (const key of [
6645
+ "dependencies",
6646
+ "devDependencies",
6647
+ "optionalDependencies",
6648
+ "peerDependencies",
6649
+ "bundledDependencies",
6650
+ "bundleDependencies"
6651
+ ]) {
6652
+ const value = manifest[key];
6653
+ if (value !== void 0 && (!value || typeof value !== "object" || Object.keys(value).length !== 0 || Array.isArray(value) && !["bundledDependencies", "bundleDependencies"].includes(key))) throw new HostProfileError("target_profile_dependency_uninstalled", "profile declares dependencies without an importer");
6654
+ }
6655
+ const bundles = manifest.dsh?.profile?.bundles;
6656
+ const names = ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-headless"];
6657
+ if (!Array.isArray(bundles) || bundles.length !== names.length || bundles.some((name, index) => name !== names[index])) throw new HostProfileError("target_profile_bundles_unsupported", "not the installation-owned Headless bundle tuple");
6658
+ const modules = realpathSync(join(runtime, "node_modules"));
6659
+ const mapText = readFileSync(join(modules, ".package-map.json"), "utf8");
6660
+ const lockText = readFileSync(join(runtime, "pnpm-lock.yaml"), "utf8");
6661
+ const rows = packageRowsFromActiveGraph(mapText, lockText, modules);
6662
+ const evaluation = evaluateHostLock(rows, {
6663
+ platform: process.platform === "win32" ? "windows" : "posix",
6664
+ profileKind: "headless"
6665
+ });
6666
+ if (evaluation.status !== "supported" || evaluation.cohortId !== "dsh-0.1.2-rc.1-core-v1") throw new HostProfileError("target_runtime_unsupported", "dependency-free inspection requires the audited rc.1 core");
6667
+ const { records, reachable } = activeGraphRecords(mapText);
6668
+ const launcher = realpathSync(join(modules, "@deepseek-ai", "dsh"));
6669
+ const anchor = join(launcher, "package.json");
6670
+ const host = readJsonObject(anchor, "target_runtime_unsupported");
6671
+ const launcherId = [...reachable].filter((id) => id.startsWith("@deepseek-ai/dsh@"));
6672
+ if (launcherId.length !== 1 || host.name !== "@deepseek-ai/dsh" || host.version !== "0.1.2-rc.1" || typeof records[launcherId[0]].url !== "string" || realpathSync(resolve(modules, records[launcherId[0]].url)) !== launcher || !within(modules, launcher)) throw new HostProfileError("target_runtime_unsupported", "launcher differs from the active runtime importer");
6673
+ const bundleRows = names.map((name) => {
6674
+ const packageRoot = packageFromAnchor(anchor, name);
6675
+ const ids = [...reachable].filter((id) => id === name || id.startsWith(`${name}@`));
6676
+ if (!packageRoot || !within(modules, packageRoot) || ids.length !== 1) throw new HostProfileError("target_bundle_unresolved", "bundle is not uniquely installation-owned");
6677
+ const record = records[ids[0]];
6678
+ if (typeof record.url !== "string" || realpathSync(resolve(modules, record.url)) !== packageRoot) throw new HostProfileError("target_bundle_origin_mismatch", "bundle differs from active runtime mapping");
6679
+ const installed = readJsonObject(join(packageRoot, "package.json"), "target_bundle_invalid");
6680
+ const patch = installed.dsh?.bundle?.patch;
6681
+ const locked = packageRowsFromPnpmLock(lockText, [name]).filter((row) => row.version === host.version && row.integrity);
6682
+ if (installed.name !== name || installed.version !== host.version || locked.length !== 1 || ids[0].split("(", 1)[0] !== `${name}@${host.version}` || typeof patch !== "string" || isAbsolute(patch) || !within(packageRoot, realpathSync(resolve(packageRoot, patch))) || !statSync(resolve(packageRoot, patch)).isFile()) throw new HostProfileError("target_bundle_invalid", "bundle identity or patch is not installation-owned");
6683
+ return locked[0];
6684
+ });
6685
+ for (const name of [...CRITICAL_NAMES, ...names]) {
6686
+ const visible = packageFromAnchor(manifestPath, name);
6687
+ if (!visible) continue;
6688
+ const ids = [...reachable].filter((id) => id === name || id.startsWith(`${name}@`));
6689
+ if (ids.length !== 1 || typeof records[ids[0]].url !== "string" || !within(modules, visible) || realpathSync(resolve(modules, records[ids[0]].url)) !== visible) throw new HostProfileError("target_profile_module_shadow", "profile lookup differs from the audited installation");
6690
+ }
6691
+ return {
6692
+ packages: rows,
6693
+ profileGraph: {
6694
+ state: "dependency_free_headless",
6695
+ manifestSha256: createHash("sha256").update(readFileSync(manifestPath)).digest("hex"),
6696
+ bundles: bundleRows
6697
+ }
6698
+ };
6699
+ }
6548
6700
  /** Read and validate the actual runtime graph plus the installed profile plugin. */
6549
6701
  function resolveActiveProfileHostLock(runtimeRoot, profileRoot, expectedPluginVersion) {
6550
6702
  const runtime = resolve(runtimeRoot);
@@ -6563,8 +6715,7 @@ function resolveActiveProfileHostLock(runtimeRoot, profileRoot, expectedPluginVe
6563
6715
  profileManifestPath,
6564
6716
  pluginManifestPath
6565
6717
  ]) if (!existsSync(path$1)) throw new HostProfileError("active_graph_missing", `required active graph file is missing: ${path$1}`);
6566
- const runtimeRows = packageRowsFromActiveGraph(readFileSync(mapPath, "utf8"), readFileSync(lockPath, "utf8"), join(runtime, "node_modules"));
6567
- const profileRows = packageRowsFromActiveGraph(readFileSync(profileMapPath, "utf8"), readFileSync(profileLockPath, "utf8"), join(profile, "node_modules"));
6718
+ const rows = readActiveHostGraph(runtime, profile);
6568
6719
  const profileManifest = readJsonObject(profileManifestPath, "profile_manifest_invalid");
6569
6720
  const installedPlugin = readJsonObject(pluginManifestPath, "installed_plugin_invalid");
6570
6721
  const dependencies = profileManifest.dependencies;
@@ -6574,8 +6725,7 @@ function resolveActiveProfileHostLock(runtimeRoot, profileRoot, expectedPluginVe
6574
6725
  if (installedPlugin.name !== "dsh-completion-guard" || installedPlugin.version !== expectedPluginVersion) throw new HostProfileError("profile_plugin_version_mismatch", "installed profile plugin identity does not match the generator version");
6575
6726
  const profileKind = bundles.includes("@deepseek-ai/dsh-web-app") || bundles.includes("dshmarket") ? "web" : "headless";
6576
6727
  const platform = process.platform === "win32" ? "windows" : "posix";
6577
- const runtimeKeys = new Set(runtimeRows.map((row) => `${row.name}\u0000${row.version ?? ""}\u0000${row.integrity ?? ""}`));
6578
- const evaluation = evaluateHostLock([...runtimeRows, ...profileRows.filter((row) => !runtimeKeys.has(`${row.name}\u0000${row.version ?? ""}\u0000${row.integrity ?? ""}`))], {
6728
+ const evaluation = evaluateHostLock(rows, {
6579
6729
  platform,
6580
6730
  profileKind
6581
6731
  });
@@ -6599,13 +6749,16 @@ function readJsonObject(path$1, code) {
6599
6749
  function yamlQuote(value) {
6600
6750
  return JSON.stringify(value);
6601
6751
  }
6602
- function renderManagedPatch(rows, platform, profileKind, activation) {
6752
+ function renderManagedPatch(rows, platform, profileKind, activation, runtimeRoot, profileRoot) {
6603
6753
  const lines = [
6604
6754
  HOST_LOCK_MARKER_BEGIN,
6605
6755
  "- id: context-guard",
6606
6756
  " name: dsh-completion-guard",
6607
6757
  " config:"
6608
6758
  ];
6759
+ lines.push(" hostLockPolicy: \"dsh-core/v1\"");
6760
+ if (runtimeRoot) lines.push(` hostLockRuntimeRoot: ${yamlQuote(runtimeRoot)}`);
6761
+ if (profileRoot) lines.push(` hostLockProfileRoot: ${yamlQuote(profileRoot)}`);
6609
6762
  if (activation) lines.push(` activation: ${yamlQuote(activation)}`);
6610
6763
  lines.push(` hostLockPlatform: ${yamlQuote(platform)}`);
6611
6764
  lines.push(` hostLockProfile: ${yamlQuote(profileKind)}`);
@@ -6632,16 +6785,20 @@ function stripManagedPatch(text) {
6632
6785
  }
6633
6786
  function activationFromPatch(text) {
6634
6787
  const lines = text.split(/\r?\n/);
6635
- const starts = lines.flatMap((line, index) => /^- id:\s*["']?context-guard["']?\s*$/.test(line) ? [index] : []);
6636
- if (starts.length > 1) throw new HostProfileError("profile_patch_duplicate_target", "multiple unmanaged context-guard patches are ambiguous");
6637
- if (starts.length === 0) return void 0;
6638
- const start = starts[0];
6639
- let end = lines.length;
6640
- for (let index = start + 1; index < lines.length; index += 1) if (lines[index].startsWith("- ")) {
6641
- end = index;
6642
- break;
6643
- }
6644
- const entry = lines.slice(start + 1, end).join("\n");
6788
+ const entries = lines.flatMap((line, index) => /^- id:\s*["']?context-guard["']?\s*$/.test(line) ? [index] : []).map((start) => {
6789
+ let end = lines.length;
6790
+ for (let index = start + 1; index < lines.length; index += 1) if (lines[index].startsWith("- ")) {
6791
+ end = index;
6792
+ break;
6793
+ }
6794
+ return lines.slice(start + 1, end).join("\n");
6795
+ }).filter((entry$1) => {
6796
+ const fields = entry$1.split(/\r?\n/).filter((line) => line.trim() && !line.trimStart().startsWith("#"));
6797
+ return !(fields.length === 1 && /^ {2}disabled:\s*(?:true|false)\s*(?:#.*)?$/.test(fields[0]));
6798
+ });
6799
+ if (entries.length > 1) throw new HostProfileError("profile_patch_duplicate_target", "multiple unmanaged context-guard configurations are ambiguous");
6800
+ if (entries.length === 0) return void 0;
6801
+ const entry = entries[0];
6645
6802
  const name = entry.match(/^\s{2}name:\s*(.+?)\s*$/m)?.[1]?.replace(/^['"]|['"]$/g, "");
6646
6803
  if (name && name !== "dsh-completion-guard") throw new HostProfileError("profile_patch_name_mismatch", "context-guard patch targets a different package");
6647
6804
  if (/^\s{4}hostLockPackages:\s*$/m.test(entry)) throw new HostProfileError("profile_patch_unmanaged_host_lock", "unmanaged hostLockPackages must be removed before managed injection");
@@ -6667,7 +6824,7 @@ function injectActiveProfileHostLock(input) {
6667
6824
  const stripped = stripManagedPatch(existsSync(patchPath) ? readFileSync(patchPath, "utf8") : "");
6668
6825
  const base = normalizeEmptyPatchBase(stripped.base);
6669
6826
  const activation = activationFromPatch(base) ?? (stripped.prior ? activationFromManagedPatch(stripped.prior) : void 0);
6670
- const managed = renderManagedPatch(input.evaluation.packages.filter((row) => row.version && row.integrity), input.platform, input.profileKind, activation);
6827
+ const managed = renderManagedPatch(input.evaluation.packages.filter((row) => row.version && row.integrity), input.platform, input.profileKind, activation, input.runtimeRoot, input.profileRoot);
6671
6828
  const next = `${base.trimEnd()}${base.trim() ? "\n\n" : ""}${managed}`;
6672
6829
  const temporary = `${patchPath}.context-guard-${process.pid}.tmp`;
6673
6830
  writeFileSync(temporary, next, {
@@ -6699,7 +6856,8 @@ function parseYamlField(entry, index, value) {
6699
6856
  ].includes(indicator)) return parseYamlScalar(value);
6700
6857
  const parts = [];
6701
6858
  for (let cursor = index + 1; cursor < entry.length; cursor += 1) {
6702
- const blockLine = entry[cursor].match(/^\s{10}(.*)$/);
6859
+ const indentation = (entry[index].match(/^\s*/)?.[0].length ?? 8) + 2;
6860
+ const blockLine = entry[cursor].match(/* @__PURE__ */ new RegExp(`^\\s{${indentation}}(.*)$`));
6703
6861
  if (!blockLine) break;
6704
6862
  parts.push(blockLine[1]);
6705
6863
  }
@@ -6759,7 +6917,24 @@ function hostLockContextFromComposedDump(text) {
6759
6917
  ...profileKind === "headless" || profileKind === "web" ? { profileKind } : {}
6760
6918
  };
6761
6919
  }
6762
- function verifyComposedHostLockDump(text, expected) {
6920
+ function verifyComposedHostLockDump(text, expected, roots) {
6921
+ const lines = text.split(/\r?\n/);
6922
+ const start = lines.findIndex((line) => /^- id:\s*["']?context-guard["']?\s*$/.test(line));
6923
+ const tail = lines.slice(start + 1);
6924
+ const end = tail.findIndex((line) => line.startsWith("- "));
6925
+ const entry = end < 0 ? tail : tail.slice(0, end);
6926
+ const settings = {};
6927
+ for (const key of [
6928
+ "hostLockPolicy",
6929
+ "hostLockRuntimeRoot",
6930
+ "hostLockProfileRoot"
6931
+ ]) {
6932
+ const matches = entry.flatMap((line, index$1) => line.startsWith(` ${key}:`) ? [index$1] : []);
6933
+ if (matches.length !== 1) throw new HostProfileError("host_lock_readback_mismatch", "composed config host lock does not match the active graph");
6934
+ const index = matches[0];
6935
+ settings[key] = parseYamlField(entry, index, entry[index].slice(entry[index].indexOf(":") + 1));
6936
+ }
6937
+ if (settings.hostLockPolicy !== "dsh-core/v1" || !isAbsolute(settings.hostLockRuntimeRoot) || !isAbsolute(settings.hostLockProfileRoot) || roots && (resolve(settings.hostLockRuntimeRoot) !== resolve(roots.runtimeRoot) || resolve(settings.hostLockProfileRoot) !== resolve(roots.profileRoot))) throw new HostProfileError("host_lock_readback_mismatch", "composed config host lock does not match the active graph");
6763
6938
  const context = hostLockContextFromComposedDump(text);
6764
6939
  const actual = evaluateHostLock(hostLockRowsFromComposedDump(text), context);
6765
6940
  if (actual.status !== "supported" || actual.digest !== expected.digest) throw new HostProfileError("host_lock_readback_mismatch", "composed config host lock does not match the active graph");
@@ -6977,4 +7152,4 @@ function proofEvidenceConstraints(evidence, obligation) {
6977
7152
  }
6978
7153
 
6979
7154
  //#endregion
6980
- export { DEFAULT_HOST_LOCK as $, SUPPORTED_EVIDENCE_ADAPTERS as $t, decideTurnBoundary as A, bindingSatisfies as At, extractTextContent as B, extractArtifactPaths as Bt, createGitPrestateEnvelope as C, closingHint as Ct, revalidateGitPrestate as D, evidenceAvailabilityReason as Dt, parseGitCommandManifest as E, renderRecoveryPacket as Et, CAPTURE_V042_NOTICE as F, createProjection as Ft, isRunExecutable as G, canonicalRegistryBase as Gt, isDeterministicCheck as H, extractOperation as Ht, PROTOCOL_V3_NOTICE as I, rebindResponse as It, goalCompletionDenial as J, ACTION_MANIFEST_VERSION as Jt, parsePwshCommand as K, npmEscapedPackageName as Kt, deriveProjection as L, captureClause as Lt, isWholeTaskCompletionClaim as M, evidenceMatchesItem as Mt, latestAssistantText as N, isVerifyingCapability as Nt, verifiedLinearCommitReadback as O, itemDiagnosis as Ot, observeAssistantOutcome as P, currentContractDigest as Pt, BASE_HOST_PACKAGES as Q, STOP_PROTOCOL_VERSION as Qt, supersedeItem as R, captureItem as Rt, commitTreeSnapshotDigest as S, MIN_RECOVERY_CHAR_BUDGET as St, gitCommandMatchesTarget as T, recoveryDigest as Tt, withDurability as U, isInformationalMessage as Ut, extractToolSubject as V, extractMethod as Vt, canonicalArgvFromCommand as W, segmentClauses as Wt, ALPHA2_DSHMARKET_139_HOST_PACKAGES as X, SEMANTIC_ACTIONS as Xt, hasCurrentCertificate as Y, CERTIFICATE_VERSION as Yt, ALPHA2_HOST_PACKAGES as Z, STATEFUL_ACTIONS as Zt, resolveInstalledHostLock as _, effectuateBoundary as _t, createProofManifest as a, semanticActionFromText as an, bindLiveGoalCapability as at, GIT_COMMAND_MANIFEST_IDS as b, certifyCheckpoint as bt, sessionQuery as c, COMMAND_SURFACE_MANIFEST as cn, evaluateHostLock as ct, hostLockContextFromComposedDump as d, digestStrings as dn, RC1_HOST_PACKAGES as dt, actionCompatible as en, EXPECTED_HOST_PACKAGES as et, hostLockRowsFromComposedDump as f, normalizeClause as fn, ALPHA3_HOST_PACKAGES as ft, resolveActiveProfileHostLock as g, availableBoundaryQualifications as gt, packageRowsFromPnpmLock as h, sha256 as hn, classifyUserInteraction as ht, canonicalProjection as i, semanticActionFromCommand as in, bindExecutableIdentity as it, decideTurnStopping as j, evidenceCoverage as jt, classifyCompletionClaim as k, relevantEvidence as kt, validateProofManifest as l, validateManifest as ln, evaluateToolSurfaceCapability as lt, packageRowsFromActiveGraph as m, sanitizeUrl as mn, segmentAuthorityBlocks as mt, PROOF_PROTOCOL_VERSION as n, requestedTargetAuthorizesMutation as nn, HOST_CAPABILITY_PACKAGE_GROUPS as nt, proofDigest as o, validateActionManifest as on, evaluateExternalWaitCapability as ot, injectActiveProfileHostLock as p, sanitizeClauseText as pn, authorityCaptureCounts as pt, parseShellCommand as q, ACTION_MANIFEST as qt, bindProofToProjection as r, requestedTargetMatchesResolved as rn, HOST_COHORTS as rt, proofEvidenceConstraints as s, validateActionTarget as sn, evaluateHostCapability as st, PROOF_KINDS as t, isStatefulAction as tn, GOAL_HOST_PACKAGES as tt, HostProfileError as u, canonicalizePath as un, selectHostCohort as ut, verifyComposedHostLockDump as v, isCurrentAcceptedBoundary as vt, executeRevalidatedGitEffect as w, openItems$1 as wt, commitIndexSnapshotDigest as x, DEFAULT_RECOVERY_CHAR_BUDGET as xt, snapshotSessionEvents as y, qualifyBoundary as yt, evidenceFromPersistedToolResult as z, classifyClause as zt };
7155
+ export { ALPHA2_HOST_PACKAGES as $, SEMANTIC_ACTIONS as $t, verifiedLinearCommitReadback as A, evidenceAvailabilityReason as At, supersedeItem as B, captureClause as Bt, commitIndexSnapshotDigest as C, certifyCheckpoint as Ct, gitCommandMatchesTarget as D, openItems$1 as Dt, executeRevalidatedGitEffect as E, closingHint as Et, latestAssistantText as F, evidenceMatchesItem as Ft, withDurability as G, extractOperation as Gt, extractTextContent as H, classifyClause as Ht, observeAssistantOutcome as I, isVerifyingCapability as It, parsePwshCommand as J, canonicalRegistryBase as Jt, canonicalArgvFromCommand as K, isInformationalMessage as Kt, CAPTURE_V042_NOTICE as L, currentContractDigest as Lt, decideTurnBoundary as M, relevantEvidence as Mt, decideTurnStopping as N, bindingSatisfies as Nt, parseGitCommandManifest as O, recoveryDigest as Ot, isWholeTaskCompletionClaim as P, evidenceCoverage as Pt, ALPHA2_DSHMARKET_139_HOST_PACKAGES as Q, CERTIFICATE_VERSION as Qt, PROTOCOL_V3_NOTICE as R, createProjection as Rt, GIT_COMMAND_MANIFEST_IDS as S, qualifyBoundary as St, createGitPrestateEnvelope as T, MIN_RECOVERY_CHAR_BUDGET as Tt, extractToolSubject as U, extractArtifactPaths as Ut, evidenceFromPersistedToolResult as V, captureItem as Vt, isDeterministicCheck as W, extractMethod as Wt, goalCompletionDenial as X, ACTION_MANIFEST as Xt, parseShellCommand as Y, npmEscapedPackageName as Yt, hasCurrentCertificate as Z, ACTION_MANIFEST_VERSION as Zt, readActiveHostGraph as _, sanitizeUrl as _n, segmentAuthorityBlocks as _t, createProofManifest as a, requestedTargetAuthorizesMutation as an, HOST_COHORTS as at, verifyComposedHostLockDump as b, effectuateBoundary as bt, sessionQuery as c, semanticActionFromText as cn, bindLiveGoalCapability as ct, hostLockContextFromComposedDump as d, COMMAND_SURFACE_MANIFEST as dn, evaluateHostLock as dt, STATEFUL_ACTIONS as en, BASE_HOST_PACKAGES as et, hostLockRowsFromComposedDump as f, validateManifest as fn, evaluateToolSurfaceCapability as ft, packageRowsFromPnpmLock as g, sanitizeClauseText as gn, authorityCaptureCounts as gt, packageRowsFromActiveGraph as h, normalizeClause as hn, ALPHA3_HOST_PACKAGES as ht, canonicalProjection as i, isStatefulAction as in, HOST_CAPABILITY_PACKAGE_GROUPS as it, classifyCompletionClaim as j, itemDiagnosis as jt, revalidateGitPrestate as k, renderRecoveryPacket as kt, validateProofManifest as l, validateActionManifest as ln, evaluateExternalWaitCapability as lt, inspectTargetHostGraph as m, digestStrings as mn, RC1_HOST_PACKAGES as mt, PROOF_PROTOCOL_VERSION as n, SUPPORTED_EVIDENCE_ADAPTERS as nn, EXPECTED_HOST_PACKAGES as nt, proofDigest as o, requestedTargetMatchesResolved as on, LEGACY_HOST_COHORTS as ot, injectActiveProfileHostLock as p, canonicalizePath as pn, selectHostCohort as pt, isRunExecutable as q, segmentClauses as qt, bindProofToProjection as r, actionCompatible as rn, GOAL_HOST_PACKAGES as rt, proofEvidenceConstraints as s, semanticActionFromCommand as sn, bindExecutableIdentity as st, PROOF_KINDS as t, STOP_PROTOCOL_VERSION as tn, DEFAULT_HOST_LOCK as tt, HostProfileError as u, validateActionTarget as un, evaluateHostCapability as ut, resolveActiveProfileHostLock as v, sha256 as vn, classifyUserInteraction as vt, commitTreeSnapshotDigest as w, DEFAULT_RECOVERY_CHAR_BUDGET as wt, snapshotSessionEvents as x, isCurrentAcceptedBoundary as xt, resolveInstalledHostLock as y, availableBoundaryQualifications as yt, deriveProjection as z, rebindResponse as zt };
@@ -542,6 +542,11 @@ declare const ALPHA2_DSHMARKET_139_HOST_PACKAGES: PackageRow[];
542
542
  * rows, duplicate rows, or use identities outside every registered cohort
543
543
  * fail closed.
544
544
  */
545
+ declare const LEGACY_HOST_COHORTS: readonly HostCohort[];
546
+ /** Core-lock/v1 separates optional market identity from the audited DSH graph.
547
+ * Legacy rows remain available for historical verification; they are never
548
+ * silently re-labelled as a newly accepted core lock.
549
+ */
545
550
  declare const HOST_COHORTS: readonly HostCohort[];
546
551
  /**
547
552
  * rc.2 audited package identities (first registry cohort). The audited
@@ -567,7 +572,7 @@ interface HostLockEvaluation {
567
572
  status: HostLockStatus;
568
573
  digest: string;
569
574
  goalAvailable: boolean;
570
- reasonCode?: "host_lock_missing" | "host_lock_version_mismatch" | "host_lock_integrity_mismatch" | "host_lock_unknown_package" | "host_lock_duplicate_package" | "host_lock_goal_graph_incomplete" | "host_lock_goal_capability_mismatch" | "host_lock_cohort_mixed_graph" | "host_lock_cohort_unbound_identity" | "host_lock_cohort_platform_not_audited";
575
+ reasonCode?: "host_lock_migration_required" | "host_lock_installed_graph_drift" | "host_lock_missing" | "host_lock_version_mismatch" | "host_lock_integrity_mismatch" | "host_lock_unknown_package" | "host_lock_duplicate_package" | "host_lock_goal_graph_incomplete" | "host_lock_goal_capability_mismatch" | "host_lock_cohort_mixed_graph" | "host_lock_cohort_unbound_identity" | "host_lock_cohort_platform_not_audited";
571
576
  packages: PackageRow[];
572
577
  capabilities: Record<HostCapabilityId, HostCapabilityEvaluation>;
573
578
  platform?: HostPlatform;
@@ -900,7 +905,7 @@ declare class HostProfileError extends Error {
900
905
  * v9 lockfile. Multiple resolved versions are preserved as separate rows so
901
906
  * callers cannot silently select a nearest instance.
902
907
  */
903
- declare function packageRowsFromPnpmLock(text: string): PackageRow[];
908
+ declare function packageRowsFromPnpmLock(text: string, names?: readonly string[]): PackageRow[];
904
909
  declare function resolveInstalledHostLock(moduleUrl?: string): HostLockEvaluation;
905
910
  /**
906
911
  * Resolve only package identities reachable from the active pnpm importer.
@@ -917,6 +922,24 @@ interface ActiveProfileHostLock {
917
922
  platform: HostPlatform;
918
923
  profileKind: HostProfileKind;
919
924
  }
925
+ /** Read exact reachable critical rows without requiring Guard installation.
926
+ * Used by target preflight before a legacy profile can be migrated.
927
+ */
928
+ declare function readActiveHostGraph(runtimeRoot: string, profileRoot: string): PackageRow[];
929
+ interface TargetHostGraph {
930
+ packages: PackageRow[];
931
+ profileGraph: {
932
+ state: "active_importer" | "dependency_free_headless";
933
+ manifestSha256?: string;
934
+ bundles?: PackageRow[];
935
+ };
936
+ }
937
+ /**
938
+ * Pre-install inspection only. A fresh rc.1 Headless profile can use its two
939
+ * installation-owned bundles without a private importer. Never extend this
940
+ * absence rule to inject or runtime replay, which still call the strict reader.
941
+ */
942
+ declare function inspectTargetHostGraph(runtimeRoot: string, profileRoot: string): TargetHostGraph;
920
943
  /** Read and validate the actual runtime graph plus the installed profile plugin. */
921
944
  declare function resolveActiveProfileHostLock(runtimeRoot: string, profileRoot: string, expectedPluginVersion: string): ActiveProfileHostLock;
922
945
  /** Atomically inject a repeatable managed patch into the selected profile only. */
@@ -927,7 +950,7 @@ declare function hostLockContextFromComposedDump(text: string): {
927
950
  platform?: HostPlatform;
928
951
  profileKind?: HostProfileKind;
929
952
  };
930
- declare function verifyComposedHostLockDump(text: string, expected: HostLockEvaluation): HostLockEvaluation;
953
+ declare function verifyComposedHostLockDump(text: string, expected: HostLockEvaluation, roots?: Pick<ActiveProfileHostLock, "runtimeRoot" | "profileRoot">): HostLockEvaluation;
931
954
  //#endregion
932
955
  //#region src/domain/manifest.d.ts
933
956
  /**
@@ -1137,4 +1160,4 @@ declare function latestAssistantText(events: readonly {
1137
1160
  //#region src/domain/supersession.d.ts
1138
1161
  declare function supersedeItem(items: Map<string, GuardItem>, oldId: string, replacement: GuardItem): boolean;
1139
1162
  //#endregion
1140
- export { resolveInstalledHostLock as $, DeriveResult as $n, HostCapabilityEvaluation as $t, createProofManifest as A, ClassifiedClause as An, ActionManifest as Ar, hasCurrentCertificate as At, COMMAND_SURFACE_MANIFEST as B, BoundaryEffectuation as Bn, isStatefulAction as Br, PROTOCOL_V3_NOTICE as Bt, ProofKind as C, segmentAuthorityBlocks as Cn, TargetValue as Cr, ParsedShell as Ct, SessionQuery as D, RejectedBinding as Dn, PackageRow as Dr, parsePwshCommand as Dt, ProofSurface as E, CheckpointResult as En, createProjection as Er, isRunExecutable as Et, EvidenceFacetCoverage as F, extractArtifactPaths as Fn, STOP_PROTOCOL_VERSION as Fr, extractTextContent as Ft, ActiveProfileHostLock as G, availableBoundaryQualifications as Gn, validateActionManifest as Gr, BASE_HOST_PACKAGES as Gt, ManifestIssue as H, BoundaryRequest as Hn, requestedTargetMatchesResolved as Hr, ALPHA2_DSHMARKET_139_HOST_PACKAGES as Ht, bindingSatisfies as I, extractMethod as In, SUPPORTED_EVIDENCE_ADAPTERS as Ir, extractToolSubject as It, hostLockRowsFromComposedDump as J, qualifyBoundary as Jn, digestStrings as Jr, ExecutableIdentity as Jt, HostProfileError as K, effectuateBoundary as Kn, validateActionTarget as Kr, DEFAULT_HOST_LOCK as Kt, evidenceCoverage as L, extractOperation as Ln, SemanticAction as Lr, isDeterministicCheck as Lt, proofEvidenceConstraints as M, captureClause as Mn, CERTIFICATE_VERSION as Mr, ToolResultInput as Mt, sessionQuery as N, captureItem as Nn, SEMANTIC_ACTIONS as Nr, ToolSubject as Nt, bindProofToProjection as O, certifyCheckpoint as On, ACTION_MANIFEST as Or, parseShellCommand as Ot, validateProofManifest as P, classifyClause as Pn, STATEFUL_ACTIONS as Pr, evidenceFromPersistedToolResult as Pt, resolveActiveProfileHostLock as Q, DeriveConfig as Qn, sha256 as Qr, HOST_COHORTS as Qt, evidenceMatchesItem as R, isInformationalMessage as Rn, StatefulAction as Rr, withDurability as Rt, PROOF_PROTOCOL_VERSION as S, authorityCaptureCounts as Sn, TargetTuple as Sr, CanonicalCommandSurface as St, ProofObligation as T, classifyUserInteraction as Tn, WaitAuthorization as Tr, canonicalArgvFromCommand as Tt, OperationVerbEntry as U, GoalActivationState as Un, semanticActionFromCommand as Ur, ALPHA2_HOST_PACKAGES as Ut, CommandSurfaceManifest as V, BoundaryQualification as Vn, requestedTargetAuthorizesMutation as Vr, deriveProjection as Vt, validateManifest as W, GoalBoundaryAccess as Wn, semanticActionFromText as Wr, AuditedExecutable as Wt, packageRowsFromActiveGraph as X, BoundaryQualificationKind as Xn, sanitizeClauseText as Xr, GOAL_HOST_PACKAGES as Xt, injectActiveProfileHostLock as Y, BoundaryDisposition as Yn, normalizeClause as Yr, ExecutableIdentityBinding as Yt, packageRowsFromPnpmLock as Z, DeferAuthorization as Zn, sanitizeUrl as Zr, HOST_CAPABILITY_PACKAGE_GROUPS as Zt, openItems as _, selectHostCohort as _n, GuardProjection as _r, gitCommandMatchesTarget as _t, classifyCompletionClaim as a, HostLockContext as an, EvidenceRole as ar, GitCommandParseResult as at, ALPHA3_HOST_PACKAGES as b, AuthorityBlockKind as bn, TargetCaptureReasonCode as br, verifiedLinearCommitReadback as bt, isWholeTaskCompletionClaim as c, HostPlatform as cn, GoalRef as cr, GitEffectRunner as ct, snapshotSessionEvents as d, bindExecutableIdentity as dn, GuardEvidence as dr, GitTargetIdentity as dt, HostCapabilityId as en, DeriveScope as er, verifyComposedHostLockDump as et, RC1_HOST_PACKAGES as f, bindLiveGoalCapability as fn, GuardIntegrity as fr, LinearCommitReadback as ft, closingHint as g, evaluateToolSurfaceCapability as gn, GuardOperation as gr, executeRevalidatedGitEffect as gt, RecoveryOptions as h, evaluateHostLock as hn, GuardItemStatus as hr, createGitPrestateEnvelope as ht, TurnStoppingDecision as i, HostCohortSelectionReason as in, EvidenceParseStatus as ir, GitCommandManifest as it, proofDigest as j, ClauseSegment as jn, ActionSpec as jr, ToolCallInput as jt, canonicalProjection as k, CaptureScope as kn, ACTION_MANIFEST_VERSION as kr, goalCompletionDenial as kt, latestAssistantText as l, HostProfileKind as ln, GuardBoundary as lr, GitPrestateCheck as lt, MIN_RECOVERY_CHAR_BUDGET as m, evaluateHostCapability as mn, GuardItemKind as mr, commitTreeSnapshotDigest as mt, AssistantOutcomeObservation as n, HostCohort as nn, EvidenceBinding as nr, GitAdapterAction as nt, decideTurnBoundary as o, HostLockEvaluation as on, ExpectedTransition as or, GitCommandRejected as ot, DEFAULT_RECOVERY_CHAR_BUDGET as p, evaluateExternalWaitCapability as pn, GuardItem as pr, commitIndexSnapshotDigest as pt, hostLockContextFromComposedDump as q, isCurrentAcceptedBoundary as qn, canonicalizePath as qr, EXPECTED_HOST_PACKAGES as qt, CompletionDisposition as r, HostCohortSelection as rn, EvidenceOutcome as rr, GitCommandAccepted as rt, decideTurnStopping as s, HostLockStatus as sn, ExternalOperation as sr, GitEffectExecution as st, supersedeItem as t, HostCapabilityRequest as tn, DerivedEnvelope as tr, GIT_COMMAND_MANIFEST_IDS as tt, observeAssistantOutcome as u, HostToolSurface as un, GuardCheckpoint as ur, GitPrestateEnvelope as ut, recoveryDigest as v, currentContractDigest as vn, HostStatus as vr, parseGitCommandManifest as vt, ProofManifest as w, UserInteractionKind as wn, VerificationContract as wr, ShellParseStatus as wt, PROOF_KINDS as x, AuthorityKind as xn, TargetCaptureStatus as xr, CanonicalArgv as xt, renderRecoveryPacket as y, AuthorityBlock as yn, PersistenceAuthorization as yr, revalidateGitPrestate as yt, isVerifyingCapability as z, segmentClauses as zn, actionCompatible as zr, CAPTURE_V042_NOTICE as zt };
1163
+ export { packageRowsFromPnpmLock as $, BoundaryDisposition as $n, normalizeClause as $r, GOAL_HOST_PACKAGES as $t, createProofManifest as A, CheckpointResult as An, createProjection as Ar, parsePwshCommand as At, COMMAND_SURFACE_MANIFEST as B, extractMethod as Bn, SUPPORTED_EVIDENCE_ADAPTERS as Br, isDeterministicCheck as Bt, ProofKind as C, AuthorityBlock as Cn, PersistenceAuthorization as Cr, verifiedLinearCommitReadback as Ct, SessionQuery as D, segmentAuthorityBlocks as Dn, TargetValue as Dr, ShellParseStatus as Dt, ProofSurface as E, authorityCaptureCounts as En, TargetTuple as Er, ParsedShell as Et, EvidenceFacetCoverage as F, ClauseSegment as Fn, ActionSpec as Fr, ToolResultInput as Ft, ActiveProfileHostLock as G, BoundaryQualification as Gn, requestedTargetAuthorizesMutation as Gr, ALPHA2_DSHMARKET_139_HOST_PACKAGES as Gt, ManifestIssue as H, isInformationalMessage as Hn, StatefulAction as Hr, CAPTURE_V042_NOTICE as Ht, bindingSatisfies as I, captureClause as In, CERTIFICATE_VERSION as Ir, ToolSubject as It, hostLockContextFromComposedDump as J, GoalBoundaryAccess as Jn, semanticActionFromText as Jr, BASE_HOST_PACKAGES as Jt, HostProfileError as K, BoundaryRequest as Kn, requestedTargetMatchesResolved as Kr, ALPHA2_HOST_PACKAGES as Kt, evidenceCoverage as L, captureItem as Ln, SEMANTIC_ACTIONS as Lr, evidenceFromPersistedToolResult as Lt, proofEvidenceConstraints as M, certifyCheckpoint as Mn, ACTION_MANIFEST as Mr, goalCompletionDenial as Mt, sessionQuery as N, CaptureScope as Nn, ACTION_MANIFEST_VERSION as Nr, hasCurrentCertificate as Nt, bindProofToProjection as O, UserInteractionKind as On, VerificationContract as Or, canonicalArgvFromCommand as Ot, validateProofManifest as P, ClassifiedClause as Pn, ActionManifest as Pr, ToolCallInput as Pt, packageRowsFromActiveGraph as Q, qualifyBoundary as Qn, digestStrings as Qr, ExecutableIdentityBinding as Qt, evidenceMatchesItem as R, classifyClause as Rn, STATEFUL_ACTIONS as Rr, extractTextContent as Rt, PROOF_PROTOCOL_VERSION as S, currentContractDigest as Sn, HostStatus as Sr, revalidateGitPrestate as St, ProofObligation as T, AuthorityKind as Tn, TargetCaptureStatus as Tr, CanonicalCommandSurface as Tt, OperationVerbEntry as U, segmentClauses as Un, actionCompatible as Ur, PROTOCOL_V3_NOTICE as Ut, CommandSurfaceManifest as V, extractOperation as Vn, SemanticAction as Vr, withDurability as Vt, validateManifest as W, BoundaryEffectuation as Wn, isStatefulAction as Wr, deriveProjection as Wt, injectActiveProfileHostLock as X, effectuateBoundary as Xn, validateActionTarget as Xr, EXPECTED_HOST_PACKAGES as Xt, hostLockRowsFromComposedDump as Y, availableBoundaryQualifications as Yn, validateActionManifest as Yr, DEFAULT_HOST_LOCK as Yt, inspectTargetHostGraph as Z, isCurrentAcceptedBoundary as Zn, canonicalizePath as Zr, ExecutableIdentity as Zt, openItems as _, evaluateExternalWaitCapability as _n, GuardItem as _r, commitTreeSnapshotDigest as _t, classifyCompletionClaim as a, HostCohort as an, DerivedEnvelope as ar, GitAdapterAction as at, ALPHA3_HOST_PACKAGES as b, evaluateToolSurfaceCapability as bn, GuardOperation as br, gitCommandMatchesTarget as bt, isWholeTaskCompletionClaim as c, HostLockContext as cn, EvidenceParseStatus as cr, GitCommandParseResult as ct, snapshotSessionEvents as d, HostPlatform as dn, ExternalOperation as dr, GitEffectRunner as dt, sanitizeClauseText as ei, HOST_CAPABILITY_PACKAGE_GROUPS as en, BoundaryQualificationKind as er, readActiveHostGraph as et, RC1_HOST_PACKAGES as f, HostProfileKind as fn, GoalRef as fr, GitPrestateCheck as ft, closingHint as g, bindLiveGoalCapability as gn, GuardIntegrity as gr, commitIndexSnapshotDigest as gt, RecoveryOptions as h, bindExecutableIdentity as hn, GuardEvidence as hr, LinearCommitReadback as ht, TurnStoppingDecision as i, HostCapabilityRequest as in, DeriveScope as ir, GIT_COMMAND_MANIFEST_IDS as it, proofDigest as j, RejectedBinding as jn, PackageRow as jr, parseShellCommand as jt, canonicalProjection as k, classifyUserInteraction as kn, WaitAuthorization as kr, isRunExecutable as kt, latestAssistantText as l, HostLockEvaluation as ln, EvidenceRole as lr, GitCommandRejected as lt, MIN_RECOVERY_CHAR_BUDGET as m, LEGACY_HOST_COHORTS as mn, GuardCheckpoint as mr, GitTargetIdentity as mt, AssistantOutcomeObservation as n, sha256 as ni, HostCapabilityEvaluation as nn, DeriveConfig as nr, resolveInstalledHostLock as nt, decideTurnBoundary as o, HostCohortSelection as on, EvidenceBinding as or, GitCommandAccepted as ot, DEFAULT_RECOVERY_CHAR_BUDGET as p, HostToolSurface as pn, GuardBoundary as pr, GitPrestateEnvelope as pt, TargetHostGraph as q, GoalActivationState as qn, semanticActionFromCommand as qr, AuditedExecutable as qt, CompletionDisposition as r, HostCapabilityId as rn, DeriveResult as rr, verifyComposedHostLockDump as rt, decideTurnStopping as s, HostCohortSelectionReason as sn, EvidenceOutcome as sr, GitCommandManifest as st, supersedeItem as t, sanitizeUrl as ti, HOST_COHORTS as tn, DeferAuthorization as tr, resolveActiveProfileHostLock as tt, observeAssistantOutcome as u, HostLockStatus as un, ExpectedTransition as ur, GitEffectExecution as ut, recoveryDigest as v, evaluateHostCapability as vn, GuardItemKind as vr, createGitPrestateEnvelope as vt, ProofManifest as w, AuthorityBlockKind as wn, TargetCaptureReasonCode as wr, CanonicalArgv as wt, PROOF_KINDS as x, selectHostCohort as xn, GuardProjection as xr, parseGitCommandManifest as xt, renderRecoveryPacket as y, evaluateHostLock as yn, GuardItemStatus as yr, executeRevalidatedGitEffect as yt, isVerifyingCapability as z, extractArtifactPaths as zn, STOP_PROTOCOL_VERSION as zr, extractToolSubject as zt };