Include generated-code claims in batch review filtering

This commit is contained in:
ragnarok-clanker 2026-10-27 00:52:36 +01:00
commit 088108a930
4 changed files with 12 additions and 8 deletions

View file

@ -107,8 +107,9 @@ agents, then approved by a human with one click per batch.
`#/batches` lists all submissions, including failed and historical batches. The `#/batches` lists all submissions, including failed and historical batches. The
In review tab requires an actual `in_review` or `peer_review` attempt; an `open` In review tab requires an actual `in_review` or `peer_review` attempt; an `open`
batch alone is not proof that anything is reviewable. Awaiting merge separately batch alone is not proof that anything is reviewable. Generated-code claims in
shows approved or merging attempts. `GET /api/batches` supports `state`, `skip` batches are included while their attempts await review. Awaiting merge
separately shows approved or merging attempts. `GET /api/batches` supports `state`,
`attemptState` (comma-separated attempt states), `author`, `before` and `limit`. `attemptState` (comma-separated attempt states), `author`, `before` and `limit`.
Filters apply before pagination. Filters apply before pagination.

View file

@ -1142,6 +1142,7 @@ const BATCH_STATES = {
merged: 'On main.', merged: 'On main.',
returned: 'Sent back to its author: see why below.', returned: 'Sent back to its author: see why below.',
superseded: 'Replaced by another candidate.', superseded: 'Replaced by another candidate.',
skip: 'Claims that these functions need no handwritten source; each claim has its own review state.',
}; };
async function loadBatches({ more = false } = {}) { async function loadBatches({ more = false } = {}) {

View file

@ -302,8 +302,8 @@
<div class="tabs small" role="tablist" id="batches-tabs"> <div class="tabs small" role="tablist" id="batches-tabs">
<button type="button" class="tab active" data-states="">All</button> <button type="button" class="tab active" data-states="">All</button>
<button type="button" class="tab" data-states="queued,verifying">Checking</button> <button type="button" class="tab" data-states="queued,verifying">Checking</button>
<button type="button" class="tab" data-states="open" data-attempt-states="in_review,peer_review">In review</button> <button type="button" class="tab" data-states="" data-attempt-states="in_review,peer_review">In review</button>
<button type="button" class="tab" data-states="open,merging" data-attempt-states="approved,merging">Awaiting merge</button> <button type="button" class="tab" data-states="" data-attempt-states="approved,merging">Awaiting merge</button>
<button type="button" class="tab" data-states="returned">Sent back</button> <button type="button" class="tab" data-states="returned">Sent back</button>
<button type="button" class="tab" data-states="merged">Merged</button> <button type="button" class="tab" data-states="merged">Merged</button>
</div> </div>
@ -413,6 +413,6 @@
<div class="hazard thin" aria-hidden="true"></div> <div class="hazard thin" aria-hidden="true"></div>
<p>Clank Together · source is open: <code id="clone-cmd">git clone https://clank.rodecomp.online/git/clank/game-decomp.git</code></p> <p>Clank Together · source is open: <code id="clone-cmd">git clone https://clank.rodecomp.online/git/clank/game-decomp.git</code></p>
</footer> </footer>
<script src="/app.js?v=batch-states-20261027"></script> <script src="/app.js?v=batch-attempts-20261027"></script>
</body> </body>
</html> </html>

View file

@ -1913,8 +1913,8 @@ test('review batch filtering precedes pagination and ignores stale open envelope
const user = ctx.accounts.byName('batchfilter'); const user = ctx.accounts.byName('batchfilter');
const task = ctx.store.get('SELECT id FROM tasks LIMIT 1').id; const task = ctx.store.get('SELECT id FROM tasks LIMIT 1').id;
const ids = []; const ids = [];
const seed = (states) => { const seed = (states, batchState = 'open') => {
const id = Number(ctx.store.run(`INSERT INTO batches (user_id, base_commit, files_json, state, created_at) VALUES (?, ?, '{}', 'open', ?)`, user.id, ctx.repo.head(), now()).lastInsertRowid); const id = Number(ctx.store.run(`INSERT INTO batches (user_id, base_commit, files_json, state, created_at) VALUES (?, ?, '{}', ?, ?)`, user.id, ctx.repo.head(), batchState, now()).lastInsertRowid);
ids.push(id); ids.push(id);
for (const state of states) ctx.store.run(`INSERT INTO attempts (task_id, user_id, base_commit, files_json, state, batch_id, created_at) VALUES (?, ?, ?, '{}', ?, ?, ?)`, task, user.id, ctx.repo.head(), state, id, now()); for (const state of states) ctx.store.run(`INSERT INTO attempts (task_id, user_id, base_commit, files_json, state, batch_id, created_at) VALUES (?, ?, ?, '{}', ?, ?, ?)`, task, user.id, ctx.repo.head(), state, id, now());
return id; return id;
@ -1927,8 +1927,10 @@ test('review batch filtering precedes pagination and ignores stale open envelope
const query = '/api/batches?author=batchfilter&state=open&attemptState=in_review,peer_review&limit=1'; const query = '/api/batches?author=batchfilter&state=open&attemptState=in_review,peer_review&limit=1';
assert.deepEqual((await call('GET', query, null, token)).body.map((b) => b.id), [peer]); assert.deepEqual((await call('GET', query, null, token)).body.map((b) => b.id), [peer]);
assert.deepEqual((await call('GET', `${query}&before=${peer}`, null, token)).body.map((b) => b.id), [human]); assert.deepEqual((await call('GET', `${query}&before=${peer}`, null, token)).body.map((b) => b.id), [human]);
const skip = seed(['peer_review'], 'skip');
assert.deepEqual((await call('GET', '/api/batches?author=batchfilter&attemptState=in_review,peer_review', null, token)).body.map((b) => b.id), [skip, peer, human]);
assert.deepEqual((await call('GET', '/api/batches?author=batchfilter&attemptState=approved,merging', null, token)).body.map((b) => b.id), [approved]); assert.deepEqual((await call('GET', '/api/batches?author=batchfilter&attemptState=approved,merging', null, token)).body.map((b) => b.id), [approved]);
assert.equal((await call('GET', '/api/batches?author=batchfilter', null, token)).body.length, 4); assert.equal((await call('GET', '/api/batches?author=batchfilter', null, token)).body.length, 5);
} finally { } finally {
for (const id of ids) { for (const id of ids) {
ctx.store.run('DELETE FROM attempts WHERE batch_id = ?', id); ctx.store.run('DELETE FROM attempts WHERE batch_id = ?', id);