@sublang/spex 6.0.0 → 7.0.0-beta.2
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 +419 -12
- package/dist/cli.js +12 -1
- package/dist/commands/add.d.ts +1 -1
- package/dist/commands/add.js +2 -2
- package/dist/commands/environment.d.ts +3 -3
- package/dist/commands/environment.js +5 -7
- package/dist/commands/export.js +2 -2
- package/dist/commands/home.d.ts +2 -2
- package/dist/commands/home.js +3 -3
- package/dist/commands/list.js +1 -1
- package/dist/commands/login.js +12 -7
- package/dist/commands/logout.js +2 -3
- package/dist/commands/publish.js +1 -1
- package/dist/commands/remove.js +1 -1
- package/dist/commands/run.d.ts +1 -1
- package/dist/commands/run.js +16 -0
- package/dist/commands/settle.d.ts +1 -1
- package/dist/commands/settle.js +1 -1
- package/dist/guards/approval.d.ts +56 -0
- package/dist/guards/approval.js +158 -0
- package/dist/guards/checks.d.ts +207 -0
- package/dist/guards/checks.js +681 -0
- package/dist/guards/commands.d.ts +15 -0
- package/dist/guards/commands.js +313 -0
- package/dist/guards/copy.d.ts +67 -0
- package/dist/guards/copy.js +306 -0
- package/dist/guards/declaration.d.ts +45 -0
- package/dist/guards/declaration.js +224 -0
- package/dist/guards/files.d.ts +137 -0
- package/dist/guards/files.js +544 -0
- package/dist/guards/harness.d.ts +58 -0
- package/dist/guards/harness.js +420 -0
- package/dist/guards/items.d.ts +61 -0
- package/dist/guards/items.js +161 -0
- package/dist/guards/patch.d.ts +55 -0
- package/dist/guards/patch.js +258 -0
- package/dist/guards/processes.d.ts +49 -0
- package/dist/guards/processes.js +233 -0
- package/dist/guards/proofs.d.ts +88 -0
- package/dist/guards/proofs.js +503 -0
- package/dist/guards/records.d.ts +176 -0
- package/dist/guards/records.js +513 -0
- package/dist/guards/report.d.ts +26 -0
- package/dist/guards/report.js +492 -0
- package/dist/guards/runner.d.ts +42 -0
- package/dist/guards/runner.js +167 -0
- package/dist/guards/tla.d.ts +51 -0
- package/dist/guards/tla.js +352 -0
- package/dist/guards/tlapm.d.ts +81 -0
- package/dist/guards/tlapm.js +172 -0
- package/dist/guards/tlc.d.ts +191 -0
- package/dist/guards/tlc.js +457 -0
- package/dist/guards/translation.d.ts +66 -0
- package/dist/guards/translation.js +202 -0
- package/dist/guards/types.d.ts +185 -0
- package/dist/guards/types.js +437 -0
- package/dist/guards/verify.d.ts +290 -0
- package/dist/guards/verify.js +1191 -0
- package/dist/guards/xml.d.ts +18 -0
- package/dist/guards/xml.js +105 -0
- package/dist/lib/environment/archive.d.ts +2 -2
- package/dist/lib/environment/archive.js +1 -1
- package/dist/lib/environment/builtins.d.ts +10 -12
- package/dist/lib/environment/builtins.js +17 -19
- package/dist/lib/environment/exports.d.ts +14 -13
- package/dist/lib/environment/exports.js +31 -16
- package/dist/lib/environment/format.d.ts +2 -2
- package/dist/lib/environment/format.js +3 -3
- package/dist/lib/environment/git-source.js +6 -3
- package/dist/lib/environment/install.d.ts +14 -16
- package/dist/lib/environment/install.js +66 -61
- package/dist/lib/environment/lock.d.ts +4 -3
- package/dist/lib/environment/lock.js +6 -5
- package/dist/lib/environment/marker.js +1 -2
- package/dist/lib/environment/own-paths.d.ts +7 -10
- package/dist/lib/environment/own-paths.js +10 -13
- package/dist/lib/environment/placed-record.d.ts +3 -2
- package/dist/lib/environment/placed-record.js +5 -4
- package/dist/lib/environment/registry.d.ts +1 -1
- package/dist/lib/environment/registry.js +1 -1
- package/dist/lib/environment/requests.d.ts +2 -2
- package/dist/lib/environment/requests.js +2 -2
- package/dist/lib/environment/resolve.d.ts +4 -4
- package/dist/lib/environment/resolve.js +3 -4
- package/dist/lib/environment/store.d.ts +34 -8
- package/dist/lib/environment/store.js +138 -43
- package/dist/lib/files.d.ts +72 -12
- package/dist/lib/files.js +200 -65
- package/dist/lib/git-host.d.ts +52 -258
- package/dist/lib/git-host.js +52 -265
- package/dist/lib/home-file.d.ts +13 -10
- package/dist/lib/home-file.js +28 -18
- package/dist/lib/instance.d.ts +1 -1
- package/dist/lib/instance.js +1 -1
- package/dist/lint.d.ts +22 -0
- package/dist/lint.js +36 -0
- package/dist/testing/standin-registry.js +1 -1
- package/package.json +7 -3
- package/scaffold/.file-history.json +14 -7
- package/scaffold/i18n/zh/source-pins.json +41 -0
- package/scaffold/i18n/zh/specs/decisions/000-spec-structure-format.md +0 -1
- package/scaffold/i18n/zh/specs/intents/000-spdx-headers.md +0 -1
- package/scaffold/i18n/zh/specs/map.md +0 -1
- package/scaffold/i18n/zh/specs/meta.md +18 -35
- package/scaffold/i18n/zh/specs/packages/git.md +0 -1
- package/scaffold/i18n/zh/specs/packages/licensing.md +0 -1
- package/scaffold/specs/meta.md +18 -3
- package/scripts/test-exit-guard.mjs +28 -0
package/dist/lib/home-file.d.ts
CHANGED
|
@@ -8,13 +8,14 @@ export interface HomeAccount {
|
|
|
8
8
|
}
|
|
9
9
|
/** An instance the home has signed in to (DR-127), by its canonical
|
|
10
10
|
* origin: its client, the account it signed in as, whether it was
|
|
11
|
-
* signed out since, and
|
|
11
|
+
* signed out since, and the display name and Git address last reported. */
|
|
12
12
|
export interface HomeInstance {
|
|
13
13
|
origin: string;
|
|
14
14
|
clientId: typeof CLIENT_ID;
|
|
15
15
|
account?: HomeAccount;
|
|
16
16
|
signedOut?: boolean;
|
|
17
17
|
displayName?: string;
|
|
18
|
+
gitOrigin?: string;
|
|
18
19
|
}
|
|
19
20
|
export interface HomeFolder {
|
|
20
21
|
path: string;
|
|
@@ -22,7 +23,7 @@ export interface HomeFolder {
|
|
|
22
23
|
aliases?: string[];
|
|
23
24
|
}
|
|
24
25
|
export interface HomeFile {
|
|
25
|
-
format: 2;
|
|
26
|
+
format: 2 | 3;
|
|
26
27
|
device: string;
|
|
27
28
|
/** The origin the home was created with: the default instance while
|
|
28
29
|
* no instance is listed. */
|
|
@@ -45,18 +46,20 @@ export declare class InstanceRefused extends Error {
|
|
|
45
46
|
}
|
|
46
47
|
/** Lowercase kebab-case: runs of anything else become one hyphen. */
|
|
47
48
|
export declare function kebab(value: string): string;
|
|
48
|
-
/** This device's user name as a
|
|
49
|
+
/** This device's user name as a personal records folder name (storage-2). */
|
|
49
50
|
export declare function defaultOwnName(env?: NodeJS.ProcessEnv): string;
|
|
50
|
-
/** Whether a name may stand as
|
|
51
|
+
/** Whether a name may stand as the personal records folder under `workspace/`. */
|
|
51
52
|
export declare function isGroupName(value: string): boolean;
|
|
52
53
|
export declare const invalidHome: () => string;
|
|
53
54
|
/** The reason a URL stands as no instance's canonical origin (DR-127). */
|
|
54
55
|
export declare function notAnOrigin(url: string): string;
|
|
56
|
+
/** The reported Git endpoint can include a path but never credentials. */
|
|
57
|
+
export declare function isSpaceGitOrigin(value: unknown): value is string;
|
|
55
58
|
/** A check of the pairings a host reads, after every other field. */
|
|
56
59
|
export type FoldersCheck = (folders: readonly unknown[], file: string) => void;
|
|
57
60
|
/**
|
|
58
61
|
* `home.yaml`'s value checked field by field (storage-2): its format,
|
|
59
|
-
* device, origin,
|
|
62
|
+
* device, origin, the personal records folder's name and every instance's entry —
|
|
60
63
|
* one per origin, and no two origins at one folder — and the pairings a
|
|
61
64
|
* list, each entry checked by `checkFolders` where the host supplies it.
|
|
62
65
|
* A malformed or unknown file is refused, never guessed at.
|
|
@@ -67,7 +70,7 @@ export declare function parseHomeFile(value: unknown, file: string, checkFolders
|
|
|
67
70
|
export declare function parseHomeText(text: string, file: string, checkFolders?: FoldersCheck): HomeFile;
|
|
68
71
|
/** A new home, not yet written: a fresh device id unless one is
|
|
69
72
|
* supplied, the origin the environment names, no instance signed in
|
|
70
|
-
* to, and this device's user name
|
|
73
|
+
* to, and this device's user name for its personal records folder. A URL the
|
|
71
74
|
* environment names that is no instance's origin is refused as a
|
|
72
75
|
* storage diagnostic of `file`. */
|
|
73
76
|
export declare function newHomeFile(file: string, options?: {
|
|
@@ -96,7 +99,7 @@ export declare function accountAt(home: HomeFile, origin?: string): HomeAccount
|
|
|
96
99
|
* with `InstanceRefused`. The caller checks the whole next file. */
|
|
97
100
|
export declare function withSignIn(home: HomeFile, origin: string, account: HomeAccount, file: string): HomeFile;
|
|
98
101
|
/** The home after the credential at an instance went while its account
|
|
99
|
-
* is kept (git-host-
|
|
102
|
+
* is kept (git-host-31): it reads signed out until its next
|
|
100
103
|
* sign-in. The default instance's where no origin is named; unchanged
|
|
101
104
|
* where none is listed or signed in. */
|
|
102
105
|
export declare function withSignOut(home: HomeFile, origin?: string): HomeFile;
|
|
@@ -104,9 +107,9 @@ export declare function withSignOut(home: HomeFile, origin?: string): HomeFile;
|
|
|
104
107
|
* forgotten: its entry goes; one signed in is refused with
|
|
105
108
|
* `InstanceRefused`. Null where none is listed at that origin. */
|
|
106
109
|
export declare function withoutInstance(home: HomeFile, origin: string): HomeFile | null;
|
|
107
|
-
/** The home with
|
|
108
|
-
* is not listed. */
|
|
109
|
-
export declare function withDisplayName(home: HomeFile, origin: string, displayName: string | null): HomeFile | null;
|
|
110
|
+
/** The home with a listed Space's last display name and, when supplied,
|
|
111
|
+
* its Git address. Null where the Space is not listed. */
|
|
112
|
+
export declare function withDisplayName(home: HomeFile, origin: string, displayName: string | null, gitOrigin?: string): HomeFile | null;
|
|
110
113
|
/** The path of a home's file. */
|
|
111
114
|
export declare function homeFilePath(root: string): string;
|
|
112
115
|
/** A home's file as it stands, checked; null where none stands. */
|
package/dist/lib/home-file.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
|
-
// The home file's encoding and its instances (storage-2, DR-
|
|
3
|
+
// The home file's encoding and its instances (storage-2, DR-127,
|
|
4
4
|
// DR-165): `home.yaml` names this device, the origin the home was
|
|
5
5
|
// created with, every instance it has signed in to with its account,
|
|
6
|
-
//
|
|
6
|
+
// the personal records folder's name, and each working folder paired with its
|
|
7
7
|
// spex repository's key. This module reads and checks the file, and
|
|
8
8
|
// adds, updates and removes an instance's entry; the pairings are the
|
|
9
9
|
// app's, which checks them where it reads them. Either host changes the
|
|
@@ -14,7 +14,7 @@ import { mkdirSync } from "node:fs";
|
|
|
14
14
|
import { userInfo } from "node:os";
|
|
15
15
|
import { join } from "node:path";
|
|
16
16
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
17
|
-
import { closed, isObject, isText, isUuid, knownFormat, need, readVersioned, StorageFormatError,
|
|
17
|
+
import { closed, isObject, isText, isUuid, knownFormat, need, readVersioned, StorageFormatError, writePrivateVersionedBytes, } from "./files.js";
|
|
18
18
|
import { CLIENT_ID } from "./git-host.js";
|
|
19
19
|
import { canonicalOrigin, hostUrlFor, instanceFolder, instanceSegmentOf, OriginRefused } from "./instance.js";
|
|
20
20
|
import { words } from "./words.js";
|
|
@@ -40,7 +40,7 @@ export class InstanceRefused extends Error {
|
|
|
40
40
|
export function kebab(value) {
|
|
41
41
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
42
42
|
}
|
|
43
|
-
/** This device's user name as a
|
|
43
|
+
/** This device's user name as a personal records folder name (storage-2). */
|
|
44
44
|
export function defaultOwnName(env = process.env) {
|
|
45
45
|
let name = "";
|
|
46
46
|
try {
|
|
@@ -51,7 +51,7 @@ export function defaultOwnName(env = process.env) {
|
|
|
51
51
|
}
|
|
52
52
|
return kebab(name) || "me";
|
|
53
53
|
}
|
|
54
|
-
/** Whether a name may stand as
|
|
54
|
+
/** Whether a name may stand as the personal records folder under `workspace/`. */
|
|
55
55
|
export function isGroupName(value) {
|
|
56
56
|
return GROUP_NAME.test(value);
|
|
57
57
|
}
|
|
@@ -76,11 +76,18 @@ function isOrigin(value) {
|
|
|
76
76
|
return false;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
/**
|
|
80
|
-
|
|
79
|
+
/** The reported Git endpoint can include a path but never credentials. */
|
|
80
|
+
export function isSpaceGitOrigin(value) {
|
|
81
|
+
if (typeof value !== "string" || !/^https?:\/\/[^/?#@\s]+(?:[/?#]|$)/i.test(value) || /[\s\x00-\x1f\x7f?#]/.test(value))
|
|
82
|
+
return false;
|
|
83
|
+
const url = URL.parse(value);
|
|
84
|
+
return url !== null && !url.username && !url.password;
|
|
85
|
+
}
|
|
86
|
+
/** Format 3 adds the saved Git address. Format 1 still requires the
|
|
87
|
+
* instances migration (storage-2). */
|
|
81
88
|
function homeFormat(value, file) {
|
|
82
89
|
need(value.format !== 1, file, words().homeBeforeInstances());
|
|
83
|
-
knownFormat(value, file, 2);
|
|
90
|
+
knownFormat(value, file, [2, 3]);
|
|
84
91
|
}
|
|
85
92
|
function parseAccount(value, file) {
|
|
86
93
|
closed(value, ["id", "login", "displayName"], [], file);
|
|
@@ -88,7 +95,7 @@ function parseAccount(value, file) {
|
|
|
88
95
|
}
|
|
89
96
|
/**
|
|
90
97
|
* `home.yaml`'s value checked field by field (storage-2): its format,
|
|
91
|
-
* device, origin,
|
|
98
|
+
* device, origin, the personal records folder's name and every instance's entry —
|
|
92
99
|
* one per origin, and no two origins at one folder — and the pairings a
|
|
93
100
|
* list, each entry checked by `checkFolders` where the host supplies it.
|
|
94
101
|
* A malformed or unknown file is refused, never guessed at.
|
|
@@ -102,8 +109,9 @@ export function parseHomeFile(value, file, checkFolders) {
|
|
|
102
109
|
need(isOrigin(value.origin), file, notAnOrigin(value.origin));
|
|
103
110
|
const folders = new Map();
|
|
104
111
|
for (const instance of value.instances) {
|
|
105
|
-
closed(instance, ["origin", "clientId", "account"], ["signedOut", "displayName"], file);
|
|
112
|
+
closed(instance, ["origin", "clientId", "account"], value.format === 3 ? ["signedOut", "displayName", "gitOrigin"] : ["signedOut", "displayName"], file);
|
|
106
113
|
need(isText(instance.origin) && instance.clientId === CLIENT_ID &&
|
|
114
|
+
(instance.gitOrigin === undefined || isSpaceGitOrigin(instance.gitOrigin)) &&
|
|
107
115
|
(instance.signedOut === undefined || typeof instance.signedOut === "boolean") &&
|
|
108
116
|
(instance.displayName === undefined || typeof instance.displayName === "string"), file, invalidHome());
|
|
109
117
|
need(isOrigin(instance.origin), file, notAnOrigin(instance.origin));
|
|
@@ -143,7 +151,7 @@ function originOf(origin, file) {
|
|
|
143
151
|
}
|
|
144
152
|
/** A new home, not yet written: a fresh device id unless one is
|
|
145
153
|
* supplied, the origin the environment names, no instance signed in
|
|
146
|
-
* to, and this device's user name
|
|
154
|
+
* to, and this device's user name for its personal records folder. A URL the
|
|
147
155
|
* environment names that is no instance's origin is refused as a
|
|
148
156
|
* storage diagnostic of `file`. */
|
|
149
157
|
export function newHomeFile(file, options = {}) {
|
|
@@ -218,13 +226,14 @@ export function withSignIn(home, origin, account, file) {
|
|
|
218
226
|
const entry = {
|
|
219
227
|
origin: canonical, clientId: CLIENT_ID,
|
|
220
228
|
account: { id: account.id, login: account.login, displayName: account.displayName },
|
|
229
|
+
...(prior?.gitOrigin !== undefined ? { gitOrigin: prior.gitOrigin } : {}),
|
|
221
230
|
...(prior?.displayName !== undefined ? { displayName: prior.displayName } : {}),
|
|
222
231
|
};
|
|
223
232
|
const instances = index < 0 ? [...home.instances, entry] : home.instances.map((item, at) => at === index ? entry : item);
|
|
224
233
|
return { ...home, instances };
|
|
225
234
|
}
|
|
226
235
|
/** The home after the credential at an instance went while its account
|
|
227
|
-
* is kept (git-host-
|
|
236
|
+
* is kept (git-host-31): it reads signed out until its next
|
|
228
237
|
* sign-in. The default instance's where no origin is named; unchanged
|
|
229
238
|
* where none is listed or signed in. */
|
|
230
239
|
export function withSignOut(home, origin) {
|
|
@@ -245,15 +254,16 @@ export function withoutInstance(home, origin) {
|
|
|
245
254
|
throw new InstanceRefused("signed-in", entry.origin);
|
|
246
255
|
return { ...home, instances: home.instances.filter((_, at) => at !== index) };
|
|
247
256
|
}
|
|
248
|
-
/** The home with
|
|
249
|
-
* is not listed. */
|
|
250
|
-
export function withDisplayName(home, origin, displayName) {
|
|
257
|
+
/** The home with a listed Space's last display name and, when supplied,
|
|
258
|
+
* its Git address. Null where the Space is not listed. */
|
|
259
|
+
export function withDisplayName(home, origin, displayName, gitOrigin) {
|
|
251
260
|
const index = indexOf(home, origin);
|
|
252
261
|
if (index < 0)
|
|
253
262
|
return null;
|
|
254
263
|
const { displayName: _, ...rest } = home.instances[index];
|
|
255
|
-
const entry = displayName === null ?
|
|
256
|
-
return { ...home,
|
|
264
|
+
const entry = { ...rest, ...(displayName === null ? {} : { displayName }), ...(gitOrigin === undefined ? {} : { gitOrigin }) };
|
|
265
|
+
return { ...home, format: gitOrigin === undefined ? home.format : 3,
|
|
266
|
+
instances: home.instances.map((item, at) => at === index ? entry : item) };
|
|
257
267
|
}
|
|
258
268
|
// -- one step ----------------------------------------------------------------
|
|
259
269
|
/** The path of a home's file. */
|
|
@@ -282,7 +292,7 @@ export function updateHomeFile(root, change, options = {}) {
|
|
|
282
292
|
return current;
|
|
283
293
|
parseHomeFile(next, file, options.checkFolders);
|
|
284
294
|
mkdirSync(root, { recursive: true, mode: 0o700 });
|
|
285
|
-
|
|
295
|
+
writePrivateVersionedBytes(file, stringifyYaml(next), version);
|
|
286
296
|
return next;
|
|
287
297
|
}
|
|
288
298
|
//# sourceMappingURL=home-file.js.map
|
package/dist/lib/instance.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare function instanceFolder(value: string): string;
|
|
|
52
52
|
export declare function isInstanceFolder(value: string): boolean;
|
|
53
53
|
/** The instance folder a key begins with — `@spex.sublang.ai` of
|
|
54
54
|
* `@spex.sublang.ai/acme/a-spex` — or null for a key outside every instance's
|
|
55
|
-
* folder, as
|
|
55
|
+
* folder, as for the global records repository and local-only project clones. */
|
|
56
56
|
export declare function instanceSegmentOf(key: string): string | null;
|
|
57
57
|
/**
|
|
58
58
|
* The instance a home names (git-host-1), as its canonical origin: a
|
package/dist/lib/instance.js
CHANGED
|
@@ -104,7 +104,7 @@ export function isInstanceFolder(value) {
|
|
|
104
104
|
}
|
|
105
105
|
/** The instance folder a key begins with — `@spex.sublang.ai` of
|
|
106
106
|
* `@spex.sublang.ai/acme/a-spex` — or null for a key outside every instance's
|
|
107
|
-
* folder, as
|
|
107
|
+
* folder, as for the global records repository and local-only project clones. */
|
|
108
108
|
export function instanceSegmentOf(key) {
|
|
109
109
|
const at = key.indexOf("/");
|
|
110
110
|
if (at < 0)
|
package/dist/lint.d.ts
CHANGED
|
@@ -13,3 +13,25 @@ export declare function lintSpecs(basePath: string): LintFinding[];
|
|
|
13
13
|
* non-zero when any error-severity finding exists (lint-1..3).
|
|
14
14
|
*/
|
|
15
15
|
export declare function lint(args?: string[]): void;
|
|
16
|
+
/** One spec item as the linter reads it. */
|
|
17
|
+
export type SpecItem = {
|
|
18
|
+
id: string;
|
|
19
|
+
/** POSIX path relative to the base (starts with "specs/"). */
|
|
20
|
+
relPath: string;
|
|
21
|
+
/** 1-based line of its heading. */
|
|
22
|
+
line: number;
|
|
23
|
+
/** Canonical section of the containing ## heading, if known. */
|
|
24
|
+
section: string | null;
|
|
25
|
+
/** Its heading line and body lines, as the file has them. */
|
|
26
|
+
lines: string[];
|
|
27
|
+
/** The spec items its body cites by a link, in the order cited. */
|
|
28
|
+
cites: {
|
|
29
|
+
id: string;
|
|
30
|
+
relPath: string;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Every spec item under `specs/packages/` and in `specs/meta.md`, read
|
|
35
|
+
* with the linter's own parser and item rules and reporting nothing.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readSpecItems(basePath: string): SpecItem[];
|
package/dist/lint.js
CHANGED
|
@@ -975,4 +975,40 @@ export function lint(args = []) {
|
|
|
975
975
|
process.exit(1);
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
+
/**
|
|
979
|
+
* Every spec item under `specs/packages/` and in `specs/meta.md`, read
|
|
980
|
+
* with the linter's own parser and item rules and reporting nothing.
|
|
981
|
+
*/
|
|
982
|
+
export function readSpecItems(basePath) {
|
|
983
|
+
const ctx = { basePath, files: new Map(), findings: [] };
|
|
984
|
+
const packagesDir = join(basePath, "specs", "packages");
|
|
985
|
+
const relPaths = existsSync(packagesDir) && statSync(packagesDir).isDirectory()
|
|
986
|
+
? listMarkdownFiles(packagesDir, "specs/packages")
|
|
987
|
+
: [];
|
|
988
|
+
if (existsSync(join(basePath, "specs", "meta.md")))
|
|
989
|
+
relPaths.push("specs/meta.md");
|
|
990
|
+
for (const relPath of relPaths)
|
|
991
|
+
ctx.files.set(relPath, loadFile(basePath, relPath));
|
|
992
|
+
const items = collectItems(ctx);
|
|
993
|
+
const bySlug = itemsBySlug(items);
|
|
994
|
+
return items.map((item) => {
|
|
995
|
+
const cites = [];
|
|
996
|
+
for (const link of bodyLinks(item)) {
|
|
997
|
+
const target = linkTarget(item.file, link);
|
|
998
|
+
if (target === null)
|
|
999
|
+
continue;
|
|
1000
|
+
const cited = bySlug.get(target.relPath)?.get(target.fragment);
|
|
1001
|
+
if (cited !== undefined)
|
|
1002
|
+
cites.push({ id: cited.id, relPath: cited.file.relPath });
|
|
1003
|
+
}
|
|
1004
|
+
return {
|
|
1005
|
+
id: item.id,
|
|
1006
|
+
relPath: item.file.relPath,
|
|
1007
|
+
line: item.heading.line,
|
|
1008
|
+
section: item.section,
|
|
1009
|
+
lines: item.file.lines.slice(item.heading.line - 1, item.bodyEnd - 1),
|
|
1010
|
+
cites,
|
|
1011
|
+
};
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
978
1014
|
//# sourceMappingURL=lint.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// index, version resources, raw files, release archives and search —
|
|
6
6
|
// from a directory of releases, with a publish endpoint that validates
|
|
7
7
|
// as the core's publishing does — the release checks and the fields the
|
|
8
|
-
// registry requires (environments-
|
|
8
|
+
// registry requires (environments-59) — and stores the archive.
|
|
9
9
|
// Scripted yank, suppression, private namespaces honouring app tokens,
|
|
10
10
|
// the orgs each app token's person may publish to, held as scripted,
|
|
11
11
|
// and outages let the core's tests and the browser journeys drive every
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sublang/spex",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.2",
|
|
4
4
|
"description": "The essential spec layer AI agents need to build software reliably",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"types": "./dist/testing/index.d.ts",
|
|
51
51
|
"default": "./dist/testing/index.js"
|
|
52
52
|
},
|
|
53
|
+
"./testing/exit-guard": "./scripts/test-exit-guard.mjs",
|
|
53
54
|
"./scaffold/*": "./scaffold/*",
|
|
54
55
|
"./package.json": "./package.json"
|
|
55
56
|
},
|
|
@@ -58,18 +59,21 @@
|
|
|
58
59
|
"!dist/**/*.test.js",
|
|
59
60
|
"dist/**/*.d.ts",
|
|
60
61
|
"!dist/**/*.test.d.ts",
|
|
61
|
-
"scaffold/"
|
|
62
|
+
"scaffold/",
|
|
63
|
+
"scripts/test-exit-guard.mjs"
|
|
62
64
|
],
|
|
63
65
|
"scripts": {
|
|
64
66
|
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc && node scripts/stage-scaffold.mjs",
|
|
65
67
|
"prepublishOnly": "npm run build && npm test",
|
|
68
|
+
"test:skill-atlas": "tsc --project browser && playwright test --config browser/playwright.config.ts",
|
|
66
69
|
"test": "node scripts/stage-scaffold.mjs && node scripts/run-tests.cjs",
|
|
67
70
|
"test:integration": "node scripts/stage-scaffold.mjs && node scripts/run-tests.cjs \"\\.integration\\.test\\.js$\""
|
|
68
71
|
},
|
|
69
72
|
"engines": {
|
|
70
|
-
"node": ">=22"
|
|
73
|
+
"node": ">=22.15"
|
|
71
74
|
},
|
|
72
75
|
"devDependencies": {
|
|
76
|
+
"@playwright/test": "^1.62.1",
|
|
73
77
|
"@types/mdast": "^4.0.4",
|
|
74
78
|
"@types/node": "^26.4.0",
|
|
75
79
|
"typescript": "^7.0.2"
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"sha256-f1bcf636c567b830c5d6f625e10c8e4fe2c56b71fa7787106cd7b8701ad20efe",
|
|
4
4
|
"sha256-5da224028a738e3f8c50adbeb1f2bc9006beafe47050594a9a30b207d8ff0386",
|
|
5
5
|
"sha256-390e4beb58f88ffcdb63c9518634d31c07d61f71e09a3bfab0495a5da0c56244",
|
|
6
|
-
"sha256-a1c6e3e3b6f41531da5959dd688d8c0049d1e64b19ecf708a944de987c987f83"
|
|
6
|
+
"sha256-a1c6e3e3b6f41531da5959dd688d8c0049d1e64b19ecf708a944de987c987f83",
|
|
7
|
+
"sha256-bafd6ecfba5f5179a327e1df88acab2fd0dd7bdc442ac3c9cdd2d47c44993a76"
|
|
7
8
|
],
|
|
8
9
|
"i18n/zh/specs/meta.md": [
|
|
9
10
|
"sha256-ce07160cf8af1fb67f4f86c572aa182e92dff24a72b313a89914e058de894b56",
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
"sha256-3c75823810863849ae302255d477749fc57e8e367a499240cde0dd47c479219a",
|
|
13
14
|
"sha256-b4feb754ffd405050d50efe9da527c9a81e7dec48f58a7ed29db3bd28617bbbb",
|
|
14
15
|
"sha256-78e528aee1d8f5b4946c53e119a81c7548df53bd09f8458152c2c2aaa386cd82",
|
|
15
|
-
"sha256-174cb27f6637f1b6ea9b163bd5d9a7f4dfe8b4aa52e4bca889c2da8bdb6862f1"
|
|
16
|
+
"sha256-174cb27f6637f1b6ea9b163bd5d9a7f4dfe8b4aa52e4bca889c2da8bdb6862f1",
|
|
17
|
+
"sha256-cd66a81cf14923c3e025f322524ecfd7d3ee39a364a8e9a43c484b39d320ee3f"
|
|
16
18
|
],
|
|
17
19
|
"specs/decisions/000-spec-structure-format.md": [
|
|
18
20
|
"sha256-28d0705311a8ede97c487a944efe99bed20863e246da0aa1a33286dd4f8864ca",
|
|
@@ -36,7 +38,8 @@
|
|
|
36
38
|
"sha256-ca67a077cfaecb51a85e98ec8f8508ce9d8a43dcb7355b9e16de611c38cdabfc",
|
|
37
39
|
"sha256-ba58b39de3537f06fbe4f13c9b1443a8a64cf090c9ba202a67263dfc054b78c8",
|
|
38
40
|
"sha256-ed90e3e82e18d3893e52d18e80d795406bc9a0b5915416ee73295a4d7c7ff52a",
|
|
39
|
-
"sha256-d7fb96010dbcdc89fcea56dc1c4cf6db6b6b56d261aedaa7f6ee36fb9dd3c7f5"
|
|
41
|
+
"sha256-d7fb96010dbcdc89fcea56dc1c4cf6db6b6b56d261aedaa7f6ee36fb9dd3c7f5",
|
|
42
|
+
"sha256-afbfc1beaa66205547c7e794059bf487ceb80f219eabfad7dd7e2cc61a868ac2"
|
|
40
43
|
],
|
|
41
44
|
"specs/packages/git.md": [
|
|
42
45
|
"sha256-1b194304866d05580de8b2d0caa3454aa772e876fb3dee1f6c5d637c9e9a42b2",
|
|
@@ -60,16 +63,20 @@
|
|
|
60
63
|
"sha256-d2246bb72b8a1be75cf8dd293e80c51e5f5de6f810a8d1fbc71982a52d3fecc3"
|
|
61
64
|
],
|
|
62
65
|
"i18n/zh/specs/decisions/000-spec-structure-format.md": [
|
|
63
|
-
"sha256-061769e9a2a55ec6d1bcddd47c9aaacb0881a011106a34cb13fa78dc0bd099bf"
|
|
66
|
+
"sha256-061769e9a2a55ec6d1bcddd47c9aaacb0881a011106a34cb13fa78dc0bd099bf",
|
|
67
|
+
"sha256-55a48a08b7ee38e6c7066115feef40196f8e83db13aa3c753d217d602cf86524"
|
|
64
68
|
],
|
|
65
69
|
"i18n/zh/specs/intents/000-spdx-headers.md": [
|
|
66
|
-
"sha256-f661027e2af391b88458088534a57108ceaa8458bce7eb342702149c5b43c3a8"
|
|
70
|
+
"sha256-f661027e2af391b88458088534a57108ceaa8458bce7eb342702149c5b43c3a8",
|
|
71
|
+
"sha256-089f2a09cd1167cf8b5edd128002d5d1a67cf44086f23e1b1491496528d289cc"
|
|
67
72
|
],
|
|
68
73
|
"i18n/zh/specs/packages/git.md": [
|
|
69
|
-
"sha256-a22cc1cc543e0fa56cc42be4a96383b7866235d7b9bd1c27e2d4bb95e67b5667"
|
|
74
|
+
"sha256-a22cc1cc543e0fa56cc42be4a96383b7866235d7b9bd1c27e2d4bb95e67b5667",
|
|
75
|
+
"sha256-e00173422f3eb58ad5052ee315663fbff4362ad897c54f18aeafe8970db76e58"
|
|
70
76
|
],
|
|
71
77
|
"i18n/zh/specs/packages/licensing.md": [
|
|
72
78
|
"sha256-b8219306bb5f6e33a548430c96301f0fa6b14bad36f3cb5ef72dc5338ea81aba",
|
|
73
|
-
"sha256-661cc3ffb6651021ca417eec0e6555315fdea4bcae7d880aa694772634c37bed"
|
|
79
|
+
"sha256-661cc3ffb6651021ca417eec0e6555315fdea4bcae7d880aa694772634c37bed",
|
|
80
|
+
"sha256-0c1dbdc22948812c70122ccb56cb70e30eb9a2ba043f6e5e962700f7f811db8a"
|
|
74
81
|
]
|
|
75
82
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"specs/decisions/000-spec-structure-format.md": "sha256-4c32ec9e308762026c9ec184a03885f3cd58d1eb1ab97300d6c82600ae71de64",
|
|
3
|
+
"specs/intents/000-spdx-headers.md": "sha256-d2246bb72b8a1be75cf8dd293e80c51e5f5de6f810a8d1fbc71982a52d3fecc3",
|
|
4
|
+
"specs/map.md": "sha256-5dbf6d5bf1f09c74f8bf71209986eca460723957c6861f0a73654b88d9e522d9",
|
|
5
|
+
"specs/meta.md": "sha256-afbfc1beaa66205547c7e794059bf487ceb80f219eabfad7dd7e2cc61a868ac2",
|
|
6
|
+
"specs/meta.md#meta-1": "sha256-98f39e3ec8fdc7f1625f5114a862eaee529e56d9a2dfe2d8d5b90c7509d81461",
|
|
7
|
+
"specs/meta.md#meta-23": "sha256-81630fea3117f135538a1f733caed7dab1dc908b08b7550039db26a87d74161c",
|
|
8
|
+
"specs/meta.md#meta-25": "sha256-5cc61079544bb13f32034b8d47ecf64ae4a34503d30156d735a91331fc536ce7",
|
|
9
|
+
"specs/meta.md#meta-4": "sha256-9094707b5ede14d4e0c104c0ae6aaf0ce2ca1129723a472b329d68e3142e1c48",
|
|
10
|
+
"specs/meta.md#meta-5": "sha256-6847734892ace98018676f3430e0a848b0a83541b23f1b4f69aa9b12a1c0aeda",
|
|
11
|
+
"specs/meta.md#meta-22": "sha256-58c862ce93e422901613bdcbdb9a24c55af1b7eebe6155db95e872c85860a1ee",
|
|
12
|
+
"specs/meta.md#meta-24": "sha256-48a3ecf9a8bcb8c1d4455aff9a912fd484e529ec15f88e156b2a5d471eebb11f",
|
|
13
|
+
"specs/meta.md#meta-35": "sha256-22ff1ca3f8cc94ce9e524408423830213b53d9f5fb744ecb67d1ab99172581f4",
|
|
14
|
+
"specs/meta.md#meta-36": "sha256-1841c8a6b21da8e7b5853b23685e12e39f35ecee2f8ea70cac8b1e869549f7d0",
|
|
15
|
+
"specs/meta.md#meta-37": "sha256-90cb731134b14fc8a55afeb51a35c13345d47eba4bdb023f09b8e023f45dc394",
|
|
16
|
+
"specs/meta.md#meta-28": "sha256-138df4b1fcfeb110a252ca26b5174f91513b1167603a322a13682cd4fa9b8a33",
|
|
17
|
+
"specs/meta.md#meta-6": "sha256-c6c53324be46702a10d6ca65a71842222518a1a2e32b8ccd334e361b70fbab75",
|
|
18
|
+
"specs/meta.md#meta-7": "sha256-4c4ede3e11a0482d645f0d5154791a1e4e83438033b93d4fc8b359b00f2190ad",
|
|
19
|
+
"specs/meta.md#meta-8": "sha256-724b84c437f45fec7b3158b15b3656268bd0f5599af2f481ad1fc47eb527c873",
|
|
20
|
+
"specs/meta.md#meta-29": "sha256-6b1b4e271a3a21ed2b817b6a133e1bec6827618259ea2d137960a3a69afb4de8",
|
|
21
|
+
"specs/meta.md#meta-13": "sha256-d9121e55ea381bd732db89dfbbc5b6ec903b5e2d58ab1be94ef91719c5003c92",
|
|
22
|
+
"specs/meta.md#meta-34": "sha256-7b950bb56666ce51d75d1adee22102da76fb240cf9fc10f1720a3b2d71e948fc",
|
|
23
|
+
"specs/meta.md#meta-9": "sha256-7332a5da5509864275026467cdd42fdae994e872904b6a3047d0b7c66056792d",
|
|
24
|
+
"specs/meta.md#meta-30": "sha256-0157482272767b0d31d355728e8b2df551310d4248d380ab886f71e6d0bfe93b",
|
|
25
|
+
"specs/meta.md#meta-10": "sha256-037882d4330f27da723e4bc9745111b6695408851582918ea2acf136bbf2cbea",
|
|
26
|
+
"specs/meta.md#meta-11": "sha256-7f570fb5a98c01c4ccb7b3cd48f8c370fe660d0ffaebc73333010f45e215ae8f",
|
|
27
|
+
"specs/meta.md#meta-12": "sha256-ed082a7a193eefe08f9fa15669f23d2b5d4fd5cac90c2dc7e83f6903f52bb2ba",
|
|
28
|
+
"specs/meta.md#meta-14": "sha256-bec76a978583747ecf96f671a77e9e3a795ff4bdd69dfd72d51c98779d5d82a8",
|
|
29
|
+
"specs/meta.md#meta-15": "sha256-2bf03e350e6014f7fe1d8623953c0e9923be83deb692411c2304c80cce52b70a",
|
|
30
|
+
"specs/meta.md#meta-31": "sha256-22ec564553bdada3a94a3c2273dcc59b7946bf8c4311c5c245003adb17ea9fc8",
|
|
31
|
+
"specs/meta.md#meta-21": "sha256-3fd36fda3683299fdba6129318987bc429027cde6bbae08485085fd596f9275e",
|
|
32
|
+
"specs/meta.md#meta-32": "sha256-28f1ce30821d263ee507cf71be045ab431a9d5fe449ea7ea194c2c8f15a683b9",
|
|
33
|
+
"specs/meta.md#meta-33": "sha256-65a82bd4cca5750e8e7b8743c636b2fbd6dff7fe3447b0d04c30cbb70666069a",
|
|
34
|
+
"specs/meta.md#meta-16": "sha256-c3a9c2d5a690ea7408db2fbd0a9d1cfdbe7b14ee162cd8d414f3f734f3a86279",
|
|
35
|
+
"specs/meta.md#meta-18": "sha256-c861847d755a25b07322a9a05bf66295d0477ff89fae684fe1a53d18a7774cdc",
|
|
36
|
+
"specs/meta.md#meta-19": "sha256-b48c49bc3cdefa532ee254bd7af670a3762fd436aaf0ca9d49560f2f9159f664",
|
|
37
|
+
"specs/meta.md#meta-20": "sha256-e00eba313900b6fad6a87274765cad11a900465997e0f2cacfa9c904ca4587fe",
|
|
38
|
+
"specs/meta.md#meta-27": "sha256-b19f392d742d307fb0f811892dbb65509b36dc3a9636512604c636b7b0aa5c29",
|
|
39
|
+
"specs/packages/git.md": "sha256-f4bdc7cf1ea7be17575fb189abb9fa3cfbc9eeb8a7bccefbbffdbea3d4210608",
|
|
40
|
+
"specs/packages/licensing.md": "sha256-b059af6fb2ddc8ec81628bab0b14d0deb1974b6ec840d5b9cabdfeebcab0f077"
|
|
41
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
2
|
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
3
|
<!-- AI agents: do not edit this file without human approval. -->
|
|
4
|
-
<!-- spex-i18n-source: specs/decisions/000-spec-structure-format.md sha256-4c32ec9e308762026c9ec184a03885f3cd58d1eb1ab97300d6c82600ae71de64 -->
|
|
5
4
|
|
|
6
5
|
# DR-000: 规约结构与格式
|
|
7
6
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
2
|
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
|
-
<!-- spex-i18n-source: specs/intents/000-spdx-headers.md sha256-d2246bb72b8a1be75cf8dd293e80c51e5f5de6f810a8d1fbc71982a52d3fecc3 -->
|
|
4
3
|
|
|
5
4
|
# IR-000: SPDX 头
|
|
6
5
|
|