Repository navigation
v0.5.0 — Agent-ready reliable delivery / Agent 可靠交付系统
Highlights
Excel-Ops v0.5.0 turns the v0.4.0 delivery loop into a much more complete, agent-ready local delivery system. Since v0.4.0, 21 PRs and 50 commits add safe refresh operations, cross-platform CI, working-directory discovery, whole-run idempotency, delivery Manifests, semantic number formats, a local MCP server, verified XLSX/CSV/PDF export, and formula planning through independently recalculated delivery.
- Safe refresh apply, rollback, and agent-check (#44, PR #49):
refresh.mjsnow supports confirmed apply with backups, retryable partial/unverified rollback states, and a cached fail-open agent check. Symlink-safe destination validation and atomic replacement close a real path-traversal risk discovered during review. - Cross-platform Node CI (#50, PR #51): refresh and security behavior now runs on Ubuntu, Windows, and macOS. Manifest checks normalize CRLF/LF checkout differences without hiding real content changes.
- Working-directory discovery (#15, PR #52): read-only scanning classifies inputs, templates, prior deliveries, review returns, duplicates, unstable files, sync artifacts, and ambiguous version candidates inside explicit authorized roots.
- Whole-run idempotency (#19, PR #54): input, template/profile, mapping/Recipe, confirmation, period, output, and revision evidence produce
no_op,changed, orretry. Only a recorded successful run can authorize a no-op; failed or interrupted work retries safely. - Source-and-verification Manifests (#20, PR #55): each delivered workbook can carry JSON and human-readable evidence covering source hashes, per-tab counts, template/Recipe versions, persisted output hash, verification results, format policy, exports, and formula evidence without copying sensitive cell values.
- Semantic number formats (#23, PR #58): workbook defaults and field overrides support amount, rate, hours, headcount, percentage, and tax semantics; CAD/USD/CNY/EUR; precision declarations; and standard, red, parentheses, or accounting negative styles. Ambiguous or conflicting currency fails closed.
- Local Agent MCP server (#53/#59, PR #57/#60): a stdio MCP adapter exposes
excel_ops.scan_workdir,excel_ops.prepare_delivery,excel_ops.plan_delivery, andexcel_ops.run_delivery. The JavaScript layer validates and routes versioned JSON while Python remains the only spreadsheet execution backend. - Verified multi-format delivery (#22, PR #62–#68): users can select XLSX, CSV, or PDF from one verified workbook. CSV capability loss is explicit; formula caches are inspected safely; PDF supports LibreOffice and local Microsoft Excel, selected-sheet isolation, dependency preservation, page-layout verification, idempotency binding, and Manifest-backed retry recovery.
- Formula planning, safe application, and real recalculation (#25, PR #69–#72): natural-language lookup, conditional aggregation, and date goals become typed, version-aware plans; formula or static output is applied to explicit ranges while protecting existing formulas; Excel or LibreOffice independently recalculates formula-mode output; delivery rejects missing engines, mismatched results, removed formulas, missing formula sheets, and changed contracts without new records. Formula rules flow through Delivery, idempotency, Manifests, CLI, and MCP.
- Verification baseline: the release head passed the full GitHub Actions workflow on
main; local release validation recorded 342 Python tests passed (2 skipped), 34 Node tests passed, and 4 MCP integration tests passed.
Safety and compatibility notes
- Formula-mode delivery that requires independent recalculation needs Microsoft Excel on Windows or LibreOffice. Without an available engine, it fails with
formula_delivery_failed; it never treats openpyxl as calculation proof. - Static formula rules can be delivered without a calculation engine, but they do not claim recalculation evidence.
- PDF export is for review and handoff, not continued calculation. CSV drops workbook-only features such as multiple sheets, styles, and formulas.
- The MCP adapter does not duplicate spreadsheet logic. Source preservation, dry-run planning, human confirmation, reread verification, idempotency, and Manifest rules remain enforced by the Python core.
Known gaps carried forward
- Working-directory scan results are not yet automatically wired into
run_delivery; selection remains an explicit planning step. - Cloud connectors and revision-aware writes for Google Sheets, Dropbox, Feishu, WPS, OneDrive, and SharePoint are not implemented.
- Cross-source contradiction detection, Evidence Diff, missing-record detection, fact timelines, and full audit evidence packages remain future work.
- Natural-language append/join/grouping, summaries, pivot tables, and role/jurisdiction packs remain outside this release.
Full changelog: v0.4.0...v0.5.0
更新亮点
Excel-Ops v0.5.0 将 v0.4.0 的交付闭环扩展为更完整、可供 Agent 直接调用的本地交付系统。自 v0.4.0 以来,21 个 PR、50 个提交补齐了安全更新写入与回滚、跨平台 CI、工作目录发现、整次运行幂等、交付 Manifest、语义化数字格式、本地 MCP、经过验证的 XLSX/CSV/PDF 导出,以及从公式规划到独立复算交付的完整链路。
- 安全的 refresh apply、rollback 与 agent-check(#44,PR #49):
refresh.mjs新增确认式 apply、写前备份、可重试的部分/未验证回滚状态,以及带缓存且 fail-open 的 Agent 检查。统一的 symlink 目标校验与原子替换修复了 review 中发现的真实路径穿越风险。 - 跨平台 Node CI(#50,PR #51):refresh 与安全测试现在同时运行在 Ubuntu、Windows 和 macOS;Manifest 检查会归一化 CRLF/LF,不把 Windows checkout 差异误报为内容变化。
- 工作目录发现(#15,PR #52):在显式授权目录内只读识别输入、模板、历史交付、复核返回、重复文件、不稳定文件、同步残留和无法自动选择的版本候选。
- 整次运行幂等(#19,PR #54):输入、模板/Profile、mapping/Recipe、人工确认、周期、输出和 revision 证据共同产生
no_op、changed或retry;只有明确成功的历史运行才能授权 no-op,失败或中断的运行会安全重试。 - 来源与验证 Manifest(#20,PR #55):每个交付工作簿可生成 JSON 和人类可读证据,记录来源哈希、逐 Tab 数量、模板/Recipe 版本、真实输出哈希、验证结果、格式策略、导出和公式证据,同时不复制敏感单元格值。
- 语义化数字格式(#23,PR #58):支持工作簿默认值与字段覆盖;金额、汇率、工时、人数、百分比、税率;CAD/USD/CNY/EUR;精度声明;以及普通、红色、括号和会计式负数显示。币种含糊或冲突会失败关闭。
- 本地 Agent MCP 服务(#53/#59,PR #57/#60):通过 stdio 暴露
excel_ops.scan_workdir、excel_ops.prepare_delivery、excel_ops.plan_delivery和excel_ops.run_delivery。JavaScript 层只负责版本化 JSON 校验与路由,Python 仍是唯一表格执行后端。 - 经过验证的多格式交付(#22,PR #62–#68):用户可以从同一份已验证工作簿选择 XLSX、CSV 或 PDF。CSV 的能力损失会明确提示;公式缓存采用安全检查;PDF 支持 LibreOffice 与本机 Microsoft Excel、选定 Sheet 隔离、依赖保留、页面布局验证、幂等绑定和基于 Manifest 的重试恢复。
- 公式规划、安全写入与真实复算(#25,PR #69–#72):查找、条件汇总和日期等自然语言目标会转换为类型化、版本感知计划;公式或静态值只写入显式区域并默认保护已有公式;公式模式由 Excel 或 LibreOffice 独立复算;缺少引擎、结果不匹配、公式被替换、公式 Sheet 丢失、合同变化但无新记录都会阻断交付。公式规则已贯通 Delivery、幂等、Manifest、CLI 和 MCP。
- 验证基线:Release head 在
main上通过完整 GitHub Actions;本地发布验证记录为 Python 342 passed、2 skipped,Node 34 passed,MCP integration 4 passed。
安全与兼容性说明
- 要求独立复算的公式模式需要 Windows 上的 Microsoft Excel 或 LibreOffice。没有可用引擎时会以
formula_delivery_failed失败,不会把 openpyxl 当作计算证明。 - 静态规则无需计算引擎即可交付,但不会宣称拥有公式重算证据。
- PDF 用于审阅和交接,不用于继续计算;CSV 会丢失多工作表、样式和公式等工作簿能力。
- MCP 适配层不复制表格业务逻辑。源文件保护、dry run、人工确认、写后重读、幂等和 Manifest 规则继续由 Python 核心强制执行。
继续保留的已知缺口
- 工作目录扫描尚未自动接入
run_delivery,文件选择仍是显式规划步骤。 - Google Sheets、Dropbox、飞书、WPS、OneDrive、SharePoint 等云连接器和 revision-aware 写入尚未实现。
- 跨来源矛盾检测、Evidence Diff、缺失记录检测、事实时间线和完整审计证据包仍是后续工作。
- 自然语言 append/join/grouping、摘要、透视表以及角色/地区规则包不在本次 Release 范围内。
完整变更记录:v0.4.0...v0.5.0