Diagnostic Reference
ArchLex returns structured diagnostics with parse, analysis, and render results. Use each diagnostic’s code, severity, source span, and remediation to show a useful correction beside the diagram source.
const result = await archlex.render(source);
for (const diagnostic of result.diagnostics) {
console.log(`${diagnostic.code}: ${diagnostic.message}`);
console.log(`Fix: ${diagnostic.remediation}`);
}Diagnostic Families
| Prefix | Stage | What to check |
|---|---|---|
AL-PARSE-* | Parser | Directive syntax, resource declarations, relationship endpoints, and block delimiters |
AL-STRUCT-* | Structural analysis | Duplicate IDs, missing references, invalid containment, and conflicting declarations |
AWS-* | AWS semantics | AWS resource names, scopes, containment, and provider relationships |
GCP-* | Google Cloud semantics | Google Cloud resource names, scopes, containment, and provider relationships |
K8S-* | Kubernetes semantics | Kubernetes resource names, cluster and namespace placement, and workload relationships |
CLOUDFLARE-* | Cloudflare semantics | Cloudflare resource placement at root or in a logical account |
Icon warnings report unresolved or rejected icon assets. They do not change the provider semantic rules.
Severity
erroridentifies source that ArchLex cannot interpret or validate as a usable graph.warningidentifies a graph that ArchLex can render with a likely modeling problem.infogives provider guidance without blocking output.
ArchLex can return a partial graph or SVG with diagnostics. Check the result instead of treating a rendered SVG as proof that the source has no errors.
Validation Modes
Set the mode with the validation directive or the matching API option:
validation normal| Mode | Behavior |
|---|---|
normal | Runs the standard structural and provider checks |
strict | Promotes supported advisory findings to stricter diagnostics |
off | Skips provider semantic rules while retaining parsing and graph construction checks |
Provider specifications describe the rules that each mode affects:
Fix a Diagnostic
- Find the diagnostic code and source span in the result.
- Read its
remediationfield. - Open the code in the generated index when you need its full reference page.
- Update the source, then render it again.