@sdd-method/sdd-cli 0.61.1 → 0.63.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/dist/lib/catalogue/builders/adrs.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/adrs.js +8 -2
- package/dist/lib/catalogue/builders/adrs.js.map +1 -1
- package/dist/lib/catalogue/canonical-schema.yaml +14 -3
- package/dist/lib/pack/builder.d.ts +16 -0
- package/dist/lib/pack/builder.d.ts.map +1 -1
- package/dist/lib/pack/builder.js +28 -5
- package/dist/lib/pack/builder.js.map +1 -1
- package/dist/lib/pack/index.d.ts +15 -0
- package/dist/lib/pack/index.d.ts.map +1 -1
- package/dist/lib/pack/index.js +8 -0
- package/dist/lib/pack/index.js.map +1 -1
- package/dist/lib/pack/publish-transform.d.ts +80 -0
- package/dist/lib/pack/publish-transform.d.ts.map +1 -0
- package/dist/lib/pack/publish-transform.js +243 -0
- package/dist/lib/pack/publish-transform.js.map +1 -0
- package/dist/lib/sync/bundle-source.d.ts +34 -0
- package/dist/lib/sync/bundle-source.d.ts.map +1 -0
- package/dist/lib/sync/bundle-source.js +61 -0
- package/dist/lib/sync/bundle-source.js.map +1 -0
- package/dist/lib/sync/config.d.ts +40 -10
- package/dist/lib/sync/config.d.ts.map +1 -1
- package/dist/lib/sync/config.js +39 -7
- package/dist/lib/sync/config.js.map +1 -1
- package/dist/verbs/pack.d.ts.map +1 -1
- package/dist/verbs/pack.js +4 -0
- package/dist/verbs/pack.js.map +1 -1
- package/dist/verbs/sync.d.ts.map +1 -1
- package/dist/verbs/sync.js +22 -10
- package/dist/verbs/sync.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Publish transform (sdd-method ADR 0183 / 0184). Produces the point-in-time,
|
|
5
|
+
* producer-agnostic *published* form of method markdown by subtraction from the
|
|
6
|
+
* canon, and gates the result with a fail-closed deny-class lint.
|
|
7
|
+
*
|
|
8
|
+
* The strip is a pure structural transform — it removes marked structures and
|
|
9
|
+
* never reads meaning, so it cannot misinterpret. The lint runs on the produced
|
|
10
|
+
* output and proves nothing leaked; it never decides what to strip. Authors
|
|
11
|
+
* carry the burden of placing evolution / producer content in the structured
|
|
12
|
+
* places (lineage regions, stripped fields), enforced at author/CI time.
|
|
13
|
+
*
|
|
14
|
+
* Enabled only for method-baseline builds (BuildOptions.publishTransform);
|
|
15
|
+
* adopter-pack builds are unaffected.
|
|
16
|
+
*/
|
|
17
|
+
// Header fields stripped on publish (ADR 0184 — adr-metadata-schema.md).
|
|
18
|
+
const STRIPPED_FIELDS = [
|
|
19
|
+
"Status History",
|
|
20
|
+
"Acceptance Rationale",
|
|
21
|
+
"Supersedes",
|
|
22
|
+
"Superseded By",
|
|
23
|
+
"Amends",
|
|
24
|
+
"Source",
|
|
25
|
+
"Grounding",
|
|
26
|
+
"Introduced In",
|
|
27
|
+
];
|
|
28
|
+
const STRIPPED_FIELD_RE = new RegExp(`^\\* \\*\\*(${STRIPPED_FIELDS.join("|")}):\\*\\*`);
|
|
29
|
+
const LINEAGE_START = "<!-- lineage:start -->";
|
|
30
|
+
const LINEAGE_END = "<!-- lineage:end -->";
|
|
31
|
+
// Published-surface deny-classes. Kept in lock-step with the reference gate in
|
|
32
|
+
// sdd-method orchestration/scripts/validate-adr-structure.sh (--publish-lint).
|
|
33
|
+
// A line carrying `pit-ok` is exempt; a file carrying `pit-ok-file` is exempt
|
|
34
|
+
// wholesale (a meta/versioning ADR whose deny-vocabulary IS its subject).
|
|
35
|
+
const DENY_TEMPORAL = [
|
|
36
|
+
/since retired/i,
|
|
37
|
+
/previously/i,
|
|
38
|
+
/formerly/i,
|
|
39
|
+
/supersed/i,
|
|
40
|
+
/no longer/i,
|
|
41
|
+
/pre-federation/i,
|
|
42
|
+
/used to/i,
|
|
43
|
+
/bumps? to/i,
|
|
44
|
+
/sdd-cli [0-9]/i,
|
|
45
|
+
/\bv[0-9]+\.[0-9]+\.[0-9]+/i,
|
|
46
|
+
];
|
|
47
|
+
const DENY_PRODUCER = [
|
|
48
|
+
/sdd-method#/i,
|
|
49
|
+
/sdd-method-gov/i,
|
|
50
|
+
/sdd-method repo/i,
|
|
51
|
+
/the method repo/i,
|
|
52
|
+
/governance repo/i,
|
|
53
|
+
/synced from (sdd-method|the method)/i,
|
|
54
|
+
/bootstrap.?procedure/i,
|
|
55
|
+
];
|
|
56
|
+
/** True when the markdown is an ADR with `Status: Accepted`. */
|
|
57
|
+
export function isAccepted(content) {
|
|
58
|
+
const m = content.match(/^\*\s+\*\*Status:\*\*\s*([A-Za-z]+)/m);
|
|
59
|
+
return m?.[1] === "Accepted";
|
|
60
|
+
}
|
|
61
|
+
/** Path is an ADR file (under an `adr/` or `platform-adr/` dir). */
|
|
62
|
+
export function isAdrPath(relPath) {
|
|
63
|
+
return /adr\/ADR \d/i.test(relPath);
|
|
64
|
+
}
|
|
65
|
+
/** Remove lineage regions + stripped-class header fields. Deterministic. */
|
|
66
|
+
export function stripStructures(content) {
|
|
67
|
+
const out = [];
|
|
68
|
+
let inLineage = false;
|
|
69
|
+
for (const line of content.split("\n")) {
|
|
70
|
+
if (line.includes(LINEAGE_START)) {
|
|
71
|
+
inLineage = true;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (line.includes(LINEAGE_END)) {
|
|
75
|
+
inLineage = false;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (inLineage)
|
|
79
|
+
continue;
|
|
80
|
+
if (STRIPPED_FIELD_RE.test(line))
|
|
81
|
+
continue;
|
|
82
|
+
out.push(line);
|
|
83
|
+
}
|
|
84
|
+
return out.join("\n");
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Flatten cross-repo references to the bare in-namespace form: the published
|
|
88
|
+
* method is one namespace, so `<repo>#<id>` becomes `ADR <id>` (ADR 0184 §4.3).
|
|
89
|
+
*/
|
|
90
|
+
export function flattenCrossRefs(content) {
|
|
91
|
+
return content.replace(/\bsdd-method#(\d{3,4})\b/g, "ADR $1");
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Prefix bare in-namespace `ADR NNNN` refs with the `M-ADR` origin prefix
|
|
95
|
+
* (ADR 0140 §4.1). The `(?<![\w-])` guard means a ref already prefixed
|
|
96
|
+
* (`M-ADR`, `RA-ADR`) is left untouched — the `-` before `ADR` fails the
|
|
97
|
+
* lookbehind — so the rewrite is idempotent and never disturbs another
|
|
98
|
+
* origin's namespace.
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* The origin prefix for an ADR number, by band (ADR 0140 §4.1): `0001–0999`
|
|
102
|
+
* is the method (`M-ADR`), `9000–9999` is the reference architecture
|
|
103
|
+
* (`RA-ADR`). Adopter-authored numbers (`1000–8999`) keep the bare `ADR` and
|
|
104
|
+
* are returned null. Range-aware prefixing is what lets a ref-arch document
|
|
105
|
+
* cite a method ADR — a flattened `sdd-method#0174` becomes `M-ADR 0174`, not
|
|
106
|
+
* `RA-ADR 0174` — and keeps the method correct should it ever cite a `9NNN`.
|
|
107
|
+
*/
|
|
108
|
+
export function originPrefixForNumber(num) {
|
|
109
|
+
if (/^0\d{3}$/.test(num))
|
|
110
|
+
return "M-ADR";
|
|
111
|
+
if (/^9\d{3}$/.test(num))
|
|
112
|
+
return "RA-ADR";
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Rewrite bare in-namespace `ADR NNNN` refs to their origin prefix, by number
|
|
117
|
+
* band. Matches both the prose form ("ADR 0140") and the URL-encoded
|
|
118
|
+
* link-target form ("ADR%200140"), separator preserved, so renamed files and
|
|
119
|
+
* the hrefs that point to them stay in lock-step. The lookbehind leaves an
|
|
120
|
+
* already-prefixed `M-ADR` / `RA-ADR` untouched (idempotent).
|
|
121
|
+
*/
|
|
122
|
+
export function applyOriginPrefix(content) {
|
|
123
|
+
return content.replace(/(?<![\w-])ADR(%20| )(\d{3,4})(?!\d)/g, (m, sep, num) => {
|
|
124
|
+
const p = originPrefixForNumber(num);
|
|
125
|
+
return p ? `${p}${sep}${num}` : m;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/** @deprecated Back-compat alias — origin prefixing is now range-aware. */
|
|
129
|
+
export const applyMAdrPrefix = applyOriginPrefix;
|
|
130
|
+
/**
|
|
131
|
+
* The published filename for an ADR under the M-ADR rename: the *basename*
|
|
132
|
+
* `ADR NNNN…` becomes `M-ADR NNNN…`. The containing directory (e.g.
|
|
133
|
+
* `docs/method/adr/`, `platform-adr/`) is never touched — only the leading
|
|
134
|
+
* `ADR ` of the filename. Returns the path unchanged when it is not an
|
|
135
|
+
* `ADR NNNN` file. Idempotent: an already-`M-ADR`/`RA-ADR` name is left alone.
|
|
136
|
+
*/
|
|
137
|
+
export function mAdrFilename(relPath) {
|
|
138
|
+
return relPath.replace(/(^|\/)ADR (\d{3,4})/, (m, pre, num) => {
|
|
139
|
+
const p = originPrefixForNumber(num);
|
|
140
|
+
return p ? `${pre}${p} ${num}` : m;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** The full published form of a markdown document. */
|
|
144
|
+
export function transformPublished(content, opts = {}) {
|
|
145
|
+
let c = stripStructures(content);
|
|
146
|
+
c = flattenCrossRefs(c);
|
|
147
|
+
if (opts.mAdrPrefix)
|
|
148
|
+
c = applyMAdrPrefix(c);
|
|
149
|
+
return c;
|
|
150
|
+
}
|
|
151
|
+
/** Scan already-published content for deny-class leaks. */
|
|
152
|
+
export function lintPublished(published, relPath) {
|
|
153
|
+
if (published.includes("pit-ok-file"))
|
|
154
|
+
return [];
|
|
155
|
+
const violations = [];
|
|
156
|
+
const lines = published.split("\n");
|
|
157
|
+
lines.forEach((line, i) => {
|
|
158
|
+
if (line.includes("pit-ok"))
|
|
159
|
+
return;
|
|
160
|
+
for (const re of DENY_TEMPORAL) {
|
|
161
|
+
if (re.test(line)) {
|
|
162
|
+
violations.push({
|
|
163
|
+
path: relPath,
|
|
164
|
+
cls: "temporal",
|
|
165
|
+
pattern: re.source,
|
|
166
|
+
line: i + 1,
|
|
167
|
+
text: line.slice(0, 140),
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
for (const re of DENY_PRODUCER) {
|
|
172
|
+
if (re.test(line)) {
|
|
173
|
+
violations.push({
|
|
174
|
+
path: relPath,
|
|
175
|
+
cls: "producer",
|
|
176
|
+
pattern: re.source,
|
|
177
|
+
line: i + 1,
|
|
178
|
+
text: line.slice(0, 140),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return violations;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Apply the publish transform to a staged payload in place: drop non-Accepted
|
|
187
|
+
* ADRs, transform every markdown file to its published form, and lint the
|
|
188
|
+
* result. Returns the retained paths + any violations (caller fails closed).
|
|
189
|
+
*/
|
|
190
|
+
export async function applyPublishTransform(payloadRoot, paths, opts = {}) {
|
|
191
|
+
const keptPaths = [];
|
|
192
|
+
const droppedPaths = [];
|
|
193
|
+
const violations = [];
|
|
194
|
+
for (const p of paths) {
|
|
195
|
+
if (!p.endsWith(".md")) {
|
|
196
|
+
// Non-Markdown config/data (registry.yaml, seed lists, schemas): flatten
|
|
197
|
+
// cross-repo refs so the published config surface is producer-agnostic,
|
|
198
|
+
// and — under the origin-prefix rename — range-prefix bare in-namespace
|
|
199
|
+
// ADR refs so the config matches the renamed decision files. No lineage
|
|
200
|
+
// strip / Accepted filter / file rename applies here. Mirrors the method
|
|
201
|
+
// baseline builder's yaml/yml/txt handling.
|
|
202
|
+
if (/\.(ya?ml|txt)$/.test(p)) {
|
|
203
|
+
const abs = join(payloadRoot, p);
|
|
204
|
+
const content = await readFile(abs, "utf8");
|
|
205
|
+
let rewritten = flattenCrossRefs(content);
|
|
206
|
+
if (opts.mAdrPrefix)
|
|
207
|
+
rewritten = applyOriginPrefix(rewritten);
|
|
208
|
+
if (rewritten !== content)
|
|
209
|
+
await writeFile(abs, rewritten);
|
|
210
|
+
}
|
|
211
|
+
keptPaths.push(p);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
const abs = join(payloadRoot, p);
|
|
215
|
+
const content = await readFile(abs, "utf8");
|
|
216
|
+
// Accepted-only: a non-Accepted ADR is not part of "what the method is".
|
|
217
|
+
if (isAdrPath(p) && !isAccepted(content)) {
|
|
218
|
+
await rm(abs, { force: true });
|
|
219
|
+
droppedPaths.push(p);
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
const published = transformPublished(content, opts);
|
|
223
|
+
violations.push(...lintPublished(published, p));
|
|
224
|
+
if (published !== content) {
|
|
225
|
+
await writeFile(abs, published);
|
|
226
|
+
}
|
|
227
|
+
// Under the M-ADR rename, the published *file* is renamed too so the
|
|
228
|
+
// filename matches its (rewritten) heading. Canon filenames stay `ADR`;
|
|
229
|
+
// this is published-output only. The renamed path is what flows into
|
|
230
|
+
// MANAGED_PATHS + checksums, so the lock + sync stay self-consistent.
|
|
231
|
+
let outPath = p;
|
|
232
|
+
if (opts.mAdrPrefix && isAdrPath(p)) {
|
|
233
|
+
const renamed = mAdrFilename(p);
|
|
234
|
+
if (renamed !== p) {
|
|
235
|
+
await rename(abs, join(payloadRoot, renamed));
|
|
236
|
+
outPath = renamed;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
keptPaths.push(outPath);
|
|
240
|
+
}
|
|
241
|
+
return { keptPaths, droppedPaths, violations };
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=publish-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-transform.js","sourceRoot":"","sources":["../../../src/lib/pack/publish-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SA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,CAAC,CAAC;YAChC,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;gBAClB,MAAM,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC9C,OAAO,GAAG,OAAO,CAAC;YACpB,CAAC;QACH,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SyncConfigBundle } from "./config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a config bundle entry (sdd-method Cut-2 WS-B) to a local tarball
|
|
4
|
+
* path the single-bundle sync engine can apply, regardless of where the
|
|
5
|
+
* bundle lives. A local `source` is used in place; an `https://` source is
|
|
6
|
+
* fetched to a temp file. When the entry carries a `sha256` integrity pin,
|
|
7
|
+
* the materialised tarball is verified against it before it is handed on —
|
|
8
|
+
* the source-agnostic integrity invariant (ADR 0185): the same pin holds
|
|
9
|
+
* across a local tarball, an internal HTTPS mirror, or (later) an OCI
|
|
10
|
+
* registry, so moving the source is configuration, not rework.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: signature verification (cosign) and OCI/GHCR transport are the
|
|
13
|
+
* deferred Phase B of WS-B — they need registry infrastructure that does
|
|
14
|
+
* not exist yet. They slot in here behind the same `source` contract.
|
|
15
|
+
*/
|
|
16
|
+
export interface MaterialisedBundle {
|
|
17
|
+
/** Absolute local path to the tarball, ready for the sync engine. */
|
|
18
|
+
localPath: string;
|
|
19
|
+
/** Release any temp resources (deletes a fetched file; no-op for local). */
|
|
20
|
+
cleanup: () => Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/** Verify a tarball's sha256 against a pin; throw on mismatch. */
|
|
23
|
+
export declare function verifySha256(localPath: string, expected: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Fetch a remote bundle to a temp file. Uses the global `fetch` (Node 18+).
|
|
26
|
+
* Exported for tests that stub the fetcher.
|
|
27
|
+
*/
|
|
28
|
+
export declare function fetchToTemp(url: string, fetchImpl?: typeof fetch): Promise<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Materialise a config bundle entry to a verified local tarball path.
|
|
31
|
+
* Callers MUST invoke the returned `cleanup` after the sync completes.
|
|
32
|
+
*/
|
|
33
|
+
export declare function materialiseBundle(entry: SyncConfigBundle, fetchImpl?: typeof fetch): Promise<MaterialisedBundle>;
|
|
34
|
+
//# sourceMappingURL=bundle-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sync/bundle-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAWD,kEAAkE;AAClE,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,gBAAgB,EACvB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,kBAAkB,CAAC,CAmB7B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { basename, join } from "node:path";
|
|
5
|
+
function isUrl(s) {
|
|
6
|
+
return /^https?:\/\//i.test(s);
|
|
7
|
+
}
|
|
8
|
+
async function sha256File(path) {
|
|
9
|
+
const buf = await readFile(path);
|
|
10
|
+
return createHash("sha256").update(buf).digest("hex");
|
|
11
|
+
}
|
|
12
|
+
/** Verify a tarball's sha256 against a pin; throw on mismatch. */
|
|
13
|
+
export async function verifySha256(localPath, expected) {
|
|
14
|
+
const actual = await sha256File(localPath);
|
|
15
|
+
if (actual.toLowerCase() !== expected.toLowerCase()) {
|
|
16
|
+
throw new Error(`bundle_sha256 mismatch for ${basename(localPath)}: ` +
|
|
17
|
+
`expected ${expected}, got ${actual}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Fetch a remote bundle to a temp file. Uses the global `fetch` (Node 18+).
|
|
22
|
+
* Exported for tests that stub the fetcher.
|
|
23
|
+
*/
|
|
24
|
+
export async function fetchToTemp(url, fetchImpl = fetch) {
|
|
25
|
+
const res = await fetchImpl(url);
|
|
26
|
+
if (!res.ok) {
|
|
27
|
+
throw new Error(`Failed to fetch bundle ${url}: HTTP ${res.status}`);
|
|
28
|
+
}
|
|
29
|
+
const buf = Buffer.from(await res.arrayBuffer());
|
|
30
|
+
const dir = await mkdtemp(join(tmpdir(), "sdd-cli-bundle-src-"));
|
|
31
|
+
const dest = join(dir, basename(new URL(url).pathname) || "bundle.tar.gz");
|
|
32
|
+
await writeFile(dest, buf);
|
|
33
|
+
return dest;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Materialise a config bundle entry to a verified local tarball path.
|
|
37
|
+
* Callers MUST invoke the returned `cleanup` after the sync completes.
|
|
38
|
+
*/
|
|
39
|
+
export async function materialiseBundle(entry, fetchImpl = fetch) {
|
|
40
|
+
if (isUrl(entry.source)) {
|
|
41
|
+
const localPath = await fetchToTemp(entry.source, fetchImpl);
|
|
42
|
+
const cleanup = async () => {
|
|
43
|
+
await rm(localPath, { force: true });
|
|
44
|
+
await rm(join(localPath, ".."), { recursive: true, force: true });
|
|
45
|
+
};
|
|
46
|
+
try {
|
|
47
|
+
if (entry.sha256)
|
|
48
|
+
await verifySha256(localPath, entry.sha256);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
await cleanup();
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
return { localPath, cleanup };
|
|
55
|
+
}
|
|
56
|
+
// Local source: verify in place, no temp resources to release.
|
|
57
|
+
if (entry.sha256)
|
|
58
|
+
await verifySha256(entry.source, entry.sha256);
|
|
59
|
+
return { localPath: entry.source, cleanup: async () => { } };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=bundle-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-source.js","sourceRoot":"","sources":["../../../src/lib/sync/bundle-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAyB3C,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,kEAAkE;AAClE,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,SAAiB,EACjB,QAAgB;IAEhB,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AAK,IAAI,EAAE;YACzB,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,CAAC,CAAC;QACF,IAAI,CAAC;YACH,IAAI,KAAK,CAAC,MAAM;gBAAE,MAAM,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAChE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,EAAE,CAAC;YAChB,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAChC,CAAC;IAED,+DAA+D;IAC/D,IAAI,KAAK,CAAC,MAAM;QAAE,MAAM,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -1,33 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Multi-bundle sync config file. Per ADR 0151 + companion plan Phase 3b
|
|
2
|
+
* Multi-bundle sync config file. Per ADR 0151 + companion plan Phase 3b,
|
|
3
|
+
* extended for the Cut-2 bundle_source resolver (sdd-method Cut-2 WS-B).
|
|
3
4
|
*
|
|
4
5
|
* Lives at `method-baseline.config.yaml` (or any path passed via
|
|
5
6
|
* `sdd-cli sync --config <path>`). Declares an ordered list of bundle
|
|
6
7
|
* sources to sync in sequence.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
+
* Two ways to name a bundle:
|
|
10
|
+
*
|
|
11
|
+
* 1. Explicit `source` (path or URL) — unchanged:
|
|
9
12
|
*
|
|
10
13
|
* ```yaml
|
|
11
14
|
* version: "1.0"
|
|
12
15
|
* bundles:
|
|
13
|
-
* - source: "./dist/
|
|
14
|
-
* - source: "./dist/example-app-context-pack/example-app-context-pack-v0.1.0.tar.gz"
|
|
16
|
+
* - source: "./dist/platform-baseline/platform-baseline-v1.2.0.tar.gz"
|
|
15
17
|
* ```
|
|
16
18
|
*
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* 2. `name` + `version` resolved against a shared `bundle_source` base —
|
|
20
|
+
* no explicit paths, source-agnostic (local dir today, internal HTTPS
|
|
21
|
+
* base next, an OCI registry later — all behind the same key):
|
|
22
|
+
*
|
|
23
|
+
* ```yaml
|
|
24
|
+
* version: "1.0"
|
|
25
|
+
* bundle_source: "./dist" # local dir, or https://host/method-bundles
|
|
26
|
+
* bundles:
|
|
27
|
+
* - name: platform-baseline
|
|
28
|
+
* version: v1.2.0
|
|
29
|
+
* sha256: "<hex>" # optional integrity pin (verified on apply)
|
|
30
|
+
* - name: reverse-extension-baseline
|
|
31
|
+
* version: v1.2.0
|
|
32
|
+
* ```
|
|
20
33
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
34
|
+
* Resolution computes `<base>/<name>/<name>-<version>.tar.gz` — the same
|
|
35
|
+
* layout `build-method-baseline-bundle.sh --output-dir dist/<name>` emits.
|
|
36
|
+
* A `source` is resolved relative to the config file's directory (or kept
|
|
37
|
+
* as-is when absolute / a URL). The `bundle_sha256` pin is the
|
|
38
|
+
* source-agnostic integrity invariant (ADR 0185): it is verified against
|
|
39
|
+
* the materialised tarball regardless of where it came from.
|
|
23
40
|
*/
|
|
24
41
|
export interface SyncConfig {
|
|
25
42
|
version: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional base location resolved bundles are fetched from: a local
|
|
45
|
+
* directory (absolute, or relative to the config file) or an
|
|
46
|
+
* `https://`/`http://` base URL. Required only when a bundle entry uses
|
|
47
|
+
* `name`+`version` rather than an explicit `source`.
|
|
48
|
+
*/
|
|
49
|
+
bundleSource?: string;
|
|
26
50
|
bundles: SyncConfigBundle[];
|
|
27
51
|
}
|
|
28
52
|
export interface SyncConfigBundle {
|
|
29
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Resolved tarball location: an absolute local path, or an
|
|
55
|
+
* `https://`/`http://` URL. The sync verb materialises this to a local
|
|
56
|
+
* file before applying (see `bundle-source.ts`).
|
|
57
|
+
*/
|
|
30
58
|
source: string;
|
|
59
|
+
/** Optional hex sha256 integrity pin, verified before the bundle applies. */
|
|
60
|
+
sha256?: string;
|
|
31
61
|
}
|
|
32
62
|
export declare function loadSyncConfig(configPath: string): Promise<SyncConfig>;
|
|
33
63
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/sync/config.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/sync/config.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAmBD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAgF5E"}
|
package/dist/lib/sync/config.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
3
3
|
import { parse as parseYaml } from "yaml";
|
|
4
|
+
function isUrl(s) {
|
|
5
|
+
return /^https?:\/\//i.test(s);
|
|
6
|
+
}
|
|
4
7
|
export async function loadSyncConfig(configPath) {
|
|
5
8
|
const absPath = isAbsolute(configPath) ? configPath : resolve(configPath);
|
|
6
9
|
let raw;
|
|
@@ -25,16 +28,45 @@ export async function loadSyncConfig(configPath) {
|
|
|
25
28
|
throw new Error(`Sync config ${absPath} field "bundles" must not be empty`);
|
|
26
29
|
}
|
|
27
30
|
const configDir = dirname(absPath);
|
|
31
|
+
const bundleSource = typeof parsed.bundle_source === "string" ? parsed.bundle_source : undefined;
|
|
32
|
+
// Pre-resolve the base for name/version resolution: a URL stays as-is;
|
|
33
|
+
// a local dir is resolved relative to the config file.
|
|
34
|
+
const resolvedBase = bundleSource === undefined
|
|
35
|
+
? undefined
|
|
36
|
+
: isUrl(bundleSource) || isAbsolute(bundleSource)
|
|
37
|
+
? bundleSource
|
|
38
|
+
: resolve(configDir, bundleSource);
|
|
28
39
|
const bundles = [];
|
|
29
40
|
for (const [i, entry] of parsed.bundles.entries()) {
|
|
30
|
-
const
|
|
31
|
-
const src = typeof
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
const rawBundle = entry;
|
|
42
|
+
const src = typeof rawBundle.source === "string" ? rawBundle.source : undefined;
|
|
43
|
+
const name = typeof rawBundle.name === "string" ? rawBundle.name : undefined;
|
|
44
|
+
const ver = typeof rawBundle.version === "string" ? rawBundle.version : undefined;
|
|
45
|
+
const sha256 = typeof rawBundle.sha256 === "string" ? rawBundle.sha256 : undefined;
|
|
46
|
+
let source;
|
|
47
|
+
if (src) {
|
|
48
|
+
// Explicit source: a URL stays as-is; a path is resolved against the
|
|
49
|
+
// config dir (absolute paths pass through).
|
|
50
|
+
source = isUrl(src) || isAbsolute(src) ? src : resolve(configDir, src);
|
|
51
|
+
}
|
|
52
|
+
else if (name && ver) {
|
|
53
|
+
if (resolvedBase === undefined) {
|
|
54
|
+
throw new Error(`Sync config ${absPath} bundles[${i}] uses name+version but no ` +
|
|
55
|
+
`top-level "bundle_source" base is set to resolve it against.`);
|
|
56
|
+
}
|
|
57
|
+
const rel = `${name}/${name}-${ver}.tar.gz`;
|
|
58
|
+
source = isUrl(resolvedBase)
|
|
59
|
+
? `${resolvedBase.replace(/\/$/, "")}/${rel}`
|
|
60
|
+
: resolve(resolvedBase, name, `${name}-${ver}.tar.gz`);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
throw new Error(`Sync config ${absPath} bundles[${i}] missing required field: source ` +
|
|
64
|
+
`(or a name+version pair resolved against bundle_source)`);
|
|
34
65
|
}
|
|
35
|
-
|
|
36
|
-
bundles.push({ source: resolved });
|
|
66
|
+
bundles.push(sha256 === undefined ? { source } : { source, sha256 });
|
|
37
67
|
}
|
|
38
|
-
return
|
|
68
|
+
return bundleSource === undefined
|
|
69
|
+
? { version, bundles }
|
|
70
|
+
: { version, bundleSource, bundles };
|
|
39
71
|
}
|
|
40
72
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/sync/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/sync/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AA8E1C,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,eAAe,C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|
+
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../src/verbs/pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgEnD"}
|
package/dist/verbs/pack.js
CHANGED
|
@@ -10,6 +10,8 @@ export function registerPack(program) {
|
|
|
10
10
|
.option("--producer-repo <dir>", "adopter repo root (managed_paths are resolved relative to this; defaults to cwd)", process.cwd())
|
|
11
11
|
.option("--out-dir <dir>", "output directory for the tarball (defaults to <producer-repo>/dist/<pack-name>/)")
|
|
12
12
|
.option("--forward-base-managed-paths <path>", "path to forward-base MANAGED_PATHS.txt for the leakage check (defaults to extracting from method-baseline.lock)")
|
|
13
|
+
.option("--publish-transform", "apply the point-in-time / producer-agnostic publish transform (ADR 0183/0184): drop non-Accepted ADRs, strip lineage + stripped-class fields, flatten cross-repo refs, fail closed on leaks. For producer-published bundles.")
|
|
14
|
+
.option("--origin-prefix", "with the publish transform, apply the range-aware origin prefix (ADR 0140 §4.1): 0NNN→M-ADR, 9NNN→RA-ADR, adopter 1NNN stays ADR; ADR files renamed to match. Implies --publish-transform. The RA-ADR bundle cutover switch.")
|
|
13
15
|
.action(async (opts) => {
|
|
14
16
|
const { exitCode } = await runPackBuild({
|
|
15
17
|
seedPath: opts.seed,
|
|
@@ -18,6 +20,8 @@ export function registerPack(program) {
|
|
|
18
20
|
...(opts.forwardBaseManagedPaths && {
|
|
19
21
|
forwardBaseManagedPathsFile: opts.forwardBaseManagedPaths,
|
|
20
22
|
}),
|
|
23
|
+
...(opts.publishTransform && { publishTransform: true }),
|
|
24
|
+
...(opts.originPrefix && { originPrefix: true }),
|
|
21
25
|
});
|
|
22
26
|
if (exitCode !== 0)
|
|
23
27
|
process.exit(exitCode);
|
package/dist/verbs/pack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../src/verbs/pack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../src/verbs/pack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAerE,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,MAAM,IAAI,GAAG,OAAO;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CACV,wEAAwE,CACzE,CAAC;IAEJ,IAAI;SACD,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CACV,8FAA8F,CAC/F;SACA,cAAc,CACb,eAAe,EACf,qEAAqE,CACtE;SACA,MAAM,CACL,uBAAuB,EACvB,kFAAkF,EAClF,OAAO,CAAC,GAAG,EAAE,CACd;SACA,MAAM,CACL,iBAAiB,EACjB,kFAAkF,CACnF;SACA,MAAM,CACL,qCAAqC,EACrC,iHAAiH,CAClH;SACA,MAAM,CACL,qBAAqB,EACrB,8NAA8N,CAC/N;SACA,MAAM,CACL,iBAAiB,EACjB,8NAA8N,CAC/N;SACA,MAAM,CAAC,KAAK,EAAE,IAAkB,EAAE,EAAE;QACnC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,CAAC;YACtC,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,EAAE;YAChD,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;YAC3C,GAAG,CAAC,IAAI,CAAC,uBAAuB,IAAI;gBAClC,2BAA2B,EAAE,IAAI,CAAC,uBAAuB;aAC1D,CAAC;YACF,GAAG,CAAC,IAAI,CAAC,gBAAgB,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;YACxD,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;SACjD,CAAC,CAAC;QACH,IAAI,QAAQ,KAAK,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEL,IAAI;SACD,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CACV,8FAA8F,CAC/F;SACA,cAAc,CACb,eAAe,EACf,qEAAqE,CACtE;SACA,MAAM,CAAC,KAAK,EAAE,IAAqB,EAAE,EAAE;QACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,eAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACpE,IAAI,QAAQ,KAAK,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/verbs/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/verbs/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/verbs/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwFnD"}
|
package/dist/verbs/sync.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AGENT_HARNESSES, resolveAgentHarness, } from "../lib/agent-harness.js";
|
|
2
2
|
import { loadSyncConfig } from "../lib/sync/config.js";
|
|
3
|
+
import { materialiseBundle } from "../lib/sync/bundle-source.js";
|
|
3
4
|
import { runSync } from "../lib/sync/index.js";
|
|
4
5
|
export function registerSync(program) {
|
|
5
6
|
program
|
|
@@ -47,16 +48,27 @@ export function registerSync(program) {
|
|
|
47
48
|
try {
|
|
48
49
|
const config = await loadSyncConfig(opts.config);
|
|
49
50
|
for (const entry of config.bundles) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
// Resolve the entry to a verified local tarball (local path used
|
|
52
|
+
// in place; an internal-HTTPS source fetched to a temp file; the
|
|
53
|
+
// sha256 pin checked when present), then apply + release.
|
|
54
|
+
const resolved = await materialiseBundle(entry);
|
|
55
|
+
try {
|
|
56
|
+
const { exitCode } = await runSync({
|
|
57
|
+
bundle: resolved.localPath,
|
|
58
|
+
targetRepo: opts.targetRepo,
|
|
59
|
+
dryRun: opts.dryRun === true,
|
|
60
|
+
allowOverwrite: opts.allowOverwrite === true,
|
|
61
|
+
delete: opts.delete,
|
|
62
|
+
agentHarness,
|
|
63
|
+
});
|
|
64
|
+
if (exitCode !== 0) {
|
|
65
|
+
await resolved.cleanup();
|
|
66
|
+
process.exit(exitCode);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
await resolved.cleanup();
|
|
71
|
+
}
|
|
60
72
|
}
|
|
61
73
|
}
|
|
62
74
|
catch (err) {
|
package/dist/verbs/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/verbs/sync.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAY/C,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SAC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