@brainervirus/workit-core 1.0.5 → 1.0.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-core",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "description": "Workit shared core — task, policy, evidence, review, decision, worker, and writer state for agentic coding workflows",
6
6
  "keywords": [
@@ -3,4 +3,4 @@
3
3
  # Launch the published package's MCP bin through npx, never a repo-relative
4
4
  # dist or share clone; a startup/network failure surfaces via npx's nonzero exit.
5
5
  set -euo pipefail
6
- exec npx -y --prefer-online --package=@brainervirus/workit-cursor@latest workit-cursor-mcp "$@"
6
+ exec npx -y --prefer-online --min-release-age=0 --package=@brainervirus/workit-cursor@latest workit-cursor-mcp "$@"
@@ -235,8 +235,9 @@ export const detectCursorLatest = (cursorMcp: string): boolean => {
235
235
  return (
236
236
  server.args[0] === "-y" &&
237
237
  server.args[1] === "--prefer-online" &&
238
- server.args[2] === `--package=${CURSOR_RUNTIME_PACKAGE}` &&
239
- server.args[3] === "workit-cursor-mcp"
238
+ server.args[2] === "--min-release-age=0" &&
239
+ server.args[3] === `--package=${CURSOR_RUNTIME_PACKAGE}` &&
240
+ server.args[4] === "workit-cursor-mcp"
240
241
  );
241
242
  } catch {
242
243
  return false;
@@ -531,7 +531,8 @@ const registeredCursorLauncher = (res: Resolved): CursorLauncher | null | "inval
531
531
  // offline doctor validates its shape (never the registry reachability).
532
532
  // Exact positional tokens — a substring match would accept `@latest-alpha`
533
533
  // or `workit-cursor-mcp-foo`, and any extra/missing token would weaken the
534
- // freshness guarantee (`--prefer-online` is mandatory).
534
+ // freshness guarantee (`--prefer-online` and the npm release-age workaround
535
+ // are mandatory).
535
536
  const canonical = cursorMcpServerEntry("").args;
536
537
  if (executable === "npx" || executable === "npx.exe" || executable === "npx.cmd") {
537
538
  if (args.length !== canonical.length || args.some((a, i) => a !== canonical[i]))
@@ -820,7 +820,7 @@ export const resolveExternalActionRequest = (
820
820
  if (preview.error) return failure("invalid_input", preview.error);
821
821
  const target = String(preview.path);
822
822
  const relative =
823
- path.relative(path.resolve(root), target).replaceAll(path.sep, "/") || "CHANGELOG.md";
823
+ path.relative(fs.realpathSync(root), target).replaceAll(path.sep, "/") || "CHANGELOG.md";
824
824
  const normalized = {
825
825
  operation: request.operation,
826
826
  payload: {
@@ -524,7 +524,7 @@ export async function runAuthorizedExternalAction<T>(
524
524
  (contract.details as Record<string, unknown>).outcome === "not_started";
525
525
  const outcome = input.failureOutcome ?? (preflight ? "not_started" : "unknown");
526
526
  const settled = settleWithRefresh(outcome, settle(outcome));
527
- if (!settled.ok && outcome === "unknown") return settled as ExternalActionResult<T>;
527
+ if (!settled.ok) return settled as ExternalActionResult<T>;
528
528
  return contract;
529
529
  }
530
530
  effectValue = contract.data;
@@ -98,6 +98,9 @@ revisions, policy.assess {assessment: {facts, signals, consequences,
98
98
  verification}} where facts are inferred or observed with file refs,
99
99
  writer.acquire {taskId} before product writes, evidence.record {evidence} where
100
100
  check and review kinds auto-bind the current tree and need no digests. Record
101
+ self-review requirements with kind review and reviewContext matching your own
102
+ host session; the lead may also record checks. Fresh-context review requires a
103
+ session distinct from the task creator and every other evidence recorder. Record
101
104
  verification evidence last: later evidence or commits can reopen fixed findings
102
105
  for re-verification, so verify, resolve, then close with nothing in between.
103
106
  decision.record {binding with taskId/workspaceId from inspect plus presented and
@@ -206,8 +206,8 @@ export function mergeCursorHooks(
206
206
  * Canonical selector for the Cursor npm runtime: `@latest` with `--prefer-online`
207
207
  * (README "Update review"). The single source for every source-derived Cursor
208
208
  * runtime selector; the committed manifests keep the literal (static data
209
- * cannot import TS). `--prefer-online` is mandatory — it forces npx to check
210
- * the registry so a stale cached `latest` resolution is never reused.
209
+ * cannot import TS). `--min-release-age=0` works around npm/cli#9765, where
210
+ * npx ignores the user's scoped release-age exclusion.
211
211
  */
212
212
  export const CURSOR_RUNTIME_PACKAGE = "@brainervirus/workit-cursor@latest";
213
213
 
@@ -215,7 +215,7 @@ export const CURSOR_RUNTIME_PACKAGE = "@brainervirus/workit-cursor@latest";
215
215
  * Canonical Cursor hook launcher (single source of truth for the shipped
216
216
  * hooks-cursor.json, the installer merge, and the doctor drift check).
217
217
  */
218
- export const CURSOR_HOOK_RUN_COMMAND = `npx -y --prefer-online --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-hook`;
218
+ export const CURSOR_HOOK_RUN_COMMAND = `npx -y --prefer-online --min-release-age=0 --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-hook`;
219
219
 
220
220
  /**
221
221
  * preToolUse matcher covering every name the hook's write-tool guard treats
@@ -270,6 +270,7 @@ export function cursorMcpServerEntry(_packageDir: string): {
270
270
  args: [
271
271
  "-y",
272
272
  "--prefer-online",
273
+ "--min-release-age=0",
273
274
  `--package=${CURSOR_RUNTIME_PACKAGE}`,
274
275
  "workit-cursor-mcp",
275
276
  "${workspaceFolder}",
@@ -286,7 +287,7 @@ export function cursorHooksEntry(_packageDir: string): {
286
287
  args: string[];
287
288
  } {
288
289
  return {
289
- command: `npx -y --prefer-online --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-session-start`,
290
+ command: `npx -y --prefer-online --min-release-age=0 --package=${CURSOR_RUNTIME_PACKAGE} workit-cursor-session-start`,
290
291
  args: [],
291
292
  };
292
293
  }
@@ -459,8 +459,7 @@ export function evaluateRequirements(
459
459
  return false;
460
460
  if (requirement.dimension !== "review") return true;
461
461
  const reviewSession = sessionFromRef(entry.data.reviewContext);
462
- const implementationSession = sessionFromRef(task.intent.provenance.session);
463
- const sameImplementation = sameSession(reviewSession, implementationSession);
462
+ const sameImplementation = sameSession(reviewSession, task.intent.provenance.session);
464
463
  const sameEvidenceSession = task.evidence.some(
465
464
  (other) => other.id !== entry.id && sameSession(reviewSession, other.provenance.session),
466
465
  );
@@ -468,8 +467,7 @@ export function evaluateRequirements(
468
467
  entry.data.kind === "review" &&
469
468
  reviewSession !== null &&
470
469
  sameSession(reviewSession, entry.provenance.session) &&
471
- !sameImplementation &&
472
- !sameEvidenceSession
470
+ (requirement.ruleId === "self-review" || (!sameImplementation && !sameEvidenceSession))
473
471
  );
474
472
  });
475
473
  if (passed.length) {