Add maintenance batches and symbol corrections for maintainers

A maintenance batch carries structural source changes that belong to no function task (moving a global to its owner, fixing data annotations, adding a header or unit). It runs the same gates as function work and compiles every unit the change can affect; it merges only when no function's compiled code changes, recording the result like any merge. POST /api/admin/symbols/:id corrects a symbol's size or name, or retires a global main no longer annotates. td maintenance submit|symbol drive both.
This commit is contained in:
ragnarok-clanker 2026-10-26 18:46:45 +01:00
commit 689a8bc85b
8 changed files with 310 additions and 3 deletions

View file

@ -90,6 +90,7 @@ export class Verifier {
`SELECT b.* FROM batches b WHERE b.state = 'queued'
ORDER BY (SELECT COUNT(*) FROM batches v WHERE v.user_id = b.user_id AND v.state = 'verifying'), b.id LIMIT 1`,
);
if (row && row.kind === 'maintenance' && !this.maintenance) return null;
if (row) {
this.store.run(`UPDATE batches SET state = 'verifying' WHERE id = ?`, row.id);
this.store.run(`UPDATE attempts SET state = 'verifying' WHERE batch_id = ? AND state = 'queued'`, row.id);
@ -98,7 +99,9 @@ export class Verifier {
});
if (!b) return;
this.running++;
this.verifyBatch(b)
// A maintenance batch verifies and merges in one step (maintenance.js).
const job = b.kind === 'maintenance' ? this.maintenance.run(b.id) : this.verifyBatch(b);
job
.catch((e) => {
this.log.error(`batch ${b.id}: verifier crashed: ${e.stack}`);
for (const a of batchAttempts(this.store, b.id)) {