Commit 1e396a0
feat: unify standalone and 1ES compilers (#226)
* refactor: extract shared compile flow and move helpers to common.rs
Move helper functions, MCPG generation, and MCP validation from
standalone.rs to common.rs. Extract compile_shared() function with
CompileConfig struct so both standalone and 1ES compilers can share
the common compilation flow.
Standalone compiler is now a thin wrapper that provides target-specific
values (AWF domains, MCPG config, firewall version) via extra_replacements.
This is a pure refactor - standalone output is byte-identical to before
(verified via golden snapshot comparison).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: rewrite 1ES compiler to use Copilot CLI + AWF + MCPG
Replace the legacy Agency job type (agencyJob) with direct Copilot CLI
invocation, AWF network isolation, and MCP Gateway — matching the
standalone pipeline execution model.
Changes:
- templates/1es-base.yml: Complete rewrite. All three jobs
(PerformAgenticTask, AnalyzeSafeOutputs, ProcessSafeOutputs) now use
templateContext.type: buildJob with the same step sequence as
standalone. Dropped Agency concepts: commandOptions, globalOptions,
logLevel, mcpConfiguration, agentContextRoot, AgencyArtifact.
- src/compile/onees.rs: Rewritten as thin wrapper using compile_shared().
Removed generate_agent_context_root, generate_mcp_configuration,
generate_inline_steps. Only 1ES-specific setup/teardown helpers remain.
- src/compile/common.rs: Moved generate_allowed_domains from standalone.
Removed dead is_custom_mcp function.
- src/compile/standalone.rs: Removed now-unnecessary imports.
Both compilers now share the same execution model and compile flow.
Standalone output is verified byte-identical to pre-refactor baseline.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* docs: update documentation for unified compiler architecture
Remove Agency/agencyJob references from AGENTS.md and module docs.
Update 1ES target description to reflect shared execution model
(Copilot CLI + AWF + MCPG). Remove obsolete 1ES-specific marker
documentation (agent_context_root, mcp_configuration, global_options,
log_level).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: add YAML validation tests for compiled pipeline output
Add integration tests that compile fixtures and verify the output is
valid, parseable YAML. Tests cover:
- 1ES: valid YAML with correct 'extends' and 'resources' structure
- Standalone minimal: valid YAML with 'jobs' key
- Standalone pipeline-trigger: valid YAML
- Standalone complete: compile-only (has pre-existing indentation
issue in multi-repository output)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: correct indentation in generate_repositories, checkout_steps, and teardown_job
- generate_repositories: remove hardcoded 6-space indent on sub-fields;
output flat YAML and let replace_with_indent handle template-level
indentation
- generate_checkout_steps: same fix, remove hardcoded 14-space join
- generate_teardown_job (common.rs): match setup_job pattern — output
flat YAML starting at column 0 instead of baking in 2-space indent;
move template placeholder from column 0 to column 2 to match setup_job
- generate_setup_job/teardown_job (onees.rs): fix step indentation from
4 to 6 to match the steps: nesting depth in templateContext
- Upgrade complete-agent test from compile-only to full YAML validation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: eliminate double CompileContext creation and fragile replacement ordering
- compile_shared() now accepts &CompileContext instead of building its
own, eliminating duplicate git remote I/O on every compilation
- extra_replacements are applied before shared replacements, so targets
can cleanly override shared markers (e.g., 1ES setup/teardown jobs)
via the intended CompileConfig mechanism
- 1ES compiler no longer pre-replaces markers in the template string
before calling compile_shared; uses extra_replacements instead
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: strengthen 1ES YAML validation with content assertions
Add assertions verifying that key pipeline content is present in the
compiled 1ES output: Copilot CLI install, AWF, MCPG, SafeOutputs,
copilot invocation, threat analysis, safe output execution, and all
three job names. Also verify no Agency remnants (agencyJob,
AgencyArtifact, commandOptions).
These catch placeholder substitution regressions that the structural
YAML validity and no-unreplaced-markers tests would miss.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: stale doc comment and unescaped service connection name in YAML
- Remove orphaned schedule doc comment accidentally prepended to
generate_parameters() during earlier refactoring
- Escape single quotes in service connection names when emitting
azureSubscription YAML values to prevent malformed pipeline output
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent d309b41 commit 1e396a0
8 files changed
Lines changed: 2788 additions & 2646 deletions
File tree
- src/compile
- templates
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 528 | + | |
| 529 | + | |
533 | 530 | | |
534 | 531 | | |
535 | 532 | | |
536 | 533 | | |
537 | 534 | | |
538 | 535 | | |
539 | | - | |
| 536 | + | |
540 | 537 | | |
541 | 538 | | |
542 | 539 | | |
| |||
919 | 916 | | |
920 | 917 | | |
921 | 918 | | |
922 | | - | |
| 919 | + | |
923 | 920 | | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
| 921 | + | |
950 | 922 | | |
951 | 923 | | |
952 | 924 | | |
| |||
1675 | 1647 | | |
1676 | 1648 | | |
1677 | 1649 | | |
1678 | | - | |
| 1650 | + | |
1679 | 1651 | | |
1680 | 1652 | | |
1681 | 1653 | | |
| |||
0 commit comments