@ontrails/warden 1.0.0-beta.12 → 1.0.0-beta.14

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 (204) hide show
  1. package/.turbo/turbo-lint.log +1 -1
  2. package/CHANGELOG.md +63 -31
  3. package/README.md +21 -19
  4. package/dist/cli.d.ts +1 -1
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +24 -12
  7. package/dist/cli.js.map +1 -1
  8. package/dist/draft.d.ts +5 -0
  9. package/dist/draft.d.ts.map +1 -0
  10. package/dist/draft.js +16 -0
  11. package/dist/draft.js.map +1 -0
  12. package/dist/drift.d.ts +10 -7
  13. package/dist/drift.d.ts.map +1 -1
  14. package/dist/drift.js +50 -16
  15. package/dist/drift.js.map +1 -1
  16. package/dist/formatters.d.ts +2 -1
  17. package/dist/formatters.d.ts.map +1 -1
  18. package/dist/formatters.js +15 -4
  19. package/dist/formatters.js.map +1 -1
  20. package/dist/index.d.ts +9 -4
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +11 -5
  23. package/dist/index.js.map +1 -1
  24. package/dist/rules/ast.d.ts +22 -11
  25. package/dist/rules/ast.d.ts.map +1 -1
  26. package/dist/rules/ast.js +56 -30
  27. package/dist/rules/ast.js.map +1 -1
  28. package/dist/rules/context-no-trailhead-types.d.ts +12 -0
  29. package/dist/rules/context-no-trailhead-types.d.ts.map +1 -0
  30. package/dist/rules/context-no-trailhead-types.js +96 -0
  31. package/dist/rules/context-no-trailhead-types.js.map +1 -0
  32. package/dist/rules/cross-declarations.d.ts +13 -0
  33. package/dist/rules/cross-declarations.d.ts.map +1 -0
  34. package/dist/rules/cross-declarations.js +264 -0
  35. package/dist/rules/cross-declarations.js.map +1 -0
  36. package/dist/rules/draft-file-marking.d.ts +6 -0
  37. package/dist/rules/draft-file-marking.d.ts.map +1 -0
  38. package/dist/rules/draft-file-marking.js +65 -0
  39. package/dist/rules/draft-file-marking.js.map +1 -0
  40. package/dist/rules/draft-visible-debt.d.ts +12 -0
  41. package/dist/rules/draft-visible-debt.d.ts.map +1 -0
  42. package/dist/rules/draft-visible-debt.js +45 -0
  43. package/dist/rules/draft-visible-debt.js.map +1 -0
  44. package/dist/rules/follow-declarations.d.ts +1 -1
  45. package/dist/rules/follow-declarations.js +5 -5
  46. package/dist/rules/follow-declarations.js.map +1 -1
  47. package/dist/rules/implementation-returns-result.d.ts +2 -2
  48. package/dist/rules/implementation-returns-result.js +6 -6
  49. package/dist/rules/implementation-returns-result.js.map +1 -1
  50. package/dist/rules/index.d.ts +6 -4
  51. package/dist/rules/index.d.ts.map +1 -1
  52. package/dist/rules/index.js +18 -12
  53. package/dist/rules/index.js.map +1 -1
  54. package/dist/rules/no-direct-impl-in-route.d.ts +4 -4
  55. package/dist/rules/no-direct-impl-in-route.js +14 -14
  56. package/dist/rules/no-direct-impl-in-route.js.map +1 -1
  57. package/dist/rules/no-direct-implementation-call.d.ts +3 -3
  58. package/dist/rules/no-direct-implementation-call.js +7 -7
  59. package/dist/rules/no-direct-implementation-call.js.map +1 -1
  60. package/dist/rules/no-sync-result-assumption.d.ts +1 -1
  61. package/dist/rules/no-sync-result-assumption.js +5 -5
  62. package/dist/rules/no-sync-result-assumption.js.map +1 -1
  63. package/dist/rules/no-throw-in-detour-target.js +2 -2
  64. package/dist/rules/no-throw-in-detour-target.js.map +1 -1
  65. package/dist/rules/no-throw-in-implementation.d.ts +1 -1
  66. package/dist/rules/no-throw-in-implementation.js +3 -3
  67. package/dist/rules/no-throw-in-implementation.js.map +1 -1
  68. package/dist/rules/provision-declarations.d.ts +14 -0
  69. package/dist/rules/provision-declarations.d.ts.map +1 -0
  70. package/dist/rules/provision-declarations.js +344 -0
  71. package/dist/rules/provision-declarations.js.map +1 -0
  72. package/dist/rules/provision-exists.d.ts +6 -0
  73. package/dist/rules/provision-exists.d.ts.map +1 -0
  74. package/dist/rules/provision-exists.js +90 -0
  75. package/dist/rules/provision-exists.js.map +1 -0
  76. package/dist/rules/service-declarations.d.ts +7 -5
  77. package/dist/rules/service-declarations.d.ts.map +1 -1
  78. package/dist/rules/service-declarations.js +106 -103
  79. package/dist/rules/service-declarations.js.map +1 -1
  80. package/dist/rules/service-exists.d.ts +3 -1
  81. package/dist/rules/service-exists.d.ts.map +1 -1
  82. package/dist/rules/service-exists.js +35 -33
  83. package/dist/rules/service-exists.js.map +1 -1
  84. package/dist/rules/specs.d.ts +1 -1
  85. package/dist/rules/specs.d.ts.map +1 -1
  86. package/dist/rules/specs.js +1 -1
  87. package/dist/rules/specs.js.map +1 -1
  88. package/dist/rules/types.d.ts +2 -2
  89. package/dist/rules/types.d.ts.map +1 -1
  90. package/dist/rules/valid-detour-refs.d.ts.map +1 -1
  91. package/dist/rules/valid-detour-refs.js +3 -2
  92. package/dist/rules/valid-detour-refs.js.map +1 -1
  93. package/dist/trails/context-no-surface-types.trail.js +1 -1
  94. package/dist/trails/context-no-trailhead-types.trail.d.ts +13 -0
  95. package/dist/trails/context-no-trailhead-types.trail.d.ts.map +1 -0
  96. package/dist/trails/context-no-trailhead-types.trail.js +21 -0
  97. package/dist/trails/context-no-trailhead-types.trail.js.map +1 -0
  98. package/dist/trails/cross-declarations.trail.d.ts +13 -0
  99. package/dist/trails/cross-declarations.trail.d.ts.map +1 -0
  100. package/dist/trails/cross-declarations.trail.js +22 -0
  101. package/dist/trails/cross-declarations.trail.js.map +1 -0
  102. package/dist/trails/follow-declarations.trail.js +1 -1
  103. package/dist/trails/implementation-returns-result.trail.js +1 -1
  104. package/dist/trails/index.d.ts +4 -4
  105. package/dist/trails/index.d.ts.map +1 -1
  106. package/dist/trails/index.js +4 -4
  107. package/dist/trails/index.js.map +1 -1
  108. package/dist/trails/no-direct-impl-in-route.trail.js +4 -4
  109. package/dist/trails/no-direct-impl-in-route.trail.js.map +1 -1
  110. package/dist/trails/no-direct-implementation-call.trail.js +2 -2
  111. package/dist/trails/no-direct-implementation-call.trail.js.map +1 -1
  112. package/dist/trails/no-sync-result-assumption.trail.js +2 -2
  113. package/dist/trails/no-sync-result-assumption.trail.js.map +1 -1
  114. package/dist/trails/no-throw-in-detour-target.trail.d.ts +1 -1
  115. package/dist/trails/no-throw-in-detour-target.trail.js +1 -1
  116. package/dist/trails/no-throw-in-implementation.trail.js +1 -1
  117. package/dist/trails/prefer-schema-inference.trail.js +1 -1
  118. package/dist/trails/provision-declarations.trail.d.ts +13 -0
  119. package/dist/trails/provision-declarations.trail.d.ts.map +1 -0
  120. package/dist/trails/provision-declarations.trail.js +25 -0
  121. package/dist/trails/provision-declarations.trail.js.map +1 -0
  122. package/dist/trails/provision-exists.trail.d.ts +15 -0
  123. package/dist/trails/provision-exists.trail.d.ts.map +1 -0
  124. package/dist/trails/provision-exists.trail.js +27 -0
  125. package/dist/trails/provision-exists.trail.js.map +1 -0
  126. package/dist/trails/run.d.ts +2 -2
  127. package/dist/trails/run.d.ts.map +1 -1
  128. package/dist/trails/run.js +6 -6
  129. package/dist/trails/run.js.map +1 -1
  130. package/dist/trails/schema.d.ts +1 -1
  131. package/dist/trails/schema.js +2 -2
  132. package/dist/trails/schema.js.map +1 -1
  133. package/dist/trails/service-declarations.trail.d.ts +13 -0
  134. package/dist/trails/service-declarations.trail.d.ts.map +1 -1
  135. package/dist/trails/service-declarations.trail.js +9 -7
  136. package/dist/trails/service-declarations.trail.js.map +1 -1
  137. package/dist/trails/service-exists.trail.d.ts +17 -0
  138. package/dist/trails/service-exists.trail.d.ts.map +1 -1
  139. package/dist/trails/service-exists.trail.js +10 -8
  140. package/dist/trails/service-exists.trail.js.map +1 -1
  141. package/dist/trails/valid-describe-refs.trail.d.ts +1 -1
  142. package/dist/trails/valid-detour-refs.trail.d.ts +1 -1
  143. package/dist/trails/valid-detour-refs.trail.js +2 -2
  144. package/dist/trails/wrap-rule.js +14 -14
  145. package/dist/trails/wrap-rule.js.map +1 -1
  146. package/package.json +4 -4
  147. package/src/__tests__/cli.test.ts +121 -8
  148. package/src/__tests__/{follow-declarations.test.ts → cross-declarations.test.ts} +78 -78
  149. package/src/__tests__/drift.test.ts +76 -6
  150. package/src/__tests__/formatters.test.ts +2 -2
  151. package/src/__tests__/implementation-returns-result.test.ts +11 -11
  152. package/src/__tests__/no-direct-implementation-call.test.ts +10 -10
  153. package/src/__tests__/no-sync-result-assumption.test.ts +6 -6
  154. package/src/__tests__/no-throw-in-detour-target.test.ts +6 -6
  155. package/src/__tests__/prefer-schema-inference.test.ts +4 -4
  156. package/src/__tests__/provision-declarations.test.ts +318 -0
  157. package/src/__tests__/provision-exists.test.ts +122 -0
  158. package/src/__tests__/rules.test.ts +38 -38
  159. package/src/__tests__/valid-describe-refs.test.ts +4 -4
  160. package/src/__tests__/wrap-rule.test.ts +4 -4
  161. package/src/cli.ts +27 -15
  162. package/src/draft.ts +22 -0
  163. package/src/drift.ts +63 -21
  164. package/src/formatters.ts +15 -4
  165. package/src/index.ts +29 -8
  166. package/src/rules/ast.ts +74 -31
  167. package/src/rules/{context-no-surface-types.ts → context-no-trailhead-types.ts} +8 -8
  168. package/src/rules/{follow-declarations.ts → cross-declarations.ts} +63 -56
  169. package/src/rules/draft-file-marking.ts +112 -0
  170. package/src/rules/draft-visible-debt.ts +62 -0
  171. package/src/rules/implementation-returns-result.ts +6 -6
  172. package/src/rules/index.ts +18 -12
  173. package/src/rules/no-direct-impl-in-route.ts +17 -17
  174. package/src/rules/no-direct-implementation-call.ts +7 -7
  175. package/src/rules/no-sync-result-assumption.ts +5 -5
  176. package/src/rules/no-throw-in-detour-target.ts +2 -2
  177. package/src/rules/no-throw-in-implementation.ts +3 -3
  178. package/src/rules/{service-declarations.ts → provision-declarations.ts} +145 -129
  179. package/src/rules/{service-exists.ts → provision-exists.ts} +53 -46
  180. package/src/rules/specs.ts +4 -4
  181. package/src/rules/types.ts +2 -2
  182. package/src/rules/valid-detour-refs.ts +4 -2
  183. package/src/trails/{context-no-surface-types.trail.ts → context-no-trailhead-types.trail.ts} +5 -5
  184. package/src/trails/cross-declarations.trail.ts +22 -0
  185. package/src/trails/implementation-returns-result.trail.ts +1 -1
  186. package/src/trails/index.ts +4 -4
  187. package/src/trails/no-direct-impl-in-route.trail.ts +4 -4
  188. package/src/trails/no-direct-implementation-call.trail.ts +2 -2
  189. package/src/trails/no-sync-result-assumption.trail.ts +2 -2
  190. package/src/trails/no-throw-in-detour-target.trail.ts +1 -1
  191. package/src/trails/no-throw-in-implementation.trail.ts +1 -1
  192. package/src/trails/prefer-schema-inference.trail.ts +1 -1
  193. package/src/trails/provision-declarations.trail.ts +25 -0
  194. package/src/trails/provision-exists.trail.ts +27 -0
  195. package/src/trails/run.ts +7 -7
  196. package/src/trails/schema.ts +2 -2
  197. package/src/trails/valid-detour-refs.trail.ts +2 -2
  198. package/src/trails/wrap-rule.ts +17 -17
  199. package/tsconfig.tsbuildinfo +1 -1
  200. package/src/__tests__/service-declarations.test.ts +0 -318
  201. package/src/__tests__/service-exists.test.ts +0 -122
  202. package/src/trails/follow-declarations.trail.ts +0 -22
  203. package/src/trails/service-declarations.trail.ts +0 -25
  204. package/src/trails/service-exists.trail.ts +0 -27
@@ -1,3 +1,3 @@
1
1
  $ oxlint ./src
2
2
  Found 0 warnings and 0 errors.
3
- Finished in 52ms on 56 files with 93 rules using 24 threads.
3
+ Finished in 75ms on 59 files with 93 rules using 24 threads.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @ontrails/warden
2
2
 
3
+ ## 1.0.0-beta.14
4
+
5
+ ### Minor Changes
6
+
7
+ - 69057e9: Add hierarchical CLI command trees and structured input, enforce established-only topo exports across trailheads, move developer topo and tracker state onto shared `trails.db` with pins and maintenance flows, and ship schema-derived stores through `@ontrails/store` and its Drizzle runtime.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [69057e9]
12
+ - @ontrails/core@1.0.0-beta.14
13
+ - @ontrails/schema@1.0.0-beta.14
14
+
15
+ ## 1.0.0-beta.13
16
+
17
+ ### Minor Changes
18
+
19
+ - Trail-native vocabulary cutover. Breaking API field renames across all packages:
20
+
21
+ - Trail spec: `run:` → `blaze:`, `follow:` → `crosses:`, `services:` → `provisions:`, `metadata:` → `meta:`, `emits:` → `signals:`
22
+ - Runtime: `ctx.follow()` → `ctx.cross()`, `ctx.emit()` → `ctx.signal()`, `ctx.signal` (abort) → `ctx.abortSignal`
23
+ - Entry points: `blaze(app)` → `trailhead(app)`
24
+ - Package rename: `@ontrails/crumbs` → `@ontrails/tracker`
25
+ - Wrapper types: `Layer` → `Gate`, `layers`/`middleware` → `gates`
26
+ - Transport: `surface` → `trailhead`, `adapter` → `connector`
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [6944147]
31
+ - Updated dependencies
32
+ - @ontrails/core@1.0.0-beta.13
33
+ - @ontrails/schema@1.0.0-beta.13
34
+
3
35
  ## 1.0.0-beta.12
4
36
 
5
37
  ### Patch Changes
@@ -12,19 +44,19 @@
12
44
 
13
45
  ### Minor Changes
14
46
 
15
- - Add services as a first-class primitive.
47
+ - Add provisions as a first-class primitive.
16
48
 
17
- Services make infrastructure dependencies declarative, injectable, and governable. Define a service with `service()`, declare it on a trail with `services: [db]`, and access it with `db.from(ctx)` or `ctx.service()`.
49
+ Provisions make infrastructure dependencies declarative, injectable, and governable. Define a provision with `provision()`, declare it on a trail with `provisions: [db]`, and access it with `db.from(ctx)` or `ctx.provision()`.
18
50
 
19
- **Core:** `service()` factory, `ServiceSpec<T>`, `ServiceContext`, singleton resolution in `executeTrail`, in-flight creation dedup, `isService` guard, `findDuplicateServiceId`, topo service discovery and validation, `services` field on trail specs.
51
+ **Core:** `provision()` factory, `ProvisionSpec<T>`, `ProvisionContext`, singleton resolution in `executeTrail`, in-flight creation dedup, `isProvision` guard, `findDuplicateProvisionId`, topo provision discovery and validation, `provisions` field on trail specs.
20
52
 
21
- **Testing:** Auto-resolution of `mock` factories in `testAll`, `testExamples`, `testContracts`, and `testFollows`. Explicit `services` overrides with correct precedence (`explicit > ctx.extensions > auto-mock`). Service mock propagation through follow graphs.
53
+ **Testing:** Auto-resolution of `mock` factories in `testAll`, `testExamples`, `testContracts`, and `testCrosses`. Explicit `provisions` overrides with correct precedence (`explicit > ctx.extensions > auto-mock`). Provision mock propagation through crossing graphs.
22
54
 
23
- **Warden:** `service-declarations` rule validates `db.from(ctx)` and `ctx.service()` usage matches declared `services: [...]`. `service-exists` rule validates declared service IDs resolve in project context. Scope-aware AST walking skips nested function boundaries.
55
+ **Warden:** `provision-declarations` rule validates `db.from(ctx)` and `ctx.provision()` usage matches declared `provisions: [...]`. `provision-exists` rule validates declared provision IDs resolve in project context. Scope-aware AST walking skips nested function boundaries.
24
56
 
25
- **Surfaces:** Service overrides thread through `dispatch` and `blaze` on CLI, MCP, and HTTP.
57
+ **Trailheads:** Provision overrides thread through `run` and `trailhead` on CLI, MCP, and HTTP.
26
58
 
27
- **Introspection:** Survey and surface map outputs include service graph. Topo exposes `.services`, `.getService()`, `.hasService()`, `.listServices()`, `.serviceIds()`, `.serviceCount`.
59
+ **Introspection:** Survey and trailhead map outputs include provision graph. Topo exposes `.provisions`, `.getProvision()`, `.hasProvision()`, `.listProvisions()`, `.provisionIds()`, `.provisionCount`.
28
60
 
29
61
  **Docs:** ADR-009 accepted. Unified services guide, updated vocabulary, getting-started, architecture, and package READMEs.
30
62
 
@@ -40,13 +72,13 @@
40
72
 
41
73
  - Cleanup and hardening pass across all packages.
42
74
 
43
- **core**: Deduplicate `DispatchOptions` as type alias of `ExecuteTrailOptions`. Replace `TrailContext` index signature with typed `extensions` field for type safety. Deep-merge `extensions` in `executeTrail` context resolution. Remove unused `Surface` type, `adapters.ts`, `health.ts`, and `job.ts` proof-of-concept from published package.
75
+ **core**: Deduplicate `RunOptions` as type alias of `ExecuteTrailOptions`. Replace `TrailContext` index signature with typed `extensions` field for type safety. Deep-merge `extensions` in `executeTrail` context resolution. Remove unused `Trailhead` type and proof-of-concept files from published package.
44
76
 
45
- **cli**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `blaze()` with opt-out via `validate: false`.
77
+ **cli**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `trailhead()` with opt-out via `validate: false`.
46
78
 
47
- **http**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `blaze()` with opt-out.
79
+ **http**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `trailhead()` with opt-out.
48
80
 
49
- **mcp**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `blaze()` with opt-out.
81
+ **mcp**: Remove vestigial `kind` checks from build. Run `validateTopo()` automatically in `trailhead()` with opt-out.
50
82
 
51
83
  **warden**: Project-aware rule context preserved in trail wrappers.
52
84
 
@@ -58,9 +90,9 @@
58
90
 
59
91
  ### Minor Changes
60
92
 
61
- - Consolidated improvements across all surface packages.
93
+ - Consolidated improvements across all trailhead packages.
62
94
 
63
- **core**: Add `TrailResult<T>` utility type, `topo.ids()` and `topo.count` accessors, `dispatch()` for headless trail execution, and extract shared `executeTrail` pipeline used by CLI/MCP/HTTP.
95
+ **core**: Add `TrailResult<T>` utility type, `topo.ids()` and `topo.count` accessors, `run()` for headless trail execution, and extract shared `executeTrail` pipeline used by CLI/MCP/HTTP.
64
96
 
65
97
  **http**: Detect route path collisions and return `Result` from `buildHttpRoutes()`, wire request `AbortSignal` through to trail context, and make write → POST mapping explicit in intent-to-method lookup.
66
98
 
@@ -68,7 +100,7 @@
68
100
 
69
101
  **cli**: Verify exception catching via centralized `executeTrail`.
70
102
 
71
- **testing**: Follow context awareness improvements.
103
+ **testing**: Cross-context awareness improvements.
72
104
 
73
105
  **warden**: Refactor rules as composable trails with examples.
74
106
 
@@ -100,11 +132,11 @@
100
132
 
101
133
  ### Patch Changes
102
134
 
103
- - Fix Codex review findings on type-utils and follow-declarations.
135
+ - Fix Codex review findings on type-utils and cross-declarations.
104
136
 
105
137
  **core**: `inputOf()`/`outputOf()` now preserve the exact Zod schema subtype instead of widening to `z.ZodType`.
106
138
 
107
- **warden**: `follow-declarations` rule now recognizes single-object trail overload, detects any context parameter name (not just `ctx`), matches destructured `follow()` calls, resolves const identifiers in `follow` arrays, and restricts run body extraction to top-level config properties.
139
+ **warden**: `cross-declarations` rule now recognizes single-object trail overload, detects any context parameter name (not just `ctx`), matches destructured `cross()` calls, resolves const identifiers in `crosses` arrays, and restricts blaze body extraction to top-level config properties.
108
140
 
109
141
  - Updated dependencies
110
142
  - @ontrails/core@1.0.0-beta.6
@@ -114,11 +146,11 @@
114
146
 
115
147
  ### Minor Changes
116
148
 
117
- - Type utilities and follow-declarations warden rule.
149
+ - Type utilities and cross-declarations warden rule.
118
150
 
119
151
  **core**: Add `TrailInput<T>`, `TrailOutput<T>` utility types and `inputOf()`, `outputOf()` runtime schema accessors.
120
152
 
121
- **warden**: Add `follow-declarations` rule — statically analyzes `ctx.follow()` calls against declared `follow: [...]` arrays. Errors on undeclared calls, warns on unused declarations.
153
+ **warden**: Add `cross-declarations` rule — statically analyzes `ctx.cross()` calls against declared `crosses: [...]` arrays. Errors on undeclared calls, warns on unused declarations.
122
154
 
123
155
  ### Patch Changes
124
156
 
@@ -134,15 +166,15 @@
134
166
 
135
167
  **BREAKING CHANGES:**
136
168
 
137
- - `hike()` removed — use `trail()` with optional `follow: [...]` field
138
- - `follows` renamed to `follow` (singular, matching `ctx.follow()`)
169
+ - `hike()` removed — use `trail()` with optional `crosses: [...]` field
170
+ - `follows` renamed to `crosses` (matching `ctx.cross()`)
139
171
  - `topo.hikes` removed — single `topo.trails` map
140
172
  - `kind: 'hike'` removed — everything is `kind: 'trail'`
141
173
  - `readOnly`/`destructive` booleans replaced by `intent: 'read' | 'write' | 'destroy'`
142
174
  - `implementation` field renamed to `run`
143
175
  - `markers` field renamed to `metadata`
144
- - `testHike` renamed to `testFollows`, `HikeScenario` to `FollowScenario`
145
- - `blaze()` now returns the surface handle (`Command` for CLI, `Server` for MCP)
176
+ - `testHike` renamed to `testCrosses`, `HikeScenario` to `CrossScenario`
177
+ - `trailhead()` now returns the trailhead handle (`Command` for CLI, `Server` for MCP)
146
178
 
147
179
  ### Patch Changes
148
180
 
@@ -154,15 +186,15 @@
154
186
 
155
187
  ### Minor Changes
156
188
 
157
- - Bug fixes across all surface packages found via parallel Codex review.
189
+ - Bug fixes across all trailhead packages found via parallel Codex review.
158
190
 
159
191
  **core**: Fix Result.toJson false circular detection on DAGs, deserializeError subclass round-trip, topo cross-kind ID collisions, validateTopo multi-node cycle detection, error example input validation bypass, and deriveFields array type collapse.
160
192
 
161
- **cli**: Switch blaze to parseAsync for proper async error handling, add boolean flag negation (--no-flag), and strict number parsing that rejects partial input.
193
+ **cli**: Switch trailhead to parseAsync for proper async error handling, add boolean flag negation (--no-flag), and strict number parsing that rejects partial input.
162
194
 
163
195
  **mcp**: Align BlobRef with core (including ReadableStream support) and detect tool-name collisions after normalization.
164
196
 
165
- **testing**: Include hikes in testContracts validation, with follow-context awareness.
197
+ **testing**: Include hikes in testContracts validation, with cross-context awareness.
166
198
 
167
199
  **warden**: Collect hike detour targets, validate detour refs in hike specs, and stop implementation-returns-result from walking into nested function bodies.
168
200
 
@@ -199,13 +231,13 @@
199
231
 
200
232
  - Initial v1 beta release of the Trails framework.
201
233
 
202
- - **@ontrails/core** — Result type, error taxonomy, trail/hike/event/topo, validateTopo, validateInput/Output, deriveFields, patterns, redaction, branded types, resilience
203
- - **@ontrails/cli** — CLI surface adapter, Commander integration, flag derivation, layers
204
- - **@ontrails/mcp** — MCP surface adapter, tool generation, annotations, progress bridge
205
- - **@ontrails/logging** — Structured logging, sinks, formatters, LogTape adapter
206
- - **@ontrails/testing** — testAll, testExamples, testTrail, testHike, testContracts, testDetours, surface harnesses
234
+ - **@ontrails/core** — Result type, error taxonomy, trail/hike/signal/topo, validateTopo, validateInput/Output, deriveFields, patterns, redaction, branded types, resilience
235
+ - **@ontrails/cli** — CLI trailhead connector, Commander integration, flag derivation
236
+ - **@ontrails/mcp** — MCP trailhead connector, tool generation, annotations, progress bridge
237
+ - **@ontrails/logging** — Structured logging, sinks, formatters, LogTape connector
238
+ - **@ontrails/testing** — testAll, testExamples, testTrail, testHike, testContracts, testDetours, trailhead harnesses
207
239
  - **@ontrails/warden** — AST-based code convention rules via oxc-parser, drift detection, CI formatters
208
- - **@ontrails/schema** — Surface map generation, hashing, semantic diffing
240
+ - **@ontrails/schema** — Trailhead map generation, hashing, semantic diffing
209
241
 
210
242
  ### Patch Changes
211
243
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @ontrails/warden
2
2
 
3
- AST-based code convention rules for Trails. 13 lint rules that catch contract violations at development time, plus surface lock drift detection and CI formatters.
3
+ AST-based code convention rules for Trails. 15 lint rules that catch contract violations at development time, plus lock drift detection and CI formatters.
4
4
 
5
- Structural checks (follow target existence, declared service existence, recursive follow, example schema validation) live in `validateTopo()` from `@ontrails/core`. Warden handles the code-level rules that need AST analysis.
5
+ Structural checks (cross target existence, declared provision existence, recursive crossing, example schema validation) live in `validateTopo()` from `@ontrails/core`. Warden handles the code-level rules that need AST analysis.
6
6
 
7
7
  ## Usage
8
8
 
@@ -20,7 +20,7 @@ Or programmatically:
20
20
  ```typescript
21
21
  import { runWarden, formatWardenReport } from '@ontrails/warden';
22
22
 
23
- const report = await runWarden(app, { exitCode: true });
23
+ const report = await runWarden({ topo: app });
24
24
  console.log(formatWardenReport(report));
25
25
  ```
26
26
 
@@ -28,30 +28,32 @@ console.log(formatWardenReport(report));
28
28
 
29
29
  | Rule | Severity | What it catches |
30
30
  | --- | --- | --- |
31
- | `no-throw-in-implementation` | error | `throw` inside run bodies |
32
- | `implementation-returns-result` | error | Run functions returning raw values instead of `Result` |
33
- | `context-no-surface-types` | error | Surface type imports (`Request`, `McpSession`) in trail files |
34
- | `no-sync-result-assumption` | error | Missing `await` on run results |
31
+ | `no-throw-in-implementation` | error | `throw` inside blaze bodies |
32
+ | `implementation-returns-result` | error | Blaze functions returning raw values instead of `Result` |
33
+ | `context-no-trailhead-types` | error | Trailhead type imports (`Request`, `McpSession`) in trail files |
34
+ | `no-sync-result-assumption` | error | Missing `await` on `.blaze()` results |
35
35
  | `valid-detour-refs` | error | Detour targets that do not exist in the topo |
36
36
  | `no-throw-in-detour-target` | error | `throw` inside detour target trails |
37
- | `no-direct-implementation-call` | warn | Direct `.run()` calls bypassing `ctx.follow()` |
38
- | `no-direct-impl-in-route` | warn | Direct `.run()` calls inside trail bodies with `follow` |
37
+ | `no-direct-implementation-call` | warn | Direct `.blaze()` calls bypassing `ctx.cross()` |
38
+ | `no-direct-impl-in-route` | warn | Direct `.blaze()` calls inside trail bodies with `crosses` |
39
39
  | `prefer-schema-inference` | warn | Redundant field overrides already derivable from the schema |
40
- | `follow-declarations` | error/warn | `ctx.follow()` calls that drift from declared `follow: [...]` |
41
- | `service-declarations` | error/warn | `service.from(ctx)` / `ctx.service()` usage that drifts from declared `services: [...]` |
42
- | `service-exists` | error | Declared or referenced service IDs that do not resolve in project context |
40
+ | `cross-declarations` | error/warn | `ctx.cross()` calls that drift from declared `crosses: [...]` |
41
+ | `provision-declarations` | error/warn | `provision.from(ctx)` / `ctx.provision()` usage that drifts from declared `provisions: [...]` |
42
+ | `provision-exists` | error | Declared or referenced provision IDs that do not resolve in project context |
43
43
  | `valid-describe-refs` | warn | `@see` refs in `.describe()` that do not resolve |
44
+ | `draft-file-marking` | error | Draft-bearing files missing `_draft.*` or `*.draft.*` filename markers |
45
+ | `draft-visible-debt` | warn | Draft IDs remaining in source files that need promotion or removal |
44
46
 
45
47
  ## Drift detection
46
48
 
47
- Warden integrates with `@ontrails/schema` to detect when the topo has changed without updating `surface.lock`:
49
+ Warden integrates with `@ontrails/schema` to detect when the topo has changed without updating the lock file:
48
50
 
49
51
  ```typescript
50
52
  import { checkDrift } from '@ontrails/warden';
51
53
 
52
- const drift = await checkDrift(app);
54
+ const drift = await checkDrift(process.cwd(), app);
53
55
  if (drift.stale) {
54
- console.log('surface.lock is stale -- regenerate with `trails survey generate`');
56
+ console.log('lock file is stale -- regenerate with `trails topo export`');
55
57
  }
56
58
  ```
57
59
 
@@ -75,7 +77,7 @@ import { formatGitHubAnnotations, formatJson, formatSummary } from '@ontrails/wa
75
77
 
76
78
  ## Trail-based API
77
79
 
78
- Every built-in warden rule is also available as a composable trail. This makes rules queryable, testable, and invocable through any Trails surface.
80
+ Every built-in warden rule is also available as a composable trail. This makes rules queryable, testable, and invocable through any Trails trailhead.
79
81
 
80
82
  ```typescript
81
83
  import { wardenTopo, runWardenTrails } from '@ontrails/warden';
@@ -86,7 +88,7 @@ console.log(wardenTopo.ids()); // ['warden.rule.no-throw-in-implementation', ...
86
88
  // Run all rule trails against a source file
87
89
  const diagnostics = await runWardenTrails(filePath, sourceCode, {
88
90
  knownTrailIds: myApp.ids(),
89
- knownServiceIds: myApp.serviceIds(),
91
+ knownProvisionIds: myApp.provisionIds(),
90
92
  });
91
93
  ```
92
94
 
@@ -96,9 +98,9 @@ To wrap a custom rule as a trail, use `wrapRule` (imported from `@ontrails/warde
96
98
 
97
99
  | Export | What it does |
98
100
  | --- | --- |
99
- | `runWarden(app, options?)` | Run all rules and drift checks, return a report |
101
+ | `runWarden(options?)` | Run all rules and drift checks, return a report |
100
102
  | `formatWardenReport(report)` | Human-readable report |
101
- | `checkDrift(app)` | Check if `surface.lock` matches the current topo |
103
+ | `checkDrift(rootDir, topo?)` | Check if the lock file matches the current topo |
102
104
  | `wardenRules` | Registry of all built-in rules |
103
105
  | `wardenTopo` | `Topo` of all built-in rule trails (one per rule) |
104
106
  | `runWardenTrails(filePath, sourceCode, options?)` | Dispatch all rule trails for a file, collect diagnostics |
package/dist/cli.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface WardenOptions {
17
17
  readonly lintOnly?: boolean | undefined;
18
18
  /** Only run drift detection, skip lint rules */
19
19
  readonly driftOnly?: boolean | undefined;
20
- /** App topology for drift detection. When provided, enables real surface lock comparison. */
20
+ /** App topology for drift detection. When provided, enables real trailhead lock comparison. */
21
21
  readonly topo?: Topo | undefined;
22
22
  }
23
23
  /**
package/dist/cli.d.ts.map CHANGED
@@ -1 +1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KG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAU9C,OAAO,KAAK,EAGV,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,gDAAgD;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACzC,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAwND;;GAEG;AACH,eAAO,MAAM,SAAS,GACpB,UAAS,aAAkB,KAC1B,OAAO,CAAC,YAAY,CAwBtB,CAAC;AA2DF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY,KAAG,MAmBzD,CAAC"}
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { resolve } from 'node:path';
8
8
  import { checkDrift } from './drift.js';
9
- import { collectServiceDefinitionIds, findConfigProperty, findTrailDefinitions, parse, walk, } from './rules/ast.js';
9
+ import { collectProvisionDefinitionIds, findConfigProperty, findTrailDefinitions, parse, walk, } from './rules/ast.js';
10
10
  import { wardenRules } from './rules/index.js';
11
11
  /**
12
12
  * Collect all .ts files under a directory, excluding node_modules, dist, and .git.
@@ -67,13 +67,13 @@ const collectDetourTargetTrailIds = (sourceCode, filePath, detourTargetTrailIds)
67
67
  });
68
68
  }
69
69
  };
70
- const collectKnownServiceIds = (sourceCode, filePath, knownServiceIds) => {
70
+ const collectKnownProvisionIds = (sourceCode, filePath, knownProvisionIds) => {
71
71
  const ast = parse(filePath, sourceCode);
72
72
  if (!ast) {
73
73
  return;
74
74
  }
75
- for (const id of collectServiceDefinitionIds(ast)) {
76
- knownServiceIds.add(id);
75
+ for (const id of collectProvisionDefinitionIds(ast)) {
76
+ knownProvisionIds.add(id);
77
77
  }
78
78
  };
79
79
  const loadSourceFiles = async (rootDir) => {
@@ -108,22 +108,26 @@ const collectTopoDetourTargetTrailIds = (appTopo) => {
108
108
  };
109
109
  const buildProjectContextFromTopo = (appTopo) => {
110
110
  const knownTrailIds = new Set(appTopo.trails.keys());
111
- const knownServiceIds = new Set(appTopo.services.keys());
111
+ const knownProvisionIds = new Set(appTopo.provisions.keys());
112
112
  const detourTargetTrailIds = collectTopoDetourTargetTrailIds(appTopo);
113
- return { detourTargetTrailIds, knownServiceIds, knownTrailIds };
113
+ return {
114
+ detourTargetTrailIds,
115
+ knownProvisionIds,
116
+ knownTrailIds,
117
+ };
114
118
  };
115
119
  const buildProjectContextFromFiles = (sourceFiles) => {
116
120
  const knownTrailIds = new Set();
117
- const knownServiceIds = new Set();
121
+ const knownProvisionIds = new Set();
118
122
  const detourTargetTrailIds = new Set();
119
123
  for (const sourceFile of sourceFiles) {
120
124
  collectKnownTrailIds(sourceFile.sourceCode, sourceFile.filePath, knownTrailIds);
121
- collectKnownServiceIds(sourceFile.sourceCode, sourceFile.filePath, knownServiceIds);
125
+ collectKnownProvisionIds(sourceFile.sourceCode, sourceFile.filePath, knownProvisionIds);
122
126
  collectDetourTargetTrailIds(sourceFile.sourceCode, sourceFile.filePath, detourTargetTrailIds);
123
127
  }
124
128
  return {
125
129
  detourTargetTrailIds,
126
- knownServiceIds,
130
+ knownProvisionIds,
127
131
  knownTrailIds,
128
132
  };
129
133
  };
@@ -165,7 +169,9 @@ export const runWarden = async (options = {}) => {
165
169
  diagnostics: allDiagnostics,
166
170
  drift,
167
171
  errorCount,
168
- passed: errorCount === 0 && !(drift?.stale ?? false),
172
+ passed: errorCount === 0 &&
173
+ !(drift?.stale ?? false) &&
174
+ drift?.blockedReason === undefined,
169
175
  warnCount,
170
176
  };
171
177
  };
@@ -192,8 +198,11 @@ const formatDriftSection = (drift) => {
192
198
  if (drift === null) {
193
199
  return [];
194
200
  }
201
+ if (drift.blockedReason !== undefined) {
202
+ return [`Drift: blocked (${drift.blockedReason})`, ''];
203
+ }
195
204
  const label = drift.stale
196
- ? 'Drift: surface.lock is stale (regenerate with `trails survey generate`)'
205
+ ? 'Drift: trails.lock is stale (regenerate with `trails topo export`)'
197
206
  : 'Drift: clean';
198
207
  return [label, ''];
199
208
  };
@@ -208,7 +217,10 @@ const formatResultLine = (report) => {
208
217
  if (report.errorCount > 0) {
209
218
  parts.push(`${report.errorCount} errors`);
210
219
  }
211
- if (report.drift?.stale) {
220
+ if (report.drift?.blockedReason !== undefined) {
221
+ parts.push('established exports blocked');
222
+ }
223
+ else if (report.drift?.stale) {
212
224
  parts.push('drift detected');
213
225
  }
214
226
  return `Result: FAIL (${parts.join(', ')})`;
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,EACL,IAAI,GACL,MAA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kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO,CAAC,eAAe,EAAE,eAAe,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAC,IAAI,CACvE,IAAI,CACL,CAAC;IACJ,CAAC;IAED,OAAO;QACL,eAAe;QACf,eAAe;QACf,EAAE;QACF,GAAG,SAAS;QACZ,EAAE;QACF,GAAG,UAAU;QACb,gBAAgB,CAAC,MAAM,CAAC;KACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const DRAFT_FILE_PREFIX = "_draft.";
2
+ export declare const DRAFT_FILE_SEGMENT = ".draft.";
3
+ export declare const isDraftMarkedFile: (filePath: string) => boolean;
4
+ export declare const stripDraftFileMarkers: (fileName: string) => string;
5
+ //# sourceMappingURL=draft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../src/draft.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAI5C,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,OAMpD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,KAAG,MAMxD,CAAC"}
package/dist/draft.js ADDED
@@ -0,0 +1,16 @@
1
+ import { basename } from 'node:path';
2
+ export const DRAFT_FILE_PREFIX = '_draft.';
3
+ export const DRAFT_FILE_SEGMENT = '.draft.';
4
+ const DRAFT_TRAILING_SEGMENT = /\.draft(?=\.[^.]+$)/;
5
+ export const isDraftMarkedFile = (filePath) => {
6
+ const fileName = basename(filePath);
7
+ return (fileName.startsWith(DRAFT_FILE_PREFIX) ||
8
+ fileName.includes(DRAFT_FILE_SEGMENT));
9
+ };
10
+ export const stripDraftFileMarkers = (fileName) => {
11
+ if (fileName.startsWith(DRAFT_FILE_PREFIX)) {
12
+ return fileName.slice(DRAFT_FILE_PREFIX.length);
13
+ }
14
+ return fileName.replace(DRAFT_TRAILING_SEGMENT, '');
15
+ };
16
+ //# sourceMappingURL=draft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.js","sourceRoot":"","sources":["../src/draft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAW,EAAE;IAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,CACL,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC;QACtC,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CACtC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAU,EAAE;IAChE,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC3C,OAAO,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,QAAQ,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC,CAAC"}
package/dist/drift.d.ts CHANGED
@@ -1,24 +1,27 @@
1
1
  /**
2
- * Surface lock drift detection.
2
+ * Topo lock drift detection.
3
3
  *
4
- * Compares the committed `surface.lock` hash against a freshly generated
5
- * surface map hash to detect when the trail topology has changed without
6
- * updating the lock file.
4
+ * Compares the committed `trails.lock` hash against a freshly generated
5
+ * trailhead map hash to detect when the trail topology has changed without
6
+ * updating the lock file. The committed lock may be structured JSON or the
7
+ * legacy single-line hash format.
7
8
  */
8
9
  import type { Topo } from '@ontrails/core';
9
10
  /**
10
- * Result of a drift check comparing committed surface.lock against the current state.
11
+ * Result of a drift check comparing committed trails.lock against the current state.
11
12
  */
12
13
  export interface DriftResult {
14
+ /** Why drift could not be computed for the established graph, when blocked. */
15
+ readonly blockedReason?: string | undefined;
13
16
  /** Whether the committed lock is out of date */
14
17
  readonly stale: boolean;
15
- /** Hash from the committed surface.lock file, or null if not found */
18
+ /** Hash from the committed trails.lock file, or null if not found */
16
19
  readonly committedHash: string | null;
17
20
  /** Hash computed from the current trail topology */
18
21
  readonly currentHash: string;
19
22
  }
20
23
  /**
21
- * Check whether the committed surface.lock is stale compared to the current topology.
24
+ * Check whether the committed trails.lock is stale compared to the current topology.
22
25
  *
23
26
  * When no topo is provided, returns a clean result (no drift detectable without runtime info).
24
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../src/drift.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAO3C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,OAAO,IAAI,GAAG,SAAS,KACtB,OAAO,CAAC,WAAW,CAcrB,CAAC"}
1
+ {"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../src/drift.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAa3C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,OAAO,IAAI,GAAG,SAAS,KACtB,OAAO,CAAC,WAAW,CA6CrB,CAAC"}
package/dist/drift.js CHANGED
@@ -1,27 +1,61 @@
1
1
  /**
2
- * Surface lock drift detection.
2
+ * Topo lock drift detection.
3
3
  *
4
- * Compares the committed `surface.lock` hash against a freshly generated
5
- * surface map hash to detect when the trail topology has changed without
6
- * updating the lock file.
4
+ * Compares the committed `trails.lock` hash against a freshly generated
5
+ * trailhead map hash to detect when the trail topology has changed without
6
+ * updating the lock file. The committed lock may be structured JSON or the
7
+ * legacy single-line hash format.
7
8
  */
8
- import { generateSurfaceMap, hashSurfaceMap, readSurfaceLock, } from '@ontrails/schema';
9
+ import { existsSync, statSync } from 'node:fs';
10
+ import { createTopoStore, NotFoundError, ValidationError, } from '@ontrails/core';
11
+ import { resolveTrailsDir } from '@ontrails/core/internal/trails-db';
12
+ import { generateTrailheadMap, hashTrailheadMap, readTrailheadLockData, } from '@ontrails/schema';
9
13
  /**
10
- * Check whether the committed surface.lock is stale compared to the current topology.
14
+ * Check whether the committed trails.lock is stale compared to the current topology.
11
15
  *
12
16
  * When no topo is provided, returns a clean result (no drift detectable without runtime info).
13
17
  */
14
18
  export const checkDrift = async (rootDir, topo) => {
15
- if (!topo) {
16
- return { committedHash: null, currentHash: 'unknown', stale: false };
19
+ try {
20
+ const trailsDir = resolveTrailsDir({ rootDir });
21
+ const committedLock = existsSync(rootDir) && statSync(rootDir).isDirectory()
22
+ ? await readTrailheadLockData({ dir: trailsDir })
23
+ : null;
24
+ // Prefer the stored hash (computed by the export pipeline) to avoid
25
+ // divergence between the schema and store hash pipelines.
26
+ const storedHash = (() => {
27
+ try {
28
+ return createTopoStore({ rootDir }).exports.get()?.trailheadHash;
29
+ }
30
+ catch (error) {
31
+ if (error instanceof NotFoundError) {
32
+ return;
33
+ }
34
+ throw error;
35
+ }
36
+ })();
37
+ const currentHash = storedHash ??
38
+ (topo === undefined
39
+ ? 'unknown'
40
+ : hashTrailheadMap(generateTrailheadMap(topo)));
41
+ return {
42
+ committedHash: committedLock?.hash ?? null,
43
+ currentHash,
44
+ stale: committedLock !== null &&
45
+ currentHash !== 'unknown' &&
46
+ committedLock.hash !== currentHash,
47
+ };
48
+ }
49
+ catch (error) {
50
+ if (!(error instanceof ValidationError)) {
51
+ throw error;
52
+ }
53
+ return {
54
+ blockedReason: error.message,
55
+ committedHash: null,
56
+ currentHash: 'blocked',
57
+ stale: true,
58
+ };
17
59
  }
18
- const surfaceMap = generateSurfaceMap(topo);
19
- const currentHash = hashSurfaceMap(surfaceMap);
20
- const committedHash = await readSurfaceLock({ dir: rootDir });
21
- return {
22
- committedHash,
23
- currentHash,
24
- stale: committedHash !== null && committedHash !== currentHash,
25
- };
26
60
  };
27
61
  //# sourceMappingURL=drift.js.map
package/dist/drift.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"drift.js","sourceRoot":"","sources":["../src/drift.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAc1B;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,OAAe,EACf,IAAuB,EACD,EAAE;IACxB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,aAAa,EAAE,IAAI,EAA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CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC;YACnE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;oBACnC,OAAO;gBACT,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;QACL,MAAM,WAAW,GACf,UAAU;YACV,CAAC,IAAI,KAAK,SAAS;gBACjB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpD,OAAO;YACL,aAAa,EAAE,aAAa,EAAE,IAAI,IAAI,IAAI;YAC1C,WAAW;YACX,KAAK,EACH,aAAa,KAAK,IAAI;gBACtB,WAAW,KAAK,SAAS;gBACzB,aAAa,CAAC,IAAI,KAAK,WAAW;SACrC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,eAAe,CAAC,EAAE,CAAC;YACxC,MAAM,KAAK,CAAC;QACd,CAAC;QAED,OAAO;YACL,aAAa,EAAE,KAAK,CAAC,OAAO;YAC5B,aAAa,EAAE,IAAI;YACnB,WAAW,EAAE,SAAS;YACtB,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
@@ -10,7 +10,8 @@ import type { WardenReport } from './cli.js';
10
10
  * Produce GitHub Actions workflow command annotations, one per diagnostic.
11
11
  *
12
12
  * Severity mapping: `error` to `::error`, `warn` to `::warning`.
13
- * Drift staleness is emitted as a single `::error` annotation when detected.
13
+ * Drift staleness or established-export blocking is emitted as a single
14
+ * `::error` annotation when detected.
14
15
  */
15
16
  export declare const formatGitHubAnnotations: (report: WardenReport) => string;
16
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAS7C;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,YAAY,KAAG,MAiB9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,YAAY,KAAG,MAiBjD,CAAC;AA6BF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,YAAY,KAAG,MAapD,CAAC"}
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAS7C;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,YAAY,KAAG,MAmB9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,YAAY,KAAG,MAiBjD,CAAC;AAqCF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,YAAY,KAAG,MAapD,CAAC"}