Commit 211f498
fix(compile): correct threat-prompt doc claim and gate required_hosts on actual download
Two findings from the latest PR review:
1. docs/template-markers.md falsely claimed that the
`{{ threat_analysis_prompt }}` marker is emitted as a
`{{#runtime-import ...}}` when `inlined-imports: false`. The
threat-analysis prompt is tooling-shipped (compiled into the
`ado-aw` binary via `include_str!`) and unconditionally inlined at
step 11 of `compile_shared`. The marker is for the agent body, not
the threat prompt. Rewrote the paragraph to reflect this and to
cross-reference the rationale in `src/compile/common.rs`.
2. `AdoScriptExtension::required_hosts()` always requested
`github.com`, even when `inlined-imports: true` AND no filters were
configured (so neither `setup_steps()` nor `prepare_steps()` emits
the NodeTool@0 + curl pair, and github.com is therefore unreachable
from the pipeline). For a security-sensitive project, the
allowlist should match the actual network reach of the compiled
pipeline. Now returns `vec![]` unless `has_gate()` or
`runtime_imports_active()`. Added three unit tests covering all
three branches (no-consumer, gate-active, imports-active).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a0c4504 commit 211f498
2 files changed
Lines changed: 44 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
| |||
390 | 397 | | |
391 | 398 | | |
392 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
393 | 431 | | |
394 | 432 | | |
395 | 433 | | |
| |||
0 commit comments