fusion-cli 1.3.2__tar.gz → 1.4.2__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 (80) hide show
  1. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/PKG-INFO +1 -1
  2. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/hatch_build.py +4 -2
  3. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/pyproject.toml +12 -2
  4. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-analyst/scripts/export.py +10 -8
  5. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/SKILL.md +21 -4
  6. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/references/convert.md +4 -1
  7. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/scripts/convert.py +381 -121
  8. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/scripts/gate.py +85 -47
  9. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/tests/conftest.py +5 -5
  10. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/tests/make_fixtures.py +72 -27
  11. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/tests/test_convert.py +325 -73
  12. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/tests/test_gate.py +75 -13
  13. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/tests/test_integration.py +15 -9
  14. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/restructure.md +7 -1
  15. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/scripts/link-repair.py +83 -37
  16. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/tests/conftest.py +7 -6
  17. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/tests/test_link_repair.py +256 -110
  18. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/bucket.py +25 -10
  19. fusion_cli-1.4.2/src/fusion/checker.py +467 -0
  20. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/cli.py +275 -133
  21. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/document.py +56 -12
  22. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/hub.py +1 -0
  23. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/indexer.py +14 -8
  24. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/ledger.py +19 -6
  25. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/manifest.py +1 -0
  26. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/scaffold.py +21 -11
  27. fusion_cli-1.4.2/src/fusion/setup.py +561 -0
  28. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/update.py +19 -13
  29. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/views.py +32 -19
  30. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/conftest.py +12 -5
  31. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_build_payload.py +22 -10
  32. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_checker_errors.py +20 -15
  33. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_checker_warnings.py +175 -9
  34. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_cli.py +46 -11
  35. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_cli_encoding.py +1 -0
  36. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_cli_setup.py +27 -18
  37. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_cli_update.py +32 -16
  38. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_document.py +76 -10
  39. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_hub_bucket.py +4 -1
  40. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_indexer.py +12 -9
  41. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_ledger.py +70 -18
  42. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_line_endings.py +17 -3
  43. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_roundtrip.py +16 -6
  44. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_scaffold.py +28 -7
  45. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_setup_agents.py +106 -41
  46. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_setup_core.py +46 -3
  47. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_skill_family.py +8 -3
  48. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_views.py +32 -6
  49. fusion_cli-1.4.2/uv.lock +379 -0
  50. fusion_cli-1.3.2/src/fusion/checker.py +0 -275
  51. fusion_cli-1.3.2/src/fusion/setup.py +0 -364
  52. fusion_cli-1.3.2/uv.lock +0 -138
  53. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/.gitignore +0 -0
  54. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/README.md +0 -0
  55. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-analyst/SKILL.md +0 -0
  56. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-analyst/references/assess.md +0 -0
  57. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-analyst/references/compare.md +0 -0
  58. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-analyst/references/export.md +0 -0
  59. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-analyst/references/fusion-conventions.md +0 -0
  60. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-analyst/references/report.md +0 -0
  61. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/references/delivery.md +0 -0
  62. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/references/fusion-conventions.md +0 -0
  63. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-intake/references/gate.md +0 -0
  64. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/SKILL.md +0 -0
  65. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/archive.md +0 -0
  66. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/create.md +0 -0
  67. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/cross-reference.md +0 -0
  68. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/fusion-conventions.md +0 -0
  69. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/promote.md +0 -0
  70. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/query.md +0 -0
  71. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/reflect.md +0 -0
  72. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-librarian/references/tag.md +0 -0
  73. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-planner/SKILL.md +0 -0
  74. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-planner/references/close.md +0 -0
  75. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-planner/references/create-activity.md +0 -0
  76. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-planner/references/fusion-conventions.md +0 -0
  77. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/skills/fusion-planner/references/horizon.md +0 -0
  78. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/src/fusion/__init__.py +0 -0
  79. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/__init__.py +0 -0
  80. {fusion_cli-1.3.2 → fusion_cli-1.4.2}/tests/test_cli_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fusion-cli
3
- Version: 1.3.2
3
+ Version: 1.4.2
4
4
  Summary: The Fusion reference CLI — the notary of the Fusion Convention.
5
5
  Author: Bluewaves Boutique
6
6
  License-Expression: MIT
@@ -7,6 +7,7 @@ Source resolution order:
7
7
  2. <cli>/skills — building from an sdist (the sdist hook below
8
8
  copies skills/ inside so wheel-from-sdist works)
9
9
  """
10
+
10
11
  import shutil
11
12
  from pathlib import Path
12
13
 
@@ -41,8 +42,9 @@ class SkillsBundleHook(BuildHookInterface):
41
42
  if staged.exists():
42
43
  shutil.rmtree(staged)
43
44
  for skill in sorted(src.glob("fusion-*")):
44
- shutil.copytree(skill, staged / skill.name,
45
- ignore=shutil.ignore_patterns(*EXCLUDE))
45
+ shutil.copytree(
46
+ skill, staged / skill.name, ignore=shutil.ignore_patterns(*EXCLUDE)
47
+ )
46
48
 
47
49
  def finalize(self, version, build_data, artifact_path):
48
50
  staged = Path(self.root) / "src" / "fusion" / "_skills"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fusion-cli"
3
- version = "1.3.2"
3
+ version = "1.4.2"
4
4
  description = "The Fusion reference CLI — the notary of the Fusion Convention."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -26,7 +26,17 @@ path = "hatch_build.py"
26
26
  path = "hatch_build.py"
27
27
 
28
28
  [dependency-groups]
29
- dev = ["pytest>=8.0"]
29
+ dev = [
30
+ "mypy>=2.3.0",
31
+ "pytest>=8.0",
32
+ "ruff>=0.15.22",
33
+ "types-pyyaml>=6.0.12.20260518",
34
+ ]
30
35
 
31
36
  [tool.pytest.ini_options]
32
37
  testpaths = ["tests"]
38
+
39
+ [tool.mypy]
40
+ python_version = "3.11"
41
+ files = ["src/fusion"]
42
+ strict = true
@@ -6,6 +6,7 @@
6
6
  """fusion-analyst export: stdin JSON {"headers": [...], "rows": [[...]]}
7
7
  -> csv / json / xlsx on disk. Deterministic; the judgment (what to export)
8
8
  happened before the pipe."""
9
+
9
10
  import argparse
10
11
  import csv
11
12
  import json
@@ -15,8 +16,7 @@ from pathlib import Path
15
16
 
16
17
  def main(argv=None) -> int:
17
18
  ap = argparse.ArgumentParser(description="fusion-analyst data export")
18
- ap.add_argument("--format", "-f", choices=("csv", "json", "xlsx"),
19
- default="csv")
19
+ ap.add_argument("--format", "-f", choices=("csv", "json", "xlsx"), default="csv")
20
20
  ap.add_argument("--output", "-o", required=True)
21
21
  args = ap.parse_args(argv)
22
22
 
@@ -40,12 +40,15 @@ def main(argv=None) -> int:
40
40
  w.writerow(headers)
41
41
  w.writerows(rows)
42
42
  elif args.format == "json":
43
- records = ([dict(zip(headers, r)) for r in rows]
44
- if headers else rows)
45
- out.write_text(json.dumps(records, indent=2, ensure_ascii=False),
46
- encoding="utf-8", newline="\n")
43
+ records = [dict(zip(headers, r)) for r in rows] if headers else rows
44
+ out.write_text(
45
+ json.dumps(records, indent=2, ensure_ascii=False),
46
+ encoding="utf-8",
47
+ newline="\n",
48
+ )
47
49
  else:
48
50
  import openpyxl
51
+
49
52
  wb = openpyxl.Workbook()
50
53
  ws = wb.active
51
54
  ws.title = "export"
@@ -55,8 +58,7 @@ def main(argv=None) -> int:
55
58
  ws.append(r)
56
59
  wb.save(out)
57
60
 
58
- print(json.dumps({"written": str(out), "rows": len(rows),
59
- "format": args.format}))
61
+ print(json.dumps({"written": str(out), "rows": len(rows), "format": args.format}))
60
62
  return 0
61
63
 
62
64
 
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: fusion-intake
3
- description: "The Fusion intake gate — everything that enters a bucket enters through it, losslessly. Classify what landed in inbox/ (new, updated, duplicate, conflicting), preserve the original in sources/ with its sha256 in the MANIFEST, convert to a faithful summary-first document (xlsx, csv, docx, pptx, pdf, html, images, .eml mail, markdown/text exports), propose type and aurora, sign the ledger, clear the inbox. Use when the user says 'process the inbox', 'intake', 'ingest', 'convert this file', or drops files into a Fusion bucket's inbox/. For placement, curation, or restructuring of what is already inside, use fusion-librarian; for deliverables out of the bucket, use fusion-analyst. Applies only inside a Fusion bucket — a directory tree with BUCKET.md and LEDGER.md at its root; if there is no such bucket in play, offer to create one with `fusion new` instead of improvising structure."
3
+ description: "The Fusion intake gate — everything that enters a bucket enters through it, losslessly. Classify what landed in inbox/ (new, updated, duplicate, conflicting), preserve the original in sources/ with its sha256 in the MANIFEST, convert to a faithful summary-first document (xlsx, csv, docx, pptx, pdf, html, images, tiff→png, .eml mail, markdown/text exports), propose type and aurora, sign the ledger, clear the inbox. Use when the user says 'process the inbox', 'intake', 'ingest', 'convert this file', or drops files into a Fusion bucket's inbox/. For placement, curation, or restructuring of what is already inside, use fusion-librarian; for deliverables out of the bucket, use fusion-analyst. Applies only inside a Fusion bucket — a directory tree with BUCKET.md and LEDGER.md at its root; if there is no such bucket in play, offer to create one with `fusion new` instead of improvising structure."
4
4
  license: MIT
5
- compatibility: "Requires the fusion CLI on PATH and uv. LibreOffice (soffice on PATH) required for docx/pptx/legacy office/html formats — fails fast when missing, never silently degrades. Script deps via PEP 723 (openpyxl, PyYAML, pymupdf)."
5
+ compatibility: "Requires the fusion CLI on PATH and uv. LibreOffice (soffice on PATH) required for docx/pptx/legacy office/html formats — fails fast when missing, never silently degrades. Script deps via PEP 723 (openpyxl, PyYAML, pymupdf, pillow)."
6
6
  ---
7
7
 
8
8
  # fusion-intake — the gate
@@ -43,8 +43,8 @@ inbox/ ─► STAGE 1 gate (scripts/gate.py) deterministic: hash, similarit
43
43
 
44
44
  ## Running it
45
45
 
46
- `admit`, `prepare`, `link`, `unpack`, and `gate.py` take the bucket root as
47
- `--bucket`; `cleanup` takes only `--run-dir` — resolve it against the
46
+ `admit`, `prepare`, `link`, `relink`, `unpack`, `batch`, and `gate.py` take
47
+ the bucket root as `--bucket`; `cleanup` takes only `--run-dir` — resolve it against the
48
48
  bucket root before calling (the manifest's `run_dir` is bucket-relative).
49
49
  `<skill>` is this skill's directory.
50
50
 
@@ -70,6 +70,14 @@ and deletes the container — the members become the originals, signed
70
70
  Category follows the bucket's filing rules (BUCKET.md), else a short
71
71
  plural noun (`reports`, `mails`, `gear`). The MANIFEST row is the
72
72
  script's job — never edit MANIFEST.md yourself.
73
+ `.tif`/`.tiff` is converted to PNG right here, deterministically — the
74
+ PNG is admitted as the original (its own sha256 in the MANIFEST row);
75
+ the tiff bytes are not retained (2026-07-12 ruling: no need for large
76
+ tiff files). A single-frame tiff converts cleanly; a multi-frame tiff
77
+ is refused outright (conservative — never a silent first-frame-wins).
78
+ The JSON result carries a `note` field when this happened — sign it
79
+ immediately, same run: `fusion log noted "<note>" --bucket <root> --as
80
+ <you>`.
73
81
  3. **Prepare:**
74
82
  `uv run <skill>/scripts/convert.py prepare --bucket <root> --source <cat>/<name> [--dest …] [--slug …] [--type …] [--aurora …] [--reconcile]`
75
83
  Extractive files (`done: true`) are already conformant documents.
@@ -84,6 +92,10 @@ and deletes the container — the members become the originals, signed
84
92
  `fusion log converted "sources/<cat>/<name> → <doc>" --bucket <root> --as <you>`
85
93
  `fusion index <root>` · `fusion check <root>` — green, then
86
94
  `cleanup --run-dir <dir>`. Nothing remains in inbox for this file.
95
+ 5. **Relink** (only when a linked document later moves):
96
+ `uv run <skill>/scripts/convert.py relink --bucket <root> --source <cat>/<name> --from <old-doc> --to <new-doc>`
97
+ — repoints the cell value in place. MANIFEST.md is single-writer; a
98
+ stale cell is never hand-edited.
87
99
 
88
100
  ## The four classes (locked)
89
101
 
@@ -112,6 +124,11 @@ never erased.
112
124
  ## The fidelity contract (lossless, non-negotiable)
113
125
 
114
126
  - The original lands in `sources/` byte-identical, full sha256 in MANIFEST.
127
+ Exception, human-ruled (2026-07-12): `.tif`/`.tiff` is converted to PNG
128
+ at admit — lossless on pixels, not on bytes, and the human explicitly
129
+ waived tiff-byte preservation to avoid needlessly large files. The PNG
130
+ becomes the original; the source tiff's name + sha256 are carried in
131
+ the admit `note` so the transformation stays honest in the ledger.
115
132
  - Every page is accounted for (`page_count == len(pages)`); a page the
116
133
  text layer can't cover is flagged `needs_vision` and YOU read its image.
117
134
  - Tables: every row, every column. Numbers verbatim — never rounded,
@@ -29,7 +29,10 @@ Format-specific notes:
29
29
  into the document body; if it carried frontmatter, preserve unknown
30
30
  keys (liberal reader) and merge the required three.
31
31
  - **image**: transcribe or describe honestly — a photo gets a faithful
32
- description, a screenshot of text gets the text.
32
+ description, a screenshot of text gets the text. A tiff admitted at
33
+ Stage 1 already landed here as a PNG (admit converts tif/tiff → png,
34
+ 2026-07-12 ruling) — no special casing, it reads exactly like any other
35
+ image.
33
36
  - **html** (`path: libreoffice`): an LLM-artifact-style page — headings,
34
37
  prose, real tables — routed through LibreOffice like docx/pptx/legacy
35
38
  office formats. Read it exactly as any other rendered page below.