deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
sisyphus-iambe/northstar-exam
Trust checkpoint for AI-generated code, agent reports & embodied-AI artifacts — the exam hall for LLM output. Solves LLM hallucination with programmatic verification: four-layer statistical exams, invariant examiner, conclusion anchors. No LLM self-evaluation — deterministic verdicts.
PROJECT TOPICS
PROJECT README
Submit an AI-generated implementation, get a four-layer verdict (L1 calibration / L2 cross-reference / L3 coverage / L4 degenerate inputs). Correct → ACCEPT, wrong → REJECT. No LLM self-evaluation anywhere — the verdict is computed by deterministic programmatic checks against independent references.
Northstar treats a statistical implementation like a candidate sitting an exam: you submit a .py implementation, the platform runs a four-layer exam and returns a per-layer verdict (L1 distribution / L2 cross-reference / L3 coverage / L4 degenerate inputs) together with a report card. It is especially sensitive to code that "looks right but computes wrong" — wrong degrees of freedom, wrong p-value formulas, and silent p-value filling on degenerate inputs (on the classes where the reference itself fails honestly) are exactly the bug classes it catches.
# 1. Dependencies: Python 3.14.6 + NumPy + SciPy
pip install numpy scipy
# 2. Write your implementation (contract: chi2_pvalue(observed) -> float, see example below)
# File: my_chi2.py
# 3. Submit for examination
python3 -m spsl.run exams/exam_pearson_demo.json my_chi2.py --out verdict.json
Example output (correct implementation — textbook formula, example below):
[spsl] exam pearson_chi2_demo — my_chi2.chi2_pvalue, 3 runs (seeds 20260807..20260809), took 0.3 s
L1: PASS (rejected 0/3)
L2: PASS (rejected 0/3)
L3: PASS (rejected 0/3)
L4: PASS (rejected 0/3)
Verdict: ACCEPT (rejected 0/3)
[spsl] JSON -> verdict.json
Example output (wrong implementation — always returns 0.5):
L1: REJECT (rejected 3/3)
L2: REJECT (rejected 3/3)
L3: REJECT (rejected 3/3)
L4: REJECT (rejected 3/3)
Verdict: REJECT (rejected 3/3)
my_chi2.py — a minimal correct implementation (Pearson chi-square test of independence, textbook formula):
import numpy as np
from scipy.special import gammaincc
def chi2_pvalue(observed):
obs = np.asarray(observed, dtype=float)
row_tot, col_tot = obs.sum(axis=1), obs.sum(axis=0)
n = float(obs.sum())
expected = np.outer(row_tot, col_tot) / n
chi2 = float(np.sum((obs - expected) ** 2 / expected))
dof = (obs.shape[0] - 1) * (obs.shape[1] - 1)
return float(gammaincc(dof / 2.0, chi2 / 2.0))
The four layers exist because these bug classes are real, common, and silent. All numbers below are measured in our internal acceptance evaluations.
ref_dev diagnostic is recorded.)spec (spec JSON) → compile (exam JSON) → submit (candidate .py) → four-layer report
spsl.run loads the candidate implementation and runs the four-layer verdict.spsl/registry.py dispatches by constraint_type; examiner families register their own (compile_fn, run_fn) and INPUT_TYPES. In this repo today:statistical — the four-layer exam above (pearson_chi2, wilcoxon families).conclusion_anchor — anchors a capability conclusion on real data: the candidate estimates coverage of a stated conclusion, and the examiner verifies it against the underlying dataset (generator-based: AR(1) / normal, or self-provided parquet data).demo_data — dirty-sample detection on robot demonstration data (specs/spec_demo_data.json; the dataset itself is not bundled — point root at your own data).state_estimator — state-estimation accuracy against a reference implementation on simulated data.invariant (v3 stage 1) — identity-based, reference-free judgement: checks that a candidate's functions satisfy mathematical identities (e.g. direction complementarity p_less(x,y) vs p_greater(y,x)) with zero references, catching flip-style bugs at 500-sample resolution. Exams live in experiments/v3_stage1/exams/ (also mirrored in exams/; the main spsl.run pipeline dispatches them on layer=INV).This repository ships the full exam-setting kit: the four-layer engine, the spec schema, the examiner registry, the compiled exams for both statistical families (exams/, four-layer and L1-only), the invariant exams and their knowledge base, the question-bank evolution pipeline (experiments/exam_evolution/), the self-proof calibration experiment (calibrator/), and the local determinism checks (ci/batch_determinism.py). No closed exams — compile, inspect, verify, and re-derive everything yourself.
Every exam JSON is tamper-evident: content_md5 is recomputed on load against the normalized content, and spec_md5 against the embedded spec. You can recompile any exam from its spec with python3 -m spsl.compile_l1/l2/l3/l4 (invariant exams: python3 -m spsl.compile_inv) and diff the fingerprints.
python3 -m verifytool my_chi2.py runs the full four-layer pipeline with per-run rejection counts and produces an HTML report card plus a JSON verdict with payload_md5/self_md5 double fingerprints. python3 -m verifytool templates list shows the 22-template library (9 exam templates + 5 error controls + 8 real-world demos).python3 -m spsl.run_inv experiments/v3_stage1/exams/exam_ranksum_inv.json candidates/ranksum_correct.py runs the reference-free identity exam (candidates: ranksum_correct.py → PASS, ranksum_flip.py → REJECT).mcp/northstar_mcp.py exposes the exam pipeline as an MCP stdio server: submit candidates, run exams (statistical four-layer via spec name, conclusion_anchor / demo_data / state_estimator via spec, invariant via exam_wsr_inv / exam_ranksum_inv), fetch verdicts. Requires the mcp package (pip install "mcp==1.29.0") plus numpy/scipy. Dispatch delegates to spsl.run subprocesses — the gateway contains no judgement logic. For DeepSeek Harness: see DSH-INTEGRATION.md.calibrator/run_experiment.py re-derives the calibration-layer acceptance numbers (reference agreement, generator dual-path, L1 uniformity, sensitivity ≥ 0.95, false-kill ≤ 5%) from first principles.exams/exam_pearson_full.json, exams/exam_wilcoxon_full.json (+ L1-only variants, + exam_pearson_demo.json for a fast smoke test).experiments/v3_stage1/).specs/spec_demo_data.json).This repository is licensed under BUSL 1.1 (Business Source License 1.1): the source code is visible, and non-commercial use (personal learning / teaching / evaluation / research) is free; commercial use requires a license. After the Change Date (2030-08-11) it converts to Apache License 2.0. See LICENSE.
For commercial use, please contact the maintainer (open an issue or use any contact channel on the repository page) — the exam-hall model (licensed use of the exam-setting kit) is also available.
ci/batch_determinism.py — 5 exam pairs byte-identical on re-run; tests/, 27 tests).demo_data examiner requires a parquet dataset (AppleToPlate-style trajectories) — set root in specs/spec_demo_data.json to your own data; the other examiners need no external data.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。