@workit-dev/pi 2.27.2 → 2.27.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/workit.js +8 -8
  2. package/package.json +1 -1
package/dist/workit.js CHANGED
@@ -16722,15 +16722,13 @@ function sessionTrust(cwd, row) {
16722
16722
  const session = row.actor.session;
16723
16723
  if (!session || row.self === true)
16724
16724
  return null;
16725
+ const binding = session.includes(":") ? issuedBinding(cwd, session) : null;
16726
+ if (binding === "token" && row.sessionBound !== true)
16727
+ return "unbound_session";
16725
16728
  const source = typeof row.sessionSource === "string" ? row.sessionSource : "env";
16726
16729
  const host = row.actor.host;
16727
16730
  const issuedOnly = source === "flag" ? host !== "cli" : source === "env" && session.includes(":") && !SHELL_VOUCHED_HOSTS.has(host);
16728
- if (!issuedOnly)
16729
- return null;
16730
- const binding = issuedBinding(cwd, session);
16731
- if (binding === null)
16732
- return "unissued_session";
16733
- return binding === "token" && row.sessionBound !== true ? "unbound_session" : null;
16731
+ return issuedOnly && binding === null ? "unissued_session" : null;
16734
16732
  }
16735
16733
  function trustReasons(cwd, row) {
16736
16734
  if (row.integrity === "unverified")
@@ -29832,11 +29830,13 @@ function currentJudgment(cwd) {
29832
29830
  // packages/workit-core/src/core/verdict-set.ts
29833
29831
  import path44 from "node:path";
29834
29832
  var SET_TTL_MS = 7 * 86400000;
29833
+ var SET_ROW = "verdict.set";
29835
29834
  var SET_VOID = "verdict.set.voided";
29836
29835
  var setStorePath = () => path44.join(resolveStateDir(), "verdicts", "sets", "ledger.jsonl");
29836
+ var distrusted = (cwd, id, rows, type) => rows.some((row) => row.type === type && row.id === id && trustReasons(cwd, row).length > 0);
29837
29837
  function gateStands(cwd, gate, rows, now = Date.now()) {
29838
29838
  const id = typeof gate.verdictId === "string" ? gate.verdictId : null;
29839
- if (id !== null && verdictVoids(rows).has(id))
29839
+ if (id !== null && (verdictVoids(rows).has(id) || distrusted(cwd, id, rows, "verdict")))
29840
29840
  return false;
29841
29841
  if (gate.via !== "set")
29842
29842
  return true;
@@ -29846,7 +29846,7 @@ function gateStands(cwd, gate, rows, now = Date.now()) {
29846
29846
  if (id === null)
29847
29847
  return true;
29848
29848
  const read = readLedgerAt(cwd, setStorePath(), { integrity: true });
29849
- return read.ok && !read.value.rows.some((row) => row.type === SET_VOID && row.target === id && row.integrity === "verified");
29849
+ 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");
29850
29850
  }
29851
29851
 
29852
29852
  // packages/workit-core/src/hooks/stop.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/pi",
3
- "version": "2.27.2",
3
+ "version": "2.27.4",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",