@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.
- package/README.md +72 -17
- package/dist/append-agent-specs.d.ts +10 -3
- package/dist/append-agent-specs.js +28 -29
- package/dist/cli.js +7 -1
- package/dist/copy-templates.d.ts +19 -0
- package/dist/copy-templates.js +90 -7
- package/dist/create-specs-structure.js +2 -4
- package/dist/lint.d.ts +15 -0
- package/dist/lint.js +959 -0
- package/dist/markdown.d.ts +46 -0
- package/dist/markdown.js +130 -0
- package/dist/scaffold.js +87 -28
- package/package.json +15 -7
- package/scaffold/.file-history.json +32 -29
- package/scaffold/.legacy-file-history.json +48 -0
- package/scaffold/LICENSE +202 -0
- package/scaffold/agent-specs.txt +6 -2
- package/scaffold/i18n/zh/specs/map.md +15 -27
- package/scaffold/i18n/zh/specs/meta.md +130 -90
- package/scaffold/specs/decisions/000-spec-structure-format.md +41 -31
- package/scaffold/specs/intents/000-spdx-headers.md +39 -0
- package/scaffold/specs/map.md +13 -26
- package/scaffold/specs/meta.md +119 -79
- package/scaffold/specs/packages/git.md +46 -0
- package/scaffold/specs/packages/licensing.md +56 -0
- package/scaffold/update-merge-prompt.md +9 -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
|
@@ -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
|
|
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
|
-
- **
|
|
22
|
-
- **Requirements**. The *behaviors*
|
|
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
|
|
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
|
|
30
|
-
- Decision records (DRs) follow the ADR (Architectural Decision Record) format [[1]]
|
|
31
|
-
-
|
|
32
|
-
- **Items** must follow the
|
|
33
|
-
|
|
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
|
-
| `
|
|
43
|
-
| `
|
|
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
|
-
###
|
|
49
|
+
### Spec packages
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
76
|
-
|
|
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
|
-
-
|
|
82
|
-
-
|
|
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.
|
package/scaffold/specs/map.md
CHANGED
|
@@ -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/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
28
|
+
| [DR-000](decisions/000-spec-structure-format.md) | 000-spec-structure-format.md | Spec structure, format, and naming conventions |
|
|
34
29
|
|
|
35
|
-
##
|
|
30
|
+
## Intents
|
|
36
31
|
|
|
37
|
-
| ID | File |
|
|
32
|
+
| ID | File | Intent |
|
|
38
33
|
| --- | --- | --- |
|
|
39
|
-
| IR-000
|
|
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
|
-
|
|
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 |
|
|
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 |
|
package/scaffold/specs/meta.md
CHANGED
|
@@ -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
|
-
#
|
|
5
|
+
# meta: Spec Definition
|
|
5
6
|
|
|
6
7
|
## Intent
|
|
7
8
|
|
|
8
|
-
This
|
|
9
|
+
This file 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
|
+
- For example, `map.md` limits its indexes to those an AI agent needs to find the right files.
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
### meta-25
|
|
33
32
|
|
|
34
|
-
|
|
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
|
-
###
|
|
37
|
+
### meta-4
|
|
39
38
|
|
|
40
|
-
Each
|
|
39
|
+
Each DR shall follow the ADR format [[2]], with sections Status, Context, Decision, Consequences, and References.
|
|
41
40
|
|
|
42
|
-
###
|
|
41
|
+
### meta-5
|
|
43
42
|
|
|
44
|
-
Each
|
|
43
|
+
Each IR shall contain sections Status, Intent, Deliverables (with checkboxes), Tasks (numbered, each sized to one commit), and Verification.
|
|
45
44
|
|
|
46
|
-
###
|
|
45
|
+
### meta-22
|
|
47
46
|
|
|
48
|
-
|
|
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
|
-
###
|
|
49
|
+
### meta-24
|
|
51
50
|
|
|
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.
|
|
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
|
-
###
|
|
53
|
+
### meta-28
|
|
57
54
|
|
|
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.
|
|
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
|
-
###
|
|
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>]
|
|
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
|
|
78
|
-
| When | Trigger event
|
|
79
|
-
| shall | Required
|
|
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
|
-
###
|
|
74
|
+
### meta-7
|
|
82
75
|
|
|
83
|
-
Where test cases
|
|
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
|
-
###
|
|
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
|
-
|
|
88
|
+
### meta-29
|
|
94
89
|
|
|
95
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
103
|
+
### meta-13
|
|
105
104
|
|
|
106
|
-
A spec package shall
|
|
105
|
+
A spec package shall define a closed set of subjects and their behavioral requirements for a shared intent.
|
|
107
106
|
|
|
108
|
-
###
|
|
107
|
+
### meta-34
|
|
109
108
|
|
|
110
|
-
A spec package shall
|
|
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
|
-
|
|
111
|
+
### meta-9
|
|
113
112
|
|
|
114
|
-
|
|
113
|
+
A spec package shall be one file containing spec items under `specs/packages/` or its subdirectory.
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
### meta-30
|
|
117
116
|
|
|
118
|
-
|
|
117
|
+
Each package file shall contain only the following sections, in this order:
|
|
119
118
|
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
130
|
+
### meta-10
|
|
125
131
|
|
|
126
|
-
A spec
|
|
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
|
-
###
|
|
134
|
+
### meta-11
|
|
129
135
|
|
|
130
|
-
|
|
136
|
+
Each spec item shall use \<pack\>-\<N\> as its lowercase heading, anchor, and citation text:
|
|
131
137
|
|
|
132
|
-
|
|
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
|
-
|
|
142
|
+
### meta-12
|
|
135
143
|
|
|
136
|
-
|
|
144
|
+
A publicly released item ID shall remain permanently bound to the concern its item names:
|
|
137
145
|
|
|
138
|
-
|
|
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
|
-
|
|
150
|
+
### meta-14
|
|
141
151
|
|
|
142
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
158
|
+
### meta-15
|
|
147
159
|
|
|
148
|
-
|
|
160
|
+
A spec package shall stand alone: readable in full without following any link — a citation never carries its meaning.
|
|
149
161
|
|
|
150
|
-
###
|
|
162
|
+
### meta-31
|
|
151
163
|
|
|
152
|
-
|
|
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
|
-
|
|
166
|
+
## Testing
|
|
155
167
|
|
|
156
|
-
|
|
168
|
+
### meta-21
|
|
157
169
|
|
|
158
|
-
|
|
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
|
-
|
|
172
|
+
### meta-32
|
|
161
173
|
|
|
162
|
-
|
|
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
|
-
|
|
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
|
-
|
|
191
|
+
### meta-18
|
|
167
192
|
|
|
168
|
-
|
|
169
|
-
|
|
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)].
|