fix(xlsx): force LibreOffice recalc and stop forcing formulas on reports - #515
Merged
Conversation
- libreoffice_recalc.py: force recalc via isolated profile (OOXMLRecalcMode=0), kill orphan soffice procs, and verify formula <v> cache was populated so a silent 'success' with empty cells can no longer ship (root cause of the Shot A >5min recalc hang). - SKILL.md/create.md/validate.md: introduce Report vs Model split; reports write computed values directly (no formulas, no recalc), models keep Formula-First.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Detect missing headless (svp) VCL plugin; fall back to xvfb-run (present in cubeplex-sandbox images) so headless recalc actually loads documents instead of failing with 'source file could not be loaded'. - Fix output path collision: write recalc output to a separate dir so soffice does not overwrite the input copy (was shipping un-recalc'd file). - Verified end-to-end inside a cubeplex-sandbox container: 3/3 formula cells recalculated (A1=60, B1=20, A2=30), no orphan soffice procs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes the xlsx skill's broken recalc path (root cause of the >5min hang in the Video 2 Shot A run) and removes over-engineering that forced formulas onto static reports.
scripts/libreoffice_recalc.py: force LibreOffice to actually recalc OOXML formulas on load via an isolated per-runUserInstallationprofile +registrymodifications.xcu(OOXMLRecalcMode=0); kill orphansofficeprocs by profile; addverify_recalculated()post-check that fails (exit 1) when formula<v>caches are not populated — a silent "success" with empty cells can no longer ship.SKILL.md/references/create.md/references/validate.md(v1.1.0 → v1.2.0): introduce a Report vs Model split. Reports (final snapshot, values already computed in pandas) write computed values directly — no formulas, no recalc. Models (user edits inputs) keep Formula-First + recalc. Softens the blanket "every derived value must be a formula" rule and adds a recalc gate (never overwrite a good copy; fall back to values on recalc failure).Test plan
verify_recalculated(): empty<v>→ fail, populated<v>→ pass, pure-value report → pass./usr/bin/sofficev26.2.4.2) with a formula-bearing xlsx — confirm<v>is populated after recalc.🤖 Generated with WorkBuddy