Commit 4c1c209
fix(ado-script): address PR review — drift-check fact deps; fail-closed unknown predicates
Closes review findings on #389:
1. FACT_DEPS drift gap: the fact dependency graph in policy.ts was a
manually-maintained mirror of Fact::dependencies() in Rust, outside
the schema drift check. Added `dependencies: Vec<String>` to
FactSpec populated from Fact::dependencies(). Regenerated
types.gen.ts. PolicyTracker now reads the dep graph from the spec
at construction; the hardcoded FACT_DEPS constant is removed. The
CI `git diff --exit-code` on types.gen.ts now covers the dep graph
too.
2. Unknown predicate silent pass: the default arm of evaluatePredicate
returned true (auto-pass), so a stale gate.js paired with a newer
compiler that emits a new predicate would silently pass filters.
Now: emits a task.logissue type=warning naming the unknown type
and returns false (fail-closed). Added a regression test.
3. Stale "Python" doc on GateSpec: updated to "Node gate evaluator
(scripts/gate.js)". Propagates through codegen.
4. scripts.zip ships TS source: added -x patterns for ado-script/src/,
test/, package*.json, tsconfig.json, vitest.config*.ts, README.md,
and .gitignore. Only gate.js (already at scripts/gate.js) and any
future bundle artefacts are shipped.
5. globMatch bracket divergence: documented inline that bracket
expressions [seq] are escaped to literal characters (Python fnmatch
supported them). The IR currently never emits bracket patterns; if
a future predicate needs them, the builder must be extended.
6. release.yml missing npm cache: added cache: "npm" and
cache-dependency-path to match the CI workflow. Avoids
re-downloading node_modules on every release run.
7. Fact::is_pipeline_var() #[cfg(test)] opacity: added a doc comment
noting the runtime mirror is isPipelineVarFact in env-facts.ts, so
future readers don't wonder why the helper exists only for tests.
Validation: 172/172 vitest tests, full cargo test suite, clippy clean,
e2e gate test passes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 51eedf8 commit 4c1c209
9 files changed
Lines changed: 100 additions & 25 deletions
File tree
- .github/workflows
- scripts/ado-script/src
- gate
- __tests__/ports
- src/compile
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
81 | 94 | | |
82 | 95 | | |
83 | 96 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
353 | 381 | | |
354 | 382 | | |
355 | 383 | | |
| |||
380 | 408 | | |
381 | 409 | | |
382 | 410 | | |
383 | | - | |
384 | | - | |
| 411 | + | |
| 412 | + | |
385 | 413 | | |
386 | 414 | | |
387 | 415 | | |
| |||
406 | 434 | | |
407 | 435 | | |
408 | 436 | | |
409 | | - | |
| 437 | + | |
410 | 438 | | |
411 | 439 | | |
412 | 440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
| |||
152 | 162 | | |
153 | 163 | | |
154 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
155 | 171 | | |
156 | 172 | | |
157 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
7 | 20 | | |
8 | 21 | | |
9 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 6 | | |
16 | 7 | | |
| 8 | + | |
| 9 | + | |
17 | 10 | | |
18 | 11 | | |
19 | 12 | | |
| |||
24 | 17 | | |
25 | 18 | | |
26 | 19 | | |
| 20 | + | |
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
| |||
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
111 | | - | |
| 105 | + | |
112 | 106 | | |
113 | 107 | | |
114 | 108 | | |
| |||
132 | 126 | | |
133 | 127 | | |
134 | 128 | | |
135 | | - | |
136 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
812 | 814 | | |
813 | 815 | | |
814 | 816 | | |
815 | | - | |
| 817 | + | |
816 | 818 | | |
817 | 819 | | |
818 | 820 | | |
| |||
834 | 836 | | |
835 | 837 | | |
836 | 838 | | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
837 | 843 | | |
838 | 844 | | |
839 | 845 | | |
| |||
1065 | 1071 | | |
1066 | 1072 | | |
1067 | 1073 | | |
| 1074 | + | |
1068 | 1075 | | |
1069 | 1076 | | |
1070 | 1077 | | |
| |||
0 commit comments