MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / buildGroundTruthReceipt

Function buildGroundTruthReceipt

src/schedule/receipt.ts:84–103  ·  view source on GitHub ↗
(input: {
  status: RunReceipt['status'];
  prUrl?: string;
  reason?: string;
  filesChanged?: string[];
  verification?: ReceiptCheck[];
  summary?: string;
})

Source from the content-addressed store, hash-verified

82 * This is the uncounterfeitable half: filesChanged + verification are facts QodeX measured.
83 */
84export function buildGroundTruthReceipt(input: {
85 status: RunReceipt['status'];
86 prUrl?: string;
87 reason?: string;
88 filesChanged?: string[];
89 verification?: ReceiptCheck[];
90 summary?: string;
91}): RunReceipt {
92 const byCmd = new Map<string, boolean>();
93 for (const c of input.verification ?? []) if (c.command) byCmd.set(c.command, !!c.passed);
94 const verification = [...byCmd].map(([command, passed]) => ({ command, passed }));
95 return {
96 status: input.status,
97 prUrl: str(input.prUrl),
98 reason: str(input.reason),
99 summary: str(input.summary),
100 filesChanged: input.filesChanged?.length ? dedupeStr(input.filesChanged) : undefined,
101 verification: verification.length ? verification : undefined,
102 };
103}
104
105function dedupeStr(xs: string[]): string[] {
106 const seen = new Set<string>(); const out: string[] = [];

Callers 2

writeRunReceiptMethod · 0.85

Calls 3

strFunction · 0.85
dedupeStrFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected