Expand description
Deterministic, heuristic-only semantic tagging for AINL / ArmaraOS.
No ML, embeddings, or graph-store dependency.
Structs§
- Correction
Regexes - Compiled regex bundle for correction extraction.
- Semantic
Tag
Enums§
Constants§
- BEHAVIOR_
ADDING_ CAVEATS - BEHAVIOR_
OVEREXPLAINING - CORRECTION_
AVOID_ BULLETS - CORRECTION_
AVOID_ EMOJIS - PREFERENCE_
BREVITY - PREFERENCE_
DETAIL - PREFERENCE_
DIRECTNESS - PREFERENCE_
EXAMPLES - TONE_
FORMAL - TONE_
INFORMAL
Functions§
- correction_
regexes - Lazily compiled correction regexes (identical patterns to legacy
persona_signals). - extract_
correction_ behavior - Stage-1 triggers + stage-2 regex normalization, mapped to canonical
SemanticTagvalues. - infer_
brevity_ preference - Detects an explicit brevity preference (including legacy
EXPLICIT_BREVITYsubstring cues). - infer_
formality - Returns
tone:formalortone:informalwhen the score is outside the ambiguous band(0.38, 0.62); otherwiseNone. Confidence is always0.75on a match. - infer_
topic_ tags - Deterministic keyword tagging for broad topics. One tag per topic slug; confidence is the max
across that slug’s keyword hits (
0.85exact / phrase,0.70substring for single-token keys). - quantize_
confidence - Quantize
confidenceto [0, 100] for equality and hashing (~two decimal places of resolution). Non-finite values (NaN, ±∞) map to 0 so they cannot poisonHashimplementations. - tag_
tool_ names - Maps tool name strings to canonical
TagNamespace::Tooltags. Unknown tools are retained with a sanitized slug and confidence0.5. - tag_
turn - Tags user + assistant text and tool metadata; deduplicates by
(namespace, value). - tag_
user_ message - Runs all preference detectors; multiple matches return multiple tags.