|
| 1 | +# Evergreen Repo Policy |
| 2 | + |
| 3 | +Confirmed install-time decisions for `githubnext/tsessebe`. The deterministic |
| 4 | +readiness controller and the agentic orchestrator must both respect this file. |
| 5 | + |
| 6 | +## Merge Gates |
| 7 | + |
| 8 | +- Required checks: none are enforced by branch protection (`main` is not |
| 9 | + protected). The following CI checks are treated as configured merge gates: |
| 10 | + - `Test & Lint` |
| 11 | + - `Playground E2E (Playwright)` |
| 12 | + - `Build` |
| 13 | + - `Validate Python Examples` |
| 14 | +- Non-required checks treated as gates: the four checks above. |
| 15 | +- Not a gate: `OpenEvolve benchmark` — it runs only on `autoloop/*-evolve` PRs, |
| 16 | + reports `neutral` when there is no fitness, and is not a mergeability blocker. |
| 17 | +- Review requirements: none required (no branch protection, no required reviews). |
| 18 | +- CODEOWNERS requirements: none. |
| 19 | +- Unresolved thread policy: not a merge gate. Do not chase review threads. |
| 20 | +- Draft PR policy: do not mark drafts ready for review. Monitor only. |
| 21 | +- Required labels: `evergreen` opts a PR into the work loop. |
| 22 | +- Blocker labels: `evergreen-blocked`, `evergreen-human-needed`. |
| 23 | +- Deployment/environment gates: none. |
| 24 | +- Auto-merge behavior: GitHub auto-merge is ENABLED on the repository. Evergreen |
| 25 | + never merges directly, but by making the configured gates pass it can |
| 26 | + indirectly cause a PR with auto-merge armed to merge. This is accepted by the |
| 27 | + repository owner. |
| 28 | + |
| 29 | +## Readiness Controller |
| 30 | + |
| 31 | +- Ready label: `evergreen-ready`. |
| 32 | +- Controller owns ready label: yes. |
| 33 | +- Add ready label only when: all four configured gate checks report success for |
| 34 | + the current PR head SHA, there are no pending/failing checks, and the merge |
| 35 | + state is not dirty/conflicted. |
| 36 | +- Remove ready label when: the controller state is anything other than `ready` |
| 37 | + (new head SHA, pending, failing, missing check, conflict, out of scope). |
| 38 | +- Current-head SHA policy: readiness is evaluated only against the current PR |
| 39 | + head SHA. A new push invalidates prior readiness. |
| 40 | +- Pending check policy: `waiting` — do not repair pending or in-progress checks. |
| 41 | +- Missing/stale check policy: `needs_ci` — reactivate the latest `CI` run for the |
| 42 | + head SHA once (see CI/CD Activation). Never rerun green checks. |
| 43 | +- Branch freshness ready criterion: not required to be up to date with `main`; |
| 44 | + freshness is only enforced when the branch is conflicted (`DIRTY`/`UNKNOWN`). |
| 45 | +- Additional deterministic ready criteria: PR open, has `evergreen`, not |
| 46 | + `evergreen-exhausted`, allowed by the trust model. |
| 47 | + |
| 48 | +## Branch Updates |
| 49 | + |
| 50 | +- Base branch: `main`. |
| 51 | +- Freshness requirement: not a standalone gate; only merge `main` when the branch |
| 52 | + is behind and conflicted or CI requires a fresh merge. |
| 53 | +- Merge-main policy: allowed. Prefer ordinary merge commits from `main`. |
| 54 | +- Rebase or force-push policy: force-push is DISABLED. No rebasing history. |
| 55 | +- Fork PR behavior: do not merge `main` into or push to fork branches unless a |
| 56 | + trusted maintainer has approved the current head (see Trust Model). |
| 57 | + |
| 58 | +## Trust Model |
| 59 | + |
| 60 | +- Repository visibility: public. |
| 61 | +- Fork PR policy: fork PRs are accepted. |
| 62 | +- Are PR branch pushers trusted: not for fork PRs. |
| 63 | +- Default trust level: |
| 64 | + - Same-repo branches (e.g. `autoloop/*`, maintainer branches): `trusted-branch`. |
| 65 | + - Fork PRs: `metadata-only` until a trusted maintainer approves the current |
| 66 | + head SHA. |
| 67 | +- Current-head approval policy: for fork PRs, run PR code / push repairs only |
| 68 | + after a trusted maintainer approves via `workflow_dispatch` bound to the |
| 69 | + current head SHA. A new head SHA returns the PR to metadata-only monitoring. |
| 70 | +- Authorized `/evergreen` users: slash commands are not wired in v1. Trusted |
| 71 | + activation for fork PRs is via manual `workflow_dispatch`. |
| 72 | +- What invalidates approval: any new commit / head SHA change on the PR branch. |
| 73 | + |
| 74 | +## Event Fast Paths |
| 75 | + |
| 76 | +- `pull_request` activity types: `labeled`, `synchronize`, `reopened`, |
| 77 | + `ready_for_review`. |
| 78 | +- Default-branch `push` policy: `push` to `main` wakes the reconciliation loop |
| 79 | + because it can make labeled PRs stale or conflicted. |
| 80 | +- `workflow_run` policy: not wired in v1; the schedule + `synchronize` cover CI |
| 81 | + state changes. |
| 82 | +- Review event policy: not wired (reviews are not merge gates here). |
| 83 | +- Deployment event policy: not wired (no deployment gates). |
| 84 | +- Slash-command policy: not wired in v1. |
| 85 | +- Schedule interval: every 15 minutes (reconciliation and fork-PR fallback). |
| 86 | + |
| 87 | +## CI/CD Activation |
| 88 | + |
| 89 | +- Workflows/checks Evergreen may rerun: the `CI` workflow run for the current |
| 90 | + head SHA (via `gh run rerun --failed`, falling back to a full rerun). |
| 91 | +- Workflows/checks Evergreen may dispatch: none by name in v1; activation is |
| 92 | + rerun-based only. |
| 93 | +- Stale check policy: reactivate the latest `CI` run for the head SHA once per |
| 94 | + head; never rerun green checks; never re-trigger an already in-progress run. |
| 95 | +- Missing check policy: if no `CI` run exists for the head SHA, wait for the |
| 96 | + normal `pull_request`/schedule CI to start rather than forcing activation. |
| 97 | +- Empty commit policy: empty trigger commits are a last resort only, requested |
| 98 | + through safe outputs by the agent (never from preflight) and labeled |
| 99 | + `evergreen: trigger CI`; they do not count as semantic repair attempts. |
| 100 | +- Token policy: `GITHUB_TOKEN` for reads and control-plane label writes. |
| 101 | + `GH_AW_CI_TRIGGER_TOKEN` (existing PAT) is used by gh-aw for pushes so that PR |
| 102 | + branch pushes trigger CI (default-token pushes do not). |
| 103 | + |
| 104 | +## Repair Policy |
| 105 | + |
| 106 | +- Allowed edits: source, tests, playground, config, and workflow files needed to |
| 107 | + clear a configured gate. Keep changes small and targeted (one feature/fix per |
| 108 | + commit per repo convention). |
| 109 | +- Protected files: `README.md` and `.autoloop/programs/**` must not be modified |
| 110 | + unless explicitly requested. `.autoloop/**` and `memory/autoloop` branch state |
| 111 | + are Autoloop-owned. Issue #1 (program definition) must not be modified. |
| 112 | +- High-risk file policy: dependency manifests and lockfiles (`package.json`, |
| 113 | + `bun.lock`, `bunfig.toml`) may be edited only when the failing gate requires |
| 114 | + it; prefer deterministic tooling. |
| 115 | +- Deterministic commands (repo-native, run before agentic edits): |
| 116 | + - Install: `bun install` |
| 117 | + - Typecheck: `bun run typecheck` |
| 118 | + - Lint: `bun run lint` |
| 119 | + - Test: `bun test` |
| 120 | + - Cross-validation: `bun test ./tests/xval/` |
| 121 | + - E2E: `bun run test:e2e` |
| 122 | + - Golden snapshots: `python golden/generate.py` |
| 123 | + - Workflow compile: `gh aw compile` (and `apm compile` when APM sources change) |
| 124 | +- Generated file policy: recompile committed lockfiles/snapshots when their |
| 125 | + sources change. After editing any `.github/workflows/*.md` workflow, recompile |
| 126 | + and commit the generated `.lock.yml`. |
| 127 | +- Signed commit policy: signed commits are not required. Use the token's natural |
| 128 | + identity; add Evergreen context in the commit body. |
| 129 | + |
| 130 | +## Review Policy |
| 131 | + |
| 132 | +- Reviewer request policy: do not request or re-request reviewers. |
| 133 | +- Review thread policy: do not resolve threads. Comment only when a thread maps |
| 134 | + to a configured merge gate. |
| 135 | +- Human-needed cases: protected-file edits, credential/permission needs, fork-PR |
| 136 | + code execution before approval, and disallowed operations. |
| 137 | +- Comment style: terse. Comment only for meaningful work, blockers, human-needed |
| 138 | + decisions, or quota exhaustion. Do not comment on unchanged state. |
| 139 | + |
| 140 | +## Skills |
| 141 | + |
| 142 | +- Vendored generic skills: all files under |
| 143 | + `.github/workflows/shared/skills/`. |
| 144 | +- Existing repo skills to reuse: none dedicated to mergeability were found; |
| 145 | + respect `AGENTS.md`/`CLAUDE.md` conventions. |
| 146 | +- Conditional skills enabled: `playground-e2e-diagnoser` (Playwright E2E gate), |
| 147 | + `autoloop-coordinator` (Autoloop branches), `lint-policy-review`, |
| 148 | + `docs-release-gate-repair`, `dependency-gate-repair`, and other conditional |
| 149 | + skills when evidence identifies the matching gate. |
| 150 | +- Skills not to use: none disabled. |
| 151 | + |
| 152 | +## Quotas |
| 153 | + |
| 154 | +- Per-PR AIC/token/cost budget: 50000 AI credits per continuous application of |
| 155 | + the `evergreen` label. |
| 156 | +- Max runs: bounded by the per-PR budget; cheap deterministic monitoring should |
| 157 | + consume little or no quota. |
| 158 | +- Max repeated attempts per failure signature: do not retry the same failure |
| 159 | + signature indefinitely; record it in memory and stop. |
| 160 | +- Wall-clock limit: none beyond the per-PR budget and schedule cadence. |
| 161 | +- Exhaustion behavior: remove `evergreen`, add `evergreen-exhausted`, leave one |
| 162 | + terse comment. A human may reapply `evergreen` for a fresh quota. |
| 163 | + |
| 164 | +## Discovered Repo Context |
| 165 | + |
| 166 | +- Agent guidance: `AGENTS.md` and `CLAUDE.md` — Bun + strict TypeScript, zero |
| 167 | + core deps, 100% coverage, one feature per commit, never modify `README.md` or |
| 168 | + `.autoloop/programs/**`, recompile gh-aw/apm after workflow edits. |
| 169 | +- Existing workflow conventions: gh-aw workflows (`autoloop`, `goal`, |
| 170 | + `ci-doctor`, `agentics-maintenance`) use `engine: copilot` with |
| 171 | + `COPILOT_GITHUB_TOKEN`; `GH_AW_CI_TRIGGER_TOKEN` PAT is used for CI-triggering |
| 172 | + pushes. CI workflow name is `CI`. |
| 173 | +- Last 50 closed PR process scan: PRs merge without auto-merge requests or |
| 174 | + required reviews; many are Autoloop/goal automation PRs labeled |
| 175 | + `automation`/`autoloop`. No CODEOWNERS or required-review process observed. |
| 176 | +- Uncertainties: `main` has no branch protection, so gate enforcement relies on |
| 177 | + this policy's configured checks rather than platform-required checks. If branch |
| 178 | + protection is added later, sync `REQUIRED_CHECKS_JSON` in `evergreen.md`. |
0 commit comments