DecidrHolon Design Kit

Patterns

Privacy, redaction, and context boundaries

Screen and redact visitor text before any model runs, withhold private details from storage, isolate public and internal ports, block restricted domains, and apply the tail-light rule.

Privacy is enforced before any model sees a visitor's words and again before any text reaches the screen or the event store. Reference: guards.mjs Reference: flow.mjs House note: three-service holon The same discipline governs network ports, outbound domains, and the narrow context slice handed to external vendors. Holon rules §1.3 Ruling 18 Ruling 56

Best practices

  • Normalise and screen every message in code before any model reads it. Lift out emails, phone numbers, card numbers, and ID numbers first, then stop secrets and internal probes. Reference: guards.mjs House note: three-service holon
  • Withhold private text from the reply model, thread history, page feed, and event store. Visitor text reaches the screen and the store only after the privacy rule has run. Reference: flow.mjs House note: three-service holon
  • Scrub digit runs in conversation history while keeping the organisation's own numbers whole. Prevent visitors from reconstructing a phone or ID number across multiple turns without breaking the organisation's published contact number. Reference: guards.mjs Holon rules §3.3
  • Split public visitor ports from internal loopback inspection ports. Serve public traffic strictly through an allowlisted visitor view (visitorView) and load secrets only from *_KEY_FILE paths. Holon rules §1.3 Holon rules §3.4 Ruling 21
  • Block restricted domains before issuing any HTTP request. Reject .ru, .su, .рф (xn--p1ai), and Russian-owned brands before any outbound fetch. Ruling 56 Wireframe review C5
  • Apply the Tail-Light Rule to every vendor and external filler. Supply only the exact declared attributes required for one task, never the full organisation payload. Ruling 18 Ruling 53 Doctrine §5

Pre-model screening and redaction

Every inbound message passes through clean() and screen() in code at zero model cost. Reference: guards.mjs clean() applies Unicode NFKC normalisation, converts decimal digits from any script into ASCII digits (asciiDigits()), turns ideographic full stops into dots, strips control and format characters, and collapses repeated spaces. Reference: guards.mjs

JavaScript
export function screen(text, profile) {
  const f = FIXED(profile);
  const t = clean(text);
  if (!t) return { stop: { kind: 'empty', line: null }, modelText: '', withheld: true, removed: [] };
  if (t.length > MAX_CHARS) return { stop: { kind: 'too_long', line: f.tooLong }, modelText: '', withheld: true, removed: [] };
  if (wellbeingSignal(t)) return { stop: { kind: 'wellbeing', line: f.wellbeing }, modelText: '', withheld: true, removed: [] };
  const s = screenText(t);
  const removed = [...s.removed, ...(s.emails.length ? ['email'] : [])];
  const modelText = replaceNumbers(s.modelText, () => { removed.push('number'); return REMOVED; });
  if (isSecret(modelText)) return { stop: { kind: 'secret', line: f.secret }, modelText: '', withheld: true, removed: [] };
  if (asksInside(t)) return { stop: { kind: 'inside', line: f.inside }, modelText: '', withheld: false, removed: [] };
  if (s.contactLeft || hasContactDetail(modelText.replaceAll(REMOVED, ' ').replaceAll(EMAIL_GIVEN, ' '))) {
    return { stop: null, modelText: '[the visitor shared contact details, removed]', withheld: true, removed: ['contact'] };
  }
  return { stop: null, modelText, withheld: removed.length > 0, removed: [...new Set(removed)] };
}

The order of operations matters. Emails and long number spans (7 or more digits, excluding currency values starting with $ and non-zero up to 9 digits) are removed before isSecret() runs, so a phone number is redacted rather than mistaken for a one-time code. Reference: guards.mjs House note: three-service holon Financial and tax workflows also block 8 to 9 digit Australian tax file numbers explicitly so TFNs are never stored. Wireframe review C5 If a disguised contact detail (such as "j at gmail dot com") cannot be lifted cleanly, the entire message is replaced with a withheld placeholder before reaching the checks. Reference: guards.mjs

Withheld messages, scrubbed history, and outbound checks

Text reaches the left-hand console pane and the append-only event store only after the privacy rule has evaluated the message. Reference: flow.mjs House note: three-service holon When message.shares_personal_details fires or a contact detail could not be lifted cleanly:

For every non-withheld message, scrubHistory() replaces every group of 3 or more digits with [number] so a visitor cannot leak a phone or ID number in fragments across several turns ("starts 0412", "then 345", "ends 678"). Reference: guards.mjs The organisation's own published phone numbers from its facts are temporarily protected during scrubbing so the holon never fractures or apologises for its own number. Reference: guards.mjs Holon rules §3.3

On the outbound path, finish() checks every reply for the 192-bit session canary (containsCanary()), removes links outside allowedHosts, removes non-organisation emails, numbers, and 16-character hex strings, and fails closed if strayContact() detects a disguised contact detail. Reference: guards.mjs Ruling 21

Listener isolation, blocked domains, and the Tail-Light Rule

Privacy controls extend beyond individual messages to network and tenancy boundaries:

BoundaryHard rule
Dual-listener IP shieldPublic traffic runs on a dedicated public port filtered strictly through visitorView with strict security headers (self-only CSP, X-Frame-Options: DENY, Referrer-Policy: no-referrer, no-store, noindex). Internal diagnostics, prompt internals, raw schemas, and raw micro-USD costs stay on the loopback internal port. Holon rules §1.3 Ruling 21 Reference: public.mjs Wireframe review C6
Secrets handlingLoad API keys and access keys strictly from *_KEY_FILE paths (mode 0600), never from inline flags or tracked files. Holon rules §3.4 Ruling 21 Reference: server.mjs
Blocked domainsBlock .ru, .su, .рф (xn--p1ai), and Russian-owned brands before any outbound HTTP request. Ruling 56 Wireframe review C5
Tail-Light Rule and Sovereign Process FlowsGive each vendor holon or external filler only the narrow declared attributes required for its task, never the buyer's full organisation payload; isolate buyer operational data from vendor prompt IP. Ruling 18 Ruling 53 Doctrine §5 Wireframe spec W13
Do

Withhold private details from traces and show the exact Tail-Light attribute scope.

Message run · EFS Withheld
Message withheld: personal details
Stored · message text withheld Scope: 3 declared attributes
HTML
<div class="hx-card hx-stack">
  <div class="hx-spread">
    <span class="hx-title">Message run · EFS</span>
    <span class="hx-chip">Withheld</span>
  </div>
  <div class="hx-small hx-muted">Message withheld: personal details</div>
  <div class="hx-row hx-small">
    <span class="hx-chip">Stored · message text withheld</span>
    <span class="hx-chip">Scope: 3 declared attributes</span>
  </div>
</div>
Don’t

Do not print visitor identifiers, TFNs, or internal raw costs on public traces.

Message log
Visitor: "My TFN is 123 456 789, call 0412 345 678" · raw_cost_micro: 2410
HTML
<div class="hx-card hx-stack">
  <span class="hx-title">Message log</span>
  <div class="hx-small hx-muted">Visitor: "My TFN is 123 456 789, call 0412 345 678" · raw_cost_micro: 2410</div>
</div>