Align host settings with the 1.0 lifecycle

This commit is contained in:
vorotamoroz
2026-07-20 13:20:48 +00:00
parent 52e7bd25da
commit 80d1416a81
28 changed files with 360 additions and 57 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ npm run test:e2e:obsidian:local-suite:services
`test:contract:context:cli` builds the Node CLI and runs its existing Deno setup, put, read, list, information, remove, conflict-resolution, and revision workflow. `test:contract:context:obsidian` builds the plug-in and runs the real-Obsidian smoke test, including the Context inspection. These runtime scripts are local validation entry points and are not added to the default CI gate by this change.
`test:e2e:obsidian:onboarding-invitation` starts an unconfigured temporary Vault and verifies that startup offers the setup wizard without opening it or scanning Vault files automatically. It checks the invitation action and introduction in mobile test mode, then uses the permanent command to reopen the wizard on the desktop. This scenario owns the unconfigured-startup boundary only; configured compatibility review remains covered by `settings-ui`, and the setup workflows remain covered by their dedicated scenarios.
`test:e2e:obsidian:onboarding-invitation` starts an unconfigured temporary Vault with no plug-in data and verifies that startup selects Commonlib's new-Vault recommendations, offers the setup wizard without opening it, and does not scan Vault files automatically. It checks the invitation action and introduction in mobile test mode, then uses the permanent command to reopen the wizard on the desktop. This scenario owns the unconfigured-startup boundary only; configured compatibility review remains covered by `settings-ui`, and the setup workflows remain covered by their dedicated scenarios.
`test:e2e:obsidian:dialog-mounts` starts a temporary real Obsidian session and exercises two representative Svelte dialogue routes: remote server selection through `SetupManager`, and Setup URI entry through the registered command. The session pre-seeds a configured, inactive plug-in state so that onboarding and migration prompts do not interfere with the dialogues under test. It requires each dialogue title and its principal controls to be visible, captures desktop and mobile screenshots, closes them through their normal user controls, and verifies that the remote-selection promise settles without an error. This covers the host, context, component, and result boundaries moved during the Commonlib package extraction without applying settings or contacting a remote service.
@@ -19,6 +19,10 @@ type UnconfiguredStartupEvidence = {
configured: boolean;
markerInDatabase: boolean;
offlineScanInitialised: boolean;
recommendedDefaults: {
usePluginSyncV2: boolean;
handleFilenameCaseSensitive: boolean;
};
};
type ObsidianTestApp = {
@@ -47,10 +51,15 @@ async function inspectUnconfiguredStartup(
"try{entry=await core.localDatabase.getDBEntry(markerPath,undefined,false,false);}catch{}",
"let initialised=false;",
"try{initialised=(await core.kvDB.get('initialized'))===true;}catch{}",
"const settings=core.services.setting.currentSettings();",
"return JSON.stringify({",
"configured:core.services.setting.currentSettings()?.isConfigured===true,",
"configured:settings?.isConfigured===true,",
"markerInDatabase:Boolean(entry&&entry._id),",
"offlineScanInitialised:initialised,",
"recommendedDefaults:{",
"usePluginSyncV2:settings?.usePluginSyncV2,",
"handleFilenameCaseSensitive:settings?.handleFilenameCaseSensitive,",
"},",
"});",
"})()",
].join(""),
@@ -167,12 +176,18 @@ async function main(): Promise<void> {
startupGraceMs: Number(process.env.E2E_OBSIDIAN_STARTUP_GRACE_MS ?? 1000),
});
const evidence = await inspectUnconfiguredStartup(cli.binary, session.cliEnv);
console.log(`Fresh Vault startup evidence: ${JSON.stringify(evidence)}`);
await requireInvitationWithoutDialogue();
if (evidence.configured || evidence.markerInDatabase || evidence.offlineScanInitialised) {
throw new Error(`Unconfigured startup performed ordinary processing: ${JSON.stringify(evidence)}`);
const evidence = await inspectUnconfiguredStartup(cli.binary, session.cliEnv);
if (
evidence.configured ||
evidence.markerInDatabase ||
evidence.offlineScanInitialised ||
evidence.recommendedDefaults.usePluginSyncV2 !== true ||
evidence.recommendedDefaults.handleFilenameCaseSensitive !== false
) {
throw new Error(`Fresh Vault startup state did not match its contract: ${JSON.stringify(evidence)}`);
}
console.log(`Fresh Vault startup evidence: ${JSON.stringify(evidence)}`);
const desktopInvitation = await captureDesktopInvitation();
await openPermanentCommand();