feat(ql3): gate primary on shadow capture evidence

This commit is contained in:
whyour
2026-08-19 03:27:32 +08:00
parent c60a86d1bf
commit be98d6753b
28 changed files with 2227 additions and 30 deletions
@@ -64,6 +64,7 @@ function classifyError(error: unknown): string {
class SerialLegacyExecutionObservation
implements TrackedLegacyExecutionObservation
{
private readonly capture: Promise<LegacyShadowRunReference | null>;
private chain: Promise<LegacyShadowRunReference | null>;
constructor(
@@ -72,10 +73,15 @@ class SerialLegacyExecutionObservation
accepted: LegacyExecutionAcceptedFact,
private readonly reporter: ShadowObservationReporter,
) {
this.chain = writer.accept(accepted).catch((error) => {
this.capture = writer.accept(accepted).catch((error) => {
this.report('accept', error);
return null;
});
this.chain = this.capture;
}
async captureSettled(): Promise<'captured' | 'failed'> {
return (await this.capture) === null ? 'failed' : 'captured';
}
spawned(fact: LegacyExecutionSpawnedFact): void {