@driftsys/markspec 0.9.0 → 0.10.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/esm/collect/mod.d.ts +34 -0
- package/esm/collect/mod.d.ts.map +1 -0
- package/esm/collect/mod.js +37 -0
- package/esm/compiler/mod.d.ts +7 -0
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +17 -3
- package/esm/compiler/schema.d.ts +8 -1
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +8 -1
- package/esm/formatter/dprint.d.ts +62 -0
- package/esm/formatter/dprint.d.ts.map +1 -0
- package/esm/formatter/dprint.js +83 -0
- package/esm/formatter/md_equiv.d.ts +24 -0
- package/esm/formatter/md_equiv.d.ts.map +1 -0
- package/esm/formatter/md_equiv.js +81 -0
- package/esm/formatter/mod.d.ts +25 -0
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +135 -7
- package/esm/formatter/prose.d.ts +48 -0
- package/esm/formatter/prose.d.ts.map +1 -0
- package/esm/formatter/prose.js +85 -0
- package/esm/gates/mod.d.ts +82 -0
- package/esm/gates/mod.d.ts.map +1 -0
- package/esm/gates/mod.js +139 -0
- package/esm/lint/runner.d.ts +26 -3
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +39 -9
- package/esm/lock/edge_drift.d.ts +31 -0
- package/esm/lock/edge_drift.d.ts.map +1 -0
- package/esm/lock/edge_drift.js +29 -0
- package/esm/lock/mod.d.ts +2 -0
- package/esm/lock/mod.d.ts.map +1 -1
- package/esm/lock/mod.js +1 -0
- package/esm/mod.d.ts +16 -7
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +13 -4
- package/esm/model/mod.d.ts +27 -1
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +10 -0
- package/esm/model/profile.d.ts +42 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +38 -11
- package/esm/profile/chain.js +1 -0
- package/esm/profile/delivered.d.ts +48 -0
- package/esm/profile/delivered.d.ts.map +1 -0
- package/esm/profile/delivered.js +103 -0
- package/esm/profile/manifest.d.ts +1 -0
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +107 -0
- package/esm/profile/merge.d.ts.map +1 -1
- package/esm/profile/merge.js +22 -0
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +22 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +16 -4
- package/esm/util/fence.d.ts +8 -0
- package/esm/util/fence.d.ts.map +1 -1
- package/esm/util/fence.js +22 -0
- package/esm/validator/corpus.d.ts +25 -0
- package/esm/validator/corpus.d.ts.map +1 -0
- package/esm/validator/corpus.js +140 -0
- package/esm/validator/mod.d.ts +2 -0
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +1 -0
- package/package.json +3 -1
- package/script/collect/mod.d.ts +34 -0
- package/script/collect/mod.d.ts.map +1 -0
- package/script/collect/mod.js +40 -0
- package/script/compiler/mod.d.ts +7 -0
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +16 -2
- package/script/compiler/schema.d.ts +8 -1
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +8 -1
- package/script/formatter/dprint.d.ts +62 -0
- package/script/formatter/dprint.d.ts.map +1 -0
- package/script/formatter/dprint.js +120 -0
- package/script/formatter/md_equiv.d.ts +24 -0
- package/script/formatter/md_equiv.d.ts.map +1 -0
- package/script/formatter/md_equiv.js +87 -0
- package/script/formatter/mod.d.ts +25 -0
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +135 -6
- package/script/formatter/prose.d.ts +48 -0
- package/script/formatter/prose.d.ts.map +1 -0
- package/script/formatter/prose.js +88 -0
- package/script/gates/mod.d.ts +82 -0
- package/script/gates/mod.d.ts.map +1 -0
- package/script/gates/mod.js +144 -0
- package/script/lint/runner.d.ts +26 -3
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +39 -9
- package/script/lock/edge_drift.d.ts +31 -0
- package/script/lock/edge_drift.d.ts.map +1 -0
- package/script/lock/edge_drift.js +32 -0
- package/script/lock/mod.d.ts +2 -0
- package/script/lock/mod.d.ts.map +1 -1
- package/script/lock/mod.js +3 -1
- package/script/mod.d.ts +16 -7
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +56 -29
- package/script/model/mod.d.ts +27 -1
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +11 -0
- package/script/model/profile.d.ts +42 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +38 -11
- package/script/profile/chain.js +1 -0
- package/script/profile/delivered.d.ts +48 -0
- package/script/profile/delivered.d.ts.map +1 -0
- package/script/profile/delivered.js +109 -0
- package/script/profile/manifest.d.ts +1 -0
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +108 -1
- package/script/profile/merge.d.ts.map +1 -1
- package/script/profile/merge.js +22 -0
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +22 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +16 -4
- package/script/util/fence.d.ts +8 -0
- package/script/util/fence.d.ts.map +1 -1
- package/script/util/fence.js +23 -0
- package/script/validator/corpus.d.ts +25 -0
- package/script/validator/corpus.d.ts.map +1 -0
- package/script/validator/corpus.js +144 -0
- package/script/validator/mod.d.ts +2 -0
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +4 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/gates
|
|
4
|
+
*
|
|
5
|
+
* Composite-`check` gate stages (ADR-027). Each function is a pure,
|
|
6
|
+
* independently-testable transformation from already-gathered inputs to a
|
|
7
|
+
* `Diagnostic[]`; the CLI `check` command orchestrates them (gather inputs →
|
|
8
|
+
* call stages → merge diagnostics → render) and owns the scope policy that
|
|
9
|
+
* decides whether they run at all (project-wide only).
|
|
10
|
+
*
|
|
11
|
+
* Extracted from `cli/commands/check.ts` (#659) so the diagnostic-producing
|
|
12
|
+
* logic lives in `core` — composable, unit-testable in isolation, and reusable
|
|
13
|
+
* by future surfaces — rather than inline in the command body. The command
|
|
14
|
+
* keeps the I/O it must do (loading the Markdown prose formatter, reading
|
|
15
|
+
* `markspec.lock`) and feeds the results in.
|
|
16
|
+
*
|
|
17
|
+
* `gates` is a top-level composition layer: it depends on `formatter`,
|
|
18
|
+
* `parser`, `refs`, `lock`, and `lint`, and nothing in those depends back on
|
|
19
|
+
* it — no cycle.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.fmtDriftGate = fmtDriftGate;
|
|
23
|
+
exports.lockfileDriftGate = lockfileDriftGate;
|
|
24
|
+
exports.proseLintGate = proseLintGate;
|
|
25
|
+
const mod_js_1 = require("../formatter/mod.js");
|
|
26
|
+
const mod_js_2 = require("../parser/mod.js");
|
|
27
|
+
const mod_js_3 = require("../refs/mod.js");
|
|
28
|
+
const mod_js_4 = require("../lock/mod.js");
|
|
29
|
+
const mod_js_5 = require("../lint/mod.js");
|
|
30
|
+
/**
|
|
31
|
+
* Format-drift gate — the `MSL-F010` (formatter drift) and `MSL-F011`
|
|
32
|
+
* (reference-canonicalization drift) findings.
|
|
33
|
+
*
|
|
34
|
+
* Runs the SAME `format() → parse → canonicalizeRefs` sequence `markspec fmt`
|
|
35
|
+
* performs, from the same exclude-aware corpus, so bare `check` and
|
|
36
|
+
* `fmt --check` never disagree on what "formatted" means. `MSL-F010` is pure
|
|
37
|
+
* formatter drift; `MSL-F011` is reference-canonicalization drift (a ULID or
|
|
38
|
+
* stale display ID `fmt` would rewrite) — kept distinct so the author knows
|
|
39
|
+
* which fmt concern fired. Markdown only — `markspec fmt` never rewrites source
|
|
40
|
+
* files, so the caller passes only Markdown file contents.
|
|
41
|
+
*
|
|
42
|
+
* @param mdContents Markdown file path → current on-disk content.
|
|
43
|
+
* @param entries The full parsed entry set (project + corpus). Only
|
|
44
|
+
* project-owned entries (`!e.origin`) build the reference index
|
|
45
|
+
* `canonicalizeRefs` heals against — `markspec fmt` is corpus-blind (ADR-030).
|
|
46
|
+
* @param ledger The lockfile's `[[edge]]` ULID ledger (`lockfile.edges`, or
|
|
47
|
+
* `[]` when there is no lockfile), threaded into `canonicalizeRefs`.
|
|
48
|
+
* @param formatMarkdownProse The loaded ADR-029 whole-document Markdown
|
|
49
|
+
* formatter, or `undefined` to degrade to entry-only formatting.
|
|
50
|
+
*/
|
|
51
|
+
async function fmtDriftGate(mdContents, entries, ledger, formatMarkdownProse) {
|
|
52
|
+
const diagnostics = [];
|
|
53
|
+
// Corpus-blind by design (ADR-030): `markspec fmt` never loads the delivered
|
|
54
|
+
// corpus, so it can only canonicalize references into project-owned entries.
|
|
55
|
+
// Building the heal index over the full set (including corpus) would flag an
|
|
56
|
+
// MSL-F011 drift that `fmt` can never fix — a permanently red gate for any
|
|
57
|
+
// consumer using a delivered corpus. Filter to `!e.origin`, mirroring
|
|
58
|
+
// lockfileDriftGate.
|
|
59
|
+
const refIndex = (0, mod_js_3.buildRefIndex)(entries.filter((e) => !e.origin));
|
|
60
|
+
for (const [filePath, content] of mdContents) {
|
|
61
|
+
const formatted = (0, mod_js_1.format)(content, {
|
|
62
|
+
file: filePath,
|
|
63
|
+
formatMarkdownProse,
|
|
64
|
+
});
|
|
65
|
+
if (formatted.changed) {
|
|
66
|
+
diagnostics.push({
|
|
67
|
+
code: "MSL-F010",
|
|
68
|
+
severity: "error",
|
|
69
|
+
message: "file is not formatted (run `markspec fmt`)",
|
|
70
|
+
location: { file: filePath, line: 1, column: 1 },
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const parsed = await (0, mod_js_2.parseFile)(formatted.output, { file: filePath });
|
|
74
|
+
const refResult = (0, mod_js_3.canonicalizeRefs)(formatted.output, parsed.entries, refIndex, ledger);
|
|
75
|
+
if (refResult.changed) {
|
|
76
|
+
diagnostics.push({
|
|
77
|
+
code: "MSL-F011",
|
|
78
|
+
severity: "error",
|
|
79
|
+
message: "references are not canonical (run `markspec fmt`)",
|
|
80
|
+
location: { file: filePath, line: 1, column: 1 },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return diagnostics;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Lockfile-drift gate — the `MSL-L212` offline traceability-edge drift finding.
|
|
88
|
+
*
|
|
89
|
+
* A malformed lockfile surfaces the parser's own diagnostics unchanged. An
|
|
90
|
+
* intact lockfile is compared against the current graph's canonical edge hash.
|
|
91
|
+
* Offline by design — upstream resolution (network) stays in
|
|
92
|
+
* `markspec lock --check`.
|
|
93
|
+
*
|
|
94
|
+
* Corpus-blind by design: the lockfile is not corpus-aware yet (ADR-030 defers
|
|
95
|
+
* lockfile integration), so `markspec lock` never counts corpus edges. Counting
|
|
96
|
+
* them here would raise an `MSL-L212` drift error that `markspec lock` can never
|
|
97
|
+
* fix — a consumer gate must not fail on upstream content the consumer cannot
|
|
98
|
+
* re-lock. The gate therefore filters to project-owned entries (`!e.origin`),
|
|
99
|
+
* mirroring `markspec lock`.
|
|
100
|
+
*
|
|
101
|
+
* @param lockParse The parsed `markspec.lock` (already read from disk).
|
|
102
|
+
* @param lockPath Absolute path to `markspec.lock`, used as the diagnostic
|
|
103
|
+
* location so JSON consumers that group by `location.file` keep the finding.
|
|
104
|
+
* @param entries The full parsed entry set; corpus entries are filtered out.
|
|
105
|
+
*/
|
|
106
|
+
async function lockfileDriftGate(lockParse, lockPath, entries) {
|
|
107
|
+
if (!lockParse.lockfile) {
|
|
108
|
+
return [...lockParse.diagnostics];
|
|
109
|
+
}
|
|
110
|
+
const projectEntries = entries.filter((e) => !e.origin);
|
|
111
|
+
const drift = await (0, mod_js_4.detectOfflineEdgeDrift)(projectEntries, lockParse.lockfile.generatedCache);
|
|
112
|
+
if (!drift.drifted)
|
|
113
|
+
return [];
|
|
114
|
+
return [{
|
|
115
|
+
code: "MSL-L212",
|
|
116
|
+
severity: "error",
|
|
117
|
+
message: `traceability edges drifted from markspec.lock: locked ${drift.lockedCount} edge(s), current ${drift.currentCount} — run \`markspec lock\` to refresh. (After upgrading MarkSpec this can also fire once because traceability inputs now include source-file doc comments; re-running \`markspec lock\` clears it.)`,
|
|
118
|
+
location: { file: lockPath, line: 1, column: 1 },
|
|
119
|
+
}];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Prose-lint gate — the advisory `MSL-Q` prose-analysis findings, projected to
|
|
123
|
+
* plain {@linkcode Diagnostic}s.
|
|
124
|
+
*
|
|
125
|
+
* Pass the FULL entry set (project + corpus) and the active profile.
|
|
126
|
+
* {@linkcode runLint} excludes corpus entries from its output but keeps them in
|
|
127
|
+
* the glossary / `$Identifier` indexes, so a corpus-defined term still silences
|
|
128
|
+
* Q500 in project prose (ADR-030 §D4). The profile threads into `isProseScope`
|
|
129
|
+
* so profile-typed entries are scoped (#675).
|
|
130
|
+
*
|
|
131
|
+
* `runLint`'s {@linkcode LintDiagnostic} carries `slug`/`group`/`score` fields
|
|
132
|
+
* that must not leak into `check`'s stable JSON schema — the result is projected
|
|
133
|
+
* to plain {@linkcode Diagnostic}. `runLint`'s `readFile` option (for glossary
|
|
134
|
+
* file indexing) is not needed here: `check` passes no `glossaryFilePaths`.
|
|
135
|
+
*/
|
|
136
|
+
async function proseLintGate(entries, profile) {
|
|
137
|
+
const lintResult = await (0, mod_js_5.runLint)({ entries, profile });
|
|
138
|
+
return lintResult.diagnostics.map((d) => ({
|
|
139
|
+
code: d.code,
|
|
140
|
+
severity: d.severity,
|
|
141
|
+
message: d.message,
|
|
142
|
+
location: d.location,
|
|
143
|
+
}));
|
|
144
|
+
}
|
package/script/lint/runner.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* suppression hygiene on all Authored entries, applies suppression, and
|
|
7
7
|
* returns the final diagnostics.
|
|
8
8
|
*/
|
|
9
|
-
import type { Entry } from "../model/mod.js";
|
|
9
|
+
import type { EffectiveProfile, Entry } from "../model/mod.js";
|
|
10
10
|
import type { LintDiagnostic } from "./types.js";
|
|
11
11
|
import type { FileReader } from "./glossary.js";
|
|
12
12
|
import type { ScoreRollup } from "./score.js";
|
|
@@ -16,10 +16,23 @@ import type { ScoreRollup } from "./score.js";
|
|
|
16
16
|
* In-scope: Authored shape AND resolved core type is Specification or
|
|
17
17
|
* a direct subtype (Requirement, Test, Contract, Record, Risk).
|
|
18
18
|
* Reference-shape entries are always excluded.
|
|
19
|
+
*
|
|
20
|
+
* `profile` is threaded into {@linkcode resolvedCoreType} so an entry
|
|
21
|
+
* classified purely by a profile type (via `Type:` or a profile
|
|
22
|
+
* display-id pattern, e.g. `platform-component`) resolves to its core
|
|
23
|
+
* ancestor through the profile's `extends:` chain. Without it (#675),
|
|
24
|
+
* such entries never enter prose scope and are silently skipped.
|
|
19
25
|
*/
|
|
20
|
-
export declare function isProseScope(entry: Entry): boolean;
|
|
26
|
+
export declare function isProseScope(entry: Entry, profile?: EffectiveProfile): boolean;
|
|
21
27
|
export interface LintOptions {
|
|
22
28
|
readonly entries: readonly Entry[];
|
|
29
|
+
/**
|
|
30
|
+
* Active profile, threaded into {@linkcode isProseScope} so entries
|
|
31
|
+
* classified purely by a profile type enter prose scope (#675). Optional:
|
|
32
|
+
* callers with no profile (e.g. file-local prose scoring) pass nothing and
|
|
33
|
+
* only core-resolvable types are scoped.
|
|
34
|
+
*/
|
|
35
|
+
readonly profile?: EffectiveProfile;
|
|
23
36
|
/** Profile-extended capitalized-allow lexicon. Defaults to core baseline. */
|
|
24
37
|
readonly capitalizedAllow?: ReadonlySet<string>;
|
|
25
38
|
/** Glossary file paths discovered by the listing-directive validator. */
|
|
@@ -34,8 +47,18 @@ export interface LintResult {
|
|
|
34
47
|
/**
|
|
35
48
|
* Run the lint pipeline on a set of entries.
|
|
36
49
|
*
|
|
50
|
+
* Corpus handling (ADR-030 §D4): the glossary and `$Identifier` indexes are
|
|
51
|
+
* built from the FULL `entries` set — including delivered-corpus entries — so a
|
|
52
|
+
* term or `$Identifier` defined only in a corpus document still silences Q500
|
|
53
|
+
* in project prose (the additive-enrichment invariant). Prose *diagnostics*,
|
|
54
|
+
* suppression hygiene, and the score roll-up run only on project entries
|
|
55
|
+
* (`entry.origin === undefined`): a consumer cannot fix an upstream profile's
|
|
56
|
+
* prose, so corpus findings are never emitted and never skew the score. Callers
|
|
57
|
+
* therefore pass the merged project + corpus set, not a pre-filtered one.
|
|
58
|
+
*
|
|
37
59
|
* Pipeline:
|
|
38
|
-
* 1. Filter to in-scope entries (Specification subtypes, Authored shape
|
|
60
|
+
* 1. Filter to in-scope entries (Specification subtypes, Authored shape,
|
|
61
|
+
* non-corpus).
|
|
39
62
|
* 2. Build glossary index from DefinitionList nodes and glossary files.
|
|
40
63
|
* 3. Run lexicon rules on each in-scope entry's prose blocks.
|
|
41
64
|
* 4. Run structural rules on each in-scope entry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lint/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lint/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAUjD,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,eAAe,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAgB9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAKT;AAMD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA0FvE"}
|
package/script/lint/runner.js
CHANGED
|
@@ -42,11 +42,17 @@ function isSpecificationDescendant(typeName) {
|
|
|
42
42
|
* In-scope: Authored shape AND resolved core type is Specification or
|
|
43
43
|
* a direct subtype (Requirement, Test, Contract, Record, Risk).
|
|
44
44
|
* Reference-shape entries are always excluded.
|
|
45
|
+
*
|
|
46
|
+
* `profile` is threaded into {@linkcode resolvedCoreType} so an entry
|
|
47
|
+
* classified purely by a profile type (via `Type:` or a profile
|
|
48
|
+
* display-id pattern, e.g. `platform-component`) resolves to its core
|
|
49
|
+
* ancestor through the profile's `extends:` chain. Without it (#675),
|
|
50
|
+
* such entries never enter prose scope and are silently skipped.
|
|
45
51
|
*/
|
|
46
|
-
function isProseScope(entry) {
|
|
52
|
+
function isProseScope(entry, profile) {
|
|
47
53
|
if (entry.shape === "Reference")
|
|
48
54
|
return false;
|
|
49
|
-
const coreType = (0, type_resolution_js_1.resolvedCoreType)(entry);
|
|
55
|
+
const coreType = (0, type_resolution_js_1.resolvedCoreType)(entry, profile);
|
|
50
56
|
if (!coreType)
|
|
51
57
|
return false;
|
|
52
58
|
return isSpecificationDescendant(coreType);
|
|
@@ -69,8 +75,18 @@ function disabledCodes(entry) {
|
|
|
69
75
|
/**
|
|
70
76
|
* Run the lint pipeline on a set of entries.
|
|
71
77
|
*
|
|
78
|
+
* Corpus handling (ADR-030 §D4): the glossary and `$Identifier` indexes are
|
|
79
|
+
* built from the FULL `entries` set — including delivered-corpus entries — so a
|
|
80
|
+
* term or `$Identifier` defined only in a corpus document still silences Q500
|
|
81
|
+
* in project prose (the additive-enrichment invariant). Prose *diagnostics*,
|
|
82
|
+
* suppression hygiene, and the score roll-up run only on project entries
|
|
83
|
+
* (`entry.origin === undefined`): a consumer cannot fix an upstream profile's
|
|
84
|
+
* prose, so corpus findings are never emitted and never skew the score. Callers
|
|
85
|
+
* therefore pass the merged project + corpus set, not a pre-filtered one.
|
|
86
|
+
*
|
|
72
87
|
* Pipeline:
|
|
73
|
-
* 1. Filter to in-scope entries (Specification subtypes, Authored shape
|
|
88
|
+
* 1. Filter to in-scope entries (Specification subtypes, Authored shape,
|
|
89
|
+
* non-corpus).
|
|
74
90
|
* 2. Build glossary index from DefinitionList nodes and glossary files.
|
|
75
91
|
* 3. Run lexicon rules on each in-scope entry's prose blocks.
|
|
76
92
|
* 4. Run structural rules on each in-scope entry.
|
|
@@ -91,18 +107,25 @@ function disabledCodes(entry) {
|
|
|
91
107
|
* 14. Return diagnostics and score.
|
|
92
108
|
*/
|
|
93
109
|
async function runLint(options) {
|
|
94
|
-
const { entries } = options;
|
|
110
|
+
const { entries, profile } = options;
|
|
95
111
|
const allow = options.capitalizedAllow ?? (0, mod_js_2.loadLexicon)("capitalized-allow");
|
|
112
|
+
// Glossary + $Identifier indexes see the FULL entry set (corpus included) so
|
|
113
|
+
// corpus-defined terms/identifiers silence Q500 additively (ADR-030 §D4).
|
|
96
114
|
const glossary = await (0, glossary_js_1.buildGlossaryIndex)(entries, options.readFile ?? (() => Promise.resolve(undefined)), options.glossaryFilePaths ?? []);
|
|
97
115
|
// Corpus-scan resolver leg (issue #502, ADR-021 Decision 1). Built once
|
|
98
116
|
// per invocation; reused across every in-scope entry. Honors the
|
|
99
117
|
// additive-enrichment invariant — Q500 fires *less* as the resolver
|
|
100
118
|
// grows, never *more*.
|
|
101
119
|
const isIdHook = (0, xref_js_1.buildIsIdentifierHook)((0, xref_js_1.buildIdentifierIndex)(entries));
|
|
102
|
-
// Steps 1–9: collect diagnostics keyed by entry
|
|
120
|
+
// Steps 1–9: collect diagnostics keyed by entry. Delivered-corpus entries
|
|
121
|
+
// (`entry.origin`) are excluded from rule execution — a consumer cannot fix
|
|
122
|
+
// upstream prose (ADR-030 §D4) — even though they contribute to the indexes
|
|
123
|
+
// above.
|
|
103
124
|
const inScopeDiags = new Map();
|
|
104
125
|
for (const entry of entries) {
|
|
105
|
-
if (
|
|
126
|
+
if (entry.origin)
|
|
127
|
+
continue;
|
|
128
|
+
if (!isProseScope(entry, profile))
|
|
106
129
|
continue;
|
|
107
130
|
const diags = [];
|
|
108
131
|
// Step 3: lexicon rules
|
|
@@ -121,11 +144,15 @@ async function runLint(options) {
|
|
|
121
144
|
diags.push(...(0, passive_js_1.runPassiveRules)(entry));
|
|
122
145
|
inScopeDiags.set(entry, diags);
|
|
123
146
|
}
|
|
124
|
-
// Step 10: suppression hygiene on all Authored entries
|
|
147
|
+
// Step 10: suppression hygiene on all Authored project entries. Corpus
|
|
148
|
+
// entries are skipped for the same reason as rule execution — hygiene
|
|
149
|
+
// findings located in a corpus file are unfixable by the consumer.
|
|
125
150
|
const hygieneDiags = [];
|
|
126
151
|
for (const entry of entries) {
|
|
127
152
|
if (entry.shape !== "Authored")
|
|
128
153
|
continue;
|
|
154
|
+
if (entry.origin)
|
|
155
|
+
continue;
|
|
129
156
|
hygieneDiags.push(...(0, suppression_js_1.runSuppressionRules)(entry));
|
|
130
157
|
}
|
|
131
158
|
// Step 11: apply suppression to in-scope diagnostics; track matched codes
|
|
@@ -155,7 +182,10 @@ async function runLint(options) {
|
|
|
155
182
|
}
|
|
156
183
|
// Append hygiene diagnostics (Q900/Q901 — never suppressed)
|
|
157
184
|
out.push(...hygieneDiags);
|
|
158
|
-
// Step 13: compute score roll-up across
|
|
159
|
-
|
|
185
|
+
// Step 13: compute score roll-up across project entries (including 0-score
|
|
186
|
+
// ones). Corpus entries are excluded — counting them would skew band-counts
|
|
187
|
+
// and the mean on prose a consumer cannot act on (ADR-030 §D4). A no-op when
|
|
188
|
+
// no corpus is present.
|
|
189
|
+
const score = (0, score_js_1.computeScoreRollup)(out, entries.filter((e) => !e.origin));
|
|
160
190
|
return { diagnostics: out, score };
|
|
161
191
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/edge_drift
|
|
3
|
+
*
|
|
4
|
+
* Offline traceability edge-drift detection: compare the current project
|
|
5
|
+
* graph's canonical edge hash against a lockfile's generated-cache. Pure,
|
|
6
|
+
* offline (no upstream resolution) — the single source of truth shared by
|
|
7
|
+
* `check`'s MSL-L212 gate and `doctor`'s lock-drift health check so the two
|
|
8
|
+
* can never disagree on what "drift" means.
|
|
9
|
+
*/
|
|
10
|
+
import type { Entry } from "../model/mod.js";
|
|
11
|
+
import type { GeneratedCache } from "./model.js";
|
|
12
|
+
/** Result of the offline (no-network) edge-hash drift comparison. */
|
|
13
|
+
export interface OfflineEdgeDrift {
|
|
14
|
+
/** True when the current canonical edge hash differs from the lockfile. */
|
|
15
|
+
readonly drifted: boolean;
|
|
16
|
+
/** Edge count recorded in the lockfile's generated-cache. */
|
|
17
|
+
readonly lockedCount: number;
|
|
18
|
+
/** Edge count in the current project graph. */
|
|
19
|
+
readonly currentCount: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Compare the current project graph's canonical edge hash against a
|
|
23
|
+
* lockfile's generated-cache. Offline by design — no upstream resolution.
|
|
24
|
+
*
|
|
25
|
+
* `projectEntries` MUST already exclude delivered-corpus entries (ADR-030
|
|
26
|
+
* corpus-blindness); the caller filters `!e.origin`, mirroring how
|
|
27
|
+
* `markspec lock` and `check`'s MSL-L212 gate count only project-owned
|
|
28
|
+
* edges.
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectOfflineEdgeDrift(projectEntries: readonly Entry[], cache: GeneratedCache): Promise<OfflineEdgeDrift>;
|
|
31
|
+
//# sourceMappingURL=edge_drift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge_drift.d.ts","sourceRoot":"","sources":["../../src/lock/edge_drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,cAAc,EAAE,SAAS,KAAK,EAAE,EAChC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/lock/edge_drift
|
|
4
|
+
*
|
|
5
|
+
* Offline traceability edge-drift detection: compare the current project
|
|
6
|
+
* graph's canonical edge hash against a lockfile's generated-cache. Pure,
|
|
7
|
+
* offline (no upstream resolution) — the single source of truth shared by
|
|
8
|
+
* `check`'s MSL-L212 gate and `doctor`'s lock-drift health check so the two
|
|
9
|
+
* can never disagree on what "drift" means.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.detectOfflineEdgeDrift = detectOfflineEdgeDrift;
|
|
13
|
+
const resolve_js_1 = require("./resolve.js");
|
|
14
|
+
const canonical_edges_js_1 = require("./canonical_edges.js");
|
|
15
|
+
/**
|
|
16
|
+
* Compare the current project graph's canonical edge hash against a
|
|
17
|
+
* lockfile's generated-cache. Offline by design — no upstream resolution.
|
|
18
|
+
*
|
|
19
|
+
* `projectEntries` MUST already exclude delivered-corpus entries (ADR-030
|
|
20
|
+
* corpus-blindness); the caller filters `!e.origin`, mirroring how
|
|
21
|
+
* `markspec lock` and `check`'s MSL-L212 gate count only project-owned
|
|
22
|
+
* edges.
|
|
23
|
+
*/
|
|
24
|
+
async function detectOfflineEdgeDrift(projectEntries, cache) {
|
|
25
|
+
const quads = (0, resolve_js_1.extractEdgeQuads)(projectEntries);
|
|
26
|
+
const currentHash = await (0, canonical_edges_js_1.hashCanonicalEdges)(quads);
|
|
27
|
+
return {
|
|
28
|
+
drifted: cache.edgesHash !== currentHash,
|
|
29
|
+
lockedCount: cache.edgesCount,
|
|
30
|
+
currentCount: quads.length,
|
|
31
|
+
};
|
|
32
|
+
}
|
package/script/lock/mod.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export { checkDrift } from "./check.js";
|
|
|
15
15
|
export { sha256Bytes, sha256String } from "./hash.js";
|
|
16
16
|
export { canonicalEdgeJson, hashCanonicalEdges } from "./canonical_edges.js";
|
|
17
17
|
export type { EdgeQuad } from "./canonical_edges.js";
|
|
18
|
+
export { detectOfflineEdgeDrift } from "./edge_drift.js";
|
|
19
|
+
export type { OfflineEdgeDrift } from "./edge_drift.js";
|
|
18
20
|
export { extractEdgeLedger, extractEdgeQuads, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, } from "./resolve.js";
|
|
19
21
|
export type { FetchUrl, ReadFile, ResolvedBoundEntry, ResolvedProfile, ResolvedReference, ResolvedRegistry, ResolvedUpstreams, ResolveUpstreamsOptions, } from "./resolve.js";
|
|
20
22
|
//# sourceMappingURL=mod.d.ts.map
|
package/script/lock/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/lock/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,kBAAk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MAAM,cAAc,CAAC"}
|
package/script/lock/mod.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* for both `markspec lock` and `markspec compile --frozen`.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.resolveUpstreams = exports.resolveRegistries = exports.resolveReferences = exports.resolveProfileChain = exports.resolveBoundEntries = exports.extractEdgeQuads = exports.extractEdgeLedger = exports.hashCanonicalEdges = exports.canonicalEdgeJson = exports.sha256String = exports.sha256Bytes = exports.checkDrift = exports.isBelowFloor = exports.parseLockfile = exports.serializeLockfile = exports.LOCKFILE_SCHEMA_VERSION = void 0;
|
|
10
|
+
exports.resolveUpstreams = exports.resolveRegistries = exports.resolveReferences = exports.resolveProfileChain = exports.resolveBoundEntries = exports.extractEdgeQuads = exports.extractEdgeLedger = exports.detectOfflineEdgeDrift = exports.hashCanonicalEdges = exports.canonicalEdgeJson = exports.sha256String = exports.sha256Bytes = exports.checkDrift = exports.isBelowFloor = exports.parseLockfile = exports.serializeLockfile = exports.LOCKFILE_SCHEMA_VERSION = void 0;
|
|
11
11
|
var model_js_1 = require("./model.js");
|
|
12
12
|
Object.defineProperty(exports, "LOCKFILE_SCHEMA_VERSION", { enumerable: true, get: function () { return model_js_1.LOCKFILE_SCHEMA_VERSION; } });
|
|
13
13
|
var serializer_js_1 = require("./serializer.js");
|
|
@@ -24,6 +24,8 @@ Object.defineProperty(exports, "sha256String", { enumerable: true, get: function
|
|
|
24
24
|
var canonical_edges_js_1 = require("./canonical_edges.js");
|
|
25
25
|
Object.defineProperty(exports, "canonicalEdgeJson", { enumerable: true, get: function () { return canonical_edges_js_1.canonicalEdgeJson; } });
|
|
26
26
|
Object.defineProperty(exports, "hashCanonicalEdges", { enumerable: true, get: function () { return canonical_edges_js_1.hashCanonicalEdges; } });
|
|
27
|
+
var edge_drift_js_1 = require("./edge_drift.js");
|
|
28
|
+
Object.defineProperty(exports, "detectOfflineEdgeDrift", { enumerable: true, get: function () { return edge_drift_js_1.detectOfflineEdgeDrift; } });
|
|
27
29
|
var resolve_js_1 = require("./resolve.js");
|
|
28
30
|
Object.defineProperty(exports, "extractEdgeLedger", { enumerable: true, get: function () { return resolve_js_1.extractEdgeLedger; } });
|
|
29
31
|
Object.defineProperty(exports, "extractEdgeQuads", { enumerable: true, get: function () { return resolve_js_1.extractEdgeQuads; } });
|
package/script/mod.d.ts
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* from core/mod.ts, never from internal paths.
|
|
9
9
|
*/
|
|
10
10
|
import "./_dnt.polyfills.js";
|
|
11
|
-
export declare const VERSION = "0.
|
|
11
|
+
export declare const VERSION = "0.10.2";
|
|
12
12
|
export declare const CORE_SCHEMA_VERSION = 1;
|
|
13
|
-
export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, DEFAULT_PROJECT_CONFIG, descendantsOf, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
|
|
14
|
-
export type { Attribute, BodyToken, BodyTokenKind, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, Diagnostic, Directive, Discipline, DisciplineRegistry, DisplayId, EarsTrigger, EffectiveProfile, EffectiveTypeDef, EntityRefConvention, Entry, EntryShape, EntrySource, ExtractorRule, InlineRef, KindDecl, LabelConcern, LabelConcernKind, LabelValue, Link, LinkKind, LoadedProfile, ModalCase, PaletteHue, ProfileChain, ProfileConvention, ProjectConfig, ProvenancedMap, ProvenancedMapEntry, ProvenancedValue, RelationDef, Severity, SourceLocation, Ulid, } from "./model/mod.js";
|
|
13
|
+
export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, DEFAULT_PROJECT_CONFIG, descendantsOf, formatEntryOrigin, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
|
|
14
|
+
export type { Attribute, BodyToken, BodyTokenKind, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, DeliveredDocument, Diagnostic, Directive, Discipline, DisciplineRegistry, DisplayId, EarsTrigger, EffectiveProfile, EffectiveTypeDef, EntityRefConvention, Entry, EntryOrigin, EntryShape, EntrySource, ExtractorRule, InlineRef, KindDecl, LabelConcern, LabelConcernKind, LabelValue, Link, LinkKind, LoadedProfile, ModalCase, PaletteHue, ProfileChain, ProfileConvention, ProjectConfig, ProvenancedMap, ProvenancedMapEntry, ProvenancedValue, RelationDef, Severity, SourceLocation, Ulid, } from "./model/mod.js";
|
|
15
15
|
export { astEquivalent } from "./ast/equivalence.js";
|
|
16
16
|
export { normalizeBodyAst } from "./ast/normalize.js";
|
|
17
17
|
export { render } from "./ast/render.js";
|
|
@@ -29,12 +29,16 @@ export type { DisplayIdPatternShape, DisplayIdPatternValidation, } from "./profi
|
|
|
29
29
|
export { entryMatchesTargets, filterEntriesByTraceTargets, targetsForRelation, } from "./profile/mod.js";
|
|
30
30
|
export { buildProfileIntrospection } from "./profile/mod.js";
|
|
31
31
|
export type { AttributeDetail, ConventionDetail, LabelConcernDetail, ProfileElementDetail, ProfileElementKind, ProfileElementRef, ProfileIntrospection, ProfileOverview, ProvenancedDescription, RelationDetail, TypeDetail, } from "./profile/mod.js";
|
|
32
|
+
export { buildCorpusIndex, corpusOriginLabel, deliveredPathIsContained, loadDeliveredCorpus, } from "./profile/delivered.js";
|
|
33
|
+
export type { LoadDeliveredCorpusResult, RealPath, } from "./profile/delivered.js";
|
|
32
34
|
export { detectCaptions, detectDirectives, detectInlineRefs, isSupportedExtension, loadGrammar, parse, parseFile, parseSource, } from "./parser/mod.js";
|
|
33
35
|
export type { DetectCaptionsOptions, DetectDirectivesOptions, DetectInlineRefsOptions, DocCommentBlockMeta, LanguageDocCommentSpec, LineMap, ParseFileResult, ParseOptions, ParseSourceOptions, ParseSourceResult, SupportedLanguage, } from "./parser/mod.js";
|
|
34
36
|
export { format } from "./formatter/mod.js";
|
|
35
37
|
export type { FormatOptions, FormatResult } from "./formatter/mod.js";
|
|
36
|
-
export {
|
|
37
|
-
export type {
|
|
38
|
+
export { loadMarkdownFormatter, MARKSPEC_MARKDOWN_GLOBAL_CONFIG, MARKSPEC_MARKDOWN_PLUGIN_CONFIG, } from "./formatter/dprint.js";
|
|
39
|
+
export type { ProseFormatOptions, ProseFormatter } from "./formatter/dprint.js";
|
|
40
|
+
export { attributeCorpusDiagnostics, classifyEntriesStage, classifyEntry, compileDisplayIdPattern, detectCorpusCollisions, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, suppressDeclaredAttrR010, validate, validateAttributesForEntry, validateListingDocuments, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
|
|
41
|
+
export type { ClassifyResult, ClassifyStageResult, CorpusCollisionResult, EffectiveAttrScope, ListingFileContext, ListingKind, PipelineOptions, PipelineResult, ValidateResult, ValueValidator, } from "./validator/mod.js";
|
|
38
42
|
export { compile, generateInverses, serializeCompileResult, } from "./compiler/mod.js";
|
|
39
43
|
export type { CompileOptions, CompileResult, GenerateInversesResult, SerializedCompileResult, SerializedEntry, SerializedTypeRegistry, } from "./compiler/mod.js";
|
|
40
44
|
export { buildManifest } from "./compiler/manifest.js";
|
|
@@ -46,13 +50,18 @@ export type { ReportFormat, ReportKind, ReportOptions, } from "./reporter/mod.js
|
|
|
46
50
|
export { ANTI_PATTERN_NOTE, computeScoreRollup, isProseScope, runLint, } from "./lint/mod.js";
|
|
47
51
|
export type { EntryScore, LintDiagnostic, LintOptions, LintResult, RuleContribution, ScoreRollup, } from "./lint/mod.js";
|
|
48
52
|
export * as typl from "./typl/mod.js";
|
|
49
|
-
export { canonicalEdgeJson, checkDrift, extractEdgeLedger, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
|
|
50
|
-
export type { BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, EdgeQuad, FetchUrl, GeneratedCache, LockedAttributes, LockEdge, Lockfile, LockfileMeta, LockfileToolchain, ParseLockfileResult, ReadFile as LockReadFile, ResolvedBoundEntry, ResolvedProfile, ResolvedReference, ResolvedRegistry, ResolvedUpstreams, ResolveUpstreamsOptions, Upstream, UpstreamProfile, UpstreamReference, UpstreamRegistry, } from "./lock/mod.js";
|
|
53
|
+
export { canonicalEdgeJson, checkDrift, detectOfflineEdgeDrift, extractEdgeLedger, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
|
|
54
|
+
export type { BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, EdgeQuad, FetchUrl, GeneratedCache, LockedAttributes, LockEdge, Lockfile, LockfileMeta, LockfileToolchain, OfflineEdgeDrift, ParseLockfileResult, ReadFile as LockReadFile, ResolvedBoundEntry, ResolvedProfile, ResolvedReference, ResolvedRegistry, ResolvedUpstreams, ResolveUpstreamsOptions, Upstream, UpstreamProfile, UpstreamReference, UpstreamRegistry, } from "./lock/mod.js";
|
|
51
55
|
export { buildRefIndex, canonicalizeRefs, TRACE_ATTRIBUTE_KEYS, } from "./refs/mod.js";
|
|
52
56
|
export type { RefIndex } from "./refs/mod.js";
|
|
57
|
+
export { fmtDriftGate, lockfileDriftGate, proseLintGate } from "./gates/mod.js";
|
|
58
|
+
export { FENCE_RE, isLineFenced, walkProseLines } from "./util/fence.js";
|
|
59
|
+
export type { ProseLineCallback } from "./util/fence.js";
|
|
53
60
|
export { aggregateStatusByState, encodeLogLine, inferLockedAttributes, parseLogLine, parseMapping, validateMappings, } from "./sync/mod.js";
|
|
54
61
|
export type { AttributeMapping, BoundEntryStatus, ConflictPolicy, Direction as SyncDirection, Mapping, ParseMappingResult, RemoteState, SyncLogEntry, } from "./sync/mod.js";
|
|
55
62
|
export { type Arch as SelfUpgradeArch, assertTrustedReleaseUrl, classifyInstallPath, type ClassifyResult as SelfUpgradeClassifyResult, compareVersions, type Comparison, DEFAULT_RELEASES_API, DEFAULT_RELEASES_DOWNLOAD_BASE, detectTarget, type InstallSource, type Os as SelfUpgradeOs, parseSha256Line, type Platform as SelfUpgradePlatform, platformFromBuild, type ReleaseAssets, releaseAssets, type ReleaseEndpoints, type ResolveEndpointsInput, resolveReleaseEndpoints, type Target as SelfUpgradeTarget, } from "./self_upgrade/mod.js";
|
|
56
63
|
export { discoverFiles, isIgnored, MARKDOWN_EXTENSIONS, parseGitignore, RELEVANT_EXTENSIONS, SOURCE_EXTENSIONS, } from "./discovery/mod.js";
|
|
57
64
|
export type { DiscoverOptions, DiscoveryDirEntry, DiscoveryIO, GitignoreRule, } from "./discovery/mod.js";
|
|
65
|
+
export { collectProjectEntries } from "./collect/mod.js";
|
|
66
|
+
export type { CollectOptions } from "./collect/mod.js";
|
|
58
67
|
//# sourceMappingURL=mod.d.ts.map
|
package/script/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,WAAW,CAAC;AAChC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,UAAU,EACV,cAAc,EACd,sBAAs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