Skip to content

Affine fits at a candidate plane; tool texts the second dogfood run guessed at - #50

Merged
greenpolo merged 1 commit into
mainfrom
library/dogfood-round2
Nov 20, 2026
Merged

greenpolo merged 1 commit into
mainfrom
library/dogfood-round2

Conversation

@greenpolo

Copy link
Copy Markdown
Owner

Requested by Nash · project thread

Why

The second Fable dogfood run (xhigh, scripting, all tools, Carey 04-0180, on main after PR 49) listed where it still got stuck. Its top ask: to try a section at another position it had to write the position, fit, write it back and restore, four writes per candidate.

What changes

  • Fits at a candidate plane: job.context.fits.fit_elastix(id, position_mm=..., angles=...) fits at that plane on a copy of the stack, from the section's current transform with its deformation left out, and writes nothing. The record's fit holds the plane; overlay_picture(id, proposal={"transform": p.record, "position_mm": mm}) draws it. Checked on a real Carey job: three candidates 0.3 mm apart drawn side by side, job unchanged.
  • Texts it guessed at: look's picture number is id; make_image's gamma says below 1 brightens; interactive_transform says a change clears the deformation; mark_damage says the registration stays until the next fit; help(job) lists what each artifact kind is.

Checks

  • tests/test_script_findings.py: the candidate-plane fit leaves every status row unchanged and records its plane; the four texts.
  • pytest 26 passed, ruff, ruff format, basedpyright (0 errors), import-linter pass locally.

Not here

  • A login check before trace_borders starts: the run's 401 came from the lab OpenAI login, which needs signing in again; LangSlice already refreshes once on a 401, and I found no cheap call that proves a login without spending an image request.
  • Larger tool pictures (more tokens per picture for every agent) waits on Nash.

🤖 Generated with Claude Code

…uessed at

The second Fable run's top ask: trying a section at another position meant
writing it, fitting, writing it back and restoring, four writes per
candidate. job.context.fits.fit_elastix takes position_mm and angles and
fits at that plane on a copy of the stack, writing nothing; the proposal's
record says the plane it was made at, and overlay_picture draws it there.

The texts it had to guess at now say it: look's picture number is `id`,
make_image's gamma direction, interactive_transform clearing a deformation,
mark_damage leaving the registration until the next fit, and what each
artifact kind of a script's reply is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greenpolo greenpolo self-assigned this Nov 20, 2026
@greenpolo
greenpolo marked this pull request as ready for review November 20, 2026 21:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T21:43:39.186286Z 47a0a41 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47a0a416ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +411 to +412
position_mm=position_mm,
angles=angles,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Build the transform proposal in the candidate plane's geometry

When a section has a noncentral stored pivot and the candidate plane changes the atlas anatomy's bounding box, the returned proposal contains inconsistent normalized parameters and physical knobs. Although elastix_fit now uses the candidate placement, the subsequent self._proposals.transform_from_params(...) still reads the original section: Proposals.transform_from_params computes the canvas size, pivot and physical translation at its original position and angles. After accepting the candidate as documented, interactive_transform reads those incorrect stored knobs through held_knobs and rebuilds the affine on the candidate canvas, unexpectedly shifting the registration even when changing an unrelated knob. Construct the proposal using the same trial state and section used for fitting.

Useful? React with 👍 / 👎.

@greenpolo
greenpolo merged commit 4f15f8b into main Nov 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant