@danypops/papyrus 0.49.0 → 0.49.1

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/package.json +1 -1
  2. package/src/ops.ts +22 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/papyrus",
3
- "version": "0.49.0",
3
+ "version": "0.49.1",
4
4
  "description": "Daemon-backed graph artifacts, evidence-bearing tasks, rules, skills, and native TUI workflows for Pi",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/src/ops.ts CHANGED
@@ -599,22 +599,34 @@ function readBoundedGateFile(path: string): string {
599
599
  return readFileSync(path, "utf-8") as string;
600
600
  }
601
601
 
602
- /** Shared by the sync and async process-gate runners so "test" is never a second, independently
603
- * maintained copy of "command"'s own command-template/timeout selection. */
602
+ /**
603
+ * Shared by the sync and async process-gate runners so "test" is never a second, independently
604
+ * maintained copy of "command"'s own command-template selection.
605
+ *
606
+ * "test" runs `gate.target` verbatim, exactly like "command" -- the only real difference is a
607
+ * more generous default timeout (GATE_TEST_TIMEOUT_MS vs GATE_COMMAND_TIMEOUT_MS), since a test
608
+ * suite routinely runs longer than an arbitrary command. It previously wrapped target in
609
+ * `npx vitest run ${target} --reporter=dot`, silently wrong for every real consumer in this
610
+ * ecosystem (all Bun-native, none use vitest): a target that was itself a full command (e.g.
611
+ * `bun test path/to.test.ts`, exactly what every existing gate/checklist example here has always
612
+ * shown) got parsed by vitest as three separate positional args, triggering vitest's own broad
613
+ * discovery across the whole repo instead of running the intended command at all -- a real
614
+ * incident (task ab1463e2) that produced an unrelated multi-suite vitest failure cascade instead
615
+ * of the actual target ever running.
616
+ */
604
617
  function processGateCommand(gate: Gate): { command: string; timeout: number } {
605
- if (gate.type === "test")
606
- return { command: `npx vitest run ${gate.target} --reporter=dot`, timeout: gate.timeoutMs ?? GATE_TEST_TIMEOUT_MS };
618
+ if (gate.type === "test") return { command: gate.target, timeout: gate.timeoutMs ?? GATE_TEST_TIMEOUT_MS };
607
619
  return { command: gate.target, timeout: gate.timeoutMs ?? GATE_COMMAND_TIMEOUT_MS };
608
620
  }
609
621
 
610
622
  /**
611
623
  * spawnSync + manual stdout/stderr concatenation, not execSync: execSync's return value is stdout
612
- * only. Many real commands (bun test's own per-test lines and its pass/fail summary among them, and
613
- * vitest's own "test" gate output) write their actual output to stderr, so an execSync-based match
614
- * against gate.expect saw only the first line of a banner and never the result -- every such gate
615
- * failed regardless of whether the command actually passed. This one function now serves both
616
- * "command" and "test" gates; previously "test" was a second, separately-maintained execSync path
617
- * that never checked gate.expect at all.
624
+ * only. Many real commands (bun test's own per-test lines and its pass/fail summary among them)
625
+ * write their actual output to stderr, so an execSync-based match against gate.expect saw only the
626
+ * first line of a banner and never the result -- every such gate failed regardless of whether the
627
+ * command actually passed. This one function now serves both "command" and "test" gates;
628
+ * previously "test" was a second, separately-maintained execSync path that never checked
629
+ * gate.expect at all.
618
630
  */
619
631
  function runProcessGateSync(gate: Gate, cwd?: string): GateResult {
620
632
  const { spawnSync } = require_("node:child_process");