@orkestrel/scaffold 0.0.15 → 0.0.17

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.
@@ -30,33 +30,33 @@ descriptions never enter agent instruction context.
30
30
  | Package | Version |
31
31
  | --------------------- | ------- |
32
32
  | @orkestrel/abort | 0.0.4 |
33
- | @orkestrel/agent | 0.0.11 |
33
+ | @orkestrel/agent | 0.0.13 |
34
34
  | @orkestrel/browser | 0.0.8 |
35
35
  | @orkestrel/budget | 0.0.4 |
36
36
  | @orkestrel/console | 0.0.4 |
37
37
  | @orkestrel/contract | 0.0.9 |
38
38
  | @orkestrel/csv | 0.0.2 |
39
- | @orkestrel/database | 0.0.6 |
39
+ | @orkestrel/database | 0.0.7 |
40
40
  | @orkestrel/emitter | 0.0.5 |
41
41
  | @orkestrel/guide | 0.0.8 |
42
42
  | @orkestrel/html | 0.0.1 |
43
43
  | @orkestrel/indexeddb | 0.0.6 |
44
44
  | @orkestrel/interpret | 0.0.7 |
45
45
  | @orkestrel/markdown | 0.0.7 |
46
- | @orkestrel/mcp | 0.0.7 |
46
+ | @orkestrel/mcp | 0.0.9 |
47
47
  | @orkestrel/middleware | 0.0.6 |
48
48
  | @orkestrel/msg | 0.0.5 |
49
49
  | @orkestrel/ndjson | 0.0.5 |
50
- | @orkestrel/ollama | 0.0.7 |
51
- | @orkestrel/pool | 0.0.4 |
50
+ | @orkestrel/ollama | 0.0.8 |
51
+ | @orkestrel/pool | 0.0.6 |
52
52
  | @orkestrel/program | 0.0.6 |
53
53
  | @orkestrel/qualifier | 0.0.7 |
54
- | @orkestrel/queue | 0.0.4 |
54
+ | @orkestrel/queue | 0.0.7 |
55
55
  | @orkestrel/rater | 0.0.8 |
56
56
  | @orkestrel/reason | 0.0.4 |
57
- | @orkestrel/relation | 0.0.6 |
58
- | @orkestrel/router | 0.0.6 |
59
- | @orkestrel/scaffold | 0.0.13 |
57
+ | @orkestrel/relation | 0.0.7 |
58
+ | @orkestrel/router | 0.0.7 |
59
+ | @orkestrel/scaffold | 0.0.16 |
60
60
  | @orkestrel/sea | 0.0.4 |
61
61
  | @orkestrel/server | 0.0.7 |
62
62
  | @orkestrel/sqlite | 0.0.6 |
@@ -64,12 +64,12 @@ descriptions never enter agent instruction context.
64
64
  | @orkestrel/template | 0.0.2 |
65
65
  | @orkestrel/terminal | 0.0.5 |
66
66
  | @orkestrel/timeout | 0.0.4 |
67
- | @orkestrel/tool | 0.0.7 |
68
- | @orkestrel/toolbox | 0.0.1 |
67
+ | @orkestrel/tool | 0.0.9 |
68
+ | @orkestrel/toolbox | 0.0.2 |
69
69
  | @orkestrel/websocket | 0.0.7 |
70
- | @orkestrel/worker | 0.0.4 |
71
- | @orkestrel/workflow | 0.0.7 |
72
- | @orkestrel/workspace | 0.0.1 |
70
+ | @orkestrel/worker | 0.0.5 |
71
+ | @orkestrel/workflow | 0.0.9 |
72
+ | @orkestrel/workspace | 0.0.2 |
73
73
 
74
74
  <!-- catalog:end -->
75
75
 
@@ -290,7 +290,8 @@ the accumulated `questions`, one `CompileRecord` per stage, any `CompileFailure`
290
290
  `GuideSync`, `VersionSync`, and `SyncReport` are the freshness shapes. `GuideSync` carries the
291
291
  fetched `content`, its `freshness`, an optional `note` explaining a non-clean outcome, and an
292
292
  optional `baseline` — the SHA-256 of the observed local mirror, or the literal `absent`, present
293
- only on target-aware pulls. `VersionSync` compares a declared `range` to the registry `latest`.
293
+ only on target-aware synchronization. `VersionSync` compares a declared `range` to the registry
294
+ `latest`.
294
295
  `SyncReport` is `clean` only when nothing drifted and nothing failed. `CatalogEntry` is one fleet
295
296
  package row; its `description` is the flattened text of that package's own guide's first
296
297
  blockquote, and the empty string when that guide is missing, unreadable, or carries no blockquote.
@@ -319,6 +320,7 @@ From [`types.ts`](../../src/server/types.ts).
319
320
  | `CatalogAllowance` | type |
320
321
  | `SyncBase` | type |
321
322
  | `SyncBranch` | type |
323
+ | `VersionLookup` | type |
322
324
  | `GuideWrite` | interface |
323
325
  | `MaterializerInterface` | interface |
324
326
  | `SyncEventMap` | type |
@@ -346,7 +348,9 @@ identity, and `WriteDirectoryResult` pairs the final anchor with the subset a ca
346
348
  `CatalogAllowance` are one-cell `Float64Array` allowances: the former shares a byte budget across
347
349
  concurrent network readers, while the latter shares one entry budget across every fleet root and
348
350
  child visited by a catalog operation. `SyncBase` and `SyncBranch` are normalized strings returned
349
- only by their corresponding boundary parsers.
351
+ only by their corresponding boundary parsers. `VersionLookup` is the bare-name registry result:
352
+ a successful lookup carries `latest` with `freshness: 'behind'` because no declared range was
353
+ supplied as a reference, while `missing` and `failed` carry a `note` and no invented version.
350
354
 
351
355
  `SyncOptions` groups the injectable endpoints under the entity they configure — `guides` with
352
356
  `base`, `branch`, and `timeout`; `registry` with `base` and `timeout` — alongside `concurrency`,
@@ -689,6 +693,7 @@ From [`parsers.ts`](../../src/server/parsers.ts).
689
693
  | Name | Kind |
690
694
  | -------------------------- | -------- |
691
695
  | `parseSyncDependencies` | function |
696
+ | `parseSyncNames` | function |
692
697
  | `parseFilesystemPaths` | function |
693
698
  | `parsePortablePaths` | function |
694
699
  | `parseWritePreconditions` | function |
@@ -708,7 +713,9 @@ subset used in raw-guide URLs: it rejects overlong values, empty or dot-leading
708
713
  `@{`, the single `@`, trailing dots, and `.lock` suffixes without regard to case.
709
714
  `parseSyncCurrent` snapshots only the declared guide references, enforcing both the per-file and
710
715
  cumulative byte allowance. The three array parsers return frozen copies read through property
711
- descriptors, so a caller-supplied array can never smuggle in a getter.
716
+ descriptors, so a caller-supplied array can never smuggle in a getter. `parseSyncNames` snapshots a
717
+ bounded dense array of unique npm package names and validates only the names; declaration ranges
718
+ remain the responsibility of `parseSyncDependencies` and the blueprint gate.
712
719
 
713
720
  ### Shapers — core
714
721
 
@@ -1008,7 +1015,7 @@ error.
1008
1015
 
1009
1016
  `packageShortName` strips the canonical scope, `guideStub` renders the pointer written when a
1010
1017
  dependency guide is not vendored yet, `readGuideReferences` reads a target's existing local mirrors
1011
- so a pull's verdicts are target-relative, and `syncReportOf` assembles one report from already
1018
+ for package names so synchronization verdicts are target-relative, and `syncReportOf` assembles one report from already
1012
1019
  ordered guide and version outcomes.
1013
1020
 
1014
1021
  ### Compilers — core
@@ -1104,7 +1111,7 @@ along the three `ViteMachinery` axes:
1104
1111
  | Machinery | Emitted when |
1105
1112
  | ------------------------------------------------------------------------ | ------------------------------------ |
1106
1113
  | Shared CSS analysis (`ENVIRONMENT_CSS`, `preprocessCSS`, `isCSSRequest`) | a `src` or `app` browser environment |
1107
- | Playwright provider and `resolveChromium` | a `src` or `app` browser environment |
1114
+ | Playwright provider and managed/system browser discovery | a `src` or `app` browser environment |
1108
1115
  | Vue plugin, HTML boundary, browser development server | an `app` browser environment |
1109
1116
  | Output containment (`outputBoundary`, `enforceOutputPath`) | anything the workspace builds |
1110
1117
 
@@ -1290,16 +1297,19 @@ The interface also exposes the readonly `emitter`.
1290
1297
 
1291
1298
  #### `SyncInterface`
1292
1299
 
1293
- | Method | Returns |
1294
- | ---------- | ---------------------------------- |
1295
- | `guides` | `Promise<readonly GuideSync[]>` |
1296
- | `versions` | `Promise<readonly VersionSync[]>` |
1297
- | `catalog` | `Promise<readonly CatalogEntry[]>` |
1298
- | `pull` | `Promise<SyncReport>` |
1299
- | `write` | `Promise<readonly string[]>` |
1300
- | `destroy` | `void` |
1301
-
1302
- `guides(deps, current?)` fetches each dependency's upstream guide. The optional `current` map is
1300
+ | Method | Returns |
1301
+ | ---------- | ----------------------------------- |
1302
+ | `lookup` | `Promise<readonly VersionLookup[]>` |
1303
+ | `guides` | `Promise<readonly GuideSync[]>` |
1304
+ | `versions` | `Promise<readonly VersionSync[]>` |
1305
+ | `catalog` | `Promise<readonly CatalogEntry[]>` |
1306
+ | `pull` | `Promise<SyncReport>` |
1307
+ | `mirror` | `Promise<SyncReport>` |
1308
+ | `write` | `Promise<readonly string[]>` |
1309
+ | `destroy` | `void` |
1310
+
1311
+ `lookup(names)` resolves registry versions from bare package names, with no declaration range
1312
+ required or synthesized. `guides(deps, current?)` fetches each dependency's upstream guide. The optional `current` map is
1303
1313
  keyed by dependency name: with it, a fetched guide byte-equal to its entry verdicts `current` and
1304
1314
  anything else verdicts `behind`; without it, every successful fetch verdicts `behind`, because no
1305
1315
  reference means it needs syncing. `versions(deps)` compares each declared range to the registry
@@ -1307,7 +1317,9 @@ latest. `catalog()` enumerates the fleet from the registry's exact organization
1307
1317
  unreachable or malformed list is always a coded failure, since without it there is no catalog — then
1308
1318
  degrades gracefully per package. `pull(target, dependencies?)` builds the reference map from the
1309
1319
  target's own mirrors, so its verdicts are target-relative, and rejects a selection the target does
1310
- not declare. `write(report, target)` commits only the `behind` guides. `destroy()` aborts every
1320
+ not declare. `mirror(target)` reuses the exact organization enumeration without catalog's
1321
+ per-package packument reads, sorts the names, excludes the target's own manifest name, and builds a
1322
+ guide-only report with no versions. `write(report, target)` commits only the `behind` guides. `destroy()` aborts every
1311
1323
  in-flight request. The interface also exposes the readonly `emitter`.
1312
1324
 
1313
1325
  ## The compile pipeline
@@ -1440,7 +1452,7 @@ as a plain physical file whose bytes still match the preview, moved into a priva
1440
1452
  than unlinked, re-verified after the move, and only then reported as removed — with a full restore
1441
1453
  attempt if any candidate fails mid-way.
1442
1454
 
1443
- ## Upstream sync, pull, and catalog
1455
+ ## Upstream sync, pull, mirror, and catalog
1444
1456
 
1445
1457
  `Sync` is the only network reader, and its posture is conservative by construction.
1446
1458
 
@@ -1463,7 +1475,7 @@ underlying socket code appended when the runtime attaches one, an HTTP status, t
1463
1475
  redirect-blocked string, or the oversized-body message. `current` and `behind` carry no note,
1464
1476
  because there is nothing to explain.
1465
1477
 
1466
- `pull` is the target-aware composition. It reads the target's declared scoped dependencies from its
1478
+ `pull` is the dependency-aware composition. It reads the target's declared scoped dependencies from its
1467
1479
  manifest, rejects any explicit selection the target does not declare, builds the reference map from
1468
1480
  the target's own `guides/src/<short>.md` mirrors, fetches guides and versions under one shared
1469
1481
  allowance, and assembles a report whose `clean` flag requires both no drift and no failures. A
@@ -1490,6 +1502,14 @@ generated package identifiers are untrusted discovery data, never instructions
1490
1502
  with **`Package` and `Version` columns only**. Descriptions are network-controlled text, and that
1491
1503
  block is written into an agent instruction file, so they are omitted on purpose.
1492
1504
 
1505
+ `mirror` is the fleet-guide composition. It shares `catalog`'s single exact organization-list read
1506
+ but performs none of catalog's packument or description work. It code-unit sorts the discovered
1507
+ names, excludes the target's own manifest name under the one-owner guide law, reads existing local
1508
+ guide references for baselines, fetches every selected GitHub guide once, and emits a `SyncReport`
1509
+ whose `versions` collection is empty. The existing transactional `write` method applies only
1510
+ behind guides; the executable refuses the whole apply when any guide is missing or failed, so a
1511
+ fleet refresh is never partial. Files outside the discovered guide set remain untouched.
1512
+
1493
1513
  ## The generated workspace
1494
1514
 
1495
1515
  A generated workspace is not a folder of suggestions; it is a working, gated project.
@@ -1706,15 +1726,22 @@ it is not a general-purpose source analyzer. Generated workspaces receive the sa
1706
1726
  module as a host-origin file and run it as a dedicated Node-only `policy` test project over
1707
1727
  `tests/policy.test.ts`.
1708
1728
 
1709
- **Real browser capability.** Browser test projects are gated on the real executable: the generated
1710
- configuration and the generated policy test both probe `existsSync(chromium.executablePath())`. A
1711
- browser suite runs when a real Chromium is installed and is skipped honestly when it is not, rather
1712
- than being faked. The gate is applied at registration, not inside the real browser project: without
1713
- Chromium, each browser factory is replaced by a same-label Node/no-test placeholder, so generated
1714
- `--project <label>` and `--project=<label>` filters still resolve while no browser code runs. The
1715
- root permits an empty run only when every recognized exact project filter names one of those gated
1716
- placeholders; an unreadable or mixed filter keeps the ordinary no-test failure semantics for its
1717
- Node projects. One printed warning names every gated project label. A machine with a browser
1729
+ **Real browser capability.** Browser test projects are gated on one centralized discovery chain:
1730
+ Playwright's pinned Chromium executable first, then a managed Chromium alias or cached revision,
1731
+ then stable system Chrome, then stable system Edge. Managed candidates must be executable regular
1732
+ files. System channels are selected only when their executable exists at Playwright's standard
1733
+ Linux, macOS, or Windows installation location; custom installations are not guessed. The generated
1734
+ policy test consumes the same discovery helpers and accepts either an executable managed path or the
1735
+ stable `chrome` / `msedge` channel, so it does not maintain a second heuristic.
1736
+
1737
+ A browser suite runs when any one of those real browser capabilities is available and is skipped
1738
+ honestly when none is, rather than being faked. The gate is applied at registration, not inside the
1739
+ real browser project: without a browser, each browser factory is replaced by a same-label
1740
+ Node/no-test placeholder, so generated `--project <label>` and `--project=<label>` filters still
1741
+ resolve while no browser code runs. The root permits an empty run only when every recognized exact
1742
+ project filter names one of those gated placeholders; an unreadable or mixed filter keeps the
1743
+ ordinary no-test failure semantics for its Node projects. One printed warning names every gated
1744
+ project label and says no Playwright Chromium, Chrome, or Edge was found. A machine with a browser
1718
1745
  registers and runs the real browser suites unchanged; a machine without one runs the remaining
1719
1746
  projects and says so.
1720
1747
 
@@ -1756,12 +1783,13 @@ each Codex agent's declared `sandbox_mode` is its mechanical permission floor, w
1756
1783
  ## The `scaffold` executable
1757
1784
 
1758
1785
  The bin is a thin command-line shell over the two library faces. It exports nothing, so it carries
1759
- no module API of its own. Six verbs:
1786
+ no module API of its own. Seven verbs:
1760
1787
 
1761
1788
  | Verb | Purpose |
1762
1789
  | --------- | -------------------------------------------------------- |
1763
1790
  | `new` | scaffold a workspace into `./<name>` |
1764
1791
  | `pull` | refresh vendored guides and versions, report drift |
1792
+ | `mirror` | refresh every published Orkestrel package guide |
1765
1793
  | `audit` | whole-plan conformance report |
1766
1794
  | `repair` | restore host-owned files and optional generated canon |
1767
1795
  | `fleet` | audit or repair every workspace under the cwd's children |
@@ -1781,8 +1809,10 @@ extras so the workspace stays audit-clean.
1781
1809
  repeatable and points at a local template or catalog source instead of the bundled one.
1782
1810
  On `pull`, `--deps x,y` limits refresh to those declared Orkestrel dependencies; without it, every
1783
1811
  declared dependency mirror is considered.
1812
+ `mirror` accepts no dependency selection: its exact npm organization discovery is the operation's
1813
+ scope, and it fetches guides without registry version or packument requests.
1784
1814
  `--groups a,b` scopes an audit to artifact groups. `--live` adds an upstream freshness check to an
1785
- audit. `--strict` makes a pull throw on a network fault. `--offline` restricts a catalog to local
1815
+ audit. `--strict` makes a pull or mirror throw on a network fault. `--offline` restricts a catalog to local
1786
1816
  sources. `--prune` opts a repair or fleet run into deleting unexpected files under the three prune
1787
1817
  directories. `--generated` opts a repair or fleet run into restoring generated canon except
1788
1818
  `package.json`; on `audit`, it is inherited if the interactive repair hand-off is accepted.
@@ -2252,7 +2282,7 @@ isBehind(rangeToFreshness('^0.0.7', '0.0.9')) // true
2252
2282
 
2253
2283
  packageShortName('@orkestrel/contract') // 'contract'
2254
2284
  guideStub('guides/src/contract.md') // the local pointer content
2255
- readGuideReferences('./packages/router', [{ name: '@orkestrel/contract', range: '^0.0.7' }])
2285
+ readGuideReferences('./packages/router', ['@orkestrel/contract'])
2256
2286
  syncReportOf('./packages/router', [], []) // { clean: true, failed: 0, … }
2257
2287
  ```
2258
2288
 
@@ -2308,6 +2338,7 @@ import { createSync } from '@orkestrel/scaffold/server'
2308
2338
 
2309
2339
  const sync = createSync({ concurrency: 4, retries: 1 })
2310
2340
 
2341
+ await sync.lookup(['@orkestrel/contract'])
2311
2342
  const report = await sync.pull('.')
2312
2343
  if (report.failed === 0) await sync.write(report, '.')
2313
2344
 
@@ -2316,9 +2347,24 @@ await sync.guides(deps)
2316
2347
  await sync.versions(deps)
2317
2348
  await sync.catalog()
2318
2349
 
2350
+ const mirror = await sync.mirror('.')
2351
+ if (mirror.failed === 0) await sync.write(mirror, '.')
2352
+
2319
2353
  sync.destroy()
2320
2354
  ```
2321
2355
 
2356
+ Refresh the entire published guide mirror from an installed package:
2357
+
2358
+ ```sh
2359
+ npx scaffold mirror --apply --yes
2360
+ ```
2361
+
2362
+ Or from this checkout after building:
2363
+
2364
+ ```sh
2365
+ node ./dist/bin/scaffold.js mirror --apply --yes
2366
+ ```
2367
+
2322
2368
  ### Fleet discovery, prune scanning, and the local catalog
2323
2369
 
2324
2370
  ```ts
@@ -2432,6 +2478,7 @@ import {
2432
2478
  parseSyncBranch,
2433
2479
  parseSyncCurrent,
2434
2480
  parseSyncDependencies,
2481
+ parseSyncNames,
2435
2482
  parseSyncOptions,
2436
2483
  parseWritePreconditions,
2437
2484
  syncGuideOptionsShape,
@@ -2454,6 +2501,7 @@ parseMaterializerOptions({ host: './dist/host' })
2454
2501
  parseSyncBase('registry.npmjs.org') // 'https://registry.npmjs.org'
2455
2502
  parseSyncBranch('main')
2456
2503
  parseSyncCurrent({ '@orkestrel/contract': '# contract\n' }, ['@orkestrel/contract'], 16_777_216)
2504
+ parseSyncNames(['@orkestrel/contract', 'zod'])
2457
2505
  parseSyncDependencies([{ name: '@orkestrel/contract', range: '^0.0.7' }], false)
2458
2506
  parsePortablePaths(['src/core/index.ts'], 1_000)
2459
2507
  parseFilesystemPaths(['./packages'], 1_000)