@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.
- package/README.md +60 -17
- package/dist/append-agent-specs.d.ts +7 -1
- package/dist/append-agent-specs.js +7 -2
- 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 +967 -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 +26 -29
- 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 +14 -24
- package/scaffold/i18n/zh/specs/meta.md +110 -83
- 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 +14 -24
- package/scaffold/specs/meta.md +105 -78
- 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
|
@@ -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
|
-
Each preserved upstream line satisfies its respective [LIC-1](#lic-1)/[LIC-2](#lic-2) requirement; any missing required line shall be supplied from upstream, not the project license.
|
|
@@ -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
|