Skip to content

/archon-lint

check() — Validate protocol integrity, link health, and consistency invariants.

Run automated checks on the Archon Protocol ecosystem. Read-only — does not modify any files.

Invoke: /archon-lint or pnpm lint

Overview

/archon-lint combines three independent check phases into a single command:

PhaseScriptWhat it checks
1. Link Auditscripts/lint-links.mjsInternal markdown links resolve to valid routes or files
2. Integrityscripts/lint-integrity.mjsConsistency invariants CI-1 through CI-10
3. Testsvitest runDocument format, prohibition quality, ecosystem integrity, demand completeness

All three must pass. Failure in any phase returns a non-zero exit code.

Walks every .md file under docs/, extracts markdown links ([text](target)), and resolves them:

Link typeResolution strategy
Absolute (/syscalls/init)Match against VitePress routes (cleanUrls)
Relative (./demand)Resolve from current file's directory
External (https://...)Skipped (not checked)
Anchor-only (#section)Skipped
Inside code fencesSkipped

Reports

lint-links: checked 142 internal links across 28 files
lint-links: broken 2
  syscalls/demand.md:45 → /drivers/missing (route not found)
  guide/faq.md:12 → ./nonexistent (relative target not found)

Phase 2: Consistency Invariants

Verifies the invariants defined in the Document Integrity Protocol:

IDInvariantHow checked
CI-1Driver count in kernel tables = file count in docs/drivers/Parse kernel markdown table rows
CI-2Syscall count in kernel tables = file count in docs/syscalls/Parse kernel markdown table rows
CI-3Daemon count in kernel tables = file count in docs/daemons/Parse kernel markdown table rows
CI-4Every name in kernel tables has a corresponding docs/ fileName→file existence check
CI-5reference/constraints.md summaries match driver sourcesCross-reference ❌ prohibitions
CI-6Every .cursor/rules/archon-* traces to a docs/ sourceParse Source header in deployed files
CI-7docs/public/init.md lists all componentsString search for each component name
CI-9ai-index.md lists all componentsString search for each file path
CI-10Git coupling pairs match propagation graphscripts/lint-coupling.mjs existence check

Reports

  ✅ CI-1: driver count matches: 5
  ✅ CI-2: syscall count matches: 6
  ✅ CI-3: daemon count matches: 2
  ✅ CI-4: all kernel table names resolve to docs/ files
  ✅ CI-5: constraint summaries match driver sources
  ✅ CI-6: all deployed rules trace to docs/ sources
  ❌ CI-7: init.md missing syscall: lint
  ✅ CI-9: ai-index.md lists all components

lint-integrity: 1 violation(s) found ❌

Phase 3: Tests

Runs the existing Vitest test suite (pnpm test), which covers:

Test fileVerifies
doc-format.test.jsDocument structure, body length, no CJK, ❌ in drivers
prohibition-quality.test.jsEvery ❌ is specific, grep-verifiable
ecosystem-integrity.test.jsCross-references between README, init, demand, self-auditor
demand-completeness.test.jsAll stages present, sub-stage counts

When to Run

TriggerWhy
After adding/removing a componentCatch missing propagation targets
After editing docs/ filesCatch broken internal links
Before committing docs changesPrevent drift from reaching main branch
In CI pipelineGate merges on protocol integrity
During /archon-demand Stage 1.5Automated lint within delivery pipeline

CI Integration

Add to GitHub Actions:

yaml
- name: Archon Lint
  run: pnpm lint

Or run individual phases:

yaml
- run: node scripts/lint-links.mjs
- run: node scripts/lint-integrity.mjs
- run: pnpm test

Relationship to Other Syscalls

SyscallRelationship
/archon-auditAudit checks project code quality (0-100 score). Lint checks protocol integrity.
/archon-verifierVerifier validates claimed work. Lint validates the protocol itself.
/archon-demandDemand Stage 1.5 runs the project's linter. /archon-lint runs the protocol's own checks.
/archon-initInit Step 5 (health check) overlaps with CI-6. Lint is more comprehensive.

Output

Archon Lint:
  Phase 1 (links):     142 checked, 0 broken ✅
  Phase 2 (integrity): 10 invariants, 0 violations ✅
  Phase 3 (tests):     4 suites, 28 tests passed ✅
  Result: CLEAN ✅

Powered by AAEP (AI Architect Evolution Protocol)