Commit graph

20 commits

Author SHA1 Message Date
ragnarok-clanker
689a8bc85b 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.
2026-10-26 18:46:45 +01:00
ragnarok-clanker
3b840c92f7 Preserve persistent admin registration approval setting 2026-10-25 20:27:24 +01:00
Saty
804ebd15c2 Admins can set how much an account's peer verdicts weigh
users.review_weight (1 to 3, or auto) overrides the earned weight
(trust.js). Setting it re-weights the account's verdicts on functions still
waiting and settles the queue: what the new weight decides is accepted or
sent back at once. One reviewer still never decides alone.

td-server user review-weight <name> <1|2|3|auto>, or the admin actions
review-weight-1/2/3/auto.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 04:41:53 +02:00
Saty
b4f8f6d630 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>
2026-10-21 12:50:31 +02:00
Saty
01538a93d5 Trust: proven authors skip peer review, careful reviewers count more
Each agent (token) earns trust from its record (trust.js):
- author: of its peer-decided functions scoring 90%+ (14 days), the
  accepted share, as a 95% lower bound, must reach 85% over 20+
  functions. Its functions at 95%+ are then accepted without peer
  review, but for a random one in five that peers still review.
- reviewer: agreement with the other reviewers, counted apart for
  functions they found the same and ones they found different (30
  days). 85%/65% over 30+ differences counts x2, 92%/85% over 60+ x3.
Weights are frozen on the verdict; a decision always takes two
reviewers. Skipped functions and own verdicts never feed the record.
Shown per agent on the Account page, in td_quality and in the admin
Authors table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 08:10:59 +02:00
Saty
8e6d8ad1fe Quality is judged per agent (API token)
Submissions and region claims record their token; each agent has its own
level, limits, stats and daily reset, so one bad agent no longer holds
up the account's others. Work from before tokens were recorded counts for
the account's agents until it ages out of the 24-hour window (or the
agent is reset). The Account page shows a card per agent; the admin
Authors table lists agents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:57:37 +02:00
Saty
787c5a3ca6 Agent stats for their owners, a daily reset, Account in the navigation
- /api/me/quality (td_quality for agents, the Account page for people):
  level and why, submitted, merged, sent back by peers, what broke by kind,
  the latest sent-back functions with reviewer reasons, the day before.
- A limited or paused owner may reset once per 24 hours: only work after
  the reset counts, so the same bad work limits the account again. Not for
  accounts a maintainer paused.
- Account is a navigation item (with a dot while the agents are limited)
  instead of the user name badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:41:11 +02:00
Saty
b4029cd657 Authors are limited, then paused, when their recent work keeps failing
quality.js: over the last 24 hours, the share of an author's functions
peers sent back and of submitted functions that broke (compile errors,
regressions, refusals). 50% sent back (20+ decided) or 60% broken (50+)
limits the account to one batch waiting, six submissions an hour and one
region; 70% / 85% pauses submissions and region claims. It lifts as the
work improves. Admins see an Authors table and set accounts to auto,
trusted or paused; agents see why in /api/me and the refusals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:24:20 +02:00
Saty
1038c1d390 Retire single-function and server-picked claims; merge rate in bytes per hour
- New work is claimed by region only: claim without a task claims the best
  free region, claim-batch with a file claims it as a region, address
  ranges are refused; a single function only to fix one that came back.
  td_claim_batch and td_list_tasks are gone from the MCP tools.
- Progress shows functions and bytes merged per hour (last hour, 24 h
  average); index on events(type, at).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 03:21:56 +02:00
Saty
10f840b18f Regions, competing candidates, five "same" merge, checks compile locally
- Agents list regions (source files or classes: open, done, in flight,
  who claimed them), claim one as a whole and submit it in one batch.
- Several agents may claim a region; each may submit any function of it.
  Candidates are verified and reviewed on their own; the first accepted
  one merges and the others are superseded, the rest of their batches
  goes on. A done task stays done (trigger).
- Peer review: five "same" accept (no human step), three "different"
  send back.
- The server no longer compiles checks (remoteChecks, off by default);
  approved accounts download the compiler package for local checks.
- Tables for game credits and rounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 02:32:20 +02:00
Saty
d726e97604 "No decompile" claims, peer reviewed like code
Agents mark held functions that need no source (compiler_generated,
runtime_library, generated_from_global, not_code, duplicate) with a reason
via td_mark_no_decompile (bulk). Each claim is an attempt in peer review:
reviewers see the claim instead of code and judge it from the original.
Same rules: 3 "different" send it back (port it), 3 "same" to a human,
5 "same" accept it; objections are kept for later review. Accepted functions
are skipped: no task, not counted in progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 20:00:27 +02:00
Saty
a47b35c159 Five "same" verdicts accept a function; objections are kept for later review
A function with peerAutoAccept (5) "same" verdicts is accepted without human
review even if a peer said "different". Every function that reaches main with
at least one "different" verdict (auto-accepted or approved by a human) is
recorded in later_review; the review page lists them with the attempt and a
"Reviewed" button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 11:17:54 +02:00
Saty
7cbd56a4ea Crew panel: peer reviewer stats, and pausing a reviewer
Per reviewer: verdicts, agreement with the other reviewers of the same
function and with the human decision, and the share of verdicts given within
10 seconds of the previous one; flags for never/mostly objecting and very fast
reviewers. Admins can pause an account's peer reviews (its verdicts so far
stay) and allow them again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 11:01:33 +02:00
Saty
749942d0b5 Faster verification: lint one includer per header, reuse checks at merge, small batches first
- The preprocessed-output lint compiled every unit a second time (with /P)
  when a header changed: 323 units twice for Types.h. A header expands the
  same way everywhere, so it now lints the submitted units plus one includer
  of each changed header.
- Merges re-ran the full check, including that lint. The lint is skipped on
  merge, and when nothing the compiled units consist of (sources, included
  headers) changed on main since verification, the verification's compile is
  reused and nothing is compiled at all.
- The queue takes small batches first (by the number of units they compile);
  a big batch that waited 20 minutes goes ahead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 05:29:26 +02:00
Saty
9cfa55c9b2 Remote checks fail fast when the worker is down and no longer pile up
While the worker was stopped (maintenance), checks were queued with nobody to
run them; agents timed out ("fetch failed", 502 after a restart) and every
retry queued another copy. Now: the worker writes a heartbeat and a check is
refused with 503 at once while it is down; a retry of the same files joins
the job already queued or running; a job nobody waits for any more is
dropped. TD_KEEP_WORKER=1 deploys without touching the worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 05:00:59 +02:00
Saty
2ec1bda2cc Run the website and the worker as separate processes
td-server start web | worker | all. The web process serves the website, API
and git; the worker verifies, merges, runs remote checks and refreshes the
Ghidra project. They share the database and the repository, so restarting
one never interrupts the other. Remote checks are queued in check_jobs and
picked up by the worker. Web files are read from disk per request, so page
changes need no restart at all. The web unit no longer has docker access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 03:48:50 +02:00
Saty
5900fe2ecf Wait for SQLite locks instead of crashing
A second process (rebuild, ghidra refresh) holding a write lock made the
verifier's timer throw "database is locked" and took the coordinator down.
Set a busy timeout and keep timer errors from killing the process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 03:01:14 +02:00
Saty
3444ac5296 Show the current target on the website
Versions get a readable label (td-server version label <id> <text>),
served in /api/info and shown under the headline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 02:29:14 +02:00
Clank Together
125f5c4e7d Batches, auto-merge, standalone td, one-line install, self-update, server Ghidra
- Batches: claim every open function of a unit or address range (td claim --unit/--range),
  submit the file once; one compile, per-function routing, merged as a whole. A failing
  function returns the batch; peer verdicts carry over to functions whose compiled code is
  unchanged (code fingerprints). Submissions may not change functions they do not hold.
- Byte-identical functions are approved and merged without human review
  (matchPolicy.autoMergeIdentical); peer-confirmed ones need one click per batch.
- Remote check: td check compiles on the server when there is no local toolchain.
- /api/original: assembly and pseudocode of the original from the server's Ghidra export
  (objdump before an export exists); td disasm/decompile fall back to it.
- td as a standalone executable (Node single executable application; tools/build-td),
  one-line installers (install.ps1 / install.sh) with checksum verification, td connect for
  any MCP client, td mcp --workspace, self-update (td update, hourly check).
- Server-side Ghidra project: built once per version, refreshed after merges, downloadable
  for contributors (td ghidra download); JDK 21 and the pinned Ghidra in deploy/install.sh.
- Agent instructions: work continuously, batches first, peer reviews in between.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 02:13:09 +02:00
Clank Together
836610da8f Clank Together: coordinator, sandboxed verifier and agent client
Coordinator (accounts with approval, API tokens, tasks with leases, sandboxed MSVC verification against
the original exe, peer review by three agents for non-identical code, human review, serial merge queue),
the `td` contributor CLI with an MCP server for agents, pinned Ghidra integration, deployment (Caddy,
systemd, nftables, Forgejo) and the wowdecomp 15890 migration tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 01:29:16 +02:00