dsh-completion-guard 0.3.1 → 0.4.0

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.
@@ -943,14 +943,14 @@ function captureClause(text, sourceMessageId, id, revision, scope = {}) {
943
943
 
944
944
  //#endregion
945
945
  //#region src/domain/contract-digest.ts
946
- function stable$2(value) {
947
- if (Array.isArray(value)) return `[${value.map(stable$2).join(",")}]`;
948
- if (value && typeof value === "object") return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => `${JSON.stringify(key)}:${stable$2(entry)}`).join(",")}}`;
946
+ function stable$3(value) {
947
+ if (Array.isArray(value)) return `[${value.map(stable$3).join(",")}]`;
948
+ if (value && typeof value === "object") return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => `${JSON.stringify(key)}:${stable$3(entry)}`).join(",")}}`;
949
949
  return JSON.stringify(value);
950
950
  }
951
951
  /** One authoritative contract identity shared by checkpoints and boundaries. */
952
952
  function currentContractDigest(projection) {
953
- return sha256(stable$2([...projection.items.values()].sort((a, b) => a.id.localeCompare(b.id)).map((item) => [
953
+ return sha256(stable$3([...projection.items.values()].sort((a, b) => a.id.localeCompare(b.id)).map((item) => [
954
954
  item.id,
955
955
  item.revision,
956
956
  item.kind,
@@ -1950,16 +1950,16 @@ function renderRecoveryPacket(projection, options = {}) {
1950
1950
 
1951
1951
  //#endregion
1952
1952
  //#region src/domain/checkpoint.ts
1953
- function stable$1(value) {
1954
- if (Array.isArray(value)) return `[${value.map(stable$1).join(",")}]`;
1955
- if (value && typeof value === "object") return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => `${JSON.stringify(key)}:${stable$1(entry)}`).join(",")}}`;
1953
+ function stable$2(value) {
1954
+ if (Array.isArray(value)) return `[${value.map(stable$2).join(",")}]`;
1955
+ if (value && typeof value === "object") return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => `${JSON.stringify(key)}:${stable$2(entry)}`).join(",")}}`;
1956
1956
  return JSON.stringify(value);
1957
1957
  }
1958
1958
  function tuplesEqual(left, right) {
1959
- return stable$1(left ?? {}) === stable$1(right ?? {});
1959
+ return stable$2(left ?? {}) === stable$2(right ?? {});
1960
1960
  }
1961
1961
  function transitionsEqual(left, right) {
1962
- return stable$1(left) === stable$1(right);
1962
+ return stable$2(left) === stable$2(right);
1963
1963
  }
1964
1964
  function transitionIsSelfConsistent(action, transition) {
1965
1965
  if (!transition?.parameters || transition.predicateId !== ACTION_MANIFEST.actions[action].predicateId || transition.version !== 1 || transition.predParamsKind !== "inline") return false;
@@ -2051,14 +2051,14 @@ function expectedTransitionMatches(action, transition, resolved, observed) {
2051
2051
  "version",
2052
2052
  "integrity_digest",
2053
2053
  ...action === "publish" ? ["registry"] : ["profile"]
2054
- ].every((key) => stable$1(observed[key]) === stable$1(resolved[key]) && stable$1(params[key]) === stable$1(resolved[key]));
2054
+ ].every((key) => stable$2(observed[key]) === stable$2(resolved[key]) && stable$2(params[key]) === stable$2(resolved[key]));
2055
2055
  case "create":
2056
- case "modify": return stable$1(observed.post_digest) === stable$1(params.post_digest);
2057
- case "restart": return stable$1(params.pre_generation) === stable$1(resolved.pre_generation) && stable$1(observed.new_generation) !== stable$1(resolved.pre_generation) && stable$1(observed.health) === stable$1(params.health);
2058
- case "commit": return stable$1(params.pre_head_oid) === stable$1(resolved.pre_head_oid) && stable$1(params.change_set_digest) === stable$1(resolved.change_set_digest) && stable$1(observed.pre_head_oid) === stable$1(resolved.pre_head_oid) && stable$1(observed.post_head_oid) !== stable$1(resolved.pre_head_oid);
2059
- case "push": return stable$1(observed.remote_oid) === stable$1(resolved.local_oid) && stable$1(params.local_oid) === stable$1(resolved.local_oid);
2060
- case "pull": return stable$1(resolved.pull_mode) === stable$1("ff-only") && stable$1(params.pull_mode) === stable$1("ff-only") && stable$1(params.upstream_oid) === stable$1(resolved.upstream_oid) && stable$1(params.pre_head_oid) === stable$1(resolved.pre_head_oid) && stable$1(observed.post_head_oid) === stable$1(resolved.upstream_oid) && stable$1(observed.tracking_ref_oid) === stable$1(resolved.upstream_oid);
2061
- case "fetch": return stable$1(params.upstream_oid) === stable$1(resolved.upstream_oid) && stable$1(params.pre_head_oid) === stable$1(resolved.pre_head_oid) && stable$1(observed.tracking_ref_oid) === stable$1(resolved.upstream_oid) && stable$1(observed.post_head_oid) === stable$1(resolved.pre_head_oid);
2056
+ case "modify": return stable$2(observed.post_digest) === stable$2(params.post_digest);
2057
+ case "restart": return stable$2(params.pre_generation) === stable$2(resolved.pre_generation) && stable$2(observed.new_generation) !== stable$2(resolved.pre_generation) && stable$2(observed.health) === stable$2(params.health);
2058
+ case "commit": return stable$2(params.pre_head_oid) === stable$2(resolved.pre_head_oid) && stable$2(params.change_set_digest) === stable$2(resolved.change_set_digest) && stable$2(observed.pre_head_oid) === stable$2(resolved.pre_head_oid) && stable$2(observed.post_head_oid) !== stable$2(resolved.pre_head_oid);
2059
+ case "push": return stable$2(observed.remote_oid) === stable$2(resolved.local_oid) && stable$2(params.local_oid) === stable$2(resolved.local_oid);
2060
+ case "pull": return stable$2(resolved.pull_mode) === stable$2("ff-only") && stable$2(params.pull_mode) === stable$2("ff-only") && stable$2(params.upstream_oid) === stable$2(resolved.upstream_oid) && stable$2(params.pre_head_oid) === stable$2(resolved.pre_head_oid) && stable$2(observed.post_head_oid) === stable$2(resolved.upstream_oid) && stable$2(observed.tracking_ref_oid) === stable$2(resolved.upstream_oid);
2061
+ case "fetch": return stable$2(params.upstream_oid) === stable$2(resolved.upstream_oid) && stable$2(params.pre_head_oid) === stable$2(resolved.pre_head_oid) && stable$2(observed.tracking_ref_oid) === stable$2(resolved.upstream_oid) && stable$2(observed.post_head_oid) === stable$2(resolved.pre_head_oid);
2062
2062
  default: return true;
2063
2063
  }
2064
2064
  }
@@ -2067,8 +2067,8 @@ function nonStatefulTransitionMatches(action, transition, resolved, observed) {
2067
2067
  const params = transition.parameters;
2068
2068
  const recomputed = predParamsDigest(params, resolveAllowlist("product"));
2069
2069
  if (transition.parametersDigest && transition.parametersDigest !== recomputed) return false;
2070
- if (action === "inspect_remote_updates") return ["remote", "version"].every((key) => stable$1(params[key]) === stable$1(resolved[key])) && stable$1(params.upstream_oid) === stable$1(observed.upstream_oid);
2071
- return stable$1(params) === stable$1({
2070
+ if (action === "inspect_remote_updates") return ["remote", "version"].every((key) => stable$2(params[key]) === stable$2(resolved[key])) && stable$2(params.upstream_oid) === stable$2(observed.upstream_oid);
2071
+ return stable$2(params) === stable$2({
2072
2072
  expected_outcome: {
2073
2073
  k: "e",
2074
2074
  v: "success"
@@ -2175,7 +2175,7 @@ function richStatefulRecord(projection, item, binding) {
2175
2175
  reason: "resolution fact does not bind an expected transition digest",
2176
2176
  reasonCode: "resolution_expected_transition_digest_missing"
2177
2177
  } };
2178
- if (resolution.expectedTransitionDigest !== sha256(stable$1(resolution.expectedTransition))) return { rejected: {
2178
+ if (resolution.expectedTransitionDigest !== sha256(stable$2(resolution.expectedTransition))) return { rejected: {
2179
2179
  itemId: item.id,
2180
2180
  reason: "resolution expected transition digest does not match its stable payload",
2181
2181
  reasonCode: "resolution_expected_transition_digest_mismatch"
@@ -2270,7 +2270,7 @@ function simpleRecord(projection, item, binding) {
2270
2270
  const effectAction = effect.semanticAction ?? "generic_run";
2271
2271
  const effectTarget = effect.resolvedTarget ?? {};
2272
2272
  const effectObserved = effect.observedState ?? {};
2273
- if (!(Object.entries(binding.resolvedTarget ?? {}).every(([key, value]) => Object.hasOwn(effectTarget, key) && stable$1(value) === stable$1(effectTarget[key])) && Object.entries(binding.observedState ?? {}).every(([key, value]) => Object.hasOwn(effectObserved, key) && stable$1(value) === stable$1(effectObserved[key]))) || effectAction === action && (!tuplesEqual(binding.resolvedTarget, effectTarget) || !tuplesEqual(binding.observedState, effectObserved))) return { rejected: {
2273
+ if (!(Object.entries(binding.resolvedTarget ?? {}).every(([key, value]) => Object.hasOwn(effectTarget, key) && stable$2(value) === stable$2(effectTarget[key])) && Object.entries(binding.observedState ?? {}).every(([key, value]) => Object.hasOwn(effectObserved, key) && stable$2(value) === stable$2(effectObserved[key]))) || effectAction === action && (!tuplesEqual(binding.resolvedTarget, effectTarget) || !tuplesEqual(binding.observedState, effectObserved))) return { rejected: {
2274
2274
  itemId: item.id,
2275
2275
  reason: "binding target does not match the cited effect evidence",
2276
2276
  reasonCode: "binding_state_cross_pairing"
@@ -2929,247 +2929,654 @@ function authorityCaptureCounts(blocks) {
2929
2929
  };
2930
2930
  }
2931
2931
 
2932
+ //#endregion
2933
+ //#region src/domain/alpha3-host.ts
2934
+ /** Exact 34-row alpha.3 runtime/web graph from the 2026-09-01 annex audit. */
2935
+ const ALPHA3_HOST_PACKAGES = [
2936
+ [
2937
+ "@deepseek-ai/cordis",
2938
+ "4.0.2",
2939
+ "sha512-asOnXP1TzFSFQlHb1iegDZp0z/8WD1c7YNrwJR/Tx2bzNuMXfcekE/I67Iv6SQXeLB4csxqCngzQKANP7gdw0g=="
2940
+ ],
2941
+ [
2942
+ "@deepseek-ai/dsh",
2943
+ "0.1.2-alpha.3",
2944
+ "sha512-VvATzYmQ4LMJREJ9e2POKksSHRfqP3y9pghplLBaQBuw2BqfbC0mQUVsaPwxe4wlcpj+riEgn8OJB01YnpF+3A=="
2945
+ ],
2946
+ [
2947
+ "@deepseek-ai/dsh-agent",
2948
+ "0.1.2-alpha.3",
2949
+ "sha512-K1Pj9wqXmXjbMv4//wbPEPzaRBIYGluLzgnym2NPZFr9uS5h1soowUWVmI0lb3iU5FIUKuCg7YYEOrGSwPtRhQ=="
2950
+ ],
2951
+ [
2952
+ "@deepseek-ai/dsh-agent-loop",
2953
+ "0.1.2-alpha.3",
2954
+ "sha512-SXA7eKvcpYjexnkY3MLUbJOPaLGXrCCPI/eA1ohhYFiuRsu4y4Lt5C0CchtXWqIxlKDdW3lWapj81OpeYHTi2A=="
2955
+ ],
2956
+ [
2957
+ "@deepseek-ai/dsh-attachment",
2958
+ "0.1.2-alpha.3",
2959
+ "sha512-KiJy3esEEthj2alvZLqGN6YH7Ncmia+lzJW9VWf8J9EThlmUrX9xcG6k8v/paLMyrAv2w4JKxvZCIuWZK5mIwA=="
2960
+ ],
2961
+ [
2962
+ "@deepseek-ai/dsh-bash-sandbox",
2963
+ "0.1.2-alpha.3",
2964
+ "sha512-U3U6ageI0VPs9TmIqtZtztJRBCwGszSbNLHe24h1kPKDAy3UveGNUDdq89OgINJH7U1Ce213uucRcqY8tjkPfw=="
2965
+ ],
2966
+ [
2967
+ "@deepseek-ai/dsh-commands",
2968
+ "0.1.2-alpha.3",
2969
+ "sha512-lXB+f7B5a1gDatCtpww5AvM2TCltb95xkHZMkAmwleBJJgx5iqtKtEelObigXZu14HtZpLdO6v/0Fvm/akOyIg=="
2970
+ ],
2971
+ [
2972
+ "@deepseek-ai/dsh-fs",
2973
+ "0.1.2-alpha.3",
2974
+ "sha512-qOaZ7JRFNJYtdG2EkHpXs4yzypRZX5YHOjZ7RLe571T/eLegg9nCJIEr4gFr1LvPn2nuLdJmwTB2x4ckZkXIuw=="
2975
+ ],
2976
+ [
2977
+ "@deepseek-ai/dsh-fs-local",
2978
+ "0.1.2-alpha.3",
2979
+ "sha512-QzLTaj92cJ4RrE5NTx9NaV5ZhlC0mgSLHK3Z6ePXyHFcgAPGh3dJ6pw4q3r2dC7vlDTKyBIHHCb6MLwSUU8+BA=="
2980
+ ],
2981
+ [
2982
+ "@deepseek-ai/dsh-fs-observation-policy",
2983
+ "0.1.2-alpha.3",
2984
+ "sha512-HDbTSazpoRIyPwmfip5k0nT4FfboaiViJqQplAUulCDxRK0QykuMQPUdkzANEXkvMBR2meTYurR6OPE0NZKuWw=="
2985
+ ],
2986
+ [
2987
+ "@deepseek-ai/dsh-fs-sandbox",
2988
+ "0.1.2-alpha.3",
2989
+ "sha512-Ady8S/1NJcVv2SHgzOWHmhFcfmfidUBN1F5d5KFywHwYzYChtjldiieJvxU7dH7opH/sdX8kxOgFoDqauE4g8w=="
2990
+ ],
2991
+ [
2992
+ "@deepseek-ai/dsh-goal",
2993
+ "0.1.2-alpha.3",
2994
+ "sha512-mExFFbFDupDTwbVagDbHVGJ0jYvGiFYFocAwfGYxPQGxZRcU8d4BgFir60GhbHsKtoSLDc48IlWscTZ6CXD3CA=="
2995
+ ],
2996
+ [
2997
+ "@deepseek-ai/dsh-host-plugin-inventory",
2998
+ "0.1.2-alpha.3",
2999
+ "sha512-NagByjrXyIQRLaTGFmkqZ50HpgkEKuNHvwLskMGgu5ej8ucAQKOvJ2B+iyAlbtXj4Pkr84HKIX6smqjbGJNDxA=="
3000
+ ],
3001
+ [
3002
+ "@deepseek-ai/dsh-host-webserver",
3003
+ "0.1.2-alpha.3",
3004
+ "sha512-VSlbioqJZ8JSQmFnjYXr7U/R7NCfL8fo9ztiYpRTAoqrSoodaabA6hH79Mueb+gAVHOtzpNRLK8dWDkqczmDVA=="
3005
+ ],
3006
+ [
3007
+ "@deepseek-ai/dsh-jobs",
3008
+ "0.1.2-alpha.3",
3009
+ "sha512-P5jS3kqNrnPktvSQLBWsAnf5Dpa20EzVo9giUQQKE6WKgPV9Z3tnRVybV2TFTU6MqGClNAqZmY8tnEMABzgA9g=="
3010
+ ],
3011
+ [
3012
+ "@deepseek-ai/dsh-jobs-local",
3013
+ "0.1.2-alpha.3",
3014
+ "sha512-d77W8jURnp9pVxnU0fuYt8lDmmiJcR9FWzNwPqvk/uwjx9zwtMtkCU0WtBcyxVqVGpEmG2pU2upln1m0eCfVBA=="
3015
+ ],
3016
+ [
3017
+ "@deepseek-ai/dsh-llm",
3018
+ "0.1.2-alpha.3",
3019
+ "sha512-xGedBtvxb1HJWCmVO9v3fhHqoZ1iMDQU1x7fqAhhDfjKjmLTljWC1/RdZqUFI/1a/CM1iGPSaDuPZDCMu45AtA=="
3020
+ ],
3021
+ [
3022
+ "@deepseek-ai/dsh-pwsh-sandbox",
3023
+ "0.1.2-alpha.3",
3024
+ "sha512-nVYijWMJilFWGF/nJLieNyM1c4PY1CdMN0QmHQGMiE9kyL5+MR8xzqlgxQ3I3GzX9zzbN1NjLbm+t+QHaDlLUQ=="
3025
+ ],
3026
+ [
3027
+ "@deepseek-ai/dsh-sandbox",
3028
+ "0.1.2-alpha.3",
3029
+ "sha512-lKM+jhpxvfY48Se+J2sewIY2QP+eGCeSAazlvOsW3VMkzoVSA7RVIJFh6/xn3t1N9wrOXawii5Ex/vGVJ44HBQ=="
3030
+ ],
3031
+ [
3032
+ "@deepseek-ai/dsh-sandbox-policy",
3033
+ "0.1.2-alpha.3",
3034
+ "sha512-Lj75///rZ/5x60aM5fds3u8S4o1QTiy2/TKvqLUr+xT9CJRfk6v81LxV/SYc6DmP2pN0TKwL/50/kL44wbxzvw=="
3035
+ ],
3036
+ [
3037
+ "@deepseek-ai/dsh-session",
3038
+ "0.1.2-alpha.3",
3039
+ "sha512-iwWs0FdShoiCLLVk6lSZL18vKlFuliQXqy6gnu4U34B8K3uPb+QYWHjB3PrTXcK8ZVmb0zdWeyZ9osmANWWKnw=="
3040
+ ],
3041
+ [
3042
+ "@deepseek-ai/dsh-shell",
3043
+ "0.1.2-alpha.3",
3044
+ "sha512-UM+ZObnmKVEy+/d2hKUNAIctpLojpbs7isOyZ3LoWtcVnIK2kjPCPDHBeUj/3DMSzxYR7Ak9QRnNxnG5cXgvDg=="
3045
+ ],
3046
+ [
3047
+ "@deepseek-ai/dsh-shell-env",
3048
+ "0.1.2-alpha.3",
3049
+ "sha512-Phgv3Zuao0jKlS++uyUlQw+7x2Zk3DFcG2qOb86JwP3WpzqgdzoKoplcc3wev3J8+RX5TkNq7Dl92UKPvynGTw=="
3050
+ ],
3051
+ [
3052
+ "@deepseek-ai/dsh-subprocess-local",
3053
+ "0.1.2-alpha.3",
3054
+ "sha512-T2HPtqL17ODH5AS7E6cQKtiulJSGv7HEQmYbQKiSaR2CCiLHlXosUPuGis+yuCfBZ8GZOjwn18abkDraKOOFCg=="
3055
+ ],
3056
+ [
3057
+ "@deepseek-ai/dsh-system-prompt",
3058
+ "0.1.2-alpha.3",
3059
+ "sha512-R+VVDew/0DdTypypAjkgTygh3M2yNYXNFO+DvMfdX98jgD7MSluw2iYaCFR/ax9bBNHXXHQ7eXHsIYI1a0FrPg=="
3060
+ ],
3061
+ [
3062
+ "@deepseek-ai/dsh-tool-bash",
3063
+ "0.1.2-alpha.3",
3064
+ "sha512-eQ3IQ+Jz0CI2e24gx8Q8xg1MyYcE48UP/asWEBfSuM0ycmexbGLPPip/H137NbxBXx1O4Ewok8ipVLyHYx7QjQ=="
3065
+ ],
3066
+ [
3067
+ "@deepseek-ai/dsh-tool-fs",
3068
+ "0.1.2-alpha.3",
3069
+ "sha512-YiY/hxBh11Lu3wKjtGxhDFYHf2ACWpUlhTM1JopJhiEdrIAsZ7wXeRHfLzvMaHJG30+vgIekbY/zY8EOGkOsww=="
3070
+ ],
3071
+ [
3072
+ "@deepseek-ai/dsh-tool-goal",
3073
+ "0.1.2-alpha.3",
3074
+ "sha512-YQ1JwXIGiIDkATlrqV6CV1sbHFd95tbmNPlbsuwjKXETMcGO09iTtOoYCONBT8aIx9TSqcloM37TjDGgpEXFYQ=="
3075
+ ],
3076
+ [
3077
+ "@deepseek-ai/dsh-tool-jobs",
3078
+ "0.1.2-alpha.3",
3079
+ "sha512-tsBJslgxjlv92/8guVjUEOPkr+JlC83BGiJJpHAponyPBdCF/mVy8zBO6V89yEgmjW/nRWTUwv2dZnnHtOCptQ=="
3080
+ ],
3081
+ [
3082
+ "@deepseek-ai/dsh-tool-pwsh",
3083
+ "0.1.2-alpha.3",
3084
+ "sha512-QxCPtD9EcjoKuo1MZid/fkbsXHDKRpF3s1iXUuFIMsjBZs7ip/qoieL/bTpqiyHJcuhHjWver8hKkEdL/nqBdA=="
3085
+ ],
3086
+ [
3087
+ "@deepseek-ai/dsh-tools",
3088
+ "0.1.2-alpha.3",
3089
+ "sha512-ffcpryQgwqAHIkN326CKqH3kueCMKXgbRU4D0Lp+Kwql97NVZrmRxI8ExERJtTju1adtowwVOXIdPjD4XyB44w=="
3090
+ ],
3091
+ [
3092
+ "@deepseek-ai/dsh-user-approval",
3093
+ "0.1.2-alpha.3",
3094
+ "sha512-ulp0zA1JnzrjJVyg4DbKMR6Vxz66+ltbIXKhDQcrPgYE93woI0U2VoWiQPuvlozcWqpEvDsmsmdM3rMTxQrB0A=="
3095
+ ],
3096
+ [
3097
+ "@deepseek-ai/dsh-web-app",
3098
+ "0.1.2-alpha.3",
3099
+ "sha512-ntOJ9WOU+KPOuWBRxTibM89BxiAYN20bKcp3ozn0M5A5+IHG/7QFUxcZUZCq03eVpNR59l/EgGrHdxy7r+ON9g=="
3100
+ ],
3101
+ [
3102
+ "dshmarket",
3103
+ "1.39.0",
3104
+ "sha512-URuXIuuNRfX6k0Flo7CJxeA7EVLhLGYDm3Lk4BoEXW1Qlg+boX/LI8wCE8hGC0FMBftFr9j8D/ulGNTdFM67nQ=="
3105
+ ]
3106
+ ].map(([name, version, integrity]) => ({
3107
+ name,
3108
+ version,
3109
+ integrity
3110
+ }));
3111
+
2932
3112
  //#endregion
2933
3113
  //#region src/domain/host-lock.ts
2934
- const SUPPORTED_HOST_MANIFEST = {
2935
- manifestVersion: 1,
2936
- supportedGoalVersions: ["0.1.1-rc.2"],
2937
- capabilities: [
2938
- {
2939
- name: "goal_complete_precommit_guard",
2940
- value: {
2941
- k: "s",
2942
- v: "required"
2943
- }
2944
- },
2945
- {
2946
- name: "goal_disarm_readback",
2947
- value: {
2948
- k: "s",
2949
- v: "required"
2950
- }
2951
- },
2952
- {
2953
- name: "session_flush_before_control",
2954
- value: {
2955
- k: "s",
2956
- v: "required"
2957
- }
2958
- },
2959
- {
2960
- name: "tool_guard_monotonic",
2961
- value: {
2962
- k: "s",
2963
- v: "required"
2964
- }
2965
- },
2966
- {
2967
- name: "host_capability_model",
2968
- value: {
2969
- k: "s",
2970
- v: "action-platform-v1"
2971
- }
2972
- },
2973
- {
2974
- name: "external_wait_jobs_readback",
2975
- value: {
2976
- k: "s",
2977
- v: "dsh.jobs.v1"
2978
- }
2979
- },
2980
- {
2981
- name: "filesystem_tool_contract",
2982
- value: {
2983
- k: "s",
2984
- v: "dsh.fs-tools.v1"
2985
- }
2986
- },
2987
- ...SEMANTIC_ACTIONS.map((action) => ({
2988
- name: "supported_action",
3114
+ /**
3115
+ * Capability expectations shared by every audited host cohort. The rc.2 ->
3116
+ * alpha.2 source audit found no Guard-consumed contract change (session event
3117
+ * vocabulary, flush contract, Goal disarm, `update_goal` gating, tool
3118
+ * definition, renderer terminal markers), so the rows are identical; a future
3119
+ * cohort that changes any of them must declare its own rows instead.
3120
+ */
3121
+ const AUDITED_CAPABILITY_ROWS = [
3122
+ {
3123
+ name: "goal_complete_precommit_guard",
3124
+ value: {
3125
+ k: "s",
3126
+ v: "required"
3127
+ }
3128
+ },
3129
+ {
3130
+ name: "goal_disarm_readback",
3131
+ value: {
3132
+ k: "s",
3133
+ v: "required"
3134
+ }
3135
+ },
3136
+ {
3137
+ name: "session_flush_before_control",
3138
+ value: {
3139
+ k: "s",
3140
+ v: "required"
3141
+ }
3142
+ },
3143
+ {
3144
+ name: "tool_guard_monotonic",
3145
+ value: {
3146
+ k: "s",
3147
+ v: "required"
3148
+ }
3149
+ },
3150
+ {
3151
+ name: "host_capability_model",
3152
+ value: {
3153
+ k: "s",
3154
+ v: "action-platform-v1"
3155
+ }
3156
+ },
3157
+ {
3158
+ name: "external_wait_jobs_readback",
3159
+ value: {
3160
+ k: "s",
3161
+ v: "dsh.jobs.v1"
3162
+ }
3163
+ },
3164
+ {
3165
+ name: "filesystem_tool_contract",
3166
+ value: {
3167
+ k: "s",
3168
+ v: "dsh.fs-tools.v1"
3169
+ }
3170
+ },
3171
+ ...SEMANTIC_ACTIONS.map((action) => ({
3172
+ name: "supported_action",
3173
+ value: {
3174
+ k: "s",
3175
+ v: action
3176
+ }
3177
+ }))
3178
+ ];
3179
+ function defineCohort(id, supportedGoalVersions, auditedPlatforms, packages) {
3180
+ return {
3181
+ id,
3182
+ manifestVersion: 1,
3183
+ supportedGoalVersions,
3184
+ auditedPlatforms,
3185
+ packages,
3186
+ capabilities: [{
3187
+ name: "host_cohort",
2989
3188
  value: {
2990
3189
  k: "s",
2991
- v: action
3190
+ v: id
2992
3191
  }
2993
- }))
2994
- ]
2995
- };
3192
+ }, ...AUDITED_CAPABILITY_ROWS]
3193
+ };
3194
+ }
2996
3195
  /**
2997
- * Audited package identities. This is a catalogue, not one indivisible lock:
2998
- * evaluateHostLock requires only BASE_HOST_PACKAGES globally and evaluates the
2999
- * remaining action/platform groups independently.
3196
+ * alpha.2 audited package identities (second registry cohort), hoisted so the
3197
+ * alpha.2 + dshmarket 1.39.0 cohort can reuse the exact natively audited rows
3198
+ * with only the dshmarket identity substituted.
3000
3199
  */
3001
- const EXPECTED_HOST_PACKAGES = [
3200
+ const ALPHA2_HOST_PACKAGES = [
3002
3201
  {
3003
3202
  name: "@deepseek-ai/cordis",
3004
- version: "4.0.1",
3005
- integrity: "sha512-YBdskTU2Po1kru3GgcUWUbkTsPMA9LkSQDAY8rBkFJeajdgcQad3QPJZE26JyK99Xb6HaASvoXg2DSUTeN/0Nw=="
3203
+ version: "4.0.2",
3204
+ integrity: "sha512-asOnXP1TzFSFQlHb1iegDZp0z/8WD1c7YNrwJR/Tx2bzNuMXfcekE/I67Iv6SQXeLB4csxqCngzQKANP7gdw0g=="
3006
3205
  },
3007
3206
  {
3008
- name: "@deepseek-ai/dsh-agent",
3009
- version: "0.1.1-rc.2",
3010
- integrity: "sha512-cC7lnJe7JgPFcreNXxcxLMxQd78LnpVO9ZXROjZsGRQN1zGH6i/DduI892F1am85IfzzO+XTxMwwUHmfwamb0g=="
3207
+ name: "@deepseek-ai/dsh",
3208
+ version: "0.1.2-alpha.2",
3209
+ integrity: "sha512-4TvTC5kRKlgtSU2UTBv+cID9a2Z+6+m6mpvjXWJfVzuTkflCff6s4MsQpFJTCmwFh/k7zNWe7qFXcLYMV/5VvA=="
3011
3210
  },
3012
3211
  {
3013
- name: "@deepseek-ai/dsh-commands",
3014
- version: "0.1.1-rc.2",
3015
- integrity: "sha512-BOIe4Sht9rmMv1a6b3GWjWBbeWr7PtHlAy41vgpaymvUUuzOapOIA648ZMGCI/crRIt72Umev2FHtSwCNSbYZg=="
3212
+ name: "@deepseek-ai/dsh-agent",
3213
+ version: "0.1.2-alpha.2",
3214
+ integrity: "sha512-K7B5XSQ7byB/IoNGj7n+lBgHCpVPJqEPvpGoHKc1dBS8fPo2yYp/ALFag4YOfrXVP3jQ9A8di20BbvIlp79SoA=="
3016
3215
  },
3017
3216
  {
3018
- name: "@deepseek-ai/dsh-goal",
3019
- version: "0.1.1-rc.2",
3020
- integrity: "sha512-lSHTh4vfS6eRb9to/y+bjRf2+0QkNpY3tHJ29HMTewR9fJYZsEVVu4Hc+GPhPEjF7RpiD35/sKx+akijtDasyg=="
3217
+ name: "@deepseek-ai/dsh-agent-loop",
3218
+ version: "0.1.2-alpha.2",
3219
+ integrity: "sha512-UU1i+rTuQV3Q5PGY4qFlojJ0Gbthib22pida5elZlg28dd8gtY2d1U5V9q2+rKK/469CO29rkz6TWMWk0g93Jg=="
3021
3220
  },
3022
3221
  {
3023
- name: "@deepseek-ai/dsh-llm",
3024
- version: "0.1.1-rc.2",
3025
- integrity: "sha512-ASJfjIdZbIXvLwi3rGo+eZb/GxMVV/WO5/XVD3B96mT8EIzrlw3+nMR6/CvmJVzcycKQ2XN0wj7jD6TasPRySA=="
3222
+ name: "@deepseek-ai/dsh-attachment",
3223
+ version: "0.1.2-alpha.2",
3224
+ integrity: "sha512-+e+zQCbBi94Jnyfpq/M+/J2R/66GbMh5zqr7yVdCjvAJp8d2hxQsZ0O/oaSV+iZQIMgJz+BcwvrS1VU+XmzQWg=="
3026
3225
  },
3027
3226
  {
3028
- name: "@deepseek-ai/dsh-session",
3029
- version: "0.1.1-rc.2",
3030
- integrity: "sha512-4/cv6X9HPhm47eyRhCu/WZwzrtJKegk5J+0xaxcZ9i8S0smdxP57tqy8a0jkSshLQn7BzMFxneQrlYExrLrDhQ=="
3227
+ name: "@deepseek-ai/dsh-bash-sandbox",
3228
+ version: "0.1.2-alpha.2",
3229
+ integrity: "sha512-y5NZT7OkKi23N2fF+x9oo1QZH8LPfTU+llL86r+iETSSk5jzh91Hp2cP5Iq5S/L3BAQDaEw2J4Dg8VjF+fnnkg=="
3031
3230
  },
3032
3231
  {
3033
- name: "@deepseek-ai/dsh-tools",
3034
- version: "0.1.1-rc.2",
3035
- integrity: "sha512-0GGL4D55MwYDepzZMOI3L0ycu5b2qr96GL0Y7snwhAnpK2Di61rbX3fJE+PB3ZrovGX0csIRdt9n3iJZDVtDrw=="
3232
+ name: "@deepseek-ai/dsh-commands",
3233
+ version: "0.1.2-alpha.2",
3234
+ integrity: "sha512-KkyNkD5V80h+xXsByGdXH8uvKo/5uflb1CSY8O8IrciuptaJdneSAmTFsjmCKAjqCTGgigk2VDw6mqPwux2JYg=="
3036
3235
  },
3037
3236
  {
3038
- name: "@deepseek-ai/dsh-tool-goal",
3039
- version: "0.1.1-rc.2",
3040
- integrity: "sha512-kTECpE732uwlxRJr/jBZb1BqaxZzrA7Rv4KuM3eolvhoTJ5zjyiR2YHmDmCSfuI6zmA/BEfWss7D0mLbVtJEZA=="
3237
+ name: "@deepseek-ai/dsh-fs",
3238
+ version: "0.1.2-alpha.2",
3239
+ integrity: "sha512-wx5n0QS5rfZ2LPVocMNfuOUh0RYH/QuLoCEy+qI8U3nKmSZ8GSTASURLg+0pVxckHpLElo38U+S/lkLxRK1rpQ=="
3041
3240
  },
3042
3241
  {
3043
- name: "@deepseek-ai/dsh-agent-loop",
3044
- version: "0.1.1-rc.2",
3045
- integrity: "sha512-2uJZ6kjJ3IYLRGn6/NhiZgD576ABcbERB/nkReR9TEUMO2zWkz6OuKtVwLyFCFSni2T25Jv+clKQWt7D4MhU3A=="
3242
+ name: "@deepseek-ai/dsh-fs-local",
3243
+ version: "0.1.2-alpha.2",
3244
+ integrity: "sha512-IIpZAxGw8wr+xpZQhvuHB9JtUeE6V03e45njfFah1eRl0miaHV5CxCRlFwkMLrow5I2zCCsCPPmdEaouGxTGSA=="
3046
3245
  },
3047
3246
  {
3048
- name: "@deepseek-ai/dsh-tool-bash",
3049
- version: "0.1.1-rc.2",
3050
- integrity: "sha512-YNmrKmBanj5EQn1zejjbo4UUFtg2/h3s9y0lY3vBu+dezNz4HdUlSkSZACbNUAZywyLomdhlt4rJdtdnrqyS7Q=="
3247
+ name: "@deepseek-ai/dsh-fs-observation-policy",
3248
+ version: "0.1.2-alpha.2",
3249
+ integrity: "sha512-oMDSB1NTnj4rIGy5JXCtbzTFDwKkU/38KIKrVs3u6b65Y5spq3kjc1ITpjqo3Ze4H8umc8wJqGke2o/ms8eIEQ=="
3051
3250
  },
3052
3251
  {
3053
- name: "@deepseek-ai/dsh-tool-pwsh",
3054
- version: "0.1.1-rc.2",
3055
- integrity: "sha512-Gr0F4VWCIIR25qWVv4mMEJnewXILHLCkZwrLfbHA2OOI7DNvvdB5wjJxhuo+ZQa8/3KJ/byQGtEBqCY9mb10Zg=="
3252
+ name: "@deepseek-ai/dsh-fs-sandbox",
3253
+ version: "0.1.2-alpha.2",
3254
+ integrity: "sha512-jTnGZUov95e9OANKG+uoWAczdGlzy24aXJ+z4N4J+rMvThfj5awV3ucsmX9S4YW2peHoTV9D7BNGgBQ84LxB+w=="
3056
3255
  },
3057
3256
  {
3058
- name: "@deepseek-ai/dsh-shell",
3059
- version: "0.1.1-rc.2",
3060
- integrity: "sha512-gEqPUxKOpOV66wvM4o8Z5FEuWmsEvYzD9OQy3cyo/kjzlx+2+KUWi22cl/YWtBs/zUtRJbdG5UqMnh8GUeO8Hg=="
3257
+ name: "@deepseek-ai/dsh-goal",
3258
+ version: "0.1.2-alpha.2",
3259
+ integrity: "sha512-6E+QfBezGsQ2RI0KLZc8llRpukV9ujLjCcQ2UAboYJS7FPQMs7f/QfSrfTubwpB4lrnOok0H26JT2jHUhJeQbQ=="
3061
3260
  },
3062
3261
  {
3063
- name: "@deepseek-ai/dsh-subprocess-local",
3064
- version: "0.1.1-rc.2",
3065
- integrity: "sha512-I4pyzpohZEVRQQbuEpMP0t8oKsf+XIlRo64aJVKGXI2eMcg9f9gbfhKQNYNqRGbegQL1HYpSLU6Rzyibldgwaw=="
3262
+ name: "@deepseek-ai/dsh-host-plugin-inventory",
3263
+ version: "0.1.2-alpha.2",
3264
+ integrity: "sha512-qWD+fTYTq8YoNa1TbYXy/Qk7bjjS4URJMgMa3m1vnyZ+xdwtRBF47dUa7wVAVX7oGg03bl7TD1Eo7GcKP/eajA=="
3066
3265
  },
3067
3266
  {
3068
- name: "@deepseek-ai/dsh-bash-sandbox",
3069
- version: "0.1.1-rc.2",
3070
- integrity: "sha512-bagZDMZ73C1dVDBjFCn1flNZ8aOEel4dsmDJTfmagqeYPXfIJDFKPhDc3lWjc+o6jMNfmumeUJ62dwhHkjJHKA=="
3267
+ name: "@deepseek-ai/dsh-host-webserver",
3268
+ version: "0.1.2-alpha.2",
3269
+ integrity: "sha512-cvsfM/cm5hZk/RqdIsardfqBIVpemdmUrP4M6UgdqhJy2nG5VnokLBg7k0bc8Yi11q0vIETfQK4xiDOSOMnu7Q=="
3071
3270
  },
3072
3271
  {
3073
- name: "@deepseek-ai/dsh-pwsh-sandbox",
3074
- version: "0.1.1-rc.2",
3075
- integrity: "sha512-hBUTg5p8TTQifZrfstbimVlBFyUOb7JhNkWKc+n6UpTzoFRSkPAvrjGeXKDmFI6jXpL4nXzLJoaIssfYnRg7bw=="
3272
+ name: "@deepseek-ai/dsh-jobs",
3273
+ version: "0.1.2-alpha.2",
3274
+ integrity: "sha512-yPNlYX/ZKphjzRY7oMf5uLgfSlJ8qBp49W6qNqzhmn8moXgJcPUCNqeOkT0C3a6GQ286mmmo09eyfDLGX7+lMQ=="
3076
3275
  },
3077
3276
  {
3078
- name: "@deepseek-ai/dsh-shell-env",
3079
- version: "0.1.1-rc.2",
3080
- integrity: "sha512-dDKKqsxsbklUpxX5ornd/SKJ2yfr/SOHOWDgeJkYvx3SMSXq8EvhCK/VEvHswXQ25rRLFWM4/Mr3htk1hn/GPA=="
3277
+ name: "@deepseek-ai/dsh-jobs-local",
3278
+ version: "0.1.2-alpha.2",
3279
+ integrity: "sha512-nrK4ujL6QRS6GAysgBR08vaHub4vh7/iuGtmMvcg4Bp3hZeQ4rjWnpQAuItg9E9G3OUrvfjwzwENEM1TyVcbWw=="
3081
3280
  },
3082
3281
  {
3083
- name: "@deepseek-ai/dsh",
3084
- version: "0.1.1-rc.2",
3085
- integrity: "sha512-UP1UIh6q3Gme/yXRn/QL2P8IsVlv8Shpg22TRJIZPsCRWLm4CBiA1MUvXmJAfsOEETBMLAl+xWPtFw6ICsN3wg=="
3282
+ name: "@deepseek-ai/dsh-llm",
3283
+ version: "0.1.2-alpha.2",
3284
+ integrity: "sha512-ip6yMxwHugxQm4VCbwX/FDnlTeeBM9VBkIn0+74ityQy7Z3yKREJ1Ov8Z04l4G3duRzeGRsQ4ztOFZ01oNfKIw=="
3086
3285
  },
3087
3286
  {
3088
- name: "@deepseek-ai/dsh-host-plugin-inventory",
3089
- version: "0.1.1-rc.2",
3090
- integrity: "sha512-Hud9ezW0bexWfhX7C+c5rdUDX1xzbEGDzj1lGQyj/QxdrxHYHjGrJq3tLRyvN6K4FSmEdG2IBKdQGCOLVrIthA=="
3287
+ name: "@deepseek-ai/dsh-pwsh-sandbox",
3288
+ version: "0.1.2-alpha.2",
3289
+ integrity: "sha512-j/gUmv+nWYzg8o+oEEIK9FKeb6L24n2u7xjpIm7DcL5YjQlRDR6FgDvR2hpUK/d4Wk+zvnaPqZaEaXfUtOzEKQ=="
3091
3290
  },
3092
3291
  {
3093
- name: "dshmarket",
3094
- version: "1.36.0",
3095
- integrity: "sha512-xX8CCoXdIALaxtLosj+5qGg8r1cykW2zo1AOPJcSQepg2r4Vd2K0NmERldDqfeyFV0pCuZsUoAPe1Q/BW7De/g=="
3292
+ name: "@deepseek-ai/dsh-sandbox",
3293
+ version: "0.1.2-alpha.2",
3294
+ integrity: "sha512-InfHYn5B0MxF5QLz0AjbwPS5W0G9VtIvjEFl5o/049KzH6khGKhjqOAVZtu1Z46f1+K/dbjF50VkTdnX3pgIJA=="
3096
3295
  },
3097
3296
  {
3098
- name: "@deepseek-ai/dsh-host-webserver",
3099
- version: "0.1.1-rc.2",
3100
- integrity: "sha512-t9MrjC65QHiiWhG9V8UZxgfE/aWYhJHHrIM0kbTvtXxg4tLGIKo/upHp7iiag65F3HTkVLrH/DUyPMi4v2ZA7g=="
3297
+ name: "@deepseek-ai/dsh-sandbox-policy",
3298
+ version: "0.1.2-alpha.2",
3299
+ integrity: "sha512-Af7DWZTEjF/70YWSiN0jfbZli1XRk6Bo9W61QHxfShS79I8//mOPrItEPtJRWL/RCmGNfudFglNFyyGKdaqBIg=="
3101
3300
  },
3102
3301
  {
3103
- name: "@deepseek-ai/dsh-web-app",
3104
- version: "0.1.1-rc.2",
3105
- integrity: "sha512-1zGHY7qwBVlVJrzIWu+86SuBZXaVUxe2JRfffsuRvKXq2QcR/K4CoJJfZ43cDoWKu9xPvvxz7w2ezV+EdXgg1A=="
3302
+ name: "@deepseek-ai/dsh-session",
3303
+ version: "0.1.2-alpha.2",
3304
+ integrity: "sha512-RfikXscYTDXDr7CD7C/8oGJZaH8Egclj7pmXRtd90QcB5L8RIQ7069xrHZjds8OjNrFo69qQwNK3gYLUVZy9PA=="
3106
3305
  },
3107
3306
  {
3108
- name: "@deepseek-ai/dsh-jobs",
3109
- version: "0.1.1-rc.2",
3110
- integrity: "sha512-SXvDJMvcUrGrlzIyE7j8/lI4Pj1nDe/UOR8C05Zagp+/0R8p46n6KylySvZdPAFENV5t8WX3Fw3eOaS4No0+wQ=="
3307
+ name: "@deepseek-ai/dsh-shell",
3308
+ version: "0.1.2-alpha.2",
3309
+ integrity: "sha512-i16e+OrCJ7GZ1XDnPds081NgVs/xzIVMLECzmLnXgVDKeePgWpdEgR//PgMqKPwoBoJ8z7DTzwKiOISAtOpNzA=="
3111
3310
  },
3112
3311
  {
3113
- name: "@deepseek-ai/dsh-jobs-local",
3114
- version: "0.1.1-rc.2",
3115
- integrity: "sha512-26lg7mi9RKnu8IP8SWLbY+uZenbqF2AkAZvgZaLDlw1z58NtBsbgKgh6FNC8JXEyknAwYc6auQQKF+nLTlEjCw=="
3312
+ name: "@deepseek-ai/dsh-shell-env",
3313
+ version: "0.1.2-alpha.2",
3314
+ integrity: "sha512-OCf1iaPC5Qg6/DMLzvq5flGVSKP2uxAhgKs+8vrRuUiKc2UXXUE4uKayzZU7S18EysLZOVjMKKyUnHFXCVRQxg=="
3116
3315
  },
3117
3316
  {
3118
- name: "@deepseek-ai/dsh-tool-jobs",
3119
- version: "0.1.1-rc.2",
3120
- integrity: "sha512-wCU7mo2uoQcAtz7de4ZXP2es9lALsmz6XzC+KAlS2e7/yTBi9a5LL2vdSr6XhExVAuhu/6f9eM/w4EQBOxtKlw=="
3317
+ name: "@deepseek-ai/dsh-subprocess-local",
3318
+ version: "0.1.2-alpha.2",
3319
+ integrity: "sha512-IFneyTRqvbF/1Jm9h0WwBBxwlAd3vRh3SE/sZo2DTy9lzkRUMEBmWTiJZhVCMZ7hDLE0ALnjLLnLFLkA7bCP9Q=="
3121
3320
  },
3122
3321
  {
3123
- name: "@deepseek-ai/dsh-tool-fs",
3124
- version: "0.1.1-rc.2",
3125
- integrity: "sha512-llX8AWbaI3CGme/a2eeTSfy5atk8u3iJeOFzmZV/KZ0v0hMhKZIK1xQInWwC9OmSDJ/StStJe0hDPVLWbB7hVg=="
3322
+ name: "@deepseek-ai/dsh-system-prompt",
3323
+ version: "0.1.2-alpha.2",
3324
+ integrity: "sha512-qT9PZEVMAbszsg1UVUvuovfWFS5unjy08KV0rnOc89TJCgkb2CnlknSyIQs0lXc/UiqT6ZQ59i4ClAFrXhxfxQ=="
3126
3325
  },
3127
3326
  {
3128
- name: "@deepseek-ai/dsh-fs",
3129
- version: "0.1.1-rc.2",
3130
- integrity: "sha512-8j+6MffvCHATLQrhAVfc9rKyunKu/O7mjjJzmdsUSdID7V4iUYMwqPamhlAyI+tfohZu/vcforKzCRIZGmCYug=="
3327
+ name: "@deepseek-ai/dsh-tool-bash",
3328
+ version: "0.1.2-alpha.2",
3329
+ integrity: "sha512-Vt70FCPSE3Y7++2i9dKCNrsXTqhDpeJwqo44/GZow1xJ5acY9iNkjmjfq0UrTvacLLOEVnrMMBa9LojXi2WZUA=="
3131
3330
  },
3132
3331
  {
3133
- name: "@deepseek-ai/dsh-fs-local",
3134
- version: "0.1.1-rc.2",
3135
- integrity: "sha512-jvn1MsAMqCmt5SjRNkPjmpc+RIWrZQrBVtf/OpmKr2PaBEGqSbCkPApWDE9iSMhcuQg6k5evScOXwAsduzKOLA=="
3332
+ name: "@deepseek-ai/dsh-tool-fs",
3333
+ version: "0.1.2-alpha.2",
3334
+ integrity: "sha512-zQ+zxunJ9BXFR/kAw0Z/LO5TEy87uf1X2giE1AmM9fqbev28vd4pzLq3y8F9b0E64461ANrfD1q2wx8Gy1w47g=="
3136
3335
  },
3137
3336
  {
3138
- name: "@deepseek-ai/dsh-fs-sandbox",
3139
- version: "0.1.1-rc.2",
3140
- integrity: "sha512-PI65uLZ3ARkfVV/PXvACS1HEXggoOaXgYQzXQFdLOfm7AiHOdZWZccUAXBetpZhcNYIOKsVoLnfZkXcHByqecQ=="
3337
+ name: "@deepseek-ai/dsh-tool-goal",
3338
+ version: "0.1.2-alpha.2",
3339
+ integrity: "sha512-lvp60s3JKuTzncrlKCyS3qM/jYMLZSTMXJ/xQ8A0EIDvfPp7x1C3NNez66IJXPJ5YMtW9QYsqx2YmnUKhPOrow=="
3141
3340
  },
3142
3341
  {
3143
- name: "@deepseek-ai/dsh-fs-observation-policy",
3144
- version: "0.1.1-rc.2",
3145
- integrity: "sha512-rlq7yu4xavkKK1Oa1/aNCOeUW7t/3OXJJOfOcZXuUgJn5f8G0AbpTDpp2CeuL1cHlKpbunGhEkKQ2N/dv7ZR9w=="
3342
+ name: "@deepseek-ai/dsh-tool-jobs",
3343
+ version: "0.1.2-alpha.2",
3344
+ integrity: "sha512-QYq4almnoKNDu/ncrpGLTfkT5sIdqvRTyLd61VNJTFl4rNT2G/JCoEIhDgf50Rkwcchvvk/bNNdekjlENqZjKg=="
3146
3345
  },
3147
3346
  {
3148
- name: "@deepseek-ai/dsh-sandbox",
3149
- version: "0.1.1-rc.2",
3150
- integrity: "sha512-rnO2RqZ+ycpwrXrXlMcrhWAICdui3ZVTjNQ8eZrOPE18hAbX3tw0nLFq26sBjMSnBfDQHNZ4VaFpt0p8qhkPWQ=="
3347
+ name: "@deepseek-ai/dsh-tool-pwsh",
3348
+ version: "0.1.2-alpha.2",
3349
+ integrity: "sha512-sRGAmLWxxb+gglsqoftLojnFY1HaKMcwV9itkvv7JeACn5vkZuXTI0I/gNxjvt+g/b6sXT37hmQ7bmyo3dFHuQ=="
3151
3350
  },
3152
3351
  {
3153
- name: "@deepseek-ai/dsh-sandbox-policy",
3154
- version: "0.1.1-rc.2",
3155
- integrity: "sha512-cpoIUxCzpZJDTMXVt9gS+qgWEDAWf6rIe715uY1NF0ROoiEXPlmToLsHLF+4pXTW3wWWzpGVswO0bPYEKrQr3g=="
3352
+ name: "@deepseek-ai/dsh-tools",
3353
+ version: "0.1.2-alpha.2",
3354
+ integrity: "sha512-trk0fkmCDp64pqdcr8u7rCcRrwNi+93FKuznTnCD+YsPGFygcSG/6n+Wsh4+9A6oI1fM4/Ecq6Baa9vq1sNhJg=="
3156
3355
  },
3157
3356
  {
3158
3357
  name: "@deepseek-ai/dsh-user-approval",
3159
- version: "0.1.1-rc.2",
3160
- integrity: "sha512-SdsO4Rs+NeJFoertkVilXBACREOLfkKPJJznYKqDhJxeRo38RJ56dtj0Xd0/6rERmsQiMck4Bwdrzg1ubUqPNA=="
3358
+ version: "0.1.2-alpha.2",
3359
+ integrity: "sha512-CcV3hf2Q0NYxRbnlE+IysaUkq/hvmjlvS9OGiHpARZVY4VlidlZRmsy5g5L17vDoxirX+WBJ9Cc5VcJMcjPrUg=="
3161
3360
  },
3162
3361
  {
3163
- name: "@deepseek-ai/dsh-attachment",
3164
- version: "0.1.1-rc.2",
3165
- integrity: "sha512-rCYAt8QsawP1yfDCU7XxNwYT/XWvyFsxYrkwhLLkdfW83QVD0CQHizSkTQE7RFX74nKUD1z3sTLfnLr7xneArw=="
3362
+ name: "@deepseek-ai/dsh-web-app",
3363
+ version: "0.1.2-alpha.2",
3364
+ integrity: "sha512-+SKilM9fCCCoYr3fKT7CxNiozGsNHgvvTGhL63tKXM7/3M96dyj7zhT5ztoTgIDW9b9m8J/CaJUa4KlSeUJGFQ=="
3166
3365
  },
3167
3366
  {
3168
- name: "@deepseek-ai/dsh-system-prompt",
3169
- version: "0.1.1-rc.2",
3170
- integrity: "sha512-on4hjAlYI5uX9q7Sf95YkMMBVe6heywtA/H50ksrIMUub8U2B98hO9iQpHhjwIO1F1vu+5pLcPvRr6yUGGmtXQ=="
3367
+ name: "dshmarket",
3368
+ version: "1.38.1",
3369
+ integrity: "sha512-Z9VleLtCXwk5OlbSJKayWtbMaKACL8JUMyb/JHpErS4N3q//GJS+cgOhhxNkZYmXxB8/lv9IbhX1CBzlMhJeJg=="
3171
3370
  }
3172
3371
  ];
3372
+ /**
3373
+ * The exact graph the Windows daily runtime realized when it upgraded
3374
+ * dshmarket to 1.39.0 on an otherwise alpha.2 install — the combination whose
3375
+ * rejection was Guard 0.3.2's real web_control failure. It is one audited
3376
+ * whole-graph cohort: alpha.2 rows keep their native macOS/Windows audit
3377
+ * identities and the dshmarket 1.39.0 identity is the authoritative row from
3378
+ * the 2026-09-01 alpha.3 annex audit. Guard 0.4.0 supports this combination.
3379
+ */
3380
+ const ALPHA2_DSHMARKET_139_HOST_PACKAGES = ALPHA2_HOST_PACKAGES.map((row) => row.name === "dshmarket" ? {
3381
+ name: "dshmarket",
3382
+ version: "1.39.0",
3383
+ integrity: ALPHA3_HOST_PACKAGES.find((entry) => entry.name === "dshmarket").integrity
3384
+ } : row);
3385
+ /**
3386
+ * Audited host cohort registry. The rc.2 cohort keeps the exact identities
3387
+ * audited for 0.3.0/0.3.1 on macOS and Windows. The alpha.2 cohort carries the
3388
+ * exact package graph extracted from native macOS and Windows DSH
3389
+ * `0.1.2-alpha.2` / dshmarket `1.38.1` runtimes. The alpha.2+dshmarket-1.39.0
3390
+ * cohort carries the exact upgraded-Windows graph. The alpha.3 cohort carries
3391
+ * the graph audited in the 2026-09-01 annex. Graphs that mix cohorts, lack
3392
+ * rows, duplicate rows, or use identities outside every registered cohort
3393
+ * fail closed.
3394
+ */
3395
+ const HOST_COHORTS = [
3396
+ defineCohort("dsh-0.1.1-rc.2", ["0.1.1-rc.2"], ["posix", "windows"], [
3397
+ {
3398
+ name: "@deepseek-ai/cordis",
3399
+ version: "4.0.1",
3400
+ integrity: "sha512-YBdskTU2Po1kru3GgcUWUbkTsPMA9LkSQDAY8rBkFJeajdgcQad3QPJZE26JyK99Xb6HaASvoXg2DSUTeN/0Nw=="
3401
+ },
3402
+ {
3403
+ name: "@deepseek-ai/dsh-agent",
3404
+ version: "0.1.1-rc.2",
3405
+ integrity: "sha512-cC7lnJe7JgPFcreNXxcxLMxQd78LnpVO9ZXROjZsGRQN1zGH6i/DduI892F1am85IfzzO+XTxMwwUHmfwamb0g=="
3406
+ },
3407
+ {
3408
+ name: "@deepseek-ai/dsh-commands",
3409
+ version: "0.1.1-rc.2",
3410
+ integrity: "sha512-BOIe4Sht9rmMv1a6b3GWjWBbeWr7PtHlAy41vgpaymvUUuzOapOIA648ZMGCI/crRIt72Umev2FHtSwCNSbYZg=="
3411
+ },
3412
+ {
3413
+ name: "@deepseek-ai/dsh-goal",
3414
+ version: "0.1.1-rc.2",
3415
+ integrity: "sha512-lSHTh4vfS6eRb9to/y+bjRf2+0QkNpY3tHJ29HMTewR9fJYZsEVVu4Hc+GPhPEjF7RpiD35/sKx+akijtDasyg=="
3416
+ },
3417
+ {
3418
+ name: "@deepseek-ai/dsh-llm",
3419
+ version: "0.1.1-rc.2",
3420
+ integrity: "sha512-ASJfjIdZbIXvLwi3rGo+eZb/GxMVV/WO5/XVD3B96mT8EIzrlw3+nMR6/CvmJVzcycKQ2XN0wj7jD6TasPRySA=="
3421
+ },
3422
+ {
3423
+ name: "@deepseek-ai/dsh-session",
3424
+ version: "0.1.1-rc.2",
3425
+ integrity: "sha512-4/cv6X9HPhm47eyRhCu/WZwzrtJKegk5J+0xaxcZ9i8S0smdxP57tqy8a0jkSshLQn7BzMFxneQrlYExrLrDhQ=="
3426
+ },
3427
+ {
3428
+ name: "@deepseek-ai/dsh-tools",
3429
+ version: "0.1.1-rc.2",
3430
+ integrity: "sha512-0GGL4D55MwYDepzZMOI3L0ycu5b2qr96GL0Y7snwhAnpK2Di61rbX3fJE+PB3ZrovGX0csIRdt9n3iJZDVtDrw=="
3431
+ },
3432
+ {
3433
+ name: "@deepseek-ai/dsh-tool-goal",
3434
+ version: "0.1.1-rc.2",
3435
+ integrity: "sha512-kTECpE732uwlxRJr/jBZb1BqaxZzrA7Rv4KuM3eolvhoTJ5zjyiR2YHmDmCSfuI6zmA/BEfWss7D0mLbVtJEZA=="
3436
+ },
3437
+ {
3438
+ name: "@deepseek-ai/dsh-agent-loop",
3439
+ version: "0.1.1-rc.2",
3440
+ integrity: "sha512-2uJZ6kjJ3IYLRGn6/NhiZgD576ABcbERB/nkReR9TEUMO2zWkz6OuKtVwLyFCFSni2T25Jv+clKQWt7D4MhU3A=="
3441
+ },
3442
+ {
3443
+ name: "@deepseek-ai/dsh-tool-bash",
3444
+ version: "0.1.1-rc.2",
3445
+ integrity: "sha512-YNmrKmBanj5EQn1zejjbo4UUFtg2/h3s9y0lY3vBu+dezNz4HdUlSkSZACbNUAZywyLomdhlt4rJdtdnrqyS7Q=="
3446
+ },
3447
+ {
3448
+ name: "@deepseek-ai/dsh-tool-pwsh",
3449
+ version: "0.1.1-rc.2",
3450
+ integrity: "sha512-Gr0F4VWCIIR25qWVv4mMEJnewXILHLCkZwrLfbHA2OOI7DNvvdB5wjJxhuo+ZQa8/3KJ/byQGtEBqCY9mb10Zg=="
3451
+ },
3452
+ {
3453
+ name: "@deepseek-ai/dsh-shell",
3454
+ version: "0.1.1-rc.2",
3455
+ integrity: "sha512-gEqPUxKOpOV66wvM4o8Z5FEuWmsEvYzD9OQy3cyo/kjzlx+2+KUWi22cl/YWtBs/zUtRJbdG5UqMnh8GUeO8Hg=="
3456
+ },
3457
+ {
3458
+ name: "@deepseek-ai/dsh-subprocess-local",
3459
+ version: "0.1.1-rc.2",
3460
+ integrity: "sha512-I4pyzpohZEVRQQbuEpMP0t8oKsf+XIlRo64aJVKGXI2eMcg9f9gbfhKQNYNqRGbegQL1HYpSLU6Rzyibldgwaw=="
3461
+ },
3462
+ {
3463
+ name: "@deepseek-ai/dsh-bash-sandbox",
3464
+ version: "0.1.1-rc.2",
3465
+ integrity: "sha512-bagZDMZ73C1dVDBjFCn1flNZ8aOEel4dsmDJTfmagqeYPXfIJDFKPhDc3lWjc+o6jMNfmumeUJ62dwhHkjJHKA=="
3466
+ },
3467
+ {
3468
+ name: "@deepseek-ai/dsh-pwsh-sandbox",
3469
+ version: "0.1.1-rc.2",
3470
+ integrity: "sha512-hBUTg5p8TTQifZrfstbimVlBFyUOb7JhNkWKc+n6UpTzoFRSkPAvrjGeXKDmFI6jXpL4nXzLJoaIssfYnRg7bw=="
3471
+ },
3472
+ {
3473
+ name: "@deepseek-ai/dsh-shell-env",
3474
+ version: "0.1.1-rc.2",
3475
+ integrity: "sha512-dDKKqsxsbklUpxX5ornd/SKJ2yfr/SOHOWDgeJkYvx3SMSXq8EvhCK/VEvHswXQ25rRLFWM4/Mr3htk1hn/GPA=="
3476
+ },
3477
+ {
3478
+ name: "@deepseek-ai/dsh",
3479
+ version: "0.1.1-rc.2",
3480
+ integrity: "sha512-UP1UIh6q3Gme/yXRn/QL2P8IsVlv8Shpg22TRJIZPsCRWLm4CBiA1MUvXmJAfsOEETBMLAl+xWPtFw6ICsN3wg=="
3481
+ },
3482
+ {
3483
+ name: "@deepseek-ai/dsh-host-plugin-inventory",
3484
+ version: "0.1.1-rc.2",
3485
+ integrity: "sha512-Hud9ezW0bexWfhX7C+c5rdUDX1xzbEGDzj1lGQyj/QxdrxHYHjGrJq3tLRyvN6K4FSmEdG2IBKdQGCOLVrIthA=="
3486
+ },
3487
+ {
3488
+ name: "dshmarket",
3489
+ version: "1.36.0",
3490
+ integrity: "sha512-xX8CCoXdIALaxtLosj+5qGg8r1cykW2zo1AOPJcSQepg2r4Vd2K0NmERldDqfeyFV0pCuZsUoAPe1Q/BW7De/g=="
3491
+ },
3492
+ {
3493
+ name: "@deepseek-ai/dsh-host-webserver",
3494
+ version: "0.1.1-rc.2",
3495
+ integrity: "sha512-t9MrjC65QHiiWhG9V8UZxgfE/aWYhJHHrIM0kbTvtXxg4tLGIKo/upHp7iiag65F3HTkVLrH/DUyPMi4v2ZA7g=="
3496
+ },
3497
+ {
3498
+ name: "@deepseek-ai/dsh-web-app",
3499
+ version: "0.1.1-rc.2",
3500
+ integrity: "sha512-1zGHY7qwBVlVJrzIWu+86SuBZXaVUxe2JRfffsuRvKXq2QcR/K4CoJJfZ43cDoWKu9xPvvxz7w2ezV+EdXgg1A=="
3501
+ },
3502
+ {
3503
+ name: "@deepseek-ai/dsh-jobs",
3504
+ version: "0.1.1-rc.2",
3505
+ integrity: "sha512-SXvDJMvcUrGrlzIyE7j8/lI4Pj1nDe/UOR8C05Zagp+/0R8p46n6KylySvZdPAFENV5t8WX3Fw3eOaS4No0+wQ=="
3506
+ },
3507
+ {
3508
+ name: "@deepseek-ai/dsh-jobs-local",
3509
+ version: "0.1.1-rc.2",
3510
+ integrity: "sha512-26lg7mi9RKnu8IP8SWLbY+uZenbqF2AkAZvgZaLDlw1z58NtBsbgKgh6FNC8JXEyknAwYc6auQQKF+nLTlEjCw=="
3511
+ },
3512
+ {
3513
+ name: "@deepseek-ai/dsh-tool-jobs",
3514
+ version: "0.1.1-rc.2",
3515
+ integrity: "sha512-wCU7mo2uoQcAtz7de4ZXP2es9lALsmz6XzC+KAlS2e7/yTBi9a5LL2vdSr6XhExVAuhu/6f9eM/w4EQBOxtKlw=="
3516
+ },
3517
+ {
3518
+ name: "@deepseek-ai/dsh-tool-fs",
3519
+ version: "0.1.1-rc.2",
3520
+ integrity: "sha512-llX8AWbaI3CGme/a2eeTSfy5atk8u3iJeOFzmZV/KZ0v0hMhKZIK1xQInWwC9OmSDJ/StStJe0hDPVLWbB7hVg=="
3521
+ },
3522
+ {
3523
+ name: "@deepseek-ai/dsh-fs",
3524
+ version: "0.1.1-rc.2",
3525
+ integrity: "sha512-8j+6MffvCHATLQrhAVfc9rKyunKu/O7mjjJzmdsUSdID7V4iUYMwqPamhlAyI+tfohZu/vcforKzCRIZGmCYug=="
3526
+ },
3527
+ {
3528
+ name: "@deepseek-ai/dsh-fs-local",
3529
+ version: "0.1.1-rc.2",
3530
+ integrity: "sha512-jvn1MsAMqCmt5SjRNkPjmpc+RIWrZQrBVtf/OpmKr2PaBEGqSbCkPApWDE9iSMhcuQg6k5evScOXwAsduzKOLA=="
3531
+ },
3532
+ {
3533
+ name: "@deepseek-ai/dsh-fs-sandbox",
3534
+ version: "0.1.1-rc.2",
3535
+ integrity: "sha512-PI65uLZ3ARkfVV/PXvACS1HEXggoOaXgYQzXQFdLOfm7AiHOdZWZccUAXBetpZhcNYIOKsVoLnfZkXcHByqecQ=="
3536
+ },
3537
+ {
3538
+ name: "@deepseek-ai/dsh-fs-observation-policy",
3539
+ version: "0.1.1-rc.2",
3540
+ integrity: "sha512-rlq7yu4xavkKK1Oa1/aNCOeUW7t/3OXJJOfOcZXuUgJn5f8G0AbpTDpp2CeuL1cHlKpbunGhEkKQ2N/dv7ZR9w=="
3541
+ },
3542
+ {
3543
+ name: "@deepseek-ai/dsh-sandbox",
3544
+ version: "0.1.1-rc.2",
3545
+ integrity: "sha512-rnO2RqZ+ycpwrXrXlMcrhWAICdui3ZVTjNQ8eZrOPE18hAbX3tw0nLFq26sBjMSnBfDQHNZ4VaFpt0p8qhkPWQ=="
3546
+ },
3547
+ {
3548
+ name: "@deepseek-ai/dsh-sandbox-policy",
3549
+ version: "0.1.1-rc.2",
3550
+ integrity: "sha512-cpoIUxCzpZJDTMXVt9gS+qgWEDAWf6rIe715uY1NF0ROoiEXPlmToLsHLF+4pXTW3wWWzpGVswO0bPYEKrQr3g=="
3551
+ },
3552
+ {
3553
+ name: "@deepseek-ai/dsh-user-approval",
3554
+ version: "0.1.1-rc.2",
3555
+ integrity: "sha512-SdsO4Rs+NeJFoertkVilXBACREOLfkKPJJznYKqDhJxeRo38RJ56dtj0Xd0/6rERmsQiMck4Bwdrzg1ubUqPNA=="
3556
+ },
3557
+ {
3558
+ name: "@deepseek-ai/dsh-attachment",
3559
+ version: "0.1.1-rc.2",
3560
+ integrity: "sha512-rCYAt8QsawP1yfDCU7XxNwYT/XWvyFsxYrkwhLLkdfW83QVD0CQHizSkTQE7RFX74nKUD1z3sTLfnLr7xneArw=="
3561
+ },
3562
+ {
3563
+ name: "@deepseek-ai/dsh-system-prompt",
3564
+ version: "0.1.1-rc.2",
3565
+ integrity: "sha512-on4hjAlYI5uX9q7Sf95YkMMBVe6heywtA/H50ksrIMUub8U2B98hO9iQpHhjwIO1F1vu+5pLcPvRr6yUGGmtXQ=="
3566
+ }
3567
+ ]),
3568
+ defineCohort("dsh-0.1.2-alpha.2", ["0.1.2-alpha.2"], ["posix", "windows"], ALPHA2_HOST_PACKAGES),
3569
+ defineCohort("dsh-0.1.2-alpha.2-dshmarket-1.39.0", ["0.1.2-alpha.2"], ["posix", "windows"], ALPHA2_DSHMARKET_139_HOST_PACKAGES),
3570
+ defineCohort("dsh-0.1.2-alpha.3", ["0.1.2-alpha.3"], ["posix", "windows"], ALPHA3_HOST_PACKAGES)
3571
+ ];
3572
+ /**
3573
+ * rc.2 audited package identities (first registry cohort). The audited
3574
+ * cohort is an atomic whole-graph contract (CG-DSH-001): any drifted,
3575
+ * duplicated, unknown-version, unbound, OR MISSING row fails the whole lock
3576
+ * closed (`host_lock_missing`); no capability inherits independence from a
3577
+ * partially present graph.
3578
+ */
3579
+ const EXPECTED_HOST_PACKAGES = HOST_COHORTS[0].packages;
3173
3580
  const packageNames = (...names) => new Set(names);
3174
3581
  const BASE_HOST_PACKAGES = packageNames("@deepseek-ai/cordis", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-tools");
3175
3582
  const GOAL_HOST_PACKAGES = packageNames("@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-tool-goal");
@@ -3183,20 +3590,80 @@ const HOST_CAPABILITY_PACKAGE_GROUPS = {
3183
3590
  jobs: packageNames("@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-tool-jobs"),
3184
3591
  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")
3185
3592
  };
3593
+ /**
3594
+ * Atomically select the audited cohort for one supplied package graph. A
3595
+ * graph matches a cohort only when every row carries version and integrity,
3596
+ * each exactly equals that cohort's audited row, and the graph covers the
3597
+ * complete audited cohort (missing packages fail closed); graphs that mix
3598
+ * rows from different cohorts, use versions unknown to the registry, or
3599
+ * target a platform the cohort was never audited on never select
3600
+ * consistently.
3601
+ */
3602
+ function selectHostCohort(rows, platform) {
3603
+ const registryNames = new Set(HOST_COHORTS.flatMap((cohort) => cohort.packages.map((row) => row.name)));
3604
+ if (rows.some((row) => !registryNames.has(row.name))) return {
3605
+ cohort: HOST_COHORTS[0],
3606
+ consistent: false,
3607
+ reasonCode: "host_cohort_unknown_package"
3608
+ };
3609
+ if (rows.length === 0) return {
3610
+ cohort: HOST_COHORTS[0],
3611
+ consistent: false,
3612
+ reasonCode: "host_cohort_unbound_identity"
3613
+ };
3614
+ const bound = rows.filter((row) => row.version !== void 0 && row.integrity !== void 0);
3615
+ const unboundCount = rows.length - bound.length;
3616
+ const versionMatches = bound.map((row) => HOST_COHORTS.filter((cohort) => cohort.packages.some((p) => p.name === row.name && p.version === row.version)));
3617
+ 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)));
3618
+ const consistentCohort = HOST_COHORTS.find((cohort) => identityMatches.every((matches) => matches.includes(cohort)));
3619
+ if (consistentCohort !== void 0 && unboundCount === 0) {
3620
+ if (platform && !consistentCohort.auditedPlatforms.includes(platform)) return {
3621
+ cohort: consistentCohort,
3622
+ consistent: false,
3623
+ reasonCode: "host_cohort_platform_not_audited"
3624
+ };
3625
+ const suppliedCounts = /* @__PURE__ */ new Map();
3626
+ for (const row of rows) suppliedCounts.set(row.name, (suppliedCounts.get(row.name) ?? 0) + 1);
3627
+ if (!(consistentCohort.packages.every((row) => (suppliedCounts.get(row.name) ?? 0) === 1) && rows.length === consistentCohort.packages.length)) return {
3628
+ cohort: consistentCohort,
3629
+ consistent: false,
3630
+ reasonCode: "host_cohort_incomplete_graph"
3631
+ };
3632
+ return {
3633
+ cohort: consistentCohort,
3634
+ consistent: true
3635
+ };
3636
+ }
3637
+ const matchingIndices = identityMatches.flatMap((matches, index) => matches.length > 0 ? [index] : []);
3638
+ const mixtureCovered = HOST_COHORTS.filter((cohort) => matchingIndices.every((index) => identityMatches[index].includes(cohort)));
3639
+ let reasonCode;
3640
+ if (matchingIndices.length > 0 && mixtureCovered.length === 0) reasonCode = "host_cohort_mixed_graph";
3641
+ else if (bound.length > 0 && versionMatches.some((matches) => matches.length === 0)) reasonCode = "host_cohort_version_mismatch";
3642
+ else if (bound.length > 0 && identityMatches.some((matches) => matches.length === 0)) reasonCode = "host_cohort_integrity_mismatch";
3643
+ else reasonCode = "host_cohort_unbound_identity";
3644
+ return {
3645
+ cohort: [...HOST_COHORTS].sort((a, b) => {
3646
+ const scoreOf = (cohort) => identityMatches.filter((matches) => matches.includes(cohort)).length;
3647
+ return scoreOf(b) - scoreOf(a) || HOST_COHORTS.indexOf(a) - HOST_COHORTS.indexOf(b);
3648
+ })[0],
3649
+ consistent: false,
3650
+ reasonCode
3651
+ };
3652
+ }
3186
3653
  function stableRows(rows) {
3187
3654
  return [...rows].map((row) => ({ ...row })).sort((a, b) => a.name.localeCompare(b.name) || (a.version ?? "").localeCompare(b.version ?? "") || (a.integrity ?? "").localeCompare(b.integrity ?? ""));
3188
3655
  }
3189
- function statusForPackages(id, rows, requiredNames) {
3656
+ function statusForPackages(id, rows, requiredNames, cohort) {
3190
3657
  const requiredPackages = [...requiredNames].sort();
3191
3658
  const relevant = rows.filter((row) => requiredNames.has(row.name));
3192
3659
  const counts = /* @__PURE__ */ new Map();
3193
3660
  for (const row of relevant) counts.set(row.name, (counts.get(row.name) ?? 0) + 1);
3194
3661
  const missingPackages = requiredPackages.filter((name) => !counts.has(name));
3195
- const digest = safeHostLockDigest(relevant, { capabilityId: id });
3662
+ const digest$1 = safeHostLockDigest(relevant, { capabilityId: id }, cohort);
3196
3663
  if ([...counts.values()].some((count) => count > 1)) return {
3197
3664
  id,
3198
3665
  status: "unavailable",
3199
- digest,
3666
+ digest: digest$1,
3200
3667
  requiredPackages,
3201
3668
  missingPackages,
3202
3669
  reasonCode: "host_capability_duplicate_package"
@@ -3204,18 +3671,18 @@ function statusForPackages(id, rows, requiredNames) {
3204
3671
  if (missingPackages.length > 0) return {
3205
3672
  id,
3206
3673
  status: "unavailable",
3207
- digest,
3674
+ digest: digest$1,
3208
3675
  requiredPackages,
3209
3676
  missingPackages,
3210
3677
  reasonCode: "host_capability_missing"
3211
3678
  };
3212
- const expected = new Map(EXPECTED_HOST_PACKAGES.map((row) => [row.name, row]));
3679
+ const expected = new Map(cohort.packages.map((row) => [row.name, row]));
3213
3680
  for (const row of relevant) {
3214
3681
  const pinned = expected.get(row.name);
3215
3682
  if (!row.version || !row.integrity) return {
3216
3683
  id,
3217
3684
  status: "unavailable",
3218
- digest,
3685
+ digest: digest$1,
3219
3686
  requiredPackages,
3220
3687
  missingPackages,
3221
3688
  reasonCode: "host_capability_missing"
@@ -3223,7 +3690,7 @@ function statusForPackages(id, rows, requiredNames) {
3223
3690
  if (row.version !== pinned.version) return {
3224
3691
  id,
3225
3692
  status: "unsupported",
3226
- digest,
3693
+ digest: digest$1,
3227
3694
  requiredPackages,
3228
3695
  missingPackages,
3229
3696
  reasonCode: "host_capability_version_mismatch"
@@ -3231,7 +3698,7 @@ function statusForPackages(id, rows, requiredNames) {
3231
3698
  if (row.integrity !== pinned.integrity) return {
3232
3699
  id,
3233
3700
  status: "unsupported",
3234
- digest,
3701
+ digest: digest$1,
3235
3702
  requiredPackages,
3236
3703
  missingPackages,
3237
3704
  reasonCode: "host_capability_integrity_mismatch"
@@ -3240,32 +3707,38 @@ function statusForPackages(id, rows, requiredNames) {
3240
3707
  return {
3241
3708
  id,
3242
3709
  status: "supported",
3243
- digest,
3710
+ digest: digest$1,
3244
3711
  requiredPackages,
3245
3712
  missingPackages
3246
3713
  };
3247
3714
  }
3248
- function capabilityEvaluations(rows) {
3249
- return Object.fromEntries(Object.entries(HOST_CAPABILITY_PACKAGE_GROUPS).map(([id, packages]) => [id, statusForPackages(id, rows, packages)]));
3715
+ function capabilityEvaluations(rows, cohort) {
3716
+ return Object.fromEntries(Object.entries(HOST_CAPABILITY_PACKAGE_GROUPS).map(([id, packages]) => [id, statusForPackages(id, rows, packages, cohort)]));
3717
+ }
3718
+ function cohortForEvaluation(evaluation) {
3719
+ return HOST_COHORTS.find((cohort) => cohort.id === evaluation.cohortId) ?? HOST_COHORTS[0];
3250
3720
  }
3251
3721
  function evaluateHostLock(rows, context = {}) {
3252
3722
  const supplied = stableRows(rows);
3253
- const capabilities = capabilityEvaluations(supplied);
3723
+ const selection = selectHostCohort(supplied, context.platform);
3724
+ const cohort = selection.cohort;
3725
+ const capabilities = capabilityEvaluations(supplied, cohort);
3254
3726
  const counts = /* @__PURE__ */ new Map();
3255
3727
  for (const row of supplied) counts.set(row.name, (counts.get(row.name) ?? 0) + 1);
3256
3728
  const goalRows = [...GOAL_HOST_PACKAGES].filter((name) => counts.has(name));
3257
3729
  const goalAvailable = goalRows.length === GOAL_HOST_PACKAGES.size;
3258
- const digest = safeHostLockDigest(supplied, context);
3259
- const base = statusForPackages("base", supplied, BASE_HOST_PACKAGES);
3260
- const baseDuplicate = supplied.find((row) => BASE_HOST_PACKAGES.has(row.name) && (counts.get(row.name) ?? 0) > 1);
3261
- const goalDuplicate = supplied.find((row) => GOAL_HOST_PACKAGES.has(row.name) && (counts.get(row.name) ?? 0) > 1);
3262
- const expectedNames = new Set(EXPECTED_HOST_PACKAGES.map((row) => row.name));
3263
- const unknown = supplied.find((row) => !expectedNames.has(row.name));
3730
+ const digest$1 = safeHostLockDigest(supplied, context, cohort);
3731
+ const base = statusForPackages("base", supplied, BASE_HOST_PACKAGES, cohort);
3732
+ const missingPackages = cohort.packages.map((row) => row.name).filter((name) => (counts.get(name) ?? 0) === 0).sort((a, b) => a.localeCompare(b));
3733
+ const registryNames = new Set(HOST_COHORTS.flatMap((entry) => entry.packages.map((row) => row.name)));
3734
+ const unknown = supplied.find((row) => !registryNames.has(row.name));
3264
3735
  const baseResult = {
3265
- digest,
3736
+ digest: digest$1,
3266
3737
  goalAvailable,
3267
3738
  packages: supplied,
3268
3739
  capabilities,
3740
+ cohortId: cohort.id,
3741
+ missingPackages,
3269
3742
  ...context.platform ? { platform: context.platform } : {},
3270
3743
  ...context.profileKind ? { profileKind: context.profileKind } : {}
3271
3744
  };
@@ -3274,7 +3747,7 @@ function evaluateHostLock(rows, context = {}) {
3274
3747
  status: "unsupported",
3275
3748
  reasonCode: "host_lock_unknown_package"
3276
3749
  };
3277
- if (baseDuplicate || goalDuplicate) return {
3750
+ if (supplied.some((row) => (counts.get(row.name) ?? 0) > 1)) return {
3278
3751
  ...baseResult,
3279
3752
  status: "unavailable",
3280
3753
  goalAvailable: false,
@@ -3295,7 +3768,7 @@ function evaluateHostLock(rows, context = {}) {
3295
3768
  };
3296
3769
  }
3297
3770
  if (goalAvailable) {
3298
- const goal = statusForPackages("goal", supplied, GOAL_HOST_PACKAGES);
3771
+ const goal = statusForPackages("goal", supplied, GOAL_HOST_PACKAGES, cohort);
3299
3772
  if (goal.status !== "supported") return {
3300
3773
  ...baseResult,
3301
3774
  status: goal.status,
@@ -3303,6 +3776,44 @@ function evaluateHostLock(rows, context = {}) {
3303
3776
  reasonCode: goal.reasonCode === "host_capability_version_mismatch" ? "host_lock_version_mismatch" : goal.reasonCode === "host_capability_integrity_mismatch" ? "host_lock_integrity_mismatch" : "host_lock_missing"
3304
3777
  };
3305
3778
  }
3779
+ if (!selection.consistent) {
3780
+ const failure = {
3781
+ host_cohort_unknown_package: {
3782
+ status: "unsupported",
3783
+ reasonCode: "host_lock_unknown_package"
3784
+ },
3785
+ host_cohort_version_mismatch: {
3786
+ status: "unsupported",
3787
+ reasonCode: "host_lock_version_mismatch"
3788
+ },
3789
+ host_cohort_integrity_mismatch: {
3790
+ status: "unsupported",
3791
+ reasonCode: "host_lock_integrity_mismatch"
3792
+ },
3793
+ host_cohort_mixed_graph: {
3794
+ status: "unsupported",
3795
+ reasonCode: "host_lock_cohort_mixed_graph"
3796
+ },
3797
+ host_cohort_incomplete_graph: {
3798
+ status: "unavailable",
3799
+ reasonCode: "host_lock_missing"
3800
+ },
3801
+ host_cohort_unbound_identity: {
3802
+ status: "unsupported",
3803
+ reasonCode: "host_lock_cohort_unbound_identity"
3804
+ },
3805
+ host_cohort_platform_not_audited: {
3806
+ status: "unsupported",
3807
+ reasonCode: "host_lock_cohort_platform_not_audited"
3808
+ }
3809
+ }[selection.reasonCode ?? "host_cohort_unbound_identity"];
3810
+ return {
3811
+ ...baseResult,
3812
+ status: failure.status,
3813
+ goalAvailable: false,
3814
+ reasonCode: failure.reasonCode
3815
+ };
3816
+ }
3306
3817
  return {
3307
3818
  ...baseResult,
3308
3819
  status: "supported"
@@ -3351,7 +3862,7 @@ function evaluateHostCapability(evaluation, request) {
3351
3862
  };
3352
3863
  const required = new Set(BASE_HOST_PACKAGES);
3353
3864
  for (const group of groups) for (const name of HOST_CAPABILITY_PACKAGE_GROUPS[group]) required.add(name);
3354
- const result = statusForPackages(`action.${request.action}.${platform ?? "native"}.${profileKind ?? "unknown"}`, evaluation.packages, required);
3865
+ const result = statusForPackages(`action.${request.action}.${platform ?? "native"}.${profileKind ?? "unknown"}`, evaluation.packages, required, cohortForEvaluation(evaluation));
3355
3866
  if (evaluation.status !== "supported") return {
3356
3867
  ...result,
3357
3868
  status: evaluation.status,
@@ -3368,7 +3879,7 @@ function evaluateHostCapability(evaluation, request) {
3368
3879
  function evaluateExternalWaitCapability(evaluation) {
3369
3880
  const required = new Set(BASE_HOST_PACKAGES);
3370
3881
  for (const name of HOST_CAPABILITY_PACKAGE_GROUPS.jobs) required.add(name);
3371
- const result = statusForPackages("boundary.external_wait.jobs", evaluation.packages, required);
3882
+ const result = statusForPackages("boundary.external_wait.jobs", evaluation.packages, required, cohortForEvaluation(evaluation));
3372
3883
  if (evaluation.status !== "supported") return {
3373
3884
  ...result,
3374
3885
  status: evaluation.status,
@@ -3406,7 +3917,7 @@ function evaluateToolSurfaceCapability(evaluation, surface) {
3406
3917
  if (surface === "pwsh") groups.push("terminal_windows");
3407
3918
  const required = new Set(BASE_HOST_PACKAGES);
3408
3919
  for (const group of groups) for (const name of HOST_CAPABILITY_PACKAGE_GROUPS[group]) required.add(name);
3409
- const result = statusForPackages(`tool.${surface}.${platform ?? "native"}`, evaluation.packages, required);
3920
+ const result = statusForPackages(`tool.${surface}.${platform ?? "native"}`, evaluation.packages, required, cohortForEvaluation(evaluation));
3410
3921
  if (evaluation.status !== "supported") return {
3411
3922
  ...result,
3412
3923
  status: evaluation.status,
@@ -3414,10 +3925,10 @@ function evaluateToolSurfaceCapability(evaluation, surface) {
3414
3925
  };
3415
3926
  return result;
3416
3927
  }
3417
- function safeHostLockDigest(packages, context = {}) {
3928
+ function safeHostLockDigest(packages, context = {}, cohort) {
3418
3929
  try {
3419
3930
  const capabilities = [
3420
- ...SUPPORTED_HOST_MANIFEST.capabilities ?? [],
3931
+ ...cohort.capabilities,
3421
3932
  ...context.platform ? [{
3422
3933
  name: "active_platform",
3423
3934
  value: {
@@ -3441,7 +3952,8 @@ function safeHostLockDigest(packages, context = {}) {
3441
3952
  }] : []
3442
3953
  ];
3443
3954
  return hostLockDigest({
3444
- ...SUPPORTED_HOST_MANIFEST,
3955
+ manifestVersion: cohort.manifestVersion,
3956
+ supportedGoalVersions: [...cohort.supportedGoalVersions],
3445
3957
  capabilities,
3446
3958
  packages: [...packages]
3447
3959
  });
@@ -3514,7 +4026,7 @@ function bindExecutableIdentity(resolution, effect) {
3514
4026
  identity: { ...resolution }
3515
4027
  };
3516
4028
  }
3517
- const DEFAULT_HOST_LOCK = evaluateHostLock(EXPECTED_HOST_PACKAGES.filter((row) => BASE_HOST_PACKAGES.has(row.name)));
4029
+ const DEFAULT_HOST_LOCK = evaluateHostLock(EXPECTED_HOST_PACKAGES);
3518
4030
 
3519
4031
  //#endregion
3520
4032
  //#region src/domain/goal-gate.ts
@@ -4179,9 +4691,9 @@ function resolveCommandPath(reference, cwd) {
4179
4691
  if (/^[A-Za-z]:[\\/]/.test(reference) || reference.startsWith("//") || reference.startsWith("\\\\") || reference.startsWith("/") || reference.startsWith("\\")) return reference;
4180
4692
  return `${cwd.replace(/[\\/]+$/, "")}/${reference}`;
4181
4693
  }
4182
- function stable(value) {
4183
- if (Array.isArray(value)) return `[${value.map(stable).join(",")}]`;
4184
- if (value && typeof value === "object") return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stable(entry)}`).join(",")}}`;
4694
+ function stable$1(value) {
4695
+ if (Array.isArray(value)) return `[${value.map(stable$1).join(",")}]`;
4696
+ if (value && typeof value === "object") return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stable$1(entry)}`).join(",")}}`;
4185
4697
  return JSON.stringify(value);
4186
4698
  }
4187
4699
  function structuredGuardMeta(meta, toolName) {
@@ -4196,7 +4708,7 @@ function structuredGuardMeta(meta, toolName) {
4196
4708
  const rawExpected = asRecord$1(value.expectedTransition);
4197
4709
  const expectedParameters = asRecord$1(rawExpected?.parameters);
4198
4710
  const expectedDigest = value.expectedTransitionDigest;
4199
- const expectedTransition = rawExpected && typeof rawExpected.predicateId === "string" && rawExpected.version === 1 && rawExpected.predParamsKind === "inline" && expectedParameters && typeof expectedDigest === "string" && expectedDigest === sha256(stable(rawExpected)) ? rawExpected : void 0;
4711
+ const expectedTransition = rawExpected && typeof rawExpected.predicateId === "string" && rawExpected.version === 1 && rawExpected.predParamsKind === "inline" && expectedParameters && typeof expectedDigest === "string" && expectedDigest === sha256(stable$1(rawExpected)) ? rawExpected : void 0;
4200
4712
  if (typeof value.adapterId !== "string" || typeof value.adapterVersion !== "string") return void 0;
4201
4713
  if (SUPPORTED_EVIDENCE_ADAPTERS[value.adapterId] !== value.adapterVersion) return void 0;
4202
4714
  if (typeof action !== "string" || typeof role !== "string" || !resolved) return void 0;
@@ -4802,6 +5314,7 @@ function deriveProjection(sourceEvents, config, scope, durableConfirmed, hostLoc
4802
5314
  projection.hostLockDigest = hostLock.digest;
4803
5315
  projection.hostStatus = hostLock.status;
4804
5316
  projection.hostReasonCode = hostLock.reasonCode;
5317
+ projection.hostCohortId = hostLock.cohortId;
4805
5318
  let enabled = config.activation === "always";
4806
5319
  let epoch = 0;
4807
5320
  let evidenceCounter = 0;
@@ -5459,7 +5972,8 @@ async function executeRevalidatedGitEffect(resolved, manifest, target, currentSt
5459
5972
 
5460
5973
  //#endregion
5461
5974
  //#region src/domain/host-resolver.ts
5462
- const CRITICAL_NAMES = EXPECTED_HOST_PACKAGES.map((row) => row.name);
5975
+ /** Names audited in any registered cohort; rows outside the union are unknown. */
5976
+ const CRITICAL_NAMES = [...new Set(HOST_COHORTS.flatMap((cohort) => cohort.packages.map((row) => row.name)))];
5463
5977
  const HOST_LOCK_MARKER_BEGIN = "# >>> BEGIN DSH COMPLETION GUARD HOST LOCK (managed) >>>";
5464
5978
  const HOST_LOCK_MARKER_END = "# <<< END DSH COMPLETION GUARD HOST LOCK (managed) <<<";
5465
5979
  var HostProfileError = class extends Error {
@@ -5825,4 +6339,214 @@ function verifyComposedHostLockDump(text, expected) {
5825
6339
  }
5826
6340
 
5827
6341
  //#endregion
5828
- export { classifyUserInteraction as $, extractToolSubject as A, STOP_PROTOCOL_VERSION as At, DEFAULT_HOST_LOCK as B, COMMAND_SURFACE_MANIFEST as Bt, latestAssistantText as C, canonicalRegistryBase as Ct, supersedeItem as D, CERTIFICATE_VERSION as Dt, deriveProjection as E, ACTION_MANIFEST_VERSION as Et, parsePwshCommand as F, requestedTargetMatchesResolved as Ft, bindExecutableIdentity as G, sanitizeClauseText as Gt, GOAL_HOST_PACKAGES as H, canonicalizePath as Ht, parseShellCommand as I, semanticActionFromCommand as It, evaluateHostCapability as J, createProjection as Jt, bindLiveGoalCapability as K, sanitizeUrl as Kt, goalCompletionDenial as L, semanticActionFromText as Lt, withDurability as M, actionCompatible as Mt, canonicalArgvFromCommand as N, isStatefulAction as Nt, evidenceFromPersistedToolResult as O, SEMANTIC_ACTIONS as Ot, isRunExecutable as P, requestedTargetAuthorizesMutation as Pt, segmentAuthorityBlocks as Q, hasCurrentCertificate as R, validateActionManifest as Rt, isWholeTaskCompletionClaim as S, segmentClauses as St, PROTOCOL_V3_NOTICE as T, ACTION_MANIFEST as Tt, HOST_CAPABILITY_PACKAGE_GROUPS as U, digestStrings as Ut, EXPECTED_HOST_PACKAGES as V, validateManifest as Vt, SUPPORTED_HOST_MANIFEST as W, normalizeClause as Wt, evaluateToolSurfaceCapability as X, evaluateHostLock as Y, authorityCaptureCounts as Z, revalidateGitPrestate as _, classifyClause as _t, packageRowsFromActiveGraph as a, DEFAULT_RECOVERY_CHAR_BUDGET as at, decideTurnBoundary as b, extractOperation as bt, resolveInstalledHostLock as c, recoveryDigest as ct, commitIndexSnapshotDigest as d, evidenceCoverage as dt, availableBoundaryQualifications as et, commitTreeSnapshotDigest as f, evidenceMatchesItem as ft, parseGitCommandManifest as g, captureItem as gt, gitCommandMatchesTarget as h, captureClause as ht, injectActiveProfileHostLock as i, certifyCheckpoint as it, isDeterministicCheck as j, SUPPORTED_EVIDENCE_ADAPTERS as jt, extractTextContent as k, STATEFUL_ACTIONS as kt, verifyComposedHostLockDump as l, renderRecoveryPacket as lt, executeRevalidatedGitEffect as m, currentContractDigest as mt, hostLockContextFromComposedDump as n, isCurrentAcceptedBoundary as nt, packageRowsFromPnpmLock as o, closingHint as ot, createGitPrestateEnvelope as p, isVerifyingCapability as pt, evaluateExternalWaitCapability as q, sha256 as qt, hostLockRowsFromComposedDump as r, qualifyBoundary as rt, resolveActiveProfileHostLock as s, openItems$1 as st, HostProfileError as t, effectuateBoundary as tt, GIT_COMMAND_MANIFEST_IDS as u, bindingSatisfies as ut, verifiedLinearCommitReadback as v, extractArtifactPaths as vt, observeAssistantOutcome as w, npmEscapedPackageName as wt, decideTurnStopping as x, isInformationalMessage as xt, classifyCompletionClaim as y, extractMethod as yt, BASE_HOST_PACKAGES as z, validateActionTarget as zt };
6342
+ //#region src/domain/proof.ts
6343
+ const PROOF_PROTOCOL_VERSION = "0.4.0";
6344
+ const PROOF_KINDS = [
6345
+ "subject_readback",
6346
+ "scope_coverage",
6347
+ "state_verification"
6348
+ ];
6349
+ function stable(value) {
6350
+ if (Array.isArray(value)) return `[${value.map(stable).join(",")}]`;
6351
+ if (value && typeof value === "object") return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${JSON.stringify(k)}:${stable(v)}`).join(",")}}`;
6352
+ return JSON.stringify(value);
6353
+ }
6354
+ function digest(value) {
6355
+ return createHash("sha256").update("ccg.proofManifest.v1\n", "utf8").update(stable(value), "utf8").digest("hex");
6356
+ }
6357
+ function validDigest(value) {
6358
+ return /^[0-9a-f]{64}$/.test(value);
6359
+ }
6360
+ /**
6361
+ * The manifest digest root includes every integrity-bearing field, so a
6362
+ * tampered asset-set digest is exactly as detectable as a tampered obligation.
6363
+ */
6364
+ function proofDigest(obligations, assetSetSha256) {
6365
+ return digest({
6366
+ proofProtocolVersion: PROOF_PROTOCOL_VERSION,
6367
+ obligations: [...obligations],
6368
+ ...assetSetSha256 !== void 0 ? { assetSetSha256 } : {}
6369
+ });
6370
+ }
6371
+ function validateProofManifest(manifest) {
6372
+ const errors = [];
6373
+ if (!manifest || typeof manifest !== "object") return ["proof_manifest_invalid"];
6374
+ const value = manifest;
6375
+ if (value.proofProtocolVersion !== PROOF_PROTOCOL_VERSION) errors.push("proof_protocol_version_mismatch");
6376
+ if (!Array.isArray(value.obligations)) errors.push("proof_obligations_missing");
6377
+ if (value.assetSetSha256 !== void 0 && (typeof value.assetSetSha256 !== "string" || !validDigest(value.assetSetSha256))) errors.push("proof_asset_set_digest_invalid");
6378
+ if (typeof value.proofSha256 !== "string" || !validDigest(value.proofSha256)) errors.push("proof_digest_invalid");
6379
+ const obligations = Array.isArray(value.obligations) ? value.obligations : [];
6380
+ const ids = /* @__PURE__ */ new Set();
6381
+ for (const raw of obligations) {
6382
+ if (!raw || typeof raw !== "object") {
6383
+ errors.push("proof_obligation_invalid");
6384
+ continue;
6385
+ }
6386
+ const obligation = raw;
6387
+ if (typeof obligation.obligationId !== "string" || ids.has(obligation.obligationId)) errors.push("proof_obligation_id_duplicate_or_invalid");
6388
+ if (typeof obligation.obligationId === "string") ids.add(obligation.obligationId);
6389
+ if (!PROOF_KINDS.includes(obligation.kind)) errors.push("proof_kind_unsupported");
6390
+ if (![
6391
+ "artifact",
6392
+ "ui",
6393
+ "visual",
6394
+ "scope"
6395
+ ].includes(String(obligation.surface))) errors.push("proof_surface_unsupported");
6396
+ if (!Array.isArray(obligation.subjectIds) || obligation.subjectIds.length === 0 || obligation.subjectIds.some((id) => typeof id !== "string" || id.startsWith("codex:unsupported/"))) errors.push("proof_subject_invalid");
6397
+ if (!Array.isArray(obligation.evidenceIds) || obligation.evidenceIds.length === 0 || new Set(obligation.evidenceIds).size !== obligation.evidenceIds.length) errors.push("proof_evidence_invalid");
6398
+ const expected = obligation.expectedScopeDigest;
6399
+ const observed = obligation.observedScopeDigest;
6400
+ for (const digestValue of [expected, observed]) if (digestValue !== void 0 && (typeof digestValue !== "string" || !validDigest(digestValue))) errors.push("proof_scope_digest_invalid");
6401
+ if (expected !== void 0 && observed !== expected) errors.push("proof_scope_digest_mismatch");
6402
+ if (expected === void 0 && observed !== void 0) errors.push("proof_scope_digest_mismatch");
6403
+ }
6404
+ if (errors.length === 0) {
6405
+ const assetSet = typeof value.assetSetSha256 === "string" ? value.assetSetSha256 : void 0;
6406
+ if (value.proofSha256 !== proofDigest(obligations, assetSet)) errors.push("proof_digest_mismatch");
6407
+ }
6408
+ return [...new Set(errors)];
6409
+ }
6410
+ function createProofManifest(obligations, assetSetSha256) {
6411
+ const normalized = obligations.map((obligation) => ({
6412
+ obligationId: obligation.obligationId,
6413
+ kind: obligation.kind,
6414
+ surface: obligation.surface,
6415
+ subjectIds: [...obligation.subjectIds].sort(),
6416
+ evidenceIds: [...obligation.evidenceIds].sort(),
6417
+ ...obligation.expectedScopeDigest ? { expectedScopeDigest: obligation.expectedScopeDigest } : {},
6418
+ ...obligation.observedScopeDigest ? { observedScopeDigest: obligation.observedScopeDigest } : {}
6419
+ })).sort((a, b) => a.obligationId.localeCompare(b.obligationId));
6420
+ const manifest = {
6421
+ proofProtocolVersion: PROOF_PROTOCOL_VERSION,
6422
+ obligations: normalized,
6423
+ ...assetSetSha256 !== void 0 ? { assetSetSha256 } : {},
6424
+ proofSha256: proofDigest(normalized, assetSetSha256)
6425
+ };
6426
+ const errors = validateProofManifest(manifest);
6427
+ if (errors.length) throw new Error(`proof manifest rejected: ${errors.join(",")}`);
6428
+ return manifest;
6429
+ }
6430
+ /**
6431
+ * Bind a structurally valid proof to the actual replayed projection: every
6432
+ * obligation must name a pending item, every evidence id must exist in the
6433
+ * projection, and every bound evidence must satisfy the obligation's kind,
6434
+ * surface, subject, and outcome constraints. An empty projection therefore
6435
+ * rejects any proof, and cross-item or foreign evidence can never bind.
6436
+ */
6437
+ function bindProofToProjection(projection, proof) {
6438
+ const errors = [];
6439
+ const items = projection.items;
6440
+ const evidence = projection.evidence;
6441
+ for (const obligation of proof.obligations) {
6442
+ const item = items.get(obligation.obligationId);
6443
+ if (!item) {
6444
+ errors.push("proof_obligation_unbound");
6445
+ continue;
6446
+ }
6447
+ if (item.status !== "pending") {
6448
+ errors.push("proof_obligation_not_pending");
6449
+ continue;
6450
+ }
6451
+ if (item.verification.surface !== void 0 && item.verification.surface !== obligation.surface) errors.push("proof_surface_unbound");
6452
+ const seen = /* @__PURE__ */ new Set();
6453
+ for (const evidenceId of obligation.evidenceIds) {
6454
+ const record = evidence.get(evidenceId);
6455
+ if (!record) {
6456
+ errors.push("proof_evidence_unknown");
6457
+ continue;
6458
+ }
6459
+ if (!seen.has(evidenceId)) seen.add(evidenceId);
6460
+ if (record.outcome !== "success") {
6461
+ errors.push("proof_evidence_outcome_invalid");
6462
+ continue;
6463
+ }
6464
+ if (!proofEvidenceConstraints(record, obligation)) errors.push("proof_evidence_constraint_failed");
6465
+ }
6466
+ if (obligation.kind === "scope_coverage") {
6467
+ const itemScope = item.requestedTarget?.scope;
6468
+ const itemSubject = item.verification.subject;
6469
+ if (!obligation.subjectIds.every((subject) => subject === itemScope || subject === itemSubject)) errors.push("proof_scope_subject_unbound");
6470
+ }
6471
+ }
6472
+ return [...new Set(errors)];
6473
+ }
6474
+ function canonicalProjection(projection) {
6475
+ return {
6476
+ epoch: projection.epoch,
6477
+ contractRevision: projection.contractRevision,
6478
+ sessionRefDigest: projection.sessionRefDigest,
6479
+ hostLockDigest: projection.hostLockDigest,
6480
+ hostStatus: projection.hostStatus,
6481
+ hostCohortId: projection.hostCohortId,
6482
+ integrity: projection.integrity,
6483
+ items: [...projection.items.values()].map(({ id, revision, kind, status, semanticAction, requestedTarget, verification }) => ({
6484
+ id,
6485
+ revision,
6486
+ kind,
6487
+ status,
6488
+ semanticAction,
6489
+ requestedTarget,
6490
+ verification
6491
+ })).sort((a, b) => a.id.localeCompare(b.id)),
6492
+ evidence: [...projection.evidence.values()].map(({ id, epoch, toolName, outcome, capabilities, subjects, surfaces, operations, semanticAction, evidenceRole, resolvedTarget, observedState }) => ({
6493
+ id,
6494
+ epoch,
6495
+ toolName,
6496
+ outcome,
6497
+ capabilities,
6498
+ subjects,
6499
+ surfaces,
6500
+ operations,
6501
+ semanticAction,
6502
+ evidenceRole,
6503
+ resolvedTarget,
6504
+ observedState
6505
+ })).sort((a, b) => a.id.localeCompare(b.id)),
6506
+ checkpoints: projection.checkpoints.map(({ id, certificationDigest: certificationDigest$1, result }) => ({
6507
+ id,
6508
+ certificationDigest: certificationDigest$1,
6509
+ result
6510
+ }))
6511
+ };
6512
+ }
6513
+ function sessionQuery(projection, proof) {
6514
+ if (proof) {
6515
+ if (validateProofManifest(proof).length) return {
6516
+ sessionRefDigest: projection.sessionRefDigest,
6517
+ epoch: projection.epoch,
6518
+ contractRevision: projection.contractRevision,
6519
+ state: "corrupt",
6520
+ reasonCode: "proof_invalid",
6521
+ cohortId: projection.hostCohortId
6522
+ };
6523
+ if (bindProofToProjection(projection, proof).length) return {
6524
+ sessionRefDigest: projection.sessionRefDigest,
6525
+ epoch: projection.epoch,
6526
+ contractRevision: projection.contractRevision,
6527
+ state: "corrupt",
6528
+ reasonCode: "proof_unbound",
6529
+ cohortId: projection.hostCohortId
6530
+ };
6531
+ }
6532
+ const state = projection.integrity === "valid" ? projection.hostStatus === "supported" ? "valid" : "unknown" : projection.integrity;
6533
+ return {
6534
+ sessionRefDigest: projection.sessionRefDigest,
6535
+ epoch: projection.epoch,
6536
+ contractRevision: projection.contractRevision,
6537
+ state,
6538
+ ...proof ? { proof } : {},
6539
+ cohortId: projection.hostCohortId
6540
+ };
6541
+ }
6542
+ function proofEvidenceConstraints(evidence, obligation) {
6543
+ if (evidence.outcome !== "success" || evidence.surfaces.length !== 1 || evidence.surfaces[0] !== obligation.surface) return false;
6544
+ if (!obligation.subjectIds.every((subject) => evidence.subjects.includes(subject))) return false;
6545
+ if (obligation.kind === "subject_readback" && !(evidence.operations ?? []).some(({ op }) => op === "read" || op === "verify")) return false;
6546
+ if (obligation.kind === "scope_coverage" && !(evidence.operations ?? []).some(({ op }) => op === "run" || op === "verify")) return false;
6547
+ if (obligation.kind === "state_verification" && evidence.evidenceRole !== "state") return false;
6548
+ return true;
6549
+ }
6550
+
6551
+ //#endregion
6552
+ export { GOAL_HOST_PACKAGES as $, COMMAND_SURFACE_MANIFEST as $t, decideTurnStopping as A, classifyClause as At, isDeterministicCheck as B, CERTIFICATE_VERSION as Bt, executeRevalidatedGitEffect as C, bindingSatisfies as Ct, verifiedLinearCommitReadback as D, currentContractDigest as Dt, revalidateGitPrestate as E, isVerifyingCapability as Et, deriveProjection as F, segmentClauses as Ft, parseShellCommand as G, actionCompatible as Gt, canonicalArgvFromCommand as H, STATEFUL_ACTIONS as Ht, supersedeItem as I, canonicalRegistryBase as It, ALPHA2_DSHMARKET_139_HOST_PACKAGES as J, requestedTargetMatchesResolved as Jt, goalCompletionDenial as K, isStatefulAction as Kt, evidenceFromPersistedToolResult as L, npmEscapedPackageName as Lt, latestAssistantText as M, extractMethod as Mt, observeAssistantOutcome as N, extractOperation as Nt, classifyCompletionClaim as O, captureClause as Ot, PROTOCOL_V3_NOTICE as P, isInformationalMessage as Pt, EXPECTED_HOST_PACKAGES as Q, validateActionTarget as Qt, extractTextContent as R, ACTION_MANIFEST as Rt, createGitPrestateEnvelope as S, renderRecoveryPacket as St, parseGitCommandManifest as T, evidenceMatchesItem as Tt, isRunExecutable as U, STOP_PROTOCOL_VERSION as Ut, withDurability as V, SEMANTIC_ACTIONS as Vt, parsePwshCommand as W, SUPPORTED_EVIDENCE_ADAPTERS as Wt, BASE_HOST_PACKAGES as X, semanticActionFromText as Xt, ALPHA2_HOST_PACKAGES as Y, semanticActionFromCommand as Yt, DEFAULT_HOST_LOCK as Z, validateActionManifest as Zt, resolveInstalledHostLock as _, certifyCheckpoint as _t, createProofManifest as a, sanitizeUrl as an, evaluateHostCapability as at, commitIndexSnapshotDigest as b, openItems$1 as bt, sessionQuery as c, selectHostCohort as ct, hostLockContextFromComposedDump as d, segmentAuthorityBlocks as dt, validateManifest as en, HOST_CAPABILITY_PACKAGE_GROUPS as et, hostLockRowsFromComposedDump as f, classifyUserInteraction as ft, resolveActiveProfileHostLock as g, qualifyBoundary as gt, packageRowsFromPnpmLock as h, isCurrentAcceptedBoundary as ht, canonicalProjection as i, sanitizeClauseText as in, evaluateExternalWaitCapability as it, isWholeTaskCompletionClaim as j, extractArtifactPaths as jt, decideTurnBoundary as k, captureItem as kt, validateProofManifest as l, ALPHA3_HOST_PACKAGES as lt, packageRowsFromActiveGraph as m, effectuateBoundary as mt, PROOF_PROTOCOL_VERSION as n, digestStrings as nn, bindExecutableIdentity as nt, proofDigest as o, sha256 as on, evaluateHostLock as ot, injectActiveProfileHostLock as p, availableBoundaryQualifications as pt, hasCurrentCertificate as q, requestedTargetAuthorizesMutation as qt, bindProofToProjection as r, normalizeClause as rn, bindLiveGoalCapability as rt, proofEvidenceConstraints as s, createProjection as sn, evaluateToolSurfaceCapability as st, PROOF_KINDS as t, canonicalizePath as tn, HOST_COHORTS as tt, HostProfileError as u, authorityCaptureCounts as ut, verifyComposedHostLockDump as v, DEFAULT_RECOVERY_CHAR_BUDGET as vt, gitCommandMatchesTarget as w, evidenceCoverage as wt, commitTreeSnapshotDigest as x, recoveryDigest as xt, GIT_COMMAND_MANIFEST_IDS as y, closingHint as yt, extractToolSubject as z, ACTION_MANIFEST_VERSION as zt };