Skip to content

[docs] docs: unbloat checkout reference (-29% words) - #77595

Merged
pelikhan merged 1 commit into
mainfrom
docs/unbloat-checkout-037fd17382b2309e
Nov 14, 2026
Merged

pelikhan merged 1 commit into
mainfrom
docs/unbloat-checkout-037fd17382b2309e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Removes documentation bloat from docs/src/content/docs/reference/checkout.md. All frontmatter, examples, warnings, and heading anchors are kept, so inbound links still resolve.

Metric Before After Change
Words 6,704 4,747 -29%
Lines 592 454 -23%
Bullet items 34 32 -2

Changes

  • Condensed long policy prose in PR Revision Binding, Runtime Repository Lists, Git Credentials After Checkout, PR Head Checkout and Branch Deletion, and the pull_request_target policy section. Each caveat now appears once.
  • Shortened object-pack recovery: the budget derivation formulas and compiler-side debug namespaces were removed. The env-var table, defaults, and fail-closed rules remain, and the formulas are linked to the safe-outputs specification, which already documents them.
  • Trimmed Configuration Options descriptions to the essential constraints.
  • Tightened introductory and ordering prose, with no change to documented behavior.
Verification
  • Every heading anchor used by other docs (#pull_request_target-checkout, #target-only-checkout-permissionscontents-none, #repository-configured-recovery-limits, #git-credentials-after-checkout, #checkout-and-host-step-order, #explicit-trusted-checkout-policy, #configuration-options) is unchanged.
  • Only checkout.md is modified. Prettier is not installed in this sandbox, so formatting was not checked with it.
  • The steering issue ([WIP] Documentation Unbloat: work in progress #77593) had no steer comments.

References: none (no workflow run links apply)

🗜️ Compressed by Documentation Unbloat · pi · routed: haiku55 high · ~4 AIC · ⌖ ~2 AIC · ⊞ 5.7K · ◷
Comment /unbloat to run again

  • expires on Nov 15, 2026, 4:48 PM UTC-08:00

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.

🟡 Changes recommended

The reference edits omit multiple security, authorization, fail-closed, and derivation details needed to prevent invalid configurations and unsafe interpretations.

7 open issues
What changed in this PR

This PR condenses the checkout reference documentation while preserving its configuration examples, frontmatter, and heading anchors.

Changes:

  • Shortens introductory, policy, credential, repository-list, and checkout guidance.
  • Simplifies configuration-option descriptions and runtime repository documentation.
  • Condenses object-pack recovery documentation and links related details to the safe-outputs specification.
File Description
docs/​src/​content/​docs/​reference/​checkout.md Condensed the checkout reference documentation covering configuration, repository lists, credentials, PR checkout, recovery, and trusted target policies.

Review effort: Lite (dynamic)

| `multi` | boolean | Enables runtime repository-list expansion and its restrictions. Defaults to `false`; literal boolean only. |
| `allowed-repos` | string \| string[] | Mandatory allowlist for `multi: true`. Does not enable multi mode by itself. Supports scoped patterns such as `owner/*` and `*/repo`, but not `"*"` or `"*/*"`. Ignored in single-repository mode. |
| `max-repos` | integer | Maximum unique repositories per `multi: true` entry. Requires `allowed-repos` in multi mode; defaults to `10`. Must be a positive literal integer. |
| `allow-private-repos` | boolean | With `multi: true`, allow private/internal targets when the list is hosted by a private/internal repository. Defaults to `false`. Public hosts always reject non-public targets. |
For a central workflow repository that edits an external repository, combine `repository`, `path`, `current: true`, and checkout-scoped `github-app` authentication. The workflow repository can stay checked out for tooling. Use `permissions.contents: none` only to suppress its default checkout. Checkout credentials and safe-output publication credentials are configured separately.

When a checkout path contains an expression, credential setup resolves the evaluated directories at runtime. The last checkout targeting the workspace root determines its expected identity, including when an expression evaluates to `.` or an equivalent root path. Earlier root checkouts are not re-authenticated with their superseded identities. Expressions remain environment data, and a directory-resolution failure stops credential setup.
Credential setup verifies the expected checkout identity through `GH_AW_GIT_REPOSITORY`. It checks effective fetch and push URLs before and after authentication, rejects plaintext HTTP and empty identities, and fails on a mismatch rather than retargeting the checkout. If post-authentication verification fails, it restores the original remote. Workspaces without a checkout or `origin` remote skip setup. For path expressions, the last checkout targeting the workspace root determines the identity.

### Safe-Output Patches and Object-Pack Recovery

Safe-output patch and bundle generation is local-only. It never fetches refs or objects from the agent-writable checkout, and it disables all Git transports, hooks, and signing during generation. Prepare required refs with `checkout.fetch` and enough history with `checkout.fetch-depth` before agent execution. Partial clones must also have the required blobs locally. Incremental updates need the pre-agent PR-head baseline recorded by the PR checkout step, or an existing `origin/<branch>` tracking ref. Missing baselines are reported rather than replaced with a broader diff.

When local generation cannot resolve required refs or objects, non-staged PR outputs can return `result: "queued"` with `recovery: "object-pack"`. This is not publication success. The agent packages available local objects without fetching. The trusted safe-outputs job then fetches the authorized baseline into a new isolated bare repository, validates the objects, and regenerates the patch and bundle under the usual file, size, and publication policies. Agent repository configuration, remotes, hooks, and alternates are never copied.

Recovery selects only objects reachable from the pinned tip, excluding anything reachable from local baseline hints. Hints reduce transfer size but never authorize a publisher baseline or a remote request. The default limits (100,000 objects and 64 MiB uncompressed) apply to the selected objects, not the whole repository. Recovery rejects redacted or mismatched previews. Incremental recovery requires the triggering PR's exact pre-agent head SHA; an uploaded baseline or newer remote head cannot replace it.

Recovery selects only objects reachable from the pinned tip, excluding anything reachable from local baseline hints. Hints reduce transfer size but never authorize a publisher baseline or a remote request. The default limits (100,000 objects and 64 MiB uncompressed) apply to the selected objects, not the whole repository. Recovery rejects redacted or mismatched previews. Incremental recovery requires the triggering PR's exact pre-agent head SHA; an uploaded baseline or newer remote head cannot replace it.

Recovery needs checkout provisioning when the event has no trusted baseline, when outputs are staged, when the selected change is large, when recovery budgets are exhausted, or when agent-created content is missing. Fallback issues keep the original uploads immutable. Their recovery commands require a clean, complete clone, and object-pack envelopes cannot be applied directly with `git fetch` or `git am`.
| `GH_AW_OBJECT_PACK_TIMEOUT_MS` | `60000` | Each command timeout; the shared network deadline is three times this value |
| `GH_AW_OBJECT_PACK_FETCH_DEPTHS` | `1,16,64,256,1024,4096,16384,65536` | Strictly increasing list of history search depths |

Budgets scale from the defaults. Derivation formulas are in the [safe-outputs specification](/gh-aw/specs/safe-outputs-specification/). For example, `gh variable set GH_AW_OBJECT_PACK_MAX_BYTES --body 134217728` raises the byte budget to 128 MiB. Larger budgets increase runner memory, CPU, and network use. No setting relaxes repository authorization, preview validation, or the rule that all fetching finishes before agent objects are imported.
Each `allowed-checkouts` entry requires a literal `owner/repository` and a non-empty literal branch, tag, or commit SHA. Matching is exact and case-sensitive, and repository and ref pairs cannot be combined across entries. Expressions, wildcards, and `refs/pull/...` refs are rejected. Do not set `checkout.fetch` on these checkouts, because follow-up fetches can add refs beyond the trusted checkout. Wiki checkouts are not covered.

`on.pull_request_target.acknowledge-risk` defaults to `false`. Setting it to `true` suppresses **only** the strict-mode dangerous-trigger warning, including for `checkout: false` or a supported base checkout. It neither allows other checkouts nor bypasses [fork-pattern validation](/gh-aw/reference/triggers/#fork-filtering-forks), actor authorization, the unrestricted-forks warning, other strict validation, or safe-update checks. An allowlist without acknowledgment still emits the trigger warning.
`acknowledge-risk` defaults to `false`. Setting it to `true` suppresses **only** the strict-mode dangerous-trigger warning. It does not allow other checkouts or bypass fork-pattern validation, actor authorization, or other strict checks.
@pelikhan
pelikhan marked this pull request as ready for review November 14, 2026 14:07
@pelikhan
pelikhan merged commit 54b4c1e into main Nov 14, 2026
5 checks passed
@pelikhan
pelikhan deleted the docs/unbloat-checkout-037fd17382b2309e branch November 14, 2026 14:07
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation doc-unbloat documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants