interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tests / one_layer / generalization / families / FAMSIG_V1.md

194 lines · 11990 bytes Raw Blame History Source

GEN family signature and split contract (v1, frozen 2026-10-15)

Issue: aien-spark/omega#476 (GEN-1), program aien-spark/omega#475. This contract is frozen BEFORE the custodian authors any held-out task. Its only implementation is tools/gen/protocol/famsig_lib.h (tools famsig and gencheck). A change to the signature or token definition needs a new version (FAMSIG_V2.md, signature prefix gs2:). Additive amendments made before any held-out task exists (the token, the coarse form, rules R6 and R7, famsig compare) are dated in place. After the custodian seals, nothing changes. docs/one_layer/GEN_PROTOCOL_V1.md pins this file by sha256.

1. What a family is

A family is a composition template: which primitives a task's SPECIFICATION combines, and how they nest. It is declared by the task author from the task's prompt (what the task asks for), never computed from a reference solution. Identifiers, constants, types, edge cases and trap rules do not enter the signature: renaming a function or changing a constant never makes a new family.

2. Primitives and the nesting shape

Six primitives. Declare each from the prompt:

primitivekinddeclare it when the specification asks for
arithleafone arithmetic, bitwise, shift, comparison or conversion step stated as a single operation ("add x to the total", "is n even")
nestedleafone formula combining at least three operands with at least two operations, computed as a single value ("3xx + 2*x + 1"); declared instead of arith for such a formula
arrayleafa fixed-length sequence (length 1..64) of values written or read by index (inputs packed into an array, a table, a buffer); one array per distinct use
branch(X)containera choice between behaviours on a condition; X is what the chosen arm(s) do
loop(X)containera step repeated a bounded number of times (count from a parameter or constant, or until a condition with a stated bound); X is the repeated body
call(X)containera helper computation the prompt names (its own parameters and result) that the solution must define and use; X is the helper's own body. The functional check cannot see helper use; the family describes the specification

seq(A,B,...) writes steps one after another. It is grouping only: not a primitive, never counted.

Grammar (ASCII, no spaces, 1..512 bytes, at most 8 levels of nesting, at most 64 nodes):

node      := leaf | container "(" list ")" | "seq(" node "," list ")"
list      := node ("," node)*
leaf      := "arith" | "array" | "nested"
container := "branch" | "call" | "loop"

A container needs at least one child, a leaf takes none, a seq needs at least two children.

3. Signature

Canonical form: (1) a seq directly inside a container or inside another seq is replaced by its children (loop(seq(a,b)) = loop(a,b), seq(a,seq(b,c)) = seq(a,b,c)); (2) every child list is sorted by byte order (C locale strcmp) of the children's canonical strings, duplicates kept. Sibling order therefore never matters; nesting does (loop(branch(arith)) and branch(loop(arith)) differ).

Signature = gs1: + canonical form, e.g. seq(loop(branch(arith),array),array) has signature gs1:seq(array,loop(array,branch(arith))). famsig canon <shape> prints it.

Family token (for fields that allow only [a-z0-9_-], such as the record family field of tools/gen/retrieval/CONTRACT.md and its --exclude-family): gs1- + the first 16 lowercase hex digits of sha256 of the signature bytes (gs1: included, no newline). famsig token <shape> prints it. A record or task carries the token of the family of the task it was written for. (Added 2026-10-15, before any consumer used v1: additive, no rule changed.)

Composition edges of a shape: P>C for every container P and every child C of P after flattening, where C is the child's head primitive (famsig edges <shape>). Coarse edges: the same with a child nested read as arith, duplicates removed. Coarse edges gate through R7 (section 4).

Coarse form (rule R6; added 2026-10-15 at review of PR #486, before any held-out task existed): (1) nested is read as arith; (2) seq is flattened as in the canonical form; (3) every child list is sorted and duplicate siblings are collapsed to one, and a seq left with one child is that child; (4) a top-level seq whose children are exactly one container plus only leaves is replaced by that container. Coarse signature = gc1: + coarse form; famsig coarse <shape> prints it. Examples: loop(branch(nested)), loop(branch(arith,arith)) and seq(arith,loop(branch(arith))) all have gc1:loop(branch(arith)); loop(branch(arith),arith) has gc1:loop(arith,branch(arith)) (a leaf added inside a container is a different coarse family; R7 decides whether it adds an edge the corpus lacks).

4. Metadata lines and the disjointness rule

One line per task, fields separated by exactly one space:

<task_id> <split> <arith> <branch> <loop> <array> <call> <nested> <shape>

Known limit: R6, R7 and R8 are syntactic. A corpus family nested below the top level and given a leaf sibling, such as loop(branch(arith),arith) next to a corpus loop(branch(arith)), passes R6 (different coarse form) and R8 (not a top-level step), and passes R7 only if no corpus shape has the edge loop>arith. What the shape cannot show (the same algorithm declared under a different shape) is the job of the reviewer's blind re-declaration and the near-duplicate check (GEN_PROTOCOL_V1 section 2).

famsig rule <file>... applies R1..R8 over every task of every file given, prints per split split <s> tasks=<n> families=<m>, then one family <split> <signature> tasks=<k> line per family (held-out families only with --show-heldout, adding novel_edges=<e>: coarse edges no corpus shape has), and ends RULE PASS (exit 0) or FAIL R<k> ... lines and RULE FAIL (exit 1). A failure that involves a held-out task hides the held-out signature unless --show-heldout is given. Counts (60 held-out tasks, at least 6 held-out families, 10 dev tasks) are checked by gencheck against protocol.json, not by famsig.

famsig compare <SPLIT> <REDECLARED> (blind re-declaration, GEN_PROTOCOL_V1 section 2): both files are in the gen-split 1 format of section 6 (any salt; the reviewer draws its own); it prints only tasks=<n> mismatches=<k>, where a mismatch is a task whose signature differs between the two files, and exits 1 when k > 0 or the two files do not name exactly the same task ids. It never prints a signature.

5. Where metadata lives

splitfilevisibility
devtests/one_layer/generalization/dev/METApublic, in the repo
corpustests/one_layer/generalization/corpus/META (Agent D, GEN-3)public, in the repo
heldoutSPLIT in the custodian's sealed directory (owner gencust, mode 0700)sealed

Public files (gen-meta 1): first line exactly gen-meta 1; then metadata lines; # comment lines and blank lines are allowed; a heldout line is refused. Bytes: \n and 0x20..0x7E only, final \n.

Held-out metadata NEVER goes inside tasks.tar (whose member rules, HARNESS_INTERFACE_V2.md section 3, refuse any extra file) and is never published before the run.

6. The sealed split file (SPLIT, written by the custodian)

gen-split 1
salt <64 lowercase hex: 32 random bytes the custodian draws once>
<metadata line, split heldout>          (one per held-out task)

Rules: line 1 exactly gen-split 1; line 2 the salt; then only heldout lines, task ids strictly ascending in byte order; no comments, no blank lines; \n and 0x20..0x7E only; final \n. The task ids are exactly the case directories of the sealed tasks.tar.

Before sealing, the custodian runs (as gencust) famsig rule dev/META corpus/META SPLIT (R1..R8) and seals only on RULE PASS. It must use the corpus META at the commit the run pins.

7. The public commitment (HELDOUT.pub, published by the custodian before any held-out generation)

gen-heldout-pub 1
tasks_sha256 <64 hex: sha256 of tasks.tar, as in TASKS.sha256>
split_sha256 <64 hex>
famlist_sha256 <64 hex>
tasks <n>
families <m>
task <task_id>                            (one per task, strictly ascending, n lines)

Exactly these lines in this order, single spaces, final \n. Nothing about any family is published except families <m> and the two salted digests. After the run (or for the independent review, after the seal), anyone holding SPLIT verifies with gencheck split that SPLIT matches HELDOUT.pub (digests, ids, counts) and that R1..R8 pass against the pinned dev and corpus META.

8. Reserved dev families (v1): signature and token

The 10 dev fixtures devgen01..devgen10 hold these four signatures; no corpus or held-out task may use them (R3):

gs1:branch(loop(arith),nested)              gs1-e05d1c5dffd08b06
gs1:loop(call(nested))                      gs1-bd9c105e5ae45397
gs1:loop(loop(branch(arith)))               gs1-f63e09ec03a454ee
gs1:seq(array,loop(array,branch(arith)))    gs1-30938c5c7504ef0e

Their coarse signatures (R6: no corpus or held-out task may have these either):

gc1:branch(arith,loop(arith))
gc1:loop(call(arith))
gc1:loop(loop(branch(arith)))
gc1:loop(array,branch(arith))