Repository navigation
feat(map-ai): repair round for rejected ops, and accept dominant-baseline (PPT-2832) - #458
Merged
Merged
Conversation
GPT-6.1 sol adds dominant-baseline="middle" to every label it inserts. The server rejected the attribute, so each such insert failed even though its position was right. Testing on placeos-dev on 21 Oct lost 4 of 4 labels on both runs. The value is limited to the SVG 2 keywords plus text-before-edge and text-after-edge. ops-schema.json stays identical to the editor's copy in user-interfaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s (PPT-2832) When the server rejects some of an answer's ops, the runner now makes one more call inside the same job. It sends the same request plus the answer's ops and the reason for each rejection, and asks for the whole proposal corrected. The second answer replaces the first only if it is complete, parses, keeps at least as many accepted ops, and has fewer rejected. If that call fails, the first answer stands. The job's `repair` field records how many ops were rejected, how many remain and whether the answer was replaced. MAP_AI_REPAIR=false turns it off. The server now also checks the parent/after rule the editor applies: `after` must be a direct child of `parent` (the root when none is named), and a parent must be the root or a <g>. On placeos-dev, gpt-5.4-mini broke this with every label it inserted, and only the browser caught it, so no repair round could have fixed it. The check steps aside where the index cannot settle it: elements made earlier in the batch, an `after` deleted earlier in it, or a tree reshaped by reorder, group, ungroup or replace_element. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2832) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes from testing map editing on placeos-dev on 21 Oct, using five models.
1. Accept
dominant-baselineon inserted text. GPT-6.1 sol addsdominant-baseline="middle"to every label it inserts, and the server rejected every one even though the positions were right: 4 of 4 labels, twice. The attribute is now on the allowlist, and its value must be one of the SVG 2 keywords ortext-before-edge/text-after-edge.ops-schema.jsonis kept identical to the editor's copy.2. One repair round inside the job. When the server rejects some of an answer's ops, the runner makes one more call. It sends the same request plus the previous ops (with their
op-Nids) and the reason each was rejected, and asks for the whole proposal corrected. The second answer replaces the first only if it is complete, parses, keeps at least as many accepted ops, and has fewer rejected. If anything goes wrong with that call, the first answer stands. The job response gainsrepair: {rejected, remaining, used}(also in OPENAPI_DOC). It's one job and one unit of quota, and an answer that passes the first time costs nothing extra.MAP_AI_REPAIR=falseturns it off.3. The server now checks the editor's parent/after rule, so the repair round can see that mistake too.
aftermust be a direct child ofparent(the root when none is named), and a parent must be the root or a<g>. gpt-5.4-mini broke this with every label it inserted, and until now only the browser caught it. The check steps aside when the index cannot settle it: elements made earlier in the batch, anafterdeleted earlier in it (the editor then places the new element where the deleted one was), or a tree reshaped by reorder, group, ungroup or replace_element.The browser still validates every op as before. The repair round only changes which answer reaches it.
Specs:
spec/llm_prompt_spec.crandspec/controllers/map_ai_spec.cr, 66 examples, 0 failures, run locally in the spec container. They cover:Not yet measured with a live model: how often the second answer actually fixes things. I'll check on placeos-dev once this is deployed.
The editor side is PlaceOS/user-interfaces#600.
🤖 Generated with Claude Code