xdrs-core 0.44.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/lint.test.js CHANGED
@@ -1733,83 +1733,198 @@ test('reports scope index description exceeding 40 words', () => {
1733
1733
  expect(result.errors.join('\n')).toContain('Scope index frontmatter description must be 40 words or fewer');
1734
1734
  });
1735
1735
 
1736
- test('accepts related-scopes as a list of scope names in scope index frontmatter', () => {
1737
- const workspaceRoot = createWorkspace('valid-scope-related-scopes-list', {
1738
- '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[sibling-team](sibling-team/index.md)', '[parent-domain](parent-domain/index.md)']),
1739
- '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes:\n - sibling-team\n - parent-domain\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1736
+ test('reports related-scopes as unknown frontmatter field in scope index (field removed)', () => {
1737
+ const workspaceRoot = createWorkspace('scope-related-scopes-unknown-field', {
1738
+ '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)']),
1739
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes: sibling-team\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1740
1740
  '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1741
1741
  '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1742
- '.xdrs/sibling-team/index.md': '---\nscope-type: standard\nname: sibling-team\ndescription: Sibling team.\napply-to: Sibling team\nvalid-from: 2026-01-01\n---\n\n# sibling-team Scope Overview\n\n[ADRs](adrs/index.md)\n',
1743
- '.xdrs/sibling-team/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1744
- '.xdrs/sibling-team/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1745
- '.xdrs/parent-domain/index.md': '---\nscope-type: standard\nname: parent-domain\ndescription: Parent domain.\napply-to: Parent domain\nvalid-from: 2026-01-01\n---\n\n# parent-domain Scope Overview\n\n[ADRs](adrs/index.md)\n',
1746
- '.xdrs/parent-domain/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1747
- '.xdrs/parent-domain/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1748
1742
  });
1749
1743
 
1750
1744
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1751
1745
 
1752
- expect(result.errors.join('\n')).not.toContain('Scope index frontmatter related-scopes');
1746
+ expect(result.errors.join('\n')).toContain('unknown field "related-scopes"');
1753
1747
  });
1754
1748
 
1755
- test('accepts related-scopes as a single scope name string in scope index frontmatter', () => {
1756
- const workspaceRoot = createWorkspace('valid-scope-related-scopes-string', {
1757
- '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[sibling-team](sibling-team/index.md)']),
1758
- '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes: sibling-team\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1749
+ test('accepts extends: single scope name in scope index frontmatter', () => {
1750
+ const workspaceRoot = createWorkspace('extends-single-scope', {
1751
+ '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[shared](shared/index.md)']),
1752
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: shared\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1759
1753
  '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1760
1754
  '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1761
- '.xdrs/sibling-team/index.md': '---\nscope-type: standard\nname: sibling-team\ndescription: Sibling team.\napply-to: Sibling team\nvalid-from: 2026-01-01\n---\n\n# sibling-team Scope Overview\n\n[ADRs](adrs/index.md)\n',
1762
- '.xdrs/sibling-team/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1763
- '.xdrs/sibling-team/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1755
+ '.xdrs/shared/index.md': '---\nscope-type: standard\nname: shared\ndescription: Shared policies.\napply-to: All teams\nvalid-from: 2026-01-01\n---\n\n# shared Scope Overview\n\n[ADRs](adrs/index.md)\n',
1756
+ '.xdrs/shared/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Shared decision']),
1757
+ '.xdrs/shared/adrs/principles/001-team.md': teamXdrDocument('Shared decision.'),
1758
+ });
1759
+
1760
+ const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1761
+
1762
+ expect(result.errors.filter((e) => /\[_core-adr-policy-010\.\d+-extends-/.test(e)).join('\n')).toBe('');
1763
+ });
1764
+
1765
+ test('accepts extends: multiple scopes comma-separated in scope index frontmatter', () => {
1766
+ const workspaceRoot = createWorkspace('extends-multiple-scopes', {
1767
+ '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[shared-a](shared-a/index.md)', '[shared-b](shared-b/index.md)']),
1768
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: shared-a, shared-b\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1769
+ '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1770
+ '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1771
+ '.xdrs/shared-a/index.md': '---\nscope-type: standard\nname: shared-a\ndescription: Shared A.\napply-to: All teams\nvalid-from: 2026-01-01\n---\n\n# shared-a Scope Overview\n\n[ADRs](adrs/index.md)\n',
1772
+ '.xdrs/shared-a/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Shared A decision']),
1773
+ '.xdrs/shared-a/adrs/principles/001-team.md': teamXdrDocument('Shared A decision.'),
1774
+ '.xdrs/shared-b/index.md': '---\nscope-type: standard\nname: shared-b\ndescription: Shared B.\napply-to: All teams\nvalid-from: 2026-01-01\n---\n\n# shared-b Scope Overview\n\n[ADRs](adrs/index.md)\n',
1775
+ '.xdrs/shared-b/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Shared B decision']),
1776
+ '.xdrs/shared-b/adrs/principles/001-team.md': teamXdrDocument('Shared B decision.'),
1777
+ });
1778
+
1779
+ const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1780
+
1781
+ expect(result.errors.filter((e) => /\[_core-adr-policy-010\.\d+-extends-/.test(e)).join('\n')).toBe('');
1782
+ });
1783
+
1784
+ test('accepts extends: YAML list format in scope index frontmatter', () => {
1785
+ const workspaceRoot = createWorkspace('extends-yaml-list', {
1786
+ '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[shared-a](shared-a/index.md)', '[shared-b](shared-b/index.md)']),
1787
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends:\n - shared-a\n - shared-b\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1788
+ '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1789
+ '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1790
+ '.xdrs/shared-a/index.md': '---\nscope-type: standard\nname: shared-a\ndescription: Shared A.\napply-to: All teams\nvalid-from: 2026-01-01\n---\n\n# shared-a Scope Overview\n\n[ADRs](adrs/index.md)\n',
1791
+ '.xdrs/shared-a/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Shared A decision']),
1792
+ '.xdrs/shared-a/adrs/principles/001-team.md': teamXdrDocument('Shared A decision.'),
1793
+ '.xdrs/shared-b/index.md': '---\nscope-type: standard\nname: shared-b\ndescription: Shared B.\napply-to: All teams\nvalid-from: 2026-01-01\n---\n\n# shared-b Scope Overview\n\n[ADRs](adrs/index.md)\n',
1794
+ '.xdrs/shared-b/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Shared B decision']),
1795
+ '.xdrs/shared-b/adrs/principles/001-team.md': teamXdrDocument('Shared B decision.'),
1764
1796
  });
1765
1797
 
1766
1798
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1767
1799
 
1768
- expect(result.errors.join('\n')).not.toContain('Scope index frontmatter related-scopes');
1800
+ expect(result.errors.filter((e) => /\[_core-adr-policy-010\.\d+-extends-/.test(e)).join('\n')).toBe('');
1769
1801
  });
1770
1802
 
1771
- test('reports invalid related-scopes value in scope index frontmatter', () => {
1772
- const workspaceRoot = createWorkspace('invalid-scope-related-scopes', {
1803
+ test('reports extends: referencing a missing scope', () => {
1804
+ const workspaceRoot = createWorkspace('extends-missing-scope', {
1773
1805
  '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)']),
1774
- '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes: 123\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1806
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: nonexistent-scope\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1775
1807
  '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1776
1808
  '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1777
1809
  });
1778
1810
 
1779
1811
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1780
1812
 
1781
- expect(result.errors.join('\n')).toContain('Scope index frontmatter related-scopes must be a scope name or list of scope names');
1813
+ expect(result.errors.join('\n')).toContain('[_core-adr-policy-010.32-extends-mandatory-presence]');
1814
+ expect(result.errors.join('\n')).toContain('nonexistent-scope');
1782
1815
  });
1783
1816
 
1784
- test('reports related-scopes scope that does not exist in workspace', () => {
1785
- const workspaceRoot = createWorkspace('related-scopes-missing-scope', {
1817
+ test('reports extends: self-reference in scope index frontmatter', () => {
1818
+ const workspaceRoot = createWorkspace('extends-self-reference', {
1786
1819
  '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)']),
1787
- '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes: nonexistent-scope\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1820
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: myteam\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1788
1821
  '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1789
1822
  '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1790
1823
  });
1791
1824
 
1792
1825
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1793
1826
 
1794
- expect(result.errors.join('\n')).toContain('related-scopes references scope "nonexistent-scope" which does not exist in the workspace');
1827
+ expect(result.errors.join('\n')).toContain('[_core-adr-policy-010.30-extends-no-self]');
1795
1828
  });
1796
1829
 
1797
- test('accepts related-scopes scope that exists in workspace', () => {
1798
- const workspaceRoot = createWorkspace('related-scopes-existing-scope', {
1799
- '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[sibling-team](sibling-team/index.md)']),
1800
- '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes: sibling-team\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1830
+ test('reports extends: referencing reserved scope _local', () => {
1831
+ const workspaceRoot = createWorkspace('extends-reserved-local', {
1832
+ '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)']),
1833
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: _local\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1801
1834
  '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1802
1835
  '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1803
- '.xdrs/sibling-team/index.md': '---\nscope-type: standard\nname: sibling-team\ndescription: Sibling team.\napply-to: Sibling team\nvalid-from: 2026-01-01\n---\n\n# sibling-team Scope Overview\n\n[ADRs](adrs/index.md)\n',
1804
- '.xdrs/sibling-team/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1805
- '.xdrs/sibling-team/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1806
1836
  });
1807
1837
 
1808
1838
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1809
1839
 
1810
- expect(result.errors.join('\n')).not.toContain('related-scopes references scope "sibling-team"');
1840
+ expect(result.errors.join('\n')).toContain('[_core-adr-policy-010.29-extends-reserved-scopes]');
1811
1841
  });
1812
1842
 
1843
+ test('reports extends: referencing reserved scope _core', () => {
1844
+ const workspaceRoot = createWorkspace('extends-reserved-core', {
1845
+ '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)']),
1846
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: _core\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1847
+ '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1848
+ '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1849
+ });
1850
+
1851
+ const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1852
+
1853
+ expect(result.errors.join('\n')).toContain('[_core-adr-policy-010.29-extends-reserved-scopes]');
1854
+ });
1855
+
1856
+ test('reports extends: cycle between two scopes', () => {
1857
+ const workspaceRoot = createWorkspace('extends-cycle', {
1858
+ '.xdrs/index.md': rootIndex(['[scope-a](scope-a/index.md)', '[scope-b](scope-b/index.md)']),
1859
+ '.xdrs/scope-a/index.md': '---\nscope-type: standard\nname: scope-a\ndescription: Scope A.\napply-to: Scope A\nvalid-from: 2026-01-01\nextends: scope-b\n---\n\n# scope-a Scope Overview\n\n[ADRs](adrs/index.md)\n',
1860
+ '.xdrs/scope-a/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - A decision']),
1861
+ '.xdrs/scope-a/adrs/principles/001-team.md': teamXdrDocument('A decision.'),
1862
+ '.xdrs/scope-b/index.md': '---\nscope-type: standard\nname: scope-b\ndescription: Scope B.\napply-to: Scope B\nvalid-from: 2026-01-01\nextends: scope-a\n---\n\n# scope-b Scope Overview\n\n[ADRs](adrs/index.md)\n',
1863
+ '.xdrs/scope-b/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - B decision']),
1864
+ '.xdrs/scope-b/adrs/principles/001-team.md': teamXdrDocument('B decision.'),
1865
+ });
1866
+
1867
+ const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1868
+
1869
+ expect(result.errors.join('\n')).toContain('[_core-adr-policy-010.31-extends-no-cycle]');
1870
+ });
1871
+
1872
+ test('reports extends: and follows: referencing same scope (disjoint violation)', () => {
1873
+ const workspaceRoot = createWorkspace('extends-follows-overlap', {
1874
+ '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[myarea-core](myarea-core/index.md)']),
1875
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nfollows: myarea-core\nextends: myarea-core\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1876
+ '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1877
+ '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1878
+ '.xdrs/myarea-core/index.md': '---\nscope-type: core\nname: myarea-core\ndescription: Meta-governance for myarea.\napply-to: All myarea scopes\nvalid-from: 2026-01-01\n---\n\n# myarea-core Scope Overview\n\n[ADRs](adrs/index.md)\n',
1879
+ '.xdrs/myarea-core/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Core decision']),
1880
+ '.xdrs/myarea-core/adrs/principles/001-team.md': teamXdrDocument('Core decision.'),
1881
+ });
1882
+
1883
+ const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1884
+
1885
+ expect(result.errors.join('\n')).toContain('[_core-adr-policy-010.28-extends-disjoint]');
1886
+ });
1887
+
1888
+ test('extends-only scope not in root index is exempt from missing link error', () => {
1889
+ const workspaceRoot = createWorkspace('extends-only-scope-not-in-index', {
1890
+ // shared-policies is NOT linked in the root index — it is only referenced via extends:
1891
+ '.xdrs/index.md': rootIndex(['[_core](_core/index.md)', '[myteam](myteam/index.md)']),
1892
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: shared-policies\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1893
+ '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1894
+ '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1895
+ '.xdrs/shared-policies/index.md': '---\nscope-type: standard\nname: shared-policies\ndescription: Shared policies.\napply-to: All teams\nvalid-from: 2026-01-01\n---\n\n# shared-policies Scope Overview\n\n[ADRs](adrs/index.md)\n',
1896
+ '.xdrs/shared-policies/adrs/index.md': teamAdrIndex(['- [001-shared](principles/001-shared.md) - Shared decision']),
1897
+ '.xdrs/shared-policies/adrs/principles/001-shared.md': teamXdrDocument('Shared decision.'),
1898
+ });
1899
+
1900
+ const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1901
+
1902
+ // shared-policies should NOT trigger "missing root index link" since it is extends-only
1903
+ expect(result.errors.filter((e) => e.includes('Root index is missing scope index link') && e.includes('shared-policies')).length).toBe(0);
1904
+ // No extends: validation errors should fire for the extends: field
1905
+ expect(result.errors.filter((e) => /\[_core-adr-policy-010\.\d+-extends-/.test(e)).join('\n')).toBe('');
1906
+ });
1907
+
1908
+ test('warns when extends-referenced scope also appears in root index', () => {
1909
+ const workspaceRoot = createWorkspace('extends-scope-in-root-index', {
1910
+ '.xdrs/index.md': rootIndex(['[_core](_core/index.md)', '[myteam](myteam/index.md)', '[shared-policies](shared-policies/index.md)']),
1911
+ '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nextends: shared-policies\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
1912
+ '.xdrs/myteam/adrs/index.md': teamAdrIndex(['- [001-team](principles/001-team.md) - Team decision']),
1913
+ '.xdrs/myteam/adrs/principles/001-team.md': teamXdrDocument('Team decision.'),
1914
+ '.xdrs/shared-policies/index.md': '---\nscope-type: standard\nname: shared-policies\ndescription: Shared policies.\napply-to: All teams\nvalid-from: 2026-01-01\n---\n\n# shared-policies Scope Overview\n\n[ADRs](adrs/index.md)\n',
1915
+ '.xdrs/shared-policies/adrs/index.md': teamAdrIndex(['- [001-shared](principles/001-shared.md) - Shared decision']),
1916
+ '.xdrs/shared-policies/adrs/principles/001-shared.md': teamXdrDocument('Shared decision.'),
1917
+ });
1918
+
1919
+ const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1920
+
1921
+ expect(result.errors.join('\n')).not.toContain('[_core-adr-policy-010.35-extends-index]');
1922
+ expect(result.warnings.join('\n')).toContain('[_core-adr-policy-010.35-extends-index]');
1923
+ expect(result.warnings.join('\n')).toContain('shared-policies');
1924
+ });
1925
+
1926
+
1927
+
1813
1928
  test('reports duplicate entries in follows list', () => {
1814
1929
  const workspaceRoot = createWorkspace('follows-duplicate-entries', {
1815
1930
  '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[myarea-core](myarea-core/index.md)']),
@@ -1842,7 +1957,7 @@ test('reports duplicate entries in follows comma-separated list', () => {
1842
1957
  expect(result.errors.join('\n')).toContain('follows has duplicate entry "myarea-core"');
1843
1958
  });
1844
1959
 
1845
- test('reports related-scopes that references the scope itself', () => {
1960
+ test('reports related-scopes that references the scope itself (field now removed, reports unknown field)', () => {
1846
1961
  const workspaceRoot = createWorkspace('related-scopes-self-reference', {
1847
1962
  '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)']),
1848
1963
  '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes: myteam\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
@@ -1852,10 +1967,10 @@ test('reports related-scopes that references the scope itself', () => {
1852
1967
 
1853
1968
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1854
1969
 
1855
- expect(result.errors.join('\n')).toContain('related-scopes must not reference the scope itself');
1970
+ expect(result.errors.join('\n')).toContain('unknown field "related-scopes"');
1856
1971
  });
1857
1972
 
1858
- test('reports duplicate entries in related-scopes list', () => {
1973
+ test('reports duplicate entries in related-scopes list (field now removed, reports unknown field)', () => {
1859
1974
  const workspaceRoot = createWorkspace('related-scopes-duplicate-entries', {
1860
1975
  '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[sibling-team](sibling-team/index.md)']),
1861
1976
  '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nrelated-scopes:\n - sibling-team\n - sibling-team\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
@@ -1868,10 +1983,10 @@ test('reports duplicate entries in related-scopes list', () => {
1868
1983
 
1869
1984
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1870
1985
 
1871
- expect(result.errors.join('\n')).toContain('related-scopes has duplicate entry "sibling-team"');
1986
+ expect(result.errors.join('\n')).toContain('unknown field "related-scopes"');
1872
1987
  });
1873
1988
 
1874
- test('reports related-scopes entry that is already declared in follows', () => {
1989
+ test('reports related-scopes entry already in follows (field now removed, reports unknown field)', () => {
1875
1990
  const workspaceRoot = createWorkspace('related-scopes-follows-overlap', {
1876
1991
  '.xdrs/index.md': rootIndex(['[myteam](myteam/index.md)', '[myarea-core](myarea-core/index.md)']),
1877
1992
  '.xdrs/myteam/index.md': '---\nscope-type: standard\nname: myteam\ndescription: Team.\napply-to: Test team\nvalid-from: 2026-01-01\nfollows: myarea-core\nrelated-scopes: myarea-core\n---\n\n# myteam Scope Overview\n\n[ADRs](adrs/index.md)\n',
@@ -1884,7 +1999,7 @@ test('reports related-scopes entry that is already declared in follows', () => {
1884
1999
 
1885
2000
  const result = lintWorkspace(workspaceRoot, { ignoreExternal: false });
1886
2001
 
1887
- expect(result.errors.join('\n')).toContain('related-scopes must not repeat scope "myarea-core" already declared in follows');
2002
+ expect(result.errors.join('\n')).toContain('unknown field "related-scopes"');
1888
2003
  });
1889
2004
 
1890
2005
  test('reports orphan asset files not referenced by any document', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xdrs-core",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "description": "A framework to structure, compile and distribute Architectural (ADR), Business (BDR), and Engineering (EDR) decision records contents so that AI agents and humans can reliably find and use them with hierarchical scopes and controlled rollout in the format of distributable versioned packages.",
5
5
  "repository": {
6
6
  "type": "git",