Skip to content

Commit 8c6b8fc

Browse files
docs: update audit diff and lock file header documentation (#24574)
1 parent b6e4a90 commit 8c6b8fc

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

docs/src/content/docs/reference/audit.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,19 @@ gh aw audit 1234567890 --repo owner/repo
5151

5252
**Report sections** (rendered in Markdown or JSON): Overview, Comparison, Task/Domain, Behavior Fingerprint, Agentic Assessments, Metrics, Key Findings, Recommendations, Observability Insights, Performance Metrics, Engine Config, Prompt Analysis, Session Analysis, Safe Output Summary, MCP Server Health, Jobs, Downloaded Files, Missing Tools, Missing Data, Noops, MCP Failures, Firewall Analysis, Policy Analysis, Redacted Domains, Errors, Warnings, Tool Usage, MCP Tool Usage, Created Items.
5353

54-
## `gh aw audit diff <run-id-1> <run-id-2>`
54+
## `gh aw audit diff <base-run-id> <comparison-run-id> [<comparison-run-id>...]`
5555

56-
Compare behavior between two workflow runs. Detects policy regressions, new unauthorized domains, behavioral drift, and changes in MCP tool usage or run metrics.
56+
Compare behavior between workflow runs. Detects policy regressions, new unauthorized domains, behavioral drift, and changes in MCP tool usage or run metrics.
5757

5858
**Arguments:**
5959

6060
| Argument | Description |
6161
|----------|-------------|
62-
| `<run-id-1>` | Numeric run ID for the baseline run |
63-
| `<run-id-2>` | Numeric run ID for the comparison run |
62+
| `<base-run-id>` | Numeric run ID for the baseline run |
63+
| `<comparison-run-id>` | Numeric run ID for the comparison run |
64+
| `[<comparison-run-id>...]` | Additional run IDs to compare against the same base |
65+
66+
The base run is downloaded once and reused when multiple comparison runs are provided. Self-comparisons and duplicate run IDs are rejected.
6467

6568
**Flags:**
6669

@@ -79,11 +82,17 @@ The diff output includes:
7982
- Anomaly flags (new denied domains, previously-denied domains now allowed)
8083
- MCP tool invocation changes (new/removed tools, call count and error count diffs)
8184
- Run metrics comparison (token usage, duration, turns)
85+
- Token usage breakdown: input tokens, output tokens, cache read/write tokens, effective tokens, total API requests, and cache efficiency per run
86+
87+
**Output behavior with multiple comparisons:**
88+
- `--json` outputs a single object for one comparison, or an array for multiple
89+
- `--format pretty` and `--format markdown` separate multiple diffs with dividers
8290

8391
**Examples:**
8492

8593
```bash
8694
gh aw audit diff 12345 12346
95+
gh aw audit diff 12345 12346 12347 12348
8796
gh aw audit diff 12345 12346 --format markdown
8897
gh aw audit diff 12345 12346 --json
8998
gh aw audit diff 12345 12346 --repo owner/repo

docs/src/content/docs/reference/workflow-structure.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,26 @@ When you run the `compile` command you generate the lock file.
4646
gh aw compile
4747
```
4848

49+
### Lock File Header
50+
51+
Each compiled lock file begins with a machine-readable metadata line followed by a human-readable manifest of its external dependencies:
52+
53+
```yaml
54+
# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"...","strict":true,"agent_id":"copilot"}
55+
# ___ ...ASCII logo...
56+
# This file was automatically generated by gh-aw. DO NOT EDIT.
57+
# ...
58+
# Secrets used:
59+
# - COPILOT_GITHUB_TOKEN
60+
# - GITHUB_TOKEN
61+
#
62+
# Custom actions used:
63+
# - actions/checkout@de0fac2e... # v6.0.2
64+
# - actions/upload-artifact@bbbca2... # v4
65+
```
66+
67+
The `gh-aw-metadata` line is always first, enabling reliable machine parsing. The `Secrets used` and `Custom actions used` sections list all `secrets.*` references and external `uses:` dependencies (excluding local `./` refs) found in the compiled workflow, sorted and deduplicated.
68+
4969
## Editing Workflows
5070

5171
The **markdown body** is loaded at runtime and can be edited directly on GitHub.com without recompilation. Only **frontmatter changes** require recompilation.

0 commit comments

Comments
 (0)