Validation Rules
Canonical SFRS v2 validation layers, profile checks, and current support boundaries.
Validation is now split across two surfaces:
Legacy v1 validationFor the older statement-shaped filing model.Canonical v2 validationFor the current fact-centric filing model.
If you are building new integrations, use canonical v2 validation.
Canonical Validation
The main entry point is:
import { validateCanonicalFiling } from '@sureshake/sfrs-validator';
const result = validateCanonicalFiling(filing);The result contains:
validerrorswarningsinfosummary
Validation Layers
Canonical v2 validation currently checks:
- document integrity
- entity and identifier integrity
- taxonomy presence
- context integrity
- unit integrity
- fact integrity
- footnote linkage
- relationship linkage
- profile-specific requirements
What Is Checked
Document Layer
Examples:
document.versionmust match the canonical modeldocument.documentTypemust be a supported canonical typedocument.profilemust be present for profile-aware validation
Context Layer
Examples:
- facts must reference existing
contextRefvalues - contexts must contain a valid period definition
- dimensional qualifiers must be structurally valid
Unit Layer
Examples:
- numeric facts should reference known units
- unit definitions must contain valid measures
Fact Layer
Examples:
- a fact cannot be both populated and
nil - numeric facts should carry the right reference structure
- concept and context references must resolve
Footnotes And Relationships
Examples:
- footnotes must point to existing facts
- footnote relationships must resolve correctly
- non-footnote relationships must point to supported targets
Profile Checks
The current prerelease includes profile-level checks for:
sec-us-gaap-annualifrs-esef-annual
These checks currently enforce a first profile layer, including:
- required identifier schemes
- required headline facts
- profile compatibility for packaging/export flows
That is useful, but it is not yet full submission-grade conformance.
Severity Levels
| Level | Meaning | Blocks validity |
|---|---|---|
error | Invalid filing state | Yes |
warning | Suspicious but not fatal | No |
info | Non-blocking note | No |
Example
import { validateCanonicalFiling } from '@sureshake/sfrs-validator';
const result = validateCanonicalFiling(filing);
console.log(result.valid);
console.log(result.summary.errorCount);
console.log(result.errors.map((issue) => issue.code));API Validation
You can also validate through the API:
{
"document": {},
"modelVersion": "v2"
}Endpoint:
POST /api/v1/validate
When modelVersion is set to "auto", the API will try to detect canonical v2 documents automatically.
What Validation Does Not Yet Claim
Canonical validation is still prerelease. It does not yet claim:
- full regulator-ready conformance
- full taxonomy/disclosure coverage across real public filing corpora
- complete jurisdiction packs beyond the currently registered profiles
Read the current milestone entry in Release Notes together with validation claims.