Skip to content

Commit b182647

Browse files
committed
chore: prepare v0.1.4 release
1 parent bfa9aa7 commit b182647

7 files changed

Lines changed: 58 additions & 24 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "docmason"
7-
version = "0.1.3"
7+
version = "0.1.4"
88
description = "A Python-first, file-only, agent-native workspace for building multimodal knowledge bases from complex office documents."
99
readme = "README.md"
1010
license = { file = "LICENSE" }

src/docmason/commands.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2675,9 +2675,13 @@ def prepare_workspace(
26752675
actions_performed.append(detail)
26762676
office_snapshot = office_renderer_snapshot(workspace)
26772677
if not bool(office_snapshot.get("ready")):
2678+
validation_detail = (
2679+
office_snapshot.get("validation_detail")
2680+
or office_snapshot.get("detail")
2681+
)
26782682
actions_skipped.append(
26792683
"LibreOffice repair completed, but the renderer is still not usable. "
2680-
f"Details: {office_snapshot.get('validation_detail') or office_snapshot.get('detail')}"
2684+
f"Details: {validation_detail}"
26812685
)
26822686
else:
26832687
actions_skipped.append(detail)

src/docmason/hybrid.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,8 @@ def ensure_hires_focus_render(
11201120
pdf_path = source_path
11211121
document_type = str(source_manifest.get("document_type") or "")
11221122
if document_type != "pdf":
1123-
from .knowledge import convert_office_to_pdf, validate_soffice_binary
1123+
from .knowledge import convert_office_to_pdf
1124+
from .libreoffice_runtime import validate_soffice_binary
11241125

11251126
office_state = validate_soffice_binary(None)
11261127
office_binary = office_state.get("binary")

src/docmason/knowledge.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import os
88
import re
99
import shutil
10-
import subprocess
1110
import sys
1211
import tempfile
1312
import uuid
@@ -68,16 +67,11 @@
6867
mark_promoted_interaction_entries,
6968
repair_interaction_memory_related_sources,
7069
)
71-
from .libreoffice_runtime import (
72-
find_soffice_binary,
73-
run_office_conversion,
74-
validate_soffice_binary,
75-
)
70+
from .libreoffice_runtime import run_office_conversion
7671
from .project import (
7772
WorkspacePaths,
7873
isoformat_timestamp,
7974
read_json,
80-
relative_paths,
8175
source_index,
8276
source_inventory_signature,
8377
source_type_definition,
@@ -972,7 +966,10 @@ def convert_office_to_format(
972966
failures.append(
973967
{
974968
"stage": f"convert-office-to-{extension}",
975-
"detail": f"LibreOffice conversion completed without producing a .{extension} output.",
969+
"detail": (
970+
"LibreOffice conversion completed without producing "
971+
f"a .{extension} output."
972+
),
976973
}
977974
)
978975
return None, failures

src/docmason/libreoffice_runtime.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,22 @@ def _write_minimal_docx_probe(path: Path) -> None:
9999
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
100100
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
101101
<Default Extension="xml" ContentType="application/xml"/>
102-
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
102+
<Override
103+
PartName="/word/document.xml"
104+
ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"
105+
/>
103106
</Types>
104107
""",
105108
)
106109
archive.writestr(
107110
"_rels/.rels",
108111
"""<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
109112
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
110-
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
113+
<Relationship
114+
Id="rId1"
115+
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
116+
Target="word/document.xml"
117+
/>
111118
</Relationships>
112119
""",
113120
)
@@ -138,7 +145,15 @@ def _write_minimal_docx_probe(path: Path) -> None:
138145
</w:p>
139146
<w:sectPr>
140147
<w:pgSz w:w="12240" w:h="15840"/>
141-
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
148+
<w:pgMar
149+
w:top="1440"
150+
w:right="1440"
151+
w:bottom="1440"
152+
w:left="1440"
153+
w:header="720"
154+
w:footer="720"
155+
w:gutter="0"
156+
/>
142157
</w:sectPr>
143158
</w:body>
144159
</w:document>

tests/support_source_build_office_pdf.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
required_overlay_slots,
3434
select_lane_b_batch,
3535
)
36-
from docmason.libreoffice_runtime import (
37-
find_soffice_binary,
38-
run_office_conversion,
39-
validate_soffice_binary,
40-
)
4136
from docmason.knowledge import (
4237
_ThirdPartyDiagnosticCapture,
4338
build_docx_source,
@@ -49,6 +44,11 @@
4944
sanitize_text,
5045
source_artifact_contract_complete,
5146
)
47+
from docmason.libreoffice_runtime import (
48+
find_soffice_binary,
49+
run_office_conversion,
50+
validate_soffice_binary,
51+
)
5252
from docmason.project import WorkspacePaths, read_json, write_json
5353
from docmason.semantic_overlays import semantic_overlay_candidates, write_semantic_overlay
5454
from docmason.versioning import migrate_legacy_publish_storage, publish_ledger_entries
@@ -1018,7 +1018,12 @@ def fake_run(
10181018
) -> subprocess.CompletedProcess[str]:
10191019
del capture_output, text, check, timeout, env
10201020
if command[0] == "/usr/bin/open":
1021-
return subprocess.CompletedProcess(command, 1, stdout="", stderr="launch failed")
1021+
return subprocess.CompletedProcess(
1022+
command,
1023+
1,
1024+
stdout="",
1025+
stderr="launch failed",
1026+
)
10221027
return subprocess.CompletedProcess(command, 134, stdout="", stderr="Abort trap: 6")
10231028

10241029
with (

tests/support_workspace_bootstrap_and_status.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,15 @@ def test_bootstrap_launcher_preserves_conservative_fallback_without_healthy_host
770770
self.assertEqual(payload["status"], ACTION_REQUIRED)
771771
self.assertEqual(
772772
payload["detail"],
773-
"DocMason cannot safely confirm that this Codex turn allows the network downloads required for repo-local runtime bootstrap.",
773+
(
774+
"DocMason cannot safely confirm that this Codex turn allows the network "
775+
"downloads required for repo-local runtime bootstrap."
776+
),
777+
)
778+
self.assertEqual(
779+
payload["host_execution"]["context_source"],
780+
"env-codex-thread-id-fallback",
774781
)
775-
self.assertEqual(payload["host_execution"]["context_source"], "env-codex-thread-id-fallback")
776782
self.assertIsNone(payload["host_execution"]["sandbox_policy"])
777783
self.assertIsNone(payload["host_execution"]["permission_mode"])
778784
self.assertFalse(payload["host_execution"]["full_machine_access"])
@@ -2200,7 +2206,10 @@ def runner(command: list[str] | tuple[str, ...], cwd: Path) -> CommandExecution:
22002206
self.assertEqual(report.payload["machine_baseline_status"], "ready")
22012207
official_install.assert_called_once()
22022208
self.assertFalse(
2203-
any(command == ["/opt/homebrew/bin/brew", "install", "--cask", "libreoffice-still"] for command in seen_commands)
2209+
any(
2210+
command == ["/opt/homebrew/bin/brew", "install", "--cask", "libreoffice-still"]
2211+
for command in seen_commands
2212+
)
22042213
)
22052214

22062215
def test_prepare_is_ready_without_homebrew_when_office_renderer_is_already_available(
@@ -2650,7 +2659,10 @@ def test_status_reports_detected_but_unusable_libreoffice_under_default_permissi
26502659
):
26512660
report = status_workspace(workspace, editable_install_probe=self.missing_probe)
26522661

2653-
self.assertEqual(report.payload["environment"]["machine_baseline_status"], "host-access-upgrade-required")
2662+
self.assertEqual(
2663+
report.payload["environment"]["machine_baseline_status"],
2664+
"host-access-upgrade-required",
2665+
)
26542666
self.assertTrue(
26552667
report.payload["environment"]["machine_baseline"]["libreoffice_detected_but_unusable"]
26562668
)

0 commit comments

Comments
 (0)