yatharth-assurance
v0.1.5
Published
Read, query and check Yatharth assessments (offline assurance for object-detection datasets and models) from JavaScript.
Maintainers
Readme
yatharth-assurance
Read, query and check Yatharth assessments from JavaScript, in Node or in a browser.
Yatharth is an offline assurance system for object-detection datasets and the models trained on them. Its checks cover:
- poisoned or flipped labels;
- duplicates and flooding;
- train/validation leakage;
- foreign images;
- trigger patches and backdoored models;
- substituted models;
- tampered prediction logs;
- drift.
Each assessment writes a single findings.json. This package reads that file. It never
re-judges: the decision, severity and confidence are read exactly as Yatharth wrote them, and
nothing is combined into a score.
The assessments themselves are produced by the Python package: pip install "yatharth[all,tui]".
Install
npm install yatharth-assuranceNode 18 or later. No dependencies.
Command line
npx yatharth-report runs/my-run # decision, findings by kind, claims, checks NOT RUN
npx yatharth-report runs/my-run --json # the same, as JSON (for CI)
npx yatharth-report runs/my-run --type swapped_label --limit 5
npx yatharth-report runs/my-run --asset IMG_0042.jpg # every finding about one file
npx yatharth-report runs/my-run --check # exit 1 if the report breaks the contractruns/my-run can be a yatharth run folder, a dataset workspace, or a findings.json path.
These work in a project where the package is installed. Without installing it, use
npx -p yatharth-assurance yatharth-report runs/my-run.
Library
import {
readReport, summarise, findings, byAsset, claims, notAssessed, explain, checkShape, runYatharth,
} from "yatharth-assurance";
const report = await readReport("runs/my-run"); // Node: a path. Browser: pass the fetched object.
const s = summarise(report);
s.decision; // "quarantine" | "review" | "accept" | "recalibrate" | "inconclusive"
s.decision_meaning; // the plain-English meaning
s.driven_by; // the claim ids that set it
s.by_type; // { swapped_label: 212, ... }
s.not_assessed; // [{ engine, reason }] - a check that did not run is never a pass
for (const f of findings(report, { severity: "high", type: "backdoor_trigger" })) {
const e = explain(f);
console.log(e.kind, e.about, e.reason, e.limitations, e.corroborating_axes);
}
claims(report, "contradicted"); // which guarantees failed
byAsset(report); // Map: asset id -> its findings
checkShape(report); // [] when the report matches the contract
// Run the Python CLI from Node (needs `pip install yatharth`):
const code = await runYatharth(["run", "--mode", "data", "--submission", "case/submission", "--yes"], {
onLine: (line) => console.log(line),
});Types
Full TypeScript types for the report (AnalysisReport, EvidenceObject, ClaimAssessment and
the rest) ship with the package. They are generated from the same JSON Schemas as the Python
contracts, so the two cannot drift apart. The schemas themselves are available as
yatharth-assurance/schemas/<name>.schema.json if you want to validate with your own tool.
Licence
Proprietary, © 2026 Aditya Tipirneni and team SPARCX, all rights reserved; see the LICENSE file in this package.
You may install and run it unmodified to evaluate it. Any other use needs written permission.
Part of Yatharth, SIH 2026, PS 26228.
