@@ -133,6 +133,62 @@ private static String resolveOidColor(final String SIMPLECLASSNAME)
133133 return OID_DEFAULT ;
134134 }
135135
136+ /**
137+ * Maps a class name to a grayscale ANSI 256 shade based on its proximity to US law.
138+ * ANSI 256 grayscale ramp: 232 (near-black) → 255 (near-white).
139+ *
140+ * Theory of term:
141+ * - Classes that embody or enforce US law (security, national ID, auth, exceptions,
142+ * encryption, admin, signatory) are most lawful → darkest (toward black, 232).
143+ * - Classes that are pure infrastructure / utility with no legal character
144+ * (messaging, timing, sim, telnet I/O) → lightest (toward white, 255).
145+ * - All others fall in between proportionally.
146+ *
147+ * Scale (ANSI grayscale code):
148+ * 232 most lawful — security, national authority, authentication
149+ * 236 — encryption, admin, exceptions
150+ * 240 — database, finance, bitcoin
151+ * 245 — connections, server infrastructure
152+ * 250 — commons, output, printing
153+ * 255 least lawful — messaging, timing, sim, telnet I/O
154+ */
155+ private static String resolveLawfulness (final String SIMPLECLASSNAME )
156+ {
157+ if (SIMPLECLASSNAME == null || !USE_COLORED_OUTPUT ) return "" ;
158+ String low = SIMPLECLASSNAME .toLowerCase ();
159+
160+ // Most lawful: direct US legal authority, security, national ID, auth, admin
161+ if (low .contains ("security" ) || low .contains ("national" ) || low .contains ("auth" )
162+ || low .contains ("admin" ) || low .contains ("signatory" ) || low .contains ("cia" )
163+ || low .contains ("fbi" ) || low .contains ("port" ) || low .contains ("bodi" ))
164+ return "\033 [38;5;232m" ;
165+
166+ // Very lawful: encryption, exceptions, persistence
167+ if (low .contains ("encrypt" ) || low .contains ("exception" ) || low .contains ("persistence" )
168+ || low .contains ("listener" ) || low .contains ("handler" ))
169+ return "\033 [38;5;236m" ;
170+
171+ // Moderately lawful: finance, database, bitcoin transactions
172+ if (low .contains ("finance" ) || low .contains ("store" ) || low .contains ("datasource" )
173+ || low .contains ("bitcoin" ) || low .contains ("trader" ) || low .contains ("wallet" )
174+ || low .contains ("ascii" ) || low .contains ("signature" ) || low .contains ("module" ))
175+ return "\033 [38;5;240m" ;
176+
177+ // Infrastructure: connections, server, WebExpress
178+ if (low .contains ("connection" ) || low .contains ("server" ) || low .contains ("express" )
179+ || low .contains ("nitro" ) || low .contains ("poller" ) || low .contains ("installer" )
180+ || low .contains ("driver" ) || low .contains ("status" ) || low .contains ("shutdown" ))
181+ return "\033 [38;5;245m" ;
182+
183+ // Commons / utilities
184+ if (low .contains ("common" ) || low .contains ("rail" ) || low .contains ("iranian" )
185+ || low .contains ("wedding" ) || low .contains ("arith" ) || low .contains ("english" ))
186+ return "\033 [38;5;250m" ;
187+
188+ // Least lawful: messaging, timing, simulation, raw I/O
189+ return "\033 [38;5;255m" ;
190+ }
191+
136192 public static <T > Integer size (final ArrayList <T > LIST )
137193 {
138194 return LIST .size ();
@@ -199,7 +255,9 @@ public static void printSystemComponent(final Object OBJECT, final Integer HASHC
199255 String classname = "[" + inner + " " .repeat (innerPad ) + "]" ;
200256
201257 // classname is already the fixed-width bracketed field; use as-is
202- String classnamePadded = classname ;
258+ String classnamePadded = USE_COLORED_OUTPUT
259+ ? resolveLawfulness (OBJECT .getClass ().getSimpleName ()) + classname + ANSI_RESET
260+ : classname ;
203261
204262 String compliant_hashcode = String .format ("%010d" , HASHCODE );
205263
@@ -704,6 +762,9 @@ public static void printSystemComponent(final Object OBJECT, final Integer HASHC
704762 String inner = "Current: @" + OBJECT .getClass ().getSimpleName ();
705763 int innerPad = Math .max (0 , CLASSNAME_TOTAL_WIDTH - inner .length ());
706764 String classname = "[" + inner + " " .repeat (innerPad ) + "]" ;
765+ String classnamePadded = USE_COLORED_OUTPUT
766+ ? resolveLawfulness (OBJECT .getClass ().getSimpleName ()) + classname + ANSI_RESET
767+ : classname ;
707768
708769 String compliant_hashcode = String .format ("%010d" , HASHCODE );
709770 String colored_hashcode = USE_COLORED_OUTPUT
@@ -741,7 +802,7 @@ public static void printSystemComponent(final Object OBJECT, final Integer HASHC
741802 catch (Throwable ignored ) {}
742803 }
743804
744- String reference = object_id + " " + date + " " + classname + " " + lineFixed ;
805+ String reference = object_id + " " + date + " " + classnamePadded + " " + lineFixed ;
745806
746807 try { NationalDriver .record (reference ); } catch (Throwable ignored ) {}
747808
0 commit comments