bindery-cli 0.64.0__tar.gz → 1.0.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.
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/PKG-INFO +7 -1
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/README.md +6 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/patchnotes.md +35 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/pyproject.toml +1 -1
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/roadmap.md +1 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/spec.md +28 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/__init__.py +1 -1
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/audit.py +12 -2
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_contamination.py +4 -1
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/uv.lock +1 -1
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/.github/FUNDING.yml +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/.github/workflows/ci.yml +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/.github/workflows/publish.yml +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/.gitignore +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/AGENTS.md +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/LICENSE +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/OBSERVE-RESEARCH.md +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/docs/screenshots/library-sweep.png +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/logo.svg +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/plugin/__init__.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/project.done +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/run_tests.sh +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/scripts/FastSweep.java +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/scripts/build_plugin.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/scripts/fast_sweep.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/__main__.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/cli.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/epub.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/library.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/observe.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/pagination.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/reserialize.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/transforms.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/validate.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/src/bindery/watermark.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_audit.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_cli.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_comment_hyphens.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_cover_tocdrift.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_epub.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_flags_real_core.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_flags_wiring.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_help.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_library.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_matcher_hardening.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_observe.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_pagination.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_plugin.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_reserialize.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_space_renames.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_spine_guard.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_transforms.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_validate.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_version.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_watermark.py +0 -0
- {bindery_cli-0.64.0 → bindery_cli-1.0.0}/tests/test_xml_hardening.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bindery-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Audit EPUB body text and repair broken EPUBs with deterministic, epubcheck-gated fixes; atomic in-place replacement in a Calibre library.
|
|
5
5
|
Project-URL: Homepage, https://github.com/VirInvictus/bindery-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/VirInvictus/bindery-cli
|
|
@@ -35,6 +35,12 @@ Description-Content-Type: text/markdown
|
|
|
35
35
|
<img src="docs/screenshots/library-sweep.png" alt="bindery-cli's dry-run library sweep: per-book epubcheck results and a summary table ending in 'no files written'">
|
|
36
36
|
</p>
|
|
37
37
|
|
|
38
|
+
**Status: 1.0.** The flag surface is additive from here — new opt-in flags may
|
|
39
|
+
appear, existing flags' names and documented semantics are stable, and the gate
|
|
40
|
+
semantics plus the JSON record vocabulary are the contract (see the stability
|
|
41
|
+
section in spec.md). The observatory keeps the library census measured; the
|
|
42
|
+
remaining findings are the documented leave-measured classes.
|
|
43
|
+
|
|
38
44
|
## What it fixes
|
|
39
45
|
|
|
40
46
|
bindery-cli makes accidentally broken markup well-formed again. It does not rewrite or reflow content. The **default pass** applies only a small set of deterministic, semantics-preserving well-formedness fixes that real-world EPUBs (especially Calibre conversions) trip over; nothing else changes without an explicit flag:
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
<img src="docs/screenshots/library-sweep.png" alt="bindery-cli's dry-run library sweep: per-book epubcheck results and a summary table ending in 'no files written'">
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
|
+
**Status: 1.0.** The flag surface is additive from here — new opt-in flags may
|
|
12
|
+
appear, existing flags' names and documented semantics are stable, and the gate
|
|
13
|
+
semantics plus the JSON record vocabulary are the contract (see the stability
|
|
14
|
+
section in spec.md). The observatory keeps the library census measured; the
|
|
15
|
+
remaining findings are the documented leave-measured classes.
|
|
16
|
+
|
|
11
17
|
## What it fixes
|
|
12
18
|
|
|
13
19
|
bindery-cli makes accidentally broken markup well-formed again. It does not rewrite or reflow content. The **default pass** applies only a small set of deterministic, semantics-preserving well-formedness fixes that real-world EPUBs (especially Calibre conversions) trip over; nothing else changes without an explicit flag:
|
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# bindery-cli Patch Notes
|
|
2
2
|
|
|
3
|
+
## v1.0.0 (2026-11-05)
|
|
4
|
+
|
|
5
|
+
### 1.0: the contract is the promise
|
|
6
|
+
|
|
7
|
+
bindery-cli is 1.0. The observatory's final cycle states the mission's
|
|
8
|
+
completion in numbers: the library's default-pass preview answers
|
|
9
|
+
accepted 0 / partial 0 / rejected 0 / equal 46 — the arsenal has nothing
|
|
10
|
+
left to give on this library — clean sits at 4,126 of 7,156, error mass
|
|
11
|
+
at 11,455 (from 16,182 across the session's waves), and the library
|
|
12
|
+
carries ZERO fatal books. 2,055 books were repaired across the session's
|
|
13
|
+
waves; every finding class in the census is dispositioned: repaired,
|
|
14
|
+
detected at intake, or leave-measured with a recorded reason.
|
|
15
|
+
|
|
16
|
+
**What 1.0 means** (the stability contract, now a section in spec.md):
|
|
17
|
+
the flag surface is additive from here — new opt-in flags may appear,
|
|
18
|
+
existing flags' names and documented semantics do not change; the gate's
|
|
19
|
+
improvement/no-worse bars, the spine-collapse veto, and the shell
|
|
20
|
+
signature's 50% gate are stable; the JSON record vocabulary, the fix
|
|
21
|
+
breakdown, the exit-code contracts, and the observe schema (v2) are
|
|
22
|
+
stable, and downstream consumers can pin `bindery>=1.0`. Predicate
|
|
23
|
+
refinements ship documented in patchnotes with oracle evidence — the
|
|
24
|
+
standard this session set (base-free v0.62.0, the doctype narrowing
|
|
25
|
+
v0.63.0, both proven against epubcheck before they moved).
|
|
26
|
+
|
|
27
|
+
**This release carries**: the shell-% denominator fix (a shell now reads
|
|
28
|
+
its true manifest fraction — 75% for the Wandering Inn shape — instead
|
|
29
|
+
of the resolved-spine-only denominator that read shells at over 100%),
|
|
30
|
+
and the 1.0 stability section in spec.md plus the README status line.
|
|
31
|
+
The tool itself is v0.64.0's: `--prune-dead-spine` closed the Wandering
|
|
32
|
+
Inn repair (both books live-applied at 0f/2e and 0f/3e from 0f/739e and
|
|
33
|
+
0f/742e), and the remaining census is the documented leave-measured
|
|
34
|
+
edge.
|
|
35
|
+
|
|
36
|
+
Suite: 917 tests.
|
|
37
|
+
|
|
3
38
|
## v0.64.0 (2026-11-05)
|
|
4
39
|
|
|
5
40
|
### --prune-dead-spine: the shell repair
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bindery-cli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "1.0.0"
|
|
8
8
|
description = "Audit EPUB body text and repair broken EPUBs with deterministic, epubcheck-gated fixes; atomic in-place replacement in a Calibre library."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
classifiers = [
|
|
@@ -60,6 +60,7 @@ The plugin vendors the core and never gates (the epubcheck latency ruling).
|
|
|
60
60
|
| 0.62.2 | The review batch (three-reviewer pass over the v0.62.x range): the item-properties insertion branch emitted malformed XML on the self-closed shape (attribute after the solidus; no test drove the branch -- every fixture pre-carried properties), now appends before the solidus with an ET-parsed pin; the missing-title empty-fill is head-scoped (an empty SVG `<title>` is visible text); the double-colon tail is bounded at 120 chars (the escaped-bracket runaway); the unverified on\* handler disjunct left the census; `_scan_doctype_span` refuses unterminated declarations; the guide-prune docstring matches the code; and the documentation inventories caught up (README's seven missing flags, spec.md's four behavioral bullets + body counts + the safe-opt-in section, AGENTS.md's inventory) | v0.62.2 |
|
|
61
61
|
| 0.63 | The harvest census (the honest dig into the remaining 14,109): `--strip-presentational-attrs` (the largest attribute family; rendering-caveat approved), `--encode-ref-brackets` (the issue #19 mechanism applied to brackets without spaces; the 59-book RSC-020 lane), `--fix-id-colons` broadened to every NCName failure (digit-led scraped ids; the apostrophe charset blind spot closed), and the audit battery's `shell` analyzer (the Wandering Inn detector: spine-missing fraction at or over 50% reads SHELL, re-source never repair) | v0.63.0 |
|
|
62
62
|
| 0.63.1 | Two single-flag live-verification catches: `--encode-ref-brackets` alone was a silent no-op (`present` only filled under the other flags' guard -- The Given Day's 59 NCX bracket srcs encoded, zero raw left, once the guard included the flag), and the audit CLI's `--only` choices lacked `shell` | v0.63.1 |
|
|
63
|
+
| 1.0 | The milestone: the contract is the promise (spec.md stability section — additive flag surface, stable gate/records, oracle-evidenced predicate refinements), the shell-% denominator fix, the README status line. The observatory's final cycle: preview 0/0/0, clean 4,126/7,156, mass 11,455, ZERO fatals, 2,055 books repaired across the session's waves. Open items carry as 1.x additive work: RSC-011's spine-write policy call, the header-pseudo-tag someday-flag, the observatory cadence | v1.0.0 |
|
|
63
64
|
| 0.64 | `--prune-dead-spine`: the shell repair, shell-gated at the 50% signature (drops dead manifest items + spine itemrefs, coordinates the NCX navPoint prune and an UNCONDITIONAL playOrder re-sequence to 1..K after epubcheck 5.3 flagged the non-1 base on the post-prune shape -- the base-free clause's minimal matrix missed the shell shape); proven at 742e -> 5e on the facility copy | v0.64.0 |
|
|
64
65
|
|
|
65
66
|
## Open work
|
|
@@ -1013,3 +1013,31 @@ Behavior contract:
|
|
|
1013
1013
|
on stay out of scope, and anything the opt-ins cannot make deterministically
|
|
1014
1014
|
safe is detected as `partial`/`nochange` and reported.
|
|
1015
1015
|
- Editing human-facing dc: metadata or creating content.
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
## The 1.0 stability contract (2026-11-05)
|
|
1019
|
+
|
|
1020
|
+
1.0 is a contract statement, not a feature claim: the tool does what this
|
|
1021
|
+
document says, and this document is the promise. Concretely, from 1.0.0:
|
|
1022
|
+
|
|
1023
|
+
- **The flag surface is additive.** New opt-in flags may appear; existing
|
|
1024
|
+
flags' names and documented semantics do not change. A predicate
|
|
1025
|
+
refinement (a flag firing less or more than before) is a behavior
|
|
1026
|
+
change and ships documented in patchnotes with oracle evidence, as
|
|
1027
|
+
base-free (v0.62.0), the doctype narrowing (v0.63.0), and the
|
|
1028
|
+
presentational set's scoping did.
|
|
1029
|
+
- **The gate is stable.** The two-mode improvement/no-worse acceptance
|
|
1030
|
+
bars, the spine-collapse veto, and the shell signature's 50% gate are
|
|
1031
|
+
the contract; their thresholds do not move silently.
|
|
1032
|
+
- **The record vocabulary is stable.** `repair --json` / `library --json`
|
|
1033
|
+
record shapes, the fix-breakdown keys, the exit-code contracts, and the
|
|
1034
|
+
observe schema (v2) do not change in 1.x. Consumers (CalibreQuarry's
|
|
1035
|
+
lossy-consent mirror) can pin `bindery>=1.0`.
|
|
1036
|
+
- **The audit battery is additive.** Analyzers join the battery
|
|
1037
|
+
(`shell`, v0.63.0); existing analyzers' verdict shapes do not change,
|
|
1038
|
+
and advisory analyzers never move the exit code.
|
|
1039
|
+
|
|
1040
|
+
What 1.0 does NOT claim: that every book is repairable. The content-model
|
|
1041
|
+
zoo, the shell books (detected, re-source), and the WARN litter stay
|
|
1042
|
+
measured by the observatory — the charter's "render identically" line
|
|
1043
|
+
puts them out of repair scope permanently.
|
|
@@ -11,7 +11,7 @@ Calibre plugin built from this core.
|
|
|
11
11
|
Single source of truth for the version. pyproject.toml must match VERSION below.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
VERSION = "0.
|
|
14
|
+
VERSION = "1.0.0"
|
|
15
15
|
__version__ = VERSION
|
|
16
16
|
|
|
17
17
|
from .epub import RepairReport, repair_epub # noqa: E402
|
|
@@ -1527,8 +1527,18 @@ def analyze_shell(book: Book) -> dict:
|
|
|
1527
1527
|
Advisory by contract, like completeness."""
|
|
1528
1528
|
spine_n = len(book.spine)
|
|
1529
1529
|
missing = book.spine_missing
|
|
1530
|
-
|
|
1531
|
-
|
|
1530
|
+
# the denominator is resolved + missing (the manifest the book claims),
|
|
1531
|
+
# not the resolved spine alone: on a shell the resolved spine is the
|
|
1532
|
+
# sliver (14 of 752), so a spine-only denominator read shells at over
|
|
1533
|
+
# 100% (the 2026-11-04 display quirk, fixed v1.0.0)
|
|
1534
|
+
total = spine_n + missing
|
|
1535
|
+
frac = (missing / total) if total else 0.0
|
|
1536
|
+
return {
|
|
1537
|
+
"spine_docs": spine_n,
|
|
1538
|
+
"missing": missing,
|
|
1539
|
+
"manifest_total": total,
|
|
1540
|
+
"missing_frac": frac,
|
|
1541
|
+
}
|
|
1532
1542
|
|
|
1533
1543
|
|
|
1534
1544
|
def _shell_dir(r: dict) -> tuple[bool, str, list[str]]:
|
|
@@ -421,7 +421,10 @@ class TestShellAnalyzer(unittest.TestCase):
|
|
|
421
421
|
with tempfile.TemporaryDirectory() as tmp:
|
|
422
422
|
book = load_book(_epub(tmp, opf, files))
|
|
423
423
|
r = analyze_shell(book)
|
|
424
|
-
|
|
424
|
+
# v1.0.0 denominator: resolved spine + missing (the manifest the
|
|
425
|
+
# book claims), so a shell reads its true fraction -- never over 1
|
|
426
|
+
self.assertEqual(r["missing_frac"], 0.75)
|
|
427
|
+
self.assertEqual(r["manifest_total"], 4)
|
|
425
428
|
_p, status, lines = _shell_dir(r)
|
|
426
429
|
self.assertIn("SHELL", status)
|
|
427
430
|
self.assertIn("re-source", status)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|