Offline MoonBit library and CLI for auditing transcription of repeated quality-control measurements against a reviewed reference.
moon run --frozen --target js cmd/audit -- fixtures/main.txt fixtures/main-reference.tsv fixtures/swapped.tsvf=fixtures/blind
run=$(mktemp -d)
mkdir "$run/empty"
cp "$f"/{splits.tsv,quick-set.tsv,plan.tsv,source.txt,reference.tsv,prompt-a.txt,prompt-b.txt} "$run/empty/"
moon run --frozen --target js cmd/audit -- --freeze-blind-set "$run/empty/splits.tsv" "$run/empty/quick-set.tsv" --require-empty-slots > "$run/freeze.json"
for variant in a b; do
moon run --frozen --target js cmd/audit -- --export-blind-request "$run/empty/splits.tsv" "$run/empty/quick-set.tsv" "$run/freeze.json" trial-005 "$variant" > "$run/request-$variant.json"
done
review() {
local stage=$1 expected=$2 status=0
moon run --frozen --target js cmd/audit -- --score-blind-set "$run/$stage/splits.tsv" "$run/$stage/quick-set.tsv" "$run/freeze.json" > "$run/$stage.report.json" || status=$?
test "$status" -eq "$expected"
}
review empty 2
cp -R "$run/empty" "$run/partial"
cp "$f/response-a.json" "$run/partial/a.json"
cp "$f/response-invalid.json" "$run/partial/b.json"
review partial 2
cp -R "$run/empty" "$run/complete"
cp "$run/partial/a.json" "$run/complete/a.json"
cp "$f/response-b.json" "$run/complete/b.json"
review complete 0
printf '%s\n' "$run"| 阶段 | 保存的报告 | 预期 |
|---|---|---|
| 缺答 | empty.report.json | 计划 1 项、4 个核准键,两版均缺答 |
| 部分完成 | partial.report.json | A 为 2/4,B 格式无效,整批差值为空 |
| 完成 | complete.report.json | A 为 2/4,B 为 4/4,整批差值为 +2 |
pub struct Row {
part : String
operator : String
repeat : String
value : Double?
unit : String
mm : Double?
source_line : Int
source_quote : String?
// private fields
}pub struct Score {
reference_keys : Int
correct_keys : Int
issue_count : Int
bad_reference_keys : Int
extra_keys : Int
correct_unmeasured : Int
correct_true_zero : Int
unit_equivalent : Int
}fn check_split_source_text(text : String, normalized_sha256 : (String) -> String?) -> String raise AuditErrorfn check_split_sources(text : String, source_sha256 : (String) -> String?) -> String raise AuditErrorfn compare(source : String, reference : Array[Row], candidate : Array[Row]) -> String raise AuditErrorfn evaluate(source : String, reference : Array[Row], candidate : Array[Row]) -> Evaluation raise AuditErrorInstall
Download zipOffline MoonBit library and CLI for auditing transcription of repeated quality-control measurements against a reviewed reference.