Commit c7f3804
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 alias with a startup 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 1ad6048 commit c7f3804
55 files changed
Lines changed: 6751 additions & 600 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 | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
| |||
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
| 166 | + | |
| 167 | + | |
157 | 168 | | |
158 | 169 | | |
159 | 170 | | |
| |||
203 | 214 | | |
204 | 215 | | |
205 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
206 | 221 | | |
207 | 222 | | |
208 | 223 | | |
209 | 224 | | |
210 | | - | |
211 | 225 | | |
212 | 226 | | |
213 | 227 | | |
| |||
| 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 | | |
| |||
0 commit comments