@xn-intenton-z2a/agentic-lib 7.2.18 → 7.2.20
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.
- package/.github/workflows/agentic-lib-test.yml +1 -1
- package/.github/workflows/agentic-lib-workflow.yml +92 -74
- package/bin/agentic-lib.js +11 -11
- package/package.json +1 -1
- package/src/actions/commit-if-changed/action.yml +1 -1
- package/src/scripts/push-to-logs.sh +5 -5
- package/src/seeds/zero-.gitignore +1 -1
- package/src/seeds/zero-package.json +1 -1
|
@@ -122,7 +122,7 @@ jobs:
|
|
|
122
122
|
path: SCREENSHOT_INDEX.png
|
|
123
123
|
if-no-files-found: ignore
|
|
124
124
|
|
|
125
|
-
- name: Push screenshot to
|
|
125
|
+
- name: Push screenshot to agentic-lib-logs branch
|
|
126
126
|
if: |
|
|
127
127
|
github.ref == 'refs/heads/main' &&
|
|
128
128
|
github.repository != 'xn-intenton-z2a/agentic-lib' &&
|
|
@@ -256,12 +256,53 @@ jobs:
|
|
|
256
256
|
merged-prs: ${{ steps.cleanup.outputs.merged-prs }}
|
|
257
257
|
closed-prs: ${{ steps.cleanup.outputs.closed-prs }}
|
|
258
258
|
|
|
259
|
-
# ─── Telemetry:
|
|
260
|
-
telemetry:
|
|
259
|
+
# ─── Behaviour Telemetry: run Playwright tests in container ────────
|
|
260
|
+
behaviour-telemetry:
|
|
261
261
|
needs: params
|
|
262
262
|
if: |
|
|
263
263
|
needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'dev-only' || needs.params.outputs.mode == 'review-only'
|
|
264
264
|
runs-on: ubuntu-latest
|
|
265
|
+
container: mcr.microsoft.com/playwright:v1.58.2-noble
|
|
266
|
+
steps:
|
|
267
|
+
- uses: actions/checkout@v6
|
|
268
|
+
|
|
269
|
+
- uses: actions/setup-node@v6
|
|
270
|
+
with:
|
|
271
|
+
node-version: 24
|
|
272
|
+
|
|
273
|
+
- name: Install dependencies (non-blocking)
|
|
274
|
+
run: npm ci 2>/dev/null || npm install 2>/dev/null || true
|
|
275
|
+
|
|
276
|
+
- name: Build web assets (non-blocking)
|
|
277
|
+
run: npm run build:web 2>/dev/null || true
|
|
278
|
+
|
|
279
|
+
- name: Run behaviour tests (non-blocking)
|
|
280
|
+
id: behaviour-tests
|
|
281
|
+
if: hashFiles('playwright.config.js') != '' || hashFiles('playwright.config.ts') != ''
|
|
282
|
+
run: |
|
|
283
|
+
set +e
|
|
284
|
+
OUTPUT=$(npm run --if-present test:behaviour 2>&1)
|
|
285
|
+
EXIT_CODE=$?
|
|
286
|
+
echo "exit-code=$EXIT_CODE" | tee -a $GITHUB_OUTPUT
|
|
287
|
+
PASS_COUNT=$(echo "$OUTPUT" | grep -oP '\d+ passed' | head -1 | grep -oP '\d+' || echo "0")
|
|
288
|
+
FAIL_COUNT=$(echo "$OUTPUT" | grep -oP '\d+ failed' | head -1 | grep -oP '\d+' || echo "0")
|
|
289
|
+
echo "pass-count=$PASS_COUNT" | tee -a $GITHUB_OUTPUT
|
|
290
|
+
echo "fail-count=$FAIL_COUNT" | tee -a $GITHUB_OUTPUT
|
|
291
|
+
echo "$OUTPUT"
|
|
292
|
+
exit 0
|
|
293
|
+
|
|
294
|
+
outputs:
|
|
295
|
+
exit-code: ${{ steps.behaviour-tests.outputs.exit-code || '-1' }}
|
|
296
|
+
pass-count: ${{ steps.behaviour-tests.outputs.pass-count || '0' }}
|
|
297
|
+
fail-count: ${{ steps.behaviour-tests.outputs.fail-count || '0' }}
|
|
298
|
+
|
|
299
|
+
# ─── Telemetry: gather repo state for supervisor ───────────────────
|
|
300
|
+
telemetry:
|
|
301
|
+
needs: [params, behaviour-telemetry]
|
|
302
|
+
if: |
|
|
303
|
+
!cancelled() &&
|
|
304
|
+
(needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'dev-only' || needs.params.outputs.mode == 'review-only')
|
|
305
|
+
runs-on: ubuntu-latest
|
|
265
306
|
steps:
|
|
266
307
|
- uses: actions/checkout@v6
|
|
267
308
|
|
|
@@ -304,24 +345,6 @@ jobs:
|
|
|
304
345
|
echo "$OUTPUT"
|
|
305
346
|
exit 0
|
|
306
347
|
|
|
307
|
-
- name: Run behaviour tests (non-blocking)
|
|
308
|
-
id: behaviour-tests
|
|
309
|
-
if: hashFiles('playwright.config.js') != '' || hashFiles('playwright.config.ts') != ''
|
|
310
|
-
run: |
|
|
311
|
-
set +e
|
|
312
|
-
npx playwright install --with-deps chromium 2>/dev/null || true
|
|
313
|
-
npm run build:web 2>/dev/null || true
|
|
314
|
-
OUTPUT=$(npm run --if-present test:behaviour 2>&1)
|
|
315
|
-
EXIT_CODE=$?
|
|
316
|
-
echo "exit-code=$EXIT_CODE" | tee -a $GITHUB_OUTPUT
|
|
317
|
-
PASS_COUNT=$(echo "$OUTPUT" | grep -oP '\d+ passed' | head -1 | grep -oP '\d+' || echo "0")
|
|
318
|
-
FAIL_COUNT=$(echo "$OUTPUT" | grep -oP '\d+ failed' | head -1 | grep -oP '\d+' || echo "0")
|
|
319
|
-
echo "pass-count=$PASS_COUNT" | tee -a $GITHUB_OUTPUT
|
|
320
|
-
echo "fail-count=$FAIL_COUNT" | tee -a $GITHUB_OUTPUT
|
|
321
|
-
echo "$OUTPUT" > /tmp/behaviour-test-output.txt
|
|
322
|
-
echo "$OUTPUT"
|
|
323
|
-
exit 0
|
|
324
|
-
|
|
325
348
|
- name: Gather telemetry
|
|
326
349
|
id: gather
|
|
327
350
|
uses: actions/github-script@v8
|
|
@@ -428,21 +451,21 @@ jobs:
|
|
|
428
451
|
const missionComplete = fs.existsSync('MISSION_COMPLETE.md');
|
|
429
452
|
const missionFailed = fs.existsSync('MISSION_FAILED.md');
|
|
430
453
|
|
|
431
|
-
// Activity log stats (fetched from
|
|
454
|
+
// Activity log stats (fetched from agentic-lib-logs branch)
|
|
432
455
|
let activityStats = null;
|
|
433
456
|
try {
|
|
434
|
-
// Try
|
|
457
|
+
// Try agentic-lib-logs branch first (new location), fall back to local file (legacy)
|
|
435
458
|
let log = null;
|
|
436
459
|
for (const logFile of ['intenti\u00F6n.md', 'intention.md']) {
|
|
437
460
|
try {
|
|
438
461
|
const { data } = await github.rest.repos.getContent({
|
|
439
|
-
owner, repo, path: logFile, ref: '
|
|
462
|
+
owner, repo, path: logFile, ref: 'agentic-lib-logs',
|
|
440
463
|
});
|
|
441
464
|
log = Buffer.from(data.content, 'base64').toString('utf8');
|
|
442
465
|
break;
|
|
443
466
|
} catch { /* try next */ }
|
|
444
467
|
}
|
|
445
|
-
// Fall back to local file (for repos not yet using
|
|
468
|
+
// Fall back to local file (for repos not yet using agentic-lib-logs branch)
|
|
446
469
|
if (!log) {
|
|
447
470
|
const logPath = fs.existsSync('intenti\u00F6n.md') ? 'intenti\u00F6n.md' : (fs.existsSync('intention.md') ? 'intention.md' : null);
|
|
448
471
|
if (logPath) log = fs.readFileSync(logPath, 'utf8');
|
|
@@ -462,10 +485,6 @@ jobs:
|
|
|
462
485
|
const unitOutput = fs.existsSync('/tmp/unit-test-output.txt')
|
|
463
486
|
? fs.readFileSync('/tmp/unit-test-output.txt', 'utf8')
|
|
464
487
|
: '';
|
|
465
|
-
const behaviourOutput = fs.existsSync('/tmp/behaviour-test-output.txt')
|
|
466
|
-
? fs.readFileSync('/tmp/behaviour-test-output.txt', 'utf8')
|
|
467
|
-
: '';
|
|
468
|
-
|
|
469
488
|
const telemetry = {
|
|
470
489
|
issues: issuesSummary,
|
|
471
490
|
instabilityIssues: instabilityNumbers,
|
|
@@ -487,10 +506,9 @@ jobs:
|
|
|
487
506
|
output: unitOutput,
|
|
488
507
|
},
|
|
489
508
|
behaviour: {
|
|
490
|
-
exitCode: parseInt('${{
|
|
491
|
-
passCount: parseInt('${{
|
|
492
|
-
failCount: parseInt('${{
|
|
493
|
-
output: behaviourOutput,
|
|
509
|
+
exitCode: parseInt('${{ needs.behaviour-telemetry.outputs.exit-code }}' || '-1'),
|
|
510
|
+
passCount: parseInt('${{ needs.behaviour-telemetry.outputs.pass-count }}' || '0'),
|
|
511
|
+
failCount: parseInt('${{ needs.behaviour-telemetry.outputs.fail-count }}' || '0'),
|
|
494
512
|
},
|
|
495
513
|
},
|
|
496
514
|
externalTestResults,
|
|
@@ -540,10 +558,10 @@ jobs:
|
|
|
540
558
|
with:
|
|
541
559
|
fetch-depth: 0
|
|
542
560
|
|
|
543
|
-
- name: Fetch log from
|
|
561
|
+
- name: Fetch log from agentic-lib-logs branch
|
|
544
562
|
run: |
|
|
545
563
|
for f in "intentïon.md" "intention.md"; do
|
|
546
|
-
git show "origin
|
|
564
|
+
git show "origin/agentic-lib-logs:${f}" > "$f" 2>/dev/null || true
|
|
547
565
|
done
|
|
548
566
|
|
|
549
567
|
- name: Check mission-complete signal
|
|
@@ -642,7 +660,7 @@ jobs:
|
|
|
642
660
|
commit-message: "agentic-step: maintain features and library"
|
|
643
661
|
push-ref: ${{ github.ref_name }}
|
|
644
662
|
|
|
645
|
-
- name: Push log to
|
|
663
|
+
- name: Push log to agentic-lib-logs branch
|
|
646
664
|
if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
|
|
647
665
|
run: bash .github/agentic-lib/scripts/push-to-logs.sh "intentïon.md" "intention.md"
|
|
648
666
|
|
|
@@ -662,10 +680,10 @@ jobs:
|
|
|
662
680
|
with:
|
|
663
681
|
fetch-depth: 0
|
|
664
682
|
|
|
665
|
-
- name: Fetch log from
|
|
683
|
+
- name: Fetch log from agentic-lib-logs branch
|
|
666
684
|
run: |
|
|
667
685
|
for f in "intentïon.md" "intention.md"; do
|
|
668
|
-
git show "origin
|
|
686
|
+
git show "origin/agentic-lib-logs:${f}" > "$f" 2>/dev/null || true
|
|
669
687
|
done
|
|
670
688
|
|
|
671
689
|
- uses: actions/setup-node@v6
|
|
@@ -693,7 +711,7 @@ jobs:
|
|
|
693
711
|
instructions: ".github/agentic-lib/agents/agent-director.md"
|
|
694
712
|
model: ${{ needs.params.outputs.model }}
|
|
695
713
|
|
|
696
|
-
- name: Push log to
|
|
714
|
+
- name: Push log to agentic-lib-logs branch
|
|
697
715
|
if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
|
|
698
716
|
run: bash .github/agentic-lib/scripts/push-to-logs.sh "intentïon.md" "intention.md"
|
|
699
717
|
|
|
@@ -712,10 +730,10 @@ jobs:
|
|
|
712
730
|
with:
|
|
713
731
|
fetch-depth: 0
|
|
714
732
|
|
|
715
|
-
- name: Fetch log from
|
|
733
|
+
- name: Fetch log from agentic-lib-logs branch
|
|
716
734
|
run: |
|
|
717
735
|
for f in "intentïon.md" "intention.md"; do
|
|
718
|
-
git show "origin
|
|
736
|
+
git show "origin/agentic-lib-logs:${f}" > "$f" 2>/dev/null || true
|
|
719
737
|
done
|
|
720
738
|
|
|
721
739
|
- uses: actions/setup-node@v6
|
|
@@ -743,7 +761,7 @@ jobs:
|
|
|
743
761
|
instructions: ".github/agentic-lib/agents/agent-supervisor.md"
|
|
744
762
|
model: ${{ needs.params.outputs.model }}
|
|
745
763
|
|
|
746
|
-
- name: Push log to
|
|
764
|
+
- name: Push log to agentic-lib-logs branch
|
|
747
765
|
if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
|
|
748
766
|
run: bash .github/agentic-lib/scripts/push-to-logs.sh "intentïon.md" "intention.md"
|
|
749
767
|
|
|
@@ -767,13 +785,13 @@ jobs:
|
|
|
767
785
|
- name: Install project dependencies
|
|
768
786
|
run: npm ci
|
|
769
787
|
|
|
770
|
-
- name: Install Playwright (for behaviour tests)
|
|
771
|
-
if: hashFiles('playwright.config.js') != '' || hashFiles('playwright.config.ts') != ''
|
|
772
|
-
run: npx playwright install --with-deps chromium
|
|
773
|
-
|
|
774
|
-
- name: Self-init (agentic-lib dev only)
|
|
775
|
-
if: hashFiles('scripts/self-init.sh') != '' && hashFiles('.github/agentic-lib/actions/agentic-step/package.json') == ''
|
|
776
|
-
run: bash scripts/self-init.sh
|
|
788
|
+
# - name: Install Playwright (for behaviour tests)
|
|
789
|
+
# if: hashFiles('playwright.config.js') != '' || hashFiles('playwright.config.ts') != ''
|
|
790
|
+
# run: npx playwright install --with-deps chromium
|
|
791
|
+
#
|
|
792
|
+
# - name: Self-init (agentic-lib dev only)
|
|
793
|
+
# if: hashFiles('scripts/self-init.sh') != '' && hashFiles('.github/agentic-lib/actions/agentic-step/package.json') == ''
|
|
794
|
+
# run: bash scripts/self-init.sh
|
|
777
795
|
|
|
778
796
|
- name: Install agentic-step dependencies
|
|
779
797
|
working-directory: .github/agentic-lib/actions/agentic-step
|
|
@@ -1127,10 +1145,10 @@ jobs:
|
|
|
1127
1145
|
fetch-depth: 0
|
|
1128
1146
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
1129
1147
|
|
|
1130
|
-
- name: Fetch log from
|
|
1148
|
+
- name: Fetch log from agentic-lib-logs branch
|
|
1131
1149
|
run: |
|
|
1132
1150
|
for f in "intentïon.md" "intention.md"; do
|
|
1133
|
-
git show "origin
|
|
1151
|
+
git show "origin/agentic-lib-logs:${f}" > "$f" 2>/dev/null || true
|
|
1134
1152
|
done
|
|
1135
1153
|
|
|
1136
1154
|
- uses: actions/setup-node@v6
|
|
@@ -1262,29 +1280,29 @@ jobs:
|
|
|
1262
1280
|
echo "tests-passed=true" >> $GITHUB_OUTPUT
|
|
1263
1281
|
echo "All tests passed"
|
|
1264
1282
|
|
|
1265
|
-
- name: Run behaviour tests before committing
|
|
1266
|
-
id: pre-commit-behaviour-test
|
|
1267
|
-
if: steps.issue.outputs.issue-number != '' && steps.pre-commit-test.outputs.tests-passed == 'true' && (hashFiles('playwright.config.js') != '' || hashFiles('playwright.config.ts') != '')
|
|
1268
|
-
run: |
|
|
1269
|
-
npx playwright install --with-deps chromium 2>/dev/null || true
|
|
1270
|
-
npm run build:web 2>/dev/null || true
|
|
1271
|
-
set +e
|
|
1272
|
-
npm run --if-present test:behaviour 2>&1 | tail -30
|
|
1273
|
-
EXIT_CODE=$?
|
|
1274
|
-
if [ $EXIT_CODE -ne 0 ]; then
|
|
1275
|
-
echo "::warning::Behaviour test attempt 1 failed — retrying"
|
|
1276
|
-
sleep 2
|
|
1277
|
-
npm run --if-present test:behaviour 2>&1 | tail -30
|
|
1278
|
-
EXIT_CODE=$?
|
|
1279
|
-
fi
|
|
1280
|
-
set -e
|
|
1281
|
-
if [ $EXIT_CODE -ne 0 ]; then
|
|
1282
|
-
echo "tests-passed=false" >> $GITHUB_OUTPUT
|
|
1283
|
-
echo "WARNING: Behaviour tests failed (exit $EXIT_CODE) — skipping commit and PR"
|
|
1284
|
-
exit 0
|
|
1285
|
-
fi
|
|
1286
|
-
echo "tests-passed=true" >> $GITHUB_OUTPUT
|
|
1287
|
-
echo "Behaviour tests passed"
|
|
1283
|
+
# - name: Run behaviour tests before committing
|
|
1284
|
+
# id: pre-commit-behaviour-test
|
|
1285
|
+
# if: steps.issue.outputs.issue-number != '' && steps.pre-commit-test.outputs.tests-passed == 'true' && (hashFiles('playwright.config.js') != '' || hashFiles('playwright.config.ts') != '')
|
|
1286
|
+
# run: |
|
|
1287
|
+
# npx playwright install --with-deps chromium 2>/dev/null || true
|
|
1288
|
+
# npm run build:web 2>/dev/null || true
|
|
1289
|
+
# set +e
|
|
1290
|
+
# npm run --if-present test:behaviour 2>&1 | tail -30
|
|
1291
|
+
# EXIT_CODE=$?
|
|
1292
|
+
# if [ $EXIT_CODE -ne 0 ]; then
|
|
1293
|
+
# echo "::warning::Behaviour test attempt 1 failed — retrying"
|
|
1294
|
+
# sleep 2
|
|
1295
|
+
# npm run --if-present test:behaviour 2>&1 | tail -30
|
|
1296
|
+
# EXIT_CODE=$?
|
|
1297
|
+
# fi
|
|
1298
|
+
# set -e
|
|
1299
|
+
# if [ $EXIT_CODE -ne 0 ]; then
|
|
1300
|
+
# echo "tests-passed=false" >> $GITHUB_OUTPUT
|
|
1301
|
+
# echo "WARNING: Behaviour tests failed (exit $EXIT_CODE) — skipping commit and PR"
|
|
1302
|
+
# exit 0
|
|
1303
|
+
# fi
|
|
1304
|
+
# echo "tests-passed=true" >> $GITHUB_OUTPUT
|
|
1305
|
+
# echo "Behaviour tests passed"
|
|
1288
1306
|
|
|
1289
1307
|
- name: Commit and push
|
|
1290
1308
|
if: github.repository != 'xn-intenton-z2a/agentic-lib' && steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true' && steps.pre-commit-test.outputs.tests-passed == 'true' && steps.pre-commit-behaviour-test.outputs.tests-passed != 'false'
|
|
@@ -1293,7 +1311,7 @@ jobs:
|
|
|
1293
1311
|
commit-message: "agentic-step: transform issue #${{ steps.issue.outputs.issue-number }}"
|
|
1294
1312
|
push-ref: ${{ steps.branch.outputs.branchName }}
|
|
1295
1313
|
|
|
1296
|
-
- name: Push log to
|
|
1314
|
+
- name: Push log to agentic-lib-logs branch
|
|
1297
1315
|
if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
|
|
1298
1316
|
run: bash .github/agentic-lib/scripts/push-to-logs.sh "intentïon.md" "intention.md"
|
|
1299
1317
|
|
package/bin/agentic-lib.js
CHANGED
|
@@ -1134,30 +1134,30 @@ function initPurgeGitHub() {
|
|
|
1134
1134
|
console.log(` SKIP: Could not create discussion (${err.message})`);
|
|
1135
1135
|
}
|
|
1136
1136
|
|
|
1137
|
-
// ── Create/reset
|
|
1138
|
-
console.log("\n---
|
|
1137
|
+
// ── Create/reset agentic-lib-logs orphan branch ─────────────────────────────
|
|
1138
|
+
console.log("\n--- agentic-lib-logs branch (activity log + screenshot) ---");
|
|
1139
1139
|
try {
|
|
1140
1140
|
if (!dryRun) {
|
|
1141
|
-
// Delete existing
|
|
1141
|
+
// Delete existing agentic-lib-logs branch if present
|
|
1142
1142
|
try {
|
|
1143
|
-
ghExec(`gh api repos/${repoSlug}/git/refs/heads
|
|
1144
|
-
console.log(" DELETE: existing
|
|
1143
|
+
ghExec(`gh api repos/${repoSlug}/git/refs/heads/agentic-lib-logs -X DELETE`);
|
|
1144
|
+
console.log(" DELETE: existing agentic-lib-logs branch");
|
|
1145
1145
|
} catch { /* branch may not exist */ }
|
|
1146
|
-
// Create orphan
|
|
1146
|
+
// Create orphan agentic-lib-logs branch with an empty commit via the API
|
|
1147
1147
|
// First get the empty tree SHA
|
|
1148
1148
|
const emptyTree = JSON.parse(ghExec(`gh api repos/${repoSlug}/git/trees -X POST -f "tree[0][path]=.gitkeep" -f "tree[0][mode]=100644" -f "tree[0][type]=blob" -f "tree[0][content]="`));
|
|
1149
1149
|
const commitData = JSON.parse(ghExec(
|
|
1150
|
-
`gh api repos/${repoSlug}/git/commits -X POST -f "message=init
|
|
1150
|
+
`gh api repos/${repoSlug}/git/commits -X POST -f "message=init agentic-lib-logs branch" -f "tree=${emptyTree.sha}"`,
|
|
1151
1151
|
));
|
|
1152
|
-
ghExec(`gh api repos/${repoSlug}/git/refs -X POST -f "ref=refs/heads
|
|
1153
|
-
console.log(" CREATE:
|
|
1152
|
+
ghExec(`gh api repos/${repoSlug}/git/refs -X POST -f "ref=refs/heads/agentic-lib-logs" -f "sha=${commitData.sha}"`);
|
|
1153
|
+
console.log(" CREATE: agentic-lib-logs orphan branch");
|
|
1154
1154
|
initChanges++;
|
|
1155
1155
|
} else {
|
|
1156
|
-
console.log(" CREATE:
|
|
1156
|
+
console.log(" CREATE: agentic-lib-logs orphan branch (dry run)");
|
|
1157
1157
|
initChanges++;
|
|
1158
1158
|
}
|
|
1159
1159
|
} catch (err) {
|
|
1160
|
-
console.log(` SKIP: Could not create
|
|
1160
|
+
console.log(` SKIP: Could not create agentic-lib-logs branch (${err.message})`);
|
|
1161
1161
|
}
|
|
1162
1162
|
|
|
1163
1163
|
// ── Enable GitHub Pages ───────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ runs:
|
|
|
28
28
|
git add -A
|
|
29
29
|
# Unstage workflow files — GITHUB_TOKEN cannot push workflow changes
|
|
30
30
|
git reset HEAD -- '.github/workflows/' 2>/dev/null || true
|
|
31
|
-
# Unstage log/screenshot files — these live on the
|
|
31
|
+
# Unstage log/screenshot files — these live on the agentic-lib-logs branch
|
|
32
32
|
git reset HEAD -- 'intentïon.md' 'intention.md' 'SCREENSHOT_INDEX.png' 2>/dev/null || true
|
|
33
33
|
if git diff --cached --quiet; then
|
|
34
34
|
echo "No changes to commit"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
# Copyright (C) 2025-2026 Polycode Limited
|
|
4
|
-
# push-to-logs.sh — Push log/screenshot files to the
|
|
4
|
+
# push-to-logs.sh — Push log/screenshot files to the agentic-lib-logs orphan branch.
|
|
5
5
|
#
|
|
6
6
|
# Usage: bash .github/agentic-lib/scripts/push-to-logs.sh [file ...]
|
|
7
7
|
# e.g. bash .github/agentic-lib/scripts/push-to-logs.sh "intentïon.md" SCREENSHOT_INDEX.png
|
|
8
8
|
#
|
|
9
|
-
# Creates the
|
|
9
|
+
# Creates the agentic-lib-logs branch if it doesn't exist. Uses rebase/retry for
|
|
10
10
|
# concurrent pushes (same strategy as commit-if-changed).
|
|
11
11
|
|
|
12
12
|
set -euo pipefail
|
|
13
13
|
|
|
14
|
-
BRANCH="
|
|
14
|
+
BRANCH="agentic-lib-logs"
|
|
15
15
|
MAX_RETRIES=3
|
|
16
16
|
|
|
17
17
|
# Collect files that actually exist in the workspace
|
|
@@ -39,12 +39,12 @@ for f in "${FILES[@]}"; do
|
|
|
39
39
|
cp "$f" "${TMPDIR}/$(basename "$f")"
|
|
40
40
|
done
|
|
41
41
|
|
|
42
|
-
# Fetch the
|
|
42
|
+
# Fetch the agentic-lib-logs branch (may not exist yet)
|
|
43
43
|
REMOTE_EXISTS=""
|
|
44
44
|
git fetch origin "${BRANCH}" 2>/dev/null && REMOTE_EXISTS="true" || true
|
|
45
45
|
|
|
46
46
|
if [ "$REMOTE_EXISTS" = "true" ]; then
|
|
47
|
-
# Check out existing
|
|
47
|
+
# Check out existing agentic-lib-logs branch into a detached worktree-like state
|
|
48
48
|
git checkout "origin/${BRANCH}" -- . 2>/dev/null || true
|
|
49
49
|
git checkout -B "${BRANCH}" "origin/${BRANCH}"
|
|
50
50
|
else
|