Skip to content

Releases

v0.5.1 — Maintainability pass / 可维护性整理

Choose a tag to compare

@Schlaflied Schlaflied released this 27 Sep 03:38
954fdda

Highlights

Excel-Ops v0.5.1 is a maintainability release on top of v0.5.0. It does not change delivery behavior. Since v0.5.0, 12 PRs broke every oversized module and function into named steps and added a CI guard so the code cannot grow back into large files. The refactors that changed control flow were each checked with old-vs-new differential runs, not only the test suite.

  • delivery.py split into focused modules (PR #74, #87, #88): the 1,828-line delivery.py is now delivery_models, delivery_ambiguity, delivery_planning, delivery_write, delivery_config, and delivery_guard, and delivery_manifest gained delivery_manifest_format. from excel_ops.delivery import ... and from excel_ops.delivery_manifest import ... keep working through explicit re-exports.
  • Long delivery functions broken into named steps (PR #75, #89): run_delivery (≈280 → 94 lines), _write_and_verify, _finish_run, and _write_target became named phases: idempotency guard, prepare, stopped run, result, Manifest recovery, and target failure. The complete run_delivery result for 101 test runs was identical to main apart from content hashes and timestamps, which also differ between two runs of the same code.
  • Working-directory scan split (PR #76, #77): scan_workdir and workdir.py (940 → 432 lines) are now workdir_models, workdir_classify, and workdir. The access-audit tests still intercept every content read.
  • CLI split by subcommand (PR #86): cli.py:main (246 → 8 lines) dispatches to one function per subcommand. A side-by-side run of 17 invocations produced identical arguments, output, and exit codes. The MCP bridge depends on these.
  • PDF layout verification and template writer split (PR #90, #91): verify_pdf_layout and write_template moved their loops out verbatim. PDF verification matched on 400 randomized cases covering all ten finding codes. The template writer matched on 146 recorded test calls, byte for byte including every written cell's value, format, and style, and on 800 randomized templates.
  • CI size ratchet (PR #76): tests/test_code_size.py fails CI for any function over 100 lines or module over 800 lines, scanning subpackages and keying functions by qualified name. Both exception lists are now empty.
  • Agent guidance (PR #76, #85): AGENTS.md adds "Split before you append" and lists the repository's type labels (enhancement, bug, documentation, refactor) and area: labels.
  • Housekeeping (PR #74, #75): package and refresh-manifest versions now match the release; the stray issue-refresh-mjs.md draft is no longer shipped by refresh.mjs; README and AGENTS.md now credit Career-Ops (https://github.com/career-ops-hq/career-ops) and PPT-Ops as other people's projects that the maintainer contributes to.
  • Verification baseline: every PR passed the full GitHub Actions workflow (Python, Node on Ubuntu/Windows/macOS, MCP integration) and a CodeRabbit review with no open findings. Local validation recorded 341 Python tests passed and 4 skipped, 34 Node tests passed, and 4 MCP integration tests passed. The single local failure is the LibreOffice recalculation test, which cannot run headless in the build sandbox and passes on CI.

Safety and compatibility notes

  • There are no functional changes: ingestion, matching, write-back, verification, Manifests, idempotency, exports, and MCP behave as in v0.5.0.
  • Public import paths are unchanged. Code that imports or monkeypatches private helpers may need a new module path, for example delivery_guard._mapping_payload, delivery_write.apply_formula_delivery, or workdir_classify._read_bytes.
  • refresh.mjs updates ship the new modules and delete issue-refresh-mjs.md. The old name stays recognized so a rollback of an earlier update still validates.

Known gaps carried forward

  • The v0.5.0 known gaps still apply: working-directory scan results are not yet wired into run_delivery; cloud connectors and revision-aware writes are not implemented; cross-source contradiction detection, Evidence Diff, and natural-language join/grouping, summaries, and pivots remain future work.
  • A Feishu (Lark) connector is now the first cloud connector on the roadmap (#5), based on real user demand.

Full changelog: v0.5.0...v0.5.1


更新亮点

Excel-Ops v0.5.1 是在 v0.5.0 之上的可维护性版本,不改变任何交付行为。自 v0.5.0 以来共合并 12 个 PR:所有过长的模块和函数都被拆成了有名字的步骤,并新增 CI 检查,防止代码重新长成巨型文件。凡是改动了执行顺序的重构,除了跑测试之外,都额外做了新旧版本的逐项对比。

  • delivery.py 拆成职责单一的模块(PR #74、#87、#88):原来 1,828 行的 delivery.py 拆成 delivery_models、delivery_ambiguity、delivery_planning、delivery_write、delivery_config、delivery_guard,delivery_manifest 另拆出 delivery_manifest_format。from excel_ops.delivery import ... 和 from excel_ops.delivery_manifest import ... 的原有写法通过显式重新导出继续可用。
  • 交付流程中的超长函数拆成有名字的步骤(PR #75、#89):run_delivery(约 280 行降到 94 行)、_write_and_verify、_finish_run、_write_target 拆成防重复执行判断、准备、提前返回、组装结果、找回交付凭证、目标失败等步骤。101 次测试运行的完整 run_delivery 结果与 main 一致;唯一的差异是文件哈希和时间戳,而同一份代码自己跑两次也会有这些差异。
  • 工作目录扫描拆分(PR #76、#77):scan_workdir 和 workdir.py(940 行降到 432 行)拆成 workdir_models、workdir_classify、workdir;监控"读取了哪些文件"的安全测试依然能拦截到每一次读取。
  • 命令行按子命令拆分(PR #86):cli.py:main 从 246 行降到 8 行,只负责把命令分发给各子命令函数。新旧版本并排跑了 17 种调用,参数、输出和退出码全部一致;MCP 就是通过这些命令调用的。
  • PDF 版式校验与模板写入拆分(PR #90、#91):verify_pdf_layout 和 write_template 的循环原样搬出。PDF 校验在 400 个覆盖全部 10 种问题的随机场景中结果一致;模板写入在测试中的 146 次真实调用上逐字节一致(包括写出的每个单元格的值、格式和样式),800 个随机模板也全部一致。
  • CI 代码长度检查(PR #76):tests/test_code_size.py 会让任何超过 100 行的函数或超过 800 行的模块直接导致 CI 失败,子目录也会扫描,函数按"所在类 + 函数名"区分。两份例外清单现在都是空的。
  • 给 AI Agent 的规则(PR #76、#85):AGENTS.md 新增"先拆再加"规则,并写明仓库的类型标签(enhancement、bug、documentation、refactor)和各个 area: 标签。
  • 其他整理(PR #74、#75):包版本和更新清单版本已与 Release 对齐;多余的 issue-refresh-mjs.md 草稿不再随 refresh.mjs 分发;README 和 AGENTS.md 更正了署名,注明 Career-Ops(https://github.com/career-ops-hq/career-ops)和 PPT-Ops 是他人维护的项目,维护者是这两个项目的贡献者。
  • 验证基线:每个 PR 都通过了完整的 GitHub Actions(Python,Ubuntu/Windows/macOS 三平台 Node,MCP 集成测试),CodeRabbit 审查也没有遗留问题。本地验证结果:Python 341 passed、4 skipped,Node 34 passed,MCP integration 4 passed。唯一的本地失败是 LibreOffice 重算测试,它在构建沙箱里无法无界面运行,在 CI 上是通过的。

安全与兼容性说明

  • 没有功能变化:导入、匹配、写回、验证、交付凭证、防重复执行、导出和 MCP 的行为都与 v0.5.0 相同。
  • 公开导入路径不变。如果有代码导入或替换了私有辅助函数,可能需要改用新的模块路径,例如 delivery_guard._mapping_payload、delivery_write.apply_formula_delivery、workdir_classify._read_bytes。
  • 通过 refresh.mjs 更新时会带上新模块,并删除 issue-refresh-mjs.md;这个旧文件名仍会被识别,所以回滚更早的更新时校验依然能通过。

继续保留的已知缺口

  • v0.5.0 的已知缺口依然存在:工作目录扫描结果尚未自动接入 run_delivery;云端连接器和按版本安全写入尚未实现;跨来源矛盾检测、Evidence Diff、自然语言合并/分组、汇总和透视表仍是后续工作。
  • 根据真实用户的需求,飞书(Lark)连接器已被列为路线图(#5)上的第一个云端连接器。

完整变更记录:v0.5.0...v0.5.1

v0.5.0 — Agent-ready reliable delivery / Agent 可靠交付系统

Choose a tag to compare

@Schlaflied Schlaflied released this 24 Sep 00:43
8b48999

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.mjs now 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, or retry. 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, and excel_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

v0.4.0 — P1 端到端交付闭环 / P1 Delivery Loop Closes End to End

Choose a tag to compare

@Schlaflied Schlaflied released this 21 Sep 16:30
897ab41

Highlights

Since v0.3.0, Excel-Ops closes the full P1 correctness loop end to end: ingest → normalize → match → confirm ambiguity → write template → reopen and verify → deliver, backed by a new excel-ops deliver CLI entry point, and adds CI + automated PR review to the project.

  • P1 end-to-end delivery pipeline (#46, #47): a new run_delivery() orchestrator in src/excel_ops/delivery.py chains strict matching, batch ambiguity confirmation with recipe reuse, safe template write-back, and independent post-write verification into one agent-callable flow (excel-ops deliver). A plan/dry-run step reports expected writes, reviews, and blockers before anything touches disk. Unresolved ambiguity, conflicts, and protected/formula cells are never silently written. 116 tests passing. The prior single-target excel-ops <input> <output> command is kept (README quick-start and existing tests still use it) as a simpler, non-templated path.
  • Batch ambiguity confirmation + Recipe memory (#26, PR #41): resolve many same-shaped ambiguities in one confirmation instead of one-by-one; decisions save to a readable, version-controllable project recipe and get reused automatically on later runs.
  • Safe enterprise template write-back (#3, PR #40): writes preserve template formatting, formulas, and merged cells; output always goes to a new file, never overwrites the source template or an existing delivery.
  • Independent delivery verification (#4, PR #42): after writing, Excel-Ops reopens the actual persisted file and checks sheets, required fields, and values — a successful write is never reported as a successful delivery on its own.
  • Formula integrity & reconciliation checks (#11, PR #43): detects overwritten formulas and broken references, and reconciles declared summary values against detail rows, flagging mismatches as blocking or warning.
  • Business-period resolution and period-aware refresh (#16/#9, PR #33/#34): explicit period parsing (week/month/quarter/custom/fiscal) with no implicit "today" guessing, plus safe date-slot refresh that only touches declared refreshable fields.
  • Safe, period-aware output naming (#17, PR #35): deterministic filenames like payroll-2026-09-21.xlsx with automatic -rN de-duplication.
  • refresh.mjs read-only update check (#44 partial, PR #45): a new, independent Node entry point (node refresh.mjs check / preview) lets an agent detect system-file changes (even under an unchanged version number) using an explicit SHA-256 manifest, without touching any file. The write side (apply/rollback/agent-check) is intentionally not in this release — issue #44 stays open for that.
  • CI + automated review: GitHub Actions now runs pytest and Node's test suite plus a manifest-staleness check on every PR and push to main; CodeRabbit is installed and auto-reviews new PRs.
  • Bilingual (EN/中文) documentation across README, capability ledger, and the new delivery-pipeline docs (#37, #39).

Known gaps carried forward

  • Full cross-run idempotency (no duplicate records on rerun with changed inputs) is deferred to #19.
  • Formula recalculation is a static check, not a real Excel recompute — treated as a warning, not proof.
  • refresh.mjs's write path (apply/rollback/agent-check) is not yet implemented — see #44.
  • The plain, non-templated CLI command and the new deliver pipeline are not yet consolidated into a single entry point.

Full changelog: v0.3.0...v0.4.0


更新亮点

自 v0.3.0 以来,Excel-Ops 把 P1 正确性闭环真正端到端打通:导入 → 归一化 → 匹配 → 歧义确认 → 模板写回 → 重新打开验证 → 交付,新增了 excel-ops deliver 这个 CLI 入口,同时给项目加上了 CI 和自动化 PR review。

  • P1 端到端交付流程(#46、#47):新增 src/excel_ops/delivery.py 里的 run_delivery() 编排器,把严格匹配、批量歧义确认(含 Recipe 复用)、安全模板写回、写入后独立验证串成一条 Agent 可直接调用的流程(excel-ops deliver)。写入前会先给出计划/dry run,报告预计写入、复核和阻断数量,不落盘。未解决的歧义、冲突、受保护/公式单元格绝不会被静默写入。116 项测试全部通过。原来的单目标 excel-ops <input> <output> 命令予以保留(README quick-start 和现有测试仍在用),作为不需要模板的简化路径。
  • 批量歧义确认 + Recipe 记忆(#26,PR #41):同类歧义可以一次性批量确认,不用逐条处理;人工决定保存为可读、可版本控制的项目 Recipe,后续运行自动复用。
  • 安全写回企业工作簿模板(#3,PR #40):写入保留模板格式、公式和合并单元格;默认另存为新文件,绝不覆盖源模板或已有交付文件。
  • 独立交付验证(#4,PR #42):写入后重新打开实际落盘文件,核对工作表、必填字段和数值——写入成功本身绝不会被单独报告为交付成功。
  • 公式完整性与对账检查(#11,PR #43):检测公式是否被覆盖、引用是否断裂,并对声明的汇总值与明细值执行对账,差异标记为阻断或警告。
  • 业务周期解析与周期感知刷新(#16/#9,PR #33/#34):显式解析周/月/季度/自定义/财年周期,不隐式猜测"今天";安全刷新只更新声明为可刷新的日期槽位。
  • 安全的周期感知文件命名(#17,PR #35):确定性文件名(如 payroll-2026-09-21.xlsx),自动用 -rN 后缀处理重名。
  • refresh.mjs 只读更新检查(#44 的一部分,PR #45):新增独立的 Node 入口(node refresh.mjs check / preview),基于显式 SHA-256 Manifest,即使版本号不变也能发现系统文件变化,且完全不修改任何文件。写操作(apply/rollback/agent-check)本次有意未包含在内,issue #44 保持打开继续跟进。
  • CI + 自动化 review:GitHub Actions 现在每次 PR 和推送到 main 都会跑 pytest、Node 内置测试和 manifest 过期检查;CodeRabbit 已接入仓库,自动 review 新 PR。
  • README、能力账本和新增的交付流程文档全部补齐中英双语(#37、#39)。

遗留的已知缺口

  • 完整的跨运行幂等(输入变化后重跑不产生重复记录)留给 #19。
  • 公式重算只是静态检查,不是真正的 Excel 重新计算,只作为警告,不是证明。
  • refresh.mjs 的写操作侧(apply/rollback/agent-check)尚未实现,见 #44。
  • 无模板的普通 CLI 命令和新的 deliver 流程尚未收敛成一个入口。

完整变更记录:v0.3.0...v0.4.0

v0.3.0 — Phase 1 本地 Excel 基础能力

Choose a tag to compare

@Schlaflied Schlaflied released this 12 Sep 13:21
be3b7b3

这次发布了什么

Excel Ops 现在具备 Phase 1 本地工作流的第一组可靠基础能力:

  • 多来源、布局感知的 XLSX/XLSM/CSV 与图片提取 JSON 导入(#1 / PR #29)
  • 日期、数字、百分比、货币、标识符与地区格式推断(#24 / PR #28)
  • Schema Drift 检测、人工确认字段映射与下游影响报告(#10 / PR #30)
  • 严格匹配、稳定 record ID、预分配、去重与模糊候选复核(#2 / PR #27)
  • 普通 Excel 可填写的离线人工复核包及安全回导(#18 / PR #31)

安全边界

  • 模糊匹配不会被静默自动接受。
  • 歧义日期和冲突记录进入人工复核。
  • 原始来源、候选结果、人工决定和持久化输出保持分离。
  • Review Pack 会检测 ID、表头、候选值等关键内容是否被篡改。

验证

从 release 对应的 main commit be3b7b3 执行完整测试:39 passed。

下一步

这不是整个 Phase 1 的终点。下一段纵向闭环是:

  1. #3:安全写回企业工作簿模板;
  2. #4:重新打开并独立验证实际交付文件;
  3. 用合成数据串联 ingest → normalize → match → review → write → verify。

完整规划见 Roadmap #5。