xdrs-core 0.43.0 → 0.43.1
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.
|
@@ -27,30 +27,30 @@ All scope types — both the five built-in types and any custom types — are de
|
|
|
27
27
|
|
|
28
28
|
### Details
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
**Section A — Scope-type definition standards**
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
#### 01-def-must-live-in-core-scope
|
|
33
33
|
|
|
34
34
|
A scope-type definition policy MUST be placed in a `core`-type scope (i.e., a scope whose `index.md` declares `scope-type: core`).
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
#### 02-def-naming
|
|
37
37
|
|
|
38
38
|
The policy `name` field MUST end with `{scope-type}-scope-type` (e.g., `security-scope-type`, `business-area-scope-type`). The policy file MUST follow the standard numbered filename convention `NNN-{scope-type}-scope-type.md` and MUST be placed in the `principles` subject of any decision type folder within the `core`-type scope (e.g., `_core/adrs/principles/011-core-scope-type.md`).
|
|
39
39
|
|
|
40
40
|
Note: this naming applies to the **policy name** only, not to any scope directory name. It is distinct from the `-core` scope-name suffix convention defined in `_core-adr-policy-011`.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
#### 02b-def-companion-files
|
|
43
43
|
|
|
44
44
|
A scope-type definition MAY be split across multiple policy files. The primary file MUST follow rule 02 above. Each additional companion file MUST be named `NNN-{scope-type}-scope-type-{qualifier}.md` (e.g., `012-business-area-scope-type-writing-style.md`), where `{qualifier}` is a short lowercase kebab-case descriptor. All companion files MUST be placed in the **same** `[type]/principles/` directory as the primary file within the same scope. A companion file MUST NOT exist without a corresponding primary file in the same scope and type folder. Tools and agents MUST apply all companion files for a scope-type as additional mandatory conventions alongside the primary.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
#### 03-def-required-content
|
|
47
47
|
|
|
48
48
|
A scope-type definition policy MUST define:
|
|
49
49
|
|
|
50
50
|
- The scope type name (the value that instances declare in their `scope-type:` field).
|
|
51
51
|
- When to use this scope type and what kinds of scopes SHOULD declare it.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
#### 04-def-preferred-content
|
|
54
54
|
|
|
55
55
|
A scope-type definition policy SHOULD define:
|
|
56
56
|
|
|
@@ -59,7 +59,7 @@ A scope-type definition policy SHOULD define:
|
|
|
59
59
|
- What content SHOULD NOT be placed in scopes of this type.
|
|
60
60
|
- Special instructions on how to organise or write content in scopes of this type.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
#### 05-def-instance-declaration
|
|
63
63
|
|
|
64
64
|
A scope that is an instance of one or more scope types MUST declare `scope-type` in its `index.md` frontmatter. Two formats are valid:
|
|
65
65
|
|
|
@@ -68,77 +68,77 @@ A scope that is an instance of one or more scope types MUST declare `scope-type`
|
|
|
68
68
|
|
|
69
69
|
When multiple scope types are declared, all rules from all declared types (and their parent chains) apply simultaneously to documents in the scope. A document MUST satisfy the requirements of every applicable type. When two types define a rule with the same rule number but different content, the conflict MUST be declared in a `## Conflicts` section of the overriding scope-type policy (see Section C rule 19-conflict-declarations). An undeclared conflict makes a document impossible to satisfy and MUST be resolved before authoring begins.
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
#### 05b-def-multi-type-validation
|
|
72
72
|
|
|
73
73
|
A comma-separated `scope-type` list MUST NOT have empty elements. Each element MUST satisfy the same constraints as a single `scope-type` value (rules 06 and 08). Duplicate values within the same list are NOT allowed.
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
#### 06-def-no-underscore-prefix
|
|
76
76
|
|
|
77
77
|
Custom scope-type names MUST NOT start with `_`. The `_` prefix is reserved for built-in scope types defined in `_core` (currently only `_local`).
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
#### 07-def-parent-scope-type
|
|
80
80
|
|
|
81
81
|
A scope-type definition policy MAY declare a parent scope type by including a rule titled `NN-parent-scope-type` in its `### Details` section. The body of that rule MUST reference the parent scope-type name in backticks (e.g., "Instances of this scope type inherit all rules from the `standard` scope type."). This rule MUST appear only in the **primary** file (rule 02), not in a companion file (rule 02b). Tools and agents MUST resolve the full parent chain transitively. Child scope-type standards override parent standards on any conflict.
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
#### 08-def-valid-iff-policy-exists
|
|
84
84
|
|
|
85
85
|
A `scope-type` value in a scope `index.md` is valid if and only if a policy file whose name ends with `{scope-type}-scope-type` exists in the `principles` subject of any `core`-type scope in the workspace. Tools (such as `xdrs-core lint`) MUST enforce this for every element when `scope-type` is an array.
|
|
86
86
|
|
|
87
87
|
When a scope declares a `scope-type` (single or array) but any corresponding `{scope-type}-scope-type.md` policy is absent from the workspace, the scope MUST be treated as READ-ONLY by all tools and agents: content in it MUST NOT be added, changed, or removed, and its content MUST NOT be reviewed. Tools and agents MUST surface the read-only status to the user and MUST NOT propose or apply any changes until the scope-type governance is installed.
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
#### 08b-def-scope-type-must-be-structured
|
|
90
90
|
|
|
91
|
-
All `{scope-type}-scope-type.md` policies (primary and companion files) MUST follow the structured format defined in `_core-adr-policy-008`: the policy MUST contain a `### Details` section and at least one `#### NN-rulename` rule block within it. This makes individual scope-type rules machine-readable, individually citable, and detectable for conflict analysis. Tools MUST enforce this and report an error using code `_core-adr-policy-010.08b-def-scope-type-must-be-structured`.
|
|
91
|
+
All `{scope-type}-scope-type.md` policies (primary and companion files) MUST follow the structured format defined in `_core-adr-policy-008`: the policy MUST contain a `### Details` section and at least one `#### NN-rulename` rule block within it. This makes individual scope-type rules machine-readable, individually citable, and detectable for conflict analysis. Tools MUST enforce this and report an error using code `_core-adr-policy-010-scope-governance.08b-def-scope-type-must-be-structured`.
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
#### 08c-def-core-scope-policies-must-be-structured
|
|
94
94
|
|
|
95
|
-
All policy files in a `core`-type scope (a scope whose `index.md` declares `scope-type: core`) MUST follow the structured format defined in `_core-adr-policy-008` (see rule 08b). This requirement applies to ALL policies in the scope, not only scope-type definitions or local meta-policies. The `_core` scope itself is exempt from this requirement until its existing policies are migrated. Tools MUST enforce this for all non-exempt core-type scopes and report an error using code `_core-adr-policy-010.08c-def-core-scope-policies-must-be-structured`.
|
|
95
|
+
All policy files in a `core`-type scope (a scope whose `index.md` declares `scope-type: core`) MUST follow the structured format defined in `_core-adr-policy-008` (see rule 08b). This requirement applies to ALL policies in the scope, not only scope-type definitions or local meta-policies. The `_core` scope itself is exempt from this requirement until its existing policies are migrated. Tools MUST enforce this for all non-exempt core-type scopes and report an error using code `_core-adr-policy-010-scope-governance.08c-def-core-scope-policies-must-be-structured`.
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
**Section B — Local meta-policies**
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
#### 09-local-naming
|
|
102
102
|
|
|
103
103
|
The word `core` as a hyphen-delimited segment in a policy filename title is reserved for local meta-policies. A local meta-policy is identified by its filename title starting with `core`: either `NNN-core.md` (primary, no qualifier) or `NNN-core-{qualifier}.md` (companion, where `{qualifier}` is a short lowercase kebab-case descriptor). A policy filename title MUST NOT use `core` as a word segment unless it is a valid local meta-policy (see rule 10). Scope-type definition files (`NNN-{scope-type}-scope-type.md`) are exempt from this restriction even when their title begins with `core`.
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
#### 10-local-placement
|
|
106
106
|
|
|
107
107
|
Local meta-policy files MUST be placed in the `principles` subject of any type folder within the scope they govern (e.g., `my-team/adrs/principles/001-core.md`). They apply implicitly to that scope — no declaration in `index.md` is required. Local meta-policies MUST NOT be placed in any other subject folder; a file whose title starts with `core` in a non-`principles` subject is a lint error.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
#### 10b-local-primary-required
|
|
110
110
|
|
|
111
111
|
A companion local meta-policy (`NNN-core-{qualifier}.md`) MUST NOT exist in a type folder unless a primary local meta-policy (`NNN-core.md`) also exists in the **same** type folder. Tools MUST enforce this constraint.
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
#### 10c-local-unique-qualifier
|
|
114
114
|
|
|
115
115
|
Each qualifier (including the blank qualifier of the primary) MUST be unique across all type folders within the same scope. For example, a scope MUST NOT have both `adrs/principles/001-core.md` and `bdrs/principles/001-core.md` — the blank qualifier would appear twice.
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
#### 11-local-optional
|
|
118
118
|
|
|
119
119
|
Creating a local meta-policy is optional. It SHOULD be created when a scope has specific structural, authoring, or content constraints that differ from `_core` defaults or the scope's declared scope-type standards.
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
#### 12-local-content
|
|
122
122
|
|
|
123
123
|
A local meta-policy SHOULD define the same kinds of instructions as a scope-type definition policy (rules 03–04 above): naming conventions for content in the scope, allowed content, forbidden content, and organisation rules. These instructions apply only to policy documents authored in this one scope; they do not govern non-policy artifacts (skills, articles, plans, research). Local meta-policies and their companion files MAY include a `## Conflicts` section to declare that one of their rules overrides a conflicting rule from a scope-type policy or `follows:` scope policy (see Section C rule 19-conflict-declarations).
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
#### 12b-local-must-be-structured
|
|
126
126
|
|
|
127
|
-
All local meta-policy files (`NNN-core.md` and `NNN-core-{qualifier}.md`) MUST follow the structured format defined in `_core-adr-policy-008` (see rule 08b). Tools MUST enforce this and report an error using code `_core-adr-policy-010.12b-local-must-be-structured`.
|
|
127
|
+
All local meta-policy files (`NNN-core.md` and `NNN-core-{qualifier}.md`) MUST follow the structured format defined in `_core-adr-policy-008` (see rule 08b). Tools MUST enforce this and report an error using code `_core-adr-policy-010-scope-governance.12b-local-must-be-structured`.
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
#### 13-local-mandatory-when-present
|
|
130
130
|
|
|
131
131
|
When one or more local meta-policies exist in a scope, tools and agents MUST load and apply ALL of them as mandatory conventions when authoring or reviewing **policy documents** in that scope. If any found local meta-policy file is unreadable, tools MUST halt and report an error before proceeding.
|
|
132
132
|
|
|
133
133
|
---
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
**Section C — Governance application and precedence**
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
#### 14-application-follows
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
Tools and agents MUST apply the policies of all scopes listed in a scope's `follows:` frontmatter as mandatory conventions, in addition to `_core`. When the same topic is addressed by multiple `follows:` scopes, the last-listed scope MUST take precedence on conflicts.
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
#### 15-application-scope-type
|
|
142
142
|
|
|
143
143
|
When adding or reviewing content in a scope, tools and agents MUST:
|
|
144
144
|
|
|
@@ -151,7 +151,7 @@ When adding or reviewing content in a scope, tools and agents MUST:
|
|
|
151
151
|
4. Deduplicate the flat list keeping the **first occurrence** of each type (preserves the ancestor semantics of whichever type introduced the parent earliest).
|
|
152
152
|
5. Apply all policies from the deduplicated list as mandatory conventions. Later entries in the list override earlier entries when the same rule number appears with different content, provided the override is declared (see rule 19-conflict-declarations).
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
#### 16-application-local
|
|
155
155
|
|
|
156
156
|
When adding or reviewing **policy documents** in a scope, tools and agents MUST:
|
|
157
157
|
|
|
@@ -159,7 +159,7 @@ When adding or reviewing **policy documents** in a scope, tools and agents MUST:
|
|
|
159
159
|
2. If any are found, read and apply ALL of them as mandatory conventions. If a found file is unreadable, halt with an error before proceeding.
|
|
160
160
|
3. If none are found, continue without error — absence of local meta-policies is valid.
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
#### 17-precedence
|
|
163
163
|
|
|
164
164
|
When multiple governance layers define a rule with the same rule number, the later entry in the following ordered chain takes precedence (lowest to highest):
|
|
165
165
|
|
|
@@ -171,11 +171,11 @@ In all cases, an override is valid only if the overriding policy contains a `##
|
|
|
171
171
|
|
|
172
172
|
All of the above are subordinate to `_core` structural rules, which MUST NOT be overridden.
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
#### 18-ordering-custom-types
|
|
175
175
|
|
|
176
176
|
Custom-type scopes SHOULD be placed in the `standard` position in the root `index.md` ordering (i.e., after `platform` scopes and before `_local`).
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
#### 19-conflict-declarations
|
|
179
179
|
|
|
180
180
|
When a policy (scope-type definition, local meta-policy, or companion) overrides a rule defined by a lower-precedence policy in the governance chain, the overriding policy MUST include a `## Conflicts` section that declares:
|
|
181
181
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xdrs-core",
|
|
3
|
-
"version": "0.43.
|
|
3
|
+
"version": "0.43.1",
|
|
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",
|