The junk judge: releases judged by what their probes showed; verdicts hide them
Voyager 1's second filter (D42) for voyager 2. Hourly, in order (the first rule wins): dead (every probed first article gone), fake (a film, episode or music name whose content is a program: archive entries all executables, or the file itself by name or sniffed exe), repeated (the same first 16 KiB and size in 20+ releases), locked (passworded, no password known), unusable (random names, no inner name, no merge, no spot, a day after settling). Verdicts in release_verdicts (rule, version) hide releases from search (judged shows them); a verdict whose rule no longer matches is taken back. Nothing dropped yet. Service judge; releases:judge --once --dry counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
99b72ddd8f
commit
5897d595cf
9 files changed
+324
-3
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import { BaseCommand, flags } from '@adonisjs/core/ace'
|
||||
import type { CommandOptions } from '@adonisjs/core/types/ace'
|
||||
import { ReleaseJudge, RULES } from '#services/release_judge'
|
||||
|
||||
/** The junk judge (REBUILD.md, junk): releases judged after their probes; verdicts hide them from search. */
|
||||
export default class ReleasesJudge extends BaseCommand {
|
||||
static commandName = 'releases:judge'
|
||||
static description = 'Judges releases by what their probes showed (dead, fake, repeated, locked, unusable), hourly'
|
||||
static options: CommandOptions = { startApp: true, staysAlive: true }
|
||||
|
||||
@flags.boolean({ description: 'One round, then exit' })
|
||||
declare once: boolean
|
||||
|
||||
@flags.boolean({ description: 'With --once: count only, write no verdicts' })
|
||||
declare dry: boolean
|
||||
|
||||
async run() {
|
||||
const judge = new ReleaseJudge()
|
||||
if (this.once) {
|
||||
const round = await judge.round(this.dry)
|
||||
for (const rule of RULES) {
|
||||
const r = round.rules[rule.name]
|
||||
if (r) this.logger.info(`${rule.name}: ${r.matched} (+${r.added} −${r.removed}) — ${rule.says}`)
|
||||
}
|
||||
await this.terminate()
|
||||
return
|
||||
}
|
||||
let done: () => void
|
||||
const finished = new Promise<void>((resolve) => (done = resolve))
|
||||
this.app.terminating(async () => {
|
||||
judge.stop()
|
||||
await finished
|
||||
})
|
||||
await judge.run()
|
||||
this.logger.info('Judge stopped.')
|
||||
done!()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user