gitcx 0.1.0a4__tar.gz → 0.1.0a5__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 (83) hide show
  1. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/PKG-INFO +11 -3
  2. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/README.md +10 -2
  3. gitcx-0.1.0a5/docs/alpha-qualification.md +38 -0
  4. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/hosting-acceptance.md +16 -5
  5. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/installation.md +16 -2
  6. gitcx-0.1.0a5/docs/operations.md +140 -0
  7. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/provisioning.md +1 -1
  8. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/releases.md +25 -0
  9. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/pyproject.toml +1 -1
  10. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/pyproject.toml.orig +1 -1
  11. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/scripts/accept_hosting.py +67 -4
  12. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/scripts/check_distribution.py +1 -1
  13. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/__init__.py +8 -0
  14. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/catalog.py +9 -0
  15. gitcx-0.1.0a5/src/gitcx/cli.py +77 -0
  16. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/jobs.py +2 -0
  17. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/management.py +2 -1
  18. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/merging.py +3 -0
  19. gitcx-0.1.0a5/src/gitcx/operations.py +297 -0
  20. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/provisioning.py +4 -0
  21. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/receive.py +3 -0
  22. gitcx-0.1.0a5/src/gitcx/restoration.py +87 -0
  23. gitcx-0.1.0a5/src/gitcx/retention.py +41 -0
  24. gitcx-0.1.0a5/src/gitcx/snapshots.py +235 -0
  25. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/webhooks.py +2 -0
  26. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_hosting_acceptance.py +6 -0
  27. gitcx-0.1.0a5/tests/test_operations.py +136 -0
  28. gitcx-0.1.0a5/tests/test_operations_cli.py +55 -0
  29. gitcx-0.1.0a5/tests/test_restoration.py +72 -0
  30. gitcx-0.1.0a5/tests/test_snapshots.py +115 -0
  31. gitcx-0.1.0a4/src/gitcx/cli.py +0 -23
  32. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/IMPLEMENTATION_PLAN.md +0 -0
  33. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/LICENSE +0 -0
  34. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/authentication.md +0 -0
  35. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/backend-sources.json +0 -0
  36. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/browser.md +0 -0
  37. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/catalog.md +0 -0
  38. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/jobs.md +0 -0
  39. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/management-api.md +0 -0
  40. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/migration.md +0 -0
  41. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/permissions.md +0 -0
  42. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/pull-requests.md +0 -0
  43. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/receive.md +0 -0
  44. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/ref-policy.md +0 -0
  45. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/smart-http.md +0 -0
  46. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/docs/webhooks.md +0 -0
  47. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/scripts/check_release.py +0 -0
  48. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/__main__.py +0 -0
  49. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/authentication.py +0 -0
  50. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/backend.py +0 -0
  51. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/branch_policy.py +0 -0
  52. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/browser_http.py +0 -0
  53. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/browsing.py +0 -0
  54. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/collaboration_http.py +0 -0
  55. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/domain.py +0 -0
  56. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/git_http.py +0 -0
  57. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/merge_policy.py +0 -0
  58. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/permissions.py +0 -0
  59. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/pull_requests.py +0 -0
  60. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/py.typed +0 -0
  61. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/src/gitcx/ref_policy.py +0 -0
  62. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/browser_fixtures.py +0 -0
  63. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_authentication.py +0 -0
  64. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_backend_profile.py +0 -0
  65. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_browser_http.py +0 -0
  66. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_browsing.py +0 -0
  67. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_catalog.py +0 -0
  68. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_collaboration_http.py +0 -0
  69. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_domain.py +0 -0
  70. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_git_http.py +0 -0
  71. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_jobs.py +0 -0
  72. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_management.py +0 -0
  73. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_merge_http.py +0 -0
  74. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_merge_plans.py +0 -0
  75. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_merge_policy.py +0 -0
  76. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_merge_publication.py +0 -0
  77. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_permissions.py +0 -0
  78. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_provisioning.py +0 -0
  79. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_pull_requests.py +0 -0
  80. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_receive.py +0 -0
  81. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_receive_http.py +0 -0
  82. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_ref_policy.py +0 -0
  83. {gitcx-0.1.0a4 → gitcx-0.1.0a5}/tests/test_webhooks.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitcx
3
- Version: 0.1.0a4
3
+ Version: 0.1.0a5
4
4
  Summary: A Git-compatible hosting platform powered by gitdx
5
5
  Author: ellainng
6
6
  Author-email: ellainng <299958882+ellainng@users.noreply.github.com>
@@ -16,7 +16,7 @@ Description-Content-Type: text/markdown
16
16
 
17
17
  # gitcx
18
18
 
19
- Developer preview source: **0.1.0a4**, paired with published `gitdx==0.1.0a3`.
19
+ Developer preview source candidate: **0.1.0a5**, paired with published `gitdx==0.1.0a3`.
20
20
  The [release history](https://github.com/wispsy/gitcx/releases) records published
21
21
  versions; a source version label does not establish publication.
22
22
  The selected scope includes catalog storage, repository provisioning,
@@ -26,7 +26,9 @@ repository browsing, collaboration/reviews and explicitly selected durable jobs.
26
26
  Production qualification is unfinished. [Preview notes](docs/releases.md)
27
27
  record the supported scope and remaining gates.
28
28
  The project was renamed from Gittycat to avoid the existing npm command name.
29
- Use `pip install "gitcx[http]==0.1.0a4"`, `import gitcx` and the `gitcx` command.
29
+ The published collaboration preview is `pip install "gitcx[http]==0.1.0a4"`;
30
+ the operations candidate is available from source until separately published.
31
+ Use `import gitcx` and the `gitcx` command.
30
32
  See [migration instructions](docs/migration.md) for existing installations.
31
33
  [Wispsy Releases](https://github.com/orgs/wispsy/projects/31)
32
34
  tracks publication separately from current development.
@@ -71,6 +73,12 @@ execution is explicitly selected; no background service starts automatically.
71
73
  Optional [signed webhooks](docs/webhooks.md) use explicit destination/IP policy,
72
74
  caller-supplied credentials and independent durable delivery receipts.
73
75
 
76
+ [Single-node operations](docs/operations.md) provide verified maintenance-window
77
+ snapshots, isolated restores requiring fresh tokens with webhooks disabled,
78
+ explicit quota admission and durable writer reservations. Local commands inspect
79
+ and reconcile maintenance and propose retained snapshots without deleting them.
80
+ Snapshot creation requires exclusion of every managed and external writer.
81
+
74
82
  [Managed provisioning](docs/provisioning.md) now connects catalog permissions to
75
83
  real Gitdx bare repositories with pending/ready recovery and an immutable backend
76
84
  release.
@@ -1,6 +1,6 @@
1
1
  # gitcx
2
2
 
3
- Developer preview source: **0.1.0a4**, paired with published `gitdx==0.1.0a3`.
3
+ Developer preview source candidate: **0.1.0a5**, paired with published `gitdx==0.1.0a3`.
4
4
  The [release history](https://github.com/wispsy/gitcx/releases) records published
5
5
  versions; a source version label does not establish publication.
6
6
  The selected scope includes catalog storage, repository provisioning,
@@ -10,7 +10,9 @@ repository browsing, collaboration/reviews and explicitly selected durable jobs.
10
10
  Production qualification is unfinished. [Preview notes](docs/releases.md)
11
11
  record the supported scope and remaining gates.
12
12
  The project was renamed from Gittycat to avoid the existing npm command name.
13
- Use `pip install "gitcx[http]==0.1.0a4"`, `import gitcx` and the `gitcx` command.
13
+ The published collaboration preview is `pip install "gitcx[http]==0.1.0a4"`;
14
+ the operations candidate is available from source until separately published.
15
+ Use `import gitcx` and the `gitcx` command.
14
16
  See [migration instructions](docs/migration.md) for existing installations.
15
17
  [Wispsy Releases](https://github.com/orgs/wispsy/projects/31)
16
18
  tracks publication separately from current development.
@@ -55,6 +57,12 @@ execution is explicitly selected; no background service starts automatically.
55
57
  Optional [signed webhooks](docs/webhooks.md) use explicit destination/IP policy,
56
58
  caller-supplied credentials and independent durable delivery receipts.
57
59
 
60
+ [Single-node operations](docs/operations.md) provide verified maintenance-window
61
+ snapshots, isolated restores requiring fresh tokens with webhooks disabled,
62
+ explicit quota admission and durable writer reservations. Local commands inspect
63
+ and reconcile maintenance and propose retained snapshots without deleting them.
64
+ Snapshot creation requires exclusion of every managed and external writer.
65
+
58
66
  [Managed provisioning](docs/provisioning.md) now connects catalog permissions to
59
67
  real Gitdx bare repositories with pending/ready recovery and an immutable backend
60
68
  release.
@@ -0,0 +1,38 @@
1
+ # Single-node forge qualification
2
+
3
+ The 0.1.0a5 source candidate builds on published Gitcx 0.1.0a4 and selects
4
+ published Gitdx 0.1.0a3 / optional Expose API 0.2.0 on Python 3.14+. This profile
5
+ qualifies the selected single-node forge source; it does not establish public
6
+ production hosting. Package publication and deployment remain separate gates.
7
+
8
+ | Surface | Selected support and evidence |
9
+ | --- | --- |
10
+ | Installation | Source plus independent wheel/sdist environments outside the checkout; exact backend index provenance, artifact hashes and core no-helper/no-HTTP-import startup. |
11
+ | Platforms | Linux, macOS and Windows source/artifact matrices; qualified Linux descriptor storage is required for hosted writes. Other POSIX tests can exercise mechanisms without enabling public write support. |
12
+ | Object formats | Native SHA-1/SHA-256 provisioning, read serving and offline snapshots/restores; hosted receive and checked publication require native SHA-256. |
13
+ | Git transport | Real stock-Git clone/fetch in smart HTTP protocols 0/1/2, branches, tags and empty repositories; bounded receive and explicit policy/profile refusals. No cross-format transport claim. |
14
+ | Collaboration | Two authorized users and a denied outsider; native pushes/fetches, reviews, Git-default/ff-only/no-ff/squash, exact native trees/parents and preserved source refs after restoration. |
15
+ | Browser | Real HTTP clients read restored private HTML pages; escaped script-like titles and isolation headers survive restore, while outsiders see concealed refusal. Unit/HTTP suites cover byte paths, malicious HTML, isolated downloads and bounded rendering. |
16
+ | Credentials and delivery | Restored old tokens refuse, fresh local tokens inherit existing grants, raw tokens stay out of catalog/client config, and disabled webhooks cannot claim history or invoke a supplied transport. |
17
+ | Recovery and operation | Catalog migrations/rollback, pending provisioning, checked receive/merge receipts and explicit unknown outcomes; maintenance with active users, disk pressure, stale reservations, process death/fork, isolated restore and retention proposals. |
18
+
19
+ The installed driver retains sanitized JSON receipts identifying artifact hashes,
20
+ package/source selection, native Git version, selected profile, completed checks
21
+ and limits. Linux receipts say `hosted-sha256-linux`; other platforms say
22
+ `read-only-native`. CI artifacts retain these receipts for fourteen days. A
23
+ passing POSIX mechanism test is never relabeled as supported macOS hosting.
24
+
25
+ The acceptance fixture selects 16 MiB Git request bytes, 128 receive commands,
26
+ 30-second engine deadlines, a 4 GiB admission capacity and 16 MiB free-space
27
+ margin. The default engine filesystem reservation is 768 MiB per hosted mutation.
28
+ Browser defaults bound graph/tree/content and rendered output independently.
29
+ Snapshot limits, catalog/provision/worker reserves, retained roots and operating
30
+ capacity are explicit selections. Fixture capacity is not a production sizing
31
+ recommendation; [operations](operations.md) states the external-writer contract.
32
+
33
+ No SSH, LFS, registries, hosted CI, distributed storage, automatic retention
34
+ deletion, operating-system hard quotas, untrusted SHA-1, unqualified-platform
35
+ writes or atomic files-ref visibility is advertised. An interrupted cross-store
36
+ operation can remain unknown and require owner reconciliation. Production
37
+ application server, reverse proxy, TLS, host/domain, monitoring and rollback
38
+ require a separate deployment proposal and explicit authorization.
@@ -1,7 +1,7 @@
1
1
  # Local two-user hosting acceptance
2
2
 
3
3
  Install the selected preview profile with `uv sync --locked --all-extras`.
4
- The published Gitdx 0.1.0a2 artifacts, source commit and released Expose API
4
+ The published Gitdx 0.1.0a3 artifacts, source commit and released Expose API
5
5
  source/version are recorded in [backend-sources.json](backend-sources.json).
6
6
  The runner verifies the installed engine version and package-index provenance,
7
7
  refusing direct Git/archive installations. Its source commit is linked through
@@ -16,8 +16,13 @@ uv run --frozen --all-extras python scripts/accept_hosting.py --output /tmp/host
16
16
  The runner creates a temporary catalog, two private repositories, two authorized
17
17
  accounts and an outsider, and binds only an ephemeral loopback listener. Real
18
18
  stock Git clients clone an empty SHA-256 repository, create/commit/push main,
19
- push a feature branch, and fetch it as the second user. A new app/catalog/backend
20
- lifecycle on the same durable data accepts another feature push; the second
19
+ push a feature branch, and fetch it as the second user. Managed quota admission
20
+ is configured for the temporary root. Maintenance refuses an active user's HTTP
21
+ request, then all fixture writers/listeners stop. A verified catalog/Git snapshot
22
+ is restored into a fresh isolated root; all three old tokens refuse and fresh
23
+ tokens are issued locally. Disabled webhooks neither claim historical events
24
+ nor call the supplied transport. A new app/catalog/backend lifecycle on this
25
+ restored data accepts another feature push; the second
21
26
  client fetches the resulting tip. Protected-main and outsider pushes fail while
22
27
  the checked refs stay unchanged. Outsiders cannot discover or clone private
23
28
  repositories. Native fsck verifies server and client storage after the workflow.
@@ -51,8 +56,8 @@ source checkout. The installed runner executes from the qualification bundle
51
56
  and imports only its selected environment's packages.
52
57
 
53
58
  This prototype does not qualify untrusted SHA-1, unqualified-platform writes,
54
- atomic files-ref visibility, global quotas or public deployment. Production
55
- TLS/proxy selection, complete catalog/Git backup, destructive retention and
59
+ atomic files-ref visibility, filesystem hard quotas or public deployment. Production
60
+ server/TLS/proxy selection, destructive retention and
56
61
  future publication remain separately selected gates. This developer preview
57
62
  leaves production qualification unfinished. [Hosted receive](receive.md)
58
63
  documents the per-ref/unknown outcome and recovery contracts.
@@ -67,3 +72,9 @@ topology, including independent base edits in divergent squash/default cases;
67
72
  source refs stay unchanged. Stale previews, missing approvals and outsider
68
73
  publication are refused. Wheel/sdist runs use the same driver and selected
69
74
  published backend; non-Linux receipts remain explicitly read-only.
75
+
76
+ The selected admission profile reserves a 4 GiB temporary capacity budget and
77
+ 16 MiB free-space safety margin. Both object formats retain native Git fsck and
78
+ fetch checks after restoration. No production capacity is inferred from these
79
+ fixture values. [Operations](operations.md) documents the explicit offline and
80
+ external-writer contract, crash reservations, isolated restore and retention.
@@ -1,6 +1,6 @@
1
1
  # Qualified installation profile
2
2
 
3
- Developer preview 0.1.0a3 selects published `gitdx==0.1.0a2` in `pyproject.toml`
3
+ Source candidate 0.1.0a5 selects published `gitdx==0.1.0a3` in `pyproject.toml`
4
4
  and `uv.lock`. [backend-sources.json](backend-sources.json) records the published
5
5
  version, source, release evidence and exact artifact hashes. Installed acceptance
6
6
  requires the selected version from a package-index installation and refuses
@@ -69,4 +69,18 @@ Workflow logs identify the actual image; a display/check key is not a hardware
69
69
  claim. Python and dependency pins remain unchanged. Supported
70
70
  runner labels are documented in the [GitHub runner reference](https://docs.github.com/en/actions/reference/runners/github-hosted-runners).
71
71
 
72
- Current source selects published `gitdx==0.1.0a3`, including qualified bare merge planning/publication. The backend must expose both selected merge capabilities before managed storage is reported ready. Actual published artifact hashes and source/release qualification are recorded in `backend-sources.json`; the older published Gitcx preview remains a separate release identity.
72
+ The backend must expose both selected bare merge capabilities before managed
73
+ storage is reported ready. Actual published artifact hashes and source/release
74
+ qualification are recorded in `backend-sources.json`. Operations added after the
75
+ preview release are source work until separately published. Installed suites
76
+ qualify snapshot/restore, revoked credentials, disabled delivery, quota admission,
77
+ maintenance, retention proposals and restored two-user native workflows through
78
+ the same artifact installation boundary.
79
+
80
+ Windows installed qualification has a twenty-five-minute job budget. One
81
+ artifact's 159-test suite measured 338 seconds before the original ten-minute
82
+ limit interrupted the second artifact; the complete 174-test operations pair
83
+ then passed in 19m56s. The selected limit retains headroom for runner variance.
84
+ Both complete artifact suites and
85
+ native/HTTP acceptance remain required. Source jobs and Linux/macOS installed
86
+ budgets remain ten minutes; existing check names and coverage are unchanged.
@@ -0,0 +1,140 @@
1
+ # Single-node operations
2
+
3
+ `backup_data_root(source, fresh_destination, offline=True)` snapshots a managed
4
+ data root (`catalog.sqlite3` and `git/`) into a fresh private directory. The
5
+ explicit offline assertion requires stopping HTTP writers, workers, recovery,
6
+ maintenance and every external/native Git writer for the entire operation.
7
+ SQLite transactions and native lockfile inspection cannot establish that window.
8
+ The current profile assumes owner-controlled local directories.
9
+
10
+ The snapshot binds catalog schema, repository IDs, storage IDs, native object
11
+ formats and every component hash in a versioned `snapshot.json` completion
12
+ receipt. Each Git repository also passes Gitdx backup receipt and typed object
13
+ closure verification. Pending provisioning, unknown storage/staging/locks,
14
+ redirects and existing destinations refuse. Unknown receive/merge outcomes stay
15
+ unknown in the copied catalog; a backup does not infer their outcome from refs.
16
+
17
+ `verify_snapshot(path)` rechecks the complete inventory, catalog integrity and
18
+ native snapshots. `SnapshotLimits` bounds repositories, entries, total bytes and
19
+ manifest size; Gitdx pack/graph budgets and cancellation can also be selected.
20
+ An interrupted copy leaves an incomplete destination for owner inspection. It
21
+ is never adopted or overwritten on retry. Select a new path after investigating
22
+ the failure. There is no automatic deletion, expiry or live-source replacement.
23
+
24
+ Snapshots contain credential **verifiers**, private repository contents,
25
+ account/grant history and audit/outbox records. Keep their directory and storage
26
+ private; checksums detect corruption, not malicious replacement by a writer
27
+ who can replace both data and manifest. Raw tokens, signing keys, hooks,
28
+ arbitrary Git configuration and service processes are not copied.
29
+
30
+ ## Isolated restore
31
+
32
+ `restore_snapshot(verified_snapshot, fresh_data_root, now=unix_time)` validates
33
+ the complete snapshot before allocating a new root, reconstructs safe native
34
+ repositories and writes ownership markers from the verified catalog identities.
35
+ The target never replaces the source or another existing directory. Both native
36
+ object formats retain their refs, HEAD, reflogs and reachable object closure.
37
+ Accounts, organizations, grants, branch/review policy, collaboration records,
38
+ audit/outbox and job history remain intact.
39
+
40
+ Every active credential is revoked while keeping its verifier/history. Existing
41
+ revocations keep their original timestamp. Webhooks are disabled even when
42
+ signing keys and a transport are later supplied. Bootstrap fresh tokens through
43
+ the trusted local `TokenAuth.issue` boundary after checking restored permissions.
44
+ No listener, worker or outbound delivery starts. Explicitly enabling an old
45
+ webhook can replay accumulated historical events; inspect its cursor and receipts
46
+ before selecting that operation. Custom external worker effects also require
47
+ their own explicit replay/idempotency policy.
48
+
49
+ The `restore-incomplete` marker blocks every ordinary catalog/server open until
50
+ the credential/delivery policy commits and `restore.json` is written. If a copy,
51
+ policy transaction or final verification fails, retain that marker and inspect
52
+ the target. Retry into a fresh root; never remove the marker to adopt a partial
53
+ restore. Git journal recovery and prepared/unknown hosting receipts remain
54
+ explicit owner reconciliation, not inferred success or automatic replay.
55
+
56
+ ## Managed writer admission and quotas
57
+
58
+ Global admission is explicitly selected with
59
+ `Operations(data_root).configure(QuotaPolicy(max_bytes=..., min_free_bytes=...),
60
+ retained_roots=(backup_directory,), offline=True)`. Supply measured local
61
+ capacity and safety margins; no production quota is selected by import or
62
+ startup. Configure the existing root while all managed and native/external
63
+ writers are stopped, then restart callers with this implementation. Retained
64
+ roots must be separate directories on the same filesystem. The profile assumes
65
+ only these managed entry points mutate the root; raw Gitdx/native operations,
66
+ external GC, backup deletion and custom handlers need explicit exclusion or
67
+ their own bounded admitted operation.
68
+
69
+ `maintenance(True)` persistently denies new managed operations. It refuses while
70
+ a writer is active; stop traffic and retry after it settles. Managed catalog
71
+ transactions, provisioning, receive/merge publication/recovery and finite worker
72
+ batches share one durable exclusive reservation. Concurrent attempts return
73
+ busy (HTTP 503). Nested calls in the same thread reuse/expand the reservation.
74
+ This first single-node profile serializes writers, rather than supporting
75
+ parallel reservations. Read paths that use catalog transactions also refuse
76
+ during maintenance; it is an offline window, not read-only serving.
77
+
78
+ Accounting includes catalog/sidecars, repository objects/packs, incoming
79
+ quarantines, provisioning staging, configured retained roots, control files and
80
+ reserved growth. It bounds traversal and charges file/directory allocations
81
+ rounded up to 4 KiB, including larger reported allocations. Admissions require
82
+ `used + reserved <= max_bytes` and enough free space for the reservation plus
83
+ `min_free_bytes`. Catalog rollback overhead is reserved separately; hosted
84
+ receive/merge use the engine's filesystem allocation bound. Snapshots under a
85
+ configured quota require maintenance and a target beneath a retained root.
86
+
87
+ These are admission budgets, not an operating-system hard quota. Existing
88
+ per-operation limits still bound work; custom local catalog transactions or
89
+ worker handlers must select enough reserve and bound their own writes/effects.
90
+ Completion remeasures actual storage. An overrun or failed inspection retains
91
+ the reservation and reports that actual operation receipts need inspection;
92
+ settled Git writes are never claimed rolled back. Unknown/stale reservations
93
+ never expire automatically. Inspect `reservation()`, stop **all** writers,
94
+ reconcile Git/catalog receipts and retained staging, then call
95
+ `reconcile(observed_sha256, offline=True)`. It refuses changed receipts and
96
+ never removes repository data. Native lockfiles and journals remain separately
97
+ owned; clearing admission does not adopt or recover them.
98
+
99
+ Configured quotas survive snapshot/restore. A restored root starts in managed
100
+ maintenance and clears the old root's retained-directory paths. Inspect it,
101
+ configure its separate retained roots, leave maintenance explicitly, then issue
102
+ fresh tokens. Unconfigured source roots retain the initial offline contract.
103
+
104
+ ## Local commands and retention
105
+
106
+ These commands use the trusted local filesystem; they are not HTTP management
107
+ endpoints. Values below are explicit examples to replace with measured capacity.
108
+
109
+ ```sh
110
+ gitcx operations --data-root data configure --max-bytes 4294967296 --min-free-bytes 268435456 --retained-root /srv/gitcx-backups --offline
111
+ gitcx operations --data-root data maintenance on
112
+ gitcx operations --data-root data status
113
+ gitcx backup --data-root data --destination /srv/gitcx-backups/snapshot-001 --max-bytes 1073741824 --offline
114
+ gitcx verify-snapshot /srv/gitcx-backups/snapshot-001
115
+ gitcx restore --snapshot /srv/gitcx-backups/snapshot-001 --destination /srv/gitcx-restored
116
+ gitcx retention /srv/gitcx-backups --keep 3 --before 1700000000
117
+ ```
118
+
119
+ `retention_plan(directory, keep=..., before=...)` verifies direct children,
120
+ always retains at least the selected number of newest verified snapshots and
121
+ reports older complete snapshots as candidates. Incomplete/unknown entries are
122
+ reported separately. Neither API nor CLI deletes or expires anything. Exclude
123
+ snapshot writers while reviewing a plan; select any later deletion separately
124
+ after independent restore evidence and backup custody checks. Database audit,
125
+ outbox and job histories also have no automatic expiry in this milestone.
126
+
127
+ For a stale reservation, first inspect its operation and the Git/catalog outcome.
128
+ Only after every writer has stopped, use
129
+ `gitcx operations --data-root data reconcile --receipt-sha256 OBSERVED_HASH --offline`.
130
+ The checksum binds the inspected receipt. Resume maintenance or traffic explicitly
131
+ after reconciliation; the command does not recover Git journals or delete staging.
132
+
133
+ ## Deployment boundary
134
+
135
+ `gitcx serve` remains an explicitly selected loopback demo. This implementation
136
+ does not select, install or run a production ASGI server, reverse proxy or TLS
137
+ service. Public deployment requires a separately reviewed server/proxy/TLS
138
+ configuration, identity bootstrap, measured storage/capacity, trusted paths,
139
+ backup custody, restore rehearsal, monitoring and rollback. Packages, releases,
140
+ listeners and outbound services are not published or deployed by these controls.
@@ -21,7 +21,7 @@ provide hostile filesystem isolation or power-loss durability across SQLite and
21
21
  filesystem boundaries. Missing ready storage is an error, not permission to
22
22
  create a new empty repository.
23
23
 
24
- The mandatory Gitdx dependency selects published `gitdx==0.1.0a2`.
24
+ The mandatory Gitdx dependency selects published `gitdx==0.1.0a3`.
25
25
  [backend-sources.json](backend-sources.json) records its release source,
26
26
  qualification and exact artifact hashes. Repository operations never call Git;
27
27
  both native hashes are qualified against a separate stock-Git oracle.
@@ -1,5 +1,30 @@
1
1
  # Developer previews
2
2
 
3
+ ## 0.1.0a5 candidate
4
+
5
+ This source candidate adds single-node operations to the published 0.1.0a4
6
+ collaboration preview. Gitdx remains pinned to published 0.1.0a3 and the optional
7
+ HTTP framework to Expose API 0.2.0. Package upload and release publication require
8
+ separate owner authorization.
9
+
10
+ - Verified maintenance-window catalog/Git snapshots with bounded component
11
+ manifests, native object closure and explicit external-writer exclusion.
12
+ - Isolated restores preserve permissions, collaboration and audit/outbox/job
13
+ history, revoke active credentials and disable webhooks. Incomplete targets
14
+ cannot serve; fresh trusted-local tokens restore access after verification.
15
+ - Explicit single-node writer admission, quota/free-space reservations,
16
+ maintenance, crash reconciliation and retained-snapshot proposals. No automatic
17
+ deletion or expiry. Admission budgets do not establish filesystem hard quotas.
18
+ - Source/wheel/sdist acceptance uses real native Git and HTTP browser/API clients
19
+ against restored roots, including two-user reviews and all four merge methods,
20
+ private-access refusal, escaped pages and disabled outbound replay.
21
+
22
+ The [qualification profile](alpha-qualification.md) states the selected formats,
23
+ platforms, protocols and resource bounds. Untrusted SHA-1, other-platform hosted
24
+ writes, external/native concurrent writers, atomic files-ref visibility,
25
+ production server/proxy/TLS and public deployment remain outside this candidate.
26
+ SSH, LFS, registries, hosted CI and distributed storage require separate scope.
27
+
3
28
  ## 0.1.0a4
4
29
 
5
30
  This collaboration milestone selects published `gitdx==0.1.0a3` and retains
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gitcx"
3
- version = "0.1.0a4"
3
+ version = "0.1.0a5"
4
4
  description = "A Git-compatible hosting platform powered by gitdx"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gitcx"
3
- version = "0.1.0a4"
3
+ version = "0.1.0a5"
4
4
  description = "A Git-compatible hosting platform powered by gitdx"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -3,6 +3,7 @@
3
3
  import argparse
4
4
  import asyncio
5
5
  from importlib import metadata
6
+ from http.client import HTTPConnection
6
7
  import json
7
8
  import os
8
9
  from pathlib import Path
@@ -15,7 +16,9 @@ from gitdx import Blob, Commit, Repository, Tree, TreeEntry
15
16
  import gitdx.confined_fs as storage_profile
16
17
  from gitcx import (AccessGrant, Action, BranchRule, Catalog, GitdxBackend, Owner, Permission,
17
18
  Principal, RepositoryRecord, RepositoryService, Slug, StorageId, TokenAuth,
18
- Visibility, create_app)
19
+ Visibility, create_app, AuthenticationError, DestinationPolicy, Operations,
20
+ QuotaPolicy, SnapshotLimits, WebhookService, backup_data_root,
21
+ restore_snapshot, verify_snapshot)
19
22
 
20
23
 
21
24
  NOW = 1_700_000_000
@@ -83,6 +86,8 @@ async def run_acceptance(*, read_only=False):
83
86
  with tempfile.TemporaryDirectory(prefix='gitcx-acceptance-') as tmp:
84
87
  root = Path(tmp);data = root/'data';database = data/'catalog.sqlite3';backend = GitdxBackend(data/'git')
85
88
  alice, bob, outsider = (uuid.uuid4().hex for _ in range(3));tokens = {}
89
+ hook_policy = DestinationPolicy({'http://127.0.0.1:9':'127.0.0.1'}, allow_loopback_http=True)
90
+ hook_id = uuid.uuid4().hex
86
91
  with Catalog(database) as catalog:
87
92
  for user, slug in ((alice, 'alice'), (bob, 'bob'), (outsider, 'outsider')):
88
93
  catalog.create_account(user, Slug(slug), now=NOW)
@@ -94,6 +99,13 @@ async def run_acceptance(*, read_only=False):
94
99
  RepositoryService(catalog, backend).create(Principal(alice), record, now=NOW+1)
95
100
  catalog.grant(Principal(alice), AccessGrant(record.id, bob, Permission.WRITE), now=NOW+2)
96
101
  records.append(record)
102
+ WebhookService(catalog, hook_policy, credentials=lambda _:b'k'*32).configure(
103
+ Principal(alice), hook_id, records[0].id, url='http://127.0.0.1:9/events',
104
+ credential_name='ephemeral-acceptance', now=NOW+3, after=0)
105
+ retained = root/'snapshots';retained.mkdir()
106
+ operations = Operations(data)
107
+ quota = QuotaPolicy(max_bytes=4*1024**3, min_free_bytes=16*1024**2)
108
+ operations.configure(quota, retained_roots=(retained,), offline=True)
97
109
  app = create_app(data, clock=lambda: NOW+10)
98
110
 
99
111
  async def git(path, *args, token=None):
@@ -120,6 +132,24 @@ async def run_acceptance(*, read_only=False):
120
132
  if status!=expected:raise AssertionError('collaboration API returned an unexpected status: '+str(status))
121
133
  return json.loads(payload)
122
134
 
135
+ async def browser(server, record):
136
+ host, port = server.sockets[0].getsockname()[:2]
137
+ def read(user):
138
+ connection = HTTPConnection(host, port, timeout=30)
139
+ try:
140
+ connection.request('GET', '/repos/'+record.id+'/pulls',
141
+ headers={'Authorization':'Bearer '+tokens[user]})
142
+ response = connection.getresponse();body = response.read(1024*1024+1)
143
+ return response.status, {name.lower():value for name,value in response.getheaders()}, body
144
+ finally:connection.close()
145
+ status, headers, body = await asyncio.to_thread(read, bob)
146
+ if (status != 200 or len(body) > 1024*1024 or b'&lt;script&gt;unsafe&lt;/script&gt;' not in body
147
+ or b'<script>' in body or headers.get('x-content-type-options') != 'nosniff'
148
+ or "default-src 'none'" not in headers.get('content-security-policy', '')):
149
+ raise AssertionError('restored browser page lost escaping or isolation headers')
150
+ if (await asyncio.to_thread(read, outsider))[0] != 404:
151
+ raise AssertionError('restored browser page exposed private collaboration')
152
+
123
153
  clients = {};previews={}
124
154
  async with serve(app, host='127.0.0.1', port=0, request_timeout=30) as server:
125
155
  host, port = server.sockets[0].getsockname()[:2]
@@ -159,7 +189,7 @@ async def run_acceptance(*, read_only=False):
159
189
  checks.append(record.object_format+'-authorized-fetch-and-outsider-concealment')
160
190
  prefix='/api/repositories/'+record.id+'/pulls'
161
191
  for method in ('git-default','ff-only','no-ff','squash'):
162
- pull=await api(server,'POST',prefix,alice,{'title':'Preview '+method,'base_ref':'refs/heads/main','head_ref':'refs/heads/feature','method':method},201)
192
+ pull=await api(server,'POST',prefix,alice,{'title':'Preview <script>unsafe</script> '+method,'base_ref':'refs/heads/main','head_ref':'refs/heads/feature','method':method},201)
163
193
  path=prefix+'/'+pull['id']
164
194
  await api(server,'POST',path+'/reviews',bob,{'decision':'approve','expected_revision':1},201)
165
195
  preview=await api(server,'POST',path+'/merge-preview',bob,{'expected_revision':1})
@@ -171,6 +201,36 @@ async def run_acceptance(*, read_only=False):
171
201
  {'expected_revision':1,'proposal':preview['proposal']},409)
172
202
  checks.append(record.object_format+'-merge-write-profile-refusal')
173
203
  checks.append(record.object_format+'-all-method-merge-previews')
204
+ operations.maintenance(True)
205
+ await api(server, 'GET', '/api/repositories', alice, expected=503)
206
+ checks.append('maintenance-active-user-refusal')
207
+ # Every fixture writer/listener is now stopped. Snapshot the same
208
+ # catalog/Git state and run the second lifecycle against an isolated restore.
209
+ snapshot = retained/'complete'
210
+ snapshot_limits = SnapshotLimits(max_bytes=16*1024**2, max_entries=10_000, max_manifest_bytes=1024**2)
211
+ saved = backup_data_root(data, snapshot, offline=True, now=NOW+14, limits=snapshot_limits)
212
+ if verify_snapshot(snapshot, limits=snapshot_limits) != saved:raise AssertionError('snapshot verification changed its identity')
213
+ historical_tokens = dict(tokens)
214
+ data = root/'restored';database = data/'catalog.sqlite3'
215
+ restored = restore_snapshot(snapshot, data, now=NOW+15, limits=snapshot_limits)
216
+ backend = GitdxBackend(data/'git')
217
+ if restored.revoked_credentials != 3 or restored.disabled_webhooks != 1:
218
+ raise AssertionError('restore did not apply the fresh-credential/delivery policy')
219
+ new_retained = root/'restored-snapshots';new_retained.mkdir()
220
+ Operations(data).configure(quota, retained_roots=(new_retained,), offline=True)
221
+ Operations(data).maintenance(False)
222
+ with Catalog(database) as catalog:
223
+ for user, old in historical_tokens.items():
224
+ try:TokenAuth(catalog).authenticate(old, now=NOW+16)
225
+ except AuthenticationError:pass
226
+ else:raise AssertionError('restore revived a historical credential')
227
+ tokens[user] = TokenAuth(catalog).issue(Principal(user), scopes={Action.ADMIN}, expires_at=NOW+3600, now=NOW+16).reveal()
228
+ class NoDelivery:
229
+ def post(self, *args):raise AssertionError('restore replayed outbound delivery')
230
+ if WebhookService(catalog, hook_policy, credentials=lambda _:b'k'*32, transport=NoDelivery()).run_once(hook_id):
231
+ raise AssertionError('restored webhook claimed historical events')
232
+ checks.extend(('snapshot-manifest-native-verification', 'isolated-restore-fresh-token-policy',
233
+ 'restored-permission-no-outbound-replay', 'quota-admitted-writes'))
174
234
  # A new app/backend/catalog lifecycle uses the same durable state. The
175
235
  # listener remains loopback-only and may receive another ephemeral port.
176
236
  app = create_app(data, clock=lambda: NOW+20)
@@ -250,6 +310,8 @@ async def run_acceptance(*, read_only=False):
250
310
  config = (client/'.git/config').read_text()
251
311
  if any(token in config for token in tokens.values()): raise AssertionError('credential persisted in client config')
252
312
  checks.append(record.object_format+'-restart-fetch-fsck')
313
+ await browser(server, record)
314
+ checks.append(record.object_format+'-restored-browser-pages-and-concealment')
253
315
  with Catalog(database) as catalog:
254
316
  for record in records:
255
317
  events = catalog.repository_events(Principal(alice), record.id)
@@ -260,9 +322,10 @@ async def run_acceptance(*, read_only=False):
260
322
  checks.extend(('credential-non-persistence', 'durable-catalog-audit'))
261
323
  return {'schema_version': 1, 'profile': 'read-only-native' if read_only else 'hosted-sha256-linux',
262
324
  'packages': selected, 'git': (await git(root, '--version')).decode().strip(),
263
- 'checks': checks, 'limits': {'request_bytes': 16*1024*1024, 'commands': 128, 'engine_seconds': 30},
325
+ 'checks': checks, 'limits': {'request_bytes': 16*1024*1024, 'commands': 128, 'engine_seconds': 30,
326
+ 'quota_bytes':quota.max_bytes, 'min_free_bytes':quota.min_free_bytes},
264
327
  'unsupported': ['untrusted-sha1', 'unqualified-platform-writes', 'atomic-files-ref-visibility',
265
- 'global-quotas', 'public-deployment']}
328
+ 'filesystem-hard-quotas', 'external-native-writers', 'public-deployment']}
266
329
 
267
330
 
268
331
  def main():
@@ -59,7 +59,7 @@ def main():
59
59
  receipts.append({"artifact": artifact.name, "sha256": hashlib.sha256(artifact.read_bytes()).hexdigest(),
60
60
  "backend": {"distribution": "gitdx", "version": profile["version"],
61
61
  "source": profile["commit"], "source_kind": profile["source_kind"]},
62
- "profile": "catalog-auth-browser-collaboration-checked-merge/4",
62
+ "profile": "catalog-auth-browser-collaboration-operations/5",
63
63
  "acceptance": json.loads(acceptance_file.read_text())})
64
64
  if args.receipt_file:
65
65
  args.receipt_file.write_text(json.dumps(receipts, indent=2) + "\n")
@@ -15,6 +15,10 @@ from .browsing import BrowserLimits, BrowserNotFound, BrowserService, BrowserSna
15
15
  from .merge_policy import EffectiveMergePolicy, MergeMethod, MergePolicyService, MergeRule, MergeSettings
16
16
  from .pull_requests import PullComment, PullComparison, PullRequest, PullRequestService, PullReview, PullState, ReviewDecision, ReviewSummary
17
17
  from .merging import CheckedMerge, MergeService
18
+ from .snapshots import SnapshotError, SnapshotInfo, SnapshotLimits, backup_data_root, verify_snapshot
19
+ from .restoration import RestoreInfo, restore_snapshot
20
+ from .operations import OperationBudgetExceeded, Operations, OperationsError, QuotaExceeded, QuotaPolicy
21
+ from .retention import RetentionPlan, retention_plan
18
22
 
19
23
  __all__ = ["AccessGrant", "Action", "Membership", "OrganizationRole", "Owner", "OwnerKind",
20
24
  "Permission", "Principal", "RepositoryRecord", "Slug", "StorageId", "Visibility",
@@ -32,6 +36,10 @@ __all__ += ["BrowserLimits", "BrowserNotFound", "BrowserService", "BrowserSnapsh
32
36
  __all__ += ["EffectiveMergePolicy", "MergeMethod", "MergePolicyService", "MergeRule", "MergeSettings"]
33
37
  __all__ += ["PullComment", "PullComparison", "PullRequest", "PullRequestService", "PullReview", "PullState", "ReviewDecision", "ReviewSummary"]
34
38
  __all__ += ["CheckedMerge", "MergeService"]
39
+ __all__ += ["SnapshotError", "SnapshotInfo", "SnapshotLimits", "backup_data_root", "verify_snapshot"]
40
+ __all__ += ["RestoreInfo", "restore_snapshot"]
41
+ __all__ += ["OperationBudgetExceeded", "Operations", "OperationsError", "QuotaExceeded", "QuotaPolicy"]
42
+ __all__ += ["RetentionPlan", "retention_plan"]
35
43
  __all__ += ["create_app"]
36
44
 
37
45
 
@@ -101,6 +101,7 @@ class EventKind(StrEnum):
101
101
  PULL_COMMENTED = "pull.commented"
102
102
  PULL_REVIEWED = "pull.reviewed"
103
103
  PULL_MERGED = "pull.merged"
104
+ RESTORE_COMPLETED = "restore.completed"
104
105
 
105
106
 
106
107
  REPOSITORY_EVENTS = tuple(kind for kind in EventKind if kind.value.startswith(
@@ -164,6 +165,8 @@ class Catalog:
164
165
 
165
166
  def __init__(self, path, *, timeout: float = 5.0):
166
167
  self.path = Path(path).absolute()
168
+ if (self.path.parent/"restore-incomplete").exists() or (self.path.parent/"restore-incomplete").is_symlink():
169
+ raise CatalogError("isolated restore is incomplete; inspect it and retry into a fresh root")
167
170
  if not 0 <= timeout <= 30:
168
171
  raise ValueError("catalog lock timeout must be between 0 and 30 seconds")
169
172
  self.path.parent.mkdir(parents=True, exist_ok=True)
@@ -197,6 +200,12 @@ class Catalog:
197
200
 
198
201
  @contextmanager
199
202
  def transaction(self):
203
+ from .operations import managed_writer
204
+ with managed_writer(self.path.parent, "catalog"):
205
+ with self._transaction():yield self
206
+
207
+ @contextmanager
208
+ def _transaction(self):
200
209
  nested = self._connection.in_transaction
201
210
  self._savepoint += 1
202
211
  name = f"catalog_{self._savepoint}"