( ce: ComputeEngine, e: Entry, knownHeads: Set<string> )
| 64 | } |
| 65 | |
| 66 | export function boxCheckEntry( |
| 67 | ce: ComputeEngine, |
| 68 | e: Entry, |
| 69 | knownHeads: Set<string> |
| 70 | ): BoxResult { |
| 71 | const familyHeads = new Set(e.indexedFamilies ?? []); |
| 72 | const unknownHeads = e.heads.filter( |
| 73 | (h) => !knownHeads.has(h) && !familyHeads.has(h) |
| 74 | ); |
| 75 | return withEntryScope(ce, e, () => { |
| 76 | const errors: string[] = []; |
| 77 | try { |
| 78 | collectErrors(ce.expr(e.formula as any).canonical, errors); |
| 79 | if (e.assumptions != null) |
| 80 | collectErrors(ce.expr(e.assumptions as any).canonical, errors); |
| 81 | } catch (err: any) { |
| 82 | errors.push(`THROW: ${String(err?.message ?? err).slice(0, 200)}`); |
| 83 | } |
| 84 | if (errors.length === 0) return { id: e.id, topic: e.topic, outcome: 'ok' }; |
| 85 | if (unknownHeads.length > 0) |
| 86 | return { |
| 87 | id: e.id, |
| 88 | topic: e.topic, |
| 89 | outcome: 'unknown-symbol', |
| 90 | errors, |
| 91 | unknownHeads, |
| 92 | }; |
| 93 | return { id: e.id, topic: e.topic, outcome: 'box-error', errors }; |
| 94 | }); |
| 95 | } |
| 96 | |
| 97 | export type Stage1Report = { |
| 98 | total: number; |
no test coverage detected