@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.
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +63 -31
- package/README.md +21 -19
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +24 -12
- package/dist/cli.js.map +1 -1
- package/dist/draft.d.ts +5 -0
- package/dist/draft.d.ts.map +1 -0
- package/dist/draft.js +16 -0
- package/dist/draft.js.map +1 -0
- package/dist/drift.d.ts +10 -7
- package/dist/drift.d.ts.map +1 -1
- package/dist/drift.js +50 -16
- package/dist/drift.js.map +1 -1
- package/dist/formatters.d.ts +2 -1
- package/dist/formatters.d.ts.map +1 -1
- package/dist/formatters.js +15 -4
- package/dist/formatters.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/rules/ast.d.ts +22 -11
- package/dist/rules/ast.d.ts.map +1 -1
- package/dist/rules/ast.js +56 -30
- package/dist/rules/ast.js.map +1 -1
- package/dist/rules/context-no-trailhead-types.d.ts +12 -0
- package/dist/rules/context-no-trailhead-types.d.ts.map +1 -0
- package/dist/rules/context-no-trailhead-types.js +96 -0
- package/dist/rules/context-no-trailhead-types.js.map +1 -0
- package/dist/rules/cross-declarations.d.ts +13 -0
- package/dist/rules/cross-declarations.d.ts.map +1 -0
- package/dist/rules/cross-declarations.js +264 -0
- package/dist/rules/cross-declarations.js.map +1 -0
- package/dist/rules/draft-file-marking.d.ts +6 -0
- package/dist/rules/draft-file-marking.d.ts.map +1 -0
- package/dist/rules/draft-file-marking.js +65 -0
- package/dist/rules/draft-file-marking.js.map +1 -0
- package/dist/rules/draft-visible-debt.d.ts +12 -0
- package/dist/rules/draft-visible-debt.d.ts.map +1 -0
- package/dist/rules/draft-visible-debt.js +45 -0
- package/dist/rules/draft-visible-debt.js.map +1 -0
- package/dist/rules/follow-declarations.d.ts +1 -1
- package/dist/rules/follow-declarations.js +5 -5
- package/dist/rules/follow-declarations.js.map +1 -1
- package/dist/rules/implementation-returns-result.d.ts +2 -2
- package/dist/rules/implementation-returns-result.js +6 -6
- package/dist/rules/implementation-returns-result.js.map +1 -1
- package/dist/rules/index.d.ts +6 -4
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +18 -12
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/no-direct-impl-in-route.d.ts +4 -4
- package/dist/rules/no-direct-impl-in-route.js +14 -14
- package/dist/rules/no-direct-impl-in-route.js.map +1 -1
- package/dist/rules/no-direct-implementation-call.d.ts +3 -3
- package/dist/rules/no-direct-implementation-call.js +7 -7
- package/dist/rules/no-direct-implementation-call.js.map +1 -1
- package/dist/rules/no-sync-result-assumption.d.ts +1 -1
- package/dist/rules/no-sync-result-assumption.js +5 -5
- package/dist/rules/no-sync-result-assumption.js.map +1 -1
- package/dist/rules/no-throw-in-detour-target.js +2 -2
- package/dist/rules/no-throw-in-detour-target.js.map +1 -1
- package/dist/rules/no-throw-in-implementation.d.ts +1 -1
- package/dist/rules/no-throw-in-implementation.js +3 -3
- package/dist/rules/no-throw-in-implementation.js.map +1 -1
- package/dist/rules/provision-declarations.d.ts +14 -0
- package/dist/rules/provision-declarations.d.ts.map +1 -0
- package/dist/rules/provision-declarations.js +344 -0
- package/dist/rules/provision-declarations.js.map +1 -0
- package/dist/rules/provision-exists.d.ts +6 -0
- package/dist/rules/provision-exists.d.ts.map +1 -0
- package/dist/rules/provision-exists.js +90 -0
- package/dist/rules/provision-exists.js.map +1 -0
- package/dist/rules/service-declarations.d.ts +7 -5
- package/dist/rules/service-declarations.d.ts.map +1 -1
- package/dist/rules/service-declarations.js +106 -103
- package/dist/rules/service-declarations.js.map +1 -1
- package/dist/rules/service-exists.d.ts +3 -1
- package/dist/rules/service-exists.d.ts.map +1 -1
- package/dist/rules/service-exists.js +35 -33
- package/dist/rules/service-exists.js.map +1 -1
- package/dist/rules/specs.d.ts +1 -1
- package/dist/rules/specs.d.ts.map +1 -1
- package/dist/rules/specs.js +1 -1
- package/dist/rules/specs.js.map +1 -1
- package/dist/rules/types.d.ts +2 -2
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/valid-detour-refs.d.ts.map +1 -1
- package/dist/rules/valid-detour-refs.js +3 -2
- package/dist/rules/valid-detour-refs.js.map +1 -1
- package/dist/trails/context-no-surface-types.trail.js +1 -1
- package/dist/trails/context-no-trailhead-types.trail.d.ts +13 -0
- package/dist/trails/context-no-trailhead-types.trail.d.ts.map +1 -0
- package/dist/trails/context-no-trailhead-types.trail.js +21 -0
- package/dist/trails/context-no-trailhead-types.trail.js.map +1 -0
- package/dist/trails/cross-declarations.trail.d.ts +13 -0
- package/dist/trails/cross-declarations.trail.d.ts.map +1 -0
- package/dist/trails/cross-declarations.trail.js +22 -0
- package/dist/trails/cross-declarations.trail.js.map +1 -0
- package/dist/trails/follow-declarations.trail.js +1 -1
- package/dist/trails/implementation-returns-result.trail.js +1 -1
- package/dist/trails/index.d.ts +4 -4
- package/dist/trails/index.d.ts.map +1 -1
- package/dist/trails/index.js +4 -4
- package/dist/trails/index.js.map +1 -1
- package/dist/trails/no-direct-impl-in-route.trail.js +4 -4
- package/dist/trails/no-direct-impl-in-route.trail.js.map +1 -1
- package/dist/trails/no-direct-implementation-call.trail.js +2 -2
- package/dist/trails/no-direct-implementation-call.trail.js.map +1 -1
- package/dist/trails/no-sync-result-assumption.trail.js +2 -2
- package/dist/trails/no-sync-result-assumption.trail.js.map +1 -1
- package/dist/trails/no-throw-in-detour-target.trail.d.ts +1 -1
- package/dist/trails/no-throw-in-detour-target.trail.js +1 -1
- package/dist/trails/no-throw-in-implementation.trail.js +1 -1
- package/dist/trails/prefer-schema-inference.trail.js +1 -1
- package/dist/trails/provision-declarations.trail.d.ts +13 -0
- package/dist/trails/provision-declarations.trail.d.ts.map +1 -0
- package/dist/trails/provision-declarations.trail.js +25 -0
- package/dist/trails/provision-declarations.trail.js.map +1 -0
- package/dist/trails/provision-exists.trail.d.ts +15 -0
- package/dist/trails/provision-exists.trail.d.ts.map +1 -0
- package/dist/trails/provision-exists.trail.js +27 -0
- package/dist/trails/provision-exists.trail.js.map +1 -0
- package/dist/trails/run.d.ts +2 -2
- package/dist/trails/run.d.ts.map +1 -1
- package/dist/trails/run.js +6 -6
- package/dist/trails/run.js.map +1 -1
- package/dist/trails/schema.d.ts +1 -1
- package/dist/trails/schema.js +2 -2
- package/dist/trails/schema.js.map +1 -1
- package/dist/trails/service-declarations.trail.d.ts +13 -0
- package/dist/trails/service-declarations.trail.d.ts.map +1 -1
- package/dist/trails/service-declarations.trail.js +9 -7
- package/dist/trails/service-declarations.trail.js.map +1 -1
- package/dist/trails/service-exists.trail.d.ts +17 -0
- package/dist/trails/service-exists.trail.d.ts.map +1 -1
- package/dist/trails/service-exists.trail.js +10 -8
- package/dist/trails/service-exists.trail.js.map +1 -1
- package/dist/trails/valid-describe-refs.trail.d.ts +1 -1
- package/dist/trails/valid-detour-refs.trail.d.ts +1 -1
- package/dist/trails/valid-detour-refs.trail.js +2 -2
- package/dist/trails/wrap-rule.js +14 -14
- package/dist/trails/wrap-rule.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/cli.test.ts +121 -8
- package/src/__tests__/{follow-declarations.test.ts → cross-declarations.test.ts} +78 -78
- package/src/__tests__/drift.test.ts +76 -6
- package/src/__tests__/formatters.test.ts +2 -2
- package/src/__tests__/implementation-returns-result.test.ts +11 -11
- package/src/__tests__/no-direct-implementation-call.test.ts +10 -10
- package/src/__tests__/no-sync-result-assumption.test.ts +6 -6
- package/src/__tests__/no-throw-in-detour-target.test.ts +6 -6
- package/src/__tests__/prefer-schema-inference.test.ts +4 -4
- package/src/__tests__/provision-declarations.test.ts +318 -0
- package/src/__tests__/provision-exists.test.ts +122 -0
- package/src/__tests__/rules.test.ts +38 -38
- package/src/__tests__/valid-describe-refs.test.ts +4 -4
- package/src/__tests__/wrap-rule.test.ts +4 -4
- package/src/cli.ts +27 -15
- package/src/draft.ts +22 -0
- package/src/drift.ts +63 -21
- package/src/formatters.ts +15 -4
- package/src/index.ts +29 -8
- package/src/rules/ast.ts +74 -31
- package/src/rules/{context-no-surface-types.ts → context-no-trailhead-types.ts} +8 -8
- package/src/rules/{follow-declarations.ts → cross-declarations.ts} +63 -56
- package/src/rules/draft-file-marking.ts +112 -0
- package/src/rules/draft-visible-debt.ts +62 -0
- package/src/rules/implementation-returns-result.ts +6 -6
- package/src/rules/index.ts +18 -12
- package/src/rules/no-direct-impl-in-route.ts +17 -17
- package/src/rules/no-direct-implementation-call.ts +7 -7
- package/src/rules/no-sync-result-assumption.ts +5 -5
- package/src/rules/no-throw-in-detour-target.ts +2 -2
- package/src/rules/no-throw-in-implementation.ts +3 -3
- package/src/rules/{service-declarations.ts → provision-declarations.ts} +145 -129
- package/src/rules/{service-exists.ts → provision-exists.ts} +53 -46
- package/src/rules/specs.ts +4 -4
- package/src/rules/types.ts +2 -2
- package/src/rules/valid-detour-refs.ts +4 -2
- package/src/trails/{context-no-surface-types.trail.ts → context-no-trailhead-types.trail.ts} +5 -5
- package/src/trails/cross-declarations.trail.ts +22 -0
- package/src/trails/implementation-returns-result.trail.ts +1 -1
- package/src/trails/index.ts +4 -4
- package/src/trails/no-direct-impl-in-route.trail.ts +4 -4
- package/src/trails/no-direct-implementation-call.trail.ts +2 -2
- package/src/trails/no-sync-result-assumption.trail.ts +2 -2
- package/src/trails/no-throw-in-detour-target.trail.ts +1 -1
- package/src/trails/no-throw-in-implementation.trail.ts +1 -1
- package/src/trails/prefer-schema-inference.trail.ts +1 -1
- package/src/trails/provision-declarations.trail.ts +25 -0
- package/src/trails/provision-exists.trail.ts +27 -0
- package/src/trails/run.ts +7 -7
- package/src/trails/schema.ts +2 -2
- package/src/trails/valid-detour-refs.trail.ts +2 -2
- package/src/trails/wrap-rule.ts +17 -17
- package/tsconfig.tsbuildinfo +1 -1
- package/src/__tests__/service-declarations.test.ts +0 -318
- package/src/__tests__/service-exists.test.ts +0 -122
- package/src/trails/follow-declarations.trail.ts +0 -22
- package/src/trails/service-declarations.trail.ts +0 -25
- package/src/trails/service-exists.trail.ts +0 -27
package/.turbo/turbo-lint.log
CHANGED
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
|
|
47
|
+
- Add provisions as a first-class primitive.
|
|
16
48
|
|
|
17
|
-
|
|
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:** `
|
|
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 `
|
|
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:** `
|
|
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
|
-
**
|
|
57
|
+
**Trailheads:** Provision overrides thread through `run` and `trailhead` on CLI, MCP, and HTTP.
|
|
26
58
|
|
|
27
|
-
**Introspection:** Survey and
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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
|
|
93
|
+
- Consolidated improvements across all trailhead packages.
|
|
62
94
|
|
|
63
|
-
**core**: Add `TrailResult<T>` utility type, `topo.ids()` and `topo.count` accessors, `
|
|
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**:
|
|
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
|
|
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**: `
|
|
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
|
|
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 `
|
|
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 `
|
|
138
|
-
- `follows` renamed to `
|
|
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 `
|
|
145
|
-
- `
|
|
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
|
|
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
|
|
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
|
|
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/
|
|
203
|
-
- **@ontrails/cli** — CLI
|
|
204
|
-
- **@ontrails/mcp** — MCP
|
|
205
|
-
- **@ontrails/logging** — Structured logging, sinks, formatters, LogTape
|
|
206
|
-
- **@ontrails/testing** — testAll, testExamples, testTrail, testHike, testContracts, testDetours,
|
|
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** —
|
|
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.
|
|
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 (
|
|
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(
|
|
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
|
|
32
|
-
| `implementation-returns-result` | error |
|
|
33
|
-
| `context-no-
|
|
34
|
-
| `no-sync-result-assumption` | error | Missing `await` on
|
|
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 `.
|
|
38
|
-
| `no-direct-impl-in-route` | warn | Direct `.
|
|
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
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
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
|
|
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('
|
|
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
|
|
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
|
-
|
|
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(
|
|
101
|
+
| `runWarden(options?)` | Run all rules and drift checks, return a report |
|
|
100
102
|
| `formatWardenReport(report)` | Human-readable report |
|
|
101
|
-
| `checkDrift(
|
|
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
|
|
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 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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,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@
|
|
|
6
6
|
*/
|
|
7
7
|
import { resolve } from 'node:path';
|
|
8
8
|
import { checkDrift } from './drift.js';
|
|
9
|
-
import {
|
|
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
|
|
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
|
|
76
|
-
|
|
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
|
|
111
|
+
const knownProvisionIds = new Set(appTopo.provisions.keys());
|
|
112
112
|
const detourTargetTrailIds = collectTopoDetourTargetTrailIds(appTopo);
|
|
113
|
-
return {
|
|
113
|
+
return {
|
|
114
|
+
detourTargetTrailIds,
|
|
115
|
+
knownProvisionIds,
|
|
116
|
+
knownTrailIds,
|
|
117
|
+
};
|
|
114
118
|
};
|
|
115
119
|
const buildProjectContextFromFiles = (sourceFiles) => {
|
|
116
120
|
const knownTrailIds = new Set();
|
|
117
|
-
const
|
|
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
|
-
|
|
125
|
+
collectKnownProvisionIds(sourceFile.sourceCode, sourceFile.filePath, knownProvisionIds);
|
|
122
126
|
collectDetourTargetTrailIds(sourceFile.sourceCode, sourceFile.filePath, detourTargetTrailIds);
|
|
123
127
|
}
|
|
124
128
|
return {
|
|
125
129
|
detourTargetTrailIds,
|
|
126
|
-
|
|
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 &&
|
|
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:
|
|
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?.
|
|
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,
|
|
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,6BAA6B,EAC7B,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,EACL,IAAI,GACL,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAsC/C;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,KAAa,EAAW,EAAE,CAC9C,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;IACxB,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC;IAClC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;IAC1B,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;IAC1B,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC7B,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;IAC5B,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC3B,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAE9B,MAAM,cAAc,GAAG,CAAC,GAAW,EA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AAK,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAC5C,CAAC;SAAM,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,iBAAiB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC9C,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAoB,EAAU,EAAE;IACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,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"}
|
package/dist/draft.d.ts
ADDED
|
@@ -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
|
-
*
|
|
2
|
+
* Topo lock drift detection.
|
|
3
3
|
*
|
|
4
|
-
* Compares the committed `
|
|
5
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
*/
|
package/dist/drift.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../src/drift.ts"],"names":[],"mappings":"AAAA
|
|
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
|
-
*
|
|
2
|
+
* Topo lock drift detection.
|
|
3
3
|
*
|
|
4
|
-
* Compares the committed `
|
|
5
|
-
*
|
|
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 {
|
|
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
|
|
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
|
-
|
|
16
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"drift.js","sourceRoot":"","sources":["../src/drift.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,EACL,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAgB1B;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,OAAe,EACf,IAAuB,EACD,EAAE;IACxB,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QAChD,MAAM,aAAa,GACjB,UAAU,CAAC,OAAO,CAAC,IAAI,QAAQ,CAA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flow 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
|
|
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
|
/**
|
package/dist/formatters.d.ts.map
CHANGED
|
@@ -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
|
|
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"}
|