Droso

Primitive-mining criteria (frozen)

Status: FROZEN 2026-07-30, written before tools/mine_primitives.py runs. No revision after results are seen; every later edit needs a dated entry in the change log at the bottom. This is the contract for proposal item 4, variant (b) (“mine the 30-day library for reusable primitives”).

0. Blindness

The miner reads only (i) the procedure stores named below, (ii) this document, (iii) an operator-supplied coverage-tasks JSON (schema in §7). It never reads the battery, the held-out files, or any diagnosis narrative. The coverage mapping against the nine refused tasks is a mechanical step over the kind signatures defined here, applied by the operator to the miner’s output.

1. Source corpus

Two stores are inventoried and reported separately:

The miner found the live store at state/house_agent_learning.json (9,845 lines, 680 procedures) and the seeder file at exocortex/learned_procedures.json (277 entries: 274 innate + 3 trial_replay). 396 live entries qualified as mining sources under the rules below; 1 seeder entry did.

An entry is a mining source only if all hold:

Per source entry, fragments are lifted from the most recent verified solution only.

2. What counts as a reusable primitive

A fragment is a strict sub-part of a stored solution, lifted as one of:

The lifted block excludes the function’s final return; the miner’s wrapper supplies return <last assigned name> (or the comprehension itself).

Parameterizability (the generalization bar). Every literal in the fragment is masked to a slot; the original literal is the default fill. A fragment with no literals is admitted only if its normalized form is not already in the candidate space (§4). A fragment that reads no enclosing function parameter is a constant, not vocabulary, and is rejected. A fragment whose only liftable content is a name the junk list already covers as a builtin is rejected.

Dedupe. The normalized form (AST dump with literals masked and names canonicalized) must not match any body in PRIMITIVES, HINTS, HINT_PAIRS or PROGRAM_SHAPES in organs/reasoning_loop.py, nor an already-mined fragment (first wins; ties by source confidence, then store order).

3. Verifier standard

Every candidate fragment is wrapped as a standalone function (free names that are enclosing parameters become parameters; masked literals become keyword parameters with the original literal as default) and run in the sandbox:

Admissible iff at least 3 inputs run clean (exit 0, no exception) and the fragment runs clean on the source’s own examples when those exist. Inputs of the wrong type for the fragment may error; they are recorded, not fatal. The recorded input→output behaviour is part of the admission report, so edge-case wrongness (the stem('class') failure mode) is reviewable before anything is banked. The verifier proves “runs”; the report makes “behaves” visible.

4. Same-lane admission

Mined primitives are banked into the live store as entries with source == "mined", trigger text = the source task’s own wording, code = the generalized fragment. They then ride the existing lanes with zero code change:

No new lane, no score bonus, no floor change, no gate change, no change to the per-task enumeration budget (10) or the prog cap (14).

Known limitation, recorded now: the library: lane uses stored code verbatim, so a banked fragment fires there only when its stored function name matches the tests’ target; the compose lane renames and is therefore the primary path. If admission later adds the existing rename adaptation to the library: lane, that is a small mechanical reuse of compose’s machinery and must be logged as a change; it is not part of this freeze.

Optionally, admission may also add mined entries as word-triggered HINTS/PROGRAM_SHAPES entries (same scores the lanes already use: 0.3–0.45 prog, 0.35/0.4 hints; slots only of the existing {c}/{e} kinds with fills from the existing _INNER tables). This is a candidate-space constant change, subject to the budget in §5, and must be logged.

5. Enumeration budget

6. Kind signatures (structural, for coverage accounting)

7. Coverage accounting (the measured number)

The nine refused tasks (count_vowels, second_largest, slugify, intersperse, most_common, rot13, levenshtein, pig_latin, running_total) with their diagnosed kinds. A refused task is covered iff ≥ 1 admitted mined entry has a matching kind signature and at least one of its trigger words appears in the task’s wording. The dry-run reports: per kind, admitted entry names; per refused task, covered yes/no and by which entries; and the count of covered tasks. This replaces the proposal’s 4–6 analogy estimate with a measurement. The same mapping is reported for the fresh set, clearly separated, as the “after” probe target. The fresh set’s pre-admission first-contact baseline is state/fitness/fresh_baseline.json, beside the 0.6834 composite snapshot (baseline_cap1024.json): 11 clean slots, 0 passed, all routed to the reasoning loop, oracle disabled, learn=False. The count_digits slot was excluded — a probe bug let a library-recallable task through; the bug and the exclusion are recorded in the file’s provenance wrapper and fixed in tools/fresh_heldout.py.

Coverage-tasks JSON schema (operator-supplied): [{"name": str, "task": str, "kind": one of the six}].

8. What the dry-run may touch

Reads: the two stores, organs/reasoning_loop.py (constants only, for dedupe), this document, the coverage-tasks JSON. Writes: its report under _tmp/ and nothing else. No store writes, no candidate-space writes, no gate changes. Without --dry-run the tool refuses to run: admission is a later, logged change.

Change log