nx_twincard_gate.nx
buildroot/runtime/nx_twincard_gate.nx
about
nx_twincard_gate.nx -- the referee for nx_twincard_lib (aesthetictwin AT23, 2026-09-16). In-process, on fixtures built at
runtime under /tmp/twincard_gate/ (never the production schema, canon or a real card): a good card is accepted with its method
partition, coverage and completed left-right pairs exact, and a bad card is refused with every defect class counted and the
first offender named -- the group-label neg-control (an "ancestry" axis) is refused BY NAME, a face id not in the canon is
undeclared, a paired axis without a side and an unpaired axis with one are refused, a feature of unknown kind, unknown region
or outside its chart is refused, a signed value parses, a class word outside its declared set is refused. Values are printed
with gv_kv; the verdict line stays LAST.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_twincard_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 13 | const TG_DIR: *u8 = "/tmp/twincard_gate" |
| 14 | const TG_SCHEMA: *u8 = "/tmp/twincard_gate/twincard.axes" |
| 15 | const TG_CANON: *u8 = "/tmp/twincard_gate/facecanon.conf" |
| 16 | const TG_GOOD: *u8 = "/tmp/twincard_gate/good.card" |
| 17 | const TG_BAD: *u8 = "/tmp/twincard_gate/bad.card" |
| 18 | const TG_BAD2: *u8 = "/tmp/twincard_gate/bad2.card" |
| 19 | const TG_BAD2_TEXT: *u8 = "card|gamma|Gamma Fixture|real|F|REVIEW|1\naxis|ident|ancestry|C|anything|observed|r1|2026-09-16\n" |
| 20 | const TG_NEG20: i64 = 0 - 20 |
| 21 | const TG_SCHEMA_TEXT: *u8 = "axis|ident|stature|cm10|1200|2200|0|standing height\naxis|ident|sex|class|0|0|0|sex\nclass|ident|sex|F\nclass|ident|sex|M\nclass|ident|sex|X\naxis|skin|freckle_density|class|0|0|0|freckles\nclass|skin|freckle_density|none\nclass|skin|freckle_density|moderate\naxis|soft|areola_over_breast|permil|50|400|1|areola over breast base\naxis|eyes|canthal_tilt|deg10|-150|150|1|lateral canthus above medial is positive\nregion|face|the face chart\nregion|chest|the chest chart\nruler|soft|areola_over_breast|/tmp/twincard_gate/organ_present.nx|am_areola\nruler|face|*|/tmp/twincard_gate/organ_nosymbol.nx|pm_landmarks\nclass|shot|presentation|nude-art\nclass|shot|presentation|glamour\nclass|shot|makeup|none\nclass|shot|makeup|full\nclass|shot|hair_state|natural\nclass|shot|hair_state|styled\nclass|shot|retouch|raw\nclass|shot|retouch|unknown\n" |
| 22 | const TG_CANON_TEXT: *u8 = "canon|facial_index|bizygomatic|trichion-menton|744|0|0|A|permil|BRIEF|BRIEF\ncanon|vthird_upper|trichion-glabella|trichion-menton|333|0|0|A|permil|BRIEF|BRIEF\n" |
| 23 | const TG_GOOD_TEXT: *u8 = "card|alpha|Alpha Fixture|real|F|REVIEW|1\nref|r1|knowledge/fetched/fx.jpg|0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|REVIEW|mirrored\nref|r2|-|-|REVIEW|unmirrored paste\nshot|r1|2019-05|22|seated|neutral|dappled|wicker|eye-level|necklace|nude-art|none|natural|raw\nshot|r2|-|-|standing|smile|soft|studio|eye-level|-|glamour|full|styled|unknown\naxis|ident|stature|C|1680|measured|r1|2026-09-16\naxis|ident|sex|C|F|declared|operator|2026-09-16\naxis|skin|freckle_density|C|moderate|observed|r2|2026-09-16\naxis|soft|areola_over_breast|L|180|observed|r2|2026-09-16\naxis|soft|areola_over_breast|R|172|observed|r2|2026-09-16\naxis|eyes|canthal_tilt|L|-20|measured|r1|2026-09-16\naxis|face|facial_index|C|744|measured|r1|2026-09-16\nfeature|freckle|L|face|412|388|120|620|180|210|observed|r2\nfeature|mole|C|chest|500|300|450|350|150|120|measured|r1\n" |
| 24 | const TG_BAD_TEXT: *u8 = "card|beta|Beta Fixture|human|F|REVIEW|1\naxis|ident|ancestry|C|anything|observed|r1|2026-09-16\naxis|face|golden_ratio|C|618|measured|r1|2026-09-16\naxis|ident|stature|C|3000|measured|r1|2026-09-16\naxis|ident|stature|C|1700|measured|r1|2026-09-16\naxis|skin|freckle_density|C|lots|observed|r1|2026-09-16\naxis|eyes|canthal_tilt|L|10|guessed|r1|2026-09-16\naxis|soft|areola_over_breast|C|200|observed|r1|2026-09-16\naxis|ident|stature|L|1650|measured|r1|2026-09-16\nref|r1|-|abc|REVIEW|bad sha\nshot|r9|-|-|-|-|-|-|-|-|nude-art|none|natural|raw\nshot|r1|-|-|-|-|-|-|-|-|beach|none|natural|raw\nfeature|wart|L|face|10|10|10|500|0|0|observed|r1\nfeature|freckle|L|nowhere|10|10|10|500|0|0|observed|r1\nfeature|freckle|L|face|2000|10|10|500|0|0|observed|r1\n" |
| 25 | const TG_GOOD_AXES: i64 = 7 |
| 26 | const TG_GOOD_MEASURED: i64 = 3 |
| 27 | const TG_GOOD_OBSERVED: i64 = 3 |
| 28 | const TG_GOOD_DECLARED: i64 = 1 |
| 29 | const TG_GOOD_REFS: i64 = 2 |
| 30 | const TG_GOOD_SHOTS: i64 = 2 |
| 31 | const TG_GOOD_FEATURES: i64 = 2 |
| 32 | const TG_SCHEMA_SECTIONS: i64 = 4 |
| 33 | const TG_FACE_DECLARED: i64 = 2 |
| 34 | const TG_SOFT_DECLARED: i64 = 2 |
| 35 | const TG_EYES_DECLARED: i64 = 2 |
| 36 | const TG_TOTAL_DECLARED: i64 = 9 |
| 37 | const TG_TOTAL_FILLED: i64 = 7 |
| 38 | const TG_PAIRS_DECLARED: i64 = 2 |
| 39 | const TG_HALF: i64 = 500 |
| 40 | const TG_BAD_DEFECTS: i64 = 15 |
| 41 | const TG_BAD_SHOTS: i64 = 2 |
| 42 | const TG_COV_AXES: i64 = 7 |
| 43 | const TG_COV_RULED: i64 = 3 |
| 44 | const TG_COV_UNRULED: i64 = 4 |
| 45 | const TG_BAD_UNDECLARED: i64 = 2 |
| 46 | const TG_BAD_SIDE: i64 = 2 |
| 47 | const TG_BAD_FEATURES: i64 = 3 |
| 48 | const TG_BAD_AXES: i64 = 8 |
| 49 | const TG_CENSUS_N: i64 = 4 |
| 53 | const TG_CEN_SCHEMA: *u8 = "/tmp/twincard_gate/census.axes" |
| 54 | const TG_ORGAN_PRESENT: *u8 = "/tmp/twincard_gate/organ_present.nx" |
| 55 | const TG_ORGAN_NOSYMBOL: *u8 = "/tmp/twincard_gate/organ_nosymbol.nx" |
| 56 | const TG_ORGAN_MISSING: *u8 = "/tmp/twincard_gate/organ_missing.nx" |
| 57 | const TG_ORGAN_PRESENT_TEXT: *u8 = "func am_areola(x: i64) -> i64 {\n return x\n}\n" |
| 58 | const TG_ORGAN_NOSYMBOL_TEXT: *u8 = "func tg_unrelated(x: i64) -> i64 {\n return x\n}\n" |
| 59 | const TG_CEN_SCHEMA_TEXT: *u8 = "ruler|soft|areola_over_breast|/tmp/twincard_gate/organ_present.nx|am_areola\nruler|face|*|/tmp/twincard_gate/organ_nosymbol.nx|pm_landmarks\nruler|eyes|canthal_tilt|/tmp/twincard_gate/organ_missing.nx|ct_tilt\n" |
| 60 | const TG_CEN_ROWS: i64 = 3 |
| 61 | const TG_CEN_ABSENT_AFTER: i64 = 2 |
functions
| 63 | func tg_write(path: *u8, text: *u8) -> i64 |
| 71 | func main(argc: i64, argv: *i64) -> i64 |