Skip to the content

Capsid menu

app/kb/procedures/proof.server.ts

19 lines and 3 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.

Functions

The functions of proof.server.ts
FunctionLinesComplexityCoveredCRAPMutation
proofFor13 to 214No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
<anonymous:18>18 to 181No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
<anonymous:19>19 to 191No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code

Imports

It imports app/db/phages.ts, app/db/publications.ts, app/kb/procedures/proof.mjs, app/kb/procedures/render.mjs, app/lib/phages/compile.mjs. Imported by app/routes/procedure.tsx, app/routes/procedure[.md].ts.

Source

import { listPhages } from "~/db/phages";
import { listPublishedPublications } from "~/db/publications";
import { phageSlug } from "~/lib/phages/compile.mjs";

import { resolveProof } from "./proof.mjs";
import type { ProcedureRecord } from "./render.mjs";

/**
 * A protocol's proof of use with its words and addresses: the file holds slugs, and the papers' titles and the phages'
 * names are read from their rows, so a corrected title reaches every protocol that names the paper. Only the tables a
 * protocol actually names are read.
 */
export async function proofFor(env: Env, stored: ProcedureRecord["proofOfUse"]) {
  if (!stored) return null;
  const papers = stored.papers.length > 0 ? await listPublishedPublications(env) : [];
  const phages = stored.phages.length > 0 ? await listPhages(env) : [];
  return resolveProof(stored, {
    papers: new Map(papers.map((p) => [p.slug, { title: p.title, year: p.year }])),
    phages: new Map(phages.map((p) => [phageSlug(p.name), p.name])),
  });
}