factor_agent.gate#

The Gate: deterministic checks that every candidate passes before it is evaluated.

Gate.check never reads data; what candidates may write with is its Vocabulary, from the campaign’s field and operator files. A bad candidate comes back Rejected with readable reasons; only an infrastructure failure raises. The checks run in this order:

  1. static checks on the code (syntax allow-list, names in the vocabulary, alpha assigned);

  2. the graph build in a sandboxed subprocess (timeout from when the sandbox is ready, memory limit, bubblewrap filesystem isolation where it is installed);

  3. the stage rules of an intraday family’s candidate (stages.split): an intraday field reaches the daily stage only through a session aggregation, the intraday stage reads no daily field, no aggregation of a daily value or of an aggregation, each operator is used only in its stages, each window and lag is one of its stage’s set; each refusal says how to write it instead (Rejected.hints);

  4. the graph’s size, parameter values, dimensions and complexity, all reported together;

  5. originality against the zoo: not a rewrite of a zoo factor, not one with other windows or parameters only, and no common subtree with one larger than the limit. The reasons name the zoo factor and quote the subtree;

  6. not a duplicate of a candidate this gate passed before: the same canonical graph up to what keeps or reverses its ranking (Graph.ranking): a factor and its negation predict alike, in opposite directions.

Classes

Gate

Check candidates; see the module docstring for the order of the checks.

Passed

A candidate whose graph was built: the graph, its fingerprint and its statistics.

Rejected

A candidate refused by the gate, with the reasons sent back to the proposer.

Modules

graph

A candidate's KunQuant graph as plain data: what the Gate records and the Evaluator compiles.

stages

The stage split: a candidate's recorded graph as the graphs it runs as, and the stage rules it breaks.

vocabulary

The Vocabulary: the fields, operators and parameter values a campaign's candidates may write with.