Conversation
Addresses the consolidated policy editor / AI Policy Assistant bug cluster: - 013 artifact: strip C0/C1 control chars at the markdown boundary (new sanitizeMarkdown) so stray glyphs never reach the document. - CS-418a: preserve tableHeader cells in the content validator instead of collapsing header rows to a single empty cell. - CS-256: tie proposePolicy success to real content and show an "incomplete + Retry" card instead of a false "Policy updated" on a truncated/blank run. - CS-265: fix the list-item position off-by-one in buildPositionMap and unwrap list wrappers on apply so single/multi-bullet edits replace the intended item(s) without bleeding into neighbors or splitting the list; also fix a leading-blank-line trim that desynced lineToPos for list-first documents. - Hung/"Interrupted" runs: add maxOutputTokens (chat + edit-section), raise chat maxDuration, add a Retry affordance (regenerate), and an AbortController+timeout on the section-edit fetch. - SALE-65 + CS-265 formatting: consolidate the hand-rolled markdown converters into one symmetric mark-aware encoder/decoder (policy-markdown) used by the diff and apply paths, and neutralize inline-marker differences in normalizeContent so markup asymmetry can't create phantom suggestions. Adds 35 unit tests (converter round-trip, real-ProseMirror list apply, card-state, table headers). No production behavior outside the policy AI editor is touched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[dev] [tofikwest] tofik/fix-policy-ai-editor-cs427
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
The previous commit added inline-marker stripping to normalizeContent as a phantom-diff safety net, but it backfired: a user asking only to bold/italic/ code a phrase (same words) normalized to "no change", so zero suggestions were produced and the formatting was silently dropped despite the assistant reporting success. The markdown encoder is already mark-aware and symmetric with the model's output, so unchanged formatted content compares equal without stripping. Remove the inline-marker strip (keep block-marker + whitespace normalization) so explicit formatting edits surface as accept-able suggestions and apply as real marks. Adds regression tests for bold-only and link-only changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lti-edit merge Found via a new deterministic end-to-end pipeline harness (start doc + AI markdown -> positionMap -> diff -> apply against real ProseMirror), which reproduces "accept all" without a deploy. - Insert position: jsdiff's oldStart for an insertion is the line to insert BEFORE; resolveHunkPositions now collapses inserts to a zero-width point at that boundary (was inserting AFTER the anchor, so a new bullet landed below its intended neighbor). Exposed by the list-first lineToPos alignment fix. - Paragraph/heading modify: replacing a textblock's content range with a whole block node split the block and left an empty paragraph. buildReplacementNodes now splices inline content for same-shape textblock edits. - Multi-edit data loss: mergeOverlappingRanges merged two modifies across a gap, dropping the unchanged content between them (e.g. a heading) from the merged proposedText -> it was deleted on apply. Now only overlapping ranges and adjacent section-deletes merge. Adds a 17-scenario e2e harness (single/multi bullet, ordered lists, inserts, deletes, inline marks, multi-section edits, full-policy generation) as a permanent regression guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Section deletes left an empty heading behind, and any non-list delete/modify left an empty block, because non-list blocks mapped to their inner content range (single-bullet edits only worked because list items already use boundaries). Map every block to its outer [before, after] boundary so accept/delete operate on the whole block. This also lets modifies replace the whole node cleanly, so the textblock inline-splice workaround is removed. Also extract the heading-led delete-section extension into a pure, tested helper (extendDeleteRangesToSections) shared by the hook and the e2e harness. Harness now covers section delete, no-op proposals, and stray-whitespace normalization (20 scenarios). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… blockquote) Round 3 scenarios — all pass except a documented known limitation: a heading-LEVEL-only change (## -> ###) or block-type change with identical text is suppressed by normalizeContent's block-marker stripping (it.skip with a note). Text edits to any block work; pure structural changes are out of scope. 26 e2e scenarios total. No production changes this round. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses a P1 from automated review (identified by cubic): the nearest-position fallback for pure inserts used `near.to` unconditionally, so when the nearest mapped line is AFTER the insertion anchor (e.g. an insert in a double-blank gap where both neighboring lines are unmapped), content was placed after that block instead of before it. Now the side is chosen by the nearest line's position relative to the anchor (.from when at/after, .to when before). Adds tests for both sides. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[dev] [tofikwest] tofik/fix-policy-ai-editor-cs427
Contributor
|
🎉 This PR is included in version 3.83.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Stabilizes the Policy AI Assistant and editor to prevent interrupted/empty runs and ensure precise list, paragraph, and section edits. Cleans model markdown, preserves table headers, keeps inline-formatting-only changes, and adds retry/timeout safeguards.
maxDurationto 300s and setmaxOutputTokens(chat: 16000,edit-section: 4000); tool card shows correct states with Retry.Written for commit c38b1d5. Summary will update on new commits.