@sublang/spex 0.3.0 → 2.0.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.
@@ -1,5 +1,6 @@
1
1
  <!-- SPDX-License-Identifier: Apache-2.0 -->
2
2
  <!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
3
+ <!-- AI agents: do not edit this file without human approval. -->
3
4
 
4
5
  # DR-000: Spec Structure and Format
5
6
 
@@ -9,7 +10,8 @@ Accepted
9
10
 
10
11
  ## Context
11
12
 
12
- Specifications (specs) need a standardized format and structure to support iterative development and collaboration between AI and humans.
13
+ Specifications (specs) need a normative format and structure to support iterative development and collaboration between AI and humans.
14
+ AI-native software development is a series of human intent realizations.
13
15
 
14
16
  ## Decision
15
17
 
@@ -18,19 +20,19 @@ Specifications (specs) need a standardized format and structure to support itera
18
20
  Spex organizes specs around three essential elements of software development:
19
21
 
20
22
  - **Decisions**. The choices made in product and system *design*.
21
- - **Iterations**. The incremental plans for *implementation*.
22
- - **Requirements**. The *behaviors* and *constraints* of the product and system.
23
+ - **Intents**. The development intents and their *implementation*.
24
+ - **Requirements**. The required *behaviors* of the product and system.
23
25
 
24
26
  ### Forms
25
27
 
26
- Spex uses two forms of specs to balance unification and flexibility.
28
+ Spex uses two forms of specs to balance normalization and flexibility.
27
29
 
28
30
  - **Records** must follow specified formats and may use free-form content within those formats.
29
- Decisions and iterations are stored as records.
30
- - Decision records (DRs) follow the ADR (Architectural Decision Record) format [[1]], with active section titles defined by [META-4](../meta.md#meta-4).
31
- - Iteration records (IRs) contain the sections defined by [META-5](../meta.md#meta-5).
32
- - **Items** must follow the active GEARS pattern defined by [META-6](../meta.md#meta-6) to specify behaviors and constraints.
33
- Each item file must include the active intent section defined by [META-3](../meta.md#meta-3).
31
+ Decisions and intents are stored as records.
32
+ - Decision records (DRs) follow the ADR (Architectural Decision Record) format [[1]].
33
+ - Intent records (IRs) plan an intent's implementation and track its progress [[meta-5](../meta.md#meta-5)].
34
+ - **Items** must follow the GEARS pattern [[2]] to specify behaviors.
35
+ A spec package collects spec items that share an intent.
34
36
 
35
37
  ### Organization
36
38
 
@@ -39,47 +41,55 @@ Spex creates the default `specs/` directory under the repo root, with the follow
39
41
  | Path | Content | File Naming |
40
42
  | --------- | ------- | ------ |
41
43
  | `decisions/` | DRs. Design decisions and rationale. | \<NNN\>-\<kebab-case\>.md |
42
- | `iterations/` | IRs. Implementation plans. | \<NNN\>-\<kebab-case\>.md |
43
- | `user/` | item files for user-visible behavior. What the system does. | [\<path\>/]\<kebab-case\>.md |
44
- | `dev/` | item files for system internal behavior. How the system is built. | [\<path\>/]\<kebab-case\>.md |
45
- | `test/` | item files for acceptance testing. Quality guard for user and dev items. | [\<path\>/]\<kebab-case\>.md |
44
+ | `intents/` | IRs. Intent implementation plans and states. | \<NNN\>-\<kebab-case\>.md |
45
+ | `packages/` | Spec packages: collections of behaviors and their tests. | \<kebab-case\>.md |
46
46
  | `map.md` | spec index for navigation | - |
47
47
  | `meta.md` | the spec of specs | - |
48
48
 
49
- ### Item syntax
49
+ ### Spec packages
50
50
 
51
- The active `meta.md` defines the GEARS item pattern, clause forms, and GWT mapping.
52
- This keeps localized scaffolds aligned with the same framework without restating English-only syntax here.
51
+ A spec package is a collection of behaviors for a shared intent, in one file under `packages/`.
52
+ It is the unit of spec authoring, reuse, customization, and composition.
53
53
 
54
- ### Spec packages
54
+ For example, a spec package for generating short URLs may be `specs/packages/signing/gen-url.md`, where `signing/` is a local collection of related packages for development convenience.
55
55
 
56
- A spec package is a coherent set of spec items for a *single* intent.
57
- It is the basic unit for spec composition, reuse, and extension.
56
+ Each package file carries these sections in this order [[meta-30](../meta.md#meta-30)]:
58
57
 
59
- A spec package consists of one to three coordinated item files sharing the same relative path and basename.
60
- The item files are located in `user/`, `dev/`, or `test/` according to their category.
58
+ - `Intent` for the purpose the package's items share.
59
+ - `External Behavior` for outcomes and guarantees the package's users rely on.
60
+ A package's user may be a human or a system component.
61
+ - `Internal Behavior` (optional) for behavior hidden from the package's users.
62
+ - `Verification` for test items that check the package's own claims.
63
+ - `References` (optional) for external sources.
61
64
 
62
- For example, a spec package for generating short URLs may be named `gen-url` and consist of:
65
+ An installed package can be customized in place by adding, changing, or deleting spec items in its file; this changes only the installed copy and creates no peer package relationship.
63
66
 
64
- - `specs/user/signing/gen-url.md` for user-facing behaviors (e.g., basic operations, URL format)
65
- - `specs/dev/signing/gen-url.md` for internal-implementation behaviors (e.g., algorithms)
66
- - `specs/test/signing/gen-url.md` for tests covering the corresponding user and dev items
67
+ ### Package relationships
67
68
 
68
- Here, `signing/` is a local collection of related spec packages for development convenience.
69
+ A package behavior shall express every peer package relationship through binding citations to peer External Behavior [[meta-14](../meta.md#meta-14)]:
69
70
 
70
- `map.md` organizes item files by package.
71
+ | Case | Form |
72
+ | --- | --- |
73
+ | Fixed binding | The package definition fixes the binding to a required behavior at the exact phrase the cited behavior makes specific. |
74
+ | Polymorphic binding | Instantiation resolves the binding to a selected behavior at the exact phrase the cited behavior makes specific. |
75
+ | Composition | A behavior states an integrated outcome and cites each contributing behavior at the exact phrase it makes specific. |
71
76
 
72
77
  ### Citations
73
78
 
74
79
  DRs and items are persistent and may cite each other.
75
- IRs may be temporary and must not be cited by DRs or items.
76
- `map.md` may cite IRs, as it indexes all spec files and is kept in sync as files change.
80
+ A DR references a spec item only to support what the DR itself states, never to carry content it leaves unsaid.
81
+
82
+ IRs may cite, but must not be cited by, DRs or items.
83
+ `map.md` may cite all spec files and is kept in sync as files change.
77
84
 
78
85
  ## Consequences
79
86
 
80
87
  - Consistent structure and format across development cycles
81
- - Clear positions of directories and files
82
- - Flexible expression of design and implementation
88
+ - One file per package: a single read covers a package's external behavior, internal behavior, and verification
89
+ - One package kind supports in-place customization; one binding-citation form expresses every peer package relationship
90
+ - Every peer package relationship is visible as a citation at the phrase that relies on it
91
+ - A package stands alone once its citations are stripped
92
+ - Flexible expression of external, internal, and composed behavior
83
93
 
84
94
  ## References
85
95
 
@@ -0,0 +1,39 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
3
+
4
+ # IR-000: SPDX Headers
5
+
6
+ ## Status
7
+
8
+ Pending
9
+
10
+ ## Intent
11
+
12
+ Apply [[licensing-1](../packages/licensing.md#licensing-1)], [[licensing-2](../packages/licensing.md#licensing-2)], [[licensing-5](../packages/licensing.md#licensing-5)] to in-scope files and pin the project's header format.
13
+
14
+ ## Deliverables
15
+
16
+ - [ ] Add SPDX headers to in-scope files missing them
17
+ - [ ] Add `licensing-9` to the External Behavior of [`packages/licensing.md`](../packages/licensing.md) with the project's actual header format, license, and copyright
18
+
19
+ ## Tasks
20
+
21
+ 1. Resolve scope: detect a project-root license file per [[licensing-7](../packages/licensing.md#licensing-7)]; enumerate in-scope files per [[licensing-6](../packages/licensing.md#licensing-6)].
22
+
23
+ 2. Insert SPDX lines in each file's first comment block (after any shebang), using the file's native comment syntax.
24
+
25
+ 3. Add `licensing-9` to the `## External Behavior` section of [`packages/licensing.md`](../packages/licensing.md), showing the concrete header per comment style. Example for a single Apache-2.0 `LICENSE`:
26
+
27
+ ```markdown
28
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
29
+ <!-- SPDX-FileCopyrightText: <year> <holder> -->
30
+ ```
31
+
32
+ ```typescript
33
+ // SPDX-License-Identifier: Apache-2.0
34
+ // SPDX-FileCopyrightText: <year> <holder>
35
+ ```
36
+
37
+ ## Verification
38
+
39
+ - [[licensing-3](../packages/licensing.md#licensing-3)], [[licensing-4](../packages/licensing.md#licensing-4)] pass on all in-scope files.
@@ -11,44 +11,31 @@ Code can be inconsistent with specs during development.
11
11
 
12
12
  Know the rules in [`meta.md`](meta.md) before authoring, modifying, or reviewing a DR, IR, or item.
13
13
 
14
- - DRs and IRs: see [Organization](meta.md#organization), [Record format](meta.md#record-format), and [Citation](meta.md#citation).
15
- - Items: see [Organization](meta.md#organization), [Item syntax](meta.md#item-syntax), [Spec packages](meta.md#spec-packages), and [Citation](meta.md#citation).
16
-
17
14
  ## Layout
18
15
 
19
16
  ```text
20
- decisions/ Decision records (DRs)
21
- iterations/ Iteration records (IRs)
22
- user/ User-visible behavior
23
- dev/ Implementation requirements
24
- test/ Acceptance testing
25
- map.md This index
26
- meta.md The spec of specs
17
+ decisions/ Decision records (DRs)
18
+ intents/ Intent records (IRs)
19
+ packages/ Spec packages (one file per package)
20
+ map.md This index
21
+ meta.md The spec of specs
27
22
  ```
28
23
 
29
24
  ## Decisions
30
25
 
31
26
  | ID | File | Summary |
32
27
  | --- | --- | --- |
33
- | DR-000 | [000-spec-structure-format.md](decisions/000-spec-structure-format.md) | Spec structure, format, and naming conventions |
28
+ | [DR-000](decisions/000-spec-structure-format.md) | 000-spec-structure-format.md | Spec structure, format, and naming conventions |
34
29
 
35
- ## Iterations
30
+ ## Intents
36
31
 
37
- | ID | File | Goal |
32
+ | ID | File | Intent |
38
33
  | --- | --- | --- |
39
- | IR-000 | [000-spdx-headers.md](iterations/000-spdx-headers.md) | Add SPDX headers to applicable files |
34
+ | [IR-000](intents/000-spdx-headers.md) | 000-spdx-headers.md | Add SPDX headers to applicable files |
40
35
 
41
36
  ## Packages
42
37
 
43
- ### GIT
44
-
45
- | Group | File | Summary |
46
- | --- | --- | --- |
47
- | dev | [git.md](dev/git.md) | Commit message format and AI co-authorship trailers |
48
-
49
- ### LIC
50
-
51
- | Group | File | Summary |
52
- | --- | --- | --- |
53
- | dev | [licensing.md](dev/licensing.md) | SPDX header requirements and file-scope rules |
54
- | test | [licensing.md](test/licensing.md) | Copyright and license header presence checks |
38
+ | File | Summary |
39
+ | --- | --- |
40
+ | [git.md](packages/git.md) | Commit message format and AI co-authorship trailers |
41
+ | [licensing.md](packages/licensing.md) | SPDX header requirements and verification checks |
@@ -1,86 +1,79 @@
1
1
  <!-- SPDX-License-Identifier: Apache-2.0 -->
2
2
  <!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
3
+ <!-- AI agents: do not edit this file without human approval. -->
3
4
 
4
- # META: Spec Definition
5
+ # meta: Spec Definition
5
6
 
6
7
  ## Intent
7
8
 
8
- This spec defines the structure and organization of specifications (specs), per [DR-000](decisions/000-spec-structure-format.md).
9
+ This file defines the structure and organization of specifications (specs), per [DR-000](decisions/000-spec-structure-format.md).
9
10
 
10
- ## Organization
11
+ ## Overall
11
12
 
12
- ### META-1
13
+ ### meta-1
13
14
 
14
15
  The `specs/` directory shall contain the following subdirectories and files:
15
16
 
16
17
  | Path | Content | File Naming |
17
18
  | --------- | ------- | ------ |
18
- | `decisions/` | Decision records (DRs) | \<NNN\>-\<kebab-case\>.md |
19
- | `iterations/` | Iteration records (IRs) | \<NNN\>-\<kebab-case\>.md |
20
- | `user/` | item files for user-visible behavior | [\<path\>/]\<kebab-case\>.md |
21
- | `dev/` | item files for implementation requirements | [\<path\>/]\<kebab-case\>.md |
22
- | `test/` | item files for acceptance testing | [\<path\>/]\<kebab-case\>.md |
23
- | `map.md` | spec index for navigation with item files organized by packages | - |
19
+ | `decisions/` | decision records (DRs) | \<NNN\>-\<kebab-case\>.md |
20
+ | `intents/` | intent records (IRs) | \<NNN\>-\<kebab-case\>.md |
21
+ | `packages/` | spec packages | \<kebab-case\>.md |
22
+ | `map.md` | spec index — start here for context search | - |
24
23
  | `meta.md` | the spec of specs | - |
25
24
 
26
- ### META-3
25
+ ### meta-23
27
26
 
28
- Each item file shall include an `## Intent` section stating its purpose.
27
+ A spec in any form shall contain the minimal information, concisely expressed, to act on it or audit it, preferring bullets, tables, or (renderable) diagrams to prose:
29
28
 
30
- ### META-21
29
+ - For example, `map.md` limits its indexes to those an AI agent needs to find the right files.
31
30
 
32
- Test items shall focus on integration and system testing.
31
+ ### meta-25
33
32
 
34
- Unit tests shall be part of the implementation and shall not be specified as spec items.
33
+ A spec file shall keep one sentence per line — with lists, tables, and diagrams exempt.
35
34
 
36
35
  ## Record format
37
36
 
38
- ### META-4
37
+ ### meta-4
39
38
 
40
- Each decision record (DR) shall follow the ADR format [[2]] with the following sections: Status, Context, Decision, and Consequences.
39
+ Each DR shall follow the ADR format [[2]], with sections Status, Context, Decision, Consequences, and References.
41
40
 
42
- ### META-5
41
+ ### meta-5
43
42
 
44
- Each iteration record (IR) shall contain the following sections: Goal, Deliverables (with checkboxes), Tasks (numbered, each in one-commit size), and Acceptance criteria.
43
+ Each IR shall contain sections Status, Intent, Deliverables (with checkboxes), Tasks (numbered, each sized to one commit), and Verification.
45
44
 
46
- ### META-23
45
+ ### meta-22
47
46
 
48
- DRs and IRs shall be written in concise language, including only what is needed to act on or audit the record, with preference for bullets and tables over prose paragraphs.
47
+ A record's ID shall join its kind prefix to its filename's leading number — `DR-<NNN>` under `decisions/`, `IR-<NNN>` under `intents/` — with the leading number unique within each record kind.
49
48
 
50
- ### META-24
49
+ ### meta-24
51
50
 
52
- A DR shall specify design decisions and constraints, not duplicate implementation logic.
53
- A DR is sufficient when an implementer can generate or audit code from the design intent, constraints, and tradeoffs.
54
- Implementation details shall be included only when they are part of the design contract.
51
+ A DR shall record design decisions and constraints, not implementation details, sufficient to provide context for or to audit the corresponding spec items.
55
52
 
56
- ### META-25
53
+ ### meta-28
57
54
 
58
- In prose paragraphs of DRs and IRs, each sentence shall begin on a new line for diff readability.
59
- List items and table cells are exempt, since their delimiters already isolate per-entry changes.
60
- Fixed-width column wrapping within a sentence is allowed.
55
+ An IR shall be disposable: it contains nothing a DR or a spec item should cover, and its deletion loses no design or behavior record.
61
56
 
62
57
  ## Item syntax
63
58
 
64
- ### META-6
59
+ ### meta-6
65
60
 
66
- Each spec item shall use the GEARS pattern [[1]]:
61
+ Each spec item shall use the GEARS pattern [[1]], with its clauses and punctuation following natural English conventions:
67
62
 
68
63
  ```text
69
- [Where <static precondition(s)>] [While <stateful precondition(s)>] [When <trigger>] The <subject> shall <behavior>.
64
+ [Where <static precondition(s)>] [While <stateful precondition(s)>] [When <trigger>] <subject> shall <behavior(s)>.
70
65
  ```
71
66
 
72
- Clauses and punctuation shall follow standard English conventions.
73
-
74
67
  | Clause | Purpose | Example |
75
68
  | ------ | ------- | ------- |
76
69
  | Where | Static preconditions (features, config) | Where debug mode is enabled |
77
- | While | Stateful preconditions (runtime state) | While the connection is active |
78
- | When | Trigger event (at most one) | When the user clicks submit |
79
- | shall | Required behavior | The form shall validate inputs |
70
+ | While | Stateful preconditions (runtime states) | While the connection is active |
71
+ | When | Trigger event — at most one | When the user clicks submit |
72
+ | shall | Required behaviors | The form shall validate inputs and highlight each violation |
80
73
 
81
- ### META-7
74
+ ### meta-7
82
75
 
83
- Where test cases are expressed by Given-When-Then (GWT), their spec items shall map GWT to GEARS [[1]]:
76
+ Where test cases can be expressed by Given-When-Then (GWT), their spec items shall map GWT to the GEARS clauses [[meta-6](#meta-6)]:
84
77
 
85
78
  | GWT | Clause |
86
79
  | --- | ------ |
@@ -88,85 +81,132 @@ Where test cases are expressed by Given-When-Then (GWT), their spec items shall
88
81
  | When | When |
89
82
  | Then | shall |
90
83
 
91
- ### META-8
84
+ ### meta-8
85
+
86
+ Each spec item shall be self-contained: every reliance on another item is an explicit citation [[meta-16](#meta-16)].
92
87
 
93
- Each item shall be self-contained:
88
+ ### meta-29
94
89
 
95
- - It shall have no implicit dependency on sections other than its own subsections.
96
- - Citations to other specs or shared sections shall be explicit.
90
+ Each spec item shall state one requirement in one GEARS statement [[meta-6](#meta-6)], with attachments introduced by a colon at the statement's end and elaborating only that requirement:
97
91
 
98
- ### META-26
92
+ | Item kind | Example attachment |
93
+ | --- | --- |
94
+ | Behavior | ordered steps or the cases and outcomes of one operation or decision |
95
+ | Test | the assertions of one execution flow or one explicit case matrix |
99
96
 
100
- A spec item shall describe behavior as observable outcomes (e.g., file state, exit code, printed output, return value, network call) under named conditions, including any conditions under which a particular outcome shall not occur.
97
+ - An attachment may take a form such as a note, list, table, (renderable) diagram, or example.
98
+ - A condition inside an attachment is a case label.
99
+ - Differing stateful preconditions or triggers are evidence of additional spec items.
101
100
 
102
101
  ## Spec packages
103
102
 
104
- ### META-9
103
+ ### meta-13
105
104
 
106
- A spec package shall consist of one to three coordinated item files sharing the same relative path and basename under `user/`, `dev/`, or `test/`.
105
+ A spec package shall define a closed set of subjects and their behavioral requirements for a shared intent.
107
106
 
108
- ### META-10
107
+ ### meta-34
109
108
 
110
- A spec package shall have a basename \<kebab-case\>.md unique across `specs/user/`, `specs/dev/`, and `specs/test/`, with a short form \<ALLCAPS\>.
109
+ A spec package shall be complete and exact for its intent: sufficient to reimplement its behavior, stating no requirement beyond that intent, leaving no gap within it, and stating no requirement another spec already states.
111
110
 
112
- Example: `package-management.md` has short form `PKGMGT`.
111
+ ### meta-9
113
112
 
114
- ### META-11
113
+ A spec package shall be one file containing spec items under `specs/packages/` or its subdirectory.
115
114
 
116
- Each item shall have an ID unique within `specs/`, following \<PACK\>-\<N...\> format (e.g., AUTH-11, URL-3) as a markdown heading for anchor linking.
115
+ ### meta-30
117
116
 
118
- Note: \<PACK\> refers to the short form of the package name.
117
+ Each package file shall contain only the following sections, in this order:
119
118
 
120
- ### META-12
119
+ | Section | Presence | Content |
120
+ | ------- | -------- | ------- |
121
+ | `Intent` | required | the package's purpose |
122
+ | `External Behavior` | required | outcomes and guarantees the package's users may rely on |
123
+ | `Internal Behavior` | optional | behavior hidden from the package's users |
124
+ | `Verification` | required | test items verifying this package's behavior |
125
+ | `References` | optional | external sources [[meta-19](#meta-19)] |
121
126
 
122
- Item IDs shall not be modified once released; new items shall use higher IDs per package.
127
+ - A package's user is any human or system component using its contract; External and Internal are relative to the package.
128
+ - Topic subsections and item headings live inside the Behavior and Verification sections.
123
129
 
124
- ### META-13
130
+ ### meta-10
125
131
 
126
- A spec package shall define a closed set of subjects and their behaviors for a single intent. The shall clause (see [META-6](#meta-6)) of any item shall only involve subjects and behaviors within its own package.
132
+ A file containing spec items shall use a lowercase kebab-case basename \<pack\>.md unique across the specs tree, with \<pack\> serving as its identifier.
127
133
 
128
- ### META-14
134
+ ### meta-11
129
135
 
130
- The precondition and trigger clauses (Where, While, When; see [META-6](#meta-6)) of items shall be allowed to reference subjects and behaviors from other spec packages.
136
+ Each spec item shall use \<pack\>-\<N\> as its lowercase heading, anchor, and citation text:
131
137
 
132
- ### META-15
138
+ - \<pack\> is its containing file's identifier [[meta-10](#meta-10)];
139
+ - \<N\> is a positive integer unique within that file;
140
+ - a new item takes the lowest positive \<N\> neither assigned nor reserved by a public release [[meta-12](#meta-12)].
133
141
 
134
- Each spec package shall minimize references to the containing project. When a project-specific reference is essential to a package's intent, it shall be documented in the package's `## Intent` section.
142
+ ### meta-12
135
143
 
136
- ## Citation
144
+ A publicly released item ID shall remain permanently bound to the concern its item names:
137
145
 
138
- ### META-16
146
+ - the ID is never renumbered or reassigned;
147
+ - the item's content may evolve only with that concern preserved;
148
+ - an unreleased ID can be reassigned.
139
149
 
140
- Citations to specific items shall use relative links with anchors (e.g., `[META-1](meta.md#meta-1)`).
150
+ ### meta-14
141
151
 
142
- ### META-17
152
+ A behavior item shall express every peer package relationship as a binding citation — an inline citation of that package's External Behavior at the exact phrase the cited behavior makes specific [[meta-16](#meta-16)]:
143
153
 
144
- DRs and items shall be allowed to cite each other.
154
+ - a binding citation binds behavior, never package subjects or states alone;
155
+ - one phrase may carry several binding citations when several behaviors make its different parts specific, respectively;
156
+ - there is no uncited peer package dependency.
145
157
 
146
- ### META-18
158
+ ### meta-15
147
159
 
148
- IRs shall not be cited by any spec except `map.md`.
160
+ A spec package shall stand alone: readable in full without following any link — a citation never carries its meaning.
149
161
 
150
- ### META-19
162
+ ### meta-31
151
163
 
152
- External references in specs shall cite authoritative sources (e.g., official docs) with numbered markers (e.g., `[[1]]`) linked to specific URLs in a `## References` section that shall have no uncited entries.
164
+ A lowercase kebab-case subdirectory under `specs/packages/` shall be an organizational collection only: a file's identity is its basename [[meta-10](#meta-10)]; moving a file between collections changes relative citation paths but no item ID or anchor.
153
165
 
154
- ### META-20
166
+ ## Testing
155
167
 
156
- Each test item shall include one `Verifies:` metadata line immediately below its item ID heading.
168
+ ### meta-21
157
169
 
158
- The `Verifies:` line shall contain one or more comma-separated [citations](#meta-16) to the user or dev items that the test item verifies.
170
+ Spec test items shall specify integration and system tests only: unit tests belong to the implementation, and no spec item specifies one.
159
171
 
160
- ## Authoring language
172
+ ### meta-32
161
173
 
162
- ### META-27
174
+ A test shall prefer executing the real behaviors bound by the behaviors it verifies [[meta-14](#meta-14)] to supplying substitutes for them.
163
175
 
164
- Authoring language: en
176
+ ### meta-33
177
+
178
+ Each package's `Verification` section shall verify every behavior in that package, white-box or black-box.
179
+
180
+ ## Citation
181
+
182
+ ### meta-16
183
+
184
+ A citation of a spec item or record shall be an inline relative link with the cited ID as its link text:
185
+
186
+ | Cited | Form |
187
+ | --- | --- |
188
+ | Spec item | its heading anchor, in an outer pair of square brackets (e.g., `[[meta-1](meta.md#meta-1)]`) |
189
+ | Record | its file, with no outer brackets (e.g., `[DR-000](decisions/000-spec-structure-format.md)`) |
165
190
 
166
- Where a specs tree declares an authoring language, the specs shall be authored in that language.
191
+ ### meta-18
167
192
 
168
- The declaration line in this item is the machine-readable scaffold language marker.
169
- It shall use the exact format `Authoring language: <code>`, where `<code>` contains only ASCII letters, digits, and hyphens.
193
+ No DR or spec item shall cite an IR or name it in prose.
194
+
195
+ ### meta-19
196
+
197
+ An external reference shall cite an authoritative source (e.g., official docs) by a numbered marker (e.g., `[[1]]`) linked to a specific URL in the file's references section, which holds no uncited entry.
198
+
199
+ ### meta-20
200
+
201
+ A test item shall identify every behavior it verifies by an inline citation at the verifying assertion, with behavior citations confined to its own package.
202
+
203
+ ## Authoring language
204
+
205
+ ### meta-27
206
+
207
+ Where a specs tree declares an authoring language — by this item's machine-readable marker line, in the exact format `Authoring language: <code>` with `<code>` of only ASCII letters, digits, and hyphens — spec content added for that project shall be authored in that language:
208
+
209
+ Authoring language: en
170
210
 
171
211
  ## References
172
212
 
@@ -0,0 +1,46 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
3
+
4
+ # git: Git Workflow
5
+
6
+ ## Intent
7
+
8
+ This package lets contributors and maintainers create auditable project commits with consistent messages and AI attribution.
9
+ It owns commit preparation and message conventions, not branching, review, or release policy.
10
+ It is project-local.
11
+
12
+ ## External Behavior
13
+
14
+ ### git-1
15
+
16
+ When a contributor or maintainer asks the commit workflow to prepare a commit, the commit preparation shall report the configured `user.name` and `user.email` or identify each missing value and create no commit until both are configured.
17
+
18
+ ### git-2
19
+
20
+ When writing a commit message subject, the commit message shall use `<type>(<scope>)<!>: <subject>` format, where `<scope>` is optional, `!` is included for breaking changes, `<type>` is one of `feat|fix|docs|style|refactor|test|ci|build|perf|chore`, and `<subject>` is imperative, <=50 chars, with no trailing period.
21
+
22
+ ### git-3
23
+
24
+ Where a commit message includes a body, when writing the body, the commit body shall explain what and why rather than how, wrap at 72 chars, and use bullets if clearer.
25
+
26
+ ### git-4
27
+
28
+ When AI assists in coding or authoring, the commit message shall include a `Co-authored-by` trailer in the format `<model> (<role>) <email>`, where `<role>` is one of `coder|reviewer|maintainer` and `<email>` is `cligent@sublang.ai`:
29
+
30
+ Example: `Co-authored-by: GPT-5.2-Codex (coder) <cligent@sublang.ai>`
31
+
32
+ ### git-5
33
+
34
+ Where a commit realizes a recorded intent, the commit message shall reference the intent record by its bare ID in the `IR-<N>` form, in the subject or body.
35
+
36
+ ## Verification
37
+
38
+ ### git-6
39
+
40
+ When a prepared commit is audited, the audit shall assert the commit follows this package's conventions:
41
+
42
+ - the commit records the configured `user.name` and `user.email` [[git-1](#git-1)];
43
+ - the subject line follows the `<type>(<scope>)<!>: <subject>` format [[git-2](#git-2)];
44
+ - any body explains what and why, wrapped at 72 chars [[git-3](#git-3)];
45
+ - an AI-assisted commit carries the `Co-authored-by` attribution trailer [[git-4](#git-4)];
46
+ - a commit realizing a recorded intent references the intent record's ID [[git-5](#git-5)].
@@ -0,0 +1,56 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
3
+
4
+ # licensing: Licensing Headers
5
+
6
+ ## Intent
7
+
8
+ This package lets contributors and reviewers identify the copyright and license of included project files through consistent SPDX headers.
9
+ It owns header scope and content, not the project's license choice.
10
+ It is project-local.
11
+
12
+ ## External Behavior
13
+
14
+ ### licensing-6
15
+
16
+ When a project file is classified for licensing headers, the licensing scope shall exclude exactly these categories:
17
+
18
+ - files with no comment syntax, such as JSON and binaries;
19
+ - configuration such as `.gitignore`, `.editorconfig`, `**/settings.json`, `AGENTS.md`, `.github/workflows/ci.yml`, and lock files;
20
+ - generated or vendor content such as `dist/`, `node_modules/`, and vendor directories; and
21
+ - license and legal documents.
22
+
23
+ ### licensing-7
24
+
25
+ When the project root is inspected for its license, the license-file detector shall recognize these patterns:
26
+
27
+ - `LICENSE`, `LICENSE.txt`, `LICENSE.md`, `COPYING`
28
+ - `LICENSE-CONTENT`, `LICENSE-APACHE`, etc. (named variants)
29
+ - `LICENCE`, `LICENCE.txt` (British spelling)
30
+ - `LICENSES/` folder (REUSE convention)
31
+
32
+ ### licensing-1
33
+
34
+ Where the file has comment syntax and is not excluded by the licensing scope [[licensing-6](#licensing-6)], while the file is git-tracked or `git add`-able, when preparing the file for inclusion in the repo, the file shall include `SPDX-FileCopyrightText` in its first comment block after any shebang.
35
+
36
+ ### licensing-2
37
+
38
+ Where the file has comment syntax, is not excluded by the licensing scope [[licensing-6](#licensing-6)], and one or more project-root license files match the license-file detector patterns [[licensing-7](#licensing-7)], while the file is git-tracked or `git add`-able, when preparing the file for inclusion in the repo, the file shall include `SPDX-License-Identifier` in its first comment block after any shebang.
39
+
40
+ ### licensing-5
41
+
42
+ Where a file's first comment block already contains `SPDX-FileCopyrightText` or `SPDX-License-Identifier` from an upstream source (e.g., a template or vendored file copied from another project), when preparing the file for inclusion in the repo, those existing SPDX lines shall be preserved unmodified, even when the project root carries a different license — each preserved upstream line satisfying its respective copyright-header requirement [[licensing-1](#licensing-1)] or license-header requirement [[licensing-2](#licensing-2)], with any missing required line supplied from upstream, not the project license.
43
+
44
+ ## Verification
45
+
46
+ ### licensing-3
47
+
48
+ Where the file has comment syntax and is included by the licensing scope [[licensing-6](#licensing-6)], while git-tracked or `git add`-able, when checking its first comment block after any shebang, the verification shall assert the copyright-header requirement [[licensing-1](#licensing-1)] by finding `SPDX-FileCopyrightText`.
49
+
50
+ ### licensing-4
51
+
52
+ Where the file has comment syntax, is included by the licensing scope [[licensing-6](#licensing-6)], and the license-file detector [[licensing-7](#licensing-7)] recognizes a project-root license, while git-tracked or `git add`-able, when checking its first comment block after any shebang, the verification shall assert the license-header requirement [[licensing-2](#licensing-2)] by finding `SPDX-License-Identifier`.
53
+
54
+ ### licensing-8
55
+
56
+ Where a file already contains upstream SPDX lines and the project license differs, when inclusion preparation runs, the verification shall assert byte-for-byte preservation of every upstream line and use of upstream rather than project license data for any missing required line [[licensing-5](#licensing-5)].