@openchamber/web 1.18.2 → 1.18.4
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/bin/lib/commands-models.js +1 -1
- package/dist/assets/{CodeMirrorCommentWidgets-CxcJ5x9h.js → CodeMirrorCommentWidgets-4qZbrEXU.js} +1 -1
- package/dist/assets/{CommitSection-C9sBBYAJ.js → CommitSection-MJmntVPJ.js} +1 -1
- package/dist/assets/{DiagramEditor-C7nUw7p3.js → DiagramEditor-jnG3Hbxg.js} +1 -1
- package/dist/assets/{DiagramView-cYxZP-HS.js → DiagramView-CFXxgg_a.js} +1 -1
- package/dist/assets/{DiffView-1zd0slLu.js → DiffView-DZIoOnV7.js} +2 -2
- package/dist/assets/FilesView-BKL6YlKG.js +14 -0
- package/dist/assets/{GitView-OSVIn5V1.js → GitView-DBFrDDBv.js} +1 -1
- package/dist/assets/{JsonTreeView-Kgepz4pR.js → JsonTreeView-DLW2Wy1g.js} +1 -1
- package/dist/assets/MarkdownImageGallery-DKIylIK7.js +1 -0
- package/dist/assets/MarkdownRendererImpl-CLv8hxvv.js +12 -0
- package/dist/assets/OnboardingScreen-D2Y6djMw.js +1 -0
- package/dist/assets/{PatchDiff-Cddz02Ya.js → PatchDiff-BuLPx7AN.js} +1 -1
- package/dist/assets/{PierreDiffViewer-B5k0KvPW.js → PierreDiffViewer-BHm4Yr0X.js} +2 -2
- package/dist/assets/{PlanView-BYgHBHDt.js → PlanView-ZYEJn8A_.js} +3 -3
- package/dist/assets/{SessionSwitcherDropdown-ig2OT22Z.js → SessionSwitcherDropdown-rro-SsaO.js} +1 -1
- package/dist/assets/SettingsView-5RmswFZe.js +28 -0
- package/dist/assets/{SettingsWindow-CNHM8ifT.js → SettingsWindow-BZhAYFdS.js} +1 -1
- package/dist/assets/{ToolOutputDialog-DrGeYq2p.js → ToolOutputDialog-Za6V4VMJ.js} +7 -7
- package/dist/assets/{ToolPartDiffPreview-BRmPpe94.js → ToolPartDiffPreview-BL-9ixyC.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-Dcu8Q-5P.js → VirtualizedFileDiff-CwGocYQd.js} +1 -1
- package/dist/assets/{WalkthroughView-HStEYdD2.js → WalkthroughView-5DyvN03T.js} +2 -2
- package/dist/assets/{computeVirtualFileMetrics-DQE7R9IY.js → computeVirtualFileMetrics-Da00Jg7M.js} +2 -2
- package/dist/assets/contextPanelEmbeddedChat-B-bSg3P5.js +1 -0
- package/dist/assets/de-u7gSnqWs.js +9 -0
- package/dist/assets/es-T9O7aAOr.js +15 -0
- package/dist/assets/fr-Oor7ewbE.js +13 -0
- package/dist/assets/index-BzIpNlNE.css +1 -0
- package/dist/assets/{index-BgQEgA2a.js → index-C0yNhuZw.js} +1 -1
- package/dist/assets/index-DRpChWux.js +7 -0
- package/dist/assets/{isDiffPlainText-XyBCe4eD.js → isDiffPlainText-D9YpoLrV.js} +1 -1
- package/dist/assets/{isFilePlainText-JbqDfa3n.js → isFilePlainText-gTibdNIe.js} +1 -1
- package/dist/assets/ja-DHpqbVmr.js +15 -0
- package/dist/assets/ko-CwLkS3nx.js +15 -0
- package/dist/assets/{main-LfcbGv7C.js → main-D7UcL3VQ.js} +2 -2
- package/dist/assets/main-DPMd2iKS.js +915 -0
- package/dist/assets/markdownCore-DDrHVneM.js +2 -0
- package/dist/assets/{miniChat-CUp_elRz.js → miniChat-O_GVoEbc.js} +2 -2
- package/dist/assets/{mobile-CBSN7BsH.js → mobile-Br4TtAqc.js} +2 -2
- package/dist/assets/{patchFileDiff-DCIXUHRJ.js → patchFileDiff-KNkxM1C1.js} +2 -2
- package/dist/assets/{pl-tHTP6XQx.js → pl-CcZILN8q.js} +4 -4
- package/dist/assets/pt-BR-DYHhVK6o.js +15 -0
- package/dist/assets/{renderElectronMiniChatApp-eZl-5STF.js → renderElectronMiniChatApp-CJpdxTT1.js} +2 -2
- package/dist/assets/renderMobileApp-toj9cXoh.js +25 -0
- package/dist/assets/runtimeEndpointReset-BVmispdD.js +13 -0
- package/dist/assets/scheduledTasksApi-ByKya3Un.js +1 -0
- package/dist/assets/{shikiHighlight-eU8abJ3T.js → shikiHighlight-C7LTbwFx.js} +1 -1
- package/dist/assets/uk-BA2kZR38.js +15 -0
- package/dist/assets/{useAppFontEffects-Bbpz77To.js → useAppFontEffects-BikB6enL.js} +138 -138
- package/dist/assets/useInlineCommentController-CYPvYJDt.js +2 -0
- package/dist/assets/{vendor-codemirror-language-data-Dzt9rWZZ.js → vendor-codemirror-language-data-CLHw8NWn.js} +2 -2
- package/dist/assets/{vendor-marked-i_gIkIP3.js → vendor-marked-CX41MkDF.js} +1 -1
- package/dist/assets/{web-components-DGvnI0zx.js → web-components-GMc3oR3i.js} +1 -1
- package/dist/assets/zh-CN-dlOQK6v9.js +15 -0
- package/dist/assets/zh-TW-BnqQ-WL5.js +15 -0
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +2 -2
- package/server/index.js +65 -19
- package/server/lib/agent-tool/DOCUMENTATION.md +21 -6
- package/server/lib/agent-tool/runtime.js +90 -16
- package/server/lib/agent-tool/runtime.test.js +86 -0
- package/server/lib/browser-control/DOCUMENTATION.md +50 -0
- package/server/lib/browser-control/broker.js +154 -0
- package/server/lib/browser-control/broker.test.js +191 -0
- package/server/lib/browser-control/routes.js +48 -0
- package/server/lib/browser-control/routes.test.js +108 -0
- package/server/lib/dev-servers/parse.js +203 -0
- package/server/lib/dev-servers/parse.test.js +174 -0
- package/server/lib/dev-servers/routes.js +135 -0
- package/server/lib/dev-tunnel/DOCUMENTATION.md +57 -0
- package/server/lib/dev-tunnel/client.js +193 -0
- package/server/lib/dev-tunnel/runtime.js +189 -0
- package/server/lib/dev-tunnel/tunnel.test.js +291 -0
- package/server/lib/git/credentials.js +0 -33
- package/server/lib/github/DOCUMENTATION.md +1 -1
- package/server/lib/markdown-image-grants/DOCUMENTATION.md +36 -0
- package/server/lib/markdown-image-grants/routes.js +340 -0
- package/server/lib/markdown-image-grants/routes.test.js +221 -0
- package/server/lib/openchamber-control/DOCUMENTATION.md +9 -0
- package/server/lib/openchamber-control/actions.js +33 -1
- package/server/lib/openchamber-control/screenshots.js +83 -0
- package/server/lib/openchamber-control/screenshots.test.js +84 -0
- package/server/lib/openchamber-control/service.js +141 -2
- package/server/lib/openchamber-control/service.test.js +55 -0
- package/server/lib/opencode/core-routes.js +31 -52
- package/server/lib/opencode/core-routes.test.js +37 -9
- package/server/lib/opencode/feature-routes-runtime.js +15 -0
- package/server/lib/opencode/server-startup-runtime.js +22 -1
- package/server/lib/opencode/server-startup-runtime.test.js +44 -0
- package/server/lib/opencode/settings-helpers.js +3 -9
- package/server/lib/projects/project-config.js +181 -2
- package/server/lib/projects/project-config.test.js +295 -0
- package/server/lib/quota/DOCUMENTATION.md +4 -2
- package/server/lib/quota/credentials/providers.js +0 -7
- package/server/lib/quota/credentials/store.js +11 -1
- package/server/lib/quota/credentials/store.test.js +9 -1
- package/server/lib/quota/providers/opencode-go.js +35 -35
- package/server/lib/quota/providers/opencode-go.test.js +52 -7
- package/server/lib/quota/routes.js +0 -2
- package/server/lib/relay/DOCUMENTATION.md +2 -0
- package/server/lib/relay/tunnel-host.js +157 -33
- package/server/lib/relay/tunnel-host.test.js +147 -0
- package/server/lib/scheduled-tasks/DOCUMENTATION.md +49 -0
- package/server/lib/scheduled-tasks/issue-2710-double-execution.test.js +488 -0
- package/server/lib/scheduled-tasks/routes.js +6 -0
- package/server/lib/scheduled-tasks/runtime.js +369 -108
- package/server/lib/scheduled-tasks/service.js +7 -1
- package/server/lib/scheduled-tasks/service.test.js +20 -0
- package/server/lib/walkthrough/index.js +0 -2
- package/server/sse-routes.test.js +3 -0
- package/dist/assets/FilesView-WkxsWHBE.js +0 -14
- package/dist/assets/MarkdownRendererImpl-CKAsRfIk.js +0 -12
- package/dist/assets/OnboardingScreen-BCgYA7J5.js +0 -1
- package/dist/assets/SettingsView-e7Fmxnz8.js +0 -28
- package/dist/assets/contextPanelEmbeddedChat-5VGWIT_J.js +0 -1
- package/dist/assets/de-B6t6T54h.js +0 -9
- package/dist/assets/es-DH9NUKge.js +0 -15
- package/dist/assets/fr-Do4t2KmA.js +0 -13
- package/dist/assets/index-B45s9aAX.css +0 -1
- package/dist/assets/index-CNrN5qDs.js +0 -7
- package/dist/assets/ja-DJT9EM80.js +0 -15
- package/dist/assets/ko-CfWRq2p4.js +0 -15
- package/dist/assets/main-B4oBRI9u.js +0 -193
- package/dist/assets/markdownCore-A3_L34oS.js +0 -2
- package/dist/assets/pt-BR-BDEzzltP.js +0 -15
- package/dist/assets/renderMobileApp-DA7wpIBi.js +0 -23
- package/dist/assets/runtimeEndpointReset-D5izT-u5.js +0 -13
- package/dist/assets/scheduledTasksApi-CTJdfSWc.js +0 -1
- package/dist/assets/uk-B6Q32nyk.js +0 -15
- package/dist/assets/useInlineCommentController-D7zs7-BQ.js +0 -2
- package/dist/assets/vendor-zumer-snapdom-Btyu_Xi2.js +0 -8
- package/dist/assets/zh-CN-7MGcwGaC.js +0 -15
- package/dist/assets/zh-TW-CFPfqxlL.js +0 -15
- package/server/lib/preview/proxy-runtime.js +0 -1604
- package/server/lib/preview/proxy-runtime.test.js +0 -528
- package/server/lib/quota/opencode-go-credentials.js +0 -11
- package/server/lib/quota/opencode-go-credentials.test.js +0 -32
- package/server/lib/quota/routes.test.js +0 -40
|
@@ -471,4 +471,299 @@ describe('project-config loop reconciliation', () => {
|
|
|
471
471
|
await cleanup();
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
|
+
|
|
475
|
+
it('conditionally updates state only when the predicate passes (occurrence claim)', async () => {
|
|
476
|
+
const { runtime, cleanup } = await createRuntime();
|
|
477
|
+
try {
|
|
478
|
+
const created = await runtime.upsertScheduledTask('project-test', {
|
|
479
|
+
name: 'claim-me',
|
|
480
|
+
enabled: true,
|
|
481
|
+
schedule: { kind: 'daily', time: '15:00', timezone: 'UTC' },
|
|
482
|
+
execution: { prompt: 'Run once', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
const scheduledFor = Date.UTC(2026, 0, 1, 15, 0, 0);
|
|
486
|
+
const first = await runtime.updateScheduledTaskStateIf(
|
|
487
|
+
'project-test',
|
|
488
|
+
created.task.id,
|
|
489
|
+
(task) => !Number.isFinite(task.state?.lastScheduledFor),
|
|
490
|
+
{
|
|
491
|
+
lastScheduledFor: scheduledFor,
|
|
492
|
+
lastStatus: 'running',
|
|
493
|
+
nextRunAt: scheduledFor + 86_400_000,
|
|
494
|
+
},
|
|
495
|
+
);
|
|
496
|
+
expect(first.updated).toBe(true);
|
|
497
|
+
expect(first.task.state.lastScheduledFor).toBe(scheduledFor);
|
|
498
|
+
|
|
499
|
+
const second = await runtime.updateScheduledTaskStateIf(
|
|
500
|
+
'project-test',
|
|
501
|
+
created.task.id,
|
|
502
|
+
(task) => task.state?.lastScheduledFor !== scheduledFor,
|
|
503
|
+
{
|
|
504
|
+
lastScheduledFor: scheduledFor,
|
|
505
|
+
lastStatus: 'running',
|
|
506
|
+
},
|
|
507
|
+
);
|
|
508
|
+
expect(second.updated).toBe(false);
|
|
509
|
+
expect(second.task.state.lastScheduledFor).toBe(scheduledFor);
|
|
510
|
+
|
|
511
|
+
const reloaded = await runtime.listScheduledTasks('project-test');
|
|
512
|
+
expect(reloaded[0].state.lastScheduledFor).toBe(scheduledFor);
|
|
513
|
+
} finally {
|
|
514
|
+
await cleanup();
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
it('serializes concurrent writes across two runtimes sharing a projects dir', async () => {
|
|
519
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), 'oc-project-lock-contention-'));
|
|
520
|
+
const fsPromises = await import('fs/promises');
|
|
521
|
+
try {
|
|
522
|
+
const runtimeA = createProjectConfigRuntime({
|
|
523
|
+
fsPromises,
|
|
524
|
+
path,
|
|
525
|
+
projectsDirPath: tempRoot,
|
|
526
|
+
createTaskID: () => 'shared-task',
|
|
527
|
+
});
|
|
528
|
+
const runtimeB = createProjectConfigRuntime({
|
|
529
|
+
fsPromises,
|
|
530
|
+
path,
|
|
531
|
+
projectsDirPath: tempRoot,
|
|
532
|
+
createTaskID: () => 'shared-task',
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
await runtimeA.upsertScheduledTask('project-lock', {
|
|
536
|
+
name: 'contended',
|
|
537
|
+
enabled: true,
|
|
538
|
+
schedule: { kind: 'daily', time: '15:00', timezone: 'UTC' },
|
|
539
|
+
execution: { prompt: 'Run', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
await Promise.all([
|
|
543
|
+
runtimeA.updateScheduledTaskState('project-lock', 'shared-task', {
|
|
544
|
+
lastStatus: 'success',
|
|
545
|
+
lastRunAt: 100,
|
|
546
|
+
}),
|
|
547
|
+
runtimeB.updateScheduledTaskState('project-lock', 'shared-task', {
|
|
548
|
+
lastStatus: 'error',
|
|
549
|
+
lastRunAt: 200,
|
|
550
|
+
}),
|
|
551
|
+
]);
|
|
552
|
+
|
|
553
|
+
const tasks = await runtimeA.listScheduledTasks('project-lock');
|
|
554
|
+
expect(tasks).toHaveLength(1);
|
|
555
|
+
expect(['success', 'error']).toContain(tasks[0].state.lastStatus);
|
|
556
|
+
expect([100, 200]).toContain(tasks[0].state.lastRunAt);
|
|
557
|
+
|
|
558
|
+
const lockPath = `${runtimeA.resolveProjectConfigPath('project-lock')}.lock`;
|
|
559
|
+
await expect(fsPromises.access(lockPath)).rejects.toMatchObject({ code: 'ENOENT' });
|
|
560
|
+
} finally {
|
|
561
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
it('recovers from a stale-by-age project config lock and cleans it up', async () => {
|
|
566
|
+
const { runtime, cleanup } = await createRuntime();
|
|
567
|
+
const fsPromises = await import('fs/promises');
|
|
568
|
+
try {
|
|
569
|
+
const projectID = 'stale-age';
|
|
570
|
+
const configPath = runtime.resolveProjectConfigPath(projectID);
|
|
571
|
+
const lockPath = `${configPath}.lock`;
|
|
572
|
+
await fsPromises.mkdir(path.dirname(configPath), { recursive: true });
|
|
573
|
+
await writeFile(lockPath, JSON.stringify({
|
|
574
|
+
pid: process.pid,
|
|
575
|
+
at: Date.now() - 120_000,
|
|
576
|
+
}));
|
|
577
|
+
|
|
578
|
+
const created = await runtime.upsertScheduledTask(projectID, {
|
|
579
|
+
name: 'after-stale',
|
|
580
|
+
enabled: true,
|
|
581
|
+
schedule: { kind: 'daily', time: '09:00', timezone: 'UTC' },
|
|
582
|
+
execution: { prompt: 'Run', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
583
|
+
});
|
|
584
|
+
expect(created.created).toBe(true);
|
|
585
|
+
await expect(fsPromises.access(lockPath)).rejects.toMatchObject({ code: 'ENOENT' });
|
|
586
|
+
} finally {
|
|
587
|
+
await cleanup();
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
it('recovers from a stale-by-dead-pid project config lock', async () => {
|
|
592
|
+
const { runtime, cleanup } = await createRuntime();
|
|
593
|
+
const fsPromises = await import('fs/promises');
|
|
594
|
+
try {
|
|
595
|
+
const projectID = 'stale-pid';
|
|
596
|
+
const configPath = runtime.resolveProjectConfigPath(projectID);
|
|
597
|
+
const lockPath = `${configPath}.lock`;
|
|
598
|
+
await fsPromises.mkdir(path.dirname(configPath), { recursive: true });
|
|
599
|
+
// PID unlikely to exist; kill(pid, 0) should fail with ESRCH.
|
|
600
|
+
await writeFile(lockPath, JSON.stringify({
|
|
601
|
+
pid: 2_147_483_647,
|
|
602
|
+
at: Date.now(),
|
|
603
|
+
}));
|
|
604
|
+
|
|
605
|
+
const created = await runtime.upsertScheduledTask(projectID, {
|
|
606
|
+
name: 'after-dead-pid',
|
|
607
|
+
enabled: true,
|
|
608
|
+
schedule: { kind: 'daily', time: '09:00', timezone: 'UTC' },
|
|
609
|
+
execution: { prompt: 'Run', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
610
|
+
});
|
|
611
|
+
expect(created.created).toBe(true);
|
|
612
|
+
await expect(fsPromises.access(lockPath)).rejects.toMatchObject({ code: 'ENOENT' });
|
|
613
|
+
} finally {
|
|
614
|
+
await cleanup();
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
it('release does not unlink a lock stolen by another holder', async () => {
|
|
619
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), 'oc-project-lock-own-'));
|
|
620
|
+
const realFs = await import('fs/promises');
|
|
621
|
+
let enteredCritical;
|
|
622
|
+
const entered = new Promise((resolve) => {
|
|
623
|
+
enteredCritical = resolve;
|
|
624
|
+
});
|
|
625
|
+
let resumeCritical;
|
|
626
|
+
const hold = new Promise((resolve) => {
|
|
627
|
+
resumeCritical = resolve;
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
const fsPromises = {
|
|
631
|
+
...realFs,
|
|
632
|
+
rename: async (from, to) => {
|
|
633
|
+
if (String(from).includes('.tmp-')) {
|
|
634
|
+
enteredCritical();
|
|
635
|
+
await hold;
|
|
636
|
+
}
|
|
637
|
+
return realFs.rename(from, to);
|
|
638
|
+
},
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
try {
|
|
642
|
+
const runtime = createProjectConfigRuntime({
|
|
643
|
+
fsPromises,
|
|
644
|
+
path,
|
|
645
|
+
projectsDirPath: tempRoot,
|
|
646
|
+
createTaskID: () => 'owned-task',
|
|
647
|
+
});
|
|
648
|
+
const projectID = 'lock-own';
|
|
649
|
+
const lockPath = `${runtime.resolveProjectConfigPath(projectID)}.lock`;
|
|
650
|
+
const stolenPid = process.pid + 1;
|
|
651
|
+
|
|
652
|
+
const upsertPromise = runtime.upsertScheduledTask(projectID, {
|
|
653
|
+
name: 'ownership',
|
|
654
|
+
enabled: true,
|
|
655
|
+
schedule: { kind: 'daily', time: '10:00', timezone: 'UTC' },
|
|
656
|
+
execution: { prompt: 'Run', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
await entered;
|
|
660
|
+
await realFs.writeFile(lockPath, JSON.stringify({
|
|
661
|
+
pid: stolenPid,
|
|
662
|
+
at: Date.now(),
|
|
663
|
+
}));
|
|
664
|
+
resumeCritical();
|
|
665
|
+
await upsertPromise;
|
|
666
|
+
|
|
667
|
+
const raw = await realFs.readFile(lockPath, 'utf8');
|
|
668
|
+
expect(JSON.parse(raw).pid).toBe(stolenPid);
|
|
669
|
+
} finally {
|
|
670
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
it('times out when a live lock holder never releases', async () => {
|
|
675
|
+
const { runtime, cleanup } = await createRuntime();
|
|
676
|
+
const fsPromises = await import('fs/promises');
|
|
677
|
+
try {
|
|
678
|
+
const projectID = 'lock-timeout';
|
|
679
|
+
const configPath = runtime.resolveProjectConfigPath(projectID);
|
|
680
|
+
const lockPath = `${configPath}.lock`;
|
|
681
|
+
await fsPromises.mkdir(path.dirname(configPath), { recursive: true });
|
|
682
|
+
// Current process is alive — acquire must wait then throw.
|
|
683
|
+
await writeFile(lockPath, JSON.stringify({
|
|
684
|
+
pid: process.pid,
|
|
685
|
+
at: Date.now(),
|
|
686
|
+
}));
|
|
687
|
+
|
|
688
|
+
await expect(runtime.upsertScheduledTask(projectID, {
|
|
689
|
+
name: 'blocked',
|
|
690
|
+
enabled: true,
|
|
691
|
+
schedule: { kind: 'daily', time: '11:00', timezone: 'UTC' },
|
|
692
|
+
execution: { prompt: 'Run', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
693
|
+
})).rejects.toThrow(/timeout acquiring project config lock/);
|
|
694
|
+
} finally {
|
|
695
|
+
await cleanup();
|
|
696
|
+
}
|
|
697
|
+
}, 15_000);
|
|
698
|
+
|
|
699
|
+
it('releases the write chain after a lock timeout so a later write can complete', async () => {
|
|
700
|
+
const { runtime, cleanup } = await createRuntime();
|
|
701
|
+
const fsPromises = await import('fs/promises');
|
|
702
|
+
try {
|
|
703
|
+
const projectID = 'lock-timeout-recover';
|
|
704
|
+
const configPath = runtime.resolveProjectConfigPath(projectID);
|
|
705
|
+
const lockPath = `${configPath}.lock`;
|
|
706
|
+
await fsPromises.mkdir(path.dirname(configPath), { recursive: true });
|
|
707
|
+
await writeFile(lockPath, JSON.stringify({
|
|
708
|
+
pid: process.pid,
|
|
709
|
+
at: Date.now(),
|
|
710
|
+
}));
|
|
711
|
+
|
|
712
|
+
await expect(runtime.upsertScheduledTask(projectID, {
|
|
713
|
+
name: 'blocked-then-recover',
|
|
714
|
+
enabled: true,
|
|
715
|
+
schedule: { kind: 'daily', time: '11:00', timezone: 'UTC' },
|
|
716
|
+
execution: { prompt: 'Run', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
717
|
+
})).rejects.toThrow(/timeout acquiring project config lock/);
|
|
718
|
+
|
|
719
|
+
// Remove the hostile lock. A wedged in-process chain would hang forever here.
|
|
720
|
+
await fsPromises.unlink(lockPath);
|
|
721
|
+
|
|
722
|
+
const created = await Promise.race([
|
|
723
|
+
runtime.upsertScheduledTask(projectID, {
|
|
724
|
+
name: 'after-timeout',
|
|
725
|
+
enabled: true,
|
|
726
|
+
schedule: { kind: 'daily', time: '12:00', timezone: 'UTC' },
|
|
727
|
+
execution: { prompt: 'Run after timeout', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
728
|
+
}),
|
|
729
|
+
new Promise((_, reject) => {
|
|
730
|
+
setTimeout(() => reject(new Error('second write hung after lock timeout')), 3_000);
|
|
731
|
+
}),
|
|
732
|
+
]);
|
|
733
|
+
|
|
734
|
+
expect(created.created).toBe(true);
|
|
735
|
+
expect(created.task.name).toBe('after-timeout');
|
|
736
|
+
const listed = await runtime.listScheduledTasks(projectID);
|
|
737
|
+
expect(listed).toHaveLength(1);
|
|
738
|
+
expect(listed[0].name).toBe('after-timeout');
|
|
739
|
+
} finally {
|
|
740
|
+
await cleanup();
|
|
741
|
+
}
|
|
742
|
+
}, 20_000);
|
|
743
|
+
|
|
744
|
+
it('recovers from an unparseable lock using mtime age', async () => {
|
|
745
|
+
const { runtime, cleanup } = await createRuntime();
|
|
746
|
+
const fsPromises = await import('fs/promises');
|
|
747
|
+
try {
|
|
748
|
+
const projectID = 'stale-unparseable';
|
|
749
|
+
const configPath = runtime.resolveProjectConfigPath(projectID);
|
|
750
|
+
const lockPath = `${configPath}.lock`;
|
|
751
|
+
await fsPromises.mkdir(path.dirname(configPath), { recursive: true });
|
|
752
|
+
// Simulate crash between open(wx) and writeFile / partial payload.
|
|
753
|
+
await writeFile(lockPath, '{not-json');
|
|
754
|
+
const staleMtime = new Date(Date.now() - 120_000);
|
|
755
|
+
await fsPromises.utimes(lockPath, staleMtime, staleMtime);
|
|
756
|
+
|
|
757
|
+
const created = await runtime.upsertScheduledTask(projectID, {
|
|
758
|
+
name: 'after-unparseable',
|
|
759
|
+
enabled: true,
|
|
760
|
+
schedule: { kind: 'daily', time: '09:00', timezone: 'UTC' },
|
|
761
|
+
execution: { prompt: 'Run', providerID: 'openai', modelID: 'gpt-4.1' },
|
|
762
|
+
});
|
|
763
|
+
expect(created.created).toBe(true);
|
|
764
|
+
await expect(fsPromises.access(lockPath)).rejects.toMatchObject({ code: 'ENOENT' });
|
|
765
|
+
} finally {
|
|
766
|
+
await cleanup();
|
|
767
|
+
}
|
|
768
|
+
});
|
|
474
769
|
});
|
|
@@ -33,7 +33,7 @@ These provider IDs are currently dispatchable via `fetchQuotaForProvider(provide
|
|
|
33
33
|
| `minimax-cn-coding-plan` | MiniMax Coding Plan (minimaxi.com) | `providers/minimax-cn-coding-plan.js` / `providers/minimax-shared.js` | `minimax-cn-coding-plan` |
|
|
34
34
|
| `ollama-cloud` | Ollama Cloud | `providers/ollama-cloud.js` | Manual cookie stored under `~/.config/openchamber/quota/` |
|
|
35
35
|
| `wafer` | Wafer.ai | `providers/wafer.js` | `wafer`, `wafer-ai`, `wafer_ai`, `wafer.ai` |
|
|
36
|
-
| `opencode-go` | OpenCode Go | `providers/opencode-go.js` |
|
|
36
|
+
| `opencode-go` | OpenCode Go | `providers/opencode-go.js` | `opencode-go` API key from OpenCode `auth.json` |
|
|
37
37
|
| `neuralwatt` | NeuralWatt | `providers/neuralwatt.js` | `neuralwatt` (API key under `key` or `token`) |
|
|
38
38
|
| `xai` | xAI | `providers/xai.js` | `xai` OAuth entry in OpenCode `auth.json` |
|
|
39
39
|
|
|
@@ -49,7 +49,9 @@ All providers should return results via shared helpers to preserve API shape:
|
|
|
49
49
|
Provider modules must export `providerId`, `providerName`, `aliases`, `isConfigured(auth?)`, and `fetchQuota()`.
|
|
50
50
|
`fetchQuota()` should return a quota result with `usage.windows` keyed by window name (for example `5h`, `7d`, `daily`) and optional provider-specific `usage.models` data.
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Ollama Cloud and Cursor credentials are explicitly managed through Settings. OpenCode Go usage uses `GET https://opencode.ai/zen/go/v1/usage` with the `opencode-go` API key from OpenCode `auth.json` as a bearer token. The server validates managed credentials before atomic `0600` writes and never returns secrets through its API. OpenChamber never scans browser cookie stores or automatically reads Cursor storage; Cursor import is an explicit one-time user action and never modifies Cursor's database.
|
|
53
|
+
|
|
54
|
+
On the first OpenCode Go usage refresh after upgrading, OpenChamber deletes the obsolete `quota/opencode-go.json` credential file without reading its cookie value.
|
|
53
55
|
|
|
54
56
|
## Add a new provider (quick steps)
|
|
55
57
|
1. Choose module shape based on complexity:
|
|
@@ -3,12 +3,6 @@ import { deleteQuotaCredential, readQuotaCredential, writeQuotaCredential } from
|
|
|
3
3
|
const clean = (value) => typeof value === 'string' && !/[\r\n]/.test(value) ? value.trim() : '';
|
|
4
4
|
|
|
5
5
|
export const normalizers = {
|
|
6
|
-
'opencode-go': (value) => {
|
|
7
|
-
const workspaceId = clean(value?.workspaceId);
|
|
8
|
-
let authCookie = clean(value?.authCookie);
|
|
9
|
-
if (authCookie.startsWith('auth=')) authCookie = authCookie.slice(5).trim();
|
|
10
|
-
return workspaceId && authCookie ? { workspaceId, authCookie } : null;
|
|
11
|
-
},
|
|
12
6
|
'ollama-cloud': (value) => {
|
|
13
7
|
const cookie = clean(value?.cookie);
|
|
14
8
|
return cookie ? { cookie } : null;
|
|
@@ -35,7 +29,6 @@ export const writeManagedCredential = (providerId, value) => {
|
|
|
35
29
|
export const getManagedCredentialStatus = (providerId) => {
|
|
36
30
|
const credential = readManagedCredential(providerId);
|
|
37
31
|
if (!credential) return { configured: false };
|
|
38
|
-
if (providerId === 'opencode-go') return { configured: true, workspaceId: credential.workspaceId, secretMasked: '••••••••' };
|
|
39
32
|
if (providerId === 'cursor') return { configured: true, hasRefreshToken: Boolean(credential.refreshToken), secretMasked: '••••••••' };
|
|
40
33
|
return { configured: true, secretMasked: '••••••••' };
|
|
41
34
|
};
|
|
@@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
|
|
5
|
-
const MANAGED_QUOTA_PROVIDERS = new Set(['
|
|
5
|
+
const MANAGED_QUOTA_PROVIDERS = new Set(['ollama-cloud', 'cursor']);
|
|
6
6
|
|
|
7
7
|
const credentialsDirectory = () => path.join(
|
|
8
8
|
process.env.OPENCHAMBER_DATA_DIR
|
|
@@ -46,3 +46,13 @@ export const deleteQuotaCredential = (providerId) => {
|
|
|
46
46
|
if (error?.code !== 'ENOENT') throw error;
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
|
|
50
|
+
// OpenCode Go used to store a browser auth cookie here. Its usage API now uses
|
|
51
|
+
// OpenCode's auth.json API key, so remove the obsolete secret without reading it.
|
|
52
|
+
export const deleteLegacyOpenCodeGoCredential = () => {
|
|
53
|
+
try {
|
|
54
|
+
fs.unlinkSync(path.join(credentialsDirectory(), 'opencode-go.json'));
|
|
55
|
+
} catch (error) {
|
|
56
|
+
if (error?.code !== 'ENOENT') throw error;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
@@ -2,7 +2,7 @@ import { afterAll, describe, expect, it } from 'bun:test';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { deleteQuotaCredential, readQuotaCredential, writeQuotaCredential } from './store.js';
|
|
5
|
+
import { deleteLegacyOpenCodeGoCredential, deleteQuotaCredential, readQuotaCredential, writeQuotaCredential } from './store.js';
|
|
6
6
|
|
|
7
7
|
const previousDataDir = process.env.OPENCHAMBER_DATA_DIR;
|
|
8
8
|
const temporaryDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'openchamber-quota-store-'));
|
|
@@ -17,6 +17,14 @@ describe('quota credential store', () => {
|
|
|
17
17
|
expect(() => writeQuotaCredential('../escape', {})).toThrow('Unsupported credential provider');
|
|
18
18
|
deleteQuotaCredential('ollama-cloud');
|
|
19
19
|
});
|
|
20
|
+
|
|
21
|
+
it('removes the obsolete OpenCode Go credential without parsing it', () => {
|
|
22
|
+
const legacyPath = path.join(temporaryDirectory, 'quota', 'opencode-go.json');
|
|
23
|
+
fs.mkdirSync(path.dirname(legacyPath), { recursive: true });
|
|
24
|
+
fs.writeFileSync(legacyPath, '{not valid json', { mode: 0o600 });
|
|
25
|
+
deleteLegacyOpenCodeGoCredential();
|
|
26
|
+
expect(fs.existsSync(legacyPath)).toBe(false);
|
|
27
|
+
});
|
|
20
28
|
});
|
|
21
29
|
|
|
22
30
|
afterAll(() => {
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { readAuthFile } from '../../opencode/auth.js';
|
|
2
|
+
import { deleteLegacyOpenCodeGoCredential } from '../credentials/store.js';
|
|
3
|
+
import { buildResult, getAuthEntry, normalizeAuthEntry, toUsageWindow } from '../utils/index.js';
|
|
3
4
|
|
|
4
5
|
export const providerId = 'opencode-go';
|
|
5
6
|
export const providerName = 'OpenCode Go';
|
|
6
7
|
export const aliases = ['opencode-go'];
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
'5h': '
|
|
10
|
-
weekly: '
|
|
11
|
-
monthly: '
|
|
9
|
+
const windowsByApiKey = {
|
|
10
|
+
'5h': 'rolling',
|
|
11
|
+
weekly: 'weekly',
|
|
12
|
+
monthly: 'monthly',
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
return Number.isFinite(value) ? value : null;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const parseOpenCodeGoUsage = (html, now = Date.now()) => {
|
|
21
|
-
if (typeof html !== 'string') return {};
|
|
22
|
-
const normalized = html.replaceAll('"', '"').replaceAll('"', '"').replaceAll('\\u0022', '"').replaceAll('\\"', '"');
|
|
15
|
+
export const parseOpenCodeGoUsage = (payload) => {
|
|
16
|
+
const usage = payload && typeof payload === 'object' ? payload.usage : null;
|
|
17
|
+
if (!usage || typeof usage !== 'object') return {};
|
|
23
18
|
const windows = {};
|
|
24
|
-
for (const [key,
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
if (
|
|
19
|
+
for (const [key, apiKey] of Object.entries(windowsByApiKey)) {
|
|
20
|
+
const entry = usage[apiKey];
|
|
21
|
+
if (!entry || typeof entry !== 'object') continue;
|
|
22
|
+
const usedPercent = entry.percent;
|
|
23
|
+
const resetAt = entry.resetsAt;
|
|
24
|
+
if (typeof usedPercent !== 'number' || !Number.isFinite(usedPercent)) continue;
|
|
25
|
+
if (typeof resetAt !== 'string' || !Number.isFinite(new Date(resetAt).getTime())) continue;
|
|
31
26
|
windows[key] = toUsageWindow({
|
|
32
27
|
usedPercent: Math.min(100, Math.max(0, usedPercent)),
|
|
33
|
-
resetAt
|
|
28
|
+
resetAt,
|
|
34
29
|
windowSeconds: null,
|
|
35
30
|
});
|
|
36
31
|
}
|
|
37
32
|
return windows;
|
|
38
33
|
};
|
|
39
34
|
|
|
40
|
-
export const fetchOpenCodeGoUsage = async (
|
|
41
|
-
const response = await fetchImpl(
|
|
35
|
+
export const fetchOpenCodeGoUsage = async (apiKey, fetchImpl = fetch) => {
|
|
36
|
+
const response = await fetchImpl('https://opencode.ai/zen/go/v1/usage', {
|
|
42
37
|
headers: {
|
|
43
|
-
Accept: '
|
|
44
|
-
|
|
38
|
+
Accept: 'application/json',
|
|
39
|
+
Authorization: `Bearer ${apiKey}`,
|
|
45
40
|
'User-Agent': 'OpenChamber quota provider',
|
|
46
41
|
},
|
|
47
|
-
redirect: 'manual',
|
|
48
42
|
signal: AbortSignal.timeout(15_000),
|
|
49
43
|
});
|
|
50
|
-
if (response.status === 401 || response.status === 403
|
|
44
|
+
if (response.status === 401 || response.status === 403) {
|
|
51
45
|
throw new Error('OpenCode Go authentication failed');
|
|
52
46
|
}
|
|
53
|
-
if (!response.ok) throw new Error(`OpenCode Go
|
|
54
|
-
const windows = parseOpenCodeGoUsage(await response.
|
|
47
|
+
if (!response.ok) throw new Error(`OpenCode Go usage API returned HTTP ${response.status}`);
|
|
48
|
+
const windows = parseOpenCodeGoUsage(await response.json().catch(() => null));
|
|
55
49
|
if (Object.keys(windows).length === 0) throw new Error('OpenCode Go usage data could not be parsed');
|
|
56
50
|
return windows;
|
|
57
51
|
};
|
|
58
52
|
|
|
59
|
-
|
|
53
|
+
const getApiKey = () => {
|
|
54
|
+
const entry = normalizeAuthEntry(getAuthEntry(readAuthFile(), aliases));
|
|
55
|
+
return entry?.key ?? entry?.token ?? null;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const isConfigured = () => Boolean(getApiKey());
|
|
60
59
|
|
|
61
60
|
export const fetchQuota = async () => {
|
|
62
|
-
const credential = readOpenCodeGoCredential();
|
|
63
|
-
if (!credential) return buildResult({ providerId, providerName, ok: false, configured: false, error: 'Not configured' });
|
|
64
61
|
try {
|
|
65
|
-
|
|
62
|
+
deleteLegacyOpenCodeGoCredential();
|
|
63
|
+
const apiKey = getApiKey();
|
|
64
|
+
if (!apiKey) return buildResult({ providerId, providerName, ok: false, configured: false, error: 'Not configured' });
|
|
65
|
+
const windows = await fetchOpenCodeGoUsage(apiKey);
|
|
66
66
|
return buildResult({ providerId, providerName, ok: true, configured: true, usage: { windows } });
|
|
67
67
|
} catch (error) {
|
|
68
68
|
return buildResult({ providerId, providerName, ok: false, configured: true, error: error instanceof Error ? error.message : 'Request failed' });
|
|
@@ -1,17 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { afterAll, afterEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
|
|
6
|
+
const previousDataDirectory = process.env.OPENCHAMBER_DATA_DIR;
|
|
7
|
+
const temporaryDataDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'openchamber-opencode-go-'));
|
|
8
|
+
process.env.OPENCHAMBER_DATA_DIR = temporaryDataDirectory;
|
|
9
|
+
|
|
10
|
+
vi.mock('../../opencode/auth.js', () => ({
|
|
11
|
+
readAuthFile: () => ({ 'opencode-go': { key: 'test-key' } }),
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
import { fetchOpenCodeGoUsage, fetchQuota, parseOpenCodeGoUsage } from './opencode-go.js';
|
|
15
|
+
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
vi.unstubAllGlobals();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
afterAll(() => {
|
|
21
|
+
if (previousDataDirectory === undefined) delete process.env.OPENCHAMBER_DATA_DIR;
|
|
22
|
+
else process.env.OPENCHAMBER_DATA_DIR = previousDataDirectory;
|
|
23
|
+
fs.rmSync(temporaryDataDirectory, { recursive: true, force: true });
|
|
24
|
+
});
|
|
3
25
|
|
|
4
26
|
describe('OpenCode Go quota provider', () => {
|
|
5
|
-
it('parses partial
|
|
6
|
-
const windows = parseOpenCodeGoUsage(
|
|
27
|
+
it('parses partial API usage windows', () => {
|
|
28
|
+
const windows = parseOpenCodeGoUsage({ usage: { rolling: { percent: 25, resetsAt: '2026-08-12T12:00:00.000Z' }, weekly: { percent: 40, resetsAt: '2026-08-19T12:00:00.000Z' } } });
|
|
7
29
|
expect(windows['5h'].usedPercent).toBe(25);
|
|
8
|
-
expect(windows['5h'].resetAt).toBe(
|
|
30
|
+
expect(windows['5h'].resetAt).toBe('2026-08-12T12:00:00.000Z');
|
|
9
31
|
expect(windows.weekly.usedPercent).toBe(40);
|
|
10
32
|
expect(windows.monthly).toBeUndefined();
|
|
11
33
|
});
|
|
12
34
|
|
|
13
35
|
it('does not expose credentials in authentication errors', async () => {
|
|
14
|
-
|
|
15
|
-
|
|
36
|
+
await expect(fetchOpenCodeGoUsage('secret', async () => new Response('', { status: 403 }))).rejects.toThrow('authentication failed');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('uses the Go usage API with bearer authentication', async () => {
|
|
40
|
+
let request;
|
|
41
|
+
const usage = await fetchOpenCodeGoUsage('secret', async (url, options) => {
|
|
42
|
+
request = { url, options };
|
|
43
|
+
return new Response(JSON.stringify({ usage: { rolling: { percent: 25, resetsAt: '2026-08-12T12:00:00.000Z' } } }));
|
|
44
|
+
});
|
|
45
|
+
expect(request.url).toBe('https://opencode.ai/zen/go/v1/usage');
|
|
46
|
+
expect(request.options.headers).toMatchObject({ Accept: 'application/json', Authorization: 'Bearer secret' });
|
|
47
|
+
expect(request.options.headers.Cookie).toBeUndefined();
|
|
48
|
+
expect(usage['5h'].usedPercent).toBe(25);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('reads the API key from the OpenCode auth file', async () => {
|
|
52
|
+
const legacyPath = path.join(temporaryDataDirectory, 'quota', 'opencode-go.json');
|
|
53
|
+
fs.mkdirSync(path.dirname(legacyPath), { recursive: true });
|
|
54
|
+
fs.writeFileSync(legacyPath, '{not valid json', { mode: 0o600 });
|
|
55
|
+
const fetchMock = vi.fn().mockResolvedValue(new Response(JSON.stringify({ usage: { rolling: { percent: 25, resetsAt: '2026-08-12T12:00:00.000Z' } } })));
|
|
56
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
57
|
+
const result = await fetchQuota();
|
|
58
|
+
expect(result).toMatchObject({ providerId: 'opencode-go', ok: true, configured: true });
|
|
59
|
+
expect(fetchMock.mock.calls[0][1].headers.Authorization).toBe('Bearer test-key');
|
|
60
|
+
expect(fs.existsSync(legacyPath)).toBe(false);
|
|
16
61
|
});
|
|
17
62
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { deleteManagedCredential, getManagedCredentialStatus, normalizers, readManagedCredential, writeManagedCredential } from './credentials/providers.js';
|
|
3
|
-
import { fetchOpenCodeGoUsage } from './providers/opencode-go.js';
|
|
4
3
|
import { fetchOllamaCloudUsage } from './providers/ollama-cloud.js';
|
|
5
4
|
import { importCursorCredential, validateCursorCredential } from './providers/cursor.js';
|
|
6
5
|
|
|
7
6
|
const validators = {
|
|
8
|
-
'opencode-go': fetchOpenCodeGoUsage,
|
|
9
7
|
'ollama-cloud': fetchOllamaCloudUsage,
|
|
10
8
|
cursor: validateCursorCredential,
|
|
11
9
|
};
|
|
@@ -45,6 +45,8 @@ Everything a client normally sends to the single OpenChamber origin:
|
|
|
45
45
|
|
|
46
46
|
The host dispatcher restricts tunneled traffic to explicit path allowlists (one for HTTP, one for WS).
|
|
47
47
|
|
|
48
|
+
Request bodies crossing the tunnel are buffered on the host and forwarded to loopback only once the client's `StreamEnd` frame arrives (bodies above ~512 KB stream live instead). A body whose frames were lost in transit therefore never reaches the loopback server as an empty/truncated chunked body — the host aborts the stream and the client sees an ambiguous transport failure it can retry, instead of the loopback server's bare `400` ("Failed to send message (400)" from the mobile app).
|
|
49
|
+
|
|
48
50
|
## Authentication model
|
|
49
51
|
|
|
50
52
|
- The tunnel is **transport only**. The OpenChamber server still authenticates every tunneled request exactly as it authenticates a direct remote client. The relay path grants reachability, not authorization.
|