* refactor(domain): consolidate canonical ordering and digest helpers (#624) * refactor(domain): consolidate canonical ordering and digest helpers Single owner for code-point ordering (domain/canonicalOrdering.ts) and canonical JSON digests (domain/comparisonSemantics.ts). Delete all local compareCodePoints/compareText/digestCanonical duplicates and migrate every importer. No re-export shims. * fix(ci): allow slower real browser startup * chore(config): remove dead eslint, dedupe scripts, cacheable turbo tasks Delete eslint.config.js (oxlint is the linter), drop lint:dead alias, pin smol-toml, fold jscpd/scan:todos into check:pr, make test:run cacheable, align oxlint ignores. * fix(config): hash all test inputs for cached runs * docs: fix architecture diagram and pretty-print tool catalog Drop dangling REPLAY edges, add dotnet/reference/error/evaluation nodes. Emit 2-space JSON from the catalog generator and regenerate. * test: extract shared fixtures, drop knip carve-outs Dedupe android/apple session tests, bundler adapter headers, and reconstruction helpers into tests/support fixtures. Delete unused type aliases and the knip ignoreIssues block. Lower jscpd threshold 2.7 to 2.5. * refactor(app): split Setup and ProcessOwnership modules Extract SetupTypes/SetupHost from Setup.ts and move observation helpers into ProcessOwnershipObservation/ProcessTree. Migrate all importers including CLI commands. No re-export shims.
27 lines
986 B
TypeScript
27 lines
986 B
TypeScript
import type { ProcessLineageObservation } from "./ProcessOwnership.js";
|
|
import { observeOwnedProcessLineage } from "./ProcessOwnershipObservation.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);
|
|
}
|
|
}
|