feat(process): record provider and verifier run lineage

This commit is contained in:
morluto
2026-07-22 14:01:47 +00:00
parent f5b3e22e72
commit 513fa294a4
200 changed files with 2808 additions and 546 deletions
+26
View File
@@ -0,0 +1,26 @@
import type { ProcessLineageObservation } from "./ProcessOwnership.js";
import { observeOwnedProcessLineage } from "./ProcessOwnership.js";
import type { ProviderProcessLaunch } from "./ProviderProcess.js";
/** Retain the latest truthful process-lineage observation for one client. */
export class ProviderRunLineage {
#observation: ProcessLineageObservation | null = null;
/** Clear stale lineage before a new launch attempt. */
reset(): void {
this.#observation = null;
}
/** Observe a token-owned launcher without signaling it. */
async observe(launch: ProviderProcessLaunch | undefined): Promise<void> {
if (launch?.ownership === undefined) return;
this.#observation = await observeOwnedProcessLineage(launch.ownership);
}
/** Return a detached copy suitable for caller-visible status. */
snapshot(): ProcessLineageObservation | null {
return this.#observation === null
? null
: structuredClone(this.#observation);
}
}