DarkMoon research series·C. OpenCode & TUI·Article 17 of 23·All 23 articles
Introduction
Graphical attack-path views have a long history: attack graphs (Sheyner et al., 2002), attack trees, and many visual syntaxes surveyed by Lallie et al. (2020). Layered graph drawing, the family behind DarkMoon's web path graph, goes back to Sugiyama, Tagawa and Toda (1981). All of these assume a canvas.
The DarkMoon Terminal Explorer has no canvas. It runs inside the OpenCode console, and the plugin API gives it a grid of character cells and no image protocol. This article describes how attack paths are drawn there, using only Unicode or ASCII characters, and how the drawing keeps the distinction between evidence and hypothesis that the engine computes. The engine is documented in darkmoon-attack-paths-research, the views in darkmoon-visualization-research.
Problem
Three constraints apply at once:
- Width. The view must work at 80 columns, where a layered left-to-right graph of more than three or four nodes does not fit.
- Proof. Each path is either an Evidence-Backed Attack Path (every step supported by a server rule or qualification) or a Possible Attack Path (declared by an agent or inferred by the server). The drawing must not let the second look like the first. In DarkMoon Community, every path is Possible by construction (
proven_paths = 0). - Portability. Some terminals and locales do not render UTF-8 box-drawing characters reliably.
Methodology
A vertical chain of node cards
Instead of a left-to-right graph, a path is drawn top to bottom: one card per step, connectors between cards. Each card carries the step number and kind (exposure, hop, finding), the asset label, and, for a finding, its identifier and evidence status. The text on the left of the screen lists all paths; the path walk on the right shows one path at a time.
Two connector styles, plus words
The connector glyph depends on the path kind computed by pathKind() and pathProof() in core.ts. This is the actual code of the one-line chain format in DarkMoon Community:
/** Unicode chain; solid arrow only for proven paths, dashed otherwise. */
export function pathChain(p: AttackPath): string[] {
const arrow = pathProof(p).proven ? "─▶" : "╌▶"
...
}In the card view, the vertical connector is │ for an evidence-backed link and ┆ for a hypothesis, followed by ▼. Every connector also carries words: « evidence-backed » or « possible · not observed ». The style is never the only signal, which follows the general rule that state should not rely on a single visual channel (WCAG 2.2, SC 1.4.1; Munzner, 2014).
The glyph table and its ASCII fallback
From glyphs() in core.ts (VERIFIED, public code):
| Role | Unicode | ASCII fallback |
|---|---|---|
| severity mark | ■ | # |
| bar / track | █ / ─ | = / - |
| selection | ▌ | > |
| step with a finding / exposure | ● / ○ | * / o |
| evidence-backed connector | │ | | |
| hypothesis connector | ┆ | : |
| arrow | ▼ | v |
| sparkline steps | ▁▂▃▄▅▆▇█ | .:-=+*# |
| box corners | ╭ ╮ ╰ ╯ | + |
The fallback switches on when DARKMOON_ASCII=1 is set or when the locale (LC_ALL, LC_CTYPE, LANG) is set and does not mention UTF-8 (VERIFIED, unicodeTerminal()).
Real results
A Possible path in Community
Transcribed from the capture below (Community, synthetic demo data, 160×45; box widths normalised for this page), the selected path reads:
┆ Possible Attack Path 3 steps · criticality critical
inferred by the server, a hypothesis · L legend
┌ 1 · exposure ───────────────────────────────────┐
│ ○ HTTP (DVGA) │
└──────────────────────────────────────────────────┘
┆ possible · not observed
▼
┌ 2 · hop ────────────────────────────────────────┐
│ ○ DVGA - Damn Vulnerable GraphQL Application │
└──────────────────────────────────────────────────┘
┆ possible · not observed
▼
┌ 3 · finding ────────────────────────────────────┐
│ ● DVGA - Damn Vulnerable GraphQL Application │
│ vuln_038822 ◐ confirmed │
└──────────────────────────────────────────────────┘Under the chain, the explorer prints why the path is not proven: « Inferred path, not proven: deduced from the infrastructure topology and the confirmed findings of this campaign by rule I-CRED (Credentials or authentication bypass). The campaign evidence does not show this chain end to end. » (VERIFIED, capture.)


An Evidence-Backed path in Pro
On the same synthetic campaign, the Pro edition lists 2 evidence-backed paths. The selected one has two finding steps, both marked ● exploited, joined by a solid │ connector labelled « evidence-backed » (VERIFIED, capture).

What the engine numbers say about these drawings
The drawing is only as honest as the classification behind it. On real campaigns measured in the engine research, 0 agent-declared links were qualified by the server (0/25 in replay, 0/19, 0/19; 0/16 by construction in Community; VERIFIED). Evidence-backed paths, where they exist, come from server pattern rules (R1/R3), not from agent declarations. On real data, then, a dotted connector is the normal case, not the exception.
Limits
- Our Evidence-Backed caption overstates. The explanatory string attached to evidence-backed paths, « every step backed by evidence the server recorded », is stronger than the engine: rules R1 and R3 read agent-written evidence text, not an independent capture. The string is flagged for correction in the engine's limitations (VERIFIED).
- Branches are not merged. Paths that share steps are listed one by one; the web ELK graph draws shared assets once. Whether a merged tree helps triage is untested.
- No ASCII-mode capture exists for the latest iteration.
- Glyph width. Box-drawing characters depend on the terminal font; wide emoji were removed from the UI because they broke border alignment. We did not test a matrix of terminal emulators.
- No user study on whether
│versus┆plus a word is read correctly (not measured).
Figures
- Figure 1 (Mermaid): classification to glyphs.
- Text figure: transcription of a real capture.
- Captures: ANSI dumps of the real TUI rendered to PNG, synthetic demo data (DVGA lab campaign copy; IPs tokenised).
Scientific sources (verified)
- K. Sugiyama, S. Tagawa, M. Toda. « Methods for Visual Understanding of Hierarchical System Structures ». IEEE Trans. Systems, Man, and Cybernetics 11(2), 1981. doi:10.1109/TSMC.1981.4308636
- O. Sheyner, J. Haines, S. Jha, R. Lippmann, J. M. Wing. « Automated generation and analysis of attack graphs ». IEEE S&P, 2002. doi:10.1109/SECPRI.2002.1004377
- H. S. Lallie, K. Debattista, J. Bal. « A review of attack graph and attack tree visual syntax in cyber security ». Computer Science Review, 2020. doi:10.1016/j.cosrev.2019.100219
- T. Munzner. Visualization Analysis and Design. CRC Press, 2014. doi:10.1201/b17511
- Unicode Consortium. Code charts Box Drawing (U+2500) and Block Elements (U+2580). https://www.unicode.org/charts/PDF/U2500.pdf · https://www.unicode.org/charts/PDF/U2580.pdf
- W3C. Understanding SC 1.4.1: Use of Color. https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html
Checked on 2026-11-20 (Crossref for DOIs, fetch for URLs).
Research, source code & reproducibility
- Main research repositories: ASCIT31/darkmoon-attack-paths-research (path kinds, evidence model, screenshots with metadata) and ASCIT31/darkmoon-visualization-research (tui/rendering, research/graph-layouts).
- Source code: ASCIT31/Dark-Moon →
conf/plugins/darkmoon-explorer/core.ts(pathKind,pathProof,pathChain,glyphs,unicodeTerminal); engine atmcp/api/. - Documentation: https://docs.dark-moon.org
- References: references.bib.
- Reproducible experiments: with DarkMoon Community on an authorised lab, open
/explore, press6for paths, then restart the console withDARKMOON_ASCII=1and compare. The unit tests incore.test.tscover the path-kind rule.
Related reading: Designing Explainable Security Graphs Without Misrepresenting Evidence · Declared vs Proven Attack Paths: A Practical Evidence Model · Visualizing Cyber Attack Paths: From Node-Link Diagrams to Orbital Graphs · Designing a Premium Terminal Interface with OpenTUI · Bringing DarkMoon to the Terminal: Building an OpenCode Explorer
If you know published work on drawing directed graphs in text terminals under a fixed column budget, please point us to it on the research repository; we did not find a verified reference to cite.
See the proof, not just the write-up: the Pro remediation benchmark (fixes retested against the exploit) · how Darkmoon compares to other AI pentest tools.
← All articles