@xn-intenton-z2a/agentic-lib 7.4.21 → 7.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
+
# .github/workflows/agentic-lib-flow.yml
|
|
4
|
+
#
|
|
5
|
+
# Uber workflow: runs the full pipeline end-to-end.
|
|
6
|
+
# Pattern: update → init → (test + bot + N×workflow) × 4 → test + bot → verify mission-complete
|
|
7
|
+
# Each sub-workflow dispatches at HEAD of main at dispatch time (not at uber job start).
|
|
8
|
+
|
|
9
|
+
name: agentic-lib-flow
|
|
10
|
+
run-name: "agentic-lib-flow [${{ github.ref_name }}] ${{ inputs.mission-seed }} (${{ inputs.workflow-runs }} runs)"
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
inputs:
|
|
15
|
+
mode:
|
|
16
|
+
description: "Init mode (update/reseed/purge/skip)"
|
|
17
|
+
type: choice
|
|
18
|
+
required: false
|
|
19
|
+
default: "purge"
|
|
20
|
+
options:
|
|
21
|
+
- skip
|
|
22
|
+
- update
|
|
23
|
+
- reseed
|
|
24
|
+
- purge
|
|
25
|
+
mission-seed:
|
|
26
|
+
description: "Mission seed name (purge/reseed only)"
|
|
27
|
+
type: choice
|
|
28
|
+
required: false
|
|
29
|
+
default: "7-kyu-understand-fizz-buzz"
|
|
30
|
+
options:
|
|
31
|
+
- 8-kyu-remember-empty
|
|
32
|
+
- 8-kyu-remember-hello-world
|
|
33
|
+
- 7-kyu-understand-fizz-buzz
|
|
34
|
+
- 6-kyu-understand-hamming-distance
|
|
35
|
+
- 6-kyu-understand-roman-numerals
|
|
36
|
+
- 5-kyu-apply-ascii-face
|
|
37
|
+
- 5-kyu-apply-string-utils
|
|
38
|
+
- 4-kyu-apply-cron-engine
|
|
39
|
+
- 4-kyu-apply-dense-encoding
|
|
40
|
+
- 4-kyu-analyze-json-schema-diff
|
|
41
|
+
- 4-kyu-apply-owl-ontology
|
|
42
|
+
- 3-kyu-analyze-lunar-lander
|
|
43
|
+
- 3-kyu-evaluate-time-series-lab
|
|
44
|
+
- 2-kyu-create-markdown-compiler
|
|
45
|
+
- 2-kyu-create-plot-code-lib
|
|
46
|
+
- 1-kyu-create-ray-tracer
|
|
47
|
+
- 1-dan-create-c64-emulator
|
|
48
|
+
- 1-dan-create-planning-engine
|
|
49
|
+
- 2-dan-create-self-hosted
|
|
50
|
+
model:
|
|
51
|
+
description: "Copilot SDK model"
|
|
52
|
+
type: choice
|
|
53
|
+
required: false
|
|
54
|
+
default: ""
|
|
55
|
+
options:
|
|
56
|
+
- ""
|
|
57
|
+
- gpt-5-mini
|
|
58
|
+
- claude-sonnet-4
|
|
59
|
+
- gpt-4.1
|
|
60
|
+
profile:
|
|
61
|
+
description: "Tuning profile"
|
|
62
|
+
type: choice
|
|
63
|
+
required: false
|
|
64
|
+
default: ""
|
|
65
|
+
options:
|
|
66
|
+
- ""
|
|
67
|
+
- min
|
|
68
|
+
- recommended
|
|
69
|
+
- max
|
|
70
|
+
workflow-runs:
|
|
71
|
+
description: "Number of workflow iterations (1-16)"
|
|
72
|
+
type: choice
|
|
73
|
+
required: false
|
|
74
|
+
default: "4"
|
|
75
|
+
options:
|
|
76
|
+
- "1"
|
|
77
|
+
- "2"
|
|
78
|
+
- "4"
|
|
79
|
+
- "8"
|
|
80
|
+
- "12"
|
|
81
|
+
- "16"
|
|
82
|
+
schedule:
|
|
83
|
+
description: "Supervisor schedule after flow"
|
|
84
|
+
type: choice
|
|
85
|
+
required: false
|
|
86
|
+
default: "off"
|
|
87
|
+
options:
|
|
88
|
+
- "off"
|
|
89
|
+
- "weekly"
|
|
90
|
+
- "daily"
|
|
91
|
+
- "hourly"
|
|
92
|
+
|
|
93
|
+
permissions: write-all
|
|
94
|
+
|
|
95
|
+
jobs:
|
|
96
|
+
# ── Phase 0: Update agentic-lib package ────────────────────────────
|
|
97
|
+
update:
|
|
98
|
+
if: inputs.mode != 'skip'
|
|
99
|
+
uses: ./.github/workflows/agentic-lib-update.yml
|
|
100
|
+
secrets: inherit
|
|
101
|
+
|
|
102
|
+
# ── Phase 0b: Init (purge/reseed/update) ───────────────────────────
|
|
103
|
+
init:
|
|
104
|
+
needs: [update]
|
|
105
|
+
if: always() && inputs.mode != 'skip' && (needs.update.result == 'success' || needs.update.result == 'skipped')
|
|
106
|
+
uses: ./.github/workflows/agentic-lib-init.yml
|
|
107
|
+
with:
|
|
108
|
+
mode: ${{ inputs.mode }}
|
|
109
|
+
mission-seed: ${{ inputs.mission-seed }}
|
|
110
|
+
model: ${{ inputs.model }}
|
|
111
|
+
profile: ${{ inputs.profile }}
|
|
112
|
+
schedule: ${{ inputs.schedule }}
|
|
113
|
+
secrets: inherit
|
|
114
|
+
|
|
115
|
+
# ── Round 1: test + bot + up to 4 workflow runs ────────────────────
|
|
116
|
+
test-1:
|
|
117
|
+
needs: [init]
|
|
118
|
+
if: always() && (needs.init.result == 'success' || needs.init.result == 'skipped')
|
|
119
|
+
uses: ./.github/workflows/agentic-lib-test.yml
|
|
120
|
+
secrets: inherit
|
|
121
|
+
|
|
122
|
+
bot-1:
|
|
123
|
+
needs: [test-1]
|
|
124
|
+
if: always() && needs.test-1.result == 'success'
|
|
125
|
+
uses: ./.github/workflows/agentic-lib-bot.yml
|
|
126
|
+
secrets: inherit
|
|
127
|
+
|
|
128
|
+
workflow-1:
|
|
129
|
+
needs: [bot-1]
|
|
130
|
+
if: always() && needs.bot-1.result == 'success' && inputs.workflow-runs >= 1
|
|
131
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
132
|
+
secrets: inherit
|
|
133
|
+
|
|
134
|
+
workflow-2:
|
|
135
|
+
needs: [workflow-1]
|
|
136
|
+
if: always() && needs.workflow-1.result == 'success' && inputs.workflow-runs >= 2
|
|
137
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
138
|
+
secrets: inherit
|
|
139
|
+
|
|
140
|
+
workflow-3:
|
|
141
|
+
needs: [workflow-2]
|
|
142
|
+
if: always() && needs.workflow-2.result == 'success' && inputs.workflow-runs >= 3
|
|
143
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
144
|
+
secrets: inherit
|
|
145
|
+
|
|
146
|
+
workflow-4:
|
|
147
|
+
needs: [workflow-3]
|
|
148
|
+
if: always() && needs.workflow-3.result == 'success' && inputs.workflow-runs >= 4
|
|
149
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
150
|
+
secrets: inherit
|
|
151
|
+
|
|
152
|
+
# ── Round 2: test + bot + up to 4 more workflow runs ───────────────
|
|
153
|
+
test-2:
|
|
154
|
+
needs: [workflow-4]
|
|
155
|
+
if: always() && inputs.workflow-runs >= 5 && (needs.workflow-4.result == 'success' || needs.workflow-4.result == 'skipped')
|
|
156
|
+
uses: ./.github/workflows/agentic-lib-test.yml
|
|
157
|
+
secrets: inherit
|
|
158
|
+
|
|
159
|
+
bot-2:
|
|
160
|
+
needs: [test-2]
|
|
161
|
+
if: always() && needs.test-2.result == 'success'
|
|
162
|
+
uses: ./.github/workflows/agentic-lib-bot.yml
|
|
163
|
+
secrets: inherit
|
|
164
|
+
|
|
165
|
+
workflow-5:
|
|
166
|
+
needs: [bot-2]
|
|
167
|
+
if: always() && needs.bot-2.result == 'success' && inputs.workflow-runs >= 5
|
|
168
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
169
|
+
secrets: inherit
|
|
170
|
+
|
|
171
|
+
workflow-6:
|
|
172
|
+
needs: [workflow-5]
|
|
173
|
+
if: always() && needs.workflow-5.result == 'success' && inputs.workflow-runs >= 6
|
|
174
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
175
|
+
secrets: inherit
|
|
176
|
+
|
|
177
|
+
workflow-7:
|
|
178
|
+
needs: [workflow-6]
|
|
179
|
+
if: always() && needs.workflow-6.result == 'success' && inputs.workflow-runs >= 7
|
|
180
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
181
|
+
secrets: inherit
|
|
182
|
+
|
|
183
|
+
workflow-8:
|
|
184
|
+
needs: [workflow-7]
|
|
185
|
+
if: always() && needs.workflow-7.result == 'success' && inputs.workflow-runs >= 8
|
|
186
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
187
|
+
secrets: inherit
|
|
188
|
+
|
|
189
|
+
# ── Round 3: test + bot + up to 4 more workflow runs ───────────────
|
|
190
|
+
test-3:
|
|
191
|
+
needs: [workflow-8]
|
|
192
|
+
if: always() && inputs.workflow-runs >= 9 && (needs.workflow-8.result == 'success' || needs.workflow-8.result == 'skipped')
|
|
193
|
+
uses: ./.github/workflows/agentic-lib-test.yml
|
|
194
|
+
secrets: inherit
|
|
195
|
+
|
|
196
|
+
bot-3:
|
|
197
|
+
needs: [test-3]
|
|
198
|
+
if: always() && needs.test-3.result == 'success'
|
|
199
|
+
uses: ./.github/workflows/agentic-lib-bot.yml
|
|
200
|
+
secrets: inherit
|
|
201
|
+
|
|
202
|
+
workflow-9:
|
|
203
|
+
needs: [bot-3]
|
|
204
|
+
if: always() && needs.bot-3.result == 'success' && inputs.workflow-runs >= 9
|
|
205
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
206
|
+
secrets: inherit
|
|
207
|
+
|
|
208
|
+
workflow-10:
|
|
209
|
+
needs: [workflow-9]
|
|
210
|
+
if: always() && needs.workflow-9.result == 'success' && inputs.workflow-runs >= 10
|
|
211
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
212
|
+
secrets: inherit
|
|
213
|
+
|
|
214
|
+
workflow-11:
|
|
215
|
+
needs: [workflow-10]
|
|
216
|
+
if: always() && needs.workflow-10.result == 'success' && inputs.workflow-runs >= 11
|
|
217
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
218
|
+
secrets: inherit
|
|
219
|
+
|
|
220
|
+
workflow-12:
|
|
221
|
+
needs: [workflow-11]
|
|
222
|
+
if: always() && needs.workflow-11.result == 'success' && inputs.workflow-runs >= 12
|
|
223
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
224
|
+
secrets: inherit
|
|
225
|
+
|
|
226
|
+
# ── Round 4: test + bot + up to 4 more workflow runs ───────────────
|
|
227
|
+
test-4:
|
|
228
|
+
needs: [workflow-12]
|
|
229
|
+
if: always() && inputs.workflow-runs >= 13 && (needs.workflow-12.result == 'success' || needs.workflow-12.result == 'skipped')
|
|
230
|
+
uses: ./.github/workflows/agentic-lib-test.yml
|
|
231
|
+
secrets: inherit
|
|
232
|
+
|
|
233
|
+
bot-4:
|
|
234
|
+
needs: [test-4]
|
|
235
|
+
if: always() && needs.test-4.result == 'success'
|
|
236
|
+
uses: ./.github/workflows/agentic-lib-bot.yml
|
|
237
|
+
secrets: inherit
|
|
238
|
+
|
|
239
|
+
workflow-13:
|
|
240
|
+
needs: [bot-4]
|
|
241
|
+
if: always() && needs.bot-4.result == 'success' && inputs.workflow-runs >= 13
|
|
242
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
243
|
+
secrets: inherit
|
|
244
|
+
|
|
245
|
+
workflow-14:
|
|
246
|
+
needs: [workflow-13]
|
|
247
|
+
if: always() && needs.workflow-13.result == 'success' && inputs.workflow-runs >= 14
|
|
248
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
249
|
+
secrets: inherit
|
|
250
|
+
|
|
251
|
+
workflow-15:
|
|
252
|
+
needs: [workflow-14]
|
|
253
|
+
if: always() && needs.workflow-14.result == 'success' && inputs.workflow-runs >= 15
|
|
254
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
255
|
+
secrets: inherit
|
|
256
|
+
|
|
257
|
+
workflow-16:
|
|
258
|
+
needs: [workflow-15]
|
|
259
|
+
if: always() && needs.workflow-15.result == 'success' && inputs.workflow-runs >= 16
|
|
260
|
+
uses: ./.github/workflows/agentic-lib-workflow.yml
|
|
261
|
+
secrets: inherit
|
|
262
|
+
|
|
263
|
+
# ── Final: test + bot ──────────────────────────────────────────────
|
|
264
|
+
test-final:
|
|
265
|
+
needs: [workflow-4, workflow-8, workflow-12, workflow-16]
|
|
266
|
+
if: always()
|
|
267
|
+
uses: ./.github/workflows/agentic-lib-test.yml
|
|
268
|
+
secrets: inherit
|
|
269
|
+
|
|
270
|
+
bot-final:
|
|
271
|
+
needs: [test-final]
|
|
272
|
+
if: always() && needs.test-final.result == 'success'
|
|
273
|
+
uses: ./.github/workflows/agentic-lib-bot.yml
|
|
274
|
+
secrets: inherit
|
|
275
|
+
|
|
276
|
+
# ── Verify: MISSION_COMPLETE.md must exist ─────────────────────────
|
|
277
|
+
verify-mission-complete:
|
|
278
|
+
needs: [bot-final]
|
|
279
|
+
if: always()
|
|
280
|
+
runs-on: ubuntu-latest
|
|
281
|
+
steps:
|
|
282
|
+
- uses: actions/checkout@v6
|
|
283
|
+
with:
|
|
284
|
+
ref: main
|
|
285
|
+
fetch-depth: 1
|
|
286
|
+
- name: Check MISSION_COMPLETE.md
|
|
287
|
+
id: check
|
|
288
|
+
run: |
|
|
289
|
+
if [ -f MISSION_COMPLETE.md ]; then
|
|
290
|
+
echo "✅ Mission complete!"
|
|
291
|
+
cat MISSION_COMPLETE.md
|
|
292
|
+
echo "mission_complete=true" >> "$GITHUB_OUTPUT"
|
|
293
|
+
else
|
|
294
|
+
echo "❌ MISSION_COMPLETE.md not found after ${{ inputs.workflow-runs }} workflow runs"
|
|
295
|
+
echo "mission_complete=false" >> "$GITHUB_OUTPUT"
|
|
296
|
+
fi
|
|
297
|
+
|
|
298
|
+
# ── Generate benchmark report ──────────────────────────────────────
|
|
299
|
+
generate-report:
|
|
300
|
+
needs: [verify-mission-complete]
|
|
301
|
+
if: always()
|
|
302
|
+
runs-on: ubuntu-latest
|
|
303
|
+
steps:
|
|
304
|
+
- uses: actions/checkout@v6
|
|
305
|
+
with:
|
|
306
|
+
ref: main
|
|
307
|
+
fetch-depth: 1
|
|
308
|
+
|
|
309
|
+
- name: Fetch state and logs from logs branch
|
|
310
|
+
run: |
|
|
311
|
+
git fetch origin agentic-lib-logs --depth=1 2>/dev/null || true
|
|
312
|
+
git show origin/agentic-lib-logs:agentic-lib-state.toml > /tmp/state.toml 2>/dev/null || echo "# no state" > /tmp/state.toml
|
|
313
|
+
# List agent log files
|
|
314
|
+
git ls-tree origin/agentic-lib-logs --name-only 2>/dev/null | grep '^agent-log-' | sort > /tmp/log-files.txt || true
|
|
315
|
+
|
|
316
|
+
- name: Read source and mission
|
|
317
|
+
run: |
|
|
318
|
+
wc -l src/lib/main.js 2>/dev/null | awk '{print $1}' > /tmp/source-lines.txt || echo "0" > /tmp/source-lines.txt
|
|
319
|
+
cat MISSION.md > /tmp/mission.txt 2>/dev/null || echo "No MISSION.md" > /tmp/mission.txt
|
|
320
|
+
ls tests/unit/*.test.js 2>/dev/null | wc -l > /tmp/test-files.txt || echo "0" > /tmp/test-files.txt
|
|
321
|
+
|
|
322
|
+
- name: Generate report
|
|
323
|
+
run: |
|
|
324
|
+
REPORT_NUM=$(printf "%03d" $(( $(ls BENCHMARK_REPORT_*.md 2>/dev/null | wc -l) + 1 )))
|
|
325
|
+
MISSION_SEED="${{ inputs.mission-seed }}"
|
|
326
|
+
MODEL="${{ inputs.model || 'default' }}"
|
|
327
|
+
PROFILE="${{ inputs.profile || 'default' }}"
|
|
328
|
+
WORKFLOW_RUNS="${{ inputs.workflow-runs }}"
|
|
329
|
+
SOURCE_LINES=$(cat /tmp/source-lines.txt)
|
|
330
|
+
TEST_FILES=$(cat /tmp/test-files.txt)
|
|
331
|
+
MISSION_COMPLETE="NO"
|
|
332
|
+
if [ -f MISSION_COMPLETE.md ]; then MISSION_COMPLETE="YES"; fi
|
|
333
|
+
|
|
334
|
+
cat > "BENCHMARK_REPORT_FLOW_${REPORT_NUM}.md" << REPORT_EOF
|
|
335
|
+
# Flow Benchmark Report ${REPORT_NUM}
|
|
336
|
+
|
|
337
|
+
**Date**: $(date -u +%Y-%m-%d)
|
|
338
|
+
**Operator**: agentic-lib-flow (automated)
|
|
339
|
+
**agentic-lib version**: $(node -e "console.log(require('./package.json').version)" 2>/dev/null || echo "unknown")
|
|
340
|
+
**Run**: [${GITHUB_RUN_ID}](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Configuration
|
|
345
|
+
|
|
346
|
+
| Parameter | Value |
|
|
347
|
+
|-----------|-------|
|
|
348
|
+
| Mission seed | ${MISSION_SEED} |
|
|
349
|
+
| Model | ${MODEL} |
|
|
350
|
+
| Profile | ${PROFILE} |
|
|
351
|
+
| Workflow runs | ${WORKFLOW_RUNS} |
|
|
352
|
+
| Init mode | ${{ inputs.mode }} |
|
|
353
|
+
|
|
354
|
+
## State File
|
|
355
|
+
|
|
356
|
+
\`\`\`toml
|
|
357
|
+
$(cat /tmp/state.toml)
|
|
358
|
+
\`\`\`
|
|
359
|
+
|
|
360
|
+
## Results
|
|
361
|
+
|
|
362
|
+
| Metric | Value |
|
|
363
|
+
|--------|-------|
|
|
364
|
+
| Mission complete | ${MISSION_COMPLETE} |
|
|
365
|
+
| Source lines | ${SOURCE_LINES} |
|
|
366
|
+
| Test files | ${TEST_FILES} |
|
|
367
|
+
| Agent log files | $(wc -l < /tmp/log-files.txt) |
|
|
368
|
+
|
|
369
|
+
## Mission
|
|
370
|
+
|
|
371
|
+
\`\`\`
|
|
372
|
+
$(head -20 /tmp/mission.txt)
|
|
373
|
+
\`\`\`
|
|
374
|
+
|
|
375
|
+
## Agent Log Files
|
|
376
|
+
|
|
377
|
+
$(cat /tmp/log-files.txt | while read f; do echo "- ${f}"; done)
|
|
378
|
+
REPORT_EOF
|
|
379
|
+
|
|
380
|
+
echo "Generated BENCHMARK_REPORT_FLOW_${REPORT_NUM}.md"
|
|
381
|
+
cat "BENCHMARK_REPORT_FLOW_${REPORT_NUM}.md"
|
|
382
|
+
|
|
383
|
+
- name: Commit report
|
|
384
|
+
run: |
|
|
385
|
+
git config user.name "github-actions[bot]"
|
|
386
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
387
|
+
git add BENCHMARK_REPORT_FLOW_*.md
|
|
388
|
+
git diff --staged --quiet && echo "No report to commit" && exit 0
|
|
389
|
+
git commit -m "flow: benchmark report for ${{ inputs.mission-seed }} (${{ inputs.workflow-runs }} runs) [skip ci]"
|
|
390
|
+
git push origin main || echo "Push failed — report saved as artifact"
|
|
391
|
+
|
|
392
|
+
- name: Upload report artifact
|
|
393
|
+
uses: actions/upload-artifact@v4
|
|
394
|
+
with:
|
|
395
|
+
name: benchmark-report
|
|
396
|
+
path: BENCHMARK_REPORT_FLOW_*.md
|
package/package.json
CHANGED