@openparachute/vault 0.7.6-rc.2 → 0.7.6

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": "@openparachute/vault",
3
- "version": "0.7.6-rc.2",
3
+ "version": "0.7.6",
4
4
  "description": "Agent-native knowledge graph. Notes, tags, links over MCP.",
5
5
  "module": "src/cli.ts",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  * wiring and the response-shape contract.
22
22
  */
23
23
 
24
- import { describe, test, expect, beforeEach, afterEach, spyOn } from "bun:test";
24
+ import { describe, test, expect, beforeAll, beforeEach, afterEach, spyOn } from "bun:test";
25
25
  import { mkdirSync, rmSync, existsSync } from "fs";
26
26
  import { join } from "path";
27
27
  import { tmpdir } from "os";
@@ -147,6 +147,15 @@ let prevJwksOrigin: string | undefined;
147
147
  let fixture: HubFixture;
148
148
  let kp: Keypair;
149
149
 
150
+ beforeAll(async () => {
151
+ // RSA keygen is the expensive part of this file (~tens of ms locally,
152
+ // hundreds under a loaded full-suite worker). Doing it per-test is what
153
+ // clustered failures under parallel contention (vault#609): 30 tests ×
154
+ // generateKeyPair competing with the rest of `bun test ./src/` blew the
155
+ // 5s default. One keypair is enough — kid, n, e are stable for the file.
156
+ kp = await makeKeypair("k1");
157
+ });
158
+
150
159
  beforeEach(async () => {
151
160
  tmpHome = join(
152
161
  tmpdir(),
@@ -157,7 +166,6 @@ beforeEach(async () => {
157
166
  process.env.PARACHUTE_HOME = tmpHome;
158
167
  clearVaultStoreCache();
159
168
 
160
- kp = await makeKeypair("k1");
161
169
  fixture = startHubFixture([kp]);
162
170
  prevHubOrigin = process.env.PARACHUTE_HUB_ORIGIN;
163
171
  prevJwksOrigin = process.env.PARACHUTE_HUB_JWKS_ORIGIN;
@@ -828,11 +828,13 @@ describe("export CLI: --watch", () => {
828
828
  const watch = spawnWatchCli(["export", exportDir, "--watch", "--interval", "1"], tmp);
829
829
  try {
830
830
  // Initial export prints the "Exported N notes" line.
831
- await watch.awaitLine((l) => l.includes("Exported 1 note"), 10_000);
831
+ await watch.awaitLine((l) => l.includes("Exported 1 note"), 15_000);
832
832
  // Watch loop prints the polling banner.
833
- await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 5_000);
834
- // At least one idle tick.
835
- await watch.awaitLine((l) => l.includes("[watch] no changes"), 5_000);
833
+ await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 15_000);
834
+ // At least one idle tick. 15s not 5s: under full-suite spawn
835
+ // contention the child can take >5s to print its first idle tick
836
+ // even with --interval 1 (vault#609).
837
+ await watch.awaitLine((l) => l.includes("[watch] no changes"), 15_000);
836
838
  } finally {
837
839
  watch.proc.kill("SIGINT");
838
840
  }
@@ -841,7 +843,7 @@ describe("export CLI: --watch", () => {
841
843
  // Stopping line printed on shutdown.
842
844
  expect(watch.seenLines.some((l) => l.includes("[watch] stopping watch"))).toBe(true);
843
845
  },
844
- 30_000,
846
+ 60_000,
845
847
  );
846
848
 
847
849
  test(
@@ -849,7 +851,7 @@ describe("export CLI: --watch", () => {
849
851
  async () => {
850
852
  const watch = spawnWatchCli(["export", exportDir, "--watch", "--interval", "1"], tmp);
851
853
  try {
852
- await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 10_000);
854
+ await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 15_000);
853
855
 
854
856
  // Open the vault DB out-of-band and add a note. The watch loop
855
857
  // should pick it up within ~2 intervals.
@@ -866,7 +868,7 @@ describe("export CLI: --watch", () => {
866
868
  // Expect the watch-mode incremental-export line.
867
869
  const line = await watch.awaitLine(
868
870
  (l) => l.startsWith("[watch] exported"),
869
- 10_000,
871
+ 15_000,
870
872
  );
871
873
  expect(line).toMatch(/\[watch\] exported \d+ note/);
872
874
  // And the on-disk file landed.
@@ -878,7 +880,7 @@ describe("export CLI: --watch", () => {
878
880
  await watch.proc.exited;
879
881
  expect(fs.existsSync(path.join(exportDir, "Inbox", "triggered.md"))).toBe(true);
880
882
  },
881
- 30_000,
883
+ 60_000,
882
884
  );
883
885
 
884
886
  test(
@@ -925,8 +927,8 @@ describe("export CLI: --watch", () => {
925
927
  );
926
928
  try {
927
929
  // Initial export must succeed (seed has no collision).
928
- await watch.awaitLine((l) => l.includes("Exported 1 note"), 10_000);
929
- await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 5_000);
930
+ await watch.awaitLine((l) => l.includes("Exported 1 note"), 15_000);
931
+ await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 15_000);
930
932
 
931
933
  // Inject a collision: existing seed is `Inbox/seed`; write
932
934
  // `Inbox/SEED` so the lowercased (path, ext) key collides.
@@ -977,7 +979,7 @@ describe("export CLI: --watch", () => {
977
979
  expect(stderr).toContain("Resolve the collision in the vault");
978
980
  expect(stderr).toContain("--strict-case-collision");
979
981
  },
980
- 30_000,
982
+ 60_000,
981
983
  );
982
984
 
983
985
  test(
@@ -993,9 +995,9 @@ describe("export CLI: --watch", () => {
993
995
  tmp,
994
996
  );
995
997
  try {
996
- await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 10_000);
998
+ await watch.awaitLine((l) => l.includes("[watch] polling every 1s"), 15_000);
997
999
  // Initial export should have produced a commit.
998
- await watch.awaitLine((l) => l.startsWith("[git-commit] export:"), 10_000);
1000
+ await watch.awaitLine((l) => l.startsWith("[git-commit] export:"), 15_000);
999
1001
  const afterInitial = gitLogOneline(exportDir).length;
1000
1002
 
1001
1003
  // Add a note → expect another commit on the next cycle.
@@ -1023,6 +1025,6 @@ describe("export CLI: --watch", () => {
1023
1025
  }
1024
1026
  await watch.proc.exited;
1025
1027
  },
1026
- 30_000,
1028
+ 60_000,
1027
1029
  );
1028
1030
  });