Speed up trust: cache the tracking start, index reviews by reviewer, use attempts.score
The admin Authors table computed trust for all 121 agents in ~30 s, blocking the web process (arcade, admin, everything) meanwhile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7120dcaebc
commit
b4f8f6d630
3 changed files with 8 additions and 4 deletions
|
|
@ -1345,8 +1345,8 @@ test('trust: careful reviewers count more, trusted authors skip peer review, one
|
|||
await mk(3, 'trustpeer');
|
||||
const peers = [0, 1, 2].map((i) => ctx.accounts.byName(`trustpeer${i}`));
|
||||
const attempt = (userId, tokenId, score, state = 'merged') =>
|
||||
Number(ctx.store.run(`INSERT INTO attempts (task_id, user_id, token_id, base_commit, files_json, state, result_json, created_at) VALUES (?, ?, ?, ?, '{}', ?, ?, ?)`,
|
||||
task, userId, tokenId, head, state, JSON.stringify({ feedback: { target: { score } } }), now()).lastInsertRowid);
|
||||
Number(ctx.store.run(`INSERT INTO attempts (task_id, user_id, token_id, base_commit, files_json, state, score, result_json, created_at) VALUES (?, ?, ?, ?, '{}', ?, ?, ?, ?)`,
|
||||
task, userId, tokenId, head, state, score, JSON.stringify({ feedback: { target: { score } } }), now()).lastInsertRowid);
|
||||
const verdict = (a, userId, v, tokenId = null) =>
|
||||
ctx.store.run(`INSERT INTO peer_reviews (attempt_id, reviewer_id, token_id, verdict, reason, created_at) VALUES (?, ?, ?, ?, 'the loop bound and the call match the original', ?)`, a, userId, tokenId, v, now());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue