Conversation
Signed-off-by: David Turner <davidelsey9513@gmail.com>
Rosetta Triage ReviewSummary: This PR replaces the binary length surrogate with a SHA-256 digest of raw bytes before the existing metadata hash, adds regression coverage for file and folder publishing, and documents the one-time binary republish. Findings:
Caveats:
Suggestions:
Validation:
Automated triage by Rosetta agent |
Signed-off-by: David Turner <davidelsey9513@gmail.com>
|
Addressed in
Local validation: 118 CLI tests, mypy, package build, twine checks, and |
|
Hi @isolomatov-gd — following up now that the P2 from automated triage has been addressed in ec34903. |
Fixes #350.
Binary files currently contribute only their byte count to
content_hash, so replacing an asset with different bytes of the same length silently skips publication. Use a SHA-256 digest of the raw binary bytes as input to the existing content-and-metadata hash. Publish filtering is kept separate from text classification, and a text-suffix file falls back to binary state when strict UTF-8 decoding fails. Valid UTF-8 text hashing and document identity are unchanged.Regression coverage exercises equal-size replacements, stable/empty binary content, malformed text-suffix content, metadata changes, and valid text-hash compatibility. Publisher tests exercise both
publish_fileandpublish_folderwith only the remote RAGFlow client mocked: changed bytes upload, subsequent unchanged bytes skip, existing length-based binary hashes migrate, and a configured.pdffilter does not redefine that file as text. The architecture documentation and its website counterpart describe the one-time migration.Validation on Windows, Python 3.12.14:
python -m pytest src/rosetta-cli/tests -q— 118 passed.python -m mypy --config-file mypy.ini src/rosetta-cli— passed, 22 source files.python -m buildinsrc/rosetta-cli— wheel and sdist built.python -m twine check src/rosetta-cli/dist/*— both passed.git diff --check— passed.No live RAGFlow upload or parsing was performed. Existing binary documents and malformed text-suffix files with lossy stored hashes will republish once because their stored hashes used the old format. AI assistance: Codex assisted implementation, regression tests, and diff review.