@workit-dev/codex 2.27.2 → 2.27.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "2.27.2",
3
+ "version": "2.27.5",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -16743,6 +16743,11 @@ var HOST_SESSION_VARS = [
16743
16743
  (env) => env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || env.CODEX_ELECTRON_RESOURCES_PATH ? "codex_desktop" : "codex_cli"
16744
16744
  ]
16745
16745
  ];
16746
+ var STAMPING_HOSTS = new Set([
16747
+ "claude_code",
16748
+ "codex_cli",
16749
+ "codex_desktop"
16750
+ ]);
16746
16751
  var family = (host) => host?.replace(/_(?:cli|desktop)$/, "") ?? null;
16747
16752
  function hostSessionFromEnv(env) {
16748
16753
  const value = (key) => env[key]?.trim() || null;
@@ -22633,15 +22638,13 @@ function sessionTrust(cwd, row) {
22633
22638
  const session = row.actor.session;
22634
22639
  if (!session || row.self === true)
22635
22640
  return null;
22641
+ const binding = session.includes(":") ? issuedBinding(cwd, session) : null;
22642
+ if (binding === "token" && row.sessionBound !== true)
22643
+ return "unbound_session";
22636
22644
  const source = typeof row.sessionSource === "string" ? row.sessionSource : "env";
22637
22645
  const host = row.actor.host;
22638
22646
  const issuedOnly = source === "flag" ? host !== "cli" : source === "env" && session.includes(":") && !SHELL_VOUCHED_HOSTS.has(host);
22639
- if (!issuedOnly)
22640
- return null;
22641
- const binding = issuedBinding(cwd, session);
22642
- if (binding === null)
22643
- return "unissued_session";
22644
- return binding === "token" && row.sessionBound !== true ? "unbound_session" : null;
22647
+ return issuedOnly && binding === null ? "unissued_session" : null;
22645
22648
  }
22646
22649
  function trustReasons(cwd, row) {
22647
22650
  if (row.integrity === "unverified")
@@ -10831,6 +10831,11 @@ function verdictDrift(cwd, input) {
10831
10831
  import { createHash as createHash8, randomBytes as randomBytes2, timingSafeEqual } from "node:crypto";
10832
10832
  import fs12 from "node:fs";
10833
10833
  import path16 from "node:path";
10834
+ var STAMPING_HOSTS = new Set([
10835
+ "claude_code",
10836
+ "codex_cli",
10837
+ "codex_desktop"
10838
+ ]);
10834
10839
  var ISSUED_PER_LEAD = 64;
10835
10840
  var ISSUED_SESSIONS_MARKER = "workit-issued-sessions/3";
10836
10841
  var hash = (value) => createHash8("sha256").update(value).digest("hex").slice(0, 32);
@@ -11610,15 +11615,13 @@ function sessionTrust(cwd, row) {
11610
11615
  const session = row.actor.session;
11611
11616
  if (!session || row.self === true)
11612
11617
  return null;
11618
+ const binding = session.includes(":") ? issuedBinding(cwd, session) : null;
11619
+ if (binding === "token" && row.sessionBound !== true)
11620
+ return "unbound_session";
11613
11621
  const source = typeof row.sessionSource === "string" ? row.sessionSource : "env";
11614
11622
  const host = row.actor.host;
11615
11623
  const issuedOnly = source === "flag" ? host !== "cli" : source === "env" && session.includes(":") && !SHELL_VOUCHED_HOSTS.has(host);
11616
- if (!issuedOnly)
11617
- return null;
11618
- const binding = issuedBinding(cwd, session);
11619
- if (binding === null)
11620
- return "unissued_session";
11621
- return binding === "token" && row.sessionBound !== true ? "unbound_session" : null;
11624
+ return issuedOnly && binding === null ? "unissued_session" : null;
11622
11625
  }
11623
11626
  function trustReasons(cwd, row) {
11624
11627
  if (row.integrity === "unverified")
@@ -19965,11 +19968,13 @@ function currentJudgment(cwd) {
19965
19968
  // packages/workit-core/src/core/verdict-set.ts
19966
19969
  import path32 from "node:path";
19967
19970
  var SET_TTL_MS = 7 * 86400000;
19971
+ var SET_ROW = "verdict.set";
19968
19972
  var SET_VOID = "verdict.set.voided";
19969
19973
  var setStorePath = () => path32.join(resolveStateDir(), "verdicts", "sets", "ledger.jsonl");
19974
+ var distrusted = (cwd, id, rows, type) => rows.some((row) => row.type === type && row.id === id && trustReasons(cwd, row).length > 0);
19970
19975
  function gateStands(cwd, gate, rows, now = Date.now()) {
19971
19976
  const id = typeof gate.verdictId === "string" ? gate.verdictId : null;
19972
- if (id !== null && verdictVoids(rows).has(id))
19977
+ if (id !== null && (verdictVoids(rows).has(id) || distrusted(cwd, id, rows, "verdict")))
19973
19978
  return false;
19974
19979
  if (gate.via !== "set")
19975
19980
  return true;
@@ -19979,7 +19984,7 @@ function gateStands(cwd, gate, rows, now = Date.now()) {
19979
19984
  if (id === null)
19980
19985
  return true;
19981
19986
  const read = readLedgerAt(cwd, setStorePath(), { integrity: true });
19982
- return read.ok && !read.value.rows.some((row) => row.type === SET_VOID && row.target === id && row.integrity === "verified");
19987
+ return read.ok && !distrusted(cwd, id, read.value.rows, SET_ROW) && !read.value.rows.some((row) => row.type === SET_VOID && row.target === id && row.integrity === "verified");
19983
19988
  }
19984
19989
 
19985
19990
  // packages/workit-core/src/hooks/stop.ts
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-s4ya8max.js");
104
+ const { runCodexHook } = await import("./workit-hook-f03mbsqh.js");
105
105
  await runCodexHook([payload]);
106
106
  } catch (error) {
107
107
  const { answerRuntimeFailure } = await import("./workit-hook-2j7nwxvz.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "2.27.2",
3
+ "version": "2.27.5",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -41,8 +41,8 @@
41
41
  "build": "bun scripts/build.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@workit-dev/core": "^2.27.2",
45
- "@workit-dev/mcp": "^2.27.2"
44
+ "@workit-dev/core": "^2.27.5",
45
+ "@workit-dev/mcp": "^2.27.5"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"