mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-16 14:22:32 +00:00
Retire redundant P2P Review Harness check
This commit is contained in:
@@ -20,11 +20,6 @@ export interface ReviewHarnessRuntime {
|
||||
isCompatibilityReviewInitialised(): boolean;
|
||||
getCompatibilityPause(): CompatibilityPause | undefined;
|
||||
openCompatibilityReview(): Promise<void>;
|
||||
getP2PComposition(): {
|
||||
readonly first: unknown;
|
||||
readonly second: unknown;
|
||||
readonly expectedServices: unknown;
|
||||
};
|
||||
runVaultRoundTrip(): Promise<ReviewHarnessScenarioResult>;
|
||||
readContinuation(): string | null;
|
||||
writeContinuation(value: string): void;
|
||||
@@ -63,37 +58,6 @@ function initialResults(): Record<ReviewHarnessScenarioId, ReviewHarnessScenario
|
||||
>;
|
||||
}
|
||||
|
||||
function inspectP2PComposition(input: ReturnType<ReviewHarnessRuntime["getP2PComposition"]>): ReviewHarnessScenarioResult {
|
||||
if (input.first !== input.second) {
|
||||
return {
|
||||
status: "failed",
|
||||
detail: "Two consecutive reads resolved different P2P replicators without a lifecycle transition.",
|
||||
observations: [],
|
||||
};
|
||||
}
|
||||
if (typeof input.first !== "object" || input.first === null) {
|
||||
return {
|
||||
status: "failed",
|
||||
detail: "The P2P composition did not expose a current replicator.",
|
||||
observations: [],
|
||||
};
|
||||
}
|
||||
const env = "env" in input.first ? input.first.env : undefined;
|
||||
const services = typeof env === "object" && env !== null && "services" in env ? env.services : undefined;
|
||||
if (services !== input.expectedServices) {
|
||||
return {
|
||||
status: "failed",
|
||||
detail: "The current P2P replicator is not bound to the active Obsidian services.",
|
||||
observations: [],
|
||||
};
|
||||
}
|
||||
return {
|
||||
status: "passed",
|
||||
detail: "The live P2P result resolves the current replicator and active Obsidian services.",
|
||||
observations: [],
|
||||
};
|
||||
}
|
||||
|
||||
export class ReviewHarnessController {
|
||||
private readonly results = initialResults();
|
||||
private readonly transcript: ReviewHarnessTranscriptEntry[] = [];
|
||||
@@ -163,9 +127,7 @@ export class ReviewHarnessController {
|
||||
}
|
||||
|
||||
async runAutomaticScenarios(): Promise<void> {
|
||||
for (const id of ["settings-lifecycle", "p2p-composition"] as const) {
|
||||
await this.runScenario(id);
|
||||
}
|
||||
await this.runScenario("settings-lifecycle");
|
||||
}
|
||||
|
||||
async runAllScenarios(): Promise<void> {
|
||||
@@ -195,8 +157,6 @@ export class ReviewHarnessController {
|
||||
settings: this.runtime.getSettings(),
|
||||
newVaultSettings: this.runtime.getNewVaultSettings(),
|
||||
});
|
||||
} else if (id === "p2p-composition") {
|
||||
result = inspectP2PComposition(this.runtime.getP2PComposition());
|
||||
} else if (id === "vault-round-trip") {
|
||||
result = await this.runtime.runVaultRoundTrip();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user