Repository navigation
Conversation
cragwolfe
marked this pull request as ready for review
October 22, 2026 04:18
Contributor
There was a problem hiding this comment.
No issues found across 9 files
Shadow auto-approve: would not auto-approve. This PR does not meet the repository auto-approval settings.
View guided diff | Re-trigger cubic
ryannikolaidis
approved these changes
Oct 22, 2026
mi7ak2020-stack
approved these changes
Oct 22, 2026
cragwolfe
deleted the
codex/hl-drop-changelog-dance-drop-changel-private.complete-one-off
branch
October 22, 2026 19:48
This was referenced Oct 22, 2026
cragwolfe
pushed a commit
to SashaMIT/unstructured
that referenced
this pull request
Oct 24, 2026
… items (Unstructured-IO#4580) ## Summary A bulleted list that starts on the line right after its lead-in, with no blank line between them, loses its list items in `partition_text()`: | text | `main` | this PR | | --- | --- | --- | | `Shopping list:` / `• milk` / `• bread` | `Title("Shopping list:")`, `Title("milk")`, `Title("bread")` | `Title("Shopping list:")`, `ListItem("milk")`, `ListItem("bread")` | | `Shopping list:` / `• fresh milk and cheese from the farm market` / `• bread` | one `NarrativeText("Shopping list: • fresh milk and cheese from the farm market • bread")` | `Title`, `ListItem`, `ListItem` | `group_broken_paragraphs()` sends a paragraph to `group_bullet_paragraph()` only when the paragraph itself starts with a bullet. A lead-in line followed by bullets is one paragraph that does not, so it takes the other path: - When all lines are short, it splits the paragraph with `PARAGRAPH_PATTERN_RE`. That pattern splits at unambiguous bullets as well as at line breaks, and it captures the separator, so each `•` becomes a piece of its own. `group_broken_paragraphs("Shopping list:\n• milk\n• bread")` returns `'Shopping list:\n\n\n•\n\n milk\n\n\n•\n\n bread'`, `partition_text()` drops the lone bullets as empty bullets, and the items are classified as titles. - When a line is long, it joins all lines into one paragraph, so the list becomes part of the lead-in text. ## Change `group_broken_paragraphs()` first passes each paragraph to a new `_split_off_bullet_lists()`. It splits off the lists whose items start with `•` (U+2022), `●` (U+25CF) or `○` (U+25CB) and the lines around them. The existing code then groups each part unchanged, as if a blank line separated it from the next one, so a split-off list goes through `group_bullet_paragraph()`: - A list starts at a line that begins with one of these glyphs, right after a line that ends with `:`. - After an item, only another item or the lead-in of the next list may follow, such as `Vegetables:` in `Fruits:` / `• apple` / `Vegetables:` / `• carrot`. These glyphs only mark list items, while `-`, `*` and `·` can also be a sign, Markdown emphasis or a thematic break, or an operator. As agreed in review, lists with those markers are left to a follow-up with agreed recognition rules. These paragraphs stay whole and are grouped exactly as before: - A paragraph with a line that starts with any other bullet glyph (`-`, `*`, `·`, `–`, …) or with `e `, which can be an OCR bullet, and a paragraph with an item line that the bullet matcher downstream (`UNICODE_BULLETS_RE`) does not read as a bullet, such as `•- 5 °C`, where another glyph follows the bullet directly. - A paragraph with a bullet glyph inside a line, after the line's leading marker: the bullet splitters downstream cut at any glyph of `UNAMBIGUOUS_BULLETS_PATTERN`, so `10 N·m`, `*really*`, `Required *production* settings:`, `3 · 4` and inline lists (`• milk • eggs`) would lose characters. - A paragraph that starts with a bullet, or whose bullet line does not follow a `:` line. - A paragraph with any other line after an item, such as a wrapped item or prose after the list, because that line can continue the item. - Every paragraph, when the caller passes its own `line_split`. ## Testing - `test_group_broken_paragraphs_keeps_a_bulleted_list_after_its_lead_in_line` covers short and long items with each of the three glyphs, a glyph without a following space, successive lead-ins and indented bullets. All cases fail on `main`. - `test_group_broken_paragraphs_keeps_a_lead_in_list_with_an_inline_bullet_glyph_as_before` checks, with LF and CRLF, that the helper keeps `N·m`, `*really*` in an item, `*production*` in a lead-in, `3 · 4`, `3 ∙ 4` and a late rejection after a supported list whole, and that `group_broken_paragraphs()` returns `main`'s text for them. These cases fail on d95b0f9. `test_group_broken_paragraphs_keeps_a_lead_in_list_with_a_glyph_after_its_bullet_as_before` does the same for `•- 5 °C`, `•– 5 °C` and a rejection after a supported list; it fails on 08d4f79. A spaced `• - 5 °C` still splits off and keeps its sign. - `test_split_off_bullet_lists_keeps_an_ambiguous_paragraph_whole` covers dash, star and middle-dot lists, a list that mixes `•` and `-`, emphasis, inline bullets, an OCR `e` line, a bullet without a lead-in, and prose or a wrapped line after an item. `test_split_off_bullet_lists_keeps_a_long_wrapped_list_item_whole` checks an item with 20,000 wrapped lines. - `test_partition_text_reads_a_bulleted_list_that_follows_its_lead_in_line` runs the lists through default `partition_text()`, also with prose before the lead-in and with two lists in a row, plus ambiguous paragraphs (`N·m`, `*really*` with CRLF, a late rejection, prose after an item) that stay one `NarrativeText` as on `main`. The custom `line_split` tests keep a configured paragraph grouper's own split. - Compared with `main`: 16,000 random ambiguous paragraphs (LF and CRLF, each with another bullet glyph at the start of a line, a glyph inside a line such as `N·m` or `*x*`, a line after an item or a bullet without a lead-in) come out of `group_broken_paragraphs()` exactly as on `main` (1,676 differed before the inline-glyph fallback, and 1,540 before the bullet-matcher check, with `•- 5 °C`-style lines added), and in 3,000 random supported lists every item becomes a `ListItem`. - `test_unstructured/cleaners` (without `test_translate.py`, which needs `transformers`), `test_unstructured/nlp`, `partition/html`, `partition/test_text.py`, `test_email.py`, `test_md.py` and `test_text_type.py`: 976 passed, 1 skipped. - `ruff check` and `ruff format --check` (0.15.10) pass. Since Unstructured-IO#4578 a PR no longer edits the version or the CHANGELOG, so this one leaves both alone.
sinnercode228
added a commit
to sinnercode228/unstructured
that referenced
this pull request
Oct 24, 2026
Resolve the conflicts in CHANGELOG.md and unstructured/__version__.py by taking main: CHANGELOG.md is frozen and ordinary PRs no longer bump the version (Unstructured-IO#4578), so this PR drops its changelog entry and version bump.
2 of 3 tasks
cragwolfe
added a commit
that referenced
this pull request
Oct 24, 2026
## Summary `CHANGELOG.md` was frozen in #4578, but nothing enforces the freeze: PRs written under the old convention still edit it. This makes the existing required `check-version` job fail when a PR changes `CHANGELOG.md`, with a message pointing to the PR title and the "Release note" section. The check lives in `scripts/check-new-release-version.sh`, with regression tests in `scripts/test-check-new-release-version.sh`. No workflow, settings or branch-protection changes are needed, because `check-version` is already a required check. ## How it decides The check compares `CHANGELOG.md` between the base that `check-version` already uses and the commit under test: - **Pull requests:** the base is the first parent of the merge ref, the `main` snapshot the merge result was built on. Only the PR's own changes count, so a stale PR that never touched the changelog still passes. - **Merge queue:** the base is the queue entry ahead, which the job already fetches. Each PR is judged only on its own change. The check runs before the version rules, so it applies whatever the version does, release PRs included. ## Validation - `shellcheck` and `shfmt -i 2 -d` are clean. `scripts/test-check-new-release-version.sh` passes 27 cases, including two new ones that edit `CHANGELOG.md` in a temporary repo: one as a merge-group entry and one as a `pull_request` merge result. Both new cases fail without this PR's script change. - Simulated locally against current `main`: - this branch, no changelog edit (queue-style base): **PASS** - PR editing `CHANGELOG.md` (queue-style base): **FAIL** with the freeze message - PR editing `CHANGELOG.md` (`pull_request` merge ref, `HEAD^1` base): **FAIL** - PR without a changelog edit (`pull_request` merge ref): **PASS** ## Release note None (CI-only).
1 of 3 tasks
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.
TL;DR
Every code PR currently competes to edit the top of
CHANGELOG.mdand advance the development version. Those shared lines cause avoidable conflicts and rebases, especially for external contributors. This draft proposes using PR titles and GitHub generated release notes instead, while keeping the existing version format and human release process.This PR adds no changelog entry and does not bump
0.27.34-dev3: it is the first PR under the proposed convention. The only changelog edit is a freeze notice; all history remains intact.Proposed contributor convention
mainmay share one-devNversion.fix: …orfeat: …) becomes the release-note entry. Applyenhancement,bug, or another appropriate existing category label. External contributors can ask a maintainer to label their PR..github/release.ymlgroups entries into Breaking changes, Enhancements, Fixes, and Other changes. It excludes the existingdependencieslabel; the releaser must restore significant security/dependency updates during curation.The repository's labels were checked with
gh label list.breaking-changedoes not exist, and this PR creates no labels. Therelease.ymlfile reserves that category for later use. Until then, breaking PRs use!in the title, an existing category label, and manual placement during curation.Release day, step by step
unstructured/__version__.pyfrom-devNto the final version, for example0.27.34-dev3to0.27.34. Leave the frozen changelog alone.packaging.version.Versionto normalize versions when comparing:0.27.34-dev3and0.27.34.dev3are the same version. Skip tags that are not package versions, such asopencv-*. Squash and merge the release PR: only that commit may introduce the final version. Before merging the release PR, empty the merge queue. Queue no ordinary PRs until the next development bump lands.0.27.35-dev1. Resume ordinary merges only after that bump, so no later commit retains the released final version.Removed enforcement and automatic edits
changelogjob and changelog-enforcer action.check-versionfrommake check, and removed thecheck-versionandversion-synctargets. They compared against the latest changelog heading, which no longer changes.Merge prerequisite:
changelogis currently required bymainbranch protection (verified through the GitHub API). A repo admin must removechangelogfrom the required checks before this PR can merge, because this PR itself no longer produces that check. Do this when the proposal is accepted, just before merging; until then other PRs still run the existing job. The active rulesets were checked as well. This PR does not change repository settings.The removed
check-versioncommand also blocked ordinary PRs whilemainheld a final version. That guard becomes a manual step in this round: empty the merge queue before merging the release PR, then queue no ordinary PRs until the next development bump lands. A replacement CI guard is deferred.The unchanged Docker workflow publishes a version tag on every push to
main. Repeated development versions therefore make tags such as:0.27.34-dev3move across commits. Consumers who need a fixed image should use the existing short-commit-SHA image tag. Renovate security PRs also stop preparing final versions automatically; a maintainer must decide when to prepare their release.An organization code search for
renovate-security-bumpfound no executable configuration outside this repository callingrenovate-security-bump.sh. Shared configuration has no script hook; related documentation describes copying a local script. No cross-repository changes are included. Any unindexed consumer that downloadsrenovate-security-bump.shfrommainmust retire its hook or keep a pinned historical copy.Deferred work and limits
The optional duplicate-final-version CI guard is deferred: it needs normalized comparisons across all tags and existing releases, plus a policy for releases created after a PR check runs. It would not by itself enforce merge ordering. The manual check and short release-only merge window above remain necessary in round 1.
Round 2 can automate the post-release development bump. Automated tagging/publishing and tag-derived versions are optional later proposals; this draft changes none of those mechanisms and does not introduce setuptools-scm or hatch-vcs.
Validation
Targeted YAML/JSON5 parsing and preservation checks passed: changelog history is intact, the package version and publication workflows are unchanged, and retired hooks are absent. Shell syntax and ShellCheck passed for both retired commands.
make -n checkinvokes only the existing Ruff checks;git diff --checkpassed. Exact-head CI will provide broader coverage; long-running jobs will not block this draft handoff.Make check command selection
The normal check target no longer reads the frozen changelog.
Retired command validation
Both former entry points have valid shell syntax and pass ShellCheck.
Review
Independent Claude Opus code review at
3c36862bd199355ce75e930fca46e62cfda39881: APPROVED, no blocking findings.The first round requested explicit merge-queue ordering, inspection of required checks and external script callers, and documentation of Docker-tag and security-release effects. Those findings were verified and addressed above and in the contributor instructions. The final round approved the source and suggested description clarifications; the merge prerequisite and normalization wording were clarified. Exact-spelling-only tag commands were not adopted because they miss normalized aliases. The optional README Docker-tag clarification is deferred; the operational effect is documented above. Opus 4.6 also reviewed the description for clear language, and valid suggestions were applied.
Exact-head CI at handoff: Python 3.11–3.13 lint, ShellCheck, shfmt, CodeQL, and Socket security checks passed. Broader test and Docker jobs were still running; no long-running CI wait was required.
(authored by codex)