zesus 0.1.0a1__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.
- zesus-0.1.0a1/.gitattributes +3 -0
- zesus-0.1.0a1/.github/workflows/ci.yml +18 -0
- zesus-0.1.0a1/.gitignore +19 -0
- zesus-0.1.0a1/AI_POLICY.md +58 -0
- zesus-0.1.0a1/CHANGELOG.md +12 -0
- zesus-0.1.0a1/CLAUDE.md +109 -0
- zesus-0.1.0a1/CODE_OF_CONDUCT.md +54 -0
- zesus-0.1.0a1/CONTRIBUTING.md +47 -0
- zesus-0.1.0a1/LICENSE +202 -0
- zesus-0.1.0a1/PKG-INFO +175 -0
- zesus-0.1.0a1/README.md +128 -0
- zesus-0.1.0a1/SECURITY.md +13 -0
- zesus-0.1.0a1/dev/imgtool.py +227 -0
- zesus-0.1.0a1/dev/make_ext4_fixtures.sh +47 -0
- zesus-0.1.0a1/dev/testimage.example.toml +3 -0
- zesus-0.1.0a1/docs/architecture.md +76 -0
- zesus-0.1.0a1/docs/how-to-use.md +238 -0
- zesus-0.1.0a1/docs/map-format.md +27 -0
- zesus-0.1.0a1/docs/writing-plugins.md +59 -0
- zesus-0.1.0a1/examples/plugin-template/pyproject.toml +14 -0
- zesus-0.1.0a1/examples/plugin-template/src/zesus_example/__init__.py +53 -0
- zesus-0.1.0a1/pyproject.toml +72 -0
- zesus-0.1.0a1/src/zesus/__init__.py +4 -0
- zesus-0.1.0a1/src/zesus/carve/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/carve/classify.py +245 -0
- zesus-0.1.0a1/src/zesus/carve/fastsum.py +59 -0
- zesus-0.1.0a1/src/zesus/carve/reconstruct.py +538 -0
- zesus-0.1.0a1/src/zesus/carve/scanner.py +182 -0
- zesus-0.1.0a1/src/zesus/carve/verify.py +388 -0
- zesus-0.1.0a1/src/zesus/cli/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/cli/extract_cmd.py +249 -0
- zesus-0.1.0a1/src/zesus/cli/fullreport.py +178 -0
- zesus-0.1.0a1/src/zesus/cli/main.py +159 -0
- zesus-0.1.0a1/src/zesus/cli/report.py +64 -0
- zesus-0.1.0a1/src/zesus/errors.py +35 -0
- zesus-0.1.0a1/src/zesus/extract/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/extract/engine.py +528 -0
- zesus-0.1.0a1/src/zesus/extract/send.py +282 -0
- zesus-0.1.0a1/src/zesus/extract/sparse.py +30 -0
- zesus-0.1.0a1/src/zesus/fs/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/fs/api.py +152 -0
- zesus-0.1.0a1/src/zesus/fs/ext4/__init__.py +536 -0
- zesus-0.1.0a1/src/zesus/fs/ext4/journal.py +162 -0
- zesus-0.1.0a1/src/zesus/fs/ext4/structs.py +234 -0
- zesus-0.1.0a1/src/zesus/fs/identify/__init__.py +93 -0
- zesus-0.1.0a1/src/zesus/fs/registry.py +62 -0
- zesus-0.1.0a1/src/zesus/io/__init__.py +3 -0
- zesus-0.1.0a1/src/zesus/io/guard.py +120 -0
- zesus-0.1.0a1/src/zesus/io/source.py +250 -0
- zesus-0.1.0a1/src/zesus/log.py +39 -0
- zesus-0.1.0a1/src/zesus/map/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/map/codes.py +39 -0
- zesus-0.1.0a1/src/zesus/map/db.py +158 -0
- zesus-0.1.0a1/src/zesus/map/schema.sql +303 -0
- zesus-0.1.0a1/src/zesus/partitions/__init__.py +78 -0
- zesus-0.1.0a1/src/zesus/partitions/gpt.py +109 -0
- zesus-0.1.0a1/src/zesus/partitions/mbr.py +77 -0
- zesus-0.1.0a1/src/zesus/scan/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/scan/phases.py +585 -0
- zesus-0.1.0a1/src/zesus/scan/pipeline.py +123 -0
- zesus-0.1.0a1/src/zesus/volume/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/volume/coverage.py +96 -0
- zesus-0.1.0a1/src/zesus/volume/logical.py +199 -0
- zesus-0.1.0a1/src/zesus/web/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/web/app.py +274 -0
- zesus-0.1.0a1/src/zesus/web/index.html +295 -0
- zesus-0.1.0a1/src/zesus/zfs/__init__.py +0 -0
- zesus-0.1.0a1/src/zesus/zfs/blkptr.py +167 -0
- zesus-0.1.0a1/src/zesus/zfs/checksum.py +143 -0
- zesus-0.1.0a1/src/zesus/zfs/compress.py +142 -0
- zesus-0.1.0a1/src/zesus/zfs/constants.py +197 -0
- zesus-0.1.0a1/src/zesus/zfs/dnode.py +191 -0
- zesus-0.1.0a1/src/zesus/zfs/dsl.py +167 -0
- zesus-0.1.0a1/src/zesus/zfs/history.py +136 -0
- zesus-0.1.0a1/src/zesus/zfs/label.py +140 -0
- zesus-0.1.0a1/src/zesus/zfs/nvlist.py +221 -0
- zesus-0.1.0a1/src/zesus/zfs/objset.py +132 -0
- zesus-0.1.0a1/src/zesus/zfs/pool.py +133 -0
- zesus-0.1.0a1/src/zesus/zfs/reader.py +206 -0
- zesus-0.1.0a1/src/zesus/zfs/vdev.py +103 -0
- zesus-0.1.0a1/src/zesus/zfs/zap.py +147 -0
- zesus-0.1.0a1/src/zesus/zfs/zpl.py +278 -0
- zesus-0.1.0a1/tests/__init__.py +0 -0
- zesus-0.1.0a1/tests/conftest.py +56 -0
- zesus-0.1.0a1/tests/fixtures/ext4-basic.img.gz +0 -0
- zesus-0.1.0a1/tests/fixtures/ext4-inline.img.gz +0 -0
- zesus-0.1.0a1/tests/integration/__init__.py +0 -0
- zesus-0.1.0a1/tests/integration/test_image.py +66 -0
- zesus-0.1.0a1/tests/unit/__init__.py +0 -0
- zesus-0.1.0a1/tests/unit/test_cluster.py +47 -0
- zesus-0.1.0a1/tests/unit/test_ext4.py +96 -0
- zesus-0.1.0a1/tests/unit/test_guard.py +101 -0
- zesus-0.1.0a1/tests/unit/test_journal.py +68 -0
- zesus-0.1.0a1/tests/unit/test_map_migration.py +33 -0
- zesus-0.1.0a1/tests/unit/test_partitions_coverage.py +88 -0
- zesus-0.1.0a1/tests/unit/test_send.py +105 -0
- zesus-0.1.0a1/tests/unit/test_zfs_core.py +210 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
test:
|
|
5
|
+
strategy:
|
|
6
|
+
fail-fast: false
|
|
7
|
+
matrix:
|
|
8
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
9
|
+
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
10
|
+
runs-on: ${{ matrix.os }}
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: ${{ matrix.python }}
|
|
16
|
+
- run: pip install -e ".[dev]"
|
|
17
|
+
- run: ruff check src tests
|
|
18
|
+
- run: pytest -q
|
zesus-0.1.0a1/.gitignore
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
.venv/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
.ruff_cache/
|
|
9
|
+
.mypy_cache/
|
|
10
|
+
# scan outputs and extracted data never belong in the repo
|
|
11
|
+
*.sqlite
|
|
12
|
+
*.sqlite-wal
|
|
13
|
+
*.sqlite-shm
|
|
14
|
+
*.log.jsonl
|
|
15
|
+
*.img
|
|
16
|
+
/out/
|
|
17
|
+
/work/
|
|
18
|
+
/dev/testimage.toml
|
|
19
|
+
.claude/
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# AI use policy
|
|
2
|
+
|
|
3
|
+
## How this project was made
|
|
4
|
+
|
|
5
|
+
Zesus was written with [Claude Code](https://claude.com/claude-code), using Anthropic's
|
|
6
|
+
Claude Opus 5.5 model, under the direction of a human maintainer. The maintainer:
|
|
7
|
+
|
|
8
|
+
* set the goals;
|
|
9
|
+
* made the design decisions;
|
|
10
|
+
* tested the tool against a real damaged pool;
|
|
11
|
+
* reviewed the results.
|
|
12
|
+
|
|
13
|
+
Commits co-written with AI carry a `Co-Authored-By` trailer that says so.
|
|
14
|
+
|
|
15
|
+
## AI-assisted contributions are welcome
|
|
16
|
+
|
|
17
|
+
You may use AI tools to write code, tests or documentation for Zesus. We care about the
|
|
18
|
+
quality of a contribution, not about which tools produced it.
|
|
19
|
+
|
|
20
|
+
## Your contribution is your responsibility
|
|
21
|
+
|
|
22
|
+
* **You are the author.** Whatever you submit, you are accountable for it: its correctness,
|
|
23
|
+
its licensing, and its consequences. "The AI wrote it" is not an explanation for a bug, a
|
|
24
|
+
hallucinated API, or a broken test. Low-quality contributions will be treated as
|
|
25
|
+
low-quality contributions, whatever tool produced them.
|
|
26
|
+
* **Test it and review it yourself before you submit it.** Run the test suite. Exercise the
|
|
27
|
+
change for real, against an image where that makes sense. Read every line. If you cannot
|
|
28
|
+
explain what a change does and why it is correct, it is not ready.
|
|
29
|
+
* **Check the facts.** Anything that claims something about ZFS on-disk structures,
|
|
30
|
+
filesystem formats or tool behaviour must be verified against the OpenZFS source,
|
|
31
|
+
published documentation, or a real image. Do not trust a model's description alone.
|
|
32
|
+
Recovery tools that act on invented facts destroy people's data, or give them false
|
|
33
|
+
confidence.
|
|
34
|
+
|
|
35
|
+
## Commit messages and pull requests
|
|
36
|
+
|
|
37
|
+
* **Descriptive and to the point.** Say what changed and why. Skip the boilerplate,
|
|
38
|
+
filler and marketing tone.
|
|
39
|
+
* **Free of hallucinations.** Describe only what the change actually does, how you actually
|
|
40
|
+
tested it, and what you actually observed. Do not claim tests pass that you did not run,
|
|
41
|
+
cite issues that do not exist, or describe behaviour you did not verify.
|
|
42
|
+
* **Disclose substantial AI help.** Add a trailer such as
|
|
43
|
+
`Co-Authored-By: <model or tool>` or `Assisted-by: <tool>` to the commit message. It is not
|
|
44
|
+
a penalty. It helps reviewers know where to look harder.
|
|
45
|
+
|
|
46
|
+
## This project's own rules still apply
|
|
47
|
+
|
|
48
|
+
AI assistance changes nothing in [CONTRIBUTING.md](CONTRIBUTING.md). In particular:
|
|
49
|
+
|
|
50
|
+
* nothing may write to the evidence;
|
|
51
|
+
* nothing may silently guess;
|
|
52
|
+
* parsers must survive damaged input;
|
|
53
|
+
* **never paste real case data (disk images, maps, file names, file contents) into an AI
|
|
54
|
+
service** that you do not control. It is someone's private data.
|
|
55
|
+
|
|
56
|
+
Maintainers may ask how a change was produced and tested. They may decline contributions
|
|
57
|
+
that show signs of unreviewed generation, such as code that does not match its description,
|
|
58
|
+
tests that do not test anything, or confidently wrong explanations.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (unreleased)
|
|
4
|
+
|
|
5
|
+
* First version: pool/label/uberblock discovery; pool history decoding; DSL traversal
|
|
6
|
+
across the whole uberblock ring; resumable raw-device carving; multi-generation zvol
|
|
7
|
+
reconstruction; data verification with fallback to older generations; GPT/MBR; ext4
|
|
8
|
+
inventory with virtual journal replay; extraction of volumes, partitions and files
|
|
9
|
+
with gap reports; local web UI.
|
|
10
|
+
* `zesus send` and the web UI's "send" action: rsync recovered files back to a server, then
|
|
11
|
+
restore original names (including ones Windows can't store), symlinks, modes, times and
|
|
12
|
+
owners from the map.
|
zesus-0.1.0a1/CLAUDE.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Guidance for Claude Code (and humans) working on **Zesus**, *ZFS Emergency Storage Undelete
|
|
4
|
+
Support*. Zesus is a forensic scanner and extractor that recovers destroyed ZFS volumes and
|
|
5
|
+
datasets, even after they have left the uberblock ring.
|
|
6
|
+
|
|
7
|
+
## Non-negotiable rules
|
|
8
|
+
|
|
9
|
+
1. **Never write to the evidence.**
|
|
10
|
+
* All source access goes through `zesus.io.RawSource` / `SliceSource` (opened `O_RDONLY`).
|
|
11
|
+
* `zesus.io.guard` installs an audit hook that raises `SourceWriteAttempt` on any write-mode
|
|
12
|
+
open, truncate, rename or remove of a protected path.
|
|
13
|
+
* Do not add write paths to `src/zesus/io/`. `tests/unit/test_guard.py` checks this
|
|
14
|
+
statically.
|
|
15
|
+
* Outputs (maps, extractions) must never resolve to the source.
|
|
16
|
+
2. **Never guess silently.**
|
|
17
|
+
* Every recovered byte is checksum-verified against a parent block pointer.
|
|
18
|
+
* Anything inferred or unverified is labelled: statuses `ok_stale`, carved provenance,
|
|
19
|
+
`--include-unverified`.
|
|
20
|
+
* Gaps are zero- or pattern-filled *and* reported (`*.gaps.json`, ddrescue mapfile,
|
|
21
|
+
manifest).
|
|
22
|
+
3. **Privacy.** Test images may contain someone's personal files. Inspect structure
|
|
23
|
+
(superblocks, directories, counts) freely, but do not print or read file *contents*
|
|
24
|
+
unless the owner asks. Validate data integrity with self-checking formats (archive CRCs,
|
|
25
|
+
checksums) instead.
|
|
26
|
+
4. **Parsers must be damage-tolerant.** Truncated, zeroed or random input must not crash a
|
|
27
|
+
phase. Record a problem and continue.
|
|
28
|
+
|
|
29
|
+
## Layout
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
src/zesus/
|
|
33
|
+
io/ read-only sources + write guard
|
|
34
|
+
zfs/ on-disk format: label/uberblock, nvlist (XDR + native), blkptr, checksum,
|
|
35
|
+
compress, dnode, objset, zap, dsl, history, zpl (ZFS filesystems), pool, reader
|
|
36
|
+
carve/ scanner (resumable raw carving) · classify · reconstruct (multi-generation
|
|
37
|
+
tree merge + orphan placement + root clustering) · verify · fastsum (numba)
|
|
38
|
+
volume/ LogicalVolume (gap-aware device over a reconstructed zvol) · Coverage
|
|
39
|
+
partitions/ GPT, MBR plugins
|
|
40
|
+
fs/ plugin API (api.py), registry, ext4 plugin (+ virtual JBD2 replay), identifiers
|
|
41
|
+
extract/ extraction engine (+ LocalNamer: collision-safe local names), sparse output,
|
|
42
|
+
send.py (stage → rsync → generated POSIX restore script)
|
|
43
|
+
scan/ pipeline (phase runner, resumable, downstream invalidation) · phases
|
|
44
|
+
map/ schema.sql, db.py (WAL, in-place migrations), codes.py (block statuses)
|
|
45
|
+
cli/ main (scan/info/report/web), extract_cmd (extract/ls), report, fullreport
|
|
46
|
+
web/ FastAPI + single-file vanilla JS UI (localhost only)
|
|
47
|
+
dev/ imgtool.py (inspect an image), make_ext4_fixtures.sh
|
|
48
|
+
tests/ unit (fixtures in tests/fixtures), integration (needs ZESUS_TEST_IMAGE)
|
|
49
|
+
docs/ how-to-use.md (user recipes), architecture.md, map-format.md, writing-plugins.md
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Scan phases, in order: `history → datasets → carve → reconstruct → verify → contents`.
|
|
53
|
+
Re-running a phase resets every later phase except `carve`, which is additive and resumes
|
|
54
|
+
by chunk.
|
|
55
|
+
|
|
56
|
+
## Commands
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install -e ".[dev,all]"
|
|
60
|
+
pytest -q # unit tests; ~1 s
|
|
61
|
+
ZESUS_TEST_IMAGE=/path/pool.img pytest -q # plus integration tests
|
|
62
|
+
ruff check src tests dev examples # must be clean
|
|
63
|
+
python dev/imgtool.py --image IMG uberblocks # also: labels, history, datasets, objset, zap, dva, bp, carve-sample
|
|
64
|
+
wsl -e sh dev/make_ext4_fixtures.sh # rebuild ext4 test images (needs e2fsprogs)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
For fast iteration on a big image, use a small slice:
|
|
68
|
+
`zesus scan IMG -o t.sqlite --phases history,datasets,reconstruct,verify,contents --limit-blocks 102400`.
|
|
69
|
+
|
|
70
|
+
## Conventions and gotchas
|
|
71
|
+
|
|
72
|
+
* **Map schema changes** need a migration in `MapDB._migrate()`. Rebuild tables with
|
|
73
|
+
"create new → copy → drop → rename" and `legacy_alter_table=ON`. A plain `RENAME` rewrites
|
|
74
|
+
other tables' foreign keys. `tests/unit/test_map_migration.py` covers this.
|
|
75
|
+
* **The map is an index, not a data store.** Volumes store L1 candidate pointers per span
|
|
76
|
+
(`volume_spans`), not every L0 pointer. Derive L0 pointers through `LogicalVolume` or
|
|
77
|
+
`carve.verify.chosen_blocks`.
|
|
78
|
+
* **Big volumes:** keep per-block work in numpy. A zvol can have 50M+ blocks, so avoid
|
|
79
|
+
Python dicts or loops per block (see `Summary`, `ChildIndex`, and the coverage-driven gap
|
|
80
|
+
loop in the extractor).
|
|
81
|
+
* **Spinning disks:** always read in physical order (`read_many`, `windows()`).
|
|
82
|
+
* **Carved roots:** associate them with a dataset by *shared tree blocks* (`cluster()`),
|
|
83
|
+
never by size or geometry alone.
|
|
84
|
+
* **Windows:** pass `encoding="utf-8"` to every `read_text`/`write_text`, since the default
|
|
85
|
+
is cp1252. Paths from the evidence may be un-decodable: use `surrogateescape`, and
|
|
86
|
+
`safe_name()` when creating files.
|
|
87
|
+
* **Plugins** register via entry points (`zesus.filesystems`, `zesus.partitions`,
|
|
88
|
+
`zesus.identifiers`). Core must not import plugin-specific code, except the built-ins
|
|
89
|
+
in the registries.
|
|
90
|
+
* Commit messages: imperative subject, a body explaining *why*. Follow [AI_POLICY.md](AI_POLICY.md): state only what
|
|
91
|
+
was actually done and tested, and keep the `Co-Authored-By` trailer on AI-assisted commits.
|
|
92
|
+
|
|
93
|
+
## Status and next steps
|
|
94
|
+
|
|
95
|
+
Validated end to end on a real 1 TB single-disk pool:
|
|
96
|
+
* A destroyed 880 GiB zvol (GPT + ext4) was rebuilt from 1,202 carved tree generations.
|
|
97
|
+
* Carved-only and ring+carved reconstructions matched slot for slot.
|
|
98
|
+
* Extracted files passed independent integrity checks.
|
|
99
|
+
|
|
100
|
+
Open items, roughly by value:
|
|
101
|
+
1. Carved-only reconstruction for destroyed ZFS **filesystem** datasets (the volume path in
|
|
102
|
+
`phase_reconstruct` shows the approach: cluster carved `os_type=2` objsets and walk
|
|
103
|
+
them with `ZplFilesystem`).
|
|
104
|
+
2. Test fixtures made by real OpenZFS (small file-backed pools with destroyed zvols and
|
|
105
|
+
datasets) for CI. These need a machine with ZFS. Add a `dev/make_zfs_fixtures.sh`.
|
|
106
|
+
3. RAIDZ/dRAID reconstruction in `zfs/vdev.py` (they are currently reported as unsupported).
|
|
107
|
+
4. More filesystem plugins: XFS and NTFS inventory (identification exists already).
|
|
108
|
+
5. Verification of zvol **snapshots** as their own volumes.
|
|
109
|
+
6. Encrypted datasets (with a user-supplied key).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
This project follows the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
|
|
4
|
+
Its standards and enforcement guidelines apply here in full. The sections below add
|
|
5
|
+
project-specific expectations; they do not replace anything in the Covenant.
|
|
6
|
+
|
|
7
|
+
## Be professional
|
|
8
|
+
|
|
9
|
+
Be respectful and assume good faith. People often arrive here after losing important
|
|
10
|
+
data, sometimes under real pressure. Help them, or leave the thread to someone who will.
|
|
11
|
+
|
|
12
|
+
Disagreements are expected. Keep them technical: argue about code, data and evidence,
|
|
13
|
+
never about the person. If a discussion turns into an argument, step away and let a
|
|
14
|
+
maintainer settle it.
|
|
15
|
+
|
|
16
|
+
## Stay on topic: no politics
|
|
17
|
+
|
|
18
|
+
Zesus exists to recover data from ZFS pools. Every project space stays on that purpose.
|
|
19
|
+
|
|
20
|
+
**Political, ideological, religious and social-cause content is not allowed in any project
|
|
21
|
+
space.** This applies equally to every cause, side and viewpoint, without exception. It is
|
|
22
|
+
not a statement about any of those causes, or about whether they matter. It is a statement
|
|
23
|
+
that this project is not the place for them.
|
|
24
|
+
|
|
25
|
+
Project spaces are:
|
|
26
|
+
* issues, pull requests, discussions and review comments;
|
|
27
|
+
* commit messages;
|
|
28
|
+
* code, comments, documentation, release notes and the README;
|
|
29
|
+
* project-owned chat channels and social accounts.
|
|
30
|
+
|
|
31
|
+
Not allowed there, for example:
|
|
32
|
+
* slogans, banners, badges or messages for or against any political figure, party,
|
|
33
|
+
government, movement, conflict or cause;
|
|
34
|
+
* political symbols or messages in code, test data, sample files or artwork added to the
|
|
35
|
+
repository;
|
|
36
|
+
* arguing about current events, or answering someone else's political remark.
|
|
37
|
+
|
|
38
|
+
Contributors are free to hold and express any views they like outside project spaces.
|
|
39
|
+
However, directing public attacks, harassment or bad-faith criticism at the project, its
|
|
40
|
+
maintainers or its community from outside project spaces is incompatible with contributing
|
|
41
|
+
to it. Honest, good-faith criticism is always welcome, wherever it is made: a public bug
|
|
42
|
+
report, a critical review, or a write-up of where Zesus failed you. (Though we would prefer
|
|
43
|
+
that you raise it with us first, so that we can make sure no one else has to deal with the
|
|
44
|
+
same problem.)
|
|
45
|
+
|
|
46
|
+
If someone brings politics in, **do not reply to it**. Report it to the maintainers, who
|
|
47
|
+
will remove or hide the content and, if needed, lock the thread. Repeated or deliberate
|
|
48
|
+
violations are handled under the Covenant's
|
|
49
|
+
[enforcement guidelines](https://www.contributor-covenant.org/version/2/1/code_of_conduct/#enforcement-guidelines).
|
|
50
|
+
|
|
51
|
+
## Reporting
|
|
52
|
+
|
|
53
|
+
Report unacceptable behaviour privately to the maintainers, through the contact listed on the
|
|
54
|
+
GitHub repository. Reports are handled confidentially.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping. Data recovery tools are only as good as the formats and failure
|
|
4
|
+
cases they have seen.
|
|
5
|
+
|
|
6
|
+
## Setup
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
python -m venv .venv && . .venv/bin/activate
|
|
10
|
+
pip install -e ".[dev,all]"
|
|
11
|
+
pytest
|
|
12
|
+
ruff check src tests
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Integration tests run against a real ZFS image when `ZESUS_TEST_IMAGE` is set.
|
|
16
|
+
|
|
17
|
+
## Conduct
|
|
18
|
+
|
|
19
|
+
Be professional, keep discussions technical, and keep politics out of the project entirely.
|
|
20
|
+
See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
|
|
21
|
+
|
|
22
|
+
## Using AI tools
|
|
23
|
+
|
|
24
|
+
AI-assisted contributions are welcome. You remain responsible for everything you submit:
|
|
25
|
+
test it, review it, and keep commit messages factual. See [AI_POLICY.md](AI_POLICY.md).
|
|
26
|
+
|
|
27
|
+
## Ground rules
|
|
28
|
+
|
|
29
|
+
* **The source is sacred.** Nothing may write to the evidence. All access goes through
|
|
30
|
+
`zesus.io.RawSource`, and `tests/unit/test_guard.py` enforces the rule. Pull
|
|
31
|
+
requests that add write paths to `zesus/io` will not be merged.
|
|
32
|
+
* **Never guess silently.** Anything unverified or inferred must be labelled as such in
|
|
33
|
+
the map and in output reports.
|
|
34
|
+
* **Be damage-tolerant.** Parsers must survive truncated, zeroed and random input. Log
|
|
35
|
+
what could not be read and continue.
|
|
36
|
+
* New filesystem support belongs in a plugin (see `docs/writing-plugins.md`).
|
|
37
|
+
* Add tests with small real fixtures where possible. Scripts that generate fixtures go in
|
|
38
|
+
`dev/`.
|
|
39
|
+
|
|
40
|
+
## Reporting a recovery problem
|
|
41
|
+
|
|
42
|
+
Please include:
|
|
43
|
+
* the output of `zesus info MAP`;
|
|
44
|
+
* the JSON log (`*.log.jsonl`);
|
|
45
|
+
* your OpenZFS version and pool features (`zpool get all`, if the pool still imports).
|
|
46
|
+
|
|
47
|
+
Never attach disk images or maps from real cases publicly. They contain your data.
|
zesus-0.1.0a1/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|