Skip to content
AGaspire-si-gates
Python 3.10+ · no dependencies · MIT

One set of gates, for the generator and the trainer.

The dataset generator and the trainer both call aspire-si-gates, so what a generator accepts is exactly what the trainer will accept. Every gate raises or returns a reason you can act on. Nothing is fixed silently.

Install

pip install aspire-si-gates # Python 3.10 or newer. # standard library only. no dependencies.

Validate a file

from aspire_si_gates import DataError, load, validate rows = load("batch3-t05.jsonl") try: validate(rows) except DataError as err: print(err.code, err.message, err.hint)

Gate one item

from aspire_si_gates import check_against, check_item check_item(row) # raises DataError problems = check_against(row, accepted) # [(code, message), ...] to hand back to the writer

What the gates check

Each gate is a check in code, with a stable reason code.

Row checks

check_item needs no other row. It refuses an apply item, because apply items are never trained. check_apply_item runs the apply rules on the apply items and refuses everything else.

Whole-set checks

check_batch looks at the finished set: shares, floors, pairs, and the phrase and formula limits. validate runs every row check, then these.

Incremental refusals

check_against tells a generator, one item at a time, which exclusivity rule a new row breaks against the rows already accepted: spans, framings, material, puzzle shapes, openings and phrases. The codes never change.

Trace leaks

check_trace_leaks_label refuses a kind C row whose checker trace names its own planted flaw. It runs inside check_batch.

A recorded identity

gates_identity returns the package version and a sha256 of its source, so each generated item can record exactly which gates passed it.

Closed to the outside

It reads the rows you pass and the one file you give to load. No network, no other files, no subprocesses, no telemetry.

Use it

Install

pip install aspire-si-gates

Report the figures

from aspire_si_gates import batch_report, freeze_report, gates_identity

print(batch_report(rows))
print(gates_identity())  # {"version": ..., "sha256": ...}