@xn-intenton-z2a/agentic-lib 7.1.60 → 7.1.62

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.
@@ -11,9 +11,9 @@
11
11
 
12
12
  name: agentic-lib-bot
13
13
  run-name: "agentic-lib-bot [${{ github.ref_name }}]"
14
- #concurrency:
15
- # group: agentic-lib-bot-${{ github.event.discussion.node_id || github.run_id }}
16
- # cancel-in-progress: false
14
+ #@dist concurrency:
15
+ #@dist group: agentic-lib-bot-${{ github.event.discussion.node_id || github.run_id }}
16
+ #@dist cancel-in-progress: false
17
17
 
18
18
  on:
19
19
  #@dist discussion:
@@ -86,12 +86,15 @@ jobs:
86
86
  respond:
87
87
  needs: params
88
88
  runs-on: ubuntu-latest
89
+ outputs:
90
+ action: ${{ steps.respond.outputs.action }}
91
+ action-arg: ${{ steps.respond.outputs.action-arg }}
89
92
  steps:
90
- - uses: actions/checkout@v4
93
+ - uses: actions/checkout@v6
91
94
  with:
92
95
  fetch-depth: 0
93
96
 
94
- - uses: actions/setup-node@v4
97
+ - uses: actions/setup-node@v6
95
98
  with:
96
99
  node-version: "24"
97
100
 
@@ -103,9 +106,32 @@ jobs:
103
106
  working-directory: .github/agentic-lib/actions/agentic-step
104
107
  run: npm ci
105
108
 
109
+ - name: Read test command from config
110
+ id: config
111
+ shell: bash
112
+ run: |
113
+ if [ -f agentic-lib.toml ]; then
114
+ TEST_CMD=$(grep '^\s*test\s*=' agentic-lib.toml | head -1 | sed 's/.*=\s*"\([^"]*\)".*/\1/')
115
+ fi
116
+ echo "test-command=${TEST_CMD:-npm ci && npm test}" >> $GITHUB_OUTPUT
117
+
118
+ - name: Run tests before responding
119
+ id: tests
120
+ shell: bash
121
+ run: |
122
+ set +e
123
+ ${{ steps.config.outputs.test-command }}
124
+ EXIT_CODE=$?
125
+ set -e
126
+ if [ $EXIT_CODE -eq 0 ]; then
127
+ echo "result=pass" >> $GITHUB_OUTPUT
128
+ else
129
+ echo "result=fail" >> $GITHUB_OUTPUT
130
+ fi
131
+
106
132
  - name: Get discussion URL
107
133
  id: discussion-url
108
- uses: actions/github-script@v7
134
+ uses: actions/github-script@v8
109
135
  with:
110
136
  script: |
111
137
  let url = '${{ inputs.discussion-url }}' || '';
@@ -114,15 +140,42 @@ jobs:
114
140
  }
115
141
  core.setOutput('url', url);
116
142
 
143
+ - name: Skip if comment is from bot
144
+ id: guard
145
+ shell: bash
146
+ run: |
147
+ COMMENT_USER='${{ github.event.comment.user.login }}'
148
+ if [ "$COMMENT_USER" = "github-actions[bot]" ] || [ "$COMMENT_USER" = "github-actions" ]; then
149
+ echo "Bot comment detected — skipping to avoid self-reply loop"
150
+ echo "skip=true" >> $GITHUB_OUTPUT
151
+ fi
152
+
117
153
  - name: Respond to discussion
118
- if: steps.discussion-url.outputs.url != ''
154
+ id: respond
155
+ if: steps.discussion-url.outputs.url != '' && steps.guard.outputs.skip != 'true'
119
156
  uses: ./.github/agentic-lib/actions/agentic-step
120
157
  env:
121
158
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122
159
  COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
160
+ TEST_RESULT: ${{ steps.tests.outputs.result }}
123
161
  with:
124
162
  task: "discussions"
125
163
  config: ${{ env.configPath }}
126
164
  instructions: ".github/agentic-lib/agents/agent-discussion-bot.md"
127
165
  discussion-url: ${{ steps.discussion-url.outputs.url }}
128
166
  model: ${{ needs.params.outputs.model }}
167
+
168
+ dispatch-supervisor:
169
+ needs: [params, respond]
170
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.respond.outputs.action == 'request-supervisor'
171
+ runs-on: ubuntu-latest
172
+ steps:
173
+ - name: Dispatch supervisor workflow
174
+ env:
175
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176
+ run: |
177
+ gh workflow run agentic-lib-workflow.yml \
178
+ --repo "${{ github.repository }}" \
179
+ -f mode=full \
180
+ -f model="${{ needs.params.outputs.model }}" \
181
+ -f message="${{ needs.respond.outputs.action-arg }}"
@@ -141,20 +141,20 @@ jobs:
141
141
  INIT_MISSION_SEED: ${{ needs.params.outputs.mission-seed }}
142
142
  INIT_MISSION_TEXT: ${{ needs.params.outputs.mission-text }}
143
143
  steps:
144
- - uses: actions/checkout@v4
144
+ - uses: actions/checkout@v6
145
145
  if: needs.params.outputs.dry-run == 'true'
146
- - uses: actions/checkout@v4
146
+ - uses: actions/checkout@v6
147
147
  if: needs.params.outputs.dry-run != 'true'
148
148
  with:
149
149
  ref: main
150
150
  token: ${{ secrets.WORKFLOW_TOKEN }}
151
151
 
152
- - uses: actions/setup-node@v4
152
+ - uses: actions/setup-node@v6
153
153
  with:
154
154
  node-version: "24"
155
155
 
156
156
  - name: Close hanging init PRs
157
- if: env.INIT_MODE == 'purge' && needs.params.outputs.dry-run != 'true'
157
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && env.INIT_MODE == 'purge' && needs.params.outputs.dry-run != 'true'
158
158
  env:
159
159
  GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
160
160
  run: |
@@ -203,8 +203,8 @@ jobs:
203
203
  - run: npm test
204
204
 
205
205
  - name: Update schedule (if requested)
206
- if: needs.params.outputs.schedule != '' && needs.params.outputs.dry-run != 'true'
207
- uses: actions/github-script@v7
206
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.schedule != '' && needs.params.outputs.dry-run != 'true'
207
+ uses: actions/github-script@v8
208
208
  with:
209
209
  script: |
210
210
  const fs = require('fs');
@@ -255,7 +255,7 @@ jobs:
255
255
  }
256
256
 
257
257
  - name: Commit and push to main [skip ci]
258
- if: needs.params.outputs.dry-run != 'true'
258
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
259
259
  env:
260
260
  GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
261
261
  run: |
@@ -61,16 +61,16 @@ jobs:
61
61
  update-schedule:
62
62
  runs-on: ubuntu-latest
63
63
  steps:
64
- - uses: actions/checkout@v4
64
+ - uses: actions/checkout@v6
65
65
  if: inputs.dry-run == 'true' || inputs.dry-run == true
66
- - uses: actions/checkout@v4
66
+ - uses: actions/checkout@v6
67
67
  if: inputs.dry-run != 'true' && inputs.dry-run != true
68
68
  with:
69
69
  ref: main
70
70
  token: ${{ secrets.WORKFLOW_TOKEN }}
71
71
 
72
72
  - name: Update workflow schedule and model
73
- uses: actions/github-script@v7
73
+ uses: actions/github-script@v8
74
74
  with:
75
75
  script: |
76
76
  const fs = require('fs');
@@ -146,7 +146,7 @@ jobs:
146
146
  }
147
147
 
148
148
  - name: Commit and push
149
- if: inputs.dry-run != 'true' && inputs.dry-run != true
149
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && inputs.dry-run != 'true' && inputs.dry-run != true
150
150
  env:
151
151
  GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
152
152
  run: |
@@ -23,17 +23,25 @@ jobs:
23
23
  test:
24
24
  runs-on: ubuntu-latest
25
25
  steps:
26
- - uses: actions/checkout@v4
26
+ - uses: actions/checkout@v6
27
27
 
28
- - uses: actions/setup-node@v4
28
+ - uses: actions/setup-node@v6
29
29
  with:
30
30
  node-version: 24
31
31
  cache: "npm"
32
32
 
33
- - run: npm ci
33
+ - name: Read test command from config
34
+ id: config
35
+ shell: bash
36
+ run: |
37
+ if [ -f agentic-lib.toml ]; then
38
+ TEST_CMD=$(grep '^\s*test\s*=' agentic-lib.toml | head -1 | sed 's/.*=\s*"\([^"]*\)".*/\1/')
39
+ fi
40
+ echo "test-command=${TEST_CMD:-npm ci && npm test}" >> $GITHUB_OUTPUT
34
41
 
35
42
  - name: Install sub-project dependencies (agentic-lib dev only)
36
43
  if: hashFiles('src/actions/agentic-step/package.json') != ''
37
44
  run: cd src/actions/agentic-step && npm ci
38
45
 
39
- - run: npm test
46
+ - name: Run tests
47
+ run: ${{ steps.config.outputs.test-command }}
@@ -125,7 +125,14 @@ jobs:
125
125
  PR='${{ inputs.pr-number }}'
126
126
  echo "pr-number=${PR}" >> $GITHUB_OUTPUT
127
127
  DRY_RUN='${{ inputs.dry-run }}'
128
- echo "dry-run=${DRY_RUN:-true}" >> $GITHUB_OUTPUT
128
+ # Schedule triggers have no inputs, so DRY_RUN is empty.
129
+ # Default to false for schedule events (they should run live).
130
+ if [ "${{ github.event_name }}" = "schedule" ]; then
131
+ DRY_RUN="${DRY_RUN:-false}"
132
+ else
133
+ DRY_RUN="${DRY_RUN:-true}"
134
+ fi
135
+ echo "dry-run=${DRY_RUN}" >> $GITHUB_OUTPUT
129
136
  CONFIG='${{ inputs.config-path }}'
130
137
  echo "config-path=${CONFIG:-${{ env.configPath }}}" >> $GITHUB_OUTPUT
131
138
  outputs:
@@ -142,12 +149,12 @@ jobs:
142
149
  pr-cleanup:
143
150
  needs: params
144
151
  if: |
145
- needs.params.outputs.dry-run != 'true' &&
146
- (needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'pr-cleanup-only')
152
+ needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'pr-cleanup-only'
147
153
  runs-on: ubuntu-latest
148
154
  steps:
149
155
  - name: PR cleanup
150
- uses: actions/github-script@v7
156
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
157
+ uses: actions/github-script@v8
151
158
  with:
152
159
  script: |
153
160
  const owner = context.repo.owner;
@@ -214,14 +221,13 @@ jobs:
214
221
  telemetry:
215
222
  needs: params
216
223
  if: |
217
- needs.params.outputs.dry-run != 'true' &&
218
- (needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'dev-only' || needs.params.outputs.mode == 'review-only')
224
+ needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'dev-only' || needs.params.outputs.mode == 'review-only'
219
225
  runs-on: ubuntu-latest
220
226
  steps:
221
- - uses: actions/checkout@v4
227
+ - uses: actions/checkout@v6
222
228
  - name: Gather telemetry
223
229
  id: gather
224
- uses: actions/github-script@v7
230
+ uses: actions/github-script@v8
225
231
  with:
226
232
  script: |
227
233
  const fs = require('fs');
@@ -292,14 +298,13 @@ jobs:
292
298
  needs: [params, pr-cleanup, telemetry]
293
299
  if: |
294
300
  always() &&
295
- needs.params.outputs.dry-run != 'true' &&
296
301
  (needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'dev-only') &&
297
302
  needs.params.result == 'success'
298
303
  runs-on: ubuntu-latest
299
304
  steps:
300
- - uses: actions/checkout@v4
305
+ - uses: actions/checkout@v6
301
306
 
302
- - uses: actions/setup-node@v4
307
+ - uses: actions/setup-node@v6
303
308
  with:
304
309
  node-version: "24"
305
310
 
@@ -312,6 +317,7 @@ jobs:
312
317
  run: npm ci
313
318
 
314
319
  - name: Run supervisor
320
+ if: github.repository != 'xn-intenton-z2a/agentic-lib'
315
321
  uses: ./.github/agentic-lib/actions/agentic-step
316
322
  env:
317
323
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -331,11 +337,22 @@ jobs:
331
337
  needs.params.result == 'success'
332
338
  runs-on: ubuntu-latest
333
339
  steps:
334
- - uses: actions/checkout@v4
340
+ - uses: actions/checkout@v6
335
341
  with:
336
342
  fetch-depth: 0
337
343
 
338
- - uses: actions/setup-node@v4
344
+ - name: Check mission-complete signal
345
+ id: mission-check
346
+ run: |
347
+ if [ -f MISSION_COMPLETE.md ]; then
348
+ echo "mission-complete=true" >> $GITHUB_OUTPUT
349
+ echo "Mission is complete — skipping budget-consuming tasks"
350
+ cat MISSION_COMPLETE.md
351
+ else
352
+ echo "mission-complete=false" >> $GITHUB_OUTPUT
353
+ fi
354
+
355
+ - uses: actions/setup-node@v6
339
356
  with:
340
357
  node-version: "24"
341
358
 
@@ -358,6 +375,7 @@ jobs:
358
375
  echo "libraryWritablePaths=${LIBRARY};${SOURCES}" >> $GITHUB_OUTPUT
359
376
 
360
377
  - name: Maintain features
378
+ if: steps.mission-check.outputs.mission-complete != 'true'
361
379
  uses: ./.github/agentic-lib/actions/agentic-step
362
380
  env:
363
381
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -370,6 +388,7 @@ jobs:
370
388
  model: ${{ needs.params.outputs.model }}
371
389
 
372
390
  - name: Maintain library
391
+ if: steps.mission-check.outputs.mission-complete != 'true'
373
392
  uses: ./.github/agentic-lib/actions/agentic-step
374
393
  env:
375
394
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -382,7 +401,7 @@ jobs:
382
401
  model: ${{ needs.params.outputs.model }}
383
402
 
384
403
  - name: Commit and push changes
385
- if: needs.params.outputs.dry-run != 'true'
404
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
386
405
  uses: ./.github/agentic-lib/actions/commit-if-changed
387
406
  with:
388
407
  commit-message: "agentic-step: maintain features and library"
@@ -393,16 +412,15 @@ jobs:
393
412
  needs: [params, supervisor]
394
413
  if: |
395
414
  always() &&
396
- needs.params.outputs.dry-run != 'true' &&
397
415
  needs.params.outputs.mode == 'full' &&
398
416
  needs.params.result == 'success'
399
417
  runs-on: ubuntu-latest
400
418
  steps:
401
- - uses: actions/checkout@v4
419
+ - uses: actions/checkout@v6
402
420
  with:
403
421
  fetch-depth: 0
404
422
 
405
- - uses: actions/setup-node@v4
423
+ - uses: actions/setup-node@v6
406
424
  with:
407
425
  node-version: "24"
408
426
 
@@ -417,8 +435,19 @@ jobs:
417
435
  working-directory: .github/agentic-lib/actions/agentic-step
418
436
  run: npm ci
419
437
 
438
+ - name: Check mission-complete signal
439
+ id: fix-mission-check
440
+ run: |
441
+ if [ -f MISSION_COMPLETE.md ]; then
442
+ echo "mission-complete=true" >> $GITHUB_OUTPUT
443
+ echo "Mission is complete — skipping fix-stuck"
444
+ else
445
+ echo "mission-complete=false" >> $GITHUB_OUTPUT
446
+ fi
447
+
420
448
  - name: Find and fix stuck PRs
421
- uses: actions/github-script@v7
449
+ if: steps.fix-mission-check.outputs.mission-complete != 'true'
450
+ uses: actions/github-script@v8
422
451
  env:
423
452
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
424
453
  with:
@@ -478,14 +507,14 @@ jobs:
478
507
  }
479
508
 
480
509
  - name: Checkout PR branch
481
- if: env.FIX_PR_NUMBER != ''
510
+ if: env.FIX_PR_NUMBER != '' && steps.fix-mission-check.outputs.mission-complete != 'true'
482
511
  run: |
483
512
  gh pr checkout ${{ env.FIX_PR_NUMBER }}
484
513
  env:
485
514
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
486
515
 
487
516
  - name: "Tier 1: Auto-resolve trivial merge conflicts"
488
- if: env.FIX_PR_NUMBER != '' && env.FIX_REASON == 'merge conflicts'
517
+ if: env.FIX_PR_NUMBER != '' && env.FIX_REASON == 'merge conflicts' && steps.fix-mission-check.outputs.mission-complete != 'true'
489
518
  id: trivial-resolve
490
519
  run: |
491
520
  git fetch origin main
@@ -517,6 +546,7 @@ jobs:
517
546
  - name: "Tier 2: LLM fix (conflicts or failing checks)"
518
547
  if: |
519
548
  env.FIX_PR_NUMBER != '' &&
549
+ steps.fix-mission-check.outputs.mission-complete != 'true' &&
520
550
  (env.FIX_REASON != 'merge conflicts' ||
521
551
  steps.trivial-resolve.outputs.resolved == 'none')
522
552
  uses: ./.github/agentic-lib/actions/agentic-step
@@ -529,11 +559,11 @@ jobs:
529
559
  config: ${{ needs.params.outputs.config-path }}
530
560
  instructions: ".github/agentic-lib/agents/agent-apply-fix.md"
531
561
  pr-number: ${{ env.FIX_PR_NUMBER }}
532
- test-command: "npm test"
562
+ # test-command read from [execution].test in agentic-lib.toml
533
563
  model: ${{ needs.params.outputs.model }}
534
564
 
535
565
  - name: Commit and push fixes
536
- if: env.FIX_PR_NUMBER != ''
566
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && env.FIX_PR_NUMBER != '' && steps.fix-mission-check.outputs.mission-complete != 'true'
537
567
  uses: ./.github/agentic-lib/actions/commit-if-changed
538
568
  with:
539
569
  commit-message: "agentic-step: fix failing tests / resolve conflicts"
@@ -547,9 +577,9 @@ jobs:
547
577
  needs.params.result == 'success'
548
578
  runs-on: ubuntu-latest
549
579
  steps:
550
- - uses: actions/checkout@v4
580
+ - uses: actions/checkout@v6
551
581
 
552
- - uses: actions/setup-node@v4
582
+ - uses: actions/setup-node@v6
553
583
  with:
554
584
  node-version: "24"
555
585
 
@@ -592,12 +622,12 @@ jobs:
592
622
  needs.params.result == 'success'
593
623
  runs-on: ubuntu-latest
594
624
  steps:
595
- - uses: actions/checkout@v4
625
+ - uses: actions/checkout@v6
596
626
  with:
597
627
  fetch-depth: 0
598
628
  token: ${{ secrets.GITHUB_TOKEN }}
599
629
 
600
- - uses: actions/setup-node@v4
630
+ - uses: actions/setup-node@v6
601
631
  with:
602
632
  node-version: "24"
603
633
 
@@ -626,9 +656,21 @@ jobs:
626
656
  DEPS=$(yq -r '.paths.dependenciesFilepath.path // "package.json"' "$CONFIG")
627
657
  echo "writablePaths=${SOURCE};${TESTS};${FEATURES};${DOCS};${LIBRARY};${SOURCES};${README};${DEPS}" >> $GITHUB_OUTPUT
628
658
 
659
+ - name: Check mission-complete signal
660
+ id: dev-mission-check
661
+ run: |
662
+ if [ -f MISSION_COMPLETE.md ]; then
663
+ echo "mission-complete=true" >> $GITHUB_OUTPUT
664
+ echo "Mission is complete — skipping dev transformation"
665
+ cat MISSION_COMPLETE.md
666
+ else
667
+ echo "mission-complete=false" >> $GITHUB_OUTPUT
668
+ fi
669
+
629
670
  - name: Find target issue
671
+ if: steps.dev-mission-check.outputs.mission-complete != 'true'
630
672
  id: issue
631
- uses: actions/github-script@v7
673
+ uses: actions/github-script@v8
632
674
  with:
633
675
  script: |
634
676
  const specificIssue = '${{ needs.params.outputs.issue-number }}';
@@ -668,21 +710,21 @@ jobs:
668
710
  task: "transform"
669
711
  config: ${{ needs.params.outputs.config-path }}
670
712
  instructions: ".github/agentic-lib/agents/agent-issue-resolution.md"
671
- test-command: "npm test"
713
+ # test-command read from [execution].test in agentic-lib.toml
672
714
  model: ${{ needs.params.outputs.model }}
673
715
  issue-number: ${{ steps.issue.outputs.issue-number }}
674
716
  writable-paths: ${{ steps.config.outputs.writablePaths }}
675
717
 
676
718
  - name: Commit and push
677
- if: steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true'
719
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true'
678
720
  uses: ./.github/agentic-lib/actions/commit-if-changed
679
721
  with:
680
722
  commit-message: "agentic-step: transform issue #${{ steps.issue.outputs.issue-number }}"
681
723
  push-ref: ${{ steps.branch.outputs.branchName }}
682
724
 
683
725
  - name: Create PR and attempt merge
684
- if: steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true'
685
- uses: actions/github-script@v7
726
+ if: github.repository != 'xn-intenton-z2a/agentic-lib' && steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true'
727
+ uses: actions/github-script@v8
686
728
  with:
687
729
  script: |
688
730
  const owner = context.repo.owner;
@@ -774,7 +816,7 @@ jobs:
774
816
  if: always() && needs.params.result == 'success'
775
817
  runs-on: ubuntu-latest
776
818
  steps:
777
- - uses: actions/checkout@v4
819
+ - uses: actions/checkout@v6
778
820
  with:
779
821
  fetch-depth: 0
780
822
 
package/README.md CHANGED
@@ -172,22 +172,37 @@ contributing = "CONTRIBUTING.md"
172
172
  library-sources = "SOURCES.md"
173
173
 
174
174
  [execution]
175
- build = "npm run build"
176
- test = "npm test"
177
- start = "npm run start"
175
+ test = "npm ci && npm test"
178
176
 
179
177
  [limits]
180
- feature-issues = 2
181
- maintenance-issues = 1
182
- attempts-per-branch = 3
183
- attempts-per-issue = 2
178
+ max-feature-issues = 2
179
+ max-maintenance-issues = 1
180
+ max-attempts-per-branch = 3
181
+ max-attempts-per-issue = 2
184
182
  features-limit = 4
185
183
  library-limit = 32
186
184
 
185
+ [tuning]
186
+ profile = "recommended" # min | recommended | max
187
+ # model = "gpt-5-mini" # override model per-profile
188
+ # transformation-budget = 8 # max code-changing cycles per run
189
+
187
190
  [bot]
188
191
  log-file = "intentïon.md"
189
192
  ```
190
193
 
194
+ ### Tuning Profiles
195
+
196
+ The `profile` setting controls all tuning defaults. Three profiles are built in:
197
+
198
+ | Profile | Budget | Source scan | Issues | Best for |
199
+ |---------|--------|-------------|--------|----------|
200
+ | `min` | 4 cycles | 3 files, 1000 chars | 5, 14d stale | CI testing, quick validation |
201
+ | `recommended` | 8 cycles | 10 files, 5000 chars | 20, 30d stale | Balanced cost/quality |
202
+ | `max` | 32 cycles | 50 files, 20000 chars | 100, 90d stale | Complex missions |
203
+
204
+ Override individual knobs in `[tuning]` to deviate from a profile. Limits (`[limits]`) also scale with the profile.
205
+
191
206
  The YAML config at `.github/agentic-lib/agents/agentic-lib.yml` is also supported as a fallback.
192
207
 
193
208
  ## The `agentic-step` Action
@@ -217,6 +232,7 @@ npx @xn-intenton-z2a/agentic-lib transform # advance code toward the
217
232
  npx @xn-intenton-z2a/agentic-lib maintain-features # generate feature files from mission
218
233
  npx @xn-intenton-z2a/agentic-lib maintain-library # update library docs from SOURCES.md
219
234
  npx @xn-intenton-z2a/agentic-lib fix-code # fix failing tests
235
+ npx @xn-intenton-z2a/agentic-lib iterate # run N cycles with budget tracking
220
236
  ```
221
237
 
222
238
  All task commands accept these flags:
@@ -226,6 +242,9 @@ All task commands accept these flags:
226
242
  | `--dry-run` | off | Show the prompt without calling the Copilot SDK |
227
243
  | `--target <path>` | current directory | Target repository to transform |
228
244
  | `--model <name>` | `claude-sonnet-4` | Copilot SDK model |
245
+ | `--cycles <N>` | from budget | Max iteration cycles (iterate only) |
246
+ | `--steps <list>` | all three | Comma-separated steps per cycle (iterate only) |
247
+ | `--mission <name>` | hamming-distance | Init with --purge before iterating (iterate only) |
229
248
 
230
249
  ### Example: Full Walkthrough
231
250
 
@@ -278,6 +297,28 @@ Use `--dry-run` to see what prompt would be sent without calling the SDK:
278
297
  npx @xn-intenton-z2a/agentic-lib transform --dry-run
279
298
  ```
280
299
 
300
+ ### Iterator
301
+
302
+ The `iterate` command runs multiple cycles of maintain → transform → fix with automatic stop conditions and budget tracking:
303
+
304
+ ```bash
305
+ # Init a mission and iterate with default budget
306
+ npx @xn-intenton-z2a/agentic-lib iterate --mission fizz-buzz --model gpt-5-mini
307
+
308
+ # Run 4 cycles on an existing workspace
309
+ npx @xn-intenton-z2a/agentic-lib iterate --cycles 4
310
+
311
+ # Transform-only cycles (skip maintain)
312
+ npx @xn-intenton-z2a/agentic-lib iterate --steps transform,fix-code --cycles 3
313
+ ```
314
+
315
+ **Stop conditions:**
316
+ - Tests pass for 2 consecutive cycles
317
+ - No files change for 2 consecutive cycles
318
+ - Transformation budget exhausted (configurable via `transformation-budget` in `agentic-lib.toml`)
319
+
320
+ Each cycle logs `**agentic-lib transformation cost:** 1` to `intentïon.md` when source files change. The iterator reads these to track cumulative cost against the budget.
321
+
281
322
  ### Environment
282
323
 
283
324
  | Variable | Required | Purpose |
@@ -301,6 +342,8 @@ Built-in safety mechanisms:
301
342
 
302
343
  - **WIP limits** -- maximum concurrent issues to prevent runaway generation
303
344
  - **Attempt limits** -- maximum retries per branch and per issue
345
+ - **Transformation budget** -- caps code-changing cycles per run (profile-scaled)
346
+ - **Mission-complete signal** -- `MISSION_COMPLETE.md` gates budget-consuming jobs without LLM calls
304
347
  - **Path enforcement** -- writable and read-only path separation
305
348
  - **TDD mode** -- optionally require tests before implementation
306
349
  - **Mission protection** -- MISSION.md is read-only to the agent
@@ -331,7 +374,7 @@ src/
331
374
 
332
375
  ### Testing
333
376
 
334
- 269 unit tests across 22 test files, plus system tests:
377
+ 393 unit tests across 26 test files, plus system tests:
335
378
 
336
379
  ```bash
337
380
  npm test # Run all tests (vitest)