RFD 1065: Taskweft domain schema in essential tuple normal form
Problem
RFD 1064 asks Claude to inspect 15,000 dataset rows and write one problem.ex per row. Many rows share the same hair color, eye color, and pose, worded in different ways. A fixed trait list misses new values, and free text per row repeats the same fact many times.
Decision
Design the domain.ex/problem.ex schema per essential tuple normal form (ETNF), from Darwen, Date, and Fagin (ICDT 2012). See DETAILS.md for the definition and its worked example. Three rules follow.
@variablesholds a trait map, keyed by trait name, one value per character, matching thehave/handle/loadedpattern in RFD 1044’sdomain.ex. The key is a superkey, so the map sits in BCNF.- The trait taxonomy comes from the training data, not from preconceived categories.
capabilitiesstarts empty, and a domain action grows it as it resolves each trait value to a capability id.problem.exstores a:refto that id, never text. - The resolve step runs inside taskweft, through the
HRR/HRR.Cleanuplibrary RFD 1021 already supplies, not throughWeftspunStudio.FactVectoroutside it. A near-duplicate caption binds to the existing id, instead of creating a new one.
Rule 2 and rule 3 remove the redundancy together. A functional dependency anchored on the capability id, a superkey, blocks the redundant tuple that ETNF targets, with no fixed enum to maintain.