@orkestrel/scaffold 0.0.26 → 0.0.27

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.
@@ -1,6 +1,7 @@
1
1
  # Orchestration
2
2
 
3
- How agents are dispatched, supervised, and accepted. Every harness follows this file.
3
+ How agents are dispatched, how long-running work is supervised, and how both are accepted. Every
4
+ harness follows this file.
4
5
 
5
6
  ## Authority
6
7
 
@@ -347,6 +348,24 @@ The harness bridge names the concrete mechanism for each of these.
347
348
  - Promote anything that must outlive the campaign into a durable artifact before the sweep — a
348
349
  commit message, a guide, a rule, a retrospective. What is only in a swept file did not survive.
349
350
 
351
+ ### Where campaign artifacts live
352
+
353
+ - Put every campaign artifact in the **orchestrator's** repository under `.orkestrel/<package>/`,
354
+ named for the package the campaign is about.
355
+ - Never put them in the package they are about. A published package's tree is its product.
356
+ - Claim nothing outside `.orkestrel/` unless Orkestrel scaffold mandates it. Everything Orkestrel
357
+ owns in a consumer's tree lives beneath that folder, so a convention can be settled there without
358
+ colliding with a convention that is not Orkestrel's.
359
+ - Keep the campaign narrative and every ruling in the durable artifact that owns it — the guide for
360
+ product truth, a rule or role file for process truth, the commit message for the decision itself.
361
+ Use `ROADMAP.md` only where the repository already keeps one.
362
+ - Prefer a mechanism that recomputes a fact over a document that records it. A ledger of live state
363
+ is stale from the moment it is written, and the next campaign reads it as current. Where the fact
364
+ can be derived, derive it: the fleet's publish order lives in the catalog table `scaffold catalog`
365
+ regenerates, not in a written order anyone has to remember to update.
366
+ - Prune the campaign folder in a commit at acceptance. The tree ends clean and the record stays
367
+ recoverable by hash. Git history is the archive; the working tree is the workspace.
368
+
350
369
  ### Required sections
351
370
 
352
371
  - **Role and engine.** The named role and its explicit engine.
@@ -416,6 +435,70 @@ wrong is right to stop.
416
435
  After reconciling findings into briefs, walk the retained finding list once. Every finding names
417
436
  the brief item that carries it. A finding with no carrier is a dropped finding.
418
437
 
438
+ ## Long-running commands
439
+
440
+ A bench exec, a Workflow, an install, a build, and a publish chain are one class of thing: a
441
+ command that outlives the turn that started it. Every law here binds all of them.
442
+
443
+ ### Launching
444
+
445
+ - The Orchestrator launches every long command as a harness-tracked background command under a hard
446
+ time cap. Never detach one from inside a dispatched agent. The harness owns the lifecycle,
447
+ completion re-invokes the session, and the cap kills a wedged command loudly instead of trusting
448
+ the agent to report its own failure. A wedged bridge is silent, and silence must never read as
449
+ progress.
450
+ - Write a multi-step chain to a script file and run the file. A chain composed inside one shell
451
+ argument cannot be read back, corrected, or re-run, and the record of what actually ran is the
452
+ argument text in a transcript rather than a file on disk.
453
+ - Detach anything that must survive its launching shell with `setsid`. A backgrounded flow the
454
+ harness reaps mid-step leaves the work half done and the exit status missing, and the reap looks
455
+ identical to the step failing.
456
+ - Size the cap from the observed high mark of comparable commands, plus an independently budgeted
457
+ gate allowance, plus explicit slack. Never size it from the estimate alone.
458
+ - Run the first use of any CLI flag, subcommand, quoting form, or stdin combination in a throwaway
459
+ probe. Never inside a dispatched unit or a publish chain.
460
+ - A launch is not a launch until its record grows past its header. Confirm the log advanced beyond
461
+ the head before recording that the command started, and treat an instantly-dead log as a failed
462
+ launch whose tail is the evidence.
463
+ - Keep network-dependent work out of sandboxed bench execs. Bench sandboxes deny network, so
464
+ lockfile generation, real installs, and live fetches belong to the Orchestrator's own tracked
465
+ commands or a network-capable native agent. A bench exec hanging on `npm` until its cap fires is
466
+ the signature of this misroute, not of a slow bench.
467
+ - A Workflow journals identically and dies identically, so give it the same watch — with one
468
+ correction. A workflow journal writes only at agent start and result, so its mtime goes quiet for
469
+ minutes during healthy work, and the liveness signal is the newest subagent transcript instead. A
470
+ watch that reports only new events cannot report a death, because silence and progress look the
471
+ same; the filter must fire on absence. Recover with `resumeFromRunId`, which returns every
472
+ completed agent from cache and re-runs only what never finished.
473
+
474
+ ### Reading liveness
475
+
476
+ Read liveness from the artifact the work produces, never from its wrapper. A subagent's transcript
477
+ file can report zero bytes while the agent is working normally, so an empty or stale wrapper proves
478
+ nothing.
479
+
480
+ - Judge a unit by what it has changed in the tree: modification times on the files it owns, the
481
+ counts its suite reports, the report it was told to write.
482
+ - Check that before killing anything. A healthy unit killed on a false signal loses everything it
483
+ had not yet written down, and the loss is charged to the orchestrator, not the unit.
484
+ - If a unit must be stopped, say plainly that it was stopped and why, then assess the tree it left
485
+ rather than assuming its partial bytes are either good or worthless.
486
+ - Follow the deviation ladder for a stalled journal or a cap-killed exec, using the session id from
487
+ the journal head as the recovery handle.
488
+
489
+ ### Confirm dead before relaunching
490
+
491
+ - Prove the previous run is gone before starting another. List the processes and read the list. A
492
+ second run started beside a live first one produces failures that read as the subject's — a
493
+ publish chain relaunched over a live one reports `EOTP` and `E403` that are its own two processes
494
+ colliding, and both readings point at the registry.
495
+ - Kill by process id, never by pattern. `pkill -f` matches the relaunch that is already starting, so
496
+ the pattern that cleans up the old run kills the new one and the cleanup reads as a launch
497
+ failure.
498
+ - Read a failure against what was running when it happened, not against what you believe was
499
+ running. The check costs one command and is the only thing that separates a real failure from
500
+ self-inflicted contention.
501
+
419
502
  ## Bench laws
420
503
 
421
504
  External engines widen capacity. They never inherit authority. Treat every bench output as a
@@ -424,6 +507,9 @@ proposal or hypothesis until it is verified against source and accepted by the O
424
507
  A bench is cross-provider reach only. Never send a model across a bridge when the running harness
425
508
  hosts it natively.
426
509
 
510
+ A bench exec is a long-running command, so every law under **Long-running commands** binds it too.
511
+ This section adds what is true of a bench and nothing else.
512
+
427
513
  Every bridge verifies before running that its CLI resolves and its bench is authenticated, and stops
428
514
  with a deviation report naming the fallback when either fails. The role file owns the exact
429
515
  invocation, flags, paths, probe, and recovery ladder; these four laws bind every bench regardless of
@@ -452,45 +538,6 @@ transport.
452
538
  is dispatched and as it returns, because each encodes knowledge that costs real money to
453
539
  re-derive and none of it is reproducible from the diff.
454
540
 
455
- ### Where campaign artifacts live
456
-
457
- - Put every campaign artifact in the **orchestrator's** repository under `.orkestrel/<package>/`,
458
- named for the package the campaign is about.
459
- - Never put them in the package they are about. A published package's tree is its product.
460
- - Claim nothing outside `.orkestrel/` unless Orkestrel scaffold mandates it. Everything Orkestrel
461
- owns in a consumer's tree lives beneath that folder, so a convention can be settled there without
462
- colliding with a convention that is not Orkestrel's.
463
- - Keep the campaign narrative and every ruling in the durable artifact that owns it — the guide for
464
- product truth, a rule or role file for process truth, the commit message for the decision itself.
465
- Use `ROADMAP.md` only where the repository already keeps one.
466
- - Prune the campaign folder in a commit at acceptance. The tree ends clean and the record stays
467
- recoverable by hash. Git history is the archive; the working tree is the workspace.
468
-
469
- ### Launching a long exec
470
-
471
- - The Orchestrator launches every long bench exec as a harness-tracked background command under a
472
- hard time cap. Never detach one from inside a bridge agent. The harness owns the lifecycle,
473
- completion re-invokes the session, and the cap kills a wedged bench loudly instead of trusting
474
- the bridge to report its own failure. A wedged bridge is silent, and silence must never read as
475
- progress.
476
- - A Workflow journals identically and dies identically, so give it the same watch — with one
477
- correction. A workflow journal writes only at agent start and result, so its mtime goes quiet for
478
- minutes during healthy work, and the liveness signal is the newest subagent transcript instead. A
479
- watch that reports only new events cannot report a death, because silence and progress look the
480
- same; the filter must fire on absence. Recover with `resumeFromRunId`, which returns every
481
- completed agent from cache and re-runs only what never finished.
482
- - Size the cap from the observed high mark of comparable units, plus an independently budgeted gate
483
- allowance, plus explicit slack. Never size it from the estimate alone.
484
- - Run the first use of any CLI flag, subcommand, quoting form, or stdin combination in a throwaway
485
- probe. Never inside a dispatched unit.
486
- - A launch is not a launch until the journal grows past its header. Confirm the event stream
487
- advanced beyond the session-configured head before recording that the exec started, and treat an
488
- instantly-dead journal as a failed launch whose tail is the evidence.
489
- - Keep network-dependent work out of sandboxed bench execs. Bench sandboxes deny network, so
490
- lockfile generation, real installs, and live fetches belong to the Orchestrator's own tracked
491
- commands or a network-capable native agent. A bench exec hanging on `npm` until its cap fires is
492
- the signature of this misroute, not of a slow bench.
493
-
494
541
  ### Recovering a dark bench
495
542
 
496
543
  - A probe that finds a bench binary present but authentication unavailable starts recovery in the
@@ -503,20 +550,95 @@ transport.
503
550
  cannot complete, record the bench dark, name the fallback in the plan, and say so.
504
551
  - The role file owns each bench's exact login command and probe.
505
552
 
506
- ### Reading liveness
507
-
508
- Read liveness from the artifact the work produces, never from its wrapper. A subagent's transcript
509
- file can report zero bytes while the agent is working normally, so an empty or stale wrapper proves
510
- nothing.
511
-
512
- - Judge a unit by what it has changed in the tree: modification times on the files it owns, the
513
- counts its suite reports, the report it was told to write.
514
- - Check that before killing anything. A healthy unit killed on a false signal loses everything it
515
- had not yet written down, and the loss is charged to the orchestrator, not the unit.
516
- - If a unit must be stopped, say plainly that it was stopped and why, then assess the tree it left
517
- rather than assuming its partial bytes are either good or worthless.
518
- - Follow the deviation ladder for a stalled journal or a cap-killed exec, using the session id from
519
- the journal head as the recovery handle.
553
+ ## Publishing the fleet
554
+
555
+ Publishing is the user's decision and the user's credential. The Orchestrator prepares, surfaces
556
+ the approval, and runs the publishes the user asked for. It never substitutes an API key, an access
557
+ token, a copied auth file, or another login flow, and it never asks the user to paste a token into
558
+ the conversation.
559
+
560
+ A publish chain is a long-running command, so every law under **Long-running commands** binds it:
561
+ write the chain to a file, detach it with `setsid`, and confirm the previous one is dead before
562
+ starting another.
563
+
564
+ ### What a bump obliges
565
+
566
+ A runtime dependency and a development dependency have different blast radius, and confusing them
567
+ either publishes packages nobody needed to publish or leaves a consumer pinned to an older release.
568
+
569
+ - A **runtime** `dependencies` bump reaches every consumer of the published package. Every package
570
+ downstream of it re-pins, re-runs its gates, bumps, and republishes, in layer order.
571
+ - A **development** `devDependencies` bump reaches nobody. Re-pin it, prove the gates still green,
572
+ and commit to `main`. Do not bump the version and do not publish.
573
+ - A development bump that forces a change to `src` or `app` is no longer a development bump. The
574
+ published types or runtime moved, so that package bumps and publishes on its own account, and
575
+ its own dependents follow the runtime rule above.
576
+
577
+ Every package is `0.0.x`, where a caret pins one exact release. A dependent therefore sees a new
578
+ version only after it re-pins and republishes, so the fleet publishes in topological layer order
579
+ derived from runtime `dependencies` alone. Layers exist for a reason a flat pass cannot fix: two
580
+ ranges that disagree install two copies of the same package, and the compiler reads them as two
581
+ distinct types.
582
+
583
+ Read the order from the catalog table in `.claude/agents/orkestrel.md`, which `scaffold catalog`
584
+ regenerates from the registry. Its `Layer` column is the publish round. Regenerate it before
585
+ sequencing a cascade rather than trusting the copy in the tree, and never write a second order down
586
+ somewhere else.
587
+
588
+ The tooling packages sit outside that order because nothing depends on them at runtime. `scaffold`
589
+ is a development dependency of every package, including packages it depends on itself, so a runtime
590
+ layering would report a cycle that does not exist. Each package builds against the already-published
591
+ `scaffold`, never against an unpublished one, and a `scaffold` release therefore publishes on its own
592
+ and propagates as files rather than as a cascade.
593
+
594
+ ### Preparing
595
+
596
+ 1. **Bump from what the registry serves, not from the local manifest.** A repository's `version`
597
+ can sit a release behind what was published from another checkout, and bumping that produces a
598
+ version the registry already holds, which fails on upload after the whole gate chain has run.
599
+ Read the registry first.
600
+ 2. **Prepare a whole layer before authenticating.** Bump each version, re-pin every `@orkestrel`
601
+ range to what the registry serves now, install, and run the package's own `prepublishOnly` to
602
+ green. Move any self-pin in source with the manifest. Commit and push before the window opens.
603
+ 3. **Prepare the next layer only after this one is on the registry.** A dependent's new pin cannot
604
+ install until the version it names exists, so preparation and publication interleave and cannot
605
+ be batched ahead.
606
+
607
+ The window is for uploads. Every gate, build, install, and commit happens outside it, which is what
608
+ makes `--ignore-scripts` the right flag at publish time: the artifact was already proved, and the
609
+ flag is what stops the gate chain running a second time inside the five minutes.
610
+
611
+ ### Reaching the approval
612
+
613
+ - **Log in first** when the session is new or a day has passed. `npm login` and `npm publish` reach
614
+ the same browser approval, and a publish that has to run the login flow spends the window on it.
615
+ - `npm login` backgrounded with stdin at EOF falls through to a legacy `Username:` prompt and exits
616
+ **zero** without authenticating. Confirm with `npm whoami` rather than an exit code.
617
+ - npm offers its browser approval only when it sees a TTY. Without one it fails `EOTP` and there is
618
+ no way to answer it. Run the login, and the first publish of a layer, under
619
+ `script -qfc '<command>' <log>` with stdin read from a fifo a long `sleep` holds open.
620
+ - npm prints `Press ENTER to open in the browser` and does not begin polling until that is
621
+ acknowledged. Send a newline into the fifo. The browser it tries to open does not exist in a
622
+ headless container, which is harmless.
623
+ - Surface the approval URL to the user the moment it appears in the log, and say that approving it
624
+ opens a five-minute window covering the rest of the layer.
625
+
626
+ ### Spending the window
627
+
628
+ - The window opens when the user approves, not when the first publish starts. Chain every remaining
629
+ publish inside the same process as the gate package, so no human turn sits inside it.
630
+ - Publish serially. Concurrent publishes collide on the auth handshake and fail each other.
631
+ - `EOTP` inside the window is intermittent contention rather than the window closing. Retry each
632
+ package about three times before recording it failed, and retry a failed set once the layer ends;
633
+ packages have landed on the third attempt and on a later pass with no new approval.
634
+ - Expect a large layer to outlast one window. Size batches to what uploads in five minutes and tell
635
+ the user how many approvals to expect, rather than discovering it mid-run.
636
+ - Read the result from the registry, not from an exit code: a piped `npm publish` reports the exit
637
+ status of the pipeline, and a CDN read straight after a publish can still serve the previous
638
+ version.
639
+ - Re-read the registry before telling the user a package failed. A chain still running, a retry that
640
+ landed, and CDN lag all produce a failure reading that the registry contradicts, and a false
641
+ failure report costs a needless approval and a needless republish.
520
642
 
521
643
  ## Acceptance laws
522
644
 
@@ -34,49 +34,49 @@ so network-controlled descriptions never enter agent instruction context.
34
34
 
35
35
  <!-- orkestrel:catalog -->
36
36
 
37
- | Package | Version |
38
- | ----------------------- | -------- |
39
- | `@orkestrel/abort` | `0.0.5` |
40
- | `@orkestrel/agent` | `0.0.14` |
41
- | `@orkestrel/browser` | `0.0.8` |
42
- | `@orkestrel/budget` | `0.0.5` |
43
- | `@orkestrel/console` | `0.0.4` |
44
- | `@orkestrel/contract` | `0.0.10` |
45
- | `@orkestrel/csv` | `0.0.2` |
46
- | `@orkestrel/database` | `0.0.7` |
47
- | `@orkestrel/emitter` | `0.0.5` |
48
- | `@orkestrel/guide` | `0.0.9` |
49
- | `@orkestrel/html` | `0.0.2` |
50
- | `@orkestrel/indexeddb` | `0.0.6` |
51
- | `@orkestrel/interpret` | `0.0.7` |
52
- | `@orkestrel/markdown` | `0.0.7` |
53
- | `@orkestrel/mcp` | `0.0.13` |
54
- | `@orkestrel/middleware` | `0.0.9` |
55
- | `@orkestrel/msg` | `0.0.5` |
56
- | `@orkestrel/ndjson` | `0.0.5` |
57
- | `@orkestrel/ollama` | `0.0.8` |
58
- | `@orkestrel/pool` | `0.0.6` |
59
- | `@orkestrel/program` | `0.0.6` |
60
- | `@orkestrel/qualifier` | `0.0.7` |
61
- | `@orkestrel/queue` | `0.0.7` |
62
- | `@orkestrel/rater` | `0.0.8` |
63
- | `@orkestrel/reason` | `0.0.4` |
64
- | `@orkestrel/relation` | `0.0.7` |
65
- | `@orkestrel/router` | `0.0.8` |
66
- | `@orkestrel/scaffold` | `0.0.24` |
67
- | `@orkestrel/sea` | `0.0.5` |
68
- | `@orkestrel/server` | `0.0.10` |
69
- | `@orkestrel/sqlite` | `0.0.6` |
70
- | `@orkestrel/sse` | `0.0.4` |
71
- | `@orkestrel/template` | `0.0.2` |
72
- | `@orkestrel/terminal` | `0.0.5` |
73
- | `@orkestrel/timeout` | `0.0.5` |
74
- | `@orkestrel/tool` | `0.0.9` |
75
- | `@orkestrel/toolbox` | `0.0.3` |
76
- | `@orkestrel/websocket` | `0.0.7` |
77
- | `@orkestrel/worker` | `0.0.6` |
78
- | `@orkestrel/workflow` | `0.0.10` |
79
- | `@orkestrel/workspace` | `0.0.3` |
37
+ | Package | Version | Layer | Runtime dependencies |
38
+ | ----------------------- | -------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39
+ | `@orkestrel/abort` | `0.0.6` | L1 | `@orkestrel/contract` `^0.0.11` |
40
+ | `@orkestrel/agent` | `0.0.15` | L5 | `@orkestrel/abort` `^0.0.6`, `@orkestrel/budget` `^0.0.6`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/queue` `^0.0.8`, `@orkestrel/timeout` `^0.0.6`, `@orkestrel/tool` `^0.0.10`, `@orkestrel/workflow` `^0.0.11`, `@orkestrel/workspace` `^0.0.4` |
41
+ | `@orkestrel/browser` | `0.0.9` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/html` `^0.0.3`, `@orkestrel/websocket` `^0.0.8` |
42
+ | `@orkestrel/budget` | `0.0.6` | L1 | `@orkestrel/contract` `^0.0.11` |
43
+ | `@orkestrel/console` | `0.0.5` | L2 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6` |
44
+ | `@orkestrel/contract` | `0.0.11` | L0 | |
45
+ | `@orkestrel/csv` | `0.0.3` | L1 | `@orkestrel/contract` `^0.0.11` |
46
+ | `@orkestrel/database` | `0.0.8` | L2 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/indexeddb` `^0.0.7`, `@orkestrel/sqlite` `^0.0.7` |
47
+ | `@orkestrel/emitter` | `0.0.6` | L1 | `@orkestrel/contract` `^0.0.11` |
48
+ | `@orkestrel/guide` | `0.0.10` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/markdown` `^0.0.8` |
49
+ | `@orkestrel/html` | `0.0.3` | L1 | `@orkestrel/contract` `^0.0.11` |
50
+ | `@orkestrel/indexeddb` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.11` |
51
+ | `@orkestrel/interpret` | `0.0.8` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/reason` `^0.0.5`, `@orkestrel/template` `^0.0.3` |
52
+ | `@orkestrel/markdown` | `0.0.8` | L2 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/html` `^0.0.3` |
53
+ | `@orkestrel/mcp` | `0.0.14` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/sse` `^0.0.5`, `@orkestrel/tool` `^0.0.10`, `@orkestrel/websocket` `^0.0.8` |
54
+ | `@orkestrel/middleware` | `0.0.10` | L2 | `@orkestrel/abort` `^0.0.6`, `@orkestrel/budget` `^0.0.6`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/timeout` `^0.0.6` |
55
+ | `@orkestrel/msg` | `0.0.6` | L0 | |
56
+ | `@orkestrel/ndjson` | `0.0.6` | L1 | `@orkestrel/contract` `^0.0.11` |
57
+ | `@orkestrel/ollama` | `0.0.9` | L6 | `@orkestrel/agent` `^0.0.15`, `@orkestrel/budget` `^0.0.6`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/ndjson` `^0.0.6`, `@orkestrel/timeout` `^0.0.6`, `@orkestrel/tool` `^0.0.10` |
58
+ | `@orkestrel/pool` | `0.0.7` | L2 | `@orkestrel/emitter` `^0.0.6` |
59
+ | `@orkestrel/program` | `0.0.7` | L4 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/qualifier` `^0.0.8`, `@orkestrel/rater` `^0.0.9`, `@orkestrel/reason` `^0.0.5` |
60
+ | `@orkestrel/qualifier` | `0.0.8` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/reason` `^0.0.5` |
61
+ | `@orkestrel/queue` | `0.0.8` | L3 | `@orkestrel/abort` `^0.0.6`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/timeout` `^0.0.6` |
62
+ | `@orkestrel/rater` | `0.0.9` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/reason` `^0.0.5` |
63
+ | `@orkestrel/reason` | `0.0.5` | L2 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6` |
64
+ | `@orkestrel/relation` | `0.0.8` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/emitter` `^0.0.6` |
65
+ | `@orkestrel/router` | `0.0.9` | L2 | `@orkestrel/abort` `^0.0.6`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6` |
66
+ | `@orkestrel/scaffold` | `0.0.26` | L3 | `@orkestrel/console` `^0.0.4`, `@orkestrel/contract` `^0.0.10`, `@orkestrel/emitter` `^0.0.5`, `@orkestrel/markdown` `^0.0.7`, `@orkestrel/template` `^0.0.2` |
67
+ | `@orkestrel/sea` | `0.0.6` | L2 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6` |
68
+ | `@orkestrel/server` | `0.0.11` | L3 | `@orkestrel/abort` `^0.0.6`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/router` `^0.0.9`, `@orkestrel/timeout` `^0.0.6` |
69
+ | `@orkestrel/sqlite` | `0.0.7` | L1 | `@orkestrel/contract` `^0.0.11` |
70
+ | `@orkestrel/sse` | `0.0.5` | L0 | |
71
+ | `@orkestrel/template` | `0.0.3` | L2 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/emitter` `^0.0.6` |
72
+ | `@orkestrel/terminal` | `0.0.6` | L3 | `@orkestrel/console` `^0.0.5`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/sse` `^0.0.5` |
73
+ | `@orkestrel/timeout` | `0.0.6` | L1 | `@orkestrel/contract` `^0.0.11` |
74
+ | `@orkestrel/tool` | `0.0.10` | L1 | `@orkestrel/contract` `^0.0.11` |
75
+ | `@orkestrel/toolbox` | `0.0.4` | L6 | `@orkestrel/agent` `^0.0.15`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/relation` `^0.0.8`, `@orkestrel/server` `^0.0.11`, `@orkestrel/terminal` `^0.0.6`, `@orkestrel/tool` `^0.0.10`, `@orkestrel/workflow` `^0.0.11`, `@orkestrel/workspace` `^0.0.4` |
76
+ | `@orkestrel/websocket` | `0.0.8` | L2 | `@orkestrel/emitter` `^0.0.6` |
77
+ | `@orkestrel/worker` | `0.0.7` | L4 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/pool` `^0.0.7`, `@orkestrel/queue` `^0.0.8` |
78
+ | `@orkestrel/workflow` | `0.0.11` | L4 | `@orkestrel/abort` `^0.0.6`, `@orkestrel/budget` `^0.0.6`, `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/emitter` `^0.0.6`, `@orkestrel/queue` `^0.0.8`, `@orkestrel/timeout` `^0.0.6` |
79
+ | `@orkestrel/workspace` | `0.0.4` | L3 | `@orkestrel/contract` `^0.0.11`, `@orkestrel/database` `^0.0.8`, `@orkestrel/emitter` `^0.0.6` |
80
80
 
81
81
  <!-- /orkestrel:catalog -->
82
82
 
@@ -89,11 +89,28 @@ range as a pin, never as a range. A dependent stays on its pinned version until
89
89
  rewrites the dependent's own declared range and re-publishes the dependent. Publishing a
90
90
  new version reaches no consumer on its own.
91
91
 
92
- A bump therefore obliges a re-publish of every package downstream of it, in dependency
93
- order. Report that cascade whenever you sequence cross-package work or state blast
94
- radius: name each downstream package, its declared range, and its position in the order.
95
- A package whose pin names an older version runs that older version, whatever the registry
96
- holds.
92
+ A **runtime** bump therefore obliges a re-publish of every package downstream of it, in
93
+ layer order. Report that cascade whenever you sequence cross-package work or state blast
94
+ radius: name each downstream package, its declared range, and its layer. A package whose
95
+ pin names an older version runs that older version, whatever the registry holds.
96
+
97
+ A **development** bump obliges nothing. A `devDependencies` range reaches no consumer of
98
+ the published package, so re-pin it, prove the gates still green, and stop. Never report a
99
+ development bump as a cascade. It becomes one only if it forces a change to `src` or
100
+ `app`, because then the published types or runtime moved and the package bumps on that
101
+ account rather than on the dependency's.
102
+
103
+ The `Layer` column above is the publish round, derived from the runtime edges in the same
104
+ row. `L0` depends on nothing else in the fleet and publishes first; each later layer
105
+ publishes only after every layer before it is on the registry. A row with no layer sits in
106
+ a cycle and cannot be placed in a round at all. Two packages in one layer are independent
107
+ of each other and may publish in any order within it.
108
+
109
+ Report a disagreeing pin as a defect, never as drift to tidy later. When two packages in
110
+ one install graph pin different versions of a third, npm installs both copies, and the
111
+ compiler reads the two copies as two distinct types. The symptom is a type error naming
112
+ one type as not assignable to itself. `npm ls @orkestrel/<name>` is the evidence: one line
113
+ is sound, and nesting is the finding.
97
114
 
98
115
  ## Evidence workflow
99
116
 
@@ -4,6 +4,7 @@ description: 'Read-only primary-source research: external capabilities, protocol
4
4
  tools: Read, Grep, Glob, WebFetch, WebSearch
5
5
  model: sonnet
6
6
  effort: medium
7
+ permissionMode: dontAsk
7
8
  ---
8
9
 
9
10
  You are the **Researcher** — the native evidence lane for the research job the
@@ -4,6 +4,7 @@ description: 'Read-only repository reconnaissance: locate files, symbols, seams,
4
4
  tools: Read, Grep, Glob
5
5
  model: sonnet
6
6
  effort: low
7
+ permissionMode: dontAsk
7
8
  ---
8
9
 
9
10
  You are the **Scout** — the cheap native reconnaissance lane in this project's
@@ -32,6 +32,8 @@ Documentation is an enforced contract, not explanatory decoration. The Writing r
32
32
  - Every public export is documented.
33
33
  - TypeScript, SCSS, Markdown, tests, and showcase remain aligned.
34
34
  - A parity failure identifies drift; never suppress or weaken the test.
35
+ - Falsify a prose claim the way you falsify a code claim. The parity test proves a name exists, never that a sentence about behavior is true, so run the example and read what it returns. A `// false` beside a call that returns `true` is a defect of the same kind as a wrong return value, and it reaches every consumer who installs the package.
36
+ - Re-read the prose last, against what actually shipped. Where a change chose to document a limit rather than close it, the sentence was often drafted for the option that lost, or written more confidently than the code earns. Code rulings survive review because a test can break them; prose rulings survive because nothing tries.
35
37
 
36
38
  For behavioral interfaces/classes:
37
39
 
@@ -63,6 +63,7 @@ A review that reads a diff finds what the diff shows. A review that tries to bre
63
63
  - Draw the negative control from outside the population the instrument covers. Name the instrument's membership rule first, then pick a control that rule excludes. A control sampled from constructs the instrument already handles proves only that it discriminates among those constructs, and says nothing about the class it silently cannot reach.
64
64
  - State an instrument's coverage beside its result. A conclusion inherits the instrument's scope, not the question's. An unstated coverage claim is read as complete, and it never is. A search proves something about the paths it walked, so name them.
65
65
  - Match the instrument to the question. A text search reports on text, so a claim about declarations, call sites, or structure needs the compiler or a parser instead. A pattern written for one spelling of a construct reports on that spelling alone. A path check answers relative to the directory it runs from, so resolve the inputs against their own base before reading a miss as a finding.
66
+ - Report a question unanswered rather than answering it with a weaker instrument. A fallback that measures something adjacent returns a confident wrong answer, and nothing downstream can tell that answer from the real one — searching commit messages for a release when the question is where a version changed will match some release, just not the one asked about. Name the substitute and what it actually measures, or say the question is open.
66
67
  - State what the controls established and what they did not. An instrument certified only from the inside is trusted exactly where it has never been tested.
67
68
  - Treat a gap between what an instrument says it checks and what it actually matches as a defect in the instrument, not as a documented limit. A recorded blind spot buys trust only when everything outside it is genuinely covered.
68
69
  - Measure the product, not the harness. A recorded baseline that counts something about its own fixture is not evidence about the shipped surface, however often a guide quotes it.
@@ -22,6 +22,10 @@ paths:
22
22
  - Cover happy paths, error paths, empty input, boundary values, `NaN`, positive/negative zero, cycles, and Map/Set order where relevant.
23
23
  - Test observable behavior, not implementation details.
24
24
  - Assert the membership a discovered or globbed set should have, not a total that a partly empty population satisfies. A glob spanning two locations passes a size check while one of them matches nothing.
25
+ - Never assert an implementation against itself. Compare the answer to a declaration, a fixture, or a second mechanism that could disagree with it. Re-deriving the answer the same way the source derives it produces a test that passes for every value the source ever returns, and it reads exactly like a real one.
26
+ - Probe a host-varying property at runtime, on the host the test is running on, and assert against what the probe returned. Filesystem case folding, path separators, permission bits, and rename semantics differ per host, so a fixture built on one host describes that host and silently measures something else on the next.
27
+ - Assert a runtime-chosen result as the property it must have, not as the number one run produced. Compression, timing, and buffer sizing are the runtime's choice, so pin the relationship the test depends on — that the encoded form is larger, that the second call is faster — and let the assertion fail when the input drifts out of the range where that relationship holds.
28
+ - Give a conditional skip the mechanism that makes it inapplicable, cited, not the platform name alone. A test skipped on a platform is a test nobody re-examines; a test skipped because a named API rejects a named case is one anybody can re-check.
25
29
  - A regression test records the exact command and its failing count before the fix, and the same command's passing count after.
26
30
  - Use `it.todo()` only for explicitly out-of-scope roadmap work, never to complete the current request. Every `.skip` or conditional skip has a narrow verifiable applicability reason.
27
31
  - Do not create test files solely for `constants.ts`, barrels, error definitions, or `types.ts`.
@@ -91,6 +95,7 @@ A test that spawns a process, packs, installs, or drives a real build is a proof
91
95
  - Give it its own Vitest project with its own setup and timeout.
92
96
  - Keep it out of the default run and require it in `prepublishOnly`.
93
97
  - Slow and hermetic is reason enough to isolate a proof; it need not touch an external service.
98
+ - Where such a proof stays in a shared project, size its budget from a full contended run rather than from an isolated one. A budget that clears the isolated cost by a thin margin turns contention into a red gate reporting a timeout, which carries no diagnostic about the code and costs a full investigation to dismiss.
94
99
 
95
100
  ## Shared test infrastructure
96
101
 
@@ -172,6 +172,7 @@ Exported from `@orkestrel/scaffold`, and reachable from
172
172
  | --------------------------- | -------- | ----------------------------------------------------------------------------- |
173
173
  | `artifactToHex` | function | Project an artifact to the exact bytes it claims, as hexadecimal. |
174
174
  | `bytesToHex` | function | Encode bytes as exact lowercase hexadecimal text. |
175
+ | `catalogToLayers` | function | Project a catalog into the layers it publishes in. |
175
176
  | `cloneValue` | function | Snapshot an untrusted value into exact JSON data the caller owns. |
176
177
  | `compareVersions` | function | Compare two versions by their numeric components. |
177
178
  | `computeBytes` | function | Count the UTF-8 bytes text encodes to. |
@@ -723,6 +724,46 @@ older planned finding refuses that call too. Take a fresh audit rather than repl
723
724
  a stored audit records what a target looked like then, and both verbs bind their writes to what a
724
725
  target holds now. The refusal is deliberate at `0.0.x` and there is no migration path.
725
726
 
727
+ ## Fleet catalog
728
+
729
+ `catalog` rewrites one marker-bounded region in `CATALOG_AGENT_PATH` and nothing else in that file.
730
+ The region holds a table with four columns:
731
+
732
+ | Column | Content |
733
+ | ---------------------- | -------------------------------------------------------------------------- |
734
+ | `Package` | The published package name |
735
+ | `Version` | The registry's `dist-tags.latest`, or the cause when the lookup found none |
736
+ | `Layer` | The publish round the edges place the package in, as `L0`, `L1`, … |
737
+ | `Runtime dependencies` | Each declared runtime edge, as name and range |
738
+
739
+ Both edge-bearing columns come from the same abbreviated packument the version came from, so a
740
+ catalog costs one request per package and no more. Only `dependencies` is read. `devDependencies`
741
+ reaches no consumer of the published package, so it constrains nothing about publish order, and
742
+ reading it would place packages in rounds that do not exist.
743
+
744
+ The layer is not stored on a row. `catalogToLayers` derives it from the rows' own edges, in the same
745
+ call that writes them, so the two cannot disagree:
746
+
747
+ ```ts
748
+ import { catalogToLayers } from '@orkestrel/scaffold'
749
+
750
+ const layers = catalogToLayers(entries)
751
+ layers[0] // the names that depend on nothing else in the fleet
752
+ ```
753
+
754
+ An edge counts only when it names a package this catalog publishes. An edge leaving the fleet and an
755
+ edge to a row that found no version each constrain nothing, so neither holds its dependent back.
756
+
757
+ The order is load-bearing because these packages are `0.0.x`, where a caret pins one exact release.
758
+ A dependent sees a new dependency version only after the dependent re-pins and republishes, so
759
+ publishing a dependent before its dependency leaves the dependent pinned to the older release. Two
760
+ ranges that disagree install two copies of one package, and the compiler reads those copies as two
761
+ distinct types.
762
+
763
+ A cycle cannot be published in rounds. `catalogToLayers` omits its members rather than placing them
764
+ in an order that would be wrong, and their rows carry no layer cell. An absent name is the report:
765
+ compare the returned names against the catalog to find one.
766
+
726
767
  ## Vendored data root
727
768
 
728
769
  The vendored data root is the shared file set, staged into the published package as plain data. It
File without changes
File without changes
File without changes
File without changes