Skip to content

Dreaming: set protected-files: allowed so the workflow can open its curation PR - #14369

Merged
jankratochvilcz merged 1 commit into
mainfrom
dreaming-allow-protected-files
Jul 15, 2026
Merged

jankratochvilcz merged 1 commit into
mainfrom
dreaming-allow-protected-files

Conversation

@jankratochvilcz

Copy link
Copy Markdown
Contributor

Problem

The Dreaming workflow (added in #14357) ran end-to-end successfully for the first time after the fleet gh-aw upgrade (#14365), produced a high-quality proposal (two small "learning atom" edits to .github/instructions/*.instructions.md) — but never opened a PR. It fell back to opening a review issue (#14368) instead.

Root cause

The workflow's whole job is to curate the "learning atoms": AGENTS.md and everything under .github/instructions, .github/skills, .github/agents. Those are exactly the paths gh-aw's default file-protection policy guards:

  • AGENTS.md is in the built-in protected_files list, and
  • protect_top_level_dot_folders: true (a v0.82.9 default) marks every .github/** path as protected.

The default protected-files policy is request_review. When a run edited the protected instruction files, the safe-outputs signed-commit push was refused:

pushSignedCommits: refusing unsigned push for branch 'dreaming/…':
Signed-commit payload violates file-protection policy (request_review):
.github/instructions/tasks.instructions.md, .github/instructions/tests.instructions.md

…so the run silently degraded to a review issue.

Fix

Set protected-files: allowed on the create-pull-request safe output.

Verified against the pinned setup action (github/gh-aw-actions/setup v0.82.9, ca8678ca): both checkFileProtection (pre-apply) and checkFileProtectionPostApply (the exact function the signed-push gate calls) short-circuit to { action: "allow" } when the policy is allowed, before the manifest/dot-folder checks run.

Why this is safe

  • The tight allowed-files allowlist (AGENTS.md, .github/instructions/**, .github/skills/**, .github/agents/**) is the real guardrail. It is enforced independently and ahead of the protected-files check, so the agent still cannot touch product code, tests, build manifests, or the workflow definitions.
  • The PR still needs maintainer approval before it can merge, so human review is preserved at the PR gate — the request_review issue fallback was redundant friction for a workflow whose only output is a PR against these files.

Diff

Two files, minimal:

  • .github/workflows/dreaming.agent.md — one protected-files: allowed line (+ explanatory comment) in the create-pull-request config.
  • .github/workflows/dreaming.agent.lock.yml — regenerated via gh aw compile dreaming.agent --approve; the only functional change is protected_files_policy: request_review → allowed (plus the auto-generated frontmatter/EOF hashes).

Once merged, a re-run should open the curation PR directly instead of issue #14368.

The Dreaming workflow's entire purpose is to curate the "learning atoms" —
AGENTS.md and the files under .github/instructions, .github/skills, and
.github/agents. Those are exactly the paths gh-aw's default file-protection
policy guards (protected_files list + protect_top_level_dot_folders), and the
default policy is request_review.

When a run edited .github/instructions/*.instructions.md, the safe-outputs
signed-commit push was refused ("Signed-commit payload violates file-protection
policy (request_review)") and the run silently fell back to opening a review
*issue* (#14368) instead of the intended PR.

Set protected-files: allowed on the create-pull-request safe output. Verified
against the pinned setup action (v0.82.9, ca8678ca): both checkFileProtection
and checkFileProtectionPostApply (the signed-push gate) short-circuit to
'allow' when the policy is 'allowed', before the manifest/dot-folder checks.
The tight allowed-files allowlist remains the real guardrail (it is enforced
independently, ahead of the protected-files check), and the PR still needs
maintainer approval before merge, so human review is preserved at the PR gate.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 1b63f3d4-d050-4905-9e00-bee816df8a94
Copilot AI review requested due to automatic review settings July 15, 2026 11:37
@jankratochvilcz
jankratochvilcz requested a review from a team as a code owner July 15, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables the Dreaming agentic workflow to successfully open its weekly curation pull request when the proposed changes touch “protected” memory files (e.g., AGENTS.md and .github/instructions/**) by switching the safe-output protected-files policy to allowed while keeping the existing tight allowed-files allowlist.

Changes:

  • Set protected-files: allowed for the create-pull-request safe-output in the Dreaming source workflow.
  • Regenerated the compiled lock workflow so the safe-outputs handler uses protected_files_policy: "allowed".

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/dreaming.agent.md Sets protected-files: allowed for the PR-creation safe output (with rationale comment) so protected memory paths can be pushed and a PR can be opened.
.github/workflows/dreaming.agent.lock.yml Regenerated compiled workflow reflecting the updated safe-outputs protected-files policy (request_review → allowed).

@jankratochvilcz
jankratochvilcz enabled auto-merge (squash) July 15, 2026 11:41

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflow Configuration Review

Summary: This PR changes the Dreaming agent's protected_files_policy from request_review to allowed so the agent can open curation PRs that touch its target files (AGENTS.md, .github/instructions/**, etc.).

Security Analysis ✅

The policy relaxation is acceptable given the layered guardrails still in place:

  1. allowed_files allowlist restricts the agent to only AGENTS.md, .github/instructions/**, .github/skills/**, .github/agents/** — documentation/instruction files only.
  2. excluded_files explicitly blocks .github/workflows/**, preventing workflow self-modification.
  3. PR merge requires human maintainer approval — the agent can propose but not land changes autonomously.

The previous request_review policy was overly restrictive for this use case: the files the agent needs to edit (AGENTS.md, .github/instructions/**) overlap with gh-aw's default protected-files list, causing silent fallback to issues instead of PRs, which defeated the workflow's purpose.

Correctness ✅

All three locations are updated consistently:

  • dreaming.agent.md (source of truth): adds protected-files: allowed
  • dreaming.agent.lock.yml config.json heredoc: protected_files_policy → allowed
  • dreaming.agent.lock.yml handler config env var: protected_files_policy → allowed

The frontmatter hash and heredoc EOF marker are updated as expected from the recompilation.

Comment Justification ✅

The added comment in the .md file clearly explains why the change is needed and what the remaining guardrails are. Good documentation.

No issues found. LGTM.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Expert Code Review (on open) for #14369 · 43.8 AIC · ⌖ 7.48 AIC · ⊞ 4.8K

@jankratochvilcz
jankratochvilcz merged commit 2390865 into main Jul 15, 2026
22 checks passed
@jankratochvilcz
jankratochvilcz deleted the dreaming-allow-protected-files branch July 15, 2026 12:42
jankratochvilcz added a commit that referenced this pull request Jul 15, 2026
…14371)

## Problem

PRs that touch only `.github/**` or `documentation/**` still run full
multi-minute builds on every `msbuild-pr` leg. For example, on #14369
(two `.github/workflows/*` files) the legs ran: Windows Full 12m,
Windows Core 9m46s, Linux Core 8m54s, Windows Full Release 6m42s — none
of which exercise anything real for a docs/workflow change.

## Root cause

The `onlyDocChanged` detection
(`azure-pipelines/check-documentation-only-change.yml`) already covers
`.github/` and works correctly — it set `onlyDocChanged=1` for #14369.
The problem is what `onlyDocChanged=1` did:

- `cibuild_bootstrapped_msbuild.sh`/`.ps1` still run **both build
stages** when `onlyDocChanged=1`; they only drop `--test` and bootstrap
creation.
- The `CI Build` steps on **Linux Core** and **macOS Core** had **no
`condition`** — the `eq(variables.onlyDocChanged, 0)` line beneath them
actually belonged to the *coverage* step — so they always did a full
build.
- Only **Linux Core Multithreaded Mode** was correctly gated with a
step-level condition.
- `msbuild-quarantine` hardcoded `-onlyDocChanged 0` and had no skip at
all.

## Fix

Gate every heavy build step on `condition: eq(variables.onlyDocChanged,
0)`, matching the one leg that already did this, and remove the
now-redundant `cibuild.cmd without test` fallback in the Windows Full
Release leg. Apply the same inline skip to the three
`msbuild-quarantine` legs.

This reuses the **existing inline `check-documentation-only-change.yml`
template** in each job — no new cross-job dependency, no added latency
for normal PRs, no hardcoded container definitions or Arcade-internal
edits. Doc/`.github`-only PRs now finish these legs in agent + checkout
time.

**Note:** the arcade `Source-Build (Managed)` leg (~4 min) is
intentionally left as-is. Gating it would require duplicating Arcade's
default source-build platform/container definition in this repo (a
drift/fragility risk), which isn't worth it for a ~4 min leg.

## Behavior for required checks

Jobs still run and report success; only their build/test steps are
skipped, so required status checks stay green quickly rather than being
left unreported.

---------

Co-authored-by: Copilot App <[email protected]>

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 1032d3f1 Deployed Jul 15, 2026 by jankratochvilcz via conclusion #463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants