@orkestrel/scaffold 0.0.143 → 0.0.145
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/agents/skills/orkestrel-publish/scripts/swap.js +111 -5
- package/dist/agents/templates/brief.md +1 -0
- package/dist/bin/main.js +87 -30
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/platforms/windows.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/references/release.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +133 -6
- package/dist/host/agents/templates/brief.md +1 -0
- package/dist/host/claude/agents/orkestrel.md +52 -52
- package/dist/host/claude/rules/documentation.md +1 -0
- package/dist/host/claude/rules/quality.md +1 -0
- package/dist/host/claude/rules/tests.md +1 -0
- package/dist/host/claude/rules/workspace.md +14 -13
- package/dist/host/dotfiles/oxlintrc.json +1 -1
- package/dist/host/guides/browser.md +1 -1
- package/dist/host/guides/codec.md +29 -12
- package/dist/host/guides/contract.md +58 -57
- package/dist/host/guides/scaffold.md +63 -43
- package/dist/host/guides/server.md +1 -1
- package/dist/host/manifest.json +18 -18
- package/dist/host/scripts/browsers.sh +0 -0
- package/dist/host/scripts/codex.sh +0 -0
- package/dist/host/scripts/cursor.sh +0 -0
- package/dist/host/scripts/deps.sh +0 -0
- package/dist/host/scripts/npm.sh +0 -0
- package/dist/host/scripts/ollama.sh +0 -0
- package/dist/host/tests/config.test.ts +5 -0
- package/dist/host/tests/setupPolicy.ts +1 -0
- package/dist/src/core/index.cjs +64 -24
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +17 -2
- package/dist/src/core/index.d.ts +17 -2
- package/dist/src/core/index.js +64 -25
- package/dist/src/core/index.js.map +1 -1
- package/package.json +13 -13
|
@@ -1292,6 +1292,79 @@ export function proveRestored(consumer, name, range) {
|
|
|
1292
1292
|
: []),
|
|
1293
1293
|
];
|
|
1294
1294
|
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Reads whether the registry serves a package.
|
|
1297
|
+
*
|
|
1298
|
+
* @remarks
|
|
1299
|
+
* Runs `npm view <name> name --json` in the consumer through the npm entry the install uses, with an
|
|
1300
|
+
* argument array and no shell.
|
|
1301
|
+
*
|
|
1302
|
+
* @param consumer - The consumer directory, whose npm configuration names the registry.
|
|
1303
|
+
* @param name - The package name.
|
|
1304
|
+
* @returns `served` when npm exits 0, `absent` when its JSON error code is `E404`, and undefined for
|
|
1305
|
+
* any other answer.
|
|
1306
|
+
*/
|
|
1307
|
+
export function classifyRegistry(consumer, name) {
|
|
1308
|
+
const result = runNpm(['view', name, 'name', '--json'], consumer);
|
|
1309
|
+
if (result.error !== undefined)
|
|
1310
|
+
return undefined;
|
|
1311
|
+
if (result.status === 0)
|
|
1312
|
+
return 'served';
|
|
1313
|
+
const error = parseJsonRecord(result.stdout.trim())?.error;
|
|
1314
|
+
return isRecord(error) && error.code === 'E404' ? 'absent' : undefined;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Lists the problem with a locked version that a recorded range does not admit.
|
|
1318
|
+
*
|
|
1319
|
+
* @remarks
|
|
1320
|
+
* An install that finds the lock entry outside the manifest range resolves the package from the
|
|
1321
|
+
* registry again, which a kept package cannot survive. A range outside the subset
|
|
1322
|
+
* {@link supportsRange} reads is not judged.
|
|
1323
|
+
*
|
|
1324
|
+
* @param consumer - The consumer directory.
|
|
1325
|
+
* @param name - The package name.
|
|
1326
|
+
* @param range - The recorded range.
|
|
1327
|
+
* @returns One message naming the package, its locked version, and the range when the lock entry's
|
|
1328
|
+
* version is absent or outside the range, and none otherwise.
|
|
1329
|
+
*/
|
|
1330
|
+
export function scanLocked(consumer, name, range) {
|
|
1331
|
+
if (!supportsRange(range))
|
|
1332
|
+
return [];
|
|
1333
|
+
const packages = loadJSONRecord(join(consumer, 'package-lock.json'))?.packages;
|
|
1334
|
+
const entry = isRecord(packages) ? packages[`node_modules/${name}`] : undefined;
|
|
1335
|
+
const version = readString(isRecord(entry) ? entry : undefined, 'version');
|
|
1336
|
+
return version !== undefined && matchesRange(version, range)
|
|
1337
|
+
? []
|
|
1338
|
+
: [
|
|
1339
|
+
`${name} is locked at ${version ?? '(no version)'} but its recorded range ${range} does not admit it`,
|
|
1340
|
+
];
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Lists the problems with one kept package.
|
|
1344
|
+
*
|
|
1345
|
+
* @remarks
|
|
1346
|
+
* A kept package returns to its recorded range in the manifest alone, so its lock entry and installed
|
|
1347
|
+
* tarball must still stand.
|
|
1348
|
+
*
|
|
1349
|
+
* @param consumer - The consumer directory.
|
|
1350
|
+
* @param name - The package name.
|
|
1351
|
+
* @param range - The recorded range the manifest must hold.
|
|
1352
|
+
* @param archive - The ledger archive's file name.
|
|
1353
|
+
* @returns One message per problem, empty when the manifest holds the range and the lockfile
|
|
1354
|
+
* `resolved` still names the archive.
|
|
1355
|
+
*/
|
|
1356
|
+
export function proveKept(consumer, name, range, archive) {
|
|
1357
|
+
const manifest = loadJSONRecord(join(consumer, 'package.json'));
|
|
1358
|
+
const held = manifest === undefined ? undefined : findDeclaration(manifest, name)?.spec;
|
|
1359
|
+
const resolved = loadResolved(consumer, name);
|
|
1360
|
+
return [
|
|
1361
|
+
...(held === range ? [] : [`${name} is ${held ?? '(absent)'} in the manifest, not ${range}`]),
|
|
1362
|
+
...(resolved !== undefined && normalizeSlashes(resolved).endsWith(archive)
|
|
1363
|
+
? []
|
|
1364
|
+
: [`the lockfile no longer names ${archive} for ${name}`]),
|
|
1365
|
+
...scanLocked(consumer, name, range),
|
|
1366
|
+
];
|
|
1367
|
+
}
|
|
1295
1368
|
/**
|
|
1296
1369
|
* Locates a consumer's ledger file.
|
|
1297
1370
|
*
|
|
@@ -1758,7 +1831,8 @@ export function scanRemovals(consumer, names) {
|
|
|
1758
1831
|
*
|
|
1759
1832
|
* @param command - The parsed command.
|
|
1760
1833
|
* @returns 0 when the restore installed and proved, 1 when a proof failed, 64 on a usage refusal.
|
|
1761
|
-
* @throws Thrown when the ledger is malformed or
|
|
1834
|
+
* @throws Thrown when the ledger is malformed, the registry gave no served or 404 answer for a package,
|
|
1835
|
+
* or the install fails.
|
|
1762
1836
|
*/
|
|
1763
1837
|
export function executeRestore(command) {
|
|
1764
1838
|
const manifestPath = join(command.consumer, 'package.json');
|
|
@@ -1786,11 +1860,36 @@ export function executeRestore(command) {
|
|
|
1786
1860
|
const refusals = scanRemovals(command.consumer, removals);
|
|
1787
1861
|
if (refusals.length > 0)
|
|
1788
1862
|
return reportUsage(refusals.join('\n'));
|
|
1863
|
+
const registry = plan.rows
|
|
1864
|
+
.filter((row) => removals.includes(row.name))
|
|
1865
|
+
.map((row) => ({ name: row.name, answer: classifyRegistry(command.consumer, row.name) }));
|
|
1866
|
+
const silent = registry.filter((row) => row.answer === undefined).map((row) => row.name);
|
|
1867
|
+
if (silent.length > 0)
|
|
1868
|
+
throw new Error(`the registry did not answer for ${silent.join(', ')}`);
|
|
1869
|
+
const absent = new Set(registry.filter((row) => row.answer === 'absent').map((row) => row.name));
|
|
1870
|
+
const outside = plan.rows.flatMap((row) => absent.has(row.name) && row.entry.replaced !== undefined
|
|
1871
|
+
? scanLocked(command.consumer, row.name, row.entry.replaced)
|
|
1872
|
+
: []);
|
|
1873
|
+
if (outside.length > 0)
|
|
1874
|
+
throw new Error(outside.join('; '));
|
|
1789
1875
|
replaceFile(manifestPath, serializeJSON(plan.manifest));
|
|
1790
1876
|
replaceFile(locateLedger(command.consumer), serializeJSON(plan.ledger));
|
|
1791
|
-
removePinnedInstalls(command.consumer, removals);
|
|
1792
|
-
|
|
1793
|
-
|
|
1877
|
+
removePinnedInstalls(command.consumer, removals.filter((name) => !absent.has(name)));
|
|
1878
|
+
if (plan.rows.some((row) => !absent.has(row.name)) || plan.dropped.length > 0) {
|
|
1879
|
+
installConsumer(command.consumer);
|
|
1880
|
+
}
|
|
1881
|
+
const kept = plan.rows.flatMap((row) => absent.has(row.name) && row.entry.replaced !== undefined
|
|
1882
|
+
? [
|
|
1883
|
+
{
|
|
1884
|
+
name: row.name,
|
|
1885
|
+
range: row.entry.replaced,
|
|
1886
|
+
registry: 'absent',
|
|
1887
|
+
resolved: loadResolved(command.consumer, row.name),
|
|
1888
|
+
problems: proveKept(command.consumer, row.name, row.entry.replaced, row.entry.tarball),
|
|
1889
|
+
},
|
|
1890
|
+
]
|
|
1891
|
+
: []);
|
|
1892
|
+
const proved = plan.rows.flatMap((row) => row.entry.field === undefined || row.entry.replaced === undefined || absent.has(row.name)
|
|
1794
1893
|
? []
|
|
1795
1894
|
: [
|
|
1796
1895
|
{
|
|
@@ -1799,7 +1898,7 @@ export function executeRestore(command) {
|
|
|
1799
1898
|
problems: proveRestored(command.consumer, row.name, row.entry.replaced),
|
|
1800
1899
|
},
|
|
1801
1900
|
]);
|
|
1802
|
-
const failures = proved.flatMap((proof) => proof.problems);
|
|
1901
|
+
const failures = [...proved, ...kept].flatMap((proof) => proof.problems);
|
|
1803
1902
|
const receipt = {
|
|
1804
1903
|
mode: 'restore',
|
|
1805
1904
|
consumer: normalizeSlashes(command.consumer),
|
|
@@ -1811,6 +1910,12 @@ export function executeRestore(command) {
|
|
|
1811
1910
|
version: readString(loadJSONRecord(join(locateInstalled(command.consumer, proof.name), 'package.json')), 'version'),
|
|
1812
1911
|
resolved: loadResolved(command.consumer, proof.name),
|
|
1813
1912
|
})),
|
|
1913
|
+
kept: kept.map(({ name, range, registry: answer, resolved }) => ({
|
|
1914
|
+
name,
|
|
1915
|
+
range,
|
|
1916
|
+
registry: answer,
|
|
1917
|
+
resolved,
|
|
1918
|
+
})),
|
|
1814
1919
|
dropped: plan.dropped,
|
|
1815
1920
|
changes: plan.changes,
|
|
1816
1921
|
repin: buildRepin(command.consumer, plan),
|
|
@@ -1820,6 +1925,7 @@ export function executeRestore(command) {
|
|
|
1820
1925
|
const path = writeReceipt(command.consumer, at, receipt);
|
|
1821
1926
|
printReport(command.json, [
|
|
1822
1927
|
...proved.map((proof) => `swap: restored ${proof.name} to ${proof.range}`),
|
|
1928
|
+
...kept.map((proof) => `swap: restored ${proof.name} to ${proof.range} in the manifest only: the registry serves no release; the install still holds the tarball`),
|
|
1823
1929
|
...plan.dropped.map((name) => `swap: dropped overrides.${name}`),
|
|
1824
1930
|
...failures.map((failure) => `swap: problem: ${failure}`),
|
|
1825
1931
|
`swap: re-pin with ${receipt.repin.join(' ')}`,
|
|
@@ -49,6 +49,7 @@ Stop and report (expected, found, evidence, done or not done, one hypothesis) on
|
|
|
49
49
|
1. CHEAP_CHECKS (regeneration, then the format check, lint, and type check over the owned files)
|
|
50
50
|
2. SCOPED_TEST
|
|
51
51
|
3. ARTIFACT_CRITERION
|
|
52
|
+
4. When the unit adds an exported name, a `tests/setup*.ts` export included: `scaffold surface` reports no collision the unit added, per `.claude/rules/names.md` § Fleet name ownership.
|
|
52
53
|
|
|
53
54
|
**Observations, not criteria.** TIMING_SENSITIVE_OR_TREE_WIDE_GATES the unit reports and the Orchestrator re-runs.
|
|
54
55
|
|
package/dist/bin/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { align, renderTable, strip, stripControls, width } from "@orkestrel/console";
|
|
3
3
|
import { attempt, isArray, isDefined, isError, isInstance, isRecord, isString, parseJSON, settle } from "@orkestrel/contract";
|
|
4
|
-
import { ARTIFACT_GROUPS, AXES, BIN_ENTRY_PATH, BIN_OUTPUT_PATH, CATALOG_AGENT_PATH, CENTRAL_FILE_NAMES, CONFORMANCE_TEST_PATH, Compiler, DEPENDENCY_NAME_PATTERN, ENVIRONMENTS, FRAMEWORKS, GLOBAL_SETUP_PATH, GUIDES_TEST_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, JOURNEY_CONFIG_PATH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, RESERVED_SHEET_NAMES, SERVICE_SETUP_PATH, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, STYLES_ENTRY_PATH, ScaffoldError, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TREE_TEST_PATH, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToEntries, blueprintToFaces, blueprintToManifest, blueprintToManifestOverrides, blueprintToProjects, blueprintToScripts, blueprintToSheets, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, collectSurfaceAdvisories, collectSurfaceCollisions, compareSurfaceCollisions, compareVersions, contentToHex, createBlueprint, extractRangeMajor, extractVersion, isFloorPath, isScaffoldError, isSheetName, isSubpathMap, iterateAnswers, manifestToDependencies, manifestToEntries, manifestToName, matchesBarrel, matchesGuideRefusal, nameToGuide, parseExtension, replaceManifestOverrides, replaceManifestScripts, replacePlanRanges } from "../src/core/index.js";
|
|
4
|
+
import { ARTIFACT_GROUPS, AXES, BIN_ENTRY_PATH, BIN_OUTPUT_PATH, CATALOG_AGENT_PATH, CENTRAL_FILE_NAMES, CONFORMANCE_TEST_PATH, Compiler, DEPENDENCY_NAME_PATTERN, ENVIRONMENTS, FRAMEWORKS, GLOBAL_SETUP_PATH, GUIDES_TEST_PATH, HOST_PATHS, INTEGRATION_TEST_PATH, ISOLATION_SETUP_PATH, JOURNEY_CONFIG_PATH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, RESERVED_SHEET_NAMES, SERVICE_SETUP_PATH, SHEET_ENTRY_NAME, SHOWCASE_CONFIG_PATH, SHOWCASE_DEV_DEPENDENCIES, SHOWCASE_PAGES_PATH, SKILLS_CONFIG_PATH, STYLES_ENTRY_PATH, ScaffoldError, THEMES_BARREL_PATH, THEMES_ENTRY_PATH, TREE_TEST_PATH, blueprintToConfigArtifacts, blueprintToDevDependencies, blueprintToEntries, blueprintToFaces, blueprintToManifest, blueprintToManifestOverrides, blueprintToProjects, blueprintToScripts, blueprintToSheets, blueprintToTestArtifacts, blueprintToToolchainHolds, blueprintToWritableScripts, collectSurfaceAdvisories, collectSurfaceCollisions, compareSurfaceCollisions, compareVersions, contentToHex, createBlueprint, extractRangeMajor, extractVersion, isFloorPath, isScaffoldError, isSheetName, isSubpathMap, iterateAnswers, manifestToDependencies, manifestToEntries, manifestToName, matchesBarrel, matchesGuideRefusal, nameToGuide, parseExtension, replaceManifestOverrides, replaceManifestScripts, replacePlanRanges } from "../src/core/index.js";
|
|
5
5
|
import { MAX_INVENTORY_PATHS, Materializer, Upstream, filesToHost, isExactCaseFile, isPhysicalDirectory, isWorktree, listFiles, readFileText, readHostFloor, readHostManifest, readSnapshot, readSurfaceCandidate, readSurfaceFile, readSurfaceGuide, readSurfaceRecord, resolveContainedPath, resolveSurfaceLoader } from "../src/server/index.js";
|
|
6
6
|
import { join, normalize, resolve } from "node:path";
|
|
7
7
|
import { createDuplex } from "@orkestrel/process/server";
|
|
@@ -10,7 +10,7 @@ import { readdirSync } from "node:fs";
|
|
|
10
10
|
import { parseArgs } from "node:util";
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "@orkestrel/scaffold",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.145",
|
|
14
14
|
description: "Scaffold workspaces with commands: new, audit, surface, repair, catalog, and overwrite.",
|
|
15
15
|
keywords: [
|
|
16
16
|
"audit",
|
|
@@ -102,20 +102,20 @@ var package_default = {
|
|
|
102
102
|
"prepublishOnly": "npm run format:check && npm run lint:check && npm run check && npm run build && npm test && npm run test:templates && npm run test:distribution -- --mode release"
|
|
103
103
|
},
|
|
104
104
|
dependencies: {
|
|
105
|
-
"@orkestrel/console": "^0.0.
|
|
106
|
-
"@orkestrel/contract": "^0.0.
|
|
107
|
-
"@orkestrel/emitter": "^0.0.
|
|
108
|
-
"@orkestrel/markdown": "^0.0.
|
|
109
|
-
"@orkestrel/process": "^0.0.
|
|
110
|
-
"@orkestrel/template": "^0.0.
|
|
105
|
+
"@orkestrel/console": "^0.0.23",
|
|
106
|
+
"@orkestrel/contract": "^0.0.27",
|
|
107
|
+
"@orkestrel/emitter": "^0.0.19",
|
|
108
|
+
"@orkestrel/markdown": "^0.0.24",
|
|
109
|
+
"@orkestrel/process": "^0.0.23",
|
|
110
|
+
"@orkestrel/template": "^0.0.17"
|
|
111
111
|
},
|
|
112
112
|
devDependencies: {
|
|
113
113
|
"@microsoft/api-extractor": "^7.60.1",
|
|
114
|
-
"@orkestrel/browser": "^0.0.
|
|
115
|
-
"@orkestrel/guide": "^0.0.
|
|
116
|
-
"@orkestrel/html": "^0.0.
|
|
117
|
-
"@orkestrel/probe": "^0.0.
|
|
118
|
-
"@orkestrel/test": "^0.0.
|
|
114
|
+
"@orkestrel/browser": "^0.0.36",
|
|
115
|
+
"@orkestrel/guide": "^0.0.34",
|
|
116
|
+
"@orkestrel/html": "^0.0.19",
|
|
117
|
+
"@orkestrel/probe": "^0.0.33",
|
|
118
|
+
"@orkestrel/test": "^0.0.45",
|
|
119
119
|
"@types/node": "^24.19.2",
|
|
120
120
|
"@vitest/browser-playwright": "^5.1.0",
|
|
121
121
|
"oxfmt": "^0.79.0",
|
|
@@ -123,7 +123,7 @@ var package_default = {
|
|
|
123
123
|
"playwright": "^1.64.1",
|
|
124
124
|
"typescript": "^7.0.2",
|
|
125
125
|
"vite": "^8.3.8",
|
|
126
|
-
"vitest": "^5.1.
|
|
126
|
+
"vitest": "^5.1.1"
|
|
127
127
|
},
|
|
128
128
|
engines: { "node": ">=22.18.0" }
|
|
129
129
|
};
|
|
@@ -1211,6 +1211,28 @@ function sanitizeLine(line) {
|
|
|
1211
1211
|
return stripControls(strip(line)).replace(/\r\n|\r|\n/gu, " ");
|
|
1212
1212
|
}
|
|
1213
1213
|
/**
|
|
1214
|
+
* Filters the release rows that name an `@orkestrel` package the registry has never published.
|
|
1215
|
+
*
|
|
1216
|
+
* @param releases - The release verdicts to filter.
|
|
1217
|
+
* @returns Each row whose lookup is `missing` and whose name starts with `@orkestrel/`, in order.
|
|
1218
|
+
*
|
|
1219
|
+
* @remarks
|
|
1220
|
+
* A `missing` lookup is a packument `404` or a package the organization catalog does not list.
|
|
1221
|
+
* An `unmatched` row, a `failed` row, and a `missing` row outside the fleet are not unpublished.
|
|
1222
|
+
*
|
|
1223
|
+
* @example
|
|
1224
|
+
* ```ts
|
|
1225
|
+
* import { filterUnpublished } from './helpers.js'
|
|
1226
|
+
*
|
|
1227
|
+
* filterUnpublished([
|
|
1228
|
+
* { name: '@orkestrel/learn', range: '^0.0.1', lookup: 'missing', note: 'the registry answered 404' },
|
|
1229
|
+
* ]).length // 1
|
|
1230
|
+
* ```
|
|
1231
|
+
*/
|
|
1232
|
+
function filterUnpublished(releases) {
|
|
1233
|
+
return releases.filter((release) => release.lookup === "missing" && release.name.startsWith("@orkestrel/"));
|
|
1234
|
+
}
|
|
1235
|
+
/**
|
|
1214
1236
|
* Projects an incomplete version resolution into the refusal it earns.
|
|
1215
1237
|
*
|
|
1216
1238
|
* @param versions - The resolution to measure.
|
|
@@ -1218,7 +1240,8 @@ function sanitizeLine(line) {
|
|
|
1218
1240
|
*
|
|
1219
1241
|
* @remarks
|
|
1220
1242
|
* Read before a caller opens a write, so a run that could not name every floor
|
|
1221
|
-
* refuses instead of writing a partial pin set.
|
|
1243
|
+
* refuses instead of writing a partial pin set. A fleet package the registry has
|
|
1244
|
+
* never published is not named, because its verb keeps the declared range.
|
|
1222
1245
|
*
|
|
1223
1246
|
* @example
|
|
1224
1247
|
* ```ts
|
|
@@ -1230,7 +1253,8 @@ function sanitizeLine(line) {
|
|
|
1230
1253
|
*/
|
|
1231
1254
|
function versionsToRefusal(versions) {
|
|
1232
1255
|
if (versions.complete) return void 0;
|
|
1233
|
-
const
|
|
1256
|
+
const unpublished = filterUnpublished(versions.releases);
|
|
1257
|
+
const names = versions.releases.filter((release) => release.lookup !== "found" && !unpublished.includes(release)).map((release) => release.name);
|
|
1234
1258
|
return new ScaffoldError("FETCH", names.length === 0 ? "A declared dependency names no concrete floor." : `The registry named no release for ${names.join(", ")}.`, { names: names.length });
|
|
1235
1259
|
}
|
|
1236
1260
|
/**
|
|
@@ -1299,33 +1323,46 @@ function entriesToReleases(declared, entries) {
|
|
|
1299
1323
|
* @param releases - The release verdicts, one per declared dependency, in the
|
|
1300
1324
|
* order the declarations were looked up.
|
|
1301
1325
|
* @param declared - The runtime and development declarations the verdicts answer for.
|
|
1302
|
-
* @returns The runtime and development pins, each at the caret of its release
|
|
1303
|
-
*
|
|
1304
|
-
*
|
|
1326
|
+
* @returns The runtime and development pins, each at the caret of its release, without
|
|
1327
|
+
* the declaration of an unpublished `@orkestrel` package.
|
|
1328
|
+
* @throws `ScaffoldError('FETCH', …)` when a verdict other than an unpublished one named no
|
|
1329
|
+
* release, when a verdict has no matching declaration, or when the two sets differ in length.
|
|
1305
1330
|
*
|
|
1306
1331
|
* @remarks
|
|
1307
1332
|
* All or nothing: a caller never writes a partial pin set, because a manifest
|
|
1308
1333
|
* carrying some raised ranges and some stale ones is harder to recover from than
|
|
1309
|
-
* one that was not written at all.
|
|
1334
|
+
* one that was not written at all. The one omission is each row `filterUnpublished`
|
|
1335
|
+
* returns, whose declared range the write keeps.
|
|
1310
1336
|
*
|
|
1311
1337
|
* @example
|
|
1312
1338
|
* ```ts
|
|
1313
1339
|
* import { releasesToPins } from './helpers.js'
|
|
1314
1340
|
*
|
|
1315
1341
|
* releasesToPins(
|
|
1316
|
-
* [
|
|
1317
|
-
*
|
|
1342
|
+
* [
|
|
1343
|
+
* { name: '@orkestrel/learn', range: '^0.0.1', lookup: 'missing', note: 'the registry answered 404' },
|
|
1344
|
+
* { name: '@orkestrel/emitter', range: '^0.0.5', lookup: 'found', latest: '0.0.6' },
|
|
1345
|
+
* ],
|
|
1346
|
+
* {
|
|
1347
|
+
* runtime: [
|
|
1348
|
+
* { name: '@orkestrel/learn', range: '^0.0.1' },
|
|
1349
|
+
* { name: '@orkestrel/emitter', range: '^0.0.5' },
|
|
1350
|
+
* ],
|
|
1351
|
+
* development: [],
|
|
1352
|
+
* },
|
|
1318
1353
|
* ) // { runtime: [{ name: '@orkestrel/emitter', range: '^0.0.6' }], development: [] }
|
|
1319
1354
|
* ```
|
|
1320
1355
|
*/
|
|
1321
1356
|
function releasesToPins(releases, declared) {
|
|
1322
|
-
const
|
|
1357
|
+
const unpublished = filterUnpublished(releases);
|
|
1358
|
+
const refused = releases.filter((release) => release.lookup !== "found" && !unpublished.includes(release));
|
|
1323
1359
|
if (refused.length > 0) throw new ScaffoldError("FETCH", `The registry named no release for ${refused.map((release) => release.name).join(", ")}.`, { names: refused.length });
|
|
1324
1360
|
const dependencies = [...declared.runtime, ...declared.development];
|
|
1325
1361
|
const pins = Array.from(releases.keys(), (index) => {
|
|
1326
1362
|
const release = releases[index];
|
|
1327
1363
|
const dependency = dependencies[index];
|
|
1328
1364
|
if (release === void 0 || dependency === void 0) throw new ScaffoldError("FETCH", "The release answer has no matching declaration.");
|
|
1365
|
+
if (unpublished.includes(release)) return void 0;
|
|
1329
1366
|
if (release.lookup !== "found") throw new ScaffoldError("FETCH", `The registry named no release for ${release.name}.`);
|
|
1330
1367
|
return {
|
|
1331
1368
|
name: dependency.name,
|
|
@@ -1333,9 +1370,11 @@ function releasesToPins(releases, declared) {
|
|
|
1333
1370
|
};
|
|
1334
1371
|
});
|
|
1335
1372
|
if (pins.length !== dependencies.length) throw new ScaffoldError("FETCH", "The release answer does not match the declaration set.");
|
|
1373
|
+
const runtime = pins.slice(0, declared.runtime.length);
|
|
1374
|
+
const development = pins.slice(declared.runtime.length);
|
|
1336
1375
|
return {
|
|
1337
|
-
runtime:
|
|
1338
|
-
development:
|
|
1376
|
+
runtime: runtime.filter((pin) => pin !== void 0),
|
|
1377
|
+
development: development.filter((pin) => pin !== void 0)
|
|
1339
1378
|
};
|
|
1340
1379
|
}
|
|
1341
1380
|
/**
|
|
@@ -2226,6 +2265,10 @@ var CLI = class {
|
|
|
2226
2265
|
runtime: dependenciesToFleet(declarations.runtime),
|
|
2227
2266
|
development: dependenciesToFleet(declarations.development)
|
|
2228
2267
|
}, command.offline === true);
|
|
2268
|
+
if (filterUnpublished(versions.releases).length > 0) {
|
|
2269
|
+
const names = versions.releases.filter((release) => release.lookup !== "found").map((release) => release.name);
|
|
2270
|
+
throw new ScaffoldError("FETCH", `The registry named no release for ${names.join(", ")}.`, { names: names.length });
|
|
2271
|
+
}
|
|
2229
2272
|
const refusal = versionsToRefusal(versions);
|
|
2230
2273
|
if (refusal !== void 0) throw refusal;
|
|
2231
2274
|
const resolved = replacePlanRanges(plan, versions.pins);
|
|
@@ -2359,8 +2402,9 @@ var CLI = class {
|
|
|
2359
2402
|
this.#say(resultToTally(result));
|
|
2360
2403
|
}
|
|
2361
2404
|
if (versions.forced || host.forced) this.#reportBaselines(outcome.provenance);
|
|
2405
|
+
const kept = this.#keep(versions.releases);
|
|
2362
2406
|
if (command.offline !== true && (versions.forced || host.forced)) return 1;
|
|
2363
|
-
return auditToExit(terminal);
|
|
2407
|
+
return Math.max(auditToExit(terminal), kept);
|
|
2364
2408
|
} finally {
|
|
2365
2409
|
host.materializer.destroy();
|
|
2366
2410
|
}
|
|
@@ -2375,7 +2419,8 @@ var CLI = class {
|
|
|
2375
2419
|
const outcome = await this.#assemble(command, target, floor, materializer, previous);
|
|
2376
2420
|
if (command.json === true) this.#report(outcome);
|
|
2377
2421
|
else this.#recount(outcome);
|
|
2378
|
-
|
|
2422
|
+
const kept = this.#keep(outcome.membership?.releases ?? []);
|
|
2423
|
+
return outcome.membership === void 0 || outcome.provenance.guides === "floor" ? 1 : kept;
|
|
2379
2424
|
}
|
|
2380
2425
|
async #assemble(command, target, floor, materializer, previous) {
|
|
2381
2426
|
try {
|
|
@@ -2497,8 +2542,9 @@ var CLI = class {
|
|
|
2497
2542
|
for (const line of renderManifestEntries(absent)) if (!remaining.has(line)) this.#say(`Inserted ${line} in package.json.`);
|
|
2498
2543
|
if (remainder.note !== void 0) this.#warn(remainder.note);
|
|
2499
2544
|
}
|
|
2545
|
+
const kept = this.#keep(outcome.releases);
|
|
2500
2546
|
if (remainder.note !== void 0) return 1;
|
|
2501
|
-
return auditToExit(terminal);
|
|
2547
|
+
return Math.max(auditToExit(terminal), kept);
|
|
2502
2548
|
} finally {
|
|
2503
2549
|
host.materializer.destroy();
|
|
2504
2550
|
}
|
|
@@ -2676,7 +2722,8 @@ var CLI = class {
|
|
|
2676
2722
|
};
|
|
2677
2723
|
}
|
|
2678
2724
|
const releases = await this.#lookup(dependencies);
|
|
2679
|
-
|
|
2725
|
+
const unpublished = filterUnpublished(releases);
|
|
2726
|
+
if (releases.filter((release) => (release.lookup === "missing" || release.lookup === "unmatched") && !unpublished.includes(release)).length > 0) return {
|
|
2680
2727
|
releases,
|
|
2681
2728
|
pins: {
|
|
2682
2729
|
runtime: [],
|
|
@@ -2699,7 +2746,10 @@ var CLI = class {
|
|
|
2699
2746
|
};
|
|
2700
2747
|
return {
|
|
2701
2748
|
releases,
|
|
2702
|
-
pins:
|
|
2749
|
+
pins: {
|
|
2750
|
+
runtime: floorPins.runtime.filter(({ name }) => !unpublished.some((release) => release.name === name)),
|
|
2751
|
+
development: floorPins.development.filter(({ name }) => !unpublished.some((release) => release.name === name))
|
|
2752
|
+
},
|
|
2703
2753
|
baseline: "floor",
|
|
2704
2754
|
forced: true,
|
|
2705
2755
|
complete: true
|
|
@@ -2804,6 +2854,7 @@ var CLI = class {
|
|
|
2804
2854
|
const tree = resolveContainedPath(target, TREE_TEST_PATH);
|
|
2805
2855
|
const service = resolveContainedPath(target, SERVICE_SETUP_PATH);
|
|
2806
2856
|
const global = resolveContainedPath(target, GLOBAL_SETUP_PATH);
|
|
2857
|
+
const isolation = resolveContainedPath(target, ISOLATION_SETUP_PATH);
|
|
2807
2858
|
const journey = resolveContainedPath(target, JOURNEY_CONFIG_PATH);
|
|
2808
2859
|
const browserEntry = resolveContainedPath(target, "app/browser/main.ts");
|
|
2809
2860
|
const skills = resolveContainedPath(target, SKILLS_CONFIG_PATH);
|
|
@@ -2834,6 +2885,7 @@ var CLI = class {
|
|
|
2834
2885
|
service: service !== void 0 && isExactCaseFile(service),
|
|
2835
2886
|
studies,
|
|
2836
2887
|
global: global !== void 0 && isExactCaseFile(global),
|
|
2888
|
+
isolation: isolation !== void 0 && isExactCaseFile(isolation),
|
|
2837
2889
|
journey: journey !== void 0 && isExactCaseFile(journey),
|
|
2838
2890
|
base: browserEntry !== void 0 && isExactCaseFile(browserEntry),
|
|
2839
2891
|
skills: skills !== void 0 && isExactCaseFile(skills)
|
|
@@ -3290,6 +3342,11 @@ var CLI = class {
|
|
|
3290
3342
|
if (release.name.startsWith("@orkestrel/") && release.range !== `^${release.latest}`) this.#warn(`${release.name}: ${release.range} differs from ^${release.latest}.`);
|
|
3291
3343
|
}
|
|
3292
3344
|
}
|
|
3345
|
+
#keep(releases) {
|
|
3346
|
+
const kept = filterUnpublished(releases);
|
|
3347
|
+
for (const { name, range } of kept) this.#warn(`Kept the declared range ${range} for ${name}: the registry or the organization catalog names no release of it, so no range was written for it.`);
|
|
3348
|
+
return kept.length > 0 ? 1 : 0;
|
|
3349
|
+
}
|
|
3293
3350
|
#reportReplacements(before, after) {
|
|
3294
3351
|
const terminal = new Map(after.findings.map((finding) => [finding.path, finding]));
|
|
3295
3352
|
for (const finding of before.findings) {
|