Repository navigation
Execute complete memory document conversion through TinyBus #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Complete Markdown conversion | ||
|
|
||
| Contract version 3 adds `ConvertMarkdown(format, StreamRef) -> OutputRef`. | ||
| Existing member argument counts and representations remain unchanged. Hosts | ||
| must pin a released version-3 module and verify its artifact digest before | ||
| calling this member. Version-2 modules do not provide this operation. | ||
|
|
||
| `format` uses the existing `DocumentFormat` wire values: `pdf`, `docx`, `pptx`, | ||
| and `xlsx`. Authorized bytes arrive over the existing TinyBus input stream. | ||
| The module executes the Markdown converter and retains UTF-8 output in its | ||
| bounded output store. The host reads it with `ReadOutput` and releases it with | ||
| `ReleaseOutput`; normal expiry also releases abandoned output. | ||
|
|
||
| Unlike `ExtractDocument`, which intentionally produces bounded previews, | ||
| `ConvertMarkdown` returns complete normalized text for document persistence. | ||
| It preserves the OfficeConverter text shape used by TinyMemory: paragraphs, | ||
| XML entity text, numeric PowerPoint slide order, worksheet row labels, and | ||
| PDF form-feed page boundaries, including blank pages between text pages. | ||
| Hosts keep their existing stored documents and ingestion metadata. | ||
|
|
||
| Empty and oversized input return `InvalidInput`. Malformed, overexpanding, | ||
| and entirely empty or scanned documents return `ExtractionFailed`. The | ||
| 32-MiB input ceiling, 64-MiB declared Office expansion ceiling, and one-million | ||
| cell spreadsheet extent ceiling apply before materializing parser data. | ||
| No local fallback is required or provided by the bus contract. | ||
|
|
||
| Regression fixtures exercise all four formats and error cases. The compiled | ||
| artifact test calls conversion over an actual broker, checks returned bytes, | ||
| and verifies output release and structured parse errors. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Markdown conversion | ||
|
|
||
| `tinydocs::markdown::convert(bytes, DocumentFormat)` extracts PDF, DOCX, PPTX, | ||
| and XLSX to the complete normalized Markdown used by memory ingestion. It | ||
| retains TinyMemory OfficeConverter semantics, including form-feed PDF page | ||
| boundaries, numeric slide order, and `sheet | cell | cell` spreadsheet rows. | ||
| The implementation is adapted from TinyMemory under GPL-3.0-only. | ||
|
|
||
| Input is limited to 32 MiB. Office archives are admitted only when their | ||
| aggregate declared expansion is at most 64 MiB; spreadsheet ranges are checked | ||
| with a sparse scan before allocating a dense grid of at most one million | ||
| cells. An entirely empty or scanned document returns `ExtractionFailed`. | ||
|
|
||
| The TinyBus `ConvertMarkdown(format, StreamRef)` member executes this converter | ||
| inside the compiled module and returns an `OutputRef`. Download with | ||
| `ReadOutput(output_id, offset, length)` and release with | ||
| `ReleaseOutput(output_id)`. The existing output store limits and expiry apply. | ||
| Callers retain authorization, provenance, ingestion metadata, and cancellation. | ||
| The pure bus contract contains no parser dependency. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the version-2 paragraph above the new section.
The new section says that
ConvertMarkdownis in contract version 3. Lines 257-262 still say that the intake methods "extend contract version 2 additively".is_compatiblenow accepts only version 3. A reader of the earlier paragraph can conclude that a version-2 requirement still works with this module. Rewrite lines 257-262 to describe the version history (v2 intake, v3 conversion) and the exact-match compatibility rule. The repository rule says: "KeepREADME.md,docs/, and module docs aligned with code changes in the same commit that changes behavior."🤖 Prompt for AI Agents
Source: Coding guidelines