szl-unit-invariants
Checks declared SI dimensions, allowlisted unit conversions, expected ranges and fixed pointwise invariants (equal, sum, difference, product, ratio) over selected measurement or simulation columns, flagging incompatible quantities, scale errors of 1000x and broken conservation checks. Use when merging instrument exports with different units, validating simulation output against conservation laws, or when a reviewer asks how unit errors were ruled out. Not an uncertainty-propagation or symbolic tool.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- szl-unit-invariants
- license
- Apache-2.0
- description
- Checks declared SI dimensions, allowlisted unit conversions, expected ranges and fixed pointwise invariants (equal, sum, difference, product, ratio) over selected measurement or simulation columns, flagging incompatible quantities, scale errors of 1000x and broken conservation checks. Use when merging instrument exports with different units, validating simulation output against conservation laws, or when a reviewer asks how unit errors were ruled out. Not an uncertainty-propagation or symbolic tool.
02 资源文件 5
- 资产文件assets/example.json874 B
- 脚本kernel.py12.8 KB
- 参考文档references/contract.md5.0 KB
- 参考文档references/provenance.md1.2 KB
- 脚本scripts/run.py2.2 KB
03 SKILL.md 正文
Unit invariants
A µg column read as mg survives every statistical test and ruins the paper. Declare what each column is supposed to be and let the helper check dimensions, ranges and the relations that must hold pointwise. Python 3.9+, stdlib, offline, decimal arithmetic at 50 significant digits.
Use when
- Combining plate-reader, LC-MS and clinical exports that report the same quantity in different units.
- Checking that mass, energy or charge is conserved row by row in a simulation output.
- A flow rate, dose or concentration column has values 1000x off from the declared range.
Quick start
python scripts/run.py assets/example.json --output unit-report.json
The invented example (a duration, a length in cm and a speed check) returns
"status": "PASS_DECLARED_CHECKS" with each quantity's SI dimension vector, declared_dimension_match
and SI-normalized values. Introduce a cm/m mix-up and the report carries SCALE_MISMATCH or
RANGE_VIOLATION with the exact factor.
Declaring checks
Select a bounded set of columns; declare unit, SI dimension, expected range and prespecified
invariants. Use decimal strings when precision matters. Read references/contract.md for the unit
table, dimension order and operation grammar. Call szl_audit_unit_invariants(record) in kernel.py
or run the CLI. Inspect dimension failures before interpreting numeric agreement; review range
violations, numerical discrepancies, undefined ratios and flagged factors of at least 1000.
Preserve original values: a corrected declaration is a new audit, not evidence that the original passed.
What it does not do
Offset units (Celsius), logarithmic units, implicit broadcasting, arbitrary formulas and units absent
from the table are rejected. Success means the declared checks pass on supplied values; observed units,
physical laws and scientific conclusions are not verified, and finite decimal arithmetic does not replace
uncertainty propagation or a symbolic proof. Limits: 1 MiB input, 1000 quantities and invariants,
10,000 samples. Provenance: references/provenance.md.
04 同仓库更多 Skills
szl-uncertainty-lineage
Propagate declared measurement uncertainty through a small arithmetic dependency graph using a first-order delta approximation. Use when a researcher needs to see how corrected inputs or shared-source correlation change a reported standard uncertainty; require unit checks separately.
szl-typesafe-ai
TypeSafe/Jev: Choice/Noul/Score in code, not TypeScript types. System One models turn natural language and application state into probabilities that software can compose. Use when building routing, ranking, extraction, verification, or replacing an LLM prompt-and-parse step with structured decisions; also when brainstorming what TypeSafe could make possible. Do not use for TypeScript/Java/Rust static types, Zod/Pydantic/mypy/JSON Schema/protobuf codegen, or asking whether a pipeline is type-safe. At SZL, Jev is an optional second reader only.
demo
暂无简介
demo
暂无简介
szl-skill-update-review
Compare pinned local skill packages using inventories and a retained lock; report changed skills, files, declarations and reruns without approving safety or validity.
szl-skill-conformance
Checks retained scientific skill-sharing evidence: exact local source and supplied host-export resource bytes, explicit import aliases, task and result digests, positive versus irrelevant-task trigger declarations, and optional artifact-to-trace byte bindings. Use when a shared skill appears imported but invocation is uncertain, when comparing retained trials across hosts, or when an update may invalidate an earlier result. Offline checking never executes the candidate and never certifies real host invocation or scientific correctness.