Skip to content

Fix what a Fable agent scripting a Carey brain stumbled on; atlas pictures at any angles - #49

Merged
greenpolo merged 3 commits into
mainfrom
library/dogfood-fixes
Nov 20, 2026
Merged

greenpolo merged 3 commits into
mainfrom
library/dogfood-fixes

Conversation

@greenpolo

@greenpolo greenpolo commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Requested by Nash · project thread

Why

Dogfooding PR 48: one Fable agent (xhigh, scripting on, all 31 tools) registered Carey brain 04-0180 on the new main, then listed 24 places where it got stuck or guessed. This PR fixes the bugs, the missing documentation and the misleading words among them.

What changes

  • Bug: look(registrations=...) on a deformed registration crashed with TypeError: replace() should be called on dataclass instances, because Section is a Pydantic model since the refactor. It now uses model_copy.

  • Fields documented: SectionView, AtlasView, AffineView, LayerRef, SectionRaster, FitFrame and AtlasPlane say what each field holds (order of file_size, angles as (pitch_deg, yaw_deg)...). SectionRaster carries pixel_size_um and um_per_px.

  • Folders: every job folder has scripts/ and scratch/, as AGENTS.md tells agents (the agent's first save failed).

  • Replies: position_sections reports cutting_angles_written; before, an angles-only call replied with empty lists.

  • Wording: a method can take more arguments than its tool (look's resolution, sheet); interactive_transform and the linear overlay captions say the transform moves the section onto the atlas, which keeps its place; unsupplied cutting angles read as a starting setting; a one-page opening no longer says "page=1 through page=1"; the placement skill follows the section number, not the filename sort.

  • Atlas pictures at any angles: look(mode="atlas", positions_mm=...) and grep_atlas_view take cutting_angles and draw the planes there, writing nothing; the caption says the angles were asked for and not written. Checked by eye on a real Carey job: yaw 12° shows the expected left/right asymmetry.

  • Collapsed affine fits: elastix_affine flags ANISOTROPIC when one axis is scaled more than 1.25 times the other. A warning only; the fit is written and undo takes it back.

  • Scripting agents may use any method: the launch message's scripting paragraph said the shell was "for what no tool does", and the MCP server instructions every client sees said to work only through the LangSlice tools. Both, and the three register-scripting agent definitions, now say the agent may use its own code, any package or published method, beside a tool or in place of one; what it computes counts once written into the job.

Checks

  • New tests/test_script_findings.py: an AST check that no stored shape is copied with dataclasses.replace, field documentation on every returned object, the deformed-registration look, the folders, the angles reply and the opening wording.
  • pytest 23 passed, ruff, ruff format, basedpyright (0 errors), import-linter all pass locally.

Left for a decision

Not made, on Nash's call: blocking fireants_syn from writing a fit it flags (the agent undoes it instead) and plane-search trial scores. Still open: landmark markers on every overlay, larger tool pictures, hoisting repeated per-section reply blocks.

🤖 Generated with Claude Code

A Fable agent registered Carey brain 04-0180 with scripting and every tool,
then listed where the library and tools confused it. This fixes the ones
that are bugs, missing documentation or misleading words:

- look(registrations=...) under a deformed registration crashed: a stored
  Section (a Pydantic model since the refactor) was copied with
  dataclasses.replace. It now uses model_copy.
- Every object a script gets back (SectionView, AtlasView, AffineView,
  LayerRef, SectionRaster, FitFrame, AtlasPlane) says what each field holds.
  SectionRaster carries the pixel size and um_per_px.
- Every job folder has scripts/ and scratch/, as AGENTS.md tells agents.
- position_sections reports the cutting angles it wrote.
- The scripting lines and AGENTS.md say a method can take more arguments
  than its tool (look's resolution and sheet).
- interactive_transform and the linear overlay captions say the transform
  moves the section onto the atlas, which keeps its place.
- Unsupplied cutting angles read as a starting setting, not a measurement.
- A one-page opening no longer says "page=1 through page=1".
- The placement skill says to follow the section number, not the filename's
  sort order.

tests/test_script_findings.py holds each: an AST check that no stored shape
is copied as a dataclass, field documentation on every returned object, the
deformed-registration look, the folders, the angles reply and the wording.

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 19:24
@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-20T19:26:10.162268Z e495e6f 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: e495e6f2eb

ℹ️ 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 +70 to +71
flip, rotation_deg
Its orientation: mirrored left-right, then turned 0, 90, 180 or 270.

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 Document rotation before mirroring in SectionView

For sections with flip=True and a 90° or 270° rotation, the documented operation order produces a different orientation from the image LangSlice actually renders. core/sections/renders.py::render_slice rotates first and then flips left-right, as also documented by Section and SectionRaster. A script following this new field documentation to orient pixels or landmarks will therefore place them incorrectly. Describe the rotation before the flip to match the actual coordinate contract.

Useful? React with 👍 / 👎.

look(mode="atlas", positions_mm=...) and grep_atlas_view take
cutting_angles ({"pitch_deg", "yaw_deg"}) and draw the planes at those
angles, writing nothing; the caption says they were asked for and not
written. Before, an agent had to write the angles to the stack to see a
plane at others, then undo.

elastix_affine flags a fit that scales one axis more than 1.25 times the
other ANISOTROPIC (a warning; the fit is written and undo takes it back).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greenpolo greenpolo changed the title Fix what a Fable agent scripting a Carey brain stumbled on Fix what a Fable agent scripting a Carey brain stumbled on; atlas pictures at any angles Nov 20, 2026
…ools

The scripting paragraph of the launch message said the shell was "for what
no tool does", and the MCP server's instructions, which every client sees,
said to work only through the LangSlice tools. Both now leave the choice to
the agent: its own code, any package or published method, beside a tool or
in place of one; what it computes counts once it is written into the job.
The three register-scripting agent definitions say the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greenpolo
greenpolo merged commit 8105a6b 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