Skip to content
Merged
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
27 changes: 27 additions & 0 deletions .changeset/skip-if-decision.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions .github/aw/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,50 @@ These rules override conflicting upstream guidance.
- Before inventing workflow/shared-component/tool/safe-output patterns, inspect
`https://github.com/gm3dmo/the-power` through GitHub APIs or `gh` for prior art.

## Skipping Unnecessary Agent Invocations

Use experimental top-level `skip-if-decision` when skipping requires semantic evidence from
task or progress files. Prefer deterministic trigger/activation checks when
ordinary conditions suffice; decisions cannot override retry limits, budgets,
deadlines, or nonrecoverable errors.

Lists accept at most 64 questions. Nonempty lists emit a compile-time experimental warning. Configuration and
behavior may change without deprecation.

```yaml
skip-if-decision:
- Is there no actionable work remaining in @context/task.md?
- Has @reports/progress.md established that further execution is unnecessary?
```

Write each question as a skip condition, not a request to execute the agent.
Populate referenced files through checkout, restored memory, or pre-agent setup
before the first invocation, and keep them current for subsequent invocations.
Runtime `@file` references resolve relative to `engine.cwd` or the workspace;
only workspace and `/tmp/gh-aw/agent` files are eligible. Sensitive paths,
symlinks, hardlinks, oversized context, and Actions expressions are unsupported.
Each read is bounded by the remaining import budget, including JSON escaping
and evidence metadata. Per-question context has a 512 KiB ceiling; the complete
serialized Decisions request is limited to 400,000 UTF-8 bytes (approximately
100,000 tokens at four bytes per token, not tokenizer-exact). A question that
does not fit abstains, while smaller remaining questions may still run.

The shared harness evaluates questions inside AWF before every otherwise
eligible initial, retry, resume, or continuation invocation, including
declarative engines. Any `deny` skips; otherwise `allow` or all `unknown`
preserves the existing execution path. Missing files, API/model unavailability,
timeouts, and malformed responses abstain without decision retries or workflow
failure. An absent or empty list preserves existing behavior.

Questions are batched through the existing AWF proxy, using
`gpt-6-luna-decisions` on Copilot or `gpt-6-luna` on OpenAI. Do not add direct
provider calls, extra credentials, host-side decision steps, or decision code
to detection, evals, or conclusion. Decision requests retain normal proxy
budget and usage accounting; a skipped agent is not zero total model usage.
Inspect typed `harness.decision` unified-session events or `gh aw audit --json`
under `retries.decisions` and `retries.avoided_invocations` for outcomes,
sanitized errors, latency, and avoided invocations.

## Indexing and Search

Follow [index-search.md](index-search.md) when integrating existing indexes or
Expand Down
9 changes: 9 additions & 0 deletions .github/aw/safe-outputs-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ See [jobs.md](jobs.md) for the full compiler-generated job graph and which job e

The `report-incomplete` safe-output is enabled by default and is distinct from `noop`. Use it when required tools or data are unavailable and the task cannot be meaningfully performed (e.g., MCP server crash, missing authentication, inaccessible repository). When an agent emits `report_incomplete`, gh-aw activates failure handling even when the agent process exits 0 — preventing empty outputs from being classified as successful, so every unrecoverable failure is tracked.

When top-level `skip-if-decision` denies an otherwise eligible invocation, the
AWF harness attempts to record `noop` only if no terminal safe output exists.
Existing task outputs, no-ops, and incomplete diagnostics are preserved; the
decision does not authorize their publication or override failure/detection
policy. Decision evaluation errors abstain and do not independently emit
`noop` or `report_incomplete`. Use `harness.decision` unified-session events and
audit decision history to distinguish an avoided invocation from agent work.
Decision-model usage remains part of normal proxy accounting.

**Per-handler modifiers** — most handlers accept `max`, `github-token`, `github-app`, and `staged` to override the global equivalents for that one output type. Two extras:

- `issue-intent:` (boolean) on `close-issue`, `set-issue-type`, `set-issue-field`, `assign-to-user`, and `assign-to-agent` — enables issue-intent metadata (rationale/confidence/suggest) fields and their schema requirements on that tool's payload.
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/daily-file-diet.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion .github/workflows/daily-file-diet.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ emoji: 🧹
engine:
agent: developer.instructions
id: copilot
skip-if-decision:
- >-
Does @/tmp/gh-aw/agent/file-diet-metrics.json conclusively show that the
largest non-test Go source file is strictly below healthy_threshold,
so no refactoring issue is required? Abstain if the metrics are invalid
or incomplete; a file at or above the threshold still requires analysis.
name: Daily File Diet
strict: true
timeout-minutes: 20
Expand Down Expand Up @@ -93,7 +99,7 @@ steps:
}) + "\n");
evals:
- id: large_files_analyzed
question: Did the agent analyze the largest Go source files in the repository?
question: When the agent ran, did it analyze the largest Go source files in the repository? Return UNKNOWN when the output records a skip-if-decision no-op because the prepared metrics established that all files were below the healthy threshold.
- id: issue_created_or_noop
question: Was a refactoring issue created for files exceeding the healthy size threshold, or was noop used when all files were within limits?
---
Expand All @@ -104,6 +110,11 @@ evals:

You are the Daily File Diet Agent - a code health specialist that monitors file sizes and promotes modular, maintainable codebases by identifying oversized files that need refactoring.

The AWF decision gate reads the prepared metrics before each eligible
invocation. It may skip the agent when the largest file is strictly below the
healthy threshold; unknown decisions and files at or above the threshold
preserve the existing analysis path.

## Mission

Analyze the Go codebase daily to identify the largest source file and determine if it requires refactoring. Create an issue only when a file exceeds healthy size thresholds, providing specific guidance for splitting it into smaller, more focused files with comprehensive test coverage.
Expand Down
Loading
Loading