Skip to content

feat(api): structured warnings, structured limit errors, Markkit Clone + Debug - #51

Merged
chaliy merged 25 commits into
mainfrom
claude/project-thread-foq2nw
Oct 27, 2026
Merged

chaliy merged 25 commits into
mainfrom
claude/project-thread-foq2nw

Conversation

@chaliy

@chaliy chaliy commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

🤖 Generated with Claude Code
Requested by Михайло · project thread

Part of #11.

What changed

  • Breaking: Extraction::warnings is Vec<Warning> (Warning { code: WarningCode, detail }) instead of "code: detail" strings. WarningCode covers every warning emitted today (truncated sheet/table/PDF, hidden content/sheets/slides, PDF unmapped font / no text, invalid UTF-8, malformed CSV, macros, ...); Display keeps the old code: detail form. Node and WASM bindings return warnings: [{ code, detail }]. The agent tool keeps string warnings.
  • Breaking: Error::ResourceLimit carries LimitExceeded { kind: LimitKind, detail }. LimitKind names the Limits field that was exceeded (input/output size, timeout, nodes, nesting, archive entries/entry size/total size, spreadsheet cells, PDF stream/decoded size); Error::limit_kind() returns it. The error message is unchanged.
  • Markkit derives Clone + Debug.

Why

Issue #11: embedders had to parse message strings to tell warnings and limit breaches apart.

Before / After

Before: e.warnings[0].starts_with("pdf_no_text:"), msg.contains("timeout").
After: e.warnings[0].code == WarningCode::PdfNoText, err.limit_kind() == Some(LimitKind::Timeout). Tests across limits, pdf_security, csv_integration, text_integration, document_security now assert on codes/kinds. just fmt lint test check-okf test-scripts examples green; Node tests 9/9.

Risk

  • Medium: public type changes (approved pre-1.0). Pattern Error::ResourceLimit(_) still compiles; string handling of warnings does not.

Checklist

  • Tests added or updated
  • Backward compatibility considered (breaking, marked in CHANGELOG)

Generated by Claude Code

chaliy added 25 commits October 26, 2026 23:53
- Single-row sheets render the row as data under Excel column letters
- Extraction.title from XLSX core.xml, ODS meta.xml, XLS SummaryInformation
- XLSB content type / extension / container detected as Format::Xlsb, not Xlsx
- XLSX without _rels/.rels gets the standard package relationship
- Release profile uses panic = "unwind" so catch_unwind guards work
- Document the trailing newline as intended

Part of #11
- Single-row sheets render the row as data under Excel column letters
- Extraction.title from XLSX core.xml, ODS meta.xml, XLS SummaryInformation
- XLSB content type / extension / container detected as Format::Xlsb, not Xlsx
- XLSX without _rels/.rels gets the standard package relationship
- Release profile uses panic = "unwind" so catch_unwind guards work
- Document the trailing newline as intended

Part of #11
…-foq2nw

# Conflicts:
#	crates/markkit/src/extract.rs
#	crates/markkit/src/lib.rs
#	knowledge/log.md
New pptx feature (in all_formats): slides in sldIdLst order as
'## Slide N: <title>' sections, bulleted body placeholders, text boxes,
tables with spans, hyperlinks, speaker notes. Hidden slides skipped unless
include_hidden_content. Shared OOXML helpers move from docx.rs to ooxml.rs.
Legacy .ppt becomes Format::Ppt and is rejected explicitly.

Part of #11
Extraction/ParsedDocument warnings become Vec<Warning> { code: WarningCode,
detail } so embedders match on a stable code instead of parsing strings.
Display keeps the old "code: detail" form; the agent tool output is
unchanged. Markkit derives Clone and Debug.

Part of #11
…-foq2nw

# Conflicts:
#	CHANGELOG.md
#	crates/markkit/src/xml.rs
…-foq2nw

# Conflicts:
#	crates/markkit-js/src/lib.rs
@chaliy
chaliy merged commit b46b6c7 into main Oct 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant