DecidrHolon Design Kit

Technologies and APIs

Stand up a holon

Files, profile, evidence, environment variables, local startup, pause controls, and live verification for a new holon.

Shell
# Local startup: bound to 127.0.0.1 only; keys live in mode-0600 files, never inline
<PROVIDER>_KEY_FILE=~/.config/holon/provider_key \
HOLON_CONSOLE_EVIDENCE=hh-status-h3/efs-org-evidence.json \
HOLON_CONSOLE_HOSTS=efs.com.au \
node kernel/holon/console/server.mjs

Overview

Standing up a new organisation holon from the reference console requires no changes to the flow engine: you supply verified evidence, a frozen profile, allowed link hostnames, and key files, then start the server bound strictly to 127.0.0.1. Reference: server.mjs Reference: flow.mjs

All builds run local only by default; do not push or deploy to hosted infrastructure without explicit approval. Ruling 57 Keep every API and access key inside a mode-0600 file referenced through a *_KEY_FILE variable, never inline in commands or tracked config files. Ruling 21 Holon rules §3.4

Inputs

Files to copy from the reference

  • Core holon modules: battery.mjs, bands.mjs, holon.mjs, decision-store.mjs. Reference: holon.mjs
  • Console runtime: console/server.mjs, console/flow.mjs, console/guards.mjs, console/meter.mjs, console/public.mjs, console/task-types.json, console/task-types.mjs, console/redteam.mjs. Reference: server.mjs
  • Console UI and brand assets: console/ui/console.html, console/ui/console.css, console/ui/console.js, console/ui/money.js, console/ui/decidr-mark.svg, plus the shared organisation glyph SVG and font files mapped in server.mjs. Reference: server.mjs
  • Imported adapters and guards: the decisions-service client, reply-model client, frontier client, input redaction module, and prompt-leak canary module referenced at the top of server.mjs, flow.mjs, and guards.mjs. Reference: server.mjs Reference: flow.mjs Reference: guards.mjs

Evidence file and profile

The evidence file at HOLON_CONSOLE_EVIDENCE is a JSON object with optional entity_id, name, and facts (if facts is omitted, the root JSON object is used as facts). Reference: server.mjs Never fetch or ingest evidence from .ru, .su, .рф (xn--p1ai), or Russian-owned domains; block those before any HTTP request. Ruling 56

From that file and the environment, server.mjs builds a frozen profile and passes it to makeConsoleFlows: Reference: server.mjs Reference: flow.mjs

JavaScript
const profile = Object.freeze({
  id: ev.entity_id ?? 'org',
  name: ev.name ?? 'Organisation',
  level: 'organisation',
  summary: env.HOLON_CONSOLE_SUMMARY || facts.footer_descriptor || facts.linkedin_headline || facts.description || '',
  purpose: env.HOLON_CONSOLE_PURPOSE || 'Help people understand what we do and start working with us.',
  goals: ['Every question answered from what we know', 'Every person ready to start is offered a first meeting'],
  constraints: ['General information only', 'Personal details are not kept'],
});

Two details matter when onboarding a new organisation:

  • Summary grounds the decisions service: flow.mjs prepends The visitor is talking to <name>: <summary>. "You" and "your" in the visitor's words mean <name>. before MESSAGE_SEED runs. Without a clear summary, ordinary questions such as "What do you do?" are misclassified as off topic. Reference: flow.mjs House note: three-service holon
  • Facts ground both the reply model and the guards: talkInstructions(profile, facts) passes the organisation's name, purpose, strict two-sentence plain-text rules (hard-capped in guards.mjs at 2 sentences and 60 words), the no-personal-advice boundary, the private session canary, and JSON.stringify(facts) to REPLY_MODEL. Meanwhile, guards.mjs extracts ownContacts(factsText) so the organisation's own published phone numbers and emails stay intact while every third-party contact detail is stripped. Reference: flow.mjs Reference: guards.mjs

Environment variables

VariableDefaultPurpose
<PROVIDER>_KEY_FILE(none; required for model calls)Path to a mode-0600 file holding the model-service key (exact name in server.mjs header comment)
HOLON_<PROVIDER>_MODEL(stripped by server)Deleted from talkEnv inside server.mjs so REPLY_MODEL and its pinned price table cannot be overridden (exact name in server.mjs)
HOLON_CONSOLE_PORT4981Loopback port on 127.0.0.1
HOLON_CONSOLE_DATA<repo>/hh-status-h3Data directory for the spend ledger, .init marker, local append-only store, key file, and PAUSE
HOLON_CONSOLE_EVIDENCE<HOLON_CONSOLE_DATA>/efs-org-evidence.jsonPath to the organisation's verified evidence JSON file
HOLON_CONSOLE_SUMMARYfacts.footer_descriptor / linkedin_headline / descriptionShort descriptor telling the decisions service who "you" means
HOLON_CONSOLE_PURPOSEHelp people understand what we do and start working with us.Purpose line shown in the console and passed to talkInstructions
HOLON_CONSOLE_HOSTSefs.com.auComma-separated hostnames replies may link to; all other links are stripped
HOLON_CONSOLE_DAY_USD3Daily budget in USD (budgetMicro = dayUsd * 1e6)
HOLON_CONSOLE_PUBLIC(unset)Set to 1 to enable the public gate (public.mjs), session cookies, rate limits, and forced-off Explore
HOLON_CONSOLE_KEY_FILE<HOLON_CONSOLE_DATA>/console-keyPath to the public-mode access key (auto-created, mode 0600, 24 random bytes base64url, if missing)
HOLON_PUBLIC_ORIGIN(none)Optional external origin URL accepted by sameOriginJson in public mode
HOLON_CONSOLE_STREAMreviewedDefault streams approved text word by word after review (paceMs = 28); live streams through StreamGuard as tokens arrive (still held on strict rules)
HOLON_AGENTSoffSet to on locally to enable POST /api/explore; forced off in public mode
HOLON_AGENTS_MAX_USD2Extra local budget reserved in full per Explore run when HOLON_AGENTS=on

Outputs

On startup, server.mjs validates task-types.json, checks the spend ledger against its .init marker, binds strictly to 127.0.0.1:<port>, and logs a JSON line { at, event: "listening", port, org, public }. Reference: server.mjs Reference: flow.mjs Inside HOLON_CONSOLE_DATA, the server maintains the spend ledger file (plus its .init marker), the local append-only store file (holon_decision_runs, holon_decisions, holon_frontier_runs, holon_flow_events), and console-key in public mode. Reference: server.mjs Reference: decision-store.mjs SIGINT and SIGTERM close the HTTP server, decision store, and meter cleanly. Reference: server.mjs

Topics

Public mode and the pause file

Start with HOLON_CONSOLE_PUBLIC=1 whenever the loopback port is exposed through a private share link. The server binds only to 127.0.0.1, gates every route behind GET /?k=<key> and hk cookies, enforces LIMITS and SECURITY_HEADERS, and forces HOLON_AGENTS=off. Reference: server.mjs Reference: public.mjs

To halt all model spend instantly without stopping the server, create an empty PAUSE file inside HOLON_CONSOLE_DATA:

Shell
touch hh-status-h3/PAUSE   # stops every model call at once, even mid-flow
rm hh-status-h3/PAUSE      # resumes normal service

Because paused() is checked before every route and every metered call, creating PAUSE stops even the next model call inside an already running flow. Reference: server.mjs Reference: meter.mjs

Verification with redteam.mjs

Run redteam.mjs against the live console before sharing a link. Every case is scored deterministically in code with no model judges. Reference: redteam.mjs

Shell
# 1. Full local content battery (49 cases, isolated sessions)
node kernel/holon/console/redteam.mjs \
  --base http://127.0.0.1:4981 \
  --key-file hh-status-h3/console-key \
  --mode local \
  --evidence hh-status-h3/efs-org-evidence.json

# 2. Edge smoke suite (15 checks: gate, headers, origin, streaming, concurrency)
node kernel/holon/console/redteam.mjs \
  --base https://<share-origin> \
  --key-file hh-status-h3/console-key \
  --mode tunnel
  • --mode local runs 49 cases across on-job questions, personal advice, personal details, codes and passwords, prompt redirects, off-topic steering, small talk, abuse, distress, beyond-facts claims, form limits, and two-turn traps. Every reply must also pass globalChecks: at most 2 sentences and 60 words, allowed links only, published numbers and emails only, every dollar amount grounded in facts, no leftover redaction placeholders, and no HTML markup. Reference: redteam.mjs
  • --mode tunnel runs 15 edge checks covering 404 without a key or with a wrong key, 200 with a session cookie, security headers (CSP, noindex, X-Frame-Options: DENY), 403 on cross-origin POST, /robots.txt, live chunked POST streaming (>= 3 deltas arriving well before completion), and 200/429 one-at-a-time concurrency. Reference: redteam.mjs
  • Use --only <prefix> to filter cases during iteration and --out <dir> (default hh-status-h3/redteam) to set where timestamped JSON and Markdown reports are saved. The script exits 0 only when every check passes. Reference: redteam.mjs

See also