Repository navigation
Convert USFM versification before updating from rows - #390
Conversation
|
@claude The CI failed for this PR. Fix it. |
The job only ran when the issue or PR author was an owner, member or collaborator. The bot's association is NONE, so a member's @claude comment on a PR Claude opened was skipped, as on #390. PRs authored by claude[bot] now pass that check. The commenter must still be a member. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The job only ran when the issue or PR author was an owner, member or collaborator. The bot's association is NONE, so a member's @claude comment on a PR Claude opened was skipped, as on #390. PRs authored by claude[bot] now pass that check. The commenter must still be a member. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
@claude The CI build failed for this PR. Fix it. |
|
Claude finished @ddaspit's task in 2m 16s —— View job CI fix pushedThe I changed the base signature to Verification
The CI run was cancelled after the pyright failure, so I haven't seen the other CI jobs finish. Please check the new run. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #390 +/- ##
==========================================
+ Coverage 92.07% 92.16% +0.09%
==========================================
Files 394 396 +2
Lines 24896 25199 +303
==========================================
+ Hits 22922 23225 +303
Misses 1974 1974 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A push by the @claude workflow makes claude[bot] the actor, and claude-code-action rejects a bot actor unless it is listed in allowed_bots. The review of #390 failed this way. The review never pushes, so allowing Claude cannot make it retrigger itself. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
515e732 to
7bc8382
Compare
This comment has been minimized.
This comment has been minimized.
|
@claude Address all of the review comments, except those that would result in the PR diverging from the original C# code. |
|
Claude finished @ddaspit's task in 17s —— View job No code changes madeI made no changes and pushed no commits. Every review comment falls under your exception, because a fix would make the Python port differ from the C# code.
Not verified: I could not read the C# source in this session, because the Suggested follow-up: F1–F3 look like real defects. If you want them fixed, they could go upstream in sillsdev/machine first, and then be ported here. Tell me if you would rather fix them here and accept the divergence. |
port-pr reads the C# code from a sibling clone at ../machine, which the @claude workflow never created, so Claude could not check C# behavior on #390. The workflow now clones sillsdev/machine with full history. Claude can read it and run git show, cat-file, log and blame there. port-pr reads each C# file as of the source PR's merge commit. It checks that the commit exists first and fetches when a local clone is stale. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
7bc8382 to
aa0d660
Compare
|
@claude You should now be able to read the C# source. |
|
Claude finished @ddaspit's task in 18s —— View job No code changes madeI read the C# source (
F1-F3 look like real defects in the C# original. I'd fix them upstream in |
This comment has been minimized.
This comment has been minimized.
|
@claude Fix F5 if it doesn't diverge from the C# source. |
|
Claude finished @ddaspit's task in 21s —— View job No code changes made for F5I left F5 alone because fixing it would make the Python port differ from the C# code. I pushed no commits.
I read the C# source and compared it by hand. I did not run the Python on the F5 input. F5 looks like a real defect in C#. I'd fix it upstream in |
Enkidu93
left a comment
There was a problem hiding this comment.
@Enkidu93 reviewed 8 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 3 unresolved discussions.
machine/corpora/convert_usfm_versification_handler.py line 15 at r1 (raw file):
def _change_versification(verse_ref: VerseRef, versification: Versification) -> VerseRef:
Just use the built-in to_versificationmethod.
tests/corpora/test_convert_usfm_versification_handler.py line 762 at r1 (raw file):
target_lines = target.split("\n") truth_lines = truth.split("\n") for i, truth_line in enumerate(truth_lines):
We ought to assert that there are an equal number of target and truth lines.
|
@claude Address the comments. |
|
Claude finished @ddaspit's task in 27s —— View job Addressed Enkidu93's review commentsI pushed commit d685e2a, but I could not run the tests,
|
On #390, Claude could not run the tests or local_check.sh, although both are allowed. The action hides Claude's output, so the log only gave a count of 3 denials. A new step prints the denied calls from the execution file. Allowed commands match by prefix, so the prompt now asks Claude to run the checks from the repository root without cd or a wrapper. tail and head are allowed for trimming output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On #390, Claude could not run the tests or local_check.sh, although both are allowed. The action hides Claude's output, so the log only gave a count of denials. A new step prints each denied call's command, path, URL or pattern as one JSON line. It never prints file content and cannot fail the job. Allowed commands match by prefix, so the prompt now asks Claude to run the checks from the repository root without cd or a wrapper. tail and head are allowed for trimming output. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Enkidu93
left a comment
There was a problem hiding this comment.
@claude The CI is failing when running black:
Run poetry run black . --check --diff
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running ``pip install "black[jupyter]"``
--- D:\a\machine.py\machine.py\machine\corpora\convert_usfm_versification_handler.py 2026-10-05 19:48:12.830494+00:00
+++ D:\a\machine.py\machine.py\machine\corpora\convert_usfm_versification_handler.py 2026-10-05 19:49:20.001164+00:00
@@ -43,12 +43,11 @@
would reformat D:\a\machine.py\machine.py\machine\corpora\convert_usfm_versification_handler.py
self._process_tokens(state)
vr = state.verse_ref.copy()
# The versification of verse 0 cannot properly be changed
vr.verse = "1"
if not self._prev_verse_ref.is_default and (
- vr.to_versification(self._target_versification).book != self._prev_verse_ref.book
- or vr.chapter_num == -1
+ vr.to_versification(self._target_versification).book != self._prev_verse_ref.book or vr.chapter_num == -1
):
self._skip = True
self._insert_chapter_index = len(self._tokens)
def verse(
Oh no! \U0001f4a5 \U0001f494 \U0001f4a5
1 file would be reformatted, 413 files would be left unchanged.
@Enkidu93 reviewed 2 files and all commit messages, made 3 comments, resolved 2 discussions, and dismissed @Enkidu93 from 2 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion.
machine/corpora/convert_usfm_versification_handler.py line 15 at r1 (raw file):
Previously, Enkidu93 (Eli C. Lowry) wrote…
Just use the built-in
to_versificationmethod.
Done.
tests/corpora/test_convert_usfm_versification_handler.py line 762 at r1 (raw file):
Previously, Enkidu93 (Eli C. Lowry) wrote…
We ought to assert that there are an equal number of target and truth lines.
Done.
|
Claude finished @Enkidu93's task in 21s —— View job Black fix pushedI ran
|
This comment has been minimized.
This comment has been minimized.
Port sillsdev/machine#472 and the follow-up fixes from sillsdev/machine#521. ParatextProjectTextUpdaterBase.update_usfm now converts the source USFM to the rows' versification when it differs from the project's, using the new ConvertUsfmVersificationHandler. The test project settings now default to English versification, matching ScriptureRef, so existing update tests do not trigger a conversion. Closes #369 Closes #382 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Damien Daspit <3261883+ddaspit@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Damien Daspit <3261883+ddaspit@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Damien Daspit <3261883+ddaspit@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Eli C. Lowry <83078660+Enkidu93@users.noreply.github.com>
7db6e13 to
b7ce280
Compare
API surface: unchanged since the last round. Findings: F1 accepted, unverified. F2 accepted, unverified. F3 accepted, unverified. F4 accepted. F5 accepted, unverified. Reviewed at b7ce280 |
Enkidu93
left a comment
There was a problem hiding this comment.
@Enkidu93 reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on claude[bot]).
Quick summary
ParatextProjectTextUpdaterBase.update_usfmnow converts the source USFM to the rows' versification before applying the update, so rows in one versification update a project in another. The conversion runs only when the two differ, so same-versification updates behave as before. Nothing inmachine/jobsis touched.Where to look
tests/corpora/test_convert_usfm_versification_handler.py.test_update_usfm_converts_to_rows_versification.DefaultParatextProjectSettingsin the test utils now defaults to English, not Original, matchingScriptureRef. With the old default, 8 existing update tests started converting and failed.ConvertUsfmVersificationHandleris a new export ofmachine.corpora.get_rows_versificationis a new module-level function inupdate_usfm_parser_handler.py.Validation
./local_check.sh --agent-strict-- 873 passed, 3 skipped (local run, not CI-equivalent)Issue / porting context
Closes #369
Closes #382
Ports sillsdev/machine#472 and sillsdev/machine#521.
🤖 Generated with Claude Code
This change is