Skip to content

Give every fix-first finding a suggested improvement #74

Done

Description

@Pranav-Mathad

Owner: Pranav · Priority: P0 · Blocked by: the issue-12-found-problems branch landing on main (it edits report/templates.py)

Parallel work: Can be written while the other two issues wait; it must be on main before the final run.

1. Goal

Every finding in the "fix first" list says what to do about it. Today most of them do not.

The sponsor's judging hints ask that the tool "suggests realistic improvements", and spec §11.4 item 3 says the top 10 each carry "facts, claim, fix and simulation result". In the bundles on main:

Repo Top 10 by type Top 10 with any fix text
artemis 3 shaky_foundation, 3 cheap_loop, 3 hidden_partners, 1 broken_rule 3
graylog 3 shaky_foundation, 3 cheap_loop, 3 hidden_partners, 1 foundation_on_features 3
shopware 3 shaky_foundation, 2 overloaded_class, 2 broken_rule, 2 cheap_loop, 1 hidden_partners 2

Ranks 1 to 3 are shaky_foundation in all three, and templates._fix returns an empty fix for every type except cheap_loop. Running codexray judge does not close this: job B only covers broken_rule, cheap_loop, foundation_on_features and overloaded_class (settings/judge.yaml, job_b.types), so shaky_foundation, hidden_partners and large_complex_changed keep an empty fix either way.

2. Decide first (spec)

The spec is not consistent here: §11.4 promises a fix for each of the top 10, while §8.3 and §9.3 give the three pressure-point types none. Settle it in a small spec pull request before any code. Two ways:

  1. Fix text built from stored facts, per type (proposed). No AI call, so the report stays complete with zero AI calls (§8.7) and nothing is detected by a model. Shown as "not simulated" unless the fix removes a specific link.
  2. Extend job B to these types. Needs new verdicts in §8.3, a change to core/contracts.py, and more AI calls. Only if option 1 reads too thin on the real findings.

If neither gives an honest suggestion for a type, the finding says "no improvement proposed" in plain words instead of showing an empty field.

3. Scope & File Boundaries

Create or edit

  • spec.md §8.7 and §11.4 (own pull request, first)
  • src/codexray/report/templates.py (_fix), src/codexray/settings/report.yaml for any wording or limit
  • src/codexray/analyze/history_findings.py only if a fact the sentence needs is not stored yet

Do not touch

  • src/codexray/core/contracts.py: use the existing Fix.action values. If a new one is needed, stop and follow "Changing a contract" in CONTRIBUTING.md.
  • src/codexray/judge/.

4. Implementation Steps

  1. For each of the three types, list which facts and evidence the finding already stores (shaky_foundation: direct_users, changes_12m, evidence roles direct user and changes; hidden_partners: shared_commits, shared_share, the two partner files; large_complex_changed: top_functions, branches, lines).
  2. Write one fix sentence per type that uses only those values and names, for example naming the functions in top_functions to split, or the two partner files whose shared part should get one owner.
  3. Every number in the sentence is a fact value and every code name is in the facts, a path or a cited slice, the same rule job B's text must pass (§8.4).
  4. Keep the wording rules of spec §12.4 and AGENTS.md: calm, no blame, limits stated.

5. Acceptance Criteria & Verification

No new test cases; run it and look (TEAM_RULES.md rule 3).

  • uv run codexray report --repo <id> on all three repos, twice each: findings.json is byte for byte the same on the second run.
  • In each repo's top 10, every finding has fix text or the plain "no improvement proposed" line. State the count per repo in the pull request.
  • Open the Decisions screen for each repo and read the first ten suggestions against the code they point to. Say in the pull request which ones read as realistic and which do not.
  • make check passes.

Branch: issue-74-suggested-improvements. Open a pull request whose description says Closes #74. The specification is spec.md; the working rules are in AGENTS.md, TEAM_RULES.md and CONTRIBUTING.md.

Activity

  1. added
    owner:pranav
    P0
    on Nov 29, 2026
  2. Pranav-Mathad commented on Nov 29, 2026

    @Pranav-Mathad
    OwnerAuthor

    The spec step is up as a pull request (#78). It takes the first way: fix text built from stored facts, no AI call, no contract change. Every placeholder is a value the findings already store, so the code step needs no new Stage 5 fact and stays in report/templates.py.

    Three things for the code step, found while checking the spec text against the code on main:

    1. Wording in the web app. web/src/screens/decisions/FixFirst.tsx shows "No fix proposed." when fix.action is none (line 272). The spec now says "No improvement proposed." One of the two has to change; that file is in the web lane.
    2. Empty text with an action. The same screen decides whether to show a fix from fix.action !== "none", not from the text (line 256). A fix with an action and empty text would render an empty span. The template must never produce that pair: when a needed value is missing, return action none.
    3. Hidden partners must stay not simulated. Its action, extract_interface, is in LINK_REMOVING in src/codexray/judge/jobs.py (line 54), which sends a fix to simulate_remove_link. It is not simulated today only because a finding without both a source and a target target returns not_simulated() first (lines 259 to 260), and hidden partners use the role partner. Check after the change that all three types still come out as "not simulated".

    Also: top_functions is one preformatted string holding one or two function names with line ranges and no branch counts (analyze/history_findings.py, lines 220 to 224). The fix sentence uses it whole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0owner:pranav

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions