Commit 7edc5cd
feat(repo-config): add per-repo .github-app.yaml control surface
Promotes the scheduler-only config reader into a first-class per-repo control
surface under `src/repo-config/`, and adds the two gates that consume it.
- Move `src/scheduler/config-schema.ts` + `config-fetcher.ts` to
`src/repo-config/{schema,fetcher}.ts` and widen the document schema beyond
scheduled actions. The fetcher now returns a discriminated
`ok` / `absent` / `invalid` result instead of a nullable value.
- Add `src/repo-config/effective.ts` to merge `workflows.<name>` over
`defaults` and clamp the result against the server env ceilings, failing
open to `DEFAULT_REPO_POLICY`.
- Add `src/repo-config/gate.ts` (Gate 1): a narrowing-only pre-dispatch check.
Every rule can refuse, none can permit, so no YAML value can readmit a repo
the `ALLOWED_OWNERS` env allowlist rejected.
- Add `src/repo-config/pr-check.ts`, the one module that reads a head-ref
copy. It is read-only by construction and imports neither `fetchRepoConfig`
nor `loadRepoPolicy`, so a head-ref read can never populate the fetcher
caches or reach the applied policy.
- Add `src/core/agent-policy.ts` (Gate 2) and apply the resolved knobs in the
pipeline and prompt builder.
- Rename `SCHEDULER_CONFIG_FILE` to `REPO_CONFIG_FILE`, keeping the old name
as a deprecated fallback with a one-shot boot warning.
- Generate `schema/github-app.schema.json` from the zod schema and gate it in
CI via `check:config-schema`, so the `$schema` modeline authors consume
cannot advertise a surface the runtime rejects.
Only the default branch's copy is ever applied: `fetchRepoConfig` calls
`getContent` with no `ref`, so a config edit inside a pull request is inert
for that pull request.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KUPpJPtxAaHWrBsjytRGyM1 parent 2790486 commit 7edc5cd
51 files changed
Lines changed: 5890 additions & 428 deletions
File tree
- .github/workflows
- docs
- build
- operate
- use
- schema
- scripts
- src
- core
- orchestrator
- repo-config
- scheduler
- test
- core
- repo-config
- scheduler
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
135 | 142 | | |
136 | 143 | | |
137 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | | - | |
| 221 | + | |
221 | 222 | | |
222 | | - | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
0 commit comments