@ontrails/warden 1.0.0-beta.14 → 1.0.0-beta.16
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/CHANGELOG.md +149 -0
- package/README.md +77 -34
- package/bin/warden.ts +22 -0
- package/package.json +26 -6
- package/src/ast.ts +28 -0
- package/src/cli.ts +1169 -116
- package/src/command.ts +927 -0
- package/src/config.ts +184 -0
- package/src/drift.ts +76 -34
- package/src/formatters.ts +54 -7
- package/src/guide.ts +234 -0
- package/src/index.ts +151 -38
- package/src/project-context.ts +163 -0
- package/src/resolve.ts +530 -0
- package/src/rules/activation-orphan.ts +97 -0
- package/src/rules/ast.ts +2884 -124
- package/src/rules/circular-refs.ts +154 -0
- package/src/rules/{context-no-trailhead-types.ts → context-no-surface-types.ts} +72 -12
- package/src/rules/contour-exists.ts +251 -0
- package/src/rules/contour-ids.ts +15 -0
- package/src/rules/cross-declarations.ts +277 -69
- package/src/rules/dead-internal-trail.ts +141 -0
- package/src/rules/draft-file-marking.ts +51 -3
- package/src/rules/draft-visible-debt.ts +40 -15
- package/src/rules/error-mapping-completeness.ts +288 -0
- package/src/rules/example-valid.ts +401 -0
- package/src/rules/fires-declarations.ts +758 -0
- package/src/rules/implementation-returns-result.ts +1042 -122
- package/src/rules/incomplete-accessor-for-standard-op.ts +272 -0
- package/src/rules/incomplete-crud.ts +580 -0
- package/src/rules/index.ts +156 -19
- package/src/rules/intent-propagation.ts +127 -0
- package/src/rules/layer-field-name-drift.ts +96 -0
- package/src/rules/metadata.ts +508 -0
- package/src/rules/missing-reconcile.ts +98 -0
- package/src/rules/missing-visibility.ts +110 -0
- package/src/rules/no-dev-permit-in-source.ts +99 -0
- package/src/rules/no-direct-implementation-call.ts +1 -1
- package/src/rules/no-legacy-layer-imports.ts +193 -0
- package/src/rules/no-native-error-result.ts +111 -0
- package/src/rules/no-sync-result-assumption.ts +1131 -96
- package/src/rules/no-throw-in-detour-recover.ts +225 -0
- package/src/rules/no-throw-in-implementation.ts +6 -4
- package/src/rules/on-references-exist.ts +194 -0
- package/src/rules/orphaned-signal.ts +150 -0
- package/src/rules/owner-projection-parity.ts +146 -0
- package/src/rules/permit-governance.ts +25 -0
- package/src/rules/public-internal-deep-imports.ts +517 -0
- package/src/rules/public-output-schema.ts +29 -0
- package/src/rules/public-union-output-discriminants.ts +150 -0
- package/src/rules/read-intent-fires.ts +187 -0
- package/src/rules/reference-exists.ts +98 -0
- package/src/rules/registry-names.ts +113 -0
- package/src/rules/resolved-import-boundary.ts +146 -0
- package/src/rules/{provision-declarations.ts → resource-declarations.ts} +208 -138
- package/src/rules/{provision-exists.ts → resource-exists.ts} +46 -51
- package/src/rules/resource-id-grammar.ts +65 -0
- package/src/rules/scan.ts +0 -26
- package/src/rules/scheduled-destroy-intent.ts +44 -0
- package/src/rules/signal-graph-coaching.ts +191 -0
- package/src/rules/specs.ts +5 -1
- package/src/rules/static-resource-accessor-preference.ts +657 -0
- package/src/rules/types.ts +187 -7
- package/src/rules/unmaterialized-activation-source.ts +84 -0
- package/src/rules/unreachable-detour-shadowing.ts +344 -0
- package/src/rules/valid-describe-refs.ts +160 -32
- package/src/rules/valid-detour-contract.ts +78 -0
- package/src/rules/warden-export-symmetry.ts +533 -0
- package/src/rules/warden-rules-use-ast.ts +996 -0
- package/src/rules/webhook-route-collision.ts +243 -0
- package/src/trails/activation-orphan.trail.ts +81 -0
- package/src/trails/circular-refs.trail.ts +29 -0
- package/src/trails/{context-no-trailhead-types.trail.ts → context-no-surface-types.trail.ts} +4 -4
- package/src/trails/contour-exists.trail.ts +21 -0
- package/src/trails/dead-internal-trail.trail.ts +26 -0
- package/src/trails/draft-file-marking.trail.ts +16 -0
- package/src/trails/draft-visible-debt.trail.ts +16 -0
- package/src/trails/error-mapping-completeness.trail.ts +29 -0
- package/src/trails/example-valid.trail.ts +25 -0
- package/src/trails/fires-declarations.trail.ts +23 -0
- package/src/trails/incomplete-accessor-for-standard-op.trail.ts +76 -0
- package/src/trails/incomplete-crud.trail.ts +39 -0
- package/src/trails/index.ts +56 -8
- package/src/trails/intent-propagation.trail.ts +30 -0
- package/src/trails/layer-field-name-drift.trail.ts +39 -0
- package/src/trails/missing-reconcile.trail.ts +33 -0
- package/src/trails/missing-visibility.trail.ts +22 -0
- package/src/trails/no-dev-permit-in-source.trail.ts +16 -0
- package/src/trails/no-legacy-layer-imports.trail.ts +35 -0
- package/src/trails/no-native-error-result.trail.ts +18 -0
- package/src/trails/no-throw-in-detour-recover.trail.ts +24 -0
- package/src/trails/on-references-exist.trail.ts +21 -0
- package/src/trails/orphaned-signal.trail.ts +36 -0
- package/src/trails/owner-projection-parity.trail.ts +26 -0
- package/src/trails/permit-governance.trail.ts +51 -0
- package/src/trails/public-internal-deep-imports.trail.ts +94 -0
- package/src/trails/public-output-schema.trail.ts +55 -0
- package/src/trails/public-union-output-discriminants.trail.ts +33 -0
- package/src/trails/read-intent-fires.trail.ts +20 -0
- package/src/trails/reference-exists.trail.ts +25 -0
- package/src/trails/resolved-import-boundary.trail.ts +109 -0
- package/src/trails/{provision-declarations.trail.ts → resource-declarations.trail.ts} +6 -6
- package/src/trails/{provision-exists.trail.ts → resource-exists.trail.ts} +7 -7
- package/src/trails/resource-id-grammar.trail.ts +39 -0
- package/src/trails/run.ts +133 -24
- package/src/trails/scheduled-destroy-intent.trail.ts +56 -0
- package/src/trails/schema.ts +122 -4
- package/src/trails/signal-graph-coaching.trail.ts +74 -0
- package/src/trails/static-resource-accessor-preference.trail.ts +25 -0
- package/src/trails/unmaterialized-activation-source.trail.ts +69 -0
- package/src/trails/unreachable-detour-shadowing.trail.ts +45 -0
- package/src/trails/valid-detour-contract.trail.ts +71 -0
- package/src/trails/warden-export-symmetry.trail.ts +16 -0
- package/src/trails/warden-rules-use-ast.trail.ts +45 -0
- package/src/trails/webhook-route-collision.trail.ts +50 -0
- package/src/trails/wrap-rule.ts +133 -14
- package/src/workspaces.ts +238 -0
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +0 -1
- package/dist/cli.d.ts +0 -46
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -247
- package/dist/cli.js.map +0 -1
- package/dist/draft.d.ts +0 -5
- package/dist/draft.d.ts.map +0 -1
- package/dist/draft.js +0 -16
- package/dist/draft.js.map +0 -1
- package/dist/drift.d.ts +0 -29
- package/dist/drift.d.ts.map +0 -1
- package/dist/drift.js +0 -61
- package/dist/drift.js.map +0 -1
- package/dist/formatters.d.ts +0 -30
- package/dist/formatters.d.ts.map +0 -1
- package/dist/formatters.js +0 -98
- package/dist/formatters.js.map +0 -1
- package/dist/index.d.ts +0 -37
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -38
- package/dist/index.js.map +0 -1
- package/dist/rules/ast.d.ts +0 -82
- package/dist/rules/ast.d.ts.map +0 -1
- package/dist/rules/ast.js +0 -363
- package/dist/rules/ast.js.map +0 -1
- package/dist/rules/context-no-surface-types.d.ts +0 -12
- package/dist/rules/context-no-surface-types.d.ts.map +0 -1
- package/dist/rules/context-no-surface-types.js +0 -96
- package/dist/rules/context-no-surface-types.js.map +0 -1
- package/dist/rules/context-no-trailhead-types.d.ts +0 -12
- package/dist/rules/context-no-trailhead-types.d.ts.map +0 -1
- package/dist/rules/context-no-trailhead-types.js +0 -96
- package/dist/rules/context-no-trailhead-types.js.map +0 -1
- package/dist/rules/cross-declarations.d.ts +0 -13
- package/dist/rules/cross-declarations.d.ts.map +0 -1
- package/dist/rules/cross-declarations.js +0 -264
- package/dist/rules/cross-declarations.js.map +0 -1
- package/dist/rules/draft-file-marking.d.ts +0 -6
- package/dist/rules/draft-file-marking.d.ts.map +0 -1
- package/dist/rules/draft-file-marking.js +0 -65
- package/dist/rules/draft-file-marking.js.map +0 -1
- package/dist/rules/draft-visible-debt.d.ts +0 -12
- package/dist/rules/draft-visible-debt.d.ts.map +0 -1
- package/dist/rules/draft-visible-debt.js +0 -45
- package/dist/rules/draft-visible-debt.js.map +0 -1
- package/dist/rules/follow-declarations.d.ts +0 -13
- package/dist/rules/follow-declarations.d.ts.map +0 -1
- package/dist/rules/follow-declarations.js +0 -264
- package/dist/rules/follow-declarations.js.map +0 -1
- package/dist/rules/implementation-returns-result.d.ts +0 -13
- package/dist/rules/implementation-returns-result.d.ts.map +0 -1
- package/dist/rules/implementation-returns-result.js +0 -277
- package/dist/rules/implementation-returns-result.js.map +0 -1
- package/dist/rules/index.d.ts +0 -20
- package/dist/rules/index.d.ts.map +0 -1
- package/dist/rules/index.js +0 -49
- package/dist/rules/index.js.map +0 -1
- package/dist/rules/no-direct-impl-in-route.d.ts +0 -12
- package/dist/rules/no-direct-impl-in-route.d.ts.map +0 -1
- package/dist/rules/no-direct-impl-in-route.js +0 -47
- package/dist/rules/no-direct-impl-in-route.js.map +0 -1
- package/dist/rules/no-direct-implementation-call.d.ts +0 -12
- package/dist/rules/no-direct-implementation-call.d.ts.map +0 -1
- package/dist/rules/no-direct-implementation-call.js +0 -39
- package/dist/rules/no-direct-implementation-call.js.map +0 -1
- package/dist/rules/no-sync-result-assumption.d.ts +0 -6
- package/dist/rules/no-sync-result-assumption.d.ts.map +0 -1
- package/dist/rules/no-sync-result-assumption.js +0 -98
- package/dist/rules/no-sync-result-assumption.js.map +0 -1
- package/dist/rules/no-throw-in-detour-target.d.ts +0 -12
- package/dist/rules/no-throw-in-detour-target.d.ts.map +0 -1
- package/dist/rules/no-throw-in-detour-target.js +0 -87
- package/dist/rules/no-throw-in-detour-target.js.map +0 -1
- package/dist/rules/no-throw-in-implementation.d.ts +0 -9
- package/dist/rules/no-throw-in-implementation.d.ts.map +0 -1
- package/dist/rules/no-throw-in-implementation.js +0 -34
- package/dist/rules/no-throw-in-implementation.js.map +0 -1
- package/dist/rules/prefer-schema-inference.d.ts +0 -7
- package/dist/rules/prefer-schema-inference.d.ts.map +0 -1
- package/dist/rules/prefer-schema-inference.js +0 -86
- package/dist/rules/prefer-schema-inference.js.map +0 -1
- package/dist/rules/provision-declarations.d.ts +0 -14
- package/dist/rules/provision-declarations.d.ts.map +0 -1
- package/dist/rules/provision-declarations.js +0 -344
- package/dist/rules/provision-declarations.js.map +0 -1
- package/dist/rules/provision-exists.d.ts +0 -6
- package/dist/rules/provision-exists.d.ts.map +0 -1
- package/dist/rules/provision-exists.js +0 -90
- package/dist/rules/provision-exists.js.map +0 -1
- package/dist/rules/scan.d.ts +0 -8
- package/dist/rules/scan.d.ts.map +0 -1
- package/dist/rules/scan.js +0 -32
- package/dist/rules/scan.js.map +0 -1
- package/dist/rules/service-declarations.d.ts +0 -16
- package/dist/rules/service-declarations.d.ts.map +0 -1
- package/dist/rules/service-declarations.js +0 -346
- package/dist/rules/service-declarations.js.map +0 -1
- package/dist/rules/service-exists.d.ts +0 -8
- package/dist/rules/service-exists.d.ts.map +0 -1
- package/dist/rules/service-exists.js +0 -91
- package/dist/rules/service-exists.js.map +0 -1
- package/dist/rules/specs.d.ts +0 -29
- package/dist/rules/specs.d.ts.map +0 -1
- package/dist/rules/specs.js +0 -192
- package/dist/rules/specs.js.map +0 -1
- package/dist/rules/structure.d.ts +0 -13
- package/dist/rules/structure.d.ts.map +0 -1
- package/dist/rules/structure.js +0 -142
- package/dist/rules/structure.js.map +0 -1
- package/dist/rules/types.d.ts +0 -54
- package/dist/rules/types.d.ts.map +0 -1
- package/dist/rules/types.js +0 -2
- package/dist/rules/types.js.map +0 -1
- package/dist/rules/valid-describe-refs.d.ts +0 -7
- package/dist/rules/valid-describe-refs.d.ts.map +0 -1
- package/dist/rules/valid-describe-refs.js +0 -51
- package/dist/rules/valid-describe-refs.js.map +0 -1
- package/dist/rules/valid-detour-refs.d.ts +0 -6
- package/dist/rules/valid-detour-refs.d.ts.map +0 -1
- package/dist/rules/valid-detour-refs.js +0 -117
- package/dist/rules/valid-detour-refs.js.map +0 -1
- package/dist/trails/context-no-surface-types.trail.d.ts +0 -13
- package/dist/trails/context-no-surface-types.trail.d.ts.map +0 -1
- package/dist/trails/context-no-surface-types.trail.js +0 -21
- package/dist/trails/context-no-surface-types.trail.js.map +0 -1
- package/dist/trails/context-no-trailhead-types.trail.d.ts +0 -13
- package/dist/trails/context-no-trailhead-types.trail.d.ts.map +0 -1
- package/dist/trails/context-no-trailhead-types.trail.js +0 -21
- package/dist/trails/context-no-trailhead-types.trail.js.map +0 -1
- package/dist/trails/cross-declarations.trail.d.ts +0 -13
- package/dist/trails/cross-declarations.trail.d.ts.map +0 -1
- package/dist/trails/cross-declarations.trail.js +0 -22
- package/dist/trails/cross-declarations.trail.js.map +0 -1
- package/dist/trails/follow-declarations.trail.d.ts +0 -13
- package/dist/trails/follow-declarations.trail.d.ts.map +0 -1
- package/dist/trails/follow-declarations.trail.js +0 -22
- package/dist/trails/follow-declarations.trail.js.map +0 -1
- package/dist/trails/implementation-returns-result.trail.d.ts +0 -13
- package/dist/trails/implementation-returns-result.trail.d.ts.map +0 -1
- package/dist/trails/implementation-returns-result.trail.js +0 -20
- package/dist/trails/implementation-returns-result.trail.js.map +0 -1
- package/dist/trails/index.d.ts +0 -16
- package/dist/trails/index.d.ts.map +0 -1
- package/dist/trails/index.js +0 -15
- package/dist/trails/index.js.map +0 -1
- package/dist/trails/no-direct-impl-in-route.trail.d.ts +0 -13
- package/dist/trails/no-direct-impl-in-route.trail.d.ts.map +0 -1
- package/dist/trails/no-direct-impl-in-route.trail.js +0 -22
- package/dist/trails/no-direct-impl-in-route.trail.js.map +0 -1
- package/dist/trails/no-direct-implementation-call.trail.d.ts +0 -13
- package/dist/trails/no-direct-implementation-call.trail.d.ts.map +0 -1
- package/dist/trails/no-direct-implementation-call.trail.js +0 -16
- package/dist/trails/no-direct-implementation-call.trail.js.map +0 -1
- package/dist/trails/no-sync-result-assumption.trail.d.ts +0 -13
- package/dist/trails/no-sync-result-assumption.trail.d.ts.map +0 -1
- package/dist/trails/no-sync-result-assumption.trail.js +0 -19
- package/dist/trails/no-sync-result-assumption.trail.js.map +0 -1
- package/dist/trails/no-throw-in-detour-target.trail.d.ts +0 -15
- package/dist/trails/no-throw-in-detour-target.trail.d.ts.map +0 -1
- package/dist/trails/no-throw-in-detour-target.trail.js +0 -20
- package/dist/trails/no-throw-in-detour-target.trail.js.map +0 -1
- package/dist/trails/no-throw-in-implementation.trail.d.ts +0 -13
- package/dist/trails/no-throw-in-implementation.trail.d.ts.map +0 -1
- package/dist/trails/no-throw-in-implementation.trail.js +0 -20
- package/dist/trails/no-throw-in-implementation.trail.js.map +0 -1
- package/dist/trails/prefer-schema-inference.trail.d.ts +0 -13
- package/dist/trails/prefer-schema-inference.trail.d.ts.map +0 -1
- package/dist/trails/prefer-schema-inference.trail.js +0 -21
- package/dist/trails/prefer-schema-inference.trail.js.map +0 -1
- package/dist/trails/provision-declarations.trail.d.ts +0 -13
- package/dist/trails/provision-declarations.trail.d.ts.map +0 -1
- package/dist/trails/provision-declarations.trail.js +0 -25
- package/dist/trails/provision-declarations.trail.js.map +0 -1
- package/dist/trails/provision-exists.trail.d.ts +0 -15
- package/dist/trails/provision-exists.trail.d.ts.map +0 -1
- package/dist/trails/provision-exists.trail.js +0 -27
- package/dist/trails/provision-exists.trail.js.map +0 -1
- package/dist/trails/run.d.ts +0 -17
- package/dist/trails/run.d.ts.map +0 -1
- package/dist/trails/run.js +0 -39
- package/dist/trails/run.js.map +0 -1
- package/dist/trails/schema.d.ts +0 -53
- package/dist/trails/schema.d.ts.map +0 -1
- package/dist/trails/schema.js +0 -42
- package/dist/trails/schema.js.map +0 -1
- package/dist/trails/service-declarations.trail.d.ts +0 -26
- package/dist/trails/service-declarations.trail.d.ts.map +0 -1
- package/dist/trails/service-declarations.trail.js +0 -27
- package/dist/trails/service-declarations.trail.js.map +0 -1
- package/dist/trails/service-exists.trail.d.ts +0 -32
- package/dist/trails/service-exists.trail.d.ts.map +0 -1
- package/dist/trails/service-exists.trail.js +0 -29
- package/dist/trails/service-exists.trail.js.map +0 -1
- package/dist/trails/topo.d.ts +0 -3
- package/dist/trails/topo.d.ts.map +0 -1
- package/dist/trails/topo.js +0 -5
- package/dist/trails/topo.js.map +0 -1
- package/dist/trails/valid-describe-refs.trail.d.ts +0 -15
- package/dist/trails/valid-describe-refs.trail.d.ts.map +0 -1
- package/dist/trails/valid-describe-refs.trail.js +0 -18
- package/dist/trails/valid-describe-refs.trail.js.map +0 -1
- package/dist/trails/valid-detour-refs.trail.d.ts +0 -15
- package/dist/trails/valid-detour-refs.trail.d.ts.map +0 -1
- package/dist/trails/valid-detour-refs.trail.js +0 -24
- package/dist/trails/valid-detour-refs.trail.js.map +0 -1
- package/dist/trails/wrap-rule.d.ts +0 -29
- package/dist/trails/wrap-rule.d.ts.map +0 -1
- package/dist/trails/wrap-rule.js +0 -47
- package/dist/trails/wrap-rule.js.map +0 -1
- package/src/__tests__/cli.test.ts +0 -311
- package/src/__tests__/cross-declarations.test.ts +0 -303
- package/src/__tests__/drift.test.ts +0 -144
- package/src/__tests__/formatters.test.ts +0 -157
- package/src/__tests__/implementation-returns-result.test.ts +0 -129
- package/src/__tests__/no-direct-implementation-call.test.ts +0 -83
- package/src/__tests__/no-sync-result-assumption.test.ts +0 -85
- package/src/__tests__/no-throw-in-detour-target.test.ts +0 -78
- package/src/__tests__/prefer-schema-inference.test.ts +0 -84
- package/src/__tests__/provision-declarations.test.ts +0 -318
- package/src/__tests__/provision-exists.test.ts +0 -122
- package/src/__tests__/rules.test.ts +0 -227
- package/src/__tests__/trails.test.ts +0 -19
- package/src/__tests__/valid-describe-refs.test.ts +0 -60
- package/src/__tests__/wrap-rule.test.ts +0 -41
- package/src/rules/no-direct-impl-in-route.ts +0 -81
- package/src/rules/no-throw-in-detour-target.ts +0 -150
- package/src/rules/valid-detour-refs.ts +0 -189
- package/src/trails/no-direct-impl-in-route.trail.ts +0 -22
- package/src/trails/no-throw-in-detour-target.trail.ts +0 -20
- package/src/trails/valid-detour-refs.trail.ts +0 -24
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,154 @@
|
|
|
1
1
|
# @ontrails/warden
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.16
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e991a5b: Add generic enum value aliases for CLI flags and migrate Warden command aliases onto the shared alias model.
|
|
8
|
+
- 2e05e27: Add `--dev-permit` for local-development synthetic full-access. New `devPermitPreset()` exposes a boolean flag; when set, the CLI synthesizes a `BasePermit` (`id: 'dev-permit'`, scopes enumerated from every declared scope across the topo) and overlays it on `ctx.permit`. Mutually exclusive with `--permit` and `--token` — any combination fails with `ValidationError` listing the conflicting flags. New Warden rule `no-dev-permit-in-source` flags any committed source file containing `--dev-permit` as an error, with a tight allow-list (`packages/cli/src/flags.ts`, `packages/cli/src/build.ts`, the rule itself). The Warden runner still scans test TypeScript files for this literal while keeping unrelated source rules filtered out of tests. Apps that import `authResource`/`authLayer` are unaffected.
|
|
9
|
+
- ad553a6: Add one warden rule coaching against the removed legacy layer API. `no-legacy-layer-imports` (error) flags any source-string reference to `authLayer`, `autoIterateLayer`, or `dateShortcutsLayer` and points the developer at the migration paths (CLI surface derivation for pagination/date-shortcuts; intrinsic permit enforcement for auth). Allow-list covers the migration notes in `packages/cli/src/{pagination,date-shortcuts}.ts` and the rule's own files. The rule is classified `lifecycle: temporary` with a `retireWhen` string tying it to the legacy layer migration window. Trail count bumps 45 → 46.
|
|
10
|
+
- 802fdfc: Rename Warden guide manifest rule grouping from `category` to `concern` so the
|
|
11
|
+
public JSON contract matches the source metadata field.
|
|
12
|
+
- 22c6c06: Accept ADR-0041 Unified Observability and ship the first activation and
|
|
13
|
+
observability primitives it depends on: activation trace records, topo-level
|
|
14
|
+
observe configuration, webhook activation materialization, signal/webhook
|
|
15
|
+
warden coaching, the `@ontrails/observe` package, sink composition, and
|
|
16
|
+
zero-dependency observe sinks.
|
|
17
|
+
- 767eb41: Ship the default `warden` bin from `@ontrails/warden` and migrate the old private `apps/ci` runner into the package-local CLI surface.
|
|
18
|
+
|
|
19
|
+
The new bin supports `--ci`, `--pre-push`, `--depth`, `--fail-on`, `--strict`, `--format`, `--lock`, `--drafts`, `--apps`, and the Sprint 1 standalone aliases. CI output now uses the package Warden formatters directly, so GitHub annotations and JSON payloads follow the `@ontrails/warden` report shape instead of the retired `apps/ci` wrapper shape.
|
|
20
|
+
|
|
21
|
+
- 82019a7: Export `wardenConfigSchema` for composing Warden options into `trails.config.ts`.
|
|
22
|
+
- f6fdc62: Add structured Warden remediation guidance to rule metadata, diagnostics, report output, and the `trails warden` result schema.
|
|
23
|
+
- a10ffa4: Add a Warden guide manifest projection and expose it through `trails warden guide` in markdown, agent-json, and manifest formats.
|
|
24
|
+
- 7085f01: Add a Warden topo-aware rule that requires public MCP/HTTP surface-eligible trails to declare output schemas.
|
|
25
|
+
- 8ddf5ff: Extend `runWarden` into the shared Warden orchestration entrypoint with effective config resolution, depth/fail thresholds, rule facets, and multi-topo report metadata.
|
|
26
|
+
|
|
27
|
+
Adapt the built-in `trails warden` wrapper to consume the readonly Warden report diagnostics contract without weakening its output schema.
|
|
28
|
+
|
|
29
|
+
- f5b6112: Add an advisory Warden rule that prefers static resource helpers over dynamic context resource lookups when the resource definition is already in scope.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- c3fc5c3: Move previously root-exported helper contracts out of `src/internal/*` to stable core module homes, document their public boundary, and guard the public barrel against future internal re-exports.
|
|
34
|
+
- e898cc4: Add repo-level Knip dead-code detection and remove stale internal exports and unused package dependencies surfaced by the new check.
|
|
35
|
+
- 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.
|
|
36
|
+
- 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.
|
|
37
|
+
- de30d6c: Introduce `topo.compile` as the canonical trail for writing `.trails` lockfile
|
|
38
|
+
and surface artifacts, remove the `survey --generate` mode, and update drift
|
|
39
|
+
guidance to point at the compile command.
|
|
40
|
+
- 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.
|
|
41
|
+
|
|
42
|
+
Breaking pre-1.0 beta change. Update consumer imports:
|
|
43
|
+
|
|
44
|
+
```diff
|
|
45
|
+
- import { topoStore, createTopoStore, createMockTopoStore, createTopoSnapshot, listTopoSnapshots, pinTopoSnapshot, unpinTopoSnapshot, createStoredTopoSnapshot, getStoredTopoExport, countTopoSnapshots, countPinnedSnapshots, countPrunableSnapshots, pruneUnpinnedSnapshots } from '@ontrails/core';
|
|
46
|
+
+ import { topoStore, createTopoStore, createMockTopoStore, createTopoSnapshot, listTopoSnapshots, pinTopoSnapshot, unpinTopoSnapshot } from '@ontrails/topographer';
|
|
47
|
+
+ import { createStoredTopoSnapshot, getStoredTopoExport, countTopoSnapshots, countPinnedSnapshots, countPrunableSnapshots, pruneUnpinnedSnapshots } from '@ontrails/topographer/backend-support';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
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`.
|
|
51
|
+
|
|
52
|
+
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.
|
|
53
|
+
|
|
54
|
+
- 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.
|
|
55
|
+
- 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`.
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
- fb10112: Polish Warden guidance projection by preserving labels in plain-text doc links
|
|
60
|
+
and reusing the shared diagnostic schema from the Trails CLI wrapper.
|
|
61
|
+
- bfabe09: Suppress static resource accessor warnings when a string lookup resolves to a
|
|
62
|
+
resource variable name shadowed inside `blaze`.
|
|
63
|
+
- 7a1d4a9: Rename the public resolved graph API from `SurfaceMap` to `TopoGraph`, including
|
|
64
|
+
the derive, hash, diff, and current graph artifact I/O helpers.
|
|
65
|
+
- 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.
|
|
66
|
+
- 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`.
|
|
67
|
+
- 2cc05da: Harden Warden drift checks for lock v3 manifests. Malformed legacy lock files and manifests without the `topo.lock` artifact now report blocked drift with a regenerate instruction instead of throwing or silently passing.
|
|
68
|
+
- df9a7d0: Add project-aware public export-map governance for @ontrails workspace docs,
|
|
69
|
+
imports, root barrels, and bin-only package surfaces.
|
|
70
|
+
- 30a2c7e: Add the resolver-backed `resolved-import-boundary` Warden rule for cross-package import boundary enforcement.
|
|
71
|
+
- 81bffec: Add Warden import-resolution substrate backed by `oxc-resolver`.
|
|
72
|
+
- d675a53: Omit `topoNames` from Warden reports when no topo targets were governed, matching the optional report contract.
|
|
73
|
+
- Updated dependencies [73622ae]
|
|
74
|
+
- Updated dependencies [e991a5b]
|
|
75
|
+
- Updated dependencies [25f3c5c]
|
|
76
|
+
- Updated dependencies [6300f70]
|
|
77
|
+
- Updated dependencies [d172013]
|
|
78
|
+
- Updated dependencies [c3fc5c3]
|
|
79
|
+
- Updated dependencies [20d7a5c]
|
|
80
|
+
- Updated dependencies [be5fb46]
|
|
81
|
+
- Updated dependencies [199304e]
|
|
82
|
+
- Updated dependencies [e898cc4]
|
|
83
|
+
- Updated dependencies [2bf239e]
|
|
84
|
+
- Updated dependencies [200bece]
|
|
85
|
+
- Updated dependencies [e4beec9]
|
|
86
|
+
- Updated dependencies [3395234]
|
|
87
|
+
- Updated dependencies [bcdc484]
|
|
88
|
+
- Updated dependencies [6300f70]
|
|
89
|
+
- Updated dependencies [3f678d4]
|
|
90
|
+
- Updated dependencies [ed171d5]
|
|
91
|
+
- Updated dependencies [49c2e7d]
|
|
92
|
+
- Updated dependencies [de30d6c]
|
|
93
|
+
- Updated dependencies [331e3a9]
|
|
94
|
+
- Updated dependencies [c40865a]
|
|
95
|
+
- Updated dependencies [4399fdb]
|
|
96
|
+
- Updated dependencies [4b8d13b]
|
|
97
|
+
- Updated dependencies [4b8d13b]
|
|
98
|
+
- Updated dependencies [4b8d13b]
|
|
99
|
+
- Updated dependencies [fbd42fc]
|
|
100
|
+
- Updated dependencies [63d1aef]
|
|
101
|
+
- Updated dependencies [6be2e95]
|
|
102
|
+
- Updated dependencies [819de09]
|
|
103
|
+
- Updated dependencies [be08686]
|
|
104
|
+
- Updated dependencies [112b9f2]
|
|
105
|
+
- Updated dependencies [893025e]
|
|
106
|
+
- Updated dependencies [ed888e2]
|
|
107
|
+
- Updated dependencies [2e05e27]
|
|
108
|
+
- Updated dependencies [c8caa5e]
|
|
109
|
+
- Updated dependencies [f4b90c9]
|
|
110
|
+
- Updated dependencies [eec5e9d]
|
|
111
|
+
- Updated dependencies [4e75129]
|
|
112
|
+
- Updated dependencies [47505fe]
|
|
113
|
+
- Updated dependencies [ebd4434]
|
|
114
|
+
- Updated dependencies [863d473]
|
|
115
|
+
- Updated dependencies [344f2f7]
|
|
116
|
+
- Updated dependencies [26f9ffd]
|
|
117
|
+
- Updated dependencies [66056ac]
|
|
118
|
+
- Updated dependencies [b12e19b]
|
|
119
|
+
- Updated dependencies [ed7f6f6]
|
|
120
|
+
- Updated dependencies [0bad534]
|
|
121
|
+
- Updated dependencies [7a1d4a9]
|
|
122
|
+
- Updated dependencies [84f595a]
|
|
123
|
+
- Updated dependencies [d2cb9ba]
|
|
124
|
+
- Updated dependencies [10eae9a]
|
|
125
|
+
- Updated dependencies [bbb1ea4]
|
|
126
|
+
- Updated dependencies [22c6c06]
|
|
127
|
+
- Updated dependencies [df9a7d0]
|
|
128
|
+
- @ontrails/core@1.0.0-beta.16
|
|
129
|
+
- @ontrails/cli@1.0.0-beta.16
|
|
130
|
+
- @ontrails/permits@1.0.0-beta.16
|
|
131
|
+
- @ontrails/store@1.0.0-beta.16
|
|
132
|
+
- @ontrails/topographer@1.0.0-beta.16
|
|
133
|
+
|
|
134
|
+
## 1.0.0-beta.15
|
|
135
|
+
|
|
136
|
+
### Minor Changes
|
|
137
|
+
|
|
138
|
+
- 4ad6b25: Lexicon rename cleanup (ADR-0023). Breaking for `@ontrails/core`, `@ontrails/cli`, and `@ontrails/tracing` at the boundary; internal-only churn for `@ontrails/warden`.
|
|
139
|
+
|
|
140
|
+
- **core**: the topo store schema renames `topo_provisions` / `topo_trail_provisions` → `topo_resources` / `topo_trail_resources` and `provision_count` → `resource_count`. Schema version bumped v4→v5. Stores still carrying the legacy schema are detected on open, dropped, and recreated from the new DDL — previous topo saves are cleared. Stored-data helpers `listTopoStoreProvisions` / `getTopoStoreProvision` / `readProvisionUsage` / `mapProvisionRow` renamed to their `resource` counterparts. TS row types `TopoTrailProvisionRow` / `TopoProvisionRow` renamed to `TopoTrailResourceRow` / `TopoResourceRow`.
|
|
141
|
+
- **cli**: CLI output mode env vars are now derived from the topo name per ADR-0023. Legacy globals `TRAILS_JSON` / `TRAILS_JSONL` are no longer honored — a topo named `stash` reads `STASH_JSON` / `STASH_JSONL`. `ActionResultContext` gains a `topoName: string` field; `resolveOutputMode(flags, topoName)` takes a topo name argument.
|
|
142
|
+
- **tracing**: legacy `.trails/dev/tracker.db` migration path removed. Any user still running a pre-rename beta build with a `tracker.db` should delete it or migrate before upgrading.
|
|
143
|
+
- **warden**: internal-only rename of `provisionDeclarations` / `provisionExists` rules and their trails to `resourceDeclarations` / `resourceExists`. No behavior change.
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [4ad6b25]
|
|
148
|
+
- @ontrails/core@1.0.0-beta.15
|
|
149
|
+
- @ontrails/permits@1.0.0-beta.15
|
|
150
|
+
- @ontrails/topographer@1.0.0-beta.15
|
|
151
|
+
|
|
3
152
|
## 1.0.0-beta.14
|
|
4
153
|
|
|
5
154
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
# @ontrails/warden
|
|
2
2
|
|
|
3
|
-
AST-based code convention rules for Trails.
|
|
3
|
+
AST-based code convention rules for Trails. Built-in lint rules catch contract
|
|
4
|
+
violations at development time, alongside lock drift detection and CI
|
|
5
|
+
formatters.
|
|
4
6
|
|
|
5
|
-
Structural checks (cross target existence, declared
|
|
7
|
+
Structural checks (cross target existence, declared resource existence,
|
|
8
|
+
recursive crossing, example schema validation) live in `validateTopo()` from
|
|
9
|
+
`@ontrails/core`. Warden handles the code-level rules that need AST analysis.
|
|
10
|
+
|
|
11
|
+
For rule-home boundaries and authoring doctrine, see the
|
|
12
|
+
[Warden guide](../../docs/warden.md) and
|
|
13
|
+
[Rule Design](../../docs/rule-design.md).
|
|
6
14
|
|
|
7
15
|
## Usage
|
|
8
16
|
|
|
9
17
|
From the Trails CLI:
|
|
10
18
|
|
|
11
19
|
```bash
|
|
12
|
-
trails warden
|
|
13
|
-
trails warden --exit-code # Non-zero exit on errors or drift
|
|
14
|
-
trails warden --lint-only # Skip drift detection
|
|
15
|
-
trails warden --drift-only # Skip lint rules
|
|
20
|
+
bunx trails warden # Run all checks
|
|
16
21
|
```
|
|
17
22
|
|
|
18
23
|
Or programmatically:
|
|
@@ -20,40 +25,39 @@ Or programmatically:
|
|
|
20
25
|
```typescript
|
|
21
26
|
import { runWarden, formatWardenReport } from '@ontrails/warden';
|
|
22
27
|
|
|
23
|
-
const report = await runWarden({ topo:
|
|
28
|
+
const report = await runWarden({ topo: graph });
|
|
24
29
|
console.log(formatWardenReport(report));
|
|
25
30
|
```
|
|
26
31
|
|
|
27
32
|
## Rules
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
| `draft-visible-debt` | warn | Draft IDs remaining in source files that need promotion or removal |
|
|
34
|
+
Built-in rules are registered in `wardenRules` and `wardenTopoRules`; use those
|
|
35
|
+
registries or `wardenTopo.ids()` for the current rule list instead of copying a
|
|
36
|
+
static table into docs.
|
|
37
|
+
|
|
38
|
+
Rules cover several families:
|
|
39
|
+
|
|
40
|
+
- blaze and `Result` contract checks
|
|
41
|
+
- cross, fire, resource, and detour declaration drift
|
|
42
|
+
- draft-state containment
|
|
43
|
+
- source-static guardrails such as surface-type leakage
|
|
44
|
+
- topo-aware checks that need the resolved graph or resource mock shape
|
|
45
|
+
|
|
46
|
+
When adding or auditing rules, follow [Rule Design](../../docs/rule-design.md):
|
|
47
|
+
name the invariant, import owner-held framework data, choose the narrowest
|
|
48
|
+
Warden tier, and collapse families only when the data model, traversal, and
|
|
49
|
+
diagnostic shape are shared.
|
|
46
50
|
|
|
47
51
|
## Drift detection
|
|
48
52
|
|
|
49
|
-
Warden integrates with `@ontrails/
|
|
53
|
+
Warden integrates with `@ontrails/topographer` to detect when the topo has changed without updating the lock file:
|
|
50
54
|
|
|
51
55
|
```typescript
|
|
52
56
|
import { checkDrift } from '@ontrails/warden';
|
|
53
57
|
|
|
54
|
-
const drift = await checkDrift(process.cwd(),
|
|
58
|
+
const drift = await checkDrift(process.cwd(), graph);
|
|
55
59
|
if (drift.stale) {
|
|
56
|
-
console.log('lock file is stale -- regenerate with `trails topo
|
|
60
|
+
console.log('lock file is stale -- regenerate with `trails topo compile`');
|
|
57
61
|
}
|
|
58
62
|
```
|
|
59
63
|
|
|
@@ -65,22 +69,38 @@ Add to lefthook for pre-push enforcement:
|
|
|
65
69
|
pre-push:
|
|
66
70
|
commands:
|
|
67
71
|
warden:
|
|
68
|
-
run: trails warden
|
|
72
|
+
run: bunx trails warden
|
|
69
73
|
tags: governance
|
|
70
74
|
```
|
|
71
75
|
|
|
72
76
|
CI formatters for structured output:
|
|
73
77
|
|
|
74
78
|
```typescript
|
|
75
|
-
import {
|
|
79
|
+
import {
|
|
80
|
+
formatGitHubAnnotations,
|
|
81
|
+
formatJson,
|
|
82
|
+
formatSummary,
|
|
83
|
+
} from '@ontrails/warden';
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Parser helpers for rule authoring and repo-local tooling live on the dedicated
|
|
87
|
+
AST entrypoint:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { findStringLiterals, parse, walk } from '@ontrails/warden/ast';
|
|
76
91
|
```
|
|
77
92
|
|
|
78
93
|
## Trail-based API
|
|
79
94
|
|
|
80
|
-
Every built-in warden rule is also available as a composable trail. This makes
|
|
95
|
+
Every built-in warden rule is also available as a composable trail. This makes
|
|
96
|
+
rules queryable, testable, and invocable through any Trails surface.
|
|
81
97
|
|
|
82
98
|
```typescript
|
|
83
|
-
import {
|
|
99
|
+
import {
|
|
100
|
+
runTopoAwareWardenTrails,
|
|
101
|
+
runWardenTrails,
|
|
102
|
+
wardenTopo,
|
|
103
|
+
} from '@ontrails/warden';
|
|
84
104
|
|
|
85
105
|
// Inspect the warden rule trails
|
|
86
106
|
console.log(wardenTopo.ids()); // ['warden.rule.no-throw-in-implementation', ...]
|
|
@@ -88,11 +108,21 @@ console.log(wardenTopo.ids()); // ['warden.rule.no-throw-in-implementation', ...
|
|
|
88
108
|
// Run all rule trails against a source file
|
|
89
109
|
const diagnostics = await runWardenTrails(filePath, sourceCode, {
|
|
90
110
|
knownTrailIds: myApp.ids(),
|
|
91
|
-
|
|
111
|
+
knownResourceIds: myApp.resourceIds(),
|
|
92
112
|
});
|
|
113
|
+
|
|
114
|
+
// Run built-in topo-aware rule trails once against the resolved graph
|
|
115
|
+
const topoDiagnostics = await runTopoAwareWardenTrails(myApp);
|
|
93
116
|
```
|
|
94
117
|
|
|
95
|
-
To wrap a custom rule as a trail,
|
|
118
|
+
To wrap a custom rule as a trail, import `wrapRule` from the root package
|
|
119
|
+
entrypoint:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { wrapRule } from '@ontrails/warden';
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This is the same factory used internally to build all built-in rule trails.
|
|
96
126
|
|
|
97
127
|
## API
|
|
98
128
|
|
|
@@ -102,11 +132,24 @@ To wrap a custom rule as a trail, use `wrapRule` (imported from `@ontrails/warde
|
|
|
102
132
|
| `formatWardenReport(report)` | Human-readable report |
|
|
103
133
|
| `checkDrift(rootDir, topo?)` | Check if the lock file matches the current topo |
|
|
104
134
|
| `wardenRules` | Registry of all built-in rules |
|
|
135
|
+
| `builtinWardenRuleMetadata` | Tier, scope, lifecycle, and invariant metadata for built-in rules |
|
|
136
|
+
| `getWardenRuleMetadata(ruleOrName)` | Resolve inline or built-in metadata for a Warden rule |
|
|
137
|
+
| `listWardenRuleMetadata()` | List built-in rule metadata entries |
|
|
105
138
|
| `wardenTopo` | `Topo` of all built-in rule trails (one per rule) |
|
|
106
|
-
| `runWardenTrails(filePath, sourceCode, options?)` | Dispatch
|
|
139
|
+
| `runWardenTrails(filePath, sourceCode, options?)` | Dispatch file-scoped rule trails for a file, collect diagnostics |
|
|
140
|
+
| `runTopoAwareWardenTrails(topo)` | Dispatch built-in topo-aware rule trails once for a resolved topo |
|
|
107
141
|
| `formatGitHubAnnotations(report)` | GitHub Actions annotation format |
|
|
108
142
|
| `formatJson(report)` | Machine-readable JSON |
|
|
109
143
|
| `formatSummary(report)` | Compact summary line |
|
|
144
|
+
| `wrapRule(rule)` | Wrap a custom rule as a trail (same factory used for all built-in rule trails) |
|
|
145
|
+
|
|
146
|
+
AST parser helpers are exported from `@ontrails/warden/ast`, not the root
|
|
147
|
+
runtime barrel. The stable authoring surface includes `parse`, `walk`,
|
|
148
|
+
`walkScope`, `offsetToLine`, `findTrailDefinitions`, `findBlazeBodies`,
|
|
149
|
+
`findContourDefinitions`, `isBlazeCall`, and string-literal helpers.
|
|
150
|
+
|
|
151
|
+
`runWarden({ tier })` can narrow a run to `source-static`, `project-static`,
|
|
152
|
+
`topo-aware`, `drift`, or `advisory`. Omit `tier` for the default full run.
|
|
110
153
|
|
|
111
154
|
See the [API Reference](../../docs/api-reference.md) for the full list.
|
|
112
155
|
|
package/bin/warden.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/* oxlint-disable eslint-plugin-jest/require-hook -- CLI bin entrypoints execute at module scope */
|
|
3
|
+
|
|
4
|
+
import { runWardenCommand } from '../src/command.js';
|
|
5
|
+
|
|
6
|
+
const env = { ...process.env } as Record<string, string | undefined>;
|
|
7
|
+
const result = await runWardenCommand({
|
|
8
|
+
args: Bun.argv.slice(2),
|
|
9
|
+
cwd: process.cwd(),
|
|
10
|
+
env,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
if (result.output.length > 0) {
|
|
14
|
+
console.log(result.output);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const summaryPath = env['GITHUB_STEP_SUMMARY'];
|
|
18
|
+
if (result.writeStepSummary && summaryPath !== undefined) {
|
|
19
|
+
await Bun.write(summaryPath, result.summary);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
process.exit(result.exitCode);
|
package/package.json
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ontrails/warden",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.16",
|
|
4
|
+
"bin": {
|
|
5
|
+
"warden": "./bin/warden.ts"
|
|
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
|
+
],
|
|
4
16
|
"type": "module",
|
|
5
17
|
"exports": {
|
|
6
18
|
".": "./src/index.ts",
|
|
19
|
+
"./ast": "./src/ast.ts",
|
|
20
|
+
"./resolve": "./src/resolve.ts",
|
|
7
21
|
"./package.json": "./package.json"
|
|
8
22
|
},
|
|
9
23
|
"scripts": {
|
|
@@ -13,14 +27,20 @@
|
|
|
13
27
|
"lint": "oxlint ./src",
|
|
14
28
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
15
29
|
},
|
|
16
|
-
"
|
|
17
|
-
"@ontrails/
|
|
18
|
-
"@
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@ontrails/cli": "^1.0.0-beta.15",
|
|
32
|
+
"@ontrails/permits": "^1.0.0-beta.15",
|
|
33
|
+
"@ontrails/store": "^1.0.0-beta.15",
|
|
19
34
|
"oxc-parser": "^0.121.0",
|
|
35
|
+
"oxc-resolver": "11.19.1",
|
|
20
36
|
"zod": "^4.3.5"
|
|
21
37
|
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@ontrails/config": "^1.0.0-beta.15",
|
|
40
|
+
"@ontrails/testing": "^1.0.0-beta.15"
|
|
41
|
+
},
|
|
22
42
|
"peerDependencies": {
|
|
23
|
-
"@ontrails/core": "^1.0.0-beta.
|
|
24
|
-
"@ontrails/
|
|
43
|
+
"@ontrails/core": "^1.0.0-beta.15",
|
|
44
|
+
"@ontrails/topographer": "^1.0.0-beta.15"
|
|
25
45
|
}
|
|
26
46
|
}
|
package/src/ast.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public Warden AST helper surface.
|
|
3
|
+
*
|
|
4
|
+
* These helpers are the supported parser primitives for repo-local tooling and
|
|
5
|
+
* rule authoring. Broader Trails-aware discovery helpers stay internal to the
|
|
6
|
+
* built-in rule implementation until they have a stable public contract.
|
|
7
|
+
*/
|
|
8
|
+
export {
|
|
9
|
+
findBlazeBodies,
|
|
10
|
+
findContourDefinitions,
|
|
11
|
+
findStringLiterals,
|
|
12
|
+
findTrailDefinitions,
|
|
13
|
+
getStringValue,
|
|
14
|
+
isBlazeCall,
|
|
15
|
+
isStringLiteral,
|
|
16
|
+
offsetToLine,
|
|
17
|
+
parse,
|
|
18
|
+
walk,
|
|
19
|
+
walkScope,
|
|
20
|
+
} from './rules/ast.js';
|
|
21
|
+
export type {
|
|
22
|
+
AstNode,
|
|
23
|
+
ContourDefinition,
|
|
24
|
+
FindContourDefinitionsOptions,
|
|
25
|
+
FrameworkNamespaceContext,
|
|
26
|
+
StringLiteralMatch,
|
|
27
|
+
TrailDefinition,
|
|
28
|
+
} from './rules/ast.js';
|