@openparachute/vault 0.4.8 → 0.4.9-rc.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openparachute/vault",
3
- "version": "0.4.8",
3
+ "version": "0.4.9-rc.2",
4
4
  "description": "Agent-native knowledge graph. Notes, tags, links over MCP.",
5
5
  "module": "src/cli.ts",
6
6
  "type": "module",
@@ -69,11 +69,16 @@ describe("shouldAutoTranscribe", () => {
69
69
  })).toBe(false);
70
70
  });
71
71
 
72
- test("skips when enabled is unset (no auto_transcribe block in config)", () => {
72
+ test("fires when enabled is unset unset config means ON", () => {
73
+ // Default behavior (no `auto_transcribe` block in config) is opt-out:
74
+ // once an operator has scribe reachable, audio attachments transcribe
75
+ // automatically. Operators wanting it OFF set
76
+ // `auto_transcribe.enabled: false` explicitly. Previously default-off;
77
+ // flipped to default-on so installing scribe is the only opt-in signal.
73
78
  expect(shouldAutoTranscribe("audio/wav", {
74
79
  readGlobalConfigImpl: readGlobalConfig(undefined),
75
80
  getCachedScribeUrlImpl: scribePresent,
76
- })).toBe(false);
81
+ })).toBe(true);
77
82
  });
78
83
 
79
84
  test("skips when scribe URL is undefined (no services.json entry, no env)", () => {
@@ -19,7 +19,11 @@ import { getCachedScribeUrl } from "./scribe-discovery.ts";
19
19
  *
20
20
  * Returns `true` only when ALL three conditions hold:
21
21
  * 1. mime-type starts with `audio/` (case-insensitive).
22
- * 2. `globalConfig.auto_transcribe?.enabled === true`.
22
+ * 2. `globalConfig.auto_transcribe?.enabled` is not explicitly false.
23
+ * Default behavior (when unset) is ON — once an operator has scribe
24
+ * reachable, audio attachments transcribe automatically without a
25
+ * separate config step. Operators who want it OFF set
26
+ * `auto_transcribe.enabled: false` explicitly.
23
27
  * 3. Scribe is discoverable (services.json entry OR SCRIBE_URL env).
24
28
  *
25
29
  * The three conditions are independent guards: a single `false` is sufficient
@@ -40,7 +44,7 @@ export function shouldAutoTranscribe(
40
44
  }
41
45
  const enabled = opts.enabledOverride
42
46
  ?? (opts.readGlobalConfigImpl ?? readGlobalConfig)().auto_transcribe?.enabled
43
- ?? false;
47
+ ?? true;
44
48
  if (!enabled) return false;
45
49
  const url = (opts.getCachedScribeUrlImpl ?? getCachedScribeUrl)();
46
50
  if (!url || !url.trim()) return false;
@@ -19,8 +19,11 @@
19
19
  * - port: GlobalConfig.port, exposed read-only.
20
20
  * - autoTranscribe.*: vault↔scribe handoff (vault#353, design 2026-05-21
21
21
  * Part 2). Three nested fields per design Q4:
22
- * - enabled: boolean toggle, default false (persisted in
23
- * GlobalConfig.auto_transcribe.enabled).
22
+ * - enabled: boolean toggle, default true when scribe is
23
+ * reachable (persisted in
24
+ * GlobalConfig.auto_transcribe.enabled). Default
25
+ * flipped from off → on so installing scribe is
26
+ * the only opt-in signal needed.
24
27
  * - scribeUrl: readOnly — resolved per-process from
25
28
  * `~/.parachute/services.json` via
26
29
  * `scribe-discovery.ts`. Operators can't point at an
@@ -69,10 +72,10 @@ export function buildConfigSchema(): ModuleConfigSchema {
69
72
  properties: {
70
73
  enabled: {
71
74
  type: "boolean",
72
- default: false,
75
+ default: true,
73
76
  title: "Enable auto-transcription",
74
77
  description:
75
- "Master toggle. When false, audio uploads land normally without any scribe interaction. Global — persisted in `GlobalConfig.auto_transcribe.enabled` and applies to every vault on this server. Per-vault control is a future enhancement when multi-vault deployments need it.",
78
+ "Master toggle. Default on audio uploads transcribe automatically when scribe is reachable. Set to false to disable. Global — persisted in `GlobalConfig.auto_transcribe.enabled` and applies to every vault on this server. Per-vault control is a future enhancement when multi-vault deployments need it.",
76
79
  },
77
80
  scribeUrl: {
78
81
  type: "string",
@@ -139,7 +142,10 @@ export function buildConfigValues(
139
142
  return {
140
143
  audio_retention: vaultConfig.audio_retention ?? "keep",
141
144
  autoTranscribe: {
142
- enabled: globalConfig.auto_transcribe?.enabled ?? false,
145
+ // Match shouldAutoTranscribe's `?? true` so the admin SPA displays
146
+ // the same value runtime uses. An unset config row shows `true`
147
+ // because that's what vault will actually do on the next audio upload.
148
+ enabled: globalConfig.auto_transcribe?.enabled ?? true,
143
149
  scribeUrl,
144
150
  },
145
151
  // Legacy alias mirrors `autoTranscribe.scribeUrl` so hubs reading the
@@ -17,7 +17,7 @@
17
17
  * never touch ~/.parachute.
18
18
  */
19
19
 
20
- import { describe, test, expect, beforeEach, afterEach, afterAll } from "bun:test";
20
+ import { describe, test, expect, beforeAll, beforeEach, afterEach, afterAll } from "bun:test";
21
21
  import { rmSync, existsSync, mkdirSync, writeFileSync } from "fs";
22
22
  import { join } from "path";
23
23
  import { tmpdir } from "os";
@@ -606,6 +606,24 @@ describe("MCP 401 WWW-Authenticate challenge (RFC 9728)", () => {
606
606
 
607
607
  const HUB_ORIGIN = "http://127.0.0.1:1939";
608
608
 
609
+ // Process-env isolation: sibling test files (tokens-routes.test.ts,
610
+ // auth-hub-jwt.test.ts) set PARACHUTE_HUB_ORIGIN in their own beforeAll
611
+ // hooks. Bun's test runner shares a single process across test files,
612
+ // and when file-ordering puts those before this one, their hook-set
613
+ // value can still be live when our tests run. Restore the default
614
+ // (unset) here so we test against `DEFAULT_HUB_LOOPBACK`. Caught when
615
+ // vault rc.1 release CI failed with "Received: http://127.0.0.1:34295"
616
+ // — a leaked ephemeral port from another test's fixture.
617
+ let _prevHubOriginRouting: string | undefined;
618
+ beforeAll(() => {
619
+ _prevHubOriginRouting = process.env.PARACHUTE_HUB_ORIGIN;
620
+ delete process.env.PARACHUTE_HUB_ORIGIN;
621
+ });
622
+ afterAll(() => {
623
+ if (_prevHubOriginRouting === undefined) delete process.env.PARACHUTE_HUB_ORIGIN;
624
+ else process.env.PARACHUTE_HUB_ORIGIN = _prevHubOriginRouting;
625
+ });
626
+
609
627
  describe("per-vault OAuth discovery (hub-rooted after workstream E)", () => {
610
628
  test("AS metadata names the hub as issuer + endpoints", async () => {
611
629
  createVault("journal");