TessemblyDocs
0.3.x · RFC3 GitHub

LANGUAGE / DOCUMENT V1

Advanced declarations

Preserve supply, environment and F1/F2 conditions in declarative calls, using the same relation model as compact syntax.

Document structure

tessembly
tessembly "tessembly.rfc3.order.v1";
config {
    rule = seven_bag();
    start = boundary();
    see = view(next=5);
    hold = slot(initial=empty);
}
supply("P7");
draw(IN(1,3,T)&I<T,T);
use(I<T|!T);

Declare config, supply, draw and use at most once each. Duplicate keys or named arguments are rejected even if their values agree. Declaration order never overrides the environment. reference and select may repeat with different identifiers.

Statements end with semicolons. The grammar supports // comments, UTF-8 strings, booleans, unsigned integers, lists, positional and named arguments. A positional argument cannot follow a named argument. There are no arbitrary scripts, loops, function execution or network calls.

Supply functions

FunctionDeclared data
pattern("P4") or "P4"Compact supply AST
queue("IOT")Exact finite queue
shuffle("TTI")Distinct multiset permutations
bag("IOTSZJL")Refilling bag stream
pool("IT")Sampling-with-replacement stream
take(10, bag("IOTSZJL"))Finite prefix of ten draws
repeat(3, shuffle("SZ"))Three independent copies of a finite expression
concat(queue("IT"), shuffle("SZ"))Concatenation
either(queue("IT"), queue("TI"))Equal-length alternatives
external("vendor.rule", revision="v1", length=10)Versioned external policy reference

take cannot request more than a finite source contains. repeat requires a finite source. Concatenating anything after an unbounded stream is rejected. Parsing validates these length contracts without expanding permutations or drawing pieces.

Compact strings refer to standard kinds. Use lists for multi-character custom IDs. A source that cannot project to the standard relation tools remains SOURCE_REQUIRES_HOST, rather than being replaced with a guessed standard queue.

One condition model, explicit calls

Compact conditionAdvanced form
Tpresent("T")
I<Tbefore("I","T")
T[2]present(nth("T",2))
I[2]<Tbefore(nth("I",2),"T")
T=2count("T","=",2)
I&T / I|Tall(present("I"),present("T")) / any(present("I"),present("T"))
!Tnot(present("T"))
IN(1,3,T)within(1,3,present("T"))
tessembly
tessembly "tessembly.rfc3.order.v1";
config { registry=["PENTO_P"]; rule=from_source; }
supply(take(8, bag(["I","PENTO_P","PENTO_P"])));
draw(all(count("PENTO_P",">=",2),before(nth("PENTO_P",2),"I")));

draw/use accept standard-kind conditions directly or the explicit forms above. Formatting uses all/any/not/count/within/nth/before/present. before(A,B) always means A first. Argument counts/types and registered IDs are validated; these calls are data, not executable functions.

A single environment authority

A fragment with missing settings can be read and stored. Before execution, resolve rule, start, see and hold once with the host. with_host_config fills missing keys only; conflicting values yield CONFIG_CONFLICT. There is no last-value-wins behavior.

The uniform policy in rule=seven_bag() is fixed. from_source means the supply declaration describes its policy. Declare custom host settings through external("id",revision="..."). The identifier never triggers an automatic code download.

Compatibility boundary of existing references

reference stores an ID, format/value and optional page/revision. select preserves existing reference IDs and ordered at values. Reading these records does not fetch resources or perform setup/policy search. Keep setup goals, metrics and dataset logic in a consumer-owned envelope around supply data.