Repository navigation
Commit 4667deb
authored
feat(learning): migrate retrospective to daily rolling-PR model + bump engine (#245)
## What
Migrate the engineer-bot **learning (retrospective)** flow from the
legacy per-PR model to the engine's current **daily cron +
adaptive-cursor** model, and bump the engine pin so the invocation
matches the engine it runs against. Three coupled changes:
| File | Change |
|---|---|
| `.github/actions/bot-prelude/action.yml` | Bump `engine-ref` default
`92b3857` → `654a31d0` (engine `main`, 61 commits). **SHA-only** — the
locked SDK/CLI (`0.2.102` / `2.1.61`) are unchanged at that SHA. |
| `.github/workflows/engineer-bot-learning.yml` | Rewrite trigger +
invocation (see below). |
| `.bot/config.yaml` | Close the loop + prune a dead key. |
## Why these are coupled
The modern `retrospective.py` (at the bump target) is invoked as a
**windowed multi-PR sweep** (`--window-hours` / `--since`, adaptive
cursor) that gathers each merged PR's diff and comments *itself*. This
repo's workflow was still the old shape: `pull_request: [closed]` gated
on `merged` + an `extract-learning` label, with a manual step that
hand-gathered a single PR's context into `pr_diff.txt` /
`review_comments.txt`. Bumping the engine without migrating the trigger
would leave a modern engine driven by a legacy trigger; migrating the
trigger without the bump would call flags the pinned engine doesn't
have. So they land together.
## Workflow changes
- **Trigger:** `pull_request: [closed]` → `schedule` (`17 7 * * *`,
off-peak/off-:00) + `workflow_dispatch` with string `since` /
`window-hours` recovery inputs (string, not number — a number-typed
dispatch input fails the whole run at startup when the workflow also
triggers on schedule).
- **Drop** the "Gather merged-PR context" step — obsolete; the engine
now gathers per-PR context over the window (`gather_pr_context`).
- **Invocation:** `retrospective --repo-dir "$GITHUB_WORKSPACE"
--window-hours "$WINDOW_HOURS"`, appending `--since` only when
non-empty.
- **Add `actions: read`** — Track B lists engineer-bot author runs +
downloads their logs via the App token; without this scope the step 403s
and fails the whole run.
- Fixed `concurrency.group` (no PR number on a scheduled run).
## Config changes
- **Close the loop:** add `author.knowledge_log:
.claude/knowledge/learning-log.md`, matching `retrospective.log_path`.
The retrospective *writes* that path; the author phase only *reads* it
back when the two agree — so fixes benefit from what's been learned. It
was previously half-open (learnings written, never read back).
- **Remove** the now-dead `retrospective.context_files` key (the
windowed sweep ignores it) and refresh the block comments.
## Validation
- Both YAML files parse; `author.knowledge_log` ==
`retrospective.log_path` (verified); no lingering
`github.event.pull_request.*` in active logic; trigger/inputs shape
matches the engine's own `engineer-bot-learning-cron.yml`.
- The `schedule` registers only once this lands on the default branch.
Before the first cron, the flow can be exercised via a manual
**workflow_dispatch** with a recent `since` — it should open/update the
rolling `ai/learning-pr-*` PR.
This pull request and its description were written by Isaac.
---------
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>1 parent 3ea1c3b commit 4667deb
3 files changed
Lines changed: 79 additions & 62 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
9 | 18 | | |
10 | 19 | | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
14 | | - | |
15 | | - | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
22 | | - | |
23 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
24 | 52 | | |
25 | 53 | | |
26 | 54 | | |
27 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
28 | 59 | | |
29 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
30 | 67 | | |
31 | 68 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 69 | | |
40 | 70 | | |
41 | 71 | | |
42 | 72 | | |
43 | 73 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 74 | | |
48 | 75 | | |
49 | 76 | | |
| |||
79 | 106 | | |
80 | 107 | | |
81 | 108 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 109 | + | |
| 110 | + | |
85 | 111 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 112 | + | |
105 | 113 | | |
106 | | - | |
| 114 | + | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
118 | 127 | | |
| 128 | + | |
| 129 | + | |
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
122 | 133 | | |
123 | 134 | | |
124 | 135 | | |
125 | | - | |
| 136 | + | |
126 | 137 | | |
| 138 | + | |
127 | 139 | | |
128 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
0 commit comments