A deterministic synchronization engine based on state reconciliation, cryptographic validation, and an idempotent pipeline. The project orchestrates download, cache, integrity, and post-processing under strict and predictable rules.
- Overview
- Project Status
- Architecture
.syncdownloadFormat- Design Principles
- Best Practices
- Contributing
- License
CanonSync addresses artifact synchronization with focus on:
- Determinism (same input → same final state)
- Integrity (SHA256/MD5 hash as source of truth)
- Efficiency (avoids downloads via cache ↔ destination reconciliation)
- Controlled extensibility (DSL + isolated subscripts)
- Synchronous execution
This is not a simple downloader: it is an incremental decision system with explicit semantics.
⚠️ Current phase: experimental / functional validation
- Internal API still subject to change
- Partial test coverage
- Core contracts already defined (RCF of
.syncdownload) - Current focus: pipeline robustness and state coherence
Production usage is not recommended without independent validation.
src/
├── main.py
├── commons.py
├── core/
│ ├── syncdownload.parser.py
│ ├── syncdownload.processor.py
│ ├── download_manager.py
│ ├── cache_validation.py
│ ├── cleanup.py
│ ├── file_operations.py
│ ├── metadata.py
│ └── retry.py
└── utils/
├── progress.py
├── naming.py
├── dsl.py
└── logging.py
Separation of responsibilities is mandatory. No module should invade another module’s domain.
A declarative file that defines source, version, integrity, and behavior.
<url or DSL>
[hash]
[final_name]
[remote_hash]
[files_in_container]
>>>ext[,phase]
optional script
https://example.com/app.zip
d41d8cd98f00b204e9800998ecf8427e
app.zip
- Fixed version (line 2) or dynamic version (line 4)
- DSL-based resolution (
${...}) - Selective extraction from containers (.zip, .tar.gz, etc.)
- Subscripts with controlled phases (
start,end, etc.)
- Line order is semantic and mandatory
- Encoding must be UTF-8
- Scripts are isolated and do not interfere with the core
- "Developed by JeanCarloEM, this library was originally designed to support the Pentools project, available at: https://github.com.
- Separation: HEAD ≠ GET
- Hash as authority (not metadata)
- Hybrid cache (memory + persistent)
- Retry only for transient failures
- Idempotent
- Deterministic
- Ordered
- No hidden side effects
- Never rely solely on cache
- Never infer version from metadata
- Never treat a container as the final artifact
- Small, specialized functions
- No logic duplication
- No hardcoding
- Prefer immutability
- Use
download_managerfor network I/O - Use
utils.dslfor any dynamic resolution - Centralize naming in
utils.naming
- HTML parsing when an API exists
- Coupling between core modules
- Non-deterministic heuristics
- Strict adherence to project contracts
- Preserve deterministic and diff-friendly style
- Do not introduce implicit side effects
- Fork
- Create isolated branch (
feature/...orfix/...) - Implement minimal required changes
- Test locally with multiple scenarios
- Submit a concise Pull Request
- Consistency with system invariants
- No behavioral regression
- Structural clarity
Distributed under the MP2+ license.
Provide a reliable and predictable engine for artifact synchronization, with:
- Explicit version control
- Guaranteed integrity
- Transparent and auditable pipeline
Without compromising operational simplicity.