Repository navigation
Description
Owner: Pranav · Priority: P1 · Blocked by: #5, #19, #23, #24, #25
Parallel work: Parallel with #7, #9, #10.
1. Goal
Write checked AI text for the findings the report will show (job B) and two-sentence module descriptions (job C), simulate fixes, and keep the report complete when every AI call fails (spec §8).
2. Scope & File Boundaries
Create or edit
src/codexray/judge/__init__.py, newpacket.py,jobs.py,prompts.pysrc/codexray/settings/judge.yaml- New
tests/judge/test_packet.py,test_jobs.py; remove thejudgeline fromSTUBS
Do not touch
src/codexray/judge/types.py,checks.py,client.py,simulation.py(Aryan: Module: checks on every AI response (judge/types.py,judge/checks.py) #23, Module: gateway client with cache and usage ledger (judge/client.py) #24, Module: fix simulation on a copy of the map (judge/simulation.py) #25).
3. Contracts / Inputs & Outputs
Reads: candidate_findings, nodes, edges, blob contents. Writes: judgements/ (cache files from #24 plus one Judgement per judged finding), usage.json, simulation_batch.json, module descriptions.
from codexray.judge.types import Packet, Slice # #23
from codexray.judge.checks import check_response, CheckFailure # #23
from codexray.judge.client import Gateway # #24
from codexray.judge.simulation import simulate_move, simulate_remove_link, simulate_batch # #25
from codexray.report.ranking import rank # #19, to know which findings are shownPacket (spec §8.2): about 5,000 tokens, facts first, 2 to 4 numbered code slices, at most about 250 lines, never a whole file over 300 lines. Repository text is data; the system instruction says so. Output schema: spec §8.3.
4. Implementation Steps
packet.py: build aPacketper finding from facts, neighbourhood, history and slices (file outline, offending lines with 5 either side, imported declaration).jobs.py: job B with 3 votes per shown finding; verdict by majority; claim and fix from the majority sample passing the most checks; one retry with the failing check's message; a second failure storesinsufficient_evidenceand the template. Each finding is judged alone.- Simulation: for
move_symboland link-removing fixes call Module: fix simulation on a copy of the map (judge/simulation.py) #25 with the module link matrix; then the batch of all cheap-loop fixes in finding-id order. - Job C per module; re-run only when its evidence changes.
- No sampling settings, no prefill, no forced tool choice (spec §8.8). The shared instruction prefix stays above 512 tokens so it caches.
5. Acceptance Criteria & Verification
uv run pytest tests/judge -qpasses with a fake transport, including: a response whose number is not a fact is rejected; a prompt-injection comment in a slice does not change the verdict path; with the transport failing, every finding still gets a template judgement.- A second
codexray judgemakes zero network calls (all cache hits) and leaves the outputs byte-identical. - On Artemis: about 20-25 judged findings, three calls each; total cost in
usage.jsonis a few dollars.
Branch: pranav/8-ai-jobs-b-and-c. Open a pull request whose description says Closes #8. The specification is spec.md; the working rules are in AGENTS.md and CONTRIBUTING.md.
Activity
Pranav-Mathad commentedon Nov 28, 2026
Handing this one to Aryan: it wires together
judge/types.py,checks.py,client.pyandsimulation.py. The "Do not touch" list above no longer applies to those files for you.Where things stand:
candidate_findingscomes from Stage 5: decisions, decision checks and structural findings (codexray analyze) #5 (yours). Until it produces rows, the two synthetic bundles inweb/public/bundles/have findings of all seven types with evidence and code files (fixture-widehas 11).main(Settle the web bundle contract, fixtures and screen seams #48):Simulation.cell_changesandBatchSimulation.cell_changes(list ofCellChange { src, dst, before, after }) are what the grid's "Try the fix" reads;NodeDescription { node_id, text, source }is where job C's text goes inmap.json;UsageRowis the per-job ledger row inreport.json.repos/<repo_id>throughcodexray.repository.git.cat_file, by theblob_shaon the evidence record.judgeline fromSTUBS.#6 (report and bundle) picks up
judgements/,usage.jsonandsimulation_batch.jsonif they are present, so the report stays complete without this.Pranav-Mathad commentedon Nov 28, 2026
PR #68 (closes #10) adds what the pull-request-goal label needs from Stage 1, for when job B is in:
prsis now filled bycodexray ingestfor the commits instructural_events(title, description, linked issues, review count, checks, AI footer), cached inpr-cache/in the run folder. Artemis: 37 asked for, 37 stored. Set the token named insettings/repository.yaml(prs.token_env) on the ingest, otherwise the table is empty and the manifest says how many are missing.report/before_after.pybuilds the labelled changes inbefore_after.json. It tries the bases of spec §12.3 in order and skips the fourth (pr_goal,source="ai"); the place to add it is theheldmapping passed toadd(...), afterdecision_document. Changes with a commit carry it as evidence of kindcommits, so the pull request iscommits.pr_numberof that commit.One thing seen in
prs.pywhile checking rows: a pull request whose head commit lists no check runs getschecks = 'none', which is every Artemis pull request stored before #12699, so for those the field does not mean the checks passed.