Repository navigation
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. |
isolomatov-gd
left a comment
There was a problem hiding this comment.
@atomicdjt thank you. The SHA-256 fix and the ec349035 follow-up are correct, and the tests cover them well.
One change before merge: a text-suffix file that is not valid UTF-8 must fail publish with a clear error, not fall back to binary.
Why: on that fallback path content_str is None, so frontmatter is not parsed. The document loses its frontmatter tags and sort_order, and it is published without any message. Tags drive retrieval, so the document stops being found by those tags. Instruction and text files must be UTF-8, so invalid encoding is a defect in the source. The author must see it and fix the file.
Please:
- Return a failed
PublishResultfor that file, with an error that names the file and says it is not valid UTF-8. The rest of the run continues, the same as other per-file failures. - Change
test_invalid_utf8_text_suffix_uses_binary_content_stateto assert the failure. - Update the change-detection sentence in
docs/MCP-ARCHITECTURE.mdand its web mirror.
Signed-off-by: David Turner <davidelsey9513@gmail.com>
|
@isolomatov-gd Thank you for the clarification. The requested UTF-8 behavior has been addressed in The updated hosted CI is green, including Rosetta CLI and CodeQL. When you have a chance, I’d appreciate a re-review. Thank you. |
Fixes #350.
Binary/non-text files contribute a SHA-256 digest of their raw bytes to the existing content-and-metadata hash, so same-size replacements are detected. Publish filtering remains separate from text classification.
Recognized text-suffix files must decode as UTF-8. An invalid UTF-8 text file returns a failed PublishResult that identifies the file and says it is not valid UTF-8; it is not uploaded, and publish_folder continues with other files. Valid UTF-8 text hashing and document identity are unchanged.
Regression coverage exercises direct and folder publication of invalid UTF-8 text, equal-size binary replacements, stable/empty binary content, metadata changes, valid UTF-8 text-hash compatibility, legacy binary-hash transition, and a configured .pdf publish filter that remains separate from text classification. Publisher tests mock only the remote RAGFlow client; no live RAGFlow upload or parsing was performed.
Validation on Windows, Python 3.12.14:
The repository pre-commit wrapper was exercised. Its Windows path does not run its POSIX test script, and after restoring pinned hooks dependencies the independent hooks suite has 40 unrelated Windows/path-semantics failures (1,401 pass); no hooks code was changed.