cadence-diff 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. cadence_diff-0.1.0/.gitignore +28 -0
  2. cadence_diff-0.1.0/LICENSE +190 -0
  3. cadence_diff-0.1.0/PKG-INFO +245 -0
  4. cadence_diff-0.1.0/README.md +206 -0
  5. cadence_diff-0.1.0/pyproject.toml +79 -0
  6. cadence_diff-0.1.0/qc_tool/__init__.py +3 -0
  7. cadence_diff-0.1.0/qc_tool/__main__.py +6 -0
  8. cadence_diff-0.1.0/qc_tool/attestation.py +209 -0
  9. cadence_diff-0.1.0/qc_tool/availability.py +273 -0
  10. cadence_diff-0.1.0/qc_tool/cli.py +769 -0
  11. cadence_diff-0.1.0/qc_tool/config/__init__.py +1 -0
  12. cadence_diff-0.1.0/qc_tool/config/lint.py +480 -0
  13. cadence_diff-0.1.0/qc_tool/config/profile.py +207 -0
  14. cadence_diff-0.1.0/qc_tool/coverage.py +35 -0
  15. cadence_diff-0.1.0/qc_tool/crosscheck/__init__.py +1 -0
  16. cadence_diff-0.1.0/qc_tool/crosscheck/numbers.py +146 -0
  17. cadence_diff-0.1.0/qc_tool/crosscheck/package.py +154 -0
  18. cadence_diff-0.1.0/qc_tool/crosscheck/trace.py +374 -0
  19. cadence_diff-0.1.0/qc_tool/engine.py +978 -0
  20. cadence_diff-0.1.0/qc_tool/excel/__init__.py +1 -0
  21. cadence_diff-0.1.0/qc_tool/excel/align.py +452 -0
  22. cadence_diff-0.1.0/qc_tool/excel/charts.py +931 -0
  23. cadence_diff-0.1.0/qc_tool/excel/context.py +106 -0
  24. cadence_diff-0.1.0/qc_tool/excel/controls.py +266 -0
  25. cadence_diff-0.1.0/qc_tool/excel/dependency.py +252 -0
  26. cadence_diff-0.1.0/qc_tool/excel/diff_structure.py +326 -0
  27. cadence_diff-0.1.0/qc_tool/excel/diff_values.py +327 -0
  28. cadence_diff-0.1.0/qc_tool/excel/formulas.py +516 -0
  29. cadence_diff-0.1.0/qc_tool/excel/interaction.py +548 -0
  30. cadence_diff-0.1.0/qc_tool/excel/periods.py +117 -0
  31. cadence_diff-0.1.0/qc_tool/excel/preflight.py +615 -0
  32. cadence_diff-0.1.0/qc_tool/excel/references.py +436 -0
  33. cadence_diff-0.1.0/qc_tool/excel/regions.py +201 -0
  34. cadence_diff-0.1.0/qc_tool/findings.py +220 -0
  35. cadence_diff-0.1.0/qc_tool/fingerprint.py +369 -0
  36. cadence_diff-0.1.0/qc_tool/fingerprint.schema.json +15 -0
  37. cadence_diff-0.1.0/qc_tool/history/__init__.py +1 -0
  38. cadence_diff-0.1.0/qc_tool/history/store.py +287 -0
  39. cadence_diff-0.1.0/qc_tool/io/__init__.py +1 -0
  40. cadence_diff-0.1.0/qc_tool/io/decrypt.py +64 -0
  41. cadence_diff-0.1.0/qc_tool/io/excel_formula.py +256 -0
  42. cadence_diff-0.1.0/qc_tool/io/excel_formula_worker.py +280 -0
  43. cadence_diff-0.1.0/qc_tool/io/formula_enrichment.py +95 -0
  44. cadence_diff-0.1.0/qc_tool/io/libreoffice_formula.py +232 -0
  45. cadence_diff-0.1.0/qc_tool/io/loader.py +973 -0
  46. cadence_diff-0.1.0/qc_tool/io/model.py +356 -0
  47. cadence_diff-0.1.0/qc_tool/io/ooxml_chart.py +530 -0
  48. cadence_diff-0.1.0/qc_tool/io/ooxml_interaction.py +400 -0
  49. cadence_diff-0.1.0/qc_tool/io/ooxml_worksheet.py +405 -0
  50. cadence_diff-0.1.0/qc_tool/io/xlsb_formula.py +313 -0
  51. cadence_diff-0.1.0/qc_tool/package-sanitize.schema.json +31 -0
  52. cadence_diff-0.1.0/qc_tool/package_sanitize.py +255 -0
  53. cadence_diff-0.1.0/qc_tool/ppt/__init__.py +1 -0
  54. cadence_diff-0.1.0/qc_tool/ppt/chart_xml.py +422 -0
  55. cadence_diff-0.1.0/qc_tool/ppt/diff.py +120 -0
  56. cadence_diff-0.1.0/qc_tool/ppt/element_diff.py +878 -0
  57. cadence_diff-0.1.0/qc_tool/ppt/element_match.py +317 -0
  58. cadence_diff-0.1.0/qc_tool/ppt/extract.py +212 -0
  59. cadence_diff-0.1.0/qc_tool/ppt/match.py +137 -0
  60. cadence_diff-0.1.0/qc_tool/ppt/model.py +132 -0
  61. cadence_diff-0.1.0/qc_tool/ppt/preflight.py +307 -0
  62. cadence_diff-0.1.0/qc_tool/privacy.py +392 -0
  63. cadence_diff-0.1.0/qc_tool/progress.py +78 -0
  64. cadence_diff-0.1.0/qc_tool/report/__init__.py +1 -0
  65. cadence_diff-0.1.0/qc_tool/report/excel_report.py +205 -0
  66. cadence_diff-0.1.0/qc_tool/report/findings.schema.json +32 -0
  67. cadence_diff-0.1.0/qc_tool/report/html_report.py +38 -0
  68. cadence_diff-0.1.0/qc_tool/report/json_report.py +55 -0
  69. cadence_diff-0.1.0/qc_tool/report/templates/report.html.j2 +117 -0
  70. cadence_diff-0.1.0/qc_tool/sanitize.py +598 -0
  71. cadence_diff-0.1.0/qc_tool/security.py +34 -0
  72. cadence_diff-0.1.0/qc_tool/server_config.py +86 -0
  73. cadence_diff-0.1.0/qc_tool/triage/__init__.py +1 -0
  74. cadence_diff-0.1.0/qc_tool/triage/rules.py +211 -0
  75. cadence_diff-0.1.0/qc_tool/ui/__init__.py +1 -0
  76. cadence_diff-0.1.0/qc_tool/ui/app.py +1261 -0
  77. cadence_diff-0.1.0/qc_tool/ui/guide.py +452 -0
  78. cadence_diff-0.1.0/qc_tool/ui/theme.py +505 -0
@@ -0,0 +1,28 @@
1
+ # generated artifacts and local runtime state
2
+ artifacts/
3
+
4
+ # python
5
+ __pycache__/
6
+ *.py[cod]
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .coverage
10
+ htmlcov/
11
+ .mypy_cache/
12
+ .pyright/
13
+ *.egg-info/
14
+
15
+ # virtual environments
16
+ .venv/
17
+ venv/
18
+
19
+ # generated artifacts — never commit deliverables, fixtures, reports, or run data
20
+ tests/fixtures/generated/
21
+ runs/
22
+ reports/
23
+ data/
24
+ *.sqlite3
25
+ dist/
26
+ build/
27
+ *.qca
28
+ *.log
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Himanshu
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,245 @@
1
+ Metadata-Version: 2.4
2
+ Name: cadence-diff
3
+ Version: 0.1.0
4
+ Summary: Local, read-only QC and diff tool for cadence Excel/PowerPoint deliverables.
5
+ Project-URL: Homepage, https://github.com/rai-himanshu07/cadence-diff
6
+ Project-URL: Repository, https://github.com/rai-himanshu07/cadence-diff
7
+ Project-URL: Issues, https://github.com/rai-himanshu07/cadence-diff/issues
8
+ Project-URL: Releases, https://github.com/rai-himanshu07/cadence-diff/releases
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: diff,excel,openpyxl,powerpoint,qc,reporting
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Web Environment
14
+ Classifier: Intended Audience :: Financial and Insurance Industry
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: jinja2>=3.1
21
+ Requires-Dist: msoffcrypto-tool>=5.4
22
+ Requires-Dist: networkx>=3.2
23
+ Requires-Dist: nicegui>=2.0
24
+ Requires-Dist: openpyxl>=3.1
25
+ Requires-Dist: platformdirs>=4.0
26
+ Requires-Dist: pydantic>=2.7
27
+ Requires-Dist: python-pptx>=1.0
28
+ Requires-Dist: pywin32>=306; sys_platform == 'win32'
29
+ Requires-Dist: pyxlsb>=1.0
30
+ Requires-Dist: pyyaml>=6.0
31
+ Requires-Dist: rapidfuzz>=3.9
32
+ Provides-Extra: dev
33
+ Requires-Dist: psutil>=6.0; extra == 'dev'
34
+ Requires-Dist: pyright; extra == 'dev'
35
+ Requires-Dist: pytest-asyncio>=1.0; extra == 'dev'
36
+ Requires-Dist: pytest>=8.0; extra == 'dev'
37
+ Requires-Dist: ruff; extra == 'dev'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # cadence-diff (QC Tool)
41
+
42
+ Local, read-only QC for recurring ("cadence") reporting deliverables —
43
+ Excel workbooks and PowerPoint decks. Everything runs on your machine,
44
+ binds to `127.0.0.1` only, never modifies source files, and uses no LLMs
45
+ or external services.
46
+
47
+ ## Three QC modes
48
+
49
+ | Mode | Inputs | What it answers |
50
+ |---|---|---|
51
+ | **Current-file preflight** | latest Excel and/or PPT | Is this file internally sound? (error literals, cleared/inconsistent formulas, period sequence, draft tokens, blanks, broken links…) |
52
+ | **Cycle comparison** | baseline + current | What changed vs last cycle — with expected cadence growth isolated from real errors (shift-aware formula compare, growth-aware alignment). |
53
+ | **Final-package QC** | current Excel + current PPT | Do the deck's figures reconcile to the workbook? (suggest → confirm → persist source mappings; coverage reporting.) |
54
+
55
+ Every run reports explicit coverage — checked / degraded / unavailable —
56
+ so a check that could not run is never silently treated as passed.
57
+ Findings support analyst severity overrides and comments; exports
58
+ (annotated Excel workbook, self-contained HTML) regenerate from the
59
+ reviewed state.
60
+
61
+ The structural engine models Excel tables and structured references, mixed
62
+ cadence bands, every plot and named series in combo charts, chart axes/legends/
63
+ labels/geometry, data validation, conditional formatting, bounded and symbolic
64
+ formula dependencies, and explicit future-blank availability rules. PowerPoint
65
+ uses collision-safe shape identities, semantic table/chart/plot/series matching,
66
+ separate speaker notes, and visible chart-label anchors for Excel reconciliation.
67
+ Unsupported representations degrade the relevant check instead of becoming a
68
+ false pass.
69
+
70
+ OOXML loading streams worksheet content, verifies physical cells independently
71
+ of declared dimensions, and reports workload evidence from uncompressed XML,
72
+ shared strings, styles, cell counts, and sheet bounds. Pathological packages
73
+ are refused before expensive parsing unless the operator deliberately enables
74
+ the per-run override. Findings budgets and low-confidence alignment are always
75
+ disclosed through summary findings and degraded coverage rather than silently
76
+ truncating or guessing.
77
+
78
+ ## Install & run
79
+
80
+ ```bash
81
+ pip install cadence-diff
82
+ cadence-diff # web UI → http://127.0.0.1:8080
83
+ cadence-diff --port 9000 --data-dir ~/qc-data
84
+ qc-tool # compatibility alias
85
+ python -m qc_tool # equivalent
86
+ ```
87
+
88
+ The web UI includes a packaged **Guide** page at `/guide`. It covers mode
89
+ selection, files, profiles and controls, coverage/severity, finding review,
90
+ Excel↔PPT mappings, Re-QC, privacy artifacts, CLI automation, network access,
91
+ troubleshooting, and the sign-off checklist. Context links from the run page
92
+ jump directly to the relevant guide section.
93
+
94
+ ### Headless / scripting
95
+
96
+ ```bash
97
+ # CI-style QC: exit 0 clean, 2 when findings at/above --fail-on exist
98
+ cadence-diff run --baseline-excel last.xlsx --current-excel this.xlsx \
99
+ --profile monthly --json findings.json --progress
100
+ cadence-diff run --current-excel this.xlsx # preflight (inferred)
101
+ cadence-diff run --current-excel x.xlsx --current-ppt d.pptx # package QC
102
+
103
+ # Only after reviewing workload refusal and confirming sufficient local memory
104
+ cadence-diff run --current-excel unusually-large.xlsx \
105
+ --allow-large-workbooks
106
+
107
+ # Local numeric scrambling only — NOT privacy-safe or shareable
108
+ cadence-diff sanitize client_pack.xlsx --seed 7
109
+
110
+ # Strict, fail-closed redaction + recursive OOXML privacy verification
111
+ cadence-diff sanitize client_pack.xlsx --seed 7 --redact-text \
112
+ --output client_pack.sanitized.xlsx
113
+ cadence-diff verify-sanitized client_pack.sanitized.xlsx \
114
+ --forbid "Client Name" --json privacy-report.json
115
+
116
+ # Structural-only evidence: no values, text, formulas, paths, or identifiers
117
+ cadence-diff fingerprint client_pack.xlsx --output client_pack.fingerprint.json
118
+
119
+ # Sanitize an Excel/PPT package together and reverify confirmed mappings
120
+ cadence-diff sanitize-package --excel current.xlsx --ppt current.pptx \
121
+ --profile monthly --output-dir sanitized-package --forbid "Client Name"
122
+
123
+ # Signed evidence bundle; verify every member and manifest signature
124
+ cadence-diff run --current-excel this.xlsx --fail-on never \
125
+ --attestation run.qca
126
+ cadence-diff verify-attestation run.qca
127
+
128
+ # Validate a profile — optionally against the real files it targets
129
+ cadence-diff lint monthly.yaml --against-excel this.xlsx --against-ppt d.pptx
130
+ ```
131
+
132
+ `qc-tool` remains a compatibility alias. Headless runs record into the same
133
+ history the web UI shows. `--progress` writes phase updates to stderr, leaving
134
+ normal stdout and JSON files unchanged. The web UI shows the same phases and a
135
+ Cancel control; cancellation stops at the next safe boundary, removes partial
136
+ reports, and does not record a successful run.
137
+
138
+ JSON exports omit raw cell neighborhoods and mapping-candidate values by
139
+ default. `--json-context` includes them for private diagnostics and must not be
140
+ treated as a shareable artifact. For encrypted files, prefer
141
+ `--password-env`, a mode-600 `--password-file`, or `--password-prompt`; inline
142
+ `--password ROLE=PW` is retained for compatibility but exposes secrets in shell
143
+ history and process listings.
144
+
145
+ ### Network exposure
146
+
147
+ The server defaults to loopback. Temporary network access is explicit,
148
+ time-bounded, and **has no built-in authentication or TLS**:
149
+
150
+ ```bash
151
+ qc-tool network status
152
+ qc-tool network lan --minutes 60
153
+ qc-tool --port 8001 # reads the persisted temporary config
154
+ qc-tool network local # running LAN server shuts down within 2s
155
+
156
+ # one-process override (also persisted so status/UI agree)
157
+ qc-tool --port 8001 --network lan --expose-for 60
158
+ ```
159
+
160
+ LAN mode binds `0.0.0.0`, displays an exposure warning in the UI, shuts the
161
+ server down at expiry, and resets the persisted config to local. Router port
162
+ forwarding and host firewalls are separate; public Internet exposure is not
163
+ recommended without an authenticated TLS reverse proxy.
164
+
165
+ Runs, uploads, profiles, and history live in a per-user data directory
166
+ (`--data-dir` to override). Supported inputs: `.xlsx`, `.xlsm`, `.xlsb`
167
+ and `.pptx`, including password-protected files.
168
+
169
+ ### XLSB formula enrichment
170
+
171
+ The original XLSB remains read-only and `pyxlsb` remains authoritative for its
172
+ saved values. Formula text is enriched through a platform spreadsheet engine
173
+ only after an independent BIFF12 scan identifies every formula coordinate:
174
+
175
+ - **Windows:** a licensed desktop Excel installation in an interactive user
176
+ session. The conditional `pywin32` dependency is installed with the package.
177
+ Excel runs in a bounded worker with links, events, calculation, and VBA
178
+ automation disabled; only `Formula2` text is accepted.
179
+ - **Linux:** `libreoffice` and `bwrap` must be installed on the host. Conversion
180
+ runs in a private bubblewrap sandbox with no network and a read-only host
181
+ filesystem; only formulas from the temporary OOXML copy are accepted.
182
+
183
+ The source and extracted formula-coordinate sets must match exactly. Active
184
+ content, external data, missing platform tools, timeouts, malformed packages,
185
+ or any mismatch fail closed to **presence-only** formula coverage. That fallback
186
+ still checks formula hardcodes, removals, missing fill formulas, and saved error
187
+ values, but does not claim logic, consistency, or formula-text error checks.
188
+ Temporary decrypted/conversion files are private and removed after each load.
189
+ The Windows worker is implemented and protocol-tested, but must still pass the
190
+ restricted corporate Windows/Excel pilot before production sign-off.
191
+
192
+ Strict sanitization supports `.xlsx` and `.pptx`. Macro-enabled `.xlsm` is
193
+ refused because VBA can retain credentials and client identifiers; create and
194
+ review a macro-free `.xlsx` copy first. The redaction manifest and privacy
195
+ verifier report what was removed, transformed, skipped, or unverifiable.
196
+
197
+ ## Development
198
+
199
+ The development environment is Conda/Miniforge:
200
+
201
+ ```bash
202
+ conda env create -f environment.yml
203
+ conda run -n cadence-diff-dev python main.py # dev server, repo-local ./data
204
+ conda run -n cadence-diff-dev pytest -x -q # 400+ tests, fixture-driven
205
+ conda run -n cadence-diff-dev ruff check .
206
+ conda run -n cadence-diff-dev pyright
207
+ ```
208
+
209
+ Tests are contract-driven: `tests/fixtures/generate.py` builds synthetic
210
+ deliverable pairs with a ground-truth defect manifest, and the E2E suite
211
+ asserts both directions — every seeded defect detected, and no finding
212
+ without a seeded cause.
213
+
214
+ ### Layout
215
+
216
+ ```
217
+ qc_tool/
218
+ io/ read-only loading, decryption, XLSB scan/enrichment, snapshots
219
+ excel/ regions, alignment, value/structure/formula QC, deps, preflight
220
+ ppt/ extraction, fuzzy slide matching, diff, preflight
221
+ crosscheck/ figure parsing, source tracing, final-package reconciliation
222
+ triage/ severity rules (analyst overrides layered on top)
223
+ report/ annotated Excel + standalone HTML exports
224
+ history/ SQLite run history, annotations, re-QC lineage
225
+ privacy.py fail-closed OOXML privacy verification
226
+ fingerprint.py structural-only evidence export
227
+ attestation.py signed QC evidence bundles
228
+ progress.py progress events and cooperative cancellation
229
+ server_config.py fail-safe local/temporary-LAN configuration
230
+ ui/ NiceGUI app (loopback only) + theme
231
+ packaged operator guide at /guide
232
+ engine.py run orchestration
233
+ ```
234
+
235
+ ## Publishing (maintainers)
236
+
237
+ Releases are built and validated by GitHub Actions, then published through PyPI
238
+ Trusted Publishing. Create an annotated version tag matching
239
+ `qc_tool.__version__`, publish the corresponding GitHub Release, and promote the
240
+ exact workflow-built artifacts. Do not upload manually or rebuild between
241
+ validation and publication.
242
+
243
+ ## License
244
+
245
+ Apache-2.0 — see [LICENSE](LICENSE).
@@ -0,0 +1,206 @@
1
+ # cadence-diff (QC Tool)
2
+
3
+ Local, read-only QC for recurring ("cadence") reporting deliverables —
4
+ Excel workbooks and PowerPoint decks. Everything runs on your machine,
5
+ binds to `127.0.0.1` only, never modifies source files, and uses no LLMs
6
+ or external services.
7
+
8
+ ## Three QC modes
9
+
10
+ | Mode | Inputs | What it answers |
11
+ |---|---|---|
12
+ | **Current-file preflight** | latest Excel and/or PPT | Is this file internally sound? (error literals, cleared/inconsistent formulas, period sequence, draft tokens, blanks, broken links…) |
13
+ | **Cycle comparison** | baseline + current | What changed vs last cycle — with expected cadence growth isolated from real errors (shift-aware formula compare, growth-aware alignment). |
14
+ | **Final-package QC** | current Excel + current PPT | Do the deck's figures reconcile to the workbook? (suggest → confirm → persist source mappings; coverage reporting.) |
15
+
16
+ Every run reports explicit coverage — checked / degraded / unavailable —
17
+ so a check that could not run is never silently treated as passed.
18
+ Findings support analyst severity overrides and comments; exports
19
+ (annotated Excel workbook, self-contained HTML) regenerate from the
20
+ reviewed state.
21
+
22
+ The structural engine models Excel tables and structured references, mixed
23
+ cadence bands, every plot and named series in combo charts, chart axes/legends/
24
+ labels/geometry, data validation, conditional formatting, bounded and symbolic
25
+ formula dependencies, and explicit future-blank availability rules. PowerPoint
26
+ uses collision-safe shape identities, semantic table/chart/plot/series matching,
27
+ separate speaker notes, and visible chart-label anchors for Excel reconciliation.
28
+ Unsupported representations degrade the relevant check instead of becoming a
29
+ false pass.
30
+
31
+ OOXML loading streams worksheet content, verifies physical cells independently
32
+ of declared dimensions, and reports workload evidence from uncompressed XML,
33
+ shared strings, styles, cell counts, and sheet bounds. Pathological packages
34
+ are refused before expensive parsing unless the operator deliberately enables
35
+ the per-run override. Findings budgets and low-confidence alignment are always
36
+ disclosed through summary findings and degraded coverage rather than silently
37
+ truncating or guessing.
38
+
39
+ ## Install & run
40
+
41
+ ```bash
42
+ pip install cadence-diff
43
+ cadence-diff # web UI → http://127.0.0.1:8080
44
+ cadence-diff --port 9000 --data-dir ~/qc-data
45
+ qc-tool # compatibility alias
46
+ python -m qc_tool # equivalent
47
+ ```
48
+
49
+ The web UI includes a packaged **Guide** page at `/guide`. It covers mode
50
+ selection, files, profiles and controls, coverage/severity, finding review,
51
+ Excel↔PPT mappings, Re-QC, privacy artifacts, CLI automation, network access,
52
+ troubleshooting, and the sign-off checklist. Context links from the run page
53
+ jump directly to the relevant guide section.
54
+
55
+ ### Headless / scripting
56
+
57
+ ```bash
58
+ # CI-style QC: exit 0 clean, 2 when findings at/above --fail-on exist
59
+ cadence-diff run --baseline-excel last.xlsx --current-excel this.xlsx \
60
+ --profile monthly --json findings.json --progress
61
+ cadence-diff run --current-excel this.xlsx # preflight (inferred)
62
+ cadence-diff run --current-excel x.xlsx --current-ppt d.pptx # package QC
63
+
64
+ # Only after reviewing workload refusal and confirming sufficient local memory
65
+ cadence-diff run --current-excel unusually-large.xlsx \
66
+ --allow-large-workbooks
67
+
68
+ # Local numeric scrambling only — NOT privacy-safe or shareable
69
+ cadence-diff sanitize client_pack.xlsx --seed 7
70
+
71
+ # Strict, fail-closed redaction + recursive OOXML privacy verification
72
+ cadence-diff sanitize client_pack.xlsx --seed 7 --redact-text \
73
+ --output client_pack.sanitized.xlsx
74
+ cadence-diff verify-sanitized client_pack.sanitized.xlsx \
75
+ --forbid "Client Name" --json privacy-report.json
76
+
77
+ # Structural-only evidence: no values, text, formulas, paths, or identifiers
78
+ cadence-diff fingerprint client_pack.xlsx --output client_pack.fingerprint.json
79
+
80
+ # Sanitize an Excel/PPT package together and reverify confirmed mappings
81
+ cadence-diff sanitize-package --excel current.xlsx --ppt current.pptx \
82
+ --profile monthly --output-dir sanitized-package --forbid "Client Name"
83
+
84
+ # Signed evidence bundle; verify every member and manifest signature
85
+ cadence-diff run --current-excel this.xlsx --fail-on never \
86
+ --attestation run.qca
87
+ cadence-diff verify-attestation run.qca
88
+
89
+ # Validate a profile — optionally against the real files it targets
90
+ cadence-diff lint monthly.yaml --against-excel this.xlsx --against-ppt d.pptx
91
+ ```
92
+
93
+ `qc-tool` remains a compatibility alias. Headless runs record into the same
94
+ history the web UI shows. `--progress` writes phase updates to stderr, leaving
95
+ normal stdout and JSON files unchanged. The web UI shows the same phases and a
96
+ Cancel control; cancellation stops at the next safe boundary, removes partial
97
+ reports, and does not record a successful run.
98
+
99
+ JSON exports omit raw cell neighborhoods and mapping-candidate values by
100
+ default. `--json-context` includes them for private diagnostics and must not be
101
+ treated as a shareable artifact. For encrypted files, prefer
102
+ `--password-env`, a mode-600 `--password-file`, or `--password-prompt`; inline
103
+ `--password ROLE=PW` is retained for compatibility but exposes secrets in shell
104
+ history and process listings.
105
+
106
+ ### Network exposure
107
+
108
+ The server defaults to loopback. Temporary network access is explicit,
109
+ time-bounded, and **has no built-in authentication or TLS**:
110
+
111
+ ```bash
112
+ qc-tool network status
113
+ qc-tool network lan --minutes 60
114
+ qc-tool --port 8001 # reads the persisted temporary config
115
+ qc-tool network local # running LAN server shuts down within 2s
116
+
117
+ # one-process override (also persisted so status/UI agree)
118
+ qc-tool --port 8001 --network lan --expose-for 60
119
+ ```
120
+
121
+ LAN mode binds `0.0.0.0`, displays an exposure warning in the UI, shuts the
122
+ server down at expiry, and resets the persisted config to local. Router port
123
+ forwarding and host firewalls are separate; public Internet exposure is not
124
+ recommended without an authenticated TLS reverse proxy.
125
+
126
+ Runs, uploads, profiles, and history live in a per-user data directory
127
+ (`--data-dir` to override). Supported inputs: `.xlsx`, `.xlsm`, `.xlsb`
128
+ and `.pptx`, including password-protected files.
129
+
130
+ ### XLSB formula enrichment
131
+
132
+ The original XLSB remains read-only and `pyxlsb` remains authoritative for its
133
+ saved values. Formula text is enriched through a platform spreadsheet engine
134
+ only after an independent BIFF12 scan identifies every formula coordinate:
135
+
136
+ - **Windows:** a licensed desktop Excel installation in an interactive user
137
+ session. The conditional `pywin32` dependency is installed with the package.
138
+ Excel runs in a bounded worker with links, events, calculation, and VBA
139
+ automation disabled; only `Formula2` text is accepted.
140
+ - **Linux:** `libreoffice` and `bwrap` must be installed on the host. Conversion
141
+ runs in a private bubblewrap sandbox with no network and a read-only host
142
+ filesystem; only formulas from the temporary OOXML copy are accepted.
143
+
144
+ The source and extracted formula-coordinate sets must match exactly. Active
145
+ content, external data, missing platform tools, timeouts, malformed packages,
146
+ or any mismatch fail closed to **presence-only** formula coverage. That fallback
147
+ still checks formula hardcodes, removals, missing fill formulas, and saved error
148
+ values, but does not claim logic, consistency, or formula-text error checks.
149
+ Temporary decrypted/conversion files are private and removed after each load.
150
+ The Windows worker is implemented and protocol-tested, but must still pass the
151
+ restricted corporate Windows/Excel pilot before production sign-off.
152
+
153
+ Strict sanitization supports `.xlsx` and `.pptx`. Macro-enabled `.xlsm` is
154
+ refused because VBA can retain credentials and client identifiers; create and
155
+ review a macro-free `.xlsx` copy first. The redaction manifest and privacy
156
+ verifier report what was removed, transformed, skipped, or unverifiable.
157
+
158
+ ## Development
159
+
160
+ The development environment is Conda/Miniforge:
161
+
162
+ ```bash
163
+ conda env create -f environment.yml
164
+ conda run -n cadence-diff-dev python main.py # dev server, repo-local ./data
165
+ conda run -n cadence-diff-dev pytest -x -q # 400+ tests, fixture-driven
166
+ conda run -n cadence-diff-dev ruff check .
167
+ conda run -n cadence-diff-dev pyright
168
+ ```
169
+
170
+ Tests are contract-driven: `tests/fixtures/generate.py` builds synthetic
171
+ deliverable pairs with a ground-truth defect manifest, and the E2E suite
172
+ asserts both directions — every seeded defect detected, and no finding
173
+ without a seeded cause.
174
+
175
+ ### Layout
176
+
177
+ ```
178
+ qc_tool/
179
+ io/ read-only loading, decryption, XLSB scan/enrichment, snapshots
180
+ excel/ regions, alignment, value/structure/formula QC, deps, preflight
181
+ ppt/ extraction, fuzzy slide matching, diff, preflight
182
+ crosscheck/ figure parsing, source tracing, final-package reconciliation
183
+ triage/ severity rules (analyst overrides layered on top)
184
+ report/ annotated Excel + standalone HTML exports
185
+ history/ SQLite run history, annotations, re-QC lineage
186
+ privacy.py fail-closed OOXML privacy verification
187
+ fingerprint.py structural-only evidence export
188
+ attestation.py signed QC evidence bundles
189
+ progress.py progress events and cooperative cancellation
190
+ server_config.py fail-safe local/temporary-LAN configuration
191
+ ui/ NiceGUI app (loopback only) + theme
192
+ packaged operator guide at /guide
193
+ engine.py run orchestration
194
+ ```
195
+
196
+ ## Publishing (maintainers)
197
+
198
+ Releases are built and validated by GitHub Actions, then published through PyPI
199
+ Trusted Publishing. Create an annotated version tag matching
200
+ `qc_tool.__version__`, publish the corresponding GitHub Release, and promote the
201
+ exact workflow-built artifacts. Do not upload manually or rebuild between
202
+ validation and publication.
203
+
204
+ ## License
205
+
206
+ Apache-2.0 — see [LICENSE](LICENSE).