voidmachine 5.0.0 → 5.0.2

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": "harness",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "VoidCorp universal craftsman skills (void-tdd, void-typescript-strict, void-hexagonal-architecture, void-domain-driven-design, void-functional, void-code-review, void-api-and-interface-design, void-source-driven-development, void-context, void-learn, void-decide, void-claude-md, void-observability, void-security-guidance, ...) plus 12 PreToolUse enforcement hooks (tdd-guard, no-any, protect-sensitive-files, block-dangerous-bash, no-ai-design-slop, ...) and PostToolUse/SessionStart lifecycle hooks (incl. trim-large-output token frugality), five read-only critics including doctrine-critic, native architecture/security/QA specialists, and the void-graph, void-doctor and void-audit gestures, which are skills like everything else.",
5
5
  "author": {
6
6
  "name": "VoidCorp",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "harnessVersion": "5.0.0",
3
+ "harnessVersion": "5.0.2",
4
4
  "capabilities": [
5
5
  {
6
6
  "id": "skill:pack-mobile/void-eas-build-profile",
@@ -7914,7 +7914,7 @@ function projectPath(root, path2) {
7914
7914
  const relativePath = relative(resolve2(root), absolute).replaceAll("\\", "/");
7915
7915
  return relativePath === ".." || relativePath.startsWith("../") || isAbsolute(relativePath) ? void 0 : relativePath;
7916
7916
  }
7917
- function protectedReason(path2, root) {
7917
+ function protectedReason(path2, root, shellWrite) {
7918
7918
  if (root !== void 0) {
7919
7919
  const relativePath = projectPath(root, path2);
7920
7920
  if (relativePath !== void 0 && !isCoOwned(relativePath) && manifestOwnedPaths(root).has(relativePath)) {
@@ -7930,7 +7930,10 @@ function protectedReason(path2, root) {
7930
7930
  return "private key / certificate";
7931
7931
  }
7932
7932
  if (/(?:\.npmrc|\.netrc|\.pgpass)$/.test(base)) return "credential file";
7933
- if (!base.endsWith(".md") && /(?:secret|credential)/.test(base)) return "credential file";
7933
+ const sourceModule = /\.(?:[cm]?[jt]s|[jt]sx)$/.test(base);
7934
+ if (!base.endsWith(".md") && (!sourceModule || shellWrite) && /(?:secret|credential)/.test(base)) {
7935
+ return sourceModule && shellWrite ? "credential-named source module with unavailable shell content; use Write/Edit or apply_patch" : "credential file";
7936
+ }
7934
7937
  if ((/* @__PURE__ */ new Set([
7935
7938
  "package-lock.json",
7936
7939
  "pnpm-lock.yaml",
@@ -7948,7 +7951,7 @@ function protectedReason(path2, root) {
7948
7951
  }
7949
7952
  function protectedFile(paths, options = {}) {
7950
7953
  for (const path2 of paths) {
7951
- const reason = protectedReason(path2, options.root);
7954
+ const reason = protectedReason(path2, options.root, options.shellWritePaths?.includes(path2) ?? false);
7952
7955
  if (reason !== void 0) {
7953
7956
  const learn = reason.includes("void-learn") ? " Use void-learn to capture the missing harness capability." : "";
7954
7957
  return block("PROTECTED_FILE", `refusing to edit ${path2}.${learn}`, [`${path2}: ${reason}`]);
@@ -7969,24 +7972,31 @@ var HIGH_CONFIDENCE = [
7969
7972
  /\bAIza[0-9A-Za-z_-]{35}\b/,
7970
7973
  /-----BEGIN [A-Z ]*PRIVATE KEY-----/
7971
7974
  ];
7972
- var GENERIC_ASSIGNMENT = /(?:_KEY|_SECRET|_TOKEN|_PASSWORD|_PASSWD|_APIKEY)["' ]*[:=]\s*["']([A-Za-z0-9+/=_-]{24,})["']/i;
7975
+ var GENERIC_ASSIGNMENT = /(?:_KEY|_SECRET|_TOKEN|_PASSWORD|_PASSWD|_APIKEY)["' ]*[:=]\s*["']([A-Za-z0-9+/=_-]{24,})["']/gi;
7976
+ var CAMEL_ASSIGNMENT = /\b[a-z][A-Za-z0-9_$]*(?:Key|Secret|Token|Password|Passwd)["' ]*[:=]\s*["']([A-Za-z0-9+/=_-]{24,})["']/g;
7973
7977
  var PLACEHOLDER = /process\.env|import\.meta\.env|xxx|changeme|example|redacted|your[-_]|<[a-z]|placeholder|todo/i;
7974
7978
  var EXEMPT_PATH = /\.(?:test|spec)\.|\/__tests__\/|\/__fixtures__\/|\/fixtures\/|\/__generated__\//;
7979
+ var CREDENTIAL_SOURCE_MODULE = /(?:secret|credential)[^/]*\.(?:[cm]?[jt]s|[jt]sx)$/i;
7975
7980
  function lineHasSecret(line) {
7976
7981
  if (line.includes("allow-secret-pattern:")) return false;
7977
7982
  if (HIGH_CONFIDENCE.some((pattern2) => pattern2.test(line))) return true;
7978
- const assignment = line.match(GENERIC_ASSIGNMENT);
7979
- if (assignment === null || PLACEHOLDER.test(line)) return false;
7980
- const value = assignment[1] ?? "";
7981
- if (/^[0-9a-f]+$/i.test(value) || /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(value)) {
7982
- return false;
7983
+ for (const pattern2 of [GENERIC_ASSIGNMENT, CAMEL_ASSIGNMENT]) {
7984
+ for (const assignment of line.matchAll(pattern2)) {
7985
+ const value = assignment[1] ?? "";
7986
+ if (PLACEHOLDER.test(value)) continue;
7987
+ if (/^[0-9a-f]+$/i.test(value) || /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(value)) {
7988
+ continue;
7989
+ }
7990
+ if (/[A-Za-z]/.test(value) && /[0-9]/.test(value)) return true;
7991
+ }
7983
7992
  }
7984
- return /[A-Za-z]/.test(value) && /[0-9]/.test(value);
7993
+ return false;
7985
7994
  }
7986
7995
  function secretContent(edits) {
7987
7996
  const evidence = [];
7988
7997
  for (const edit of edits) {
7989
- if (EXEMPT_PATH.test(edit.path.replaceAll("\\", "/"))) continue;
7998
+ const path2 = edit.path.replaceAll("\\", "/");
7999
+ if (EXEMPT_PATH.test(path2) && !CREDENTIAL_SOURCE_MODULE.test(path2)) continue;
7990
8000
  edit.addedContent.split(/\r?\n/).forEach((line, index) => {
7991
8001
  if (lineHasSecret(line)) evidence.push(`${edit.path}:${index + 1}`);
7992
8002
  });
@@ -8876,7 +8886,8 @@ function evaluateRule(rule, rawInput, options) {
8876
8886
  if (rule === "protected-file") {
8877
8887
  if (productSetting(env, "ALLOW_SECRET_EDIT") === "1") return allow("OVERRIDE", "one-shot override");
8878
8888
  const ownership = options.source === "checked-out" ? {} : { root: options.root };
8879
- return protectedFile(call.edits.map((edit) => edit.path), ownership);
8889
+ const shellWritePaths = call.tool === "Bash" || call.tool === "shell" ? shellWriteTargets(call.command) : [];
8890
+ return protectedFile(call.edits.map((edit) => edit.path), { ...ownership, shellWritePaths });
8880
8891
  }
8881
8892
  if (rule === "secret-content") return secretContent(call.edits);
8882
8893
  if (rule === "control-character") return controlCharacter(call.edits);
package/dist/main.js CHANGED
@@ -67817,7 +67817,7 @@ async function recordSpecialistRequests(root, missionId, envelopes, planHash) {
67817
67817
  init_esm_shims();
67818
67818
 
67819
67819
  // package.json
67820
- var version2 = "5.0.0";
67820
+ var version2 = "5.0.2";
67821
67821
 
67822
67822
  // src/lib/runs/verify.ts
67823
67823
  var MAX_CAPTURE_BYTES = 64 * 1024;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voidmachine",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "void-machine CLI — install an opinionated engineering doctrine on any project; render deterministic project health. Run via `npx voidmachine`; command: void-machine (alias vm).",
5
5
  "license": "MIT",
6
6
  "author": "Folpe @ VoidCorp",
@@ -58,10 +58,10 @@
58
58
  "ws": "8.21.0",
59
59
  "yaml": "^2.5.0",
60
60
  "zod": "^4.6.5",
61
- "@voidcorp/harness-graph": "5.0.0",
62
61
  "@voidcorp/hook-runner": "0.0.0",
63
- "@voidcorp/void-machine": "0.0.0",
64
- "@voidcorp/mission-engine": "0.0.0"
62
+ "@voidcorp/harness-graph": "5.0.2",
63
+ "@voidcorp/mission-engine": "0.0.0",
64
+ "@voidcorp/void-machine": "0.0.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "tsup",