@sublang/spex 0.2.3 → 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.
- package/README.md +70 -17
- package/dist/append-agent-specs.d.ts +7 -1
- package/dist/append-agent-specs.js +7 -2
- package/dist/cli.js +8 -2
- package/dist/copy-templates.d.ts +28 -3
- package/dist/copy-templates.js +172 -54
- package/dist/create-specs-structure.js +2 -4
- package/dist/lint.d.ts +15 -0
- package/dist/lint.js +967 -0
- package/dist/markdown.d.ts +46 -0
- package/dist/markdown.js +130 -0
- package/dist/scaffold.js +171 -31
- package/package.json +15 -7
- package/scaffold/.file-history.json +32 -24
- package/scaffold/.legacy-file-history.json +48 -0
- package/scaffold/LICENSE +202 -0
- package/scaffold/agent-specs.txt +10 -2
- package/scaffold/i18n/zh/specs/map.md +44 -0
- package/scaffold/i18n/zh/specs/meta.md +208 -0
- package/scaffold/specs/decisions/000-spec-structure-format.md +40 -42
- package/scaffold/specs/intents/000-spdx-headers.md +39 -0
- package/scaffold/specs/map.md +14 -24
- package/scaffold/specs/meta.md +110 -72
- package/scaffold/specs/packages/git.md +46 -0
- package/scaffold/specs/packages/licensing.md +56 -0
- package/scaffold/update-merge-prompt.md +8 -1
- package/scaffold/specs/dev/git.md +0 -28
- package/scaffold/specs/dev/licensing.md +0 -44
- package/scaffold/specs/iterations/000-spdx-headers.md +0 -35
- package/scaffold/specs/test/licensing.md +0 -20
- package/scaffold/specs/user/.gitkeep +0 -0
package/scaffold/specs/map.md
CHANGED
|
@@ -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 [
|
|
15
|
-
- Items: see [
|
|
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/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
##
|
|
33
|
+
## Intents
|
|
36
34
|
|
|
37
|
-
| ID | File |
|
|
35
|
+
| ID | File | Intent |
|
|
38
36
|
| --- | --- | --- |
|
|
39
|
-
| IR-000 | [000-spdx-headers.md](
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
|
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 |
|
package/scaffold/specs/meta.md
CHANGED
|
@@ -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
|
-
#
|
|
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
|
-
##
|
|
11
|
+
## Overall
|
|
11
12
|
|
|
12
|
-
###
|
|
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/` |
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
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
|
-
###
|
|
25
|
+
### meta-23
|
|
27
26
|
|
|
28
|
-
|
|
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
|
-
###
|
|
29
|
+
### meta-25
|
|
31
30
|
|
|
32
|
-
|
|
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
|
-
###
|
|
35
|
+
### meta-4
|
|
39
36
|
|
|
40
|
-
Each
|
|
37
|
+
Each DR shall follow the ADR format [[2]], with sections Status, Context, Decision, Consequences, and References.
|
|
41
38
|
|
|
42
|
-
###
|
|
39
|
+
### meta-5
|
|
43
40
|
|
|
44
|
-
Each
|
|
41
|
+
Each IR shall contain sections Status, Intent, Deliverables (with checkboxes), Tasks (numbered, each sized to one commit), and Verification.
|
|
45
42
|
|
|
46
|
-
###
|
|
43
|
+
### meta-22
|
|
47
44
|
|
|
48
|
-
|
|
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
|
-
###
|
|
47
|
+
### meta-24
|
|
51
48
|
|
|
52
|
-
A DR shall
|
|
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
|
-
###
|
|
51
|
+
### meta-28
|
|
57
52
|
|
|
58
|
-
|
|
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
|
-
###
|
|
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>]
|
|
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
|
|
78
|
-
| When | Trigger event
|
|
79
|
-
| shall | Required
|
|
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
|
-
###
|
|
72
|
+
### meta-7
|
|
82
73
|
|
|
83
|
-
Where test cases
|
|
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,74 +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
|
-
###
|
|
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
|
-
|
|
86
|
+
### meta-29
|
|
94
87
|
|
|
95
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
###
|
|
100
|
+
### meta-13
|
|
101
|
+
|
|
102
|
+
A spec package shall define a closed set of subjects and their behaviors for a shared intent.
|
|
103
|
+
|
|
104
|
+
### meta-9
|
|
105
|
+
|
|
106
|
+
A spec package shall be one item file under `specs/packages/` or its subdirectory.
|
|
107
|
+
|
|
108
|
+
### meta-30
|
|
109
|
+
|
|
110
|
+
Each package file shall contain only the following sections, in this order:
|
|
111
|
+
|
|
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)] |
|
|
105
119
|
|
|
106
|
-
A
|
|
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.
|
|
107
122
|
|
|
108
|
-
###
|
|
123
|
+
### meta-10
|
|
109
124
|
|
|
110
|
-
A spec package shall
|
|
125
|
+
A spec package shall use a unique lowercase kebab-case basename \<pack\>.md, with \<pack\> serving as its package identifier.
|
|
111
126
|
|
|
112
|
-
|
|
127
|
+
### meta-11
|
|
113
128
|
|
|
114
|
-
|
|
129
|
+
Each spec item shall use \<pack\>-\<N\> as its lowercase heading, anchor, and citation text:
|
|
115
130
|
|
|
116
|
-
|
|
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)].
|
|
117
134
|
|
|
118
|
-
|
|
135
|
+
### meta-12
|
|
119
136
|
|
|
120
|
-
|
|
137
|
+
A publicly released item ID shall remain permanently bound to the concern its item names:
|
|
121
138
|
|
|
122
|
-
|
|
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.
|
|
123
142
|
|
|
124
|
-
###
|
|
143
|
+
### meta-14
|
|
125
144
|
|
|
126
|
-
A
|
|
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)].
|
|
127
146
|
|
|
128
|
-
|
|
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.
|
|
129
149
|
|
|
130
|
-
|
|
150
|
+
### meta-15
|
|
131
151
|
|
|
132
|
-
|
|
152
|
+
A spec package shall stand alone: readable in full without following any link — a citation never carries its meaning.
|
|
133
153
|
|
|
134
|
-
|
|
154
|
+
### meta-31
|
|
155
|
+
|
|
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.
|
|
157
|
+
|
|
158
|
+
## Testing
|
|
159
|
+
|
|
160
|
+
### meta-21
|
|
161
|
+
|
|
162
|
+
Spec test items shall specify integration and system tests only: unit tests belong to the implementation, and no spec item specifies one.
|
|
163
|
+
|
|
164
|
+
### meta-32
|
|
165
|
+
|
|
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.
|
|
135
171
|
|
|
136
172
|
## Citation
|
|
137
173
|
|
|
138
|
-
###
|
|
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.
|
|
139
177
|
|
|
140
|
-
|
|
178
|
+
### meta-18
|
|
141
179
|
|
|
142
|
-
|
|
180
|
+
No DR or spec item shall cite an IR or name it in prose.
|
|
143
181
|
|
|
144
|
-
|
|
182
|
+
### meta-19
|
|
145
183
|
|
|
146
|
-
|
|
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.
|
|
147
185
|
|
|
148
|
-
|
|
186
|
+
### meta-20
|
|
149
187
|
|
|
150
|
-
|
|
188
|
+
A test item shall cite every behavior item it verifies, inline at the assertion that verifies the behavior.
|
|
151
189
|
|
|
152
|
-
|
|
190
|
+
## Authoring language
|
|
153
191
|
|
|
154
|
-
###
|
|
192
|
+
### meta-27
|
|
155
193
|
|
|
156
|
-
|
|
194
|
+
Authoring language: en
|
|
157
195
|
|
|
158
|
-
|
|
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.
|
|
159
197
|
|
|
160
198
|
## References
|
|
161
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.
|
|
@@ -1,28 +0,0 @@
|
|
|
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 spec defines git workflow rules for the project.
|
|
9
|
-
|
|
10
|
-
## Commits
|
|
11
|
-
|
|
12
|
-
### GIT-1
|
|
13
|
-
|
|
14
|
-
When preparing a commit, the AI agent shall verify `user.name` and `user.email` are configured.
|
|
15
|
-
|
|
16
|
-
### GIT-2
|
|
17
|
-
|
|
18
|
-
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.
|
|
19
|
-
|
|
20
|
-
### GIT-3
|
|
21
|
-
|
|
22
|
-
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.
|
|
23
|
-
|
|
24
|
-
### GIT-4
|
|
25
|
-
|
|
26
|
-
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`.
|
|
27
|
-
|
|
28
|
-
Example: `Co-authored-by: GPT-5.2-Codex (coder) <cligent@sublang.ai>`
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
-
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
|
-
|
|
4
|
-
# LIC: Licensing Headers
|
|
5
|
-
|
|
6
|
-
## Intent
|
|
7
|
-
|
|
8
|
-
This spec defines SPDX header requirements for files included in the project.
|
|
9
|
-
|
|
10
|
-
## Scope
|
|
11
|
-
|
|
12
|
-
### Exclusions
|
|
13
|
-
|
|
14
|
-
The following files are out of scope:
|
|
15
|
-
|
|
16
|
-
- No comment syntax: e.g., JSON, binaries
|
|
17
|
-
- Config: e.g., `.gitignore`, `.editorconfig`, `**/settings.json`, `AGENTS.md`, `.github/workflows/ci.yml`, lock files
|
|
18
|
-
- Generated/vendor: e.g., `dist/`, `node_modules/`, vendor directories
|
|
19
|
-
- License/legal documents
|
|
20
|
-
|
|
21
|
-
### License File Detection
|
|
22
|
-
|
|
23
|
-
Recognized patterns at project root:
|
|
24
|
-
|
|
25
|
-
- `LICENSE`, `LICENSE.txt`, `LICENSE.md`, `COPYING`
|
|
26
|
-
- `LICENSE-CONTENT`, `LICENSE-APACHE`, etc. (named variants)
|
|
27
|
-
- `LICENCE`, `LICENCE.txt` (British spelling)
|
|
28
|
-
- `LICENSES/` folder (REUSE convention)
|
|
29
|
-
|
|
30
|
-
## Headers
|
|
31
|
-
|
|
32
|
-
### LIC-1
|
|
33
|
-
|
|
34
|
-
Where the file has comment syntax and is not excluded by [Exclusions](#exclusions), 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
|
-
### LIC-2
|
|
37
|
-
|
|
38
|
-
Where the file has comment syntax, is not excluded by [Exclusions](#exclusions), and one or more project-root license files match [License File Detection](#license-file-detection), 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
|
-
### LIC-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.
|
|
43
|
-
|
|
44
|
-
[LIC-1](#lic-1) and [LIC-2](#lic-2) are satisfied by the preserved upstream headers; no project-license header shall be appended or substituted.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
-
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
|
-
|
|
4
|
-
# IR-000: SPDX Headers
|
|
5
|
-
|
|
6
|
-
## Goal
|
|
7
|
-
|
|
8
|
-
Apply [LIC-1](../dev/licensing.md#lic-1), [LIC-2](../dev/licensing.md#lic-2), [LIC-5](../dev/licensing.md#lic-5) to in-scope files and pin the project's header format.
|
|
9
|
-
|
|
10
|
-
## Deliverables
|
|
11
|
-
|
|
12
|
-
- [ ] Add SPDX headers to in-scope files missing them
|
|
13
|
-
- [ ] Add a `## Format` section to [`dev/licensing.md`](../dev/licensing.md) with the project's actual license and copyright
|
|
14
|
-
|
|
15
|
-
## Tasks
|
|
16
|
-
|
|
17
|
-
1. Resolve scope: detect a project-root license file per [License File Detection](../dev/licensing.md#license-file-detection); enumerate in-scope files per [Exclusions](../dev/licensing.md#exclusions).
|
|
18
|
-
|
|
19
|
-
2. Insert SPDX lines in each file's first comment block (after any shebang), using the file's native comment syntax.
|
|
20
|
-
|
|
21
|
-
3. Append a `## Format` section to [`dev/licensing.md`](../dev/licensing.md) showing the concrete header per comment style. Example for a single Apache-2.0 `LICENSE`:
|
|
22
|
-
|
|
23
|
-
```markdown
|
|
24
|
-
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
25
|
-
<!-- SPDX-FileCopyrightText: <year> <holder> -->
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
30
|
-
// SPDX-FileCopyrightText: <year> <holder>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Acceptance criteria
|
|
34
|
-
|
|
35
|
-
- [LIC-3](../test/licensing.md#lic-3), [LIC-4](../test/licensing.md#lic-4) pass on all in-scope files.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
|
-
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
|
-
|
|
4
|
-
# LIC: Licensing Headers
|
|
5
|
-
|
|
6
|
-
## Intent
|
|
7
|
-
|
|
8
|
-
This spec defines acceptance tests for SPDX copyright and license headers.
|
|
9
|
-
|
|
10
|
-
## Header Checks
|
|
11
|
-
|
|
12
|
-
### LIC-3
|
|
13
|
-
Verifies: [LIC-1](../dev/licensing.md#lic-1)
|
|
14
|
-
|
|
15
|
-
Where the file has comment syntax and is not [excluded](../dev/licensing.md#exclusions), while git-tracked or `git add`-able, when checking its first comment block after any shebang, the file shall contain `SPDX-FileCopyrightText`.
|
|
16
|
-
|
|
17
|
-
### LIC-4
|
|
18
|
-
Verifies: [LIC-2](../dev/licensing.md#lic-2)
|
|
19
|
-
|
|
20
|
-
Where the file has comment syntax, is not [excluded](../dev/licensing.md#exclusions), and a [license file](../dev/licensing.md#license-file-detection) exists at project root, while git-tracked or `git add`-able, when checking its first comment block after any shebang, the file shall contain `SPDX-License-Identifier`.
|
|
File without changes
|