Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fail-closed and only pauses when the agent actually proposed a reviewed output.
│ │ ├── mod.rs # Module entry point and Compiler trait
│ │ ├── common.rs # Shared helpers across targets
│ │ ├── ado_bundle.rs # Registry of ado-script bundles and their compile-time env contracts: Bundle enum (path + auth), apply_bundle_auth() (single chokepoint projecting SYSTEM_ACCESSTOKEN into every REST-calling bundle step), token_source_for() (System.AccessToken vs SC_WRITE_TOKEN selection), is_redundant_ado_mirror() (identifies auto-injected ADO predefined var re-projections)
│ │ ├── agentic_pipeline.rs # Canonical Setup → Agent → Detection → (ManualReview?) → SafeOutputs(+SafeOutputs_Reviewed?) → Teardown → Conclusion shape (Conclusion emitted when configured; shared by every target); BuiltPipelineContext, build_pipeline_context, build_canonical_jobs, per-job builders incl. build_manual_review_job + SafeOutputsVariant split, fold_agent_conditions, agent_job_variables_hoist
│ │ ├── agentic_pipeline.rs # Canonical Setup → Agent → Detection → (ManualReview?) → Custom_<tool>* → SafeOutputs(+SafeOutputs_Reviewed?) → Teardown → Conclusion shape (Conclusion emitted when configured; shared by every target); BuiltPipelineContext, build_pipeline_context, build_canonical_jobs, per-job builders incl. build_manual_review_job + custom safe-output jobs + SafeOutputsVariant split, fold_agent_conditions, agent_job_variables_hoist
│ │ ├── standalone.rs # Standalone pipeline compiler
│ │ ├── standalone_ir.rs # Standalone target typed-IR builder
│ │ ├── onees.rs # 1ES Pipeline Template compiler
Expand All @@ -74,6 +74,8 @@ fail-closed and only pauses when the agent actually proposed a reviewed output.
│ │ ├── filter_ir.rs # Filter expression IR: Fact/Predicate types, lowering, validation, codegen
│ │ ├── pr_filters.rs # PR trigger filter generation (native ADO + gate steps)
│ │ ├── path_layout_check.rs # Warning-only checkout-aware path validation: $(Build.SourcesDirectory)/<seg> refs in steps, runtime-import targets, deprecated directory markers in the body
│ │ ├── custom_tools.rs # Compile-time custom safe-output MCP schema generation for safe-outputs.scripts/jobs (closed scalar input schemas, custom-tools JSON)
│ │ ├── imports/ # Reusable component imports: mod.rs resolver + SHA-keyed .ado-aw/imports cache, schema.rs import-schema/with validation + substitution, alias.rs generated repo aliases + template diagnostics, merge.rs consumer-wins front-matter/body merge
│ │ ├── extensions/ # CompilerExtension trait and infrastructure extensions
│ │ │ ├── mod.rs # Trait, Extension enum, collect_extensions(), re-exports
│ │ │ ├── ado_aw_marker.rs # Always-on metadata marker extension (emits # ado-aw-metadata JSON)
Expand Down Expand Up @@ -118,10 +120,11 @@ fail-closed and only pauses when the agent actually proposed a reviewed output.
│ │ ├── emit.rs # Thin `lower() + serde_yaml::to_string()` wrapper
│ │ └── summary.rs # Public, serializable PipelineSummary / GraphSummary for agent-facing tooling (see docs/ir.md Public JSON summary)
│ ├── init.rs # Repository initialization for AI-first authoring: scaffolds a dispatcher agent (.github/agents/ado-aw.agent.md) AND skill (.github/skills/ado-aw/SKILL.md); `--agency` plugin scaffold embeds agency/plugins/ado-aw/ via include_str!
│ ├── execute.rs # Stage 3 safe output execution
│ ├── execute.rs # Stage 3 safe output execution, including custom safe-output modes: scripts-style `--custom-config` native dispatch and jobs-style `--custom-phase pre|post` wrapper/result validation
│ ├── fuzzy_schedule.rs # Fuzzy schedule parsing
│ ├── logging.rs # File-based logging infrastructure
│ ├── mcp.rs # SafeOutputs MCP server (stdio + HTTP)
│ ├── mcp_custom_tools.rs # Dynamic SafeOutputs MCP tool registration from compiler-generated custom-tools JSON
│ ├── mcp_author/ # Author-facing read-only MCP server for local IDE/Copilot Chat integrations
│ │ ├── mod.rs # Tool router + handlers for inspect/graph/deps/outputs/whatif/lint/catalog/trace/audit
│ │ └── tests.rs # MCP-author integration / contract tests
Expand Down Expand Up @@ -305,6 +308,10 @@ index to jump to the right page.

- [`docs/front-matter.md`](docs/front-matter.md) — full agent file format
(markdown body + YAML front matter grammar) with every supported field.
- [`docs/imports.md`](docs/imports.md) — reusable local and SHA-pinned
cross-repository markdown components: `imports:`, `import-schema:`, committed
`.ado-aw/imports/` cache, merge semantics, and custom safe-output component
examples.
- [`docs/runtime-imports.md`](docs/runtime-imports.md) — runtime prompt import
markers, path resolution, and `inlined-imports:` behavior.
- [`docs/schedule-syntax.md`](docs/schedule-syntax.md) — fuzzy schedule time
Expand All @@ -329,7 +336,8 @@ index to jump to the right page.
configured via the `execution-context:` front-matter block.
- [`docs/safe-outputs.md`](docs/safe-outputs.md) — full reference for every
safe-output tool agents can use to propose actions (PRs, work items, wiki
pages, comments, etc.) plus their per-agent configuration.
pages, comments, etc.), custom `safe-outputs.scripts` / `safe-outputs.jobs`
components, and per-agent configuration.
- [`docs/safe-output-permissions.md`](docs/safe-output-permissions.md) —
diagnosis and fix reference for Stage 3 401/403 failures: the
default build identity (PCBS vs project-scoped Build Service),
Expand Down Expand Up @@ -369,8 +377,9 @@ index to jump to the right page.
- [`docs/mcpg.md`](docs/mcpg.md) — MCP Gateway architecture and pipeline
integration.
- [`docs/network.md`](docs/network.md) — AWF network isolation, default
allowed domains, ecosystem identifiers, blocking, and ADO `permissions:`
service-connection model.
allowed domains, ecosystem identifiers, blocking, repository-resource
`endpoint:` service connections, and ADO `permissions:` service-connection
model.
- [`docs/extending.md`](docs/extending.md) — adding new CLI commands, compile
targets, front-matter fields, typed IR extensions, safe-output tools,
first-class tools, and runtimes; the `CompilerExtension` trait.
Expand Down
64 changes: 64 additions & 0 deletions docs/front-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@ repos: # compact repository declarations (replaces rep
- my-org/my-repo # shorthand: alias="my-repo", type=git, ref=refs/heads/main, checkout=true
- reponame=my-org/another-repo # shorthand with explicit alias
- name: my-org/templates # object form for full control
type: github # external repo resource type; default is git
ref: refs/heads/release/2.x
checkout: false # declared as resource only, not checked out by the agent
endpoint: github-templates # required for type: github/githubenterprise/bitbucket
imports: # reusable markdown components; see docs/imports.md
- ./components/local-guidance.md
- uses: octo/shared/components/notify.md@0123456789abcdef0123456789abcdef01234567
endpoint: github-shared-components
with: # non-secret import-schema inputs
channel: service-alerts
tools: # optional tool configuration
bash: ["cat", "ls", "grep"] # explicit bash allow-list; when omitted, all bash tools are allowed (unrestricted)
edit: true # enable file editing tool (default: true)
Expand Down Expand Up @@ -242,6 +250,61 @@ runtime — write it as clear, structured natural-language instructions.
> report on pipeline failures and surfaces diagnostic signals. See
> [`docs/conclusion.md`](conclusion.md).

## Reusable Imports (`imports:` / `import-schema:`)

`imports:` lets a workflow reuse local or SHA-pinned cross-repository markdown
components. Each imported file is parsed as regular ado-aw markdown with YAML
front matter; the compiler validates optional `import-schema:` inputs, applies
`{{ inputs.<key> }}` substitutions (a compile-time `{{ ... }}`
replacement — not the ADO `${{ ... }}` template delimiter), then merges the
imported front matter and body into the consumer workflow. Imported **body**
content is inlined into the agent prompt at compile time (ahead of the
consumer's own body); see [`imports.md`](imports.md) for the full reference.

```yaml
imports:
- ./components/local-policy.md
- octo/shared-agents/components/notify.md@0123456789abcdef0123456789abcdef01234567
- uses: octo/shared-agents/components/deploy.md@89abcdef0123456789abcdef0123456789abcdef
endpoint: github-shared-components
with:
environment: prod
region: westus3
```

Object-form fields:

| Field | Description |
|-------|-------------|
| `uses` | Import spec. Local paths are relative to the importing `.md` file. Cross-repo specs use `owner/repo/path@<40-character-sha>`; branches/tags are rejected. |
| `with` | Non-secret values validated against the imported file's `import-schema:`. |
| `endpoint` | Azure DevOps service connection for GitHub/GitHub Enterprise runtime repository resources created for imported component sources. |

Import specs may also include `#Section` to import only a markdown heading
section, and a trailing `?` to make the import optional.

Reusable components declare compile-time inputs with `import-schema:`:

```yaml
import-schema:
channel:
type: string
required: true
severity:
type: choice
options: [info, warning, critical]
default: info
labels:
type: array
items:
type: string
```

Supported types are `string`, `number`, `boolean`, `choice`, `array`, and
`object` (object properties are currently one level deep). See
[`imports.md`](imports.md) for the full syntax, cache layout, merge semantics,
limitations, and custom safe-output component examples.

## Inline step validation (`setup` / `steps` / `post-steps` / `teardown`)

Inline steps are authored as raw Azure DevOps YAML and are emitted into the
Expand Down Expand Up @@ -402,6 +465,7 @@ Object fields:
| `alias` | last segment of `name` | Repository alias (maps to ADO `repository:`) |
| `type` | `git` | ADO repository resource type |
| `ref` | `refs/heads/main` | Branch or tag reference |
| `endpoint` | *(none)* | Azure DevOps service connection. Required for `type: github`, `githubenterprise`, or `bitbucket`; not needed for same-org Azure Repos `git`. |
| `checkout` | `true` | Whether the agent job clones this repo |
| `fetch-depth` | *(ADO default)* | Shallow-clone depth for this repo's checkout (ADO `fetchDepth`). `0` = full history |
| `fetch-tags` | *(ADO default)* | Whether to fetch git tags during checkout (ADO `fetchTags`) |
Expand Down
Loading
Loading