How avalon-initiative/pyn works
pyn is a Git-compatible version-control server and CLI that adds policy-controlled exclusive paths and leased locks for files that should not be concurrently edited. The main workflow is a user invoking CLI commands, the CLI contacting the server, and core services applying access, policy, merge, and storage rules to repository changes. The README documents additional account, collaboration, remote-transfer, and Git interoperability capabilities. Some connections below rely on those README-level descriptions; unsampled implementation details are not asserted.
Main entry points: service.rs Repository services · main.rs pyn CLI · store.rs Store contracts · client.rs API client
Components 22
Client workflow
- pyn CLI
crates/pyn-cli/src/main.rs - API client
crates/pyn-cli/src/client.rs
Server API
- HTTP server
crates/pyn-server/src/main.rs - API routing
crates/pyn-server/src/routes.rs - API handlers
crates/pyn-server/src
Repository domain
- Repository services
crates/pyn-core/src/service.rs - Path policy
crates/pyn-core/src/rules.rs - Leased locks
crates/pyn-core/src/store.rs - Merge and commits
crates/pyn-core/src/merge.rs - History and branches
crates/pyn-core/src/repo.rs - Git interoperability
crates/pyn-git/src/ingest.rs
Persistence and objects
- Object space
crates/pyn-core/src/object_space.rs - Store contracts
crates/pyn-core/src/store.rs - Memory backend
crates/pyn-core/src/memory.rs - Postgres backend
crates/pyn-postgres/src/lib.rs - S3 object storage
crates/pyn-s3/src/client.rs
Identity and collaboration
- Access control
crates/pyn-core/src/access.rs - Accounts and orgs
crates/pyn-core/src/access_service.rs - Audit log
crates/pyn-core/src/audit.rs - Webhooks
crates/pyn-core/src/webhook.rs
Other components
- Repository user
- Remote server
Connections 21
- Repository user → pyn CLI: runs commands
- pyn CLI → API client: uses API
crates/pyn-cli/src/main.rs - API client → HTTP server: sends requests
- HTTP server → API routing: routes requests
crates/pyn-server/src/routes.rs - API routing → API handlers: dispatches to
crates/pyn-server/src/routes.rs - API handlers → Repository services: applies operations
- Repository services → Path policy: checks modes
crates/pyn-core/src/service.rs - Repository services → Leased locks: enforces leases
crates/pyn-core/src/service.rs - Repository services → Merge and commits: merges changes
crates/pyn-core/src/service.rs - Repository services → History and branches: tracks revisions
crates/pyn-core/src/service.rs - Repository services → Object space: accesses objects
crates/pyn-core/src/service.rs - Repository services → Store contracts: uses contracts
crates/pyn-core/src/service.rs - Store contracts → Memory backend: implemented by
crates/pyn-core/src/memory.rs - Store contracts → Postgres backend: implemented by
- Object space → S3 object storage: stores objects
- Repository services → Access control: checks permissions
crates/pyn-core/src/service.rs - Access control → Accounts and orgs: supports identity
crates/pyn-core/src/access.rs - Repository services → Audit log: records actions
crates/pyn-core/src/service.rs - Repository services → Webhooks: emits events
- pyn CLI → Git interoperability: imports and exports
- pyn CLI → Remote server: pushes and fetches