The Spec Cross-Check system validates documentation consistency, reference integrity, and governance invariant compliance. It catches broken links, missing authority references, prohibited terminology, and SBVR runtime dependencies before they reach production.
Reference: See REF-019: Spec Cross-Check for the complete specification and SDS-035: Governance Invariants for the list of enforced invariants.
1
node scripts/spec-cross-check.js --mode staging --dir docs/specs --output report.json
1
node scripts/spec-cross-check.js --mode production --dir docs/specs --output report.json
| Option | Default | Description |
|---|---|---|
--mode |
staging |
Enforcement mode: staging (warnings) or production (errors) |
--dir |
docs/specs |
Directory containing markdown specs to validate |
--output |
report.json |
Output file path for the JSON report |
| Check ID | Name | What It Validates |
|---|---|---|
CHECK-AUTH-001 |
Authority Reference | Specs with privileged actions (key rotation, break-glass, etc.) reference SDS-031 |
CHECK-PROP-001 |
Proposal Workflow | Specs describing semantic changes reference SDS-032 |
CHECK-ID-001 |
Identity Reference | Specs using identity mechanisms reference SDS-017/018/034 |
CHECK-SEM-001 |
SBVR Runtime | No SBVR referenced as runtime dependency (import/export allowed) |
CHECK-ECON-001 |
Prohibited Terms | No gas fees, mempool, staking, or public chain economics |
CHECK-REF-001 |
Reference Integrity | All markdown links to .md files resolve |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
π Spec Cross-Check (mode: staging)
Directory: docs/specs
β οΈ [WARN] shared/sds/042-new-service.md: Privileged actions found without Authority Boundaries reference
β [ERROR] cognitive-extension/sds/015-token-service.md: Broken markdown references found
π Summary:
Files scanned: 128
Checks run: 768
β Errors: 1
β οΈ Warnings: 3
β
Passed: 764
Report: report.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"timestamp": "2025-12-22T16:30:00Z",
"mode": "staging",
"filesScanned": 128,
"checksRun": 768,
"errors": [
{
"file": "cognitive-extension/sds/015-token-service.md",
"checkId": "CHECK-REF-001",
"checkName": "Reference Integrity",
"message": "Broken markdown references found",
"broken": [
{ "text": "Old Spec", "target": "../sds/999-nonexistent.md" }
],
"fix": "Update file paths or remove dead references"
}
],
"warnings": [
{
"file": "shared/sds/042-new-service.md",
"checkId": "CHECK-AUTH-001",
"checkName": "Authority Reference",
"message": "Privileged actions found without Authority Boundaries reference",
"triggers": ["key rotation", "break-glass"],
"fix": "Add reference to SDS-031: Authority & Ownership Boundaries"
}
],
"passed": [ /* ... */ ]
}
Use during development and feature branches.
Use for PRs targeting main or production branches.
Message: Privileged actions found without Authority Boundaries reference
Fix: Add a reference to SDS-031 somewhere in your document:
1
2
> **Authority Reference**: For role definitions and approval requirements, see
> **[SDS-031: Authority & Ownership Boundaries](../sds/031-authority-ownership-boundaries.md)**.
Message: SBVR referenced as runtime dependency
Fix: Replace βSBVR ruleβ with βSEAβ’ DSL Policyβ or add context indicating import/export:
1
2
3
4
5
6
7
8
<!-- β Wrong -->
The system executes SBVR rules at runtime.
<!-- β
Correct -->
The system enforces SEAβ’ DSL policies at runtime.
<!-- β
Also correct (import context) -->
SBVR rules can be imported from external sources and projected to SEAβ’ DSL.
Message: Prohibited economics/public-chain terminology found
Fix: Remove the term or add explicit disclaimer context:
1
2
3
4
5
6
7
8
<!-- β Wrong -->
Users pay gas fees to mint tokens.
<!-- β
Correct -->
There are no gas fees; attestation is free.
<!-- β
Also correct (disclaimer context) -->
Unlike public blockchains, there are no gas fees in the IFL.
Message: Broken markdown references found
Fix: Update the link to point to an existing file:
1
2
3
4
5
<!-- β Wrong (file doesn't exist) -->
See [Old Spec](../sds/999-nonexistent.md)
<!-- β
Correct -->
See [Current Spec](../sds/034-ifl-federated-ledger.md)
The cross-check runs automatically on pull requests affecting docs/specs/**/*.md. See .github/workflows/spec-cross-check.yml for configuration.
To re-run the check on an existing PR, comment:
1
/rerun-spec-check
Some files are automatically excluded:
**/z_conflict_log.md β Conflict tracking**/analysis/** β Historical analysis**/tutorial/** β Tutorials use simplified language**/_archive/** β Archived specsCheck-specific exclusions are defined in REF-019.
1
Error: Cannot find module 'scripts/spec-cross-check.js'
Fix: Run from the repository root:
1
2
cd /path/to/NewSea
node scripts/spec-cross-check.js --mode staging --dir docs/specs
1
'node' is not recognized as a command
Fix: Install Node.js 18.x or later from https://nodejs.org/
1
Error: EACCES: permission denied, open 'report.json'
Fix: Specify a writable output path:
1
node scripts/spec-cross-check.js --output ./tmp/report.json
Last updated: 2025-12-22