ArchiLens: Traceable RTL Module Topology and Anti-Hallucination Delivery

Preface

When using DSH to have an agent draw hardware architecture diagrams, a common problem is “the diagram looks professional, but doesn’t match the source code”: module names are misspelled, connections don’t exist, line numbers don’t match, and it’s difficult to verify each item manually. Manually organizing hierarchical relationships from Verilog/SystemVerilog is time-consuming, and documentation easily becomes outdated once it drifts from the source code.

ArchiLens (npm package name hw-topo-dsh, core skill hw-topo) changes the approach from “drawing from memory” to “mechanical transcription from source code”: it scans RTL to generate topology, and nodes and connections in the diagram are forced to carry file:line evidence; before delivery, it re-scans the source tree to verify item by item, and refuses delivery if the hallucination rate is non-zero (exit code 1). It defaults to using RTLens’s rtlens.evidence/1 evidence backend, has no npm runtime dependencies, and scan / verify / deliver can be fully offline. Maintained by Kylanfang, categorized as workflow; community directory at SkillHub ArchiLens page, source code at GitHub Kylanfang/ArchiLens (current public star count is 0).

What Is This

ArchiLens is a hardware topology diagram plugin for DeepSeek Harness (DSH): it targets Verilog/SystemVerilog, produces module topology SVGs with source code evidence, and provides interactive HTML, wiki index, and machine-readable receipts. The project is adapted from the DSH packaging form of @tt-a1i/archify-dsh@0.1.0, replacing general charting capabilities with an “evidence-first + self-check gate” pipeline; the division of labor with RTLens is as follows—RTLens handles facts and signal-level analysis, while this plugin handles topology deliverables and verify gates.

Core Features

Evidence Scanning and Specification Derivation

  • scan: default backend auto—uses rtlens.evidence/1 when RTLens (peer dependency rtlens-dsh ≥ 6.2.0, optional) is available; when unavailable, falls back to the built-in fault-tolerant regex scanner, and marks degraded in the receipt, HTML banner, and wiki header.
  • derive: mechanically transcribes topology specification from the evidence bundle (modules, instantiations, connections); supports --focus <top-level module> to draw only the subtree, and --no-groups to disable grouping by directory.

Anti-Hallucination Gate and Four-Piece Delivery

  • verify: doesn’t trust old evidence bundles, re-scans the RTL tree, determines backed / disclosed / unbacked / broken for each element, and calculates hallucinationRisk; the numerator is unbacked + broken, and exit 1 if non-zero.
  • deliver: produces <prefix>.html (interactive viewer), <prefix>.svg, <prefix>.wiki.md (codebase index with file:line), <prefix>.receipt.json (receipt and artifact SHA-256).

Optional Capabilities

  • Direct GitHub diagram generation: search and gh subcommands fetch source code via tarball (recording commit SHA, with path traversal protection), and SVG nodes can link to GitHub blob permalinks; only these two commands require network access.
  • Dual-engine cross-check: --cross-check uses another engine as witness and only compares line numbers; under --cross-check-strict, coordinate conflicts can cause verify to fail.
  • DSH integration: cordis.patch.yml registers a filesystem Skill provider, and npm install triggers prepare to stage skills to skills/.

Current version (from package.json in materials): 0.3.0, license MIT, requires Node ≥ 18.

Installation and Enablement

The plugin runs with the permissions of the current dsh process; before installation, you should review the repository source code and LICENSE yourself to ensure compliance with your team’s requirements. The following commands are excerpted from the project README; do not modify the repository path placeholders yourself.

Method 1: Git repository

# Replace <owner> with the actual user/organization name (if the maintainer's repository is Kylanfang/ArchiLens, replace according to the README placeholder instructions)
dsh plugin add github:<owner>/archify-dsh --profile <profile name>

Method 2: npm pack artifact

npm pack
dsh plugin add ./hw-topo-dsh-<version>.tgz --profile <profile name>

Method 3: Local directory (README includes clone and install steps; path-based installation is briefly described here)

After running npm install (triggering prepare, no runtime dependencies) in the repository root directory:

dsh plugin add <archify-dsh path> --profile <profile name>

After installation, you can run a ~30-second self-check (skill CLI is located in the profile’s node_modules):

node <profile>/node_modules/hw-topo-dsh/skills/hw-topo/bin/hw-topo.mjs doctor --json
# Expected {"ok": true ...}

Typical Usage

CLI Pipeline

Inside the repository, you can directly call hw-topo/bin/hw-topo.mjs (see previous section for installation path):

node hw-topo/bin/hw-topo.mjs demo <output directory>
node hw-topo/bin/hw-topo.mjs scan  <RTL root directory> --out topo.bundle.json --json
node hw-topo/bin/hw-topo.mjs derive topo.bundle.json --out topo.topology.json --title "<title>" --project <name> --json
node hw-topo/bin/hw-topo.mjs verify topo.topology.json --json
node hw-topo/bin/hw-topo.mjs deliver topo.topology.json --json
node hw-topo/bin/hw-topo.mjs validate topo.topology.json --json

Common scan options: --backend auto|rtlens|builtin (default auto), --evidence <rtlens evidence.json>, repeatable -D NAME (+define+ semantics), -I <directory> (`include search path). For complete parameters, refer to the usage shown by running node hw-topo/bin/hw-topo.mjs without arguments.

Calling the Skill in a DSH Session

Use the hw-topo skill to map the module topology of <RTL root directory>, generating traceable SVG and wiki index.

Generating Diagrams from GitHub Repositories (Requires Network)

node hw-topo/bin/hw-topo.mjs search "riscv cpu" --limit 5 --json
node hw-topo/bin/hw-topo.mjs gh <owner/repo> --ref <branch|tag|sha> --focus <top-level> --json

Unauthenticated GitHub API is limited to 60 requests/hour; GITHUB_TOKEN can be set. Repositories without RTL will exit with no-rtl and won’t generate empty diagrams.

The workflow order can be remembered as: scan → derive → (optional curate) → verify → deliver; if verify fails, it must not be considered a successful delivery.

Use Cases and Notes

Who it’s for: Hardware/FPGA teams that need to deliver “source code-bound” RTL module hierarchy diagrams in documentation or reviews, and want agents to follow a fixed pipeline through skills in DSH; evidence quality is best when already using or planning to install RTLens.

Relationship with adjacent skills: Instantiation relationships, ports, signal drivers, and impact analysis should be handled by RTLens; RTL topology HTML/SVG/wiki/receipts are handled by ArchiLens; non-RTL general architecture diagrams, sequence diagrams, etc., still belong to the scope of upstream archify, and this plugin’s description explicitly excludes them.

Backend and line numbers: External coordinates are 1-based, root-relative POSIX; RTLens adaptation is converted in one place in evidence-adapter.mjs. Explicit --backend rtlens will not silently fall back. Changing the backend will mark backendOverride in the receipt.

Ecosystem note: DSH advocates “everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer.

Conclusion

ArchiLens’s value lies in turning topology diagrams into reviewable transcription artifacts: every element can be traced back to file:line, and the machine gate intercepts unbacked content before delivery. If you want to install a workflow-type RTL topology plugin in your profile, you can compare the installation methods and hw-topo skill name from the directory page and repository README.

  • Directory page: https://www.skillhub.cn/plugins/Kylanfang/ArchiLens
  • GitHub: https://github.com/Kylanfang/ArchiLens
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye