@@ -152,9 +152,113 @@ private static String resolveOidColor(final String SIMPLECLASSNAME)
152152 * 250 — commons, output, printing
153153 * 255 least lawful — messaging, timing, sim, telnet I/O
154154 */
155+ /** Two shades darker than terminal reset (255); used for [Current: @ClassName] field. */
156+ private static final String ANSI_NEAR_RESET_DARK2 = "\033 [38;5;253m" ;
157+
158+ /**
159+ * Scores a class name across four concern axes and maps the sum to an ANSI-256 grayscale color.
160+ *
161+ * AXES & MAX POINTS (total = 13):
162+ *
163+ * 1. Platonic Form proximity (0–4):
164+ * How near to the Form of the Good (Republic).
165+ * 4 = Philosopher-King (sovereign, guardian, identity)
166+ * 3 = Episteme / anamnesis (knowledge, record, truth-preservation)
167+ * 2 = Demiourgoi / sophrosyne (commerce, material stewardship)
168+ * 1 = Auxiliaries / andreia (infrastructure, coordination)
169+ * 0 = Eikasia / shadow (raw conduit, simulation, I/O)
170+ *
171+ * 2. Etymology — civic rootedness (0–3):
172+ * 3 = Latin/Greek civic origin: nationalis, securitas, authentikos, signatorius
173+ * 2 = Latin disciplinary origin: exceptio, persistere, kryptos
174+ * 1 = Romance/Germanic utility: connectere, servire, communis
175+ * 0 = Modern portmanteau or purely technical: queue, telnet, sim
176+ *
177+ * 3. Social program — contribution to the polis (0–3):
178+ * 3 = Direct: state protection, lawful identity, civic record
179+ * 2 = Indirect: economic participation, infrastructure enabling cooperation
180+ * 1 = Facilitative: shared language, utilities all classes depend on
181+ * 0 = Neutral conduit: carries meaning without producing civic value
182+ *
183+ * 4. Ethics — weight of obligation (0–3):
184+ * 3 = Deontological duty (justice, protection of the governed)
185+ * 2 = Stewardship (proportional exchange, accountability)
186+ * 1 = Virtue of reliability (service, accessibility)
187+ * 0 = Instrumental (value from what is conveyed, not the conveying)
188+ *
189+ * SPECTRUM:
190+ * score 0 → ANSI 238 (darkest in range — least normative, pure shadow)
191+ * score 13 → ANSI 255 (pure white / at reset — most lawful, nearest Form of the Good)
192+ * intermediate scores interpolate linearly across 238–255 (17-step range, ~1.31 per point)
193+ */
155194 private static String resolveLawfulness (final String SIMPLECLASSNAME )
156195 {
157- return "" ;
196+ if (SIMPLECLASSNAME == null || !USE_COLORED_OUTPUT ) return "" ;
197+ String low = SIMPLECLASSNAME .toLowerCase ();
198+
199+ int plato = 0 , etym = 0 , social = 0 , ethics = 0 ;
200+
201+ // ── Platonic Form proximity ───────────────────────────────────────────
202+ if (low .contains ("national" ) || low .contains ("security" ) || low .contains ("auth" )
203+ || low .contains ("admin" ) || low .contains ("signatory" ) || low .contains ("bodi" )
204+ || low .contains ("port" ) || low .contains ("cia" ) || low .contains ("fbi" ))
205+ plato = 4 ;
206+ else if (low .contains ("encrypt" ) || low .contains ("exception" ) || low .contains ("persistence" )
207+ || low .contains ("listener" ) || low .contains ("handler" ))
208+ plato = 3 ;
209+ else if (low .contains ("finance" ) || low .contains ("store" ) || low .contains ("datasource" )
210+ || low .contains ("bitcoin" ) || low .contains ("trader" ) || low .contains ("wallet" )
211+ || low .contains ("ascii" ) || low .contains ("signature" ) || low .contains ("module" ))
212+ plato = 2 ;
213+ else if (low .contains ("connection" ) || low .contains ("server" ) || low .contains ("express" )
214+ || low .contains ("nitro" ) || low .contains ("poller" ) || low .contains ("installer" )
215+ || low .contains ("driver" ) || low .contains ("status" ) || low .contains ("shutdown" ))
216+ plato = 1 ;
217+ // else plato = 0 (eikasia: messaging, queue, sim, telnet, raw I/O)
218+
219+ // ── Etymology — civic rootedness ──────────────────────────────────────
220+ if (low .contains ("national" ) || low .contains ("security" ) || low .contains ("auth" )
221+ || low .contains ("signatory" ) || low .contains ("admin" ))
222+ etym = 3 ;
223+ else if (low .contains ("encrypt" ) || low .contains ("exception" ) || low .contains ("persist" )
224+ || low .contains ("handler" ) || low .contains ("finance" ) || low .contains ("store" ))
225+ etym = 2 ;
226+ else if (low .contains ("connect" ) || low .contains ("server" ) || low .contains ("common" )
227+ || low .contains ("arith" ) || low .contains ("driver" ) || low .contains ("module" ))
228+ etym = 1 ;
229+ // else etym = 0 (queue, telnet, sim, bitcoin portmanteau, raw I/O)
230+
231+ // ── Social program — contribution to the polis ────────────────────────
232+ if (low .contains ("national" ) || low .contains ("security" ) || low .contains ("auth" )
233+ || low .contains ("signatory" ) || low .contains ("admin" ) || low .contains ("bodi" ))
234+ social = 3 ;
235+ else if (low .contains ("finance" ) || low .contains ("bitcoin" ) || low .contains ("store" )
236+ || low .contains ("connection" ) || low .contains ("server" ) || low .contains ("encrypt" )
237+ || low .contains ("exception" ) || low .contains ("installer" ) || low .contains ("module" ))
238+ social = 2 ;
239+ else if (low .contains ("common" ) || low .contains ("rail" ) || low .contains ("arith" )
240+ || low .contains ("handler" ) || low .contains ("driver" ) || low .contains ("status" ))
241+ social = 1 ;
242+ // else social = 0 (neutral conduit)
243+
244+ // ── Ethics — weight of obligation ─────────────────────────────────────
245+ if (low .contains ("national" ) || low .contains ("security" ) || low .contains ("auth" )
246+ || low .contains ("signatory" ) || low .contains ("admin" ))
247+ ethics = 3 ;
248+ else if (low .contains ("finance" ) || low .contains ("store" ) || low .contains ("exception" )
249+ || low .contains ("persist" ) || low .contains ("encrypt" ) || low .contains ("bitcoin" ))
250+ ethics = 2 ;
251+ else if (low .contains ("server" ) || low .contains ("connect" ) || low .contains ("common" )
252+ || low .contains ("handler" ) || low .contains ("driver" ) || low .contains ("module" ))
253+ ethics = 1 ;
254+ // else ethics = 0 (instrumental)
255+
256+ // ── Map total score (0–13) → ANSI-256 grayscale (238–255) ────────────
257+ // Inverted: most lawful (score 13) → 255 (lightest, at/above reset)
258+ // least lawful (score 0) → 238 (darker, but above old floor)
259+ int score = plato + etym + social + ethics ; // 0–13
260+ int code = 238 + (int ) Math .round (score * (17.0 / 13.0 )); // 238–255
261+ return "\033 [38;5;" + code + "m" ;
158262 }
159263
160264 /** Return the same ANSI-256 color as resolveLawfulness but 2 shades darker (min 232). */
0 commit comments