@sublang/spex 0.3.0 → 1.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
+ Each item file is a spec package, stating the intent its items share [[meta-30](../meta.md#meta-30)].
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.
52
+ It is the unit of spec authoring, reuse, extension, and composition.
53
53
 
54
- ### Spec packages
54
+ A spec package is one file under `packages/` or its subdirectory.
55
+ 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
56
 
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.
57
+ Each package file carries the same sections in the following order [[meta-30](../meta.md#meta-30)]:
58
58
 
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.
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` for implementation hidden from the package's users.
62
+ - `Verification` for test items that check the package's own claims.
61
63
 
62
- For example, a spec package for generating short URLs may be named `gen-url` and consist of:
64
+ A behavior phrase can bind to another package's External Behavior by citing it [[meta-14](../meta.md#meta-14)].
65
+ But a spec package remains meaningfully self-contained.
66
+ It reads in full without following any link.
63
67
 
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
68
+ ### Package relationships
67
69
 
68
- Here, `signing/` is a local collection of related spec packages for development convenience.
70
+ Packages relate through one mechanism: a citation binding a general behavior to a specific External Behavior of another package.
71
+ Three patterns cover most cases:
69
72
 
70
- `map.md` organizes item files by package.
73
+ - **Use**. A package relies on another's behavior and cites it where the reliance is.
74
+ - **Extension**. A new package adds behavior for an existing area, with the extended package untouched.
75
+ - **Composition**. A package states behavior that emerges only when several packages work together.
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 and one relationship mechanism cover use, extension, and composition
90
+ - Every 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 interface, design, and implementation
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,19 +11,17 @@ 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).
14
+ - DRs and IRs: see [Overall](meta.md#overall), [Record format](meta.md#record-format), and [Citation](meta.md#citation).
15
+ - Items: see [Overall](meta.md#overall), [Item syntax](meta.md#item-syntax), [Spec packages](meta.md#spec-packages), [Testing](meta.md#testing), and [Citation](meta.md#citation).
16
16
 
17
17
  ## Layout
18
18
 
19
19
  ```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
20
+ decisions/ Decision records (DRs)
21
+ intents/ Intent records (IRs)
22
+ packages/ Spec packages (one file per package)
23
+ map.md This index
24
+ meta.md The spec of specs
27
25
  ```
28
26
 
29
27
  ## Decisions
@@ -32,23 +30,15 @@ meta.md The spec of specs
32
30
  | --- | --- | --- |
33
31
  | DR-000 | [000-spec-structure-format.md](decisions/000-spec-structure-format.md) | Spec structure, format, and naming conventions |
34
32
 
35
- ## Iterations
33
+ ## Intents
36
34
 
37
- | ID | File | Goal |
35
+ | ID | File | Intent |
38
36
  | --- | --- | --- |
39
- | IR-000 | [000-spdx-headers.md](iterations/000-spdx-headers.md) | Add SPDX headers to applicable files |
37
+ | IR-000 | [000-spdx-headers.md](intents/000-spdx-headers.md) | Add SPDX headers to applicable files |
40
38
 
41
39
  ## Packages
42
40
 
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 |
41
+ | File | Summary |
42
+ | --- | --- |
43
+ | [git.md](packages/git.md) | Commit message format and AI co-authorship trailers |
44
+ | [licensing.md](packages/licensing.md) | SPDX header requirements and verification checks |
@@ -1,86 +1,77 @@
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
9
  This spec 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
+ ### meta-25
31
30
 
32
- Test items shall focus on integration and system testing.
33
-
34
- Unit tests shall be part of the implementation and shall not be specified as spec items.
31
+ A spec file shall keep one sentence per line — with lists, tables, and diagrams exempt.
35
32
 
36
33
  ## Record format
37
34
 
38
- ### META-4
35
+ ### meta-4
39
36
 
40
- Each decision record (DR) shall follow the ADR format [[2]] with the following sections: Status, Context, Decision, and Consequences.
37
+ Each DR shall follow the ADR format [[2]], with sections Status, Context, Decision, Consequences, and References.
41
38
 
42
- ### META-5
39
+ ### meta-5
43
40
 
44
- Each iteration record (IR) shall contain the following sections: Goal, Deliverables (with checkboxes), Tasks (numbered, each in one-commit size), and Acceptance criteria.
41
+ Each IR shall contain sections Status, Intent, Deliverables (with checkboxes), Tasks (numbered, each sized to one commit), and Verification.
45
42
 
46
- ### META-23
43
+ ### meta-22
47
44
 
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.
45
+ 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
46
 
50
- ### META-24
47
+ ### meta-24
51
48
 
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.
49
+ A DR shall record design decisions and constraints, not implementation details, sufficient to provide context for or to audit the corresponding spec items.
55
50
 
56
- ### META-25
51
+ ### meta-28
57
52
 
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.
53
+ 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
54
 
62
55
  ## Item syntax
63
56
 
64
- ### META-6
57
+ ### meta-6
65
58
 
66
- Each spec item shall use the GEARS pattern [[1]]:
59
+ Each spec item shall use the GEARS pattern [[1]], with its clauses and punctuation following natural English conventions:
67
60
 
68
61
  ```text
69
- [Where <static precondition(s)>] [While <stateful precondition(s)>] [When <trigger>] The <subject> shall <behavior>.
62
+ [Where <static precondition(s)>] [While <stateful precondition(s)>] [When <trigger>] <subject> shall <behavior(s)>.
70
63
  ```
71
64
 
72
- Clauses and punctuation shall follow standard English conventions.
73
-
74
65
  | Clause | Purpose | Example |
75
66
  | ------ | ------- | ------- |
76
67
  | 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 |
68
+ | While | Stateful preconditions (runtime states) | While the connection is active |
69
+ | When | Trigger event — at most one | When the user clicks submit |
70
+ | shall | Required behaviors | The form shall validate inputs and highlight each violation |
80
71
 
81
- ### META-7
72
+ ### meta-7
82
73
 
83
- Where test cases are expressed by Given-When-Then (GWT), their spec items shall map GWT to GEARS [[1]]:
74
+ Where test cases can be expressed by Given-When-Then (GWT), their spec items shall map GWT to GEARS [[1]]:
84
75
 
85
76
  | GWT | Clause |
86
77
  | --- | ------ |
@@ -88,85 +79,121 @@ Where test cases are expressed by Given-When-Then (GWT), their spec items shall
88
79
  | When | When |
89
80
  | Then | shall |
90
81
 
91
- ### META-8
82
+ ### meta-8
83
+
84
+ Each spec item shall be self-contained: every reliance on another item is an explicit citation [[meta-16](#meta-16)].
92
85
 
93
- Each item shall be self-contained:
86
+ ### meta-29
94
87
 
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.
88
+ Each spec item shall be exactly one GEARS statement [[meta-6](#meta-6)], elaborated only by its attachments — such as a note, a list, a table, a (renderable) diagram, or an example.
97
89
 
98
- ### META-26
90
+ | Item kind | Example attachment |
91
+ | --- | --- |
92
+ | Behavior | ordered steps or the cases and outcomes of one operation or decision |
93
+ | Test | the assertions of one execution flow or one explicit case matrix |
99
94
 
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.
95
+ - A condition inside an attachment is a case label.
96
+ - Differing stateful preconditions or triggers are evidence of additional spec items.
101
97
 
102
98
  ## Spec packages
103
99
 
104
- ### META-9
100
+ ### meta-13
105
101
 
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/`.
102
+ A spec package shall define a closed set of subjects and their behaviors for a shared intent.
107
103
 
108
- ### META-10
104
+ ### meta-9
109
105
 
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\>.
106
+ A spec package shall be one item file under `specs/packages/` or its subdirectory.
111
107
 
112
- Example: `package-management.md` has short form `PKGMGT`.
108
+ ### meta-30
113
109
 
114
- ### META-11
110
+ Each package file shall contain only the following sections, in this order:
115
111
 
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.
112
+ | Section | Presence | Content |
113
+ | ------- | -------- | ------- |
114
+ | `Intent` | required | the shared intent of the package's items |
115
+ | `External Behavior` | required | outcomes and guarantees the package's users may rely on |
116
+ | `Internal Behavior` | optional | implementation hidden from the package's users |
117
+ | `Verification` | required unless irrelevant [[meta-33](#meta-33)] | only test items verifying the package's own items |
118
+ | `References` | optional | external sources [[meta-19](#meta-19)] |
117
119
 
118
- Note: \<PACK\> refers to the short form of the package name.
120
+ - A package's user is any human or system component using its contract; External and Internal are relative to the package.
121
+ - Topic subsections and item headings live inside the Behavior and Verification sections.
119
122
 
120
- ### META-12
123
+ ### meta-10
121
124
 
122
- Item IDs shall not be modified once released; new items shall use higher IDs per package.
125
+ A spec package shall use a unique lowercase kebab-case basename \<pack\>.md, with \<pack\> serving as its package identifier.
123
126
 
124
- ### META-13
127
+ ### meta-11
125
128
 
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.
129
+ Each spec item shall use \<pack\>-\<N\> as its lowercase heading, anchor, and citation text:
127
130
 
128
- ### META-14
131
+ - \<pack\> is its containing package's identifier [[meta-10](#meta-10)];
132
+ - \<N\> is a positive integer unique within that package;
133
+ - a new item takes the lowest positive \<N\> neither assigned nor reserved by a public release [[meta-12](#meta-12)].
129
134
 
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.
135
+ ### meta-12
131
136
 
132
- ### META-15
137
+ A publicly released item ID shall remain permanently bound to the concern its item names:
133
138
 
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.
139
+ - the ID is never renumbered or reassigned;
140
+ - the item's content may evolve only with that concern preserved;
141
+ - an unreleased ID can be reassigned.
135
142
 
136
- ## Citation
143
+ ### meta-14
144
+
145
+ A citation shall be the only relationship between packages: any general phrase of a behavior binds to a specific External Behavior of another package by citing it [[meta-16](#meta-16)].
137
146
 
138
- ### META-16
147
+ - An uncited phrase stays general as it is sufficient for code generation and audit.
148
+ - One phrase may cite several packages if it composes their behaviors.
139
149
 
140
- Citations to specific items shall use relative links with anchors (e.g., `[META-1](meta.md#meta-1)`).
150
+ ### meta-15
141
151
 
142
- ### META-17
152
+ A spec package shall stand alone: readable in full without following any link — a citation never carries its meaning.
143
153
 
144
- DRs and items shall be allowed to cite each other.
154
+ ### meta-31
145
155
 
146
- ### META-18
156
+ A 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.
147
157
 
148
- IRs shall not be cited by any spec except `map.md`.
158
+ ## Testing
149
159
 
150
- ### META-19
160
+ ### meta-21
151
161
 
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.
162
+ Spec test items shall specify integration and system tests only: unit tests belong to the implementation, and no spec item specifies one.
153
163
 
154
- ### META-20
164
+ ### meta-32
155
165
 
156
- Each test item shall include one `Verifies:` metadata line immediately below its item ID heading.
166
+ A test shall prefer executing the real behavior of a cited package [[meta-14](#meta-14)] to supplying a substitute for it.
167
+
168
+ ### meta-33
169
+
170
+ Each stated behavior shall be verified unless verification is irrelevant to it, white-box or black-box: External and Internal govern use, not verification.
171
+
172
+ ## Citation
157
173
 
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.
174
+ ### meta-16
175
+
176
+ A citation of a spec item shall be a relative link with an anchor, enclosed in square brackets (e.g., `[[meta-1](meta.md#meta-1)]`), written inline at the phrase that relies on it.
177
+
178
+ ### meta-18
179
+
180
+ No DR or spec item shall cite an IR or name it in prose.
181
+
182
+ ### meta-19
183
+
184
+ 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 `References` section, which holds no uncited entry.
185
+
186
+ ### meta-20
187
+
188
+ A test item shall cite every behavior item it verifies, inline at the assertion that verifies the behavior.
159
189
 
160
190
  ## Authoring language
161
191
 
162
- ### META-27
192
+ ### meta-27
163
193
 
164
194
  Authoring language: en
165
195
 
166
- Where a specs tree declares an authoring language, the specs shall be authored in that language.
167
-
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.
196
+ 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 — the specs shall be authored in that language.
170
197
 
171
198
  ## References
172
199
 
@@ -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)].
@@ -3,6 +3,13 @@
3
3
 
4
4
  Review Git diffs under @specs/ and perform a spec update merge:
5
5
 
6
- - If section headings or spec IDs changed, update citations across @specs/ (DRs, IRs, items, map.md) to match.
7
6
  - If @specs/decisions/000-spec-structure-format.md or @specs/meta.md changed, update existing @specs/ files to conform while preserving local content that still applies.
7
+ - Preserve every item ID and normative concern that appeared in a prior release; provisional IDs may be compacted before publication.
8
+ - Classify behavior relative to each package: outcomes and guarantees the package's users may rely on belong in `## External Behavior`; implementation hidden from them belongs in `## Internal Behavior`.
9
+ - Scope this merge to reconciling the template diff: do not restructure a legacy tree (a `user/`, `dev/`, `test/`, `items/`, `interactions/`, `compositions/`, or `iterations/` directory) into @specs/packages/ yourself — structural migration of a legacy generation belongs to the `spec-structure-migration` skill (`skills/spec-structure-migration/` in the spex repo; guide: `docs/spec-migration.md`).
10
+ - Convert every item citation to the enclosed ID-text form, e.g. `[[pack-3](pack.md#pack-3)]`, written inline at the exact phrase that relies on the cited behavior.
11
+ - Remove relationship-metadata lines (`Verifies:`, `Binds:`, `Composes:`, `Clients:`, `Suppliers:`, `Scope:`) and detached `Verifies ...` sentences: weave each citation into the assertion it verifies, then delete the line.
12
+ - Keep each package's `## Intent` a self-contained prose statement without citations, and check each file's title still fits.
13
+ - Update @specs/map.md where the merge left its layout, tables, or summaries stale.
8
14
  - Focus only on the update merge; do not refine unrelated spec content.
15
+ - Finish by running `spex lint` and resolving remaining errors; never restore removed trace lines to satisfy an older checker.