flecto 1.0.2 → 2.1.0
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 +103 -0
- package/README.md +297 -109
- package/index.js +362 -35
- package/package.json +8 -6
- package/schemas/flecto-envelope-2.0.json +65 -0
- package/schemas/flecto-policy-pack-2.0.json +124 -0
- package/src/alerter.js +11 -10
- package/src/config.js +59 -2
- package/src/differ.js +153 -16
- package/src/envelope.js +6 -4
- package/src/packs/compose.json +45 -0
- package/src/packs/default.json +37 -0
- package/src/packs/node-runtime.json +44 -0
- package/src/packs/strict-prod.json +37 -0
- package/src/parser.js +80 -14
- package/src/policy-test.js +124 -0
- package/src/policy.js +541 -34
- package/src/renderer.js +62 -13
- package/src/watcher.js +28 -11
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Flecto will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog], and this project adheres to
|
|
6
|
+
[Semantic Versioning].
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [2.1.0] - 2026-07-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Default-on array identity matching with auto-detect of unique `id`, then
|
|
15
|
+
`name`. Escape hatch: `--no-array-id` or `"arrayId": false` in `.flectorc`.
|
|
16
|
+
Custom keys still work via `--array-id-key`. ([#6])
|
|
17
|
+
- `flecto history` for local snapshot drift baselines (`--limit`). ([#7])
|
|
18
|
+
- Richer declarative policy predicates: `beforeEquals`, `beforeIn` / `afterIn`,
|
|
19
|
+
`beforeTruthy` / `afterTruthy`, `afterMatches`, `numericDelta`,
|
|
20
|
+
`match.pathEquals` / `match.pathPrefix`, and `allOf` / `anyOf`. ([#34])
|
|
21
|
+
- Built-in `compose` and `node-runtime` policy packs. ([#8])
|
|
22
|
+
- JSON Schema + load-time validation for policy packs
|
|
23
|
+
(`schemas/flecto-policy-pack-2.0.json`). ([#36])
|
|
24
|
+
- `flecto policies list` (+ `--json`) for pack discovery. ([#37])
|
|
25
|
+
- `flecto policies test <fixtureDir>` fixture harness for packs/plugins. ([#38])
|
|
26
|
+
- Per-profile `severityRemap` to raise, lower, or silence pack rules without
|
|
27
|
+
forking. ([#39])
|
|
28
|
+
- Reusable GitHub Action wrapper for `flecto ci`
|
|
29
|
+
(`.github/actions/flecto-ci`). ([#9])
|
|
30
|
+
- Policy pack + plugin authoring guides, cookbook, and examples. ([#32], [#35])
|
|
31
|
+
- `CHANGELOG.md` with v2.1 migration notes. ([#33])
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Node.js requirement raised to **>=20.19.0** (matches chokidar 5). CI matrix
|
|
36
|
+
is 20/22/24; publish uses Node 22. ([#22], [#27])
|
|
37
|
+
- `flecto ci` and `flecto watch --snapshot` fail closed when every target is
|
|
38
|
+
missing or unsupported. Pass `--allow-empty` to permit an empty run.
|
|
39
|
+
([#20], [#29], [#40])
|
|
40
|
+
- Only options explicitly set on the CLI override `.flectorc` profiles
|
|
41
|
+
(Commander defaults no longer wipe profile settings). ([#19], [#31])
|
|
42
|
+
- Watch mode fails closed on policy pack/plugin load or evaluation errors,
|
|
43
|
+
independent of `--on-alert-failure`. ([#25])
|
|
44
|
+
- Secret masking recursively redacts nested secret values when enabled. ([#24])
|
|
45
|
+
- Dangerous-toggle rules treat stringy truthy values (`true` / `1` / `yes`) as
|
|
46
|
+
enabled, so `.env` / INI configs are covered. ([#23])
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- `arrayIgnoreOrder` no longer false-positives on object key order or throws on
|
|
51
|
+
non-JSON values such as `undefined`. ([#21])
|
|
52
|
+
- `fireAlerts` preserves its `{ ok }` result and surfaces queue errors; watch
|
|
53
|
+
consumes rejected alert handlers safely. ([#26])
|
|
54
|
+
- GitHub annotation output escapes `%`, newlines, commas, and colons per
|
|
55
|
+
workflow-command rules. ([#28])
|
|
56
|
+
- Removed leftover `.sentinel-snapshots/` gitignore entry. ([#30])
|
|
57
|
+
|
|
58
|
+
### Migration notes
|
|
59
|
+
|
|
60
|
+
- **Array identity is on by default.** Diff paths may change from index-based
|
|
61
|
+
(`services[0].…`) to identity-based (`services["api"].…`). Review snapshots,
|
|
62
|
+
CI baselines, and any automation that consumes diff paths before upgrading.
|
|
63
|
+
- To keep 2.0-style index-based array diffs: `--no-array-id` or
|
|
64
|
+
`"arrayId": false` in `.flectorc`.
|
|
65
|
+
- **Node 18 is no longer supported.** Use Node.js 20.19.0 or newer.
|
|
66
|
+
- Recursive masking only affects output when secret masking is enabled, but
|
|
67
|
+
nested secret values previously visible in terminal/webhook payloads are now
|
|
68
|
+
redacted.
|
|
69
|
+
- `.flectorc` profile settings (for example `mode`, `failOn`, `format`) now
|
|
70
|
+
apply when you omit the corresponding CLI flags.
|
|
71
|
+
- Misconfigured policy packs/plugins cause `watch` to exit non-zero instead of
|
|
72
|
+
continuing with no policies.
|
|
73
|
+
|
|
74
|
+
[Unreleased]: https://github.com/myselfsiddharth/Flecto/compare/v2.1.0...HEAD
|
|
75
|
+
[2.1.0]: https://github.com/myselfsiddharth/Flecto/compare/v2.0.0...v2.1.0
|
|
76
|
+
[#6]: https://github.com/myselfsiddharth/Flecto/issues/6
|
|
77
|
+
[#7]: https://github.com/myselfsiddharth/Flecto/issues/7
|
|
78
|
+
[#8]: https://github.com/myselfsiddharth/Flecto/issues/8
|
|
79
|
+
[#9]: https://github.com/myselfsiddharth/Flecto/issues/9
|
|
80
|
+
[#19]: https://github.com/myselfsiddharth/Flecto/issues/19
|
|
81
|
+
[#20]: https://github.com/myselfsiddharth/Flecto/issues/20
|
|
82
|
+
[#21]: https://github.com/myselfsiddharth/Flecto/issues/21
|
|
83
|
+
[#22]: https://github.com/myselfsiddharth/Flecto/issues/22
|
|
84
|
+
[#23]: https://github.com/myselfsiddharth/Flecto/issues/23
|
|
85
|
+
[#24]: https://github.com/myselfsiddharth/Flecto/issues/24
|
|
86
|
+
[#25]: https://github.com/myselfsiddharth/Flecto/issues/25
|
|
87
|
+
[#26]: https://github.com/myselfsiddharth/Flecto/issues/26
|
|
88
|
+
[#27]: https://github.com/myselfsiddharth/Flecto/issues/27
|
|
89
|
+
[#28]: https://github.com/myselfsiddharth/Flecto/issues/28
|
|
90
|
+
[#29]: https://github.com/myselfsiddharth/Flecto/issues/29
|
|
91
|
+
[#30]: https://github.com/myselfsiddharth/Flecto/issues/30
|
|
92
|
+
[#31]: https://github.com/myselfsiddharth/Flecto/issues/31
|
|
93
|
+
[#32]: https://github.com/myselfsiddharth/Flecto/issues/32
|
|
94
|
+
[#33]: https://github.com/myselfsiddharth/Flecto/issues/33
|
|
95
|
+
[#34]: https://github.com/myselfsiddharth/Flecto/issues/34
|
|
96
|
+
[#35]: https://github.com/myselfsiddharth/Flecto/issues/35
|
|
97
|
+
[#36]: https://github.com/myselfsiddharth/Flecto/issues/36
|
|
98
|
+
[#37]: https://github.com/myselfsiddharth/Flecto/issues/37
|
|
99
|
+
[#38]: https://github.com/myselfsiddharth/Flecto/issues/38
|
|
100
|
+
[#39]: https://github.com/myselfsiddharth/Flecto/issues/39
|
|
101
|
+
[#40]: https://github.com/myselfsiddharth/Flecto/pull/40
|
|
102
|
+
[Keep a Changelog]: https://keepachangelog.com/en/1.1.0/
|
|
103
|
+
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
|