From df484fa2680817c300996e36bb78018a9637190c Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Thu, 5 Nov 2026 00:20:03 +0800 Subject: [PATCH] fix(review): keep code validation in deterministic CI --- .../projects/audiolab-farm/checklists/dev/default.md | 4 ++-- .../audiolab-farm/checklists/fix-bug/default.md | 2 +- .../audiolab-farm/checklists/pr-complete/default.md | 4 ++-- .../audiolab-farm/checklists/review-pr/default.md | 2 ++ .../audiolab-farm/checklists/update-branch/default.md | 4 ++-- farmslot/projects/audiolab-farm/scripts/ci-local.mjs | 4 ++-- .../projects/audiolab-farm/scripts/ci-local.test.mjs | 11 ++++++----- .../audiolab-farm/templates/worker/review-fix.md | 11 +++++++++++ .../projects/audiolab-farm/templates/worker/review.md | 10 ++++++++++ 9 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 farmslot/projects/audiolab-farm/templates/worker/review-fix.md create mode 100644 farmslot/projects/audiolab-farm/templates/worker/review.md diff --git a/farmslot/projects/audiolab-farm/checklists/dev/default.md b/farmslot/projects/audiolab-farm/checklists/dev/default.md index f43a818e4..42810e79e 100644 --- a/farmslot/projects/audiolab-farm/checklists/dev/default.md +++ b/farmslot/projects/audiolab-farm/checklists/dev/default.md @@ -6,7 +6,7 @@ platforms: [web, mobile, ios, android] - [ ] Record the acceptance criteria and inspect the affected app. - [ ] Choose existing recipes or compose a focused proof. -- [ ] Make the smallest change and run focused checks. +- [ ] Make the smallest change and add regression tests. - [ ] Run the app recipe and validate its artifact package. - [ ] Write artifacts/pr-description.md with evidence and remaining limits. -{{CI_PARITY_STEP}} +- [ ] Changed-file CI [DETERMINISTIC: ci.local_check] - call this step through `./mark N`; the engine runs the frozen command. Read failures and fix them; do not launch validation commands. diff --git a/farmslot/projects/audiolab-farm/checklists/fix-bug/default.md b/farmslot/projects/audiolab-farm/checklists/fix-bug/default.md index f2beead1e..f8053865b 100644 --- a/farmslot/projects/audiolab-farm/checklists/fix-bug/default.md +++ b/farmslot/projects/audiolab-farm/checklists/fix-bug/default.md @@ -8,4 +8,4 @@ platforms: [web, mobile, ios, android] - [ ] Fix its cause with the smallest change. - [ ] Run the same proof after the fix and validate its artifact package. - [ ] Write artifacts/pr-description.md with the cause, evidence and validation. -{{CI_PARITY_STEP}} +- [ ] Changed-file CI [DETERMINISTIC: ci.local_check] - call this step through `./mark N`; the engine runs the frozen command. Read failures and fix them; do not launch validation commands. diff --git a/farmslot/projects/audiolab-farm/checklists/pr-complete/default.md b/farmslot/projects/audiolab-farm/checklists/pr-complete/default.md index fdc5279d4..dd75e79eb 100644 --- a/farmslot/projects/audiolab-farm/checklists/pr-complete/default.md +++ b/farmslot/projects/audiolab-farm/checklists/pr-complete/default.md @@ -5,7 +5,7 @@ platforms: [web, mobile, ios, android] # Audiolab pr-complete - [ ] Inspect review findings and the current PR head. -- [ ] Fix accepted findings and run focused checks. +- [ ] Fix accepted findings and add regression tests. - [ ] Re-run affected recipes and retain evidence. - [ ] Write artifacts/pr-description.md for the same PR. -{{CI_PARITY_STEP}} +- [ ] Changed-file CI [DETERMINISTIC: ci.local_check] - call this step through `./mark N`; the engine runs the frozen command. Read failures and fix them; do not launch validation commands. diff --git a/farmslot/projects/audiolab-farm/checklists/review-pr/default.md b/farmslot/projects/audiolab-farm/checklists/review-pr/default.md index bb0ca6360..5f78b09dc 100644 --- a/farmslot/projects/audiolab-farm/checklists/review-pr/default.md +++ b/farmslot/projects/audiolab-farm/checklists/review-pr/default.md @@ -2,6 +2,8 @@ platforms: [web, mobile, ios, android] --- +Static reviews read source, recorded evidence, existing CI results and receipts only. Do not run tests, builds, recipes, installs, probes or validation scripts. Missing evidence is a finding or marked unverified. + # Audiolab review-pr - [ ] Read the full diff and trace affected app behavior. diff --git a/farmslot/projects/audiolab-farm/checklists/update-branch/default.md b/farmslot/projects/audiolab-farm/checklists/update-branch/default.md index 13ba81714..60e3eb6f4 100644 --- a/farmslot/projects/audiolab-farm/checklists/update-branch/default.md +++ b/farmslot/projects/audiolab-farm/checklists/update-branch/default.md @@ -6,6 +6,6 @@ platforms: [web, mobile, ios, android] - [ ] Check current branch status and the existing PR. - [ ] Merge the default branch without discarding local work. -- [ ] Resolve conflicts and run focused validation. +- [ ] Resolve conflicts and add regression tests. - [ ] Write artifacts/report.md with the result. -{{CI_PARITY_STEP}} +- [ ] Changed-file CI [DETERMINISTIC: ci.local_check] - call this step through `./mark N`; the engine runs the frozen command. Read failures and fix them; do not launch validation commands. diff --git a/farmslot/projects/audiolab-farm/scripts/ci-local.mjs b/farmslot/projects/audiolab-farm/scripts/ci-local.mjs index e8ba28eb3..671f3d887 100644 --- a/farmslot/projects/audiolab-farm/scripts/ci-local.mjs +++ b/farmslot/projects/audiolab-farm/scripts/ci-local.mjs @@ -41,8 +41,8 @@ try { run(['workspace', manifest.name, 'test', '--findRelatedTests', ...workspaceSource.map((file) => path.resolve(file)), '--runInBand', '--coverage=false', '--passWithNoTests']); } } - // Keep the primary CI TypeScript check on clean, docs-only or app-only branches. - if (!typed) run(['workspace', '@siteed/audio-studio', 'typecheck', '--incremental', 'false']); + // App source consumes the primary library; docs-only branches need no compiler. + if (!typed && files.some((file) => file.startsWith('apps/playground/') && isSource(file))) run(['workspace', '@siteed/audio-studio', 'typecheck', '--incremental', 'false']); const pluginFiles = files.filter((file) => file.startsWith('packages/audio-studio/plugin/')); if (pluginFiles.length) { run(['exec', 'tsc', '--noEmit', '--incremental', 'false', '-p', 'packages/audio-studio/plugin/tsconfig.json']); diff --git a/farmslot/projects/audiolab-farm/scripts/ci-local.test.mjs b/farmslot/projects/audiolab-farm/scripts/ci-local.test.mjs index 7ea0ccae8..fe38cfd5d 100644 --- a/farmslot/projects/audiolab-farm/scripts/ci-local.test.mjs +++ b/farmslot/projects/audiolab-farm/scripts/ci-local.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; import { execFileSync, spawnSync } from 'node:child_process'; -import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'; +import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import test from 'node:test'; @@ -47,7 +47,7 @@ process.exit(args.includes('test')&&process.env.AUDIO_CI_TEST_UNIT_FAIL?7:0); delete env.NODE_TEST_CONTEXT; return spawnSync(process.execPath, [path.join(scriptDir, 'ci-local.mjs')], { cwd: repo, env, encoding: 'utf8' }); }; - const calls = () => readFileSync(log, 'utf8').trim().split('\n').map((line) => JSON.parse(line)); + const calls = () => existsSync(log) ? readFileSync(log, 'utf8').trim().split('\n').map((line) => JSON.parse(line)) : []; return { root, repo, bin, log, run, calls }; } @@ -135,7 +135,8 @@ test('each PR-producing catalog entry uses the shared step and the portable prep assert.equal(Object.hasOwn(config.vars, 'mark_cmd'), false, 'Use the connected-node SDK mark helper default.'); for (const flow of ['dev', 'fix-bug', 'pr-complete', 'update-branch']) { const text = readFileSync(path.join(project, 'checklists', flow, 'default.md'), 'utf8'); - assert.equal((text.match(/\{\{CI_PARITY_STEP\}\}/g) || []).length, 1, flow); + assert.equal((text.match(/\[DETERMINISTIC: ci\.local_check\]/g) || []).length, 1, flow); + assert.doesNotMatch(text, /CI_PARITY_STEP/); } }); @@ -158,7 +159,7 @@ test('the prepared CI shell uses configured farm and Node paths with spaces', t delete env.FARMSLOT_ROOT; const result = spawnSync('/bin/bash', [wrapper], { cwd: repo, env, encoding: 'utf8', timeout: 3000 }); assert.equal(result.status, 0, result.stderr); - assert.deepEqual(calls(), [['workspace', '@siteed/audio-studio', 'typecheck', '--incremental', 'false']]); + assert.deepEqual(calls(), []); for (const configured of [undefined, '']) { const missing = { ...env }; if (configured === undefined) delete missing.AUDIOLAB_FARM_ROOT; @@ -167,5 +168,5 @@ test('the prepared CI shell uses configured farm and Node paths with spaces', t assert.notEqual(refused.status, 0); assert.match(refused.stderr, /Set AUDIOLAB_FARM_ROOT in pool.env to the Audiolab pack installation root/); } - assert.equal(calls().length, 1, 'Missing root configuration ran a CI command.'); + assert.equal(calls().length, 0, 'Missing root configuration ran a CI command.'); }); diff --git a/farmslot/projects/audiolab-farm/templates/worker/review-fix.md b/farmslot/projects/audiolab-farm/templates/worker/review-fix.md new file mode 100644 index 000000000..c65d0a4ef --- /dev/null +++ b/farmslot/projects/audiolab-farm/templates/worker/review-fix.md @@ -0,0 +1,11 @@ +# Address review findings + +Use the task's active checklist marker for progress. Fix only the reported cause; leave unrelated changes alone. + +- [ ] Read TASK.md, the named review feedback and relevant source. Explain any rejected finding with evidence. +- [ ] Apply the smallest accepted fixes and write regression tests for changed behavior. +- [ ] Changed-file CI [DETERMINISTIC: ci.local_check]. Call this step through `{{TASK_DIR}}/mark 3`; the engine runs the frozen command and retains a receipt. Read failures, fix them and repeat the mark. Do not launch validation commands yourself. +- [ ] If proven app behavior changed, rerun its affected hosted recipe and retain the new attempt's evidence. Inspect recorded results and media. +- [ ] Update `artifacts/report.md` with each finding, fix and retained receipt/evidence. Refresh `artifacts/pr-description.md` when behavior or tests changed. +- [ ] Commit intentional changes locally. The gateway owns publication after operator approval. +- [ ] Complete through `{{TASK_DIR}}/mark complete --mark-last`, or write the no-change report and mark no-change when every finding was rejected. diff --git a/farmslot/projects/audiolab-farm/templates/worker/review.md b/farmslot/projects/audiolab-farm/templates/worker/review.md new file mode 100644 index 000000000..71dbfff41 --- /dev/null +++ b/farmslot/projects/audiolab-farm/templates/worker/review.md @@ -0,0 +1,10 @@ +# Audiolab publication review + +Review the diff, source, recorded evidence, existing CI results and deterministic receipts only. Tests and code validation belong to CI. Do not run tests, builds, recipes, installs, probes or validation scripts. Missing evidence is a finding or marked unverified. + +- [ ] Read the task, worker report and `{{RUNTIME_DIR}}/review-quality.md`. Inspect the full contribution diff and relevant callers. +- [ ] Review audio lifecycle, native/JS boundaries, resource cleanup and public package compatibility. Check correctness, regression-test quality, scope and the repository rules. +- [ ] Read recorded CI results and `artifacts/deterministic-checks/` receipts/logs. Check their source identity and evidence limits; do not mark worker CI steps. +- [ ] Inspect the author's recipe, trace and retained media against each claim. Do not rerun proof or collect replacement evidence. For an upgrade, each claim that the app still works needs recorded before/after results of the same recipe; missing pairs are ISSUES. +- [ ] Write `{{TASK_DIR}}/{{REVIEW_FEEDBACK}}` with `## Verdict: PASS` or `## Verdict: ISSUES`, concrete findings with file and line, recorded evidence and unchecked areas. +- [ ] Complete through `{{TASK_DIR}}/mark --checklist {{REVIEW_CHECKLIST}} --signal {{REVIEW_SIGNAL}} complete --mark-last`.