@ontrails/trails 1.0.0-beta.15 → 1.0.0-beta.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.
Files changed (201) hide show
  1. package/CHANGELOG.md +215 -2
  2. package/README.md +27 -0
  3. package/package.json +21 -8
  4. package/src/app.ts +15 -5
  5. package/src/cli.ts +303 -10
  6. package/src/completions.ts +240 -0
  7. package/src/load-app-mirror.ts +160 -0
  8. package/src/local-state-io.ts +153 -0
  9. package/src/project-writes.ts +320 -0
  10. package/src/run-collision.ts +125 -0
  11. package/src/run-completions-install.ts +179 -0
  12. package/src/run-example.ts +149 -0
  13. package/src/run-examples.ts +148 -0
  14. package/src/run-quiet.ts +75 -0
  15. package/src/run-trace.ts +273 -0
  16. package/src/run-warden.ts +39 -0
  17. package/src/run-watch.ts +432 -0
  18. package/src/scaffold-versions.generated.ts +12 -0
  19. package/src/trails/add-surface.ts +45 -23
  20. package/src/trails/add-trail.ts +27 -17
  21. package/src/trails/add-verify.ts +57 -17
  22. package/src/trails/completions-complete.ts +165 -0
  23. package/src/trails/completions.ts +47 -0
  24. package/src/trails/create-scaffold.ts +86 -33
  25. package/src/trails/create.ts +11 -3
  26. package/src/trails/dev-clean.ts +6 -1
  27. package/src/trails/dev-reset.ts +6 -1
  28. package/src/trails/dev-stats.ts +6 -1
  29. package/src/trails/dev-support.ts +29 -17
  30. package/src/trails/draft-promote.ts +289 -80
  31. package/src/trails/guide.ts +54 -34
  32. package/src/trails/load-app.ts +251 -56
  33. package/src/trails/root-dir.ts +21 -0
  34. package/src/trails/run-example.ts +482 -0
  35. package/src/trails/run-examples.ts +141 -0
  36. package/src/trails/run.ts +403 -0
  37. package/src/trails/survey.ts +534 -200
  38. package/src/trails/topo-activation.ts +385 -0
  39. package/src/trails/topo-compile.ts +55 -0
  40. package/src/trails/topo-history.ts +6 -1
  41. package/src/trails/topo-output-schemas.ts +219 -0
  42. package/src/trails/topo-pin.ts +19 -6
  43. package/src/trails/topo-read-support.ts +171 -228
  44. package/src/trails/topo-reports.ts +587 -25
  45. package/src/trails/topo-store-support.ts +43 -19
  46. package/src/trails/topo-support.ts +18 -28
  47. package/src/trails/topo-unpin.ts +6 -1
  48. package/src/trails/topo-verify.ts +18 -5
  49. package/src/trails/topo.ts +60 -23
  50. package/src/trails/warden-guide.ts +121 -0
  51. package/src/trails/warden.ts +137 -56
  52. package/src/versions.ts +3 -18
  53. package/.turbo/turbo-build.log +0 -1
  54. package/.turbo/turbo-lint.log +0 -3
  55. package/.turbo/turbo-typecheck.log +0 -1
  56. package/__tests__/examples.test.ts +0 -45
  57. package/dist/bin/trails.d.ts +0 -3
  58. package/dist/bin/trails.d.ts.map +0 -1
  59. package/dist/bin/trails.js +0 -4
  60. package/dist/bin/trails.js.map +0 -1
  61. package/dist/src/app.d.ts +0 -2
  62. package/dist/src/app.d.ts.map +0 -1
  63. package/dist/src/app.js +0 -22
  64. package/dist/src/app.js.map +0 -1
  65. package/dist/src/clack.d.ts +0 -9
  66. package/dist/src/clack.d.ts.map +0 -1
  67. package/dist/src/clack.js +0 -84
  68. package/dist/src/clack.js.map +0 -1
  69. package/dist/src/cli.d.ts +0 -2
  70. package/dist/src/cli.d.ts.map +0 -1
  71. package/dist/src/cli.js +0 -14
  72. package/dist/src/cli.js.map +0 -1
  73. package/dist/src/trails/add-surface.d.ts +0 -13
  74. package/dist/src/trails/add-surface.d.ts.map +0 -1
  75. package/dist/src/trails/add-surface.js +0 -110
  76. package/dist/src/trails/add-surface.js.map +0 -1
  77. package/dist/src/trails/add-trail.d.ts +0 -12
  78. package/dist/src/trails/add-trail.d.ts.map +0 -1
  79. package/dist/src/trails/add-trail.js +0 -104
  80. package/dist/src/trails/add-trail.js.map +0 -1
  81. package/dist/src/trails/add-trailhead.d.ts +0 -13
  82. package/dist/src/trails/add-trailhead.d.ts.map +0 -1
  83. package/dist/src/trails/add-trailhead.js +0 -88
  84. package/dist/src/trails/add-trailhead.js.map +0 -1
  85. package/dist/src/trails/add-verify.d.ts +0 -10
  86. package/dist/src/trails/add-verify.d.ts.map +0 -1
  87. package/dist/src/trails/add-verify.js +0 -68
  88. package/dist/src/trails/add-verify.js.map +0 -1
  89. package/dist/src/trails/create-scaffold.d.ts +0 -15
  90. package/dist/src/trails/create-scaffold.d.ts.map +0 -1
  91. package/dist/src/trails/create-scaffold.js +0 -295
  92. package/dist/src/trails/create-scaffold.js.map +0 -1
  93. package/dist/src/trails/create.d.ts +0 -18
  94. package/dist/src/trails/create.d.ts.map +0 -1
  95. package/dist/src/trails/create.js +0 -126
  96. package/dist/src/trails/create.js.map +0 -1
  97. package/dist/src/trails/dev-clean.d.ts +0 -9
  98. package/dist/src/trails/dev-clean.d.ts.map +0 -1
  99. package/dist/src/trails/dev-clean.js +0 -66
  100. package/dist/src/trails/dev-clean.js.map +0 -1
  101. package/dist/src/trails/dev-reset.d.ts +0 -6
  102. package/dist/src/trails/dev-reset.d.ts.map +0 -1
  103. package/dist/src/trails/dev-reset.js +0 -39
  104. package/dist/src/trails/dev-reset.js.map +0 -1
  105. package/dist/src/trails/dev-stats.d.ts +0 -7
  106. package/dist/src/trails/dev-stats.d.ts.map +0 -1
  107. package/dist/src/trails/dev-stats.js +0 -61
  108. package/dist/src/trails/dev-stats.js.map +0 -1
  109. package/dist/src/trails/dev-support.d.ts +0 -64
  110. package/dist/src/trails/dev-support.d.ts.map +0 -1
  111. package/dist/src/trails/dev-support.js +0 -181
  112. package/dist/src/trails/dev-support.js.map +0 -1
  113. package/dist/src/trails/draft-promote.d.ts +0 -18
  114. package/dist/src/trails/draft-promote.d.ts.map +0 -1
  115. package/dist/src/trails/draft-promote.js +0 -400
  116. package/dist/src/trails/draft-promote.js.map +0 -1
  117. package/dist/src/trails/guide.d.ts +0 -21
  118. package/dist/src/trails/guide.d.ts.map +0 -1
  119. package/dist/src/trails/guide.js +0 -61
  120. package/dist/src/trails/guide.js.map +0 -1
  121. package/dist/src/trails/load-app.d.ts +0 -12
  122. package/dist/src/trails/load-app.d.ts.map +0 -1
  123. package/dist/src/trails/load-app.js +0 -415
  124. package/dist/src/trails/load-app.js.map +0 -1
  125. package/dist/src/trails/project.d.ts +0 -8
  126. package/dist/src/trails/project.d.ts.map +0 -1
  127. package/dist/src/trails/project.js +0 -54
  128. package/dist/src/trails/project.js.map +0 -1
  129. package/dist/src/trails/survey.d.ts +0 -18
  130. package/dist/src/trails/survey.d.ts.map +0 -1
  131. package/dist/src/trails/survey.js +0 -234
  132. package/dist/src/trails/survey.js.map +0 -1
  133. package/dist/src/trails/topo-constants.d.ts +0 -3
  134. package/dist/src/trails/topo-constants.d.ts.map +0 -1
  135. package/dist/src/trails/topo-constants.js +0 -3
  136. package/dist/src/trails/topo-constants.js.map +0 -1
  137. package/dist/src/trails/topo-export.d.ts +0 -19
  138. package/dist/src/trails/topo-export.d.ts.map +0 -1
  139. package/dist/src/trails/topo-export.js +0 -31
  140. package/dist/src/trails/topo-export.js.map +0 -1
  141. package/dist/src/trails/topo-history.d.ts +0 -20
  142. package/dist/src/trails/topo-history.d.ts.map +0 -1
  143. package/dist/src/trails/topo-history.js +0 -32
  144. package/dist/src/trails/topo-history.js.map +0 -1
  145. package/dist/src/trails/topo-pin.d.ts +0 -17
  146. package/dist/src/trails/topo-pin.d.ts.map +0 -1
  147. package/dist/src/trails/topo-pin.js +0 -31
  148. package/dist/src/trails/topo-pin.js.map +0 -1
  149. package/dist/src/trails/topo-read-support.d.ts +0 -58
  150. package/dist/src/trails/topo-read-support.d.ts.map +0 -1
  151. package/dist/src/trails/topo-read-support.js +0 -167
  152. package/dist/src/trails/topo-read-support.js.map +0 -1
  153. package/dist/src/trails/topo-reports.d.ts +0 -54
  154. package/dist/src/trails/topo-reports.d.ts.map +0 -1
  155. package/dist/src/trails/topo-reports.js +0 -128
  156. package/dist/src/trails/topo-reports.js.map +0 -1
  157. package/dist/src/trails/topo-show.d.ts +0 -23
  158. package/dist/src/trails/topo-show.d.ts.map +0 -1
  159. package/dist/src/trails/topo-show.js +0 -49
  160. package/dist/src/trails/topo-show.js.map +0 -1
  161. package/dist/src/trails/topo-store-support.d.ts +0 -13
  162. package/dist/src/trails/topo-store-support.d.ts.map +0 -1
  163. package/dist/src/trails/topo-store-support.js +0 -55
  164. package/dist/src/trails/topo-store-support.js.map +0 -1
  165. package/dist/src/trails/topo-support.d.ts +0 -76
  166. package/dist/src/trails/topo-support.d.ts.map +0 -1
  167. package/dist/src/trails/topo-support.js +0 -132
  168. package/dist/src/trails/topo-support.js.map +0 -1
  169. package/dist/src/trails/topo-unpin.d.ts +0 -20
  170. package/dist/src/trails/topo-unpin.d.ts.map +0 -1
  171. package/dist/src/trails/topo-unpin.js +0 -44
  172. package/dist/src/trails/topo-unpin.js.map +0 -1
  173. package/dist/src/trails/topo-verify.d.ts +0 -5
  174. package/dist/src/trails/topo-verify.d.ts.map +0 -1
  175. package/dist/src/trails/topo-verify.js +0 -24
  176. package/dist/src/trails/topo-verify.js.map +0 -1
  177. package/dist/src/trails/topo.d.ts +0 -5
  178. package/dist/src/trails/topo.d.ts.map +0 -1
  179. package/dist/src/trails/topo.js +0 -63
  180. package/dist/src/trails/topo.js.map +0 -1
  181. package/dist/src/trails/warden.d.ts +0 -20
  182. package/dist/src/trails/warden.d.ts.map +0 -1
  183. package/dist/src/trails/warden.js +0 -98
  184. package/dist/src/trails/warden.js.map +0 -1
  185. package/dist/src/versions.d.ts +0 -12
  186. package/dist/src/versions.d.ts.map +0 -1
  187. package/dist/src/versions.js +0 -23
  188. package/dist/src/versions.js.map +0 -1
  189. package/dist/tsconfig.tsbuildinfo +0 -1
  190. package/src/__tests__/add-trail.test.ts +0 -97
  191. package/src/__tests__/create.test.ts +0 -415
  192. package/src/__tests__/draft-promote.test.ts +0 -144
  193. package/src/__tests__/guide.test.ts +0 -96
  194. package/src/__tests__/load-app.test.ts +0 -419
  195. package/src/__tests__/survey.test.ts +0 -377
  196. package/src/__tests__/topo-dev.test.ts +0 -426
  197. package/src/__tests__/warden.test.ts +0 -74
  198. package/src/trails/topo-export.ts +0 -35
  199. package/src/trails/topo-show.ts +0 -54
  200. package/tsconfig.json +0 -9
  201. package/tsconfig.tests.json +0 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,218 @@
1
1
  # trails
2
2
 
3
+ ## 1.0.0-beta.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 41276d2: Expose a shipped surface projection inventory through survey output and trail detail reports.
8
+ - Updated dependencies [3dc8254]
9
+ - Updated dependencies [61497c5]
10
+ - @ontrails/core@1.0.0-beta.17
11
+ - @ontrails/cli@1.0.0-beta.17
12
+ - @ontrails/commander@1.0.0-beta.17
13
+ - @ontrails/http@1.0.0-beta.17
14
+ - @ontrails/mcp@1.0.0-beta.17
15
+ - @ontrails/observe@1.0.0-beta.17
16
+ - @ontrails/permits@1.0.0-beta.17
17
+ - @ontrails/topographer@1.0.0-beta.17
18
+ - @ontrails/tracing@1.0.0-beta.17
19
+ - @ontrails/warden@1.0.0-beta.17
20
+
21
+ ## 1.0.0-beta.16
22
+
23
+ ### Major Changes
24
+
25
+ - abc8c68: Move the brief capability report from the bare `survey` flag surface to the role-anchored `survey.brief` trail.
26
+ - 04e2a2e: Move saved contract diffing from the bare `survey` flag surface to the `survey.diff` trail, with optional `against` targets and `breakingOnly` filtering.
27
+ - ed171d5: Split `trails survey` detail inspection into role-anchored `survey.trail`, `survey.resource`, and `survey.signal` trails while keeping bare `survey <id>` as an all-kinds lookup. Remove the temporary `survey --openapi` and `topo.show` CLI shapes. CLI command projection now supports executable parent commands with positional arguments alongside child commands.
28
+ - de30d6c: Introduce `topo.compile` as the canonical trail for writing `.trails` lockfile
29
+ and surface artifacts, remove the `survey --generate` mode, and update drift
30
+ guidance to point at the compile command.
31
+ - 938f005: Cut CLI topo compile and survey diff surfaces over to the lock v3 artifact family. `topo.compile` now reports `topoPath` for `.trails/topo.lock`, survey diff accepts explicit `topo.lock` files and directories containing `topo.lock`, and new scaffolds no longer ignore committed root lock artifacts.
32
+ - 10eae9a: Migrate the Trails workspace to the documented `.trails/` layout: committed `.lock` files at the workspace root, ignored `cache/` for rebuildable derived data, ignored `state/` for mutable runtime state, and `.trails/config.local.{ts,js}` for local overrides. The default SQLite path is now `.trails/state/trails.db`. Workspace bootstrap creates only `cache/` and `state/` — the legacy `dev/` and `generated/` subdirectories are no longer created. Dev reset cleans both the new `.trails/state/` paths and legacy `.trails/trails.db*` and `.trails/dev/tracing.db*` paths for one cycle. Scaffold and workspace gitignores reflect the new layout.
33
+
34
+ Workspace bootstrap is now owned by a single canonical source in `@ontrails/core`. The package exposes `ensureTrailsWorkspace()`, `WORKSPACE_GITIGNORE_CONTENT`, and `WORKSPACE_GITIGNORE_LINES`. `@ontrails/config` no longer exports its own `ensureWorkspace` (consumers should import from `@ontrails/core`). `trails create` now writes `.trails/.gitignore` during scaffolding so a fresh-scaffolded project's initial commit includes the workspace gitignore (resolves TRL-703).
35
+
36
+ ### Minor Changes
37
+
38
+ - a18a25d: Update `trails warden` to use the shared `@ontrails/warden` command surface and final Sprint 1 flags.
39
+
40
+ The integrated CLI now projects `--ci`, `--pre-push`, `--depth`, `--fail-on`, `--strict`, `--format`, `--lock`, `--drafts`, `--apps`, `--no-lock-mutation`, and the local Warden aliases into the same runner used by the package `warden` bin. The old `lintOnly`, `driftOnly`, and `tier` inputs are replaced by `--depth` and `--lock` semantics.
41
+
42
+ - 3b5697a: Add the `run` trail family to `apps/trails` for direct trail invocation by ID. `trails run <id> '<inline-json>'` resolves the trail in the current app's topo and executes it through the shared `run()` pipeline from `@ontrails/core`, returning a typed direct-invocation envelope. `run.examples` lists authored examples and `run.example` executes one named example with an actual-vs-expected comparison. Single-app resolution only on this branch; multi-app workspace resolution plus `--app` override land in TRL-406. Not-found maps to `Result.err(NotFoundError)` and CLI exit code 2 via the existing error taxonomy. Self-hosted: the trail family authors happy-path and not-found examples, exercised by `testExamples(app)`.
43
+ - fbd42fc: Unify structured CLI input around `--input <path|->` and `--input-json`.
44
+ `--input` reads JSON from a file path or from stdin when the value is `-`;
45
+ `--input-file`, `--stdin`, and the `structuredInputFieldByTrail` routing
46
+ option are removed. Structured payloads now merge directly into each trail's
47
+ typed input object, so `trails run` callers provide the inner trail payload
48
+ under the run trail's `input` field.
49
+ - 63d1aef: Add `--quiet` / `-q` flag to strip the `inner-trail-result` envelope from `trails run` stdout. On success, stdout becomes the inner value JSON only (no `{ kind, trailId, value }` wrapper). Composes with `--json` / `--jsonl` (those control format; `--quiet` controls envelope vs unwrapped). Wired as a global CLI flag via `outputModePreset()` so all commands surface it; the run-trail-specific unwrap logic lives in `apps/trails/src/cli.ts` next to the existing collision-recovery wrapper.
50
+ - 5a3c245: Add `run.example` for named example execution. It loads a named example, executes the inner trail with the example's input, and compares actual vs expected per the example's contract (`expected` deep-equal, `expectedMatch` partial-match, or `error` class match). Returns a structured `RunExampleComparison` envelope with input/expected/actual/match/diff. The CLI surface helper prints an OK summary on match (exit 0), or a diff and `ValidationError` on mismatch (exit 1). Unknown example names produce `NotFoundError` (exit 2) with the available examples listed.
51
+ - 93e9d44: Add `run.examples` for listing a trail's examples without executing. The split run family gives examples listing its own typed input and structured `RunExamplesListing` output (`{ kind: 'examples-listing', trailId, examples }`) instead of adding an `--examples` mode flag to `run`. The CLI surface helper formats text-mode tables (name + truncated input + outcome) and unwraps to a JSON/JSONL array when `--json`/`--jsonl` is set. Trails with no examples emit `No examples defined` (text) or `[]` (JSON). Unknown trail IDs still surface `NotFoundError` (exit code 2).
52
+ - 8f5bda0: Wire workspace topo discovery into the `run` trail with collision UX. `run` accepts an optional `app?: string` input that auto-projects as `--app <name>` on the CLI. Resolution flow: `--app` provided → use it; else if the trail ID is unambiguous in the workspace index → use the single owning app; else if colliding → return `Result.err(AmbiguousError)` whose message names the candidates and suggests `--app`. The CLI surface adds a TTY-aware bridge (`tryRecoverFromRunCollision`) that prompts via clack when stdin is a TTY and the trail returned an `AmbiguousError`, then re-executes with the chosen app. Non-TTY contexts surface the error and exit with code 1. Trail logic stays surface-agnostic; TTY detection and prompts live in the CLI bridge.
53
+ - c8caa5e: Wire the `--trace` flag for the `trails run` family. Adds `tracePreset()` to `@ontrails/cli` (registered via the `presets` option) and threads `'trace'` through `META_FLAG_CANDIDATES` so the flag is treated as CLI metadata (never routed into trail input). On activation, `apps/trails/src/cli.ts` installs a per-invocation memory sink before `surface()` runs and finalizes it in a `finally` block: the post-execution tree (rendered via `renderTraceTree` from TRL-411) goes to stderr; the result still goes to stdout. With `--trace --json`, regular `trails run <id>` emits a single JSON envelope on stdout that includes `tracing: TraceRecord[]`; `trails run example <id> <exampleName>` keeps its comparison envelope, and `trails run examples <id>` remains a metadata read. `--quiet` keeps the tree on stderr and the unwrapped value on stdout, while `--jsonl` streams items as before. Sink registration is per-invocation so concurrent runs don't bleed records.
54
+ - f4b90c9: Add `--watch` for the `trails run` family. File-system events are cheap wake-ups; the rerun gate compares the resolved trail's surface-map entry hash so edits only rerun when the public contract for the watched trail changes. New `watchPreset()` exposes the boolean flag; `'watch'` is added to `META_FLAG_CANDIDATES` so the flag never routes into trail input. The watch loop in `apps/trails/src/run-watch.ts` runs once, then sets up a debounced (`100ms`) `node:fs.watch` filtered to `.ts`/`.tsx`/`.js`/`.mjs`/`.cjs` extensions in the trail's source directory. SIGINT closes the watcher cleanly. A short startup warmup window (`150ms`) suppresses the macOS FSEvents replay event that would otherwise produce a phantom rerun on first invocation.
55
+ - 2a2e072: Compose `--watch` with the split `run example` command and `--trace` cleanly. Moves the `--trace` session install/finalize bracket inside `runSurfaceOnce` so each watch rerun gets a fresh memory sink and stderr tree (previously the sink was process-scoped and accumulated records across reruns, suppressing the per-rerun tree until SIGINT). Adds integration tests covering the example-comparison rerun loop, trace-record freshness across reruns, and error recovery (a thrown rerun does not exit the watch loop). Documents the TDD-in-terminal workflow in the Direct Invocation ADR draft.
56
+ - 85c39c4: Add shell completion infrastructure and trail-ID completion. New `apps/trails/src/completions.ts` exposes `renderCompletionScript('bash' | 'zsh' | 'fish', binName)` and `renderTrailIdCompletions(workspaceRoot, prefix)` (reads the workspace topo via `buildWorkspaceTrailIndex`). Two new trails register on the topo: `completions` (returns the completion script for a chosen shell) and `completions.__complete` (the dynamic suggestion endpoint that the static script delegates to at tab-press time). Per-shell logic lives in a `Record<CompletionShell, ScriptRenderer>` lookup; the dynamic dispatch table is keyed by subcommand so TRL-416 (example-name completion) lands as a new entry.
57
+ - 6f5bf81: Add example-name completion to the dynamic suggestion endpoint. When the user tab-completes the example-name argument in `trails run example <trail-id> <prefix>`, the completion returns the named trail's `examples` array (filtered by prefix, sorted). New `renderTrailExampleCompletions(workspaceRoot, trailId, prefix)` helper resolves the trail's owning app via the workspace index, loads the topo with `tryLoadFreshAppLease`, and derives examples via `deriveStructuredTrailExamples`. Recoverable load/lookup failures return typed `RecoverableCompletionError` values from the helper and are suppressed to `[]` only at the internal `completions.__complete` shell boundary so tab completion stays quiet.
58
+ - 3d4e921: Add `trails completions install [--shell bash|zsh|fish]` for installing the completion script to the standard per-shell location. This is a CLI bridge command, not a topo trail: it uses `renderCompletionScript`, auto-detects `$SHELL` when `--shell` is omitted, creates parent directories as needed, and writes to:
59
+
60
+ - bash → `~/.local/share/bash-completion/completions/trails`
61
+ - zsh → `~/.local/share/zsh/site-functions/_trails` (user must add to `$fpath` if not already)
62
+ - fish → `~/.config/fish/completions/trails.fish`
63
+
64
+ Output reports `{ shell, path, created, message }`. Idempotent — second run reports `created: false` and overwrites with the freshest script. Detection failure (missing/unsupported `$SHELL`) returns `Result.err(ValidationError)` with a message naming the supported shells. Test seam allows injecting `homeDir` and `shellEnv` so the trail never mutates global state.
65
+
66
+ - 863d473: Add three attachment scopes for typed layers — trail, surface, topo — with composition order **topo → surface → trail → blaze**. `TrailSpec` and `Trail` gain `layers?: readonly Layer[]` (default `[]`). `topo()` accepts `{ layers: [...] }` as the third options argument; the topo carries those layers and they reach the executor via `ExecuteTrailOptions.topoLayers`. The CLI's `surface()`/`createProgram()`/`deriveCliCommands` already supports a `layers` option; that now flows through `runTrailOnce` as `surfaceLayers`. The executor builds the layer chain `[...topoLayers, ...surfaceLayers, ...trail.layers, ...options.layers]` so topo wraps surface wraps trail wraps blaze (verified by composition-order tests at every level). Survey's `TrailDetailReport` adds `composedLayers: { topo, surface, trail }` so agents can introspect the layer chain per trail. Backward-compatible: every new field is optional with a non-undefined default; existing call sites are unchanged.
67
+ - 802fdfc: Rename Warden guide manifest rule grouping from `category` to `concern` so the
68
+ public JSON contract matches the source metadata field.
69
+ - f6fdc62: Add structured Warden remediation guidance to rule metadata, diagnostics, report output, and the `trails warden` result schema.
70
+ - a10ffa4: Add a Warden guide manifest projection and expose it through `trails warden guide` in markdown, agent-json, and manifest formats.
71
+
72
+ ### Patch Changes
73
+
74
+ - 73622ae: Thread `ResourceSpec.config` through the built-in auth resource. Resource config schemas that accept `undefined` now receive their parsed default when config values are omitted, and `authResource` can materialize the no-op or JWT adapter from typed config while preserving existing mock and override paths.
75
+ - 25f3c5c: Add the dedicated `@ontrails/commander` adapter package and move the Commander runtime out of the `@ontrails/cli/commander` subpath. Extend the repo-local package-source guardrails to cover adapter package source as the Commander runtime moves under `adapters/`.
76
+ - f20cb51: Update generated CLI scaffolds and current-facing docs to use the dedicated `@ontrails/commander` adapter package.
77
+ - 20d7a5c: Enforce the shared safe error projection policy for public error bodies, diagnostics, serialized payloads, and CLI stderr.
78
+ - e898cc4: Add repo-level Knip dead-code detection and remove stale internal exports and unused package dependencies surfaced by the new check.
79
+ - 200bece: BREAKING: rename auth connector vocabulary to adapter.
80
+
81
+ This stays on the current `1.0.0-beta` prerelease line: the package is part of
82
+ the fixed `@ontrails/*` beta group, so beta-breaking API renames advance the
83
+ next beta rather than opening a stable-major release line.
84
+
85
+ - `AuthConnector` -> `AuthAdapter`
86
+ - `authConnectorSchema` -> `authAdapterSchema`
87
+ - `JwtConnectorOptions` -> `JwtAdapterOptions`
88
+ - `createJwtConnector` -> `createJwtAdapter`
89
+ - auth resource config discriminant `{ connector: 'jwt' | 'none' }` -> `{ adapter: 'jwt' | 'none' }`
90
+
91
+ The `@ontrails/permits/jwt` subpath is unchanged. The internal `connectors/`
92
+ source directory becomes `adapters/`. See
93
+ `docs/migration/connector-to-adapter.md` for the full rename map.
94
+
95
+ The Trails CLI package updates its generated auth-resource configuration to use
96
+ the new `adapter` discriminant.
97
+
98
+ - 3395234: Move store adapter-binding helpers to `@ontrails/store/adapter-support` and topographer direct database/admin helpers to `@ontrails/topographer/backend-support`, keeping root exports focused on contract-level APIs.
99
+ - d40430d: Remove the retired `@ontrails/logging` workspace from the prerelease package set. Use `@ontrails/observe` for log and trace sink contracts and `@ontrails/logtape` for LogTape forwarding.
100
+ - 331e3a9: Relocate the topo-store public API from `@ontrails/core` to `@ontrails/topographer` per ADR-0042. Generic `trails-db` helpers (`openReadTrailsDb`, `openWriteTrailsDb`, `ensureSubsystemSchema`, `deriveTrailsDbPath`, `deriveTrailsDir`) stay in core because tracing and other subsystems share them.
101
+
102
+ Breaking pre-1.0 beta change. Update consumer imports:
103
+
104
+ ```diff
105
+ - import { topoStore, createTopoStore, createMockTopoStore, createTopoSnapshot, listTopoSnapshots, pinTopoSnapshot, unpinTopoSnapshot, createStoredTopoSnapshot, getStoredTopoExport, countTopoSnapshots, countPinnedSnapshots, countPrunableSnapshots, pruneUnpinnedSnapshots } from '@ontrails/core';
106
+ + import { topoStore, createTopoStore, createMockTopoStore, createTopoSnapshot, listTopoSnapshots, pinTopoSnapshot, unpinTopoSnapshot } from '@ontrails/topographer';
107
+ + import { createStoredTopoSnapshot, getStoredTopoExport, countTopoSnapshots, countPinnedSnapshots, countPrunableSnapshots, pruneUnpinnedSnapshots } from '@ontrails/topographer/backend-support';
108
+ ```
109
+
110
+ The same root move applies to types `ReadOnlyTopoStore`, `MockTopoStoreSeed`, `TopoSnapshot`, `TopoStoreRef`, `TopoStoreExportRecord`, `TopoStoreResourceRecord`, `TopoStoreTrailRecord`, `TopoStoreTrailDetailRecord`, `CreateTopoSnapshotInput`, and `ListTopoSnapshotsOptions`. The direct DB helper type `StoredTopoExport` moves to `@ontrails/topographer/backend-support`.
111
+
112
+ Core newly exports `activationSourceKey`, `projectActivationSourceDeclaration`, `activationSourceDeclarationSignature`, and the `ActivationSourceProjection` type — these were already used internally and are now part of the public surface so `@ontrails/topographer` (the only consumer that needs them) can import them through normal package channels.
113
+
114
+ - 4399fdb: Renamed `@ontrails/schema` to `@ontrails/topographer`. Mechanical rename only — no API changes. Update import sites from `@ontrails/schema` to `@ontrails/topographer`. See ADR-0042 for the durable graph substrate doctrine.
115
+ - dbd17db: Remove the unused legacy `@ontrails/logging` dependency from the Trails CLI app package.
116
+ - 2dd9cda: Promote ADR-0043 (Layer Evolution) from draft to accepted, amend it on 2026-05-04 to remove the briefly proposed `Middleware` split, and publish the Layer Evolution Migration Guide at `docs/migration/layer-evolution.md`.
117
+
118
+ Documentation-only change capturing the post-implementation state of the layer-evolution work shipped across TRL-471 through TRL-476: typed `Layer` primitive with optional `input` schema, three attachment scopes (trail, surface, topo), CLI/MCP/HTTP surface projection of layer inputs, removal of `authLayer`, `autoIterateLayer`, and `dateShortcutsLayer`, and warden coaching via `no-legacy-layer-imports` (error). The migration guide is the durable countermeasure to the vocabulary churn flagged in ADR-0043's tradeoffs.
119
+
120
+ - ed7f6f6: Expand topo-store and survey trail detail records with resolved TopoGraph contract facts for blind-agent review.
121
+ - fb10112: Polish Warden guidance projection by preserving labels in plain-text doc links
122
+ and reusing the shared diagnostic schema from the Trails CLI wrapper.
123
+ - 7a1d4a9: Rename the public resolved graph API from `SurfaceMap` to `TopoGraph`, including
124
+ the derive, hash, diff, and current graph artifact I/O helpers.
125
+ - 84f595a: Add lock v3 manifest and `topo.lock` I/O. `trails.lock` now reads as a compact v3 manifest that points at the serialized TopoGraph artifact, and legacy v2/hash-only lock inputs fail with a regenerate instruction.
126
+ - d2cb9ba: Rename topo-store export artifacts from surface-era names to TopoGraph names. The `topo_exports` table now stores `topo_graph`, `topo_graph_hash`, and `lock_manifest`, and backend-support export records expose `topoGraphJson`, `topoGraphHash`, and `lockManifestJson`.
127
+ - 8ddf5ff: Extend `runWarden` into the shared Warden orchestration entrypoint with effective config resolution, depth/fail thresholds, rule facets, and multi-topo report metadata.
128
+
129
+ Adapt the built-in `trails warden` wrapper to consume the readonly Warden report diagnostics contract without weakening its output schema.
130
+
131
+ - Updated dependencies [73622ae]
132
+ - Updated dependencies [e991a5b]
133
+ - Updated dependencies [25f3c5c]
134
+ - Updated dependencies [6300f70]
135
+ - Updated dependencies [d172013]
136
+ - Updated dependencies [c3fc5c3]
137
+ - Updated dependencies [20d7a5c]
138
+ - Updated dependencies [be5fb46]
139
+ - Updated dependencies [199304e]
140
+ - Updated dependencies [e898cc4]
141
+ - Updated dependencies [a8997ed]
142
+ - Updated dependencies [fe03945]
143
+ - Updated dependencies [2bf239e]
144
+ - Updated dependencies [200bece]
145
+ - Updated dependencies [e4beec9]
146
+ - Updated dependencies [3395234]
147
+ - Updated dependencies [d40430d]
148
+ - Updated dependencies [bcdc484]
149
+ - Updated dependencies [3f678d4]
150
+ - Updated dependencies [ed171d5]
151
+ - Updated dependencies [49c2e7d]
152
+ - Updated dependencies [de30d6c]
153
+ - Updated dependencies [331e3a9]
154
+ - Updated dependencies [c40865a]
155
+ - Updated dependencies [4399fdb]
156
+ - Updated dependencies [578e674]
157
+ - Updated dependencies [4b8d13b]
158
+ - Updated dependencies [4b8d13b]
159
+ - Updated dependencies [4b8d13b]
160
+ - Updated dependencies [4b8d13b]
161
+ - Updated dependencies [fbd42fc]
162
+ - Updated dependencies [63d1aef]
163
+ - Updated dependencies [6be2e95]
164
+ - Updated dependencies [819de09]
165
+ - Updated dependencies [be08686]
166
+ - Updated dependencies [112b9f2]
167
+ - Updated dependencies [893025e]
168
+ - Updated dependencies [ed888e2]
169
+ - Updated dependencies [2e05e27]
170
+ - Updated dependencies [9cdb0f2]
171
+ - Updated dependencies [c8caa5e]
172
+ - Updated dependencies [f4b90c9]
173
+ - Updated dependencies [eec5e9d]
174
+ - Updated dependencies [4e75129]
175
+ - Updated dependencies [47505fe]
176
+ - Updated dependencies [ebd4434]
177
+ - Updated dependencies [863d473]
178
+ - Updated dependencies [344f2f7]
179
+ - Updated dependencies [26f9ffd]
180
+ - Updated dependencies [66056ac]
181
+ - Updated dependencies [ad553a6]
182
+ - Updated dependencies [2dd9cda]
183
+ - Updated dependencies [b12e19b]
184
+ - Updated dependencies [ed7f6f6]
185
+ - Updated dependencies [fb10112]
186
+ - Updated dependencies [802fdfc]
187
+ - Updated dependencies [0bad534]
188
+ - Updated dependencies [bfabe09]
189
+ - Updated dependencies [7a1d4a9]
190
+ - Updated dependencies [84f595a]
191
+ - Updated dependencies [d2cb9ba]
192
+ - Updated dependencies [2cc05da]
193
+ - Updated dependencies [10eae9a]
194
+ - Updated dependencies [bbb1ea4]
195
+ - Updated dependencies [22c6c06]
196
+ - Updated dependencies [767eb41]
197
+ - Updated dependencies [82019a7]
198
+ - Updated dependencies [f6fdc62]
199
+ - Updated dependencies [a10ffa4]
200
+ - Updated dependencies [df9a7d0]
201
+ - Updated dependencies [7085f01]
202
+ - Updated dependencies [30a2c7e]
203
+ - Updated dependencies [81bffec]
204
+ - Updated dependencies [8ddf5ff]
205
+ - Updated dependencies [f5b6112]
206
+ - Updated dependencies [d675a53]
207
+ - @ontrails/core@1.0.0-beta.16
208
+ - @ontrails/cli@1.0.0-beta.16
209
+ - @ontrails/permits@1.0.0-beta.16
210
+ - @ontrails/commander@1.0.0-beta.16
211
+ - @ontrails/warden@1.0.0-beta.16
212
+ - @ontrails/observe@1.0.0-beta.16
213
+ - @ontrails/tracing@1.0.0-beta.16
214
+ - @ontrails/topographer@1.0.0-beta.16
215
+
3
216
  ## 1.0.0-beta.15
4
217
 
5
218
  ### Patch Changes
@@ -10,8 +223,8 @@
10
223
  - @ontrails/cli@1.0.0-beta.15
11
224
  - @ontrails/tracing@1.0.0-beta.15
12
225
  - @ontrails/warden@1.0.0-beta.15
13
- - @ontrails/logging@1.0.0-beta.15
14
- - @ontrails/schema@1.0.0-beta.15
226
+ - @ontrails/observe@1.0.0-beta.15
227
+ - @ontrails/topographer@1.0.0-beta.15
15
228
 
16
229
  ## 1.0.0-beta.14
17
230
 
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Trails CLI
2
+
3
+ Command-line tools for working with Trails projects.
4
+
5
+ Use the CLI to scaffold a Trails app, add surfaces, inspect the current topo, run
6
+ warden checks, manage draft state, and keep local Trails project state tidy.
7
+
8
+ ```bash
9
+ bunx @ontrails/trails create
10
+ ```
11
+
12
+ Common workflows:
13
+
14
+ - `trails create` starts a new Trails project with generated trail, topo, surface,
15
+ and verification files.
16
+ - `trails add surface` adds another surface entrypoint to an existing project.
17
+ - `trails topo` inspects, exports, verifies, pins, and unpins topo state.
18
+ - `trails warden` runs Trails governance checks for contract and architecture
19
+ drift.
20
+ - `trails guide` shows available trails and examples from a project.
21
+
22
+ Trails is contract-first: define trails once with typed input, Result output,
23
+ examples, and meta; the framework derives CLI, MCP, HTTP, and future surfaces from
24
+ the same contracts.
25
+
26
+ See the main Trails documentation for the full framework guide:
27
+ <https://github.com/outfitter-dev/trails>
package/package.json CHANGED
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "name": "@ontrails/trails",
3
- "version": "1.0.0-beta.15",
3
+ "version": "1.0.0-beta.17",
4
4
  "bin": {
5
5
  "trails": "./bin/trails.ts"
6
6
  },
7
+ "files": [
8
+ "bin/**/*.ts",
9
+ "src/**/*.ts",
10
+ "!src/**/__tests__/**",
11
+ "!src/**/*.test.ts",
12
+ "!src/**/*.test-d.ts",
13
+ "README.md",
14
+ "CHANGELOG.md"
15
+ ],
7
16
  "type": "module",
8
17
  "scripts": {
9
18
  "build": "tsc -b",
@@ -14,16 +23,20 @@
14
23
  },
15
24
  "dependencies": {
16
25
  "@clack/prompts": "^1.1.0",
17
- "@ontrails/cli": "^1.0.0-beta.14",
18
- "@ontrails/core": "^1.0.0-beta.14",
19
- "@ontrails/logging": "^1.0.0-beta.14",
20
- "@ontrails/schema": "^1.0.0-beta.14",
21
- "@ontrails/tracing": "^1.0.0-beta.14",
22
- "@ontrails/warden": "^1.0.0-beta.14",
26
+ "@ontrails/cli": "^1.0.0-beta.16",
27
+ "@ontrails/commander": "^1.0.0-beta.16",
28
+ "@ontrails/core": "^1.0.0-beta.16",
29
+ "@ontrails/http": "^1.0.0-beta.16",
30
+ "@ontrails/mcp": "^1.0.0-beta.16",
31
+ "@ontrails/observe": "^1.0.0-beta.16",
32
+ "@ontrails/permits": "^1.0.0-beta.16",
33
+ "@ontrails/topographer": "^1.0.0-beta.16",
34
+ "@ontrails/tracing": "^1.0.0-beta.16",
35
+ "@ontrails/warden": "^1.0.0-beta.16",
23
36
  "commander": "^14.0.3",
24
37
  "zod": "^4.3.5"
25
38
  },
26
39
  "devDependencies": {
27
- "@ontrails/testing": "^1.0.0-beta.14"
40
+ "@ontrails/testing": "^1.0.0-beta.16"
28
41
  }
29
42
  }
package/src/app.ts CHANGED
@@ -3,6 +3,8 @@ import { topo } from '@ontrails/core';
3
3
  import * as addSurface from './trails/add-surface.js';
4
4
  import * as addTrail from './trails/add-trail.js';
5
5
  import * as addVerify from './trails/add-verify.js';
6
+ import * as completions from './trails/completions.js';
7
+ import * as completionsComplete from './trails/completions-complete.js';
6
8
  import * as create from './trails/create.js';
7
9
  import * as createScaffold from './trails/create-scaffold.js';
8
10
  import * as devClean from './trails/dev-clean.js';
@@ -10,25 +12,30 @@ import * as devReset from './trails/dev-reset.js';
10
12
  import * as devStats from './trails/dev-stats.js';
11
13
  import * as draftPromote from './trails/draft-promote.js';
12
14
  import * as guide from './trails/guide.js';
15
+ import * as run from './trails/run.js';
16
+ import * as runExample from './trails/run-example.js';
17
+ import * as runExamples from './trails/run-examples.js';
13
18
  import * as survey from './trails/survey.js';
14
- import * as topoExport from './trails/topo-export.js';
19
+ import * as topoCompile from './trails/topo-compile.js';
15
20
  import * as topoHistory from './trails/topo-history.js';
16
21
  import * as topoPin from './trails/topo-pin.js';
17
- import * as topoShow from './trails/topo-show.js';
18
22
  import * as topoCommand from './trails/topo.js';
19
23
  import * as topoUnpin from './trails/topo-unpin.js';
20
24
  import * as topoVerify from './trails/topo-verify.js';
21
25
  import * as warden from './trails/warden.js';
26
+ import * as wardenGuide from './trails/warden-guide.js';
22
27
 
23
28
  export const app = topo(
24
29
  'trails',
30
+ run,
31
+ runExamples,
32
+ runExample,
25
33
  survey,
26
34
  topoCommand,
27
- topoShow,
35
+ topoCompile,
28
36
  topoHistory,
29
37
  topoPin,
30
38
  topoUnpin,
31
- topoExport,
32
39
  topoVerify,
33
40
  devStats,
34
41
  devClean,
@@ -36,9 +43,12 @@ export const app = topo(
36
43
  guide,
37
44
  draftPromote,
38
45
  warden,
46
+ wardenGuide,
39
47
  create,
40
48
  createScaffold,
41
49
  addSurface,
42
50
  addVerify,
43
- addTrail
51
+ addTrail,
52
+ completions,
53
+ completionsComplete
44
54
  );