gitcx 0.1.0a3__tar.gz → 0.1.0a4__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 (72) hide show
  1. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/IMPLEMENTATION_PLAN.md +32 -0
  2. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/PKG-INFO +28 -5
  3. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/README.md +26 -3
  4. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/backend-sources.json +26 -24
  5. gitcx-0.1.0a4/docs/browser.md +53 -0
  6. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/catalog.md +8 -2
  7. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/hosting-acceptance.md +11 -0
  8. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/installation.md +14 -0
  9. gitcx-0.1.0a4/docs/jobs.md +58 -0
  10. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/management-api.md +8 -3
  11. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/migration.md +6 -0
  12. gitcx-0.1.0a4/docs/pull-requests.md +201 -0
  13. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/releases.md +39 -0
  14. gitcx-0.1.0a4/docs/webhooks.md +75 -0
  15. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/pyproject.toml +2 -2
  16. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/pyproject.toml.orig +2 -2
  17. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/scripts/accept_hosting.py +82 -2
  18. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/scripts/check_distribution.py +1 -1
  19. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/__init__.py +12 -0
  20. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/backend.py +2 -1
  21. gitcx-0.1.0a4/src/gitcx/browser_http.py +300 -0
  22. gitcx-0.1.0a4/src/gitcx/browsing.py +180 -0
  23. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/catalog.py +42 -2
  24. gitcx-0.1.0a4/src/gitcx/collaboration_http.py +253 -0
  25. gitcx-0.1.0a4/src/gitcx/jobs.py +190 -0
  26. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/management.py +36 -1
  27. gitcx-0.1.0a4/src/gitcx/merge_policy.py +159 -0
  28. gitcx-0.1.0a4/src/gitcx/merging.py +260 -0
  29. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/provisioning.py +6 -3
  30. gitcx-0.1.0a4/src/gitcx/pull_requests.py +330 -0
  31. gitcx-0.1.0a4/src/gitcx/webhooks.py +227 -0
  32. gitcx-0.1.0a4/tests/browser_fixtures.py +23 -0
  33. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_backend_profile.py +19 -1
  34. gitcx-0.1.0a4/tests/test_browser_http.py +149 -0
  35. gitcx-0.1.0a4/tests/test_browsing.py +111 -0
  36. gitcx-0.1.0a4/tests/test_collaboration_http.py +195 -0
  37. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_hosting_acceptance.py +4 -0
  38. gitcx-0.1.0a4/tests/test_jobs.py +139 -0
  39. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_management.py +20 -0
  40. gitcx-0.1.0a4/tests/test_merge_http.py +161 -0
  41. gitcx-0.1.0a4/tests/test_merge_plans.py +127 -0
  42. gitcx-0.1.0a4/tests/test_merge_policy.py +77 -0
  43. gitcx-0.1.0a4/tests/test_merge_publication.py +220 -0
  44. gitcx-0.1.0a4/tests/test_pull_requests.py +219 -0
  45. gitcx-0.1.0a4/tests/test_webhooks.py +147 -0
  46. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/LICENSE +0 -0
  47. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/authentication.md +0 -0
  48. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/permissions.md +0 -0
  49. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/provisioning.md +0 -0
  50. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/receive.md +0 -0
  51. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/ref-policy.md +0 -0
  52. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/docs/smart-http.md +0 -0
  53. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/scripts/check_release.py +0 -0
  54. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/__main__.py +0 -0
  55. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/authentication.py +0 -0
  56. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/branch_policy.py +0 -0
  57. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/cli.py +0 -0
  58. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/domain.py +0 -0
  59. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/git_http.py +0 -0
  60. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/permissions.py +0 -0
  61. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/py.typed +0 -0
  62. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/receive.py +0 -0
  63. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/src/gitcx/ref_policy.py +0 -0
  64. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_authentication.py +0 -0
  65. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_catalog.py +0 -0
  66. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_domain.py +0 -0
  67. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_git_http.py +0 -0
  68. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_permissions.py +0 -0
  69. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_provisioning.py +0 -0
  70. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_receive.py +0 -0
  71. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_receive_http.py +0 -0
  72. {gitcx-0.1.0a3 → gitcx-0.1.0a4}/tests/test_ref_policy.py +0 -0
@@ -1,5 +1,37 @@
1
1
  # Gitcx implementation plan
2
2
 
3
+ ## CAT-11 collaboration foundation (2 December 2026)
4
+
5
+ [Pull-request services](docs/pull-requests.md) persist reviewed native commit
6
+ snapshots, comments and revision-bound reviews with transactional audit/outbox
7
+ records. Versioned merge settings distinguish Git-default (the initial default),
8
+ fast-forward-only, no-fast-forward and squash policies. Branch restrictions
9
+ intersect and stale tips/policies invalidate approvals. Escaped browser views
10
+ and authenticated JSON routes expose this foundation. Checked publication
11
+ requires the qualified bare
12
+ merge API from Gitdx DX-34. The published backend selection remains unchanged
13
+ until its separate release/integration gate.
14
+
15
+ ## CAT-12 durable operations (1 December 2026)
16
+
17
+ Current source adds explicit bounded job batches with per-consumer leases,
18
+ restart/retry/dead-letter outcomes, a monotone activity projection and scoped
19
+ administrator audit/job queries. Optional signed webhooks persist secret-free
20
+ configuration and independent progress; selected origin/numeric-peer policy,
21
+ credential providers and finite HTTP deadlines bound outgoing delivery. See
22
+ [jobs](docs/jobs.md) and [webhooks](docs/webhooks.md). Schema upgrades are
23
+ transactional; deployment scheduling and retention remain operational choices.
24
+
25
+ ## CAT-10 repository browser (1 December 2026)
26
+
27
+ Current source adds bounded native branch/tree/blob/commit/comparison reads and
28
+ server-rendered pages through the existing optional HTTP app. Catalog/token
29
+ authorization precedes storage and is rechecked before disclosure. Byte paths,
30
+ escaped text, script-free pages and sandboxed attachment responses preserve the
31
+ untrusted-content boundary. See [browser contracts](docs/browser.md) for exact
32
+ limits, credential handling and remaining large-repository work. Production
33
+ qualification and publication remain separate.
34
+
3
35
  ## CAT-09 local acceptance (27 November 2026)
4
36
 
5
37
  The repeatable [two-user runner](docs/hosting-acceptance.md) uses temporary state
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitcx
3
- Version: 0.1.0a3
3
+ Version: 0.1.0a4
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>
7
7
  License-Expression: MIT
8
8
  License-File: LICENSE
9
- Requires-Dist: gitdx==0.1.0a2
9
+ Requires-Dist: gitdx==0.1.0a3
10
10
  Requires-Dist: expose-api==0.2.0 ; extra == 'http'
11
11
  Requires-Python: >=3.14
12
12
  Project-URL: Repository, https://github.com/wispsy/gitcx
@@ -16,14 +16,17 @@ Description-Content-Type: text/markdown
16
16
 
17
17
  # gitcx
18
18
 
19
- Developer preview: **0.1.0a3**, paired with published `gitdx==0.1.0a2`.
19
+ Developer preview source: **0.1.0a4**, paired with published `gitdx==0.1.0a3`.
20
+ The [release history](https://github.com/wispsy/gitcx/releases) records published
21
+ versions; a source version label does not establish publication.
20
22
  The selected scope includes catalog storage, repository provisioning,
21
23
  authentication, the management API, bounded read-only smart HTTP and
22
- SHA-256-only hosted receive on qualified Linux storage.
24
+ SHA-256-only hosted receive and checked merges on qualified Linux storage,
25
+ repository browsing, collaboration/reviews and explicitly selected durable jobs.
23
26
  Production qualification is unfinished. [Preview notes](docs/releases.md)
24
27
  record the supported scope and remaining gates.
25
28
  The project was renamed from Gittycat to avoid the existing npm command name.
26
- Use `pip install "gitcx[http]==0.1.0a3"`, `import gitcx` and the `gitcx` command.
29
+ Use `pip install "gitcx[http]==0.1.0a4"`, `import gitcx` and the `gitcx` command.
27
30
  See [migration instructions](docs/migration.md) for existing installations.
28
31
  [Wispsy Releases](https://github.com/orgs/wispsy/projects/31)
29
32
  tracks publication separately from current development.
@@ -38,6 +41,20 @@ qualification targets; public deployment remains a later milestone.
38
41
 
39
42
  Source development does not imply a published package or deployed service.
40
43
 
44
+ Current source also provides a [repository browser](docs/browser.md) at `/repos`
45
+ with escaped file, branch, commit and comparison views, bounded text previews
46
+ and isolated attachment downloads. It shares the existing repository/token
47
+ authorization and supports both native object formats.
48
+
49
+ [Pull-request pages and services](docs/pull-requests.md) persist reviewed base/head
50
+ snapshots, comments and fresh approvals, with versioned allowed/default merge
51
+ methods. Git-default, fast-forward-only, no-fast-forward and squash remain
52
+ distinct choices. Read-only pages show escaped comparisons and discussion;
53
+ Bearer-authenticated JSON routes manage proposals, reviews and settings.
54
+ Checked publication revalidates current reviews, permissions, protections and
55
+ both reviewed tips through the qualified bare merge engine. Previews show exact
56
+ result trees/parents; durable outcomes preserve explicit interruption recovery.
57
+
41
58
  The first implementation provides immutable platform records, validated slugs
42
59
  and opaque storage IDs, an explicit Git backend protocol and deny-by-default
43
60
  repository permissions. [Permission contracts](docs/permissions.md) describe
@@ -48,6 +65,12 @@ same read policy as repository access.
48
65
  repository metadata, permissions, credential metadata and a transactional audit
49
66
  outbox.
50
67
 
68
+ [Durable workers and audit queries](docs/jobs.md) add bounded batches,
69
+ restartable leases/retries and an idempotent local activity projection. Worker
70
+ execution is explicitly selected; no background service starts automatically.
71
+ Optional [signed webhooks](docs/webhooks.md) use explicit destination/IP policy,
72
+ caller-supplied credentials and independent durable delivery receipts.
73
+
51
74
  [Managed provisioning](docs/provisioning.md) now connects catalog permissions to
52
75
  real Gitdx bare repositories with pending/ready recovery and an immutable backend
53
76
  release.
@@ -1,13 +1,16 @@
1
1
  # gitcx
2
2
 
3
- Developer preview: **0.1.0a3**, paired with published `gitdx==0.1.0a2`.
3
+ Developer preview source: **0.1.0a4**, paired with published `gitdx==0.1.0a3`.
4
+ The [release history](https://github.com/wispsy/gitcx/releases) records published
5
+ versions; a source version label does not establish publication.
4
6
  The selected scope includes catalog storage, repository provisioning,
5
7
  authentication, the management API, bounded read-only smart HTTP and
6
- SHA-256-only hosted receive on qualified Linux storage.
8
+ SHA-256-only hosted receive and checked merges on qualified Linux storage,
9
+ repository browsing, collaboration/reviews and explicitly selected durable jobs.
7
10
  Production qualification is unfinished. [Preview notes](docs/releases.md)
8
11
  record the supported scope and remaining gates.
9
12
  The project was renamed from Gittycat to avoid the existing npm command name.
10
- Use `pip install "gitcx[http]==0.1.0a3"`, `import gitcx` and the `gitcx` command.
13
+ Use `pip install "gitcx[http]==0.1.0a4"`, `import gitcx` and the `gitcx` command.
11
14
  See [migration instructions](docs/migration.md) for existing installations.
12
15
  [Wispsy Releases](https://github.com/orgs/wispsy/projects/31)
13
16
  tracks publication separately from current development.
@@ -22,6 +25,20 @@ qualification targets; public deployment remains a later milestone.
22
25
 
23
26
  Source development does not imply a published package or deployed service.
24
27
 
28
+ Current source also provides a [repository browser](docs/browser.md) at `/repos`
29
+ with escaped file, branch, commit and comparison views, bounded text previews
30
+ and isolated attachment downloads. It shares the existing repository/token
31
+ authorization and supports both native object formats.
32
+
33
+ [Pull-request pages and services](docs/pull-requests.md) persist reviewed base/head
34
+ snapshots, comments and fresh approvals, with versioned allowed/default merge
35
+ methods. Git-default, fast-forward-only, no-fast-forward and squash remain
36
+ distinct choices. Read-only pages show escaped comparisons and discussion;
37
+ Bearer-authenticated JSON routes manage proposals, reviews and settings.
38
+ Checked publication revalidates current reviews, permissions, protections and
39
+ both reviewed tips through the qualified bare merge engine. Previews show exact
40
+ result trees/parents; durable outcomes preserve explicit interruption recovery.
41
+
25
42
  The first implementation provides immutable platform records, validated slugs
26
43
  and opaque storage IDs, an explicit Git backend protocol and deny-by-default
27
44
  repository permissions. [Permission contracts](docs/permissions.md) describe
@@ -32,6 +49,12 @@ same read policy as repository access.
32
49
  repository metadata, permissions, credential metadata and a transactional audit
33
50
  outbox.
34
51
 
52
+ [Durable workers and audit queries](docs/jobs.md) add bounded batches,
53
+ restartable leases/retries and an idempotent local activity projection. Worker
54
+ execution is explicitly selected; no background service starts automatically.
55
+ Optional [signed webhooks](docs/webhooks.md) use explicit destination/IP policy,
56
+ caller-supplied credentials and independent durable delivery receipts.
57
+
35
58
  [Managed provisioning](docs/provisioning.md) now connects catalog permissions to
36
59
  real Gitdx bare repositories with pending/ready recovery and an immutable backend
37
60
  release.
@@ -1,17 +1,38 @@
1
1
  {
2
2
  "gitdx": {
3
3
  "repository": "https://github.com/wispsy/gitdx",
4
- "commit": "5564067cc8becb1d5341fc56e271d7360d229e21",
5
- "qualification": "https://github.com/wispsy/gitdx/actions/runs/46064002159",
6
- "profile": "native files-ref storage, bounded upload-pack and SHA-256-only untrusted receive with host publication guards on qualified Linux",
4
+ "commit": "0d3d15742f0e3d479a62096444f034ed6460440a",
5
+ "qualification": "https://github.com/wispsy/gitdx/actions/runs/47073716635",
6
+ "profile": "native files-ref storage, bounded upload-pack, four-policy bare merge planning/guarded publication and SHA-256-only untrusted receive on qualified Linux",
7
7
  "required_capabilities": [
8
8
  "objects.read",
9
9
  "objects.write",
10
10
  "refs.read",
11
- "refs.update"
11
+ "refs.update",
12
+ "merge.bare-plans",
13
+ "merge.bare-publication"
12
14
  ],
13
- "version": "0.1.0a2",
15
+ "version": "0.1.0a3",
14
16
  "published": {
17
+ "version": "0.1.0a3",
18
+ "commit": "0d3d15742f0e3d479a62096444f034ed6460440a",
19
+ "qualification": "https://github.com/wispsy/gitdx/actions/runs/47073716635",
20
+ "pypi": "https://pypi.org/project/gitdx/0.1.0a3/",
21
+ "artifacts": [
22
+ {
23
+ "filename": "gitdx-0.1.0a3-py3-none-any.whl",
24
+ "bytes": 160728,
25
+ "sha256": "d23b3aed0bb08ddbf64d67f5bee248782e87d4f8476e0c4380e102bbfcee2221"
26
+ },
27
+ {
28
+ "filename": "gitdx-0.1.0a3.tar.gz",
29
+ "bytes": 297019,
30
+ "sha256": "4efabc484c986462c36d136feb1d31b35f29e3f63025f41e4a9828d83520058b"
31
+ }
32
+ ]
33
+ },
34
+ "source_kind": "pypi",
35
+ "previous_published": {
15
36
  "version": "0.1.0a2",
16
37
  "commit": "5564067cc8becb1d5341fc56e271d7360d229e21",
17
38
  "qualification": "https://github.com/wispsy/gitdx/actions/runs/46064002159",
@@ -29,25 +50,6 @@
29
50
  }
30
51
  ]
31
52
  },
32
- "source_kind": "pypi",
33
- "previous_published": {
34
- "version": "0.1.0a1",
35
- "commit": "3386e6b0b0cd4c99c7ff208ba5e127b6c15ac3a8",
36
- "qualification": "https://github.com/wispsy/gitdx/actions/runs/45495562313",
37
- "pypi": "https://pypi.org/project/gitdx/0.1.0a1/",
38
- "artifacts": [
39
- {
40
- "filename": "gitdx-0.1.0a1-py3-none-any.whl",
41
- "bytes": 101327,
42
- "sha256": "a4cdada6eafc93e2c58ac1c9558cfe16b8bd7e2e8193c6a10ee4f50c8307e30b"
43
- },
44
- {
45
- "filename": "gitdx-0.1.0a1.tar.gz",
46
- "bytes": 178361,
47
- "sha256": "94268e46bf7fd8e2aeee97a3b43ccbd365ddfff02015d18439f02a23848d20bd"
48
- }
49
- ]
50
- },
51
53
  "previous_source": {
52
54
  "version": "0.1.0a1",
53
55
  "commit": "8765b1fa9d3bc664fd551b15912e5455174f1983",
@@ -0,0 +1,53 @@
1
+ # Repository browser
2
+
3
+ Source development adds `BrowserService`: read-only branches, commit/tree/blob
4
+ snapshots and two-commit comparisons through the published Gitdx engine. It
5
+ supports native SHA-1 and SHA-256 repositories. The optional HTTP app adds HTML
6
+ routes at `/` and `/repos`, with repository pages under `/repos/<opaque-id>`.
7
+
8
+ Every operation uses catalog read authorization before opening managed storage,
9
+ hides pending/private repositories, and refreshes credential scope, expiry and
10
+ revocation. Bounded preparation holds catalog exclusion; expiry is checked again
11
+ before returning. Trusted local principals and anonymous public reads use the
12
+ same repository policy as the management and Git interfaces.
13
+
14
+ Select `HEAD`, a full `refs/heads/…` or `refs/tags/…` name, or a known full commit
15
+ ID. A known commit ID selects any stored commit in the authorized repository;
16
+ this is not a reachability filter. Returned views pin links to immutable IDs.
17
+ Git byte paths traverse tree objects without opening host files. Symlinks are
18
+ displayed as blob bytes; gitlinks never trigger submodule access. Diffs compare
19
+ explicit trees; commit views compare against the first parent (empty for roots).
20
+
21
+ `BrowserLimits` defaults to 1 MiB per object, 8 MiB aggregate object reads, 4096
22
+ reads, 1000 directory entries/changed paths/branches, depth 32, path length 4096,
23
+ 64 KiB text previews, 2 MiB rendered output and 500,000 diff work units. Pack
24
+ reads also enforce finite index/pack/scan/delta budgets. Limits refuse oversized
25
+ work; large-object streaming and pagination through large trees are later work.
26
+ No Git executable, filters, hooks or external UI dependency runs in this path.
27
+
28
+ ## HTML navigation and downloads
29
+
30
+ Repository pages link files, branches, commits, first-parent changes and explicit
31
+ base/head comparisons. Tree/blob queries use `revision` and lowercase byte-hex
32
+ `path`, preserving names that are not UTF-8. Links pin the resolved full commit
33
+ ID. Empty repositories show the branch page. Repository listing uses 50-item
34
+ cursor pages; individual directories and branch lists refuse their configured
35
+ hard limit. Comparisons show two complete tree snapshots, rather than computing
36
+ a merge-base or predicting a merge result.
37
+
38
+ Names, messages, paths and patch bytes are escaped as HTML. Invalid UTF-8 and
39
+ control/directional characters are displayed with visible escapes. Binary data
40
+ and text beyond 64 KiB have no inline preview. `/download` returns a fixed-name
41
+ attachment with `application/octet-stream`, `nosniff` and a sandbox CSP; active
42
+ content is never rendered as a document. HTML has no scripts, a restrictive CSP,
43
+ no-store caching, no-referrer and authorization-aware variation. Semantic tables,
44
+ labelled forms, skip navigation and visible keyboard focus support navigation.
45
+
46
+ Anonymous browsing lists and opens public repositories. Private URLs conceal
47
+ missing/denied resources with the same 404 response before storage lookup.
48
+ Optional Bearer or Basic credentials use the existing token parser and are
49
+ checked before preparation and disclosure. Basic authentication is usable by
50
+ explicit clients/browser credential handling; this milestone adds no interactive
51
+ login, cookies or token-in-URL workflow. The local listener remains loopback-only.
52
+ Four browser preparations can be admitted by default, separately from Git
53
+ transfer capacity; select `browser_limits` and `max_browser_reads` in `create_app`.
@@ -38,8 +38,14 @@ legacy metadata/verifiers without scope rows cannot authenticate as tokens.
38
38
 
39
39
  `pending_jobs(limit, after)` and `acknowledge_job(id)` provide restart-safe bounded
40
40
  outbox envelopes and idempotent acknowledgement. Delivery can occur at least once;
41
- consumers must be idempotent. Worker leases/retries, execution and external delivery
42
- remain CAT-12 work. No worker or network service starts automatically.
41
+ consumers must be idempotent. Schema 7 adds [explicit workers](jobs.md) with
42
+ independent consumer leases, retries, dead letters and a rebuildable activity
43
+ projection. No worker or network service starts automatically.
44
+
45
+ Schema 8 persists [optional webhook](webhooks.md) configuration without signing
46
+ keys, including its repository, creator, destination and historical cursor.
47
+ Consumer receipts remain independent of local acknowledgement. The creator's
48
+ current administrator permission is checked before each bounded delivery.
43
49
 
44
50
  Pages contain at most 100 results. New databases use owner-only file permissions;
45
51
  static database/sidecar symlinks are refused. SQLite manages database transaction
@@ -56,3 +56,14 @@ TLS/proxy selection, complete catalog/Git backup, destructive retention and
56
56
  future publication remain separately selected gates. This developer preview
57
57
  leaves production qualification unfinished. [Hosted receive](receive.md)
58
58
  documents the per-ref/unknown outcome and recovery contracts.
59
+
60
+ ## Checked merge milestone
61
+
62
+ The current driver previews all four methods through the real API in both native
63
+ formats and checks stable revision/target identity across restart. The qualified
64
+ Linux write profile performs Alice-create/Bob-review checked merges for
65
+ Git-default, ff-only, no-ff and squash. Native Git compares exact trees and parent
66
+ topology, including independent base edits in divergent squash/default cases;
67
+ source refs stay unchanged. Stale previews, missing approvals and outsider
68
+ publication are refused. Wheel/sdist runs use the same driver and selected
69
+ published backend; non-Linux receipts remain explicitly read-only.
@@ -56,3 +56,17 @@ exercise descriptor mechanisms without enabling that public platform profile;
56
56
  Windows qualifies early refusal. Both hashes retain trusted-local provisioning
57
57
  and read serving. The receive suite checks real stock-Git initial/subsequent
58
58
  pushes, policy/credential races, unknown outcomes and prepared/committed recovery.
59
+
60
+ ## macOS CI runner selection
61
+
62
+ The source and installed matrices keep the existing `macos-latest` check/artifact
63
+ keys and select `macos-15-intel` for regular pull-request/main checks, following
64
+ hosted arm64 capacity cancellations. All six required checks retain their tests.
65
+ The Checks workflow also supports manual `macos_runner=macos-latest` selection
66
+ for explicit arm64 qualification when capacity is available. Local arm64
67
+ qualification uses the same source and `check_distribution.py` entry points.
68
+ Workflow logs identify the actual image; a display/check key is not a hardware
69
+ claim. Python and dependency pins remain unchanged. Supported
70
+ runner labels are documented in the [GitHub runner reference](https://docs.github.com/en/actions/reference/runners/github-hosted-runners).
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.
@@ -0,0 +1,58 @@
1
+ # Durable jobs and audit queries
2
+
3
+ Schema 7 adds per-consumer leases, retry/dead-letter outcomes and a rebuildable
4
+ resource-activity projection. Audit/outbox envelopes remain transactional with
5
+ catalog mutations. Schema-6 catalogs upgrade in one SQLite transaction; failed
6
+ DDL rolls back version and rows. Back up before upgrading. Older binaries refuse
7
+ the new schema; rollback uses the backup.
8
+
9
+ Workers are explicitly invoked trusted local operations. Each process/thread
10
+ owns a separate `Catalog`. Nothing starts at import, HTTP startup or installation.
11
+
12
+ ```python
13
+ from gitcx import ActivityProjection, Catalog, JobQueue, Worker
14
+
15
+ with Catalog("data/catalog.sqlite3") as catalog:
16
+ projection = ActivityProjection(catalog)
17
+ outcomes = Worker(JobQueue(catalog), {
18
+ "catalog.changed": projection,
19
+ "repository.index": projection,
20
+ }).run_once()
21
+ ```
22
+
23
+ Claims serialize in SQLite and receive unique lease tokens. Defaults: 50 jobs
24
+ per batch, a 30-second lease, five attempts, exponential delays from five seconds
25
+ capped at one hour. Expired claims recover after restart; stale/expired completion
26
+ cannot acknowledge a new claim. Completion and local acknowledgement commit
27
+ together. Interrupted final attempts become dead letters without blocking later
28
+ jobs. Trusted administrators may `retry_dead`, resetting the attempt budget and
29
+ retaining the stable job/idempotency key.
30
+
31
+ The `local` consumer acknowledges the legacy outbox. Named consumers retain
32
+ independent receipts and may consume locally acknowledged events. Select the
33
+ same name, resource/cursor and policy across restarts. A new name starts a new
34
+ consumer and may repeat history. Avoid mixing direct legacy acknowledgement
35
+ with a running local worker.
36
+
37
+ Delivery is at least once. External effects must use `claim.idempotency_key`:
38
+ crashes between an effect and completion can repeat it. `ActivityProjection` is
39
+ monotone and idempotent under repeated/out-of-order events. It indexes the last
40
+ repository event, never Git branch authority or full-text content. Audit/job and
41
+ projection queries constrain event kind as well as opaque ID, so an account or
42
+ credential with the same ID cannot enter a repository's activity. Handlers bound
43
+ their own time/effects; leases provide neither cancellation nor exactly-once
44
+ execution. No hook, helper or network call runs in the default projection.
45
+
46
+ Only fixed outcome codes persist: claimed, succeeded, retryable, permanent,
47
+ exhausted. Exception text, headers, secrets and response bodies are excluded.
48
+ Ordinary exceptions retry; `PermanentJobError` refuses work. Process interruption
49
+ leaves a recoverable lease. Trusted explicit dead-letter retry resets the stored
50
+ attempt count; this milestone retains the current outcome rather than a complete
51
+ per-attempt execution log.
52
+
53
+ Administrator-only management routes `GET /api/repositories/<id>/audit` and
54
+ `/jobs` take `limit` (1–100) and nonnegative sequence `after`. Jobs also select
55
+ `consumer`. Results exclude lease tokens/verifiers, refresh tokens and share the
56
+ concealed repository policy. `repository_activity` supplies the authorized local
57
+ projection query. Retention, compaction and a scheduled worker service remain
58
+ operational policy work. Outbound delivery is a separately selected adapter.
@@ -26,6 +26,8 @@ running after the acceptance tests.
26
26
  | POST /api/repositories | Reserve and provision a managed bare repository |
27
27
  | GET /api/repositories/{id} | Authorized open and capability/format summary |
28
28
  | POST /api/repositories/{id}/recover | Authorized pending/ready recovery |
29
+ | GET /api/repositories/{id}/audit?limit=50&after=0 | Administrator audit events with an exclusive sequence cursor |
30
+ | GET /api/repositories/{id}/jobs?limit=50&after=0 | Administrator delivery state; optional named consumer |
29
31
  | PUT /api/repositories/{id}/grants/{user_id} | Set read/write/admin collaborator permission |
30
32
  | DELETE /api/repositories/{id}/grants/{user_id} | Revoke a collaborator grant |
31
33
  | POST /api/organizations | Create an organization and its owner membership |
@@ -66,9 +68,12 @@ failures remain hidden and recoverable. Synchronous local catalog/storage work
66
68
  runs inline and is bounded; long/background jobs and public concurrency
67
69
  qualification remain later work. Storage errors return redacted 503 responses.
68
70
 
69
- Only JSON control routes exist. `/repo.git/info/refs`, upload-pack/receive-pack
70
- and Git packet/binary serializers are not registered. Account login/token issuance
71
- remain local bootstrap operations. Real loopback HTTP tests qualify both hashes,
71
+ The same application also installs [repository HTML views](browser.md) under
72
+ `/repos` and [smart HTTP](smart-http.md) under `/git/<opaque-id>.git`, including
73
+ the separately gated [hosted receiver](receive.md). These have their own content
74
+ types, budgets and optional anonymous public-read policy. JSON API routes retain
75
+ mandatory Bearer authentication. Account login/token issuance remain local
76
+ bootstrap operations. Real loopback HTTP tests qualify both hashes,
72
77
  two collaborators and an outsider, scope/expiry/revocation, limits, recovery,
73
78
  organization roles, concealed discovery and lifespan restart. Installed wheel
74
79
  and sdist pairs run the same HTTP suite outside source trees on all CI platforms.
@@ -37,6 +37,12 @@ Catalogs opened explicitly through Python keep their existing filesystem paths.
37
37
  The namespace migration does not require rebuilding repositories or issuing new
38
38
  tokens. Stop the old server before starting `gitcx` against the same data root.
39
39
 
40
+ Later source development upgrades the catalog transactionally through schemas 7
41
+ (durable jobs) and 8 (optional webhook configuration). Ownership receipts,
42
+ credentials and native Git storage keep their formats. Back up before the schema
43
+ upgrade; an older binary refuses a newer catalog, so binary rollback requires
44
+ restoring the pre-upgrade backup.
45
+
40
46
  Gitdx remains pinned to published `gitdx==0.1.0a2`; the optional HTTP extra keeps
41
47
  Expose API 0.2.0. The release uses `release.yaml`, the `pypi` environment and the
42
48
  Trusted Publisher for `wispsy/gitcx`. Earlier `gittycat` PyPI distributions and
@@ -0,0 +1,201 @@
1
+ # Pull requests and merge policies
2
+
3
+ Current source provides durable pull-request records, comments, reviews and
4
+ versioned merge-method settings through explicit Python services. Managed Git
5
+ refs remain authoritative; the catalog stores reviewed snapshots, not a second
6
+ branch-tip database. Checked merge publication uses the qualified bare merge
7
+ API from Gitdx with current collaboration and authorization checks.
8
+
9
+ `MergeService.prepare(actor, pull_id, expected_revision=...)` previews the exact
10
+ native target, tree and parents through the published Gitdx backend. It writes
11
+ no Git objects/refs or collaboration records. Its fingerprint binds the reviewed
12
+ request, method, policy versions and complete generated pack. New commits use
13
+ explicit service attribution (`Gitcx <gitcx@localhost>`) and the reviewed
14
+ revision's timestamp; existing authors/signatures are not claimed for new commits.
15
+ Fast-forward and already-integrated plans retain the existing commit identity.
16
+
17
+ Previews refuse stale snapshots, disabled methods, conflicts and exhausted
18
+ engine budgets. Linear-history rules check actual resulting topology, including
19
+ interior merge commits introduced by a fast-forward. That policy query uses the
20
+ engine's bounded history walk (10,000 commits and 8 MiB per walk by default);
21
+ larger histories require an explicitly selected budget. Previewing remains
22
+ separate from checked publication and its fresh authorization/review checks.
23
+
24
+ ## Methods and settings
25
+
26
+ The initial default is normal Git behavior: fast-forward when possible, otherwise
27
+ create a two-parent merge commit. The four distinct method names are:
28
+
29
+ | Method | Intended result |
30
+ | --- | --- |
31
+ | `git-default` | Fast-forward when possible; otherwise merge commit |
32
+ | `ff-only` | Fast-forward or refuse divergence |
33
+ | `no-ff` | Merge commit even when fast-forwardable |
34
+ | `squash` | One merged-content commit with the current base as sole parent |
35
+
36
+ `MergePolicyService` reads settings and allows administrators to configure
37
+ allowed methods/defaults with an expected policy version. `MergeRule` records
38
+ restrict destination branches by exact name or a single trailing `/*` prefix.
39
+ All matching rules intersect; an exact rule cannot relax broader restrictions.
40
+ An empty branch method set disables merging there. A default excluded by branch
41
+ rules requires an explicit permitted choice, rather than silently substituting
42
+ another method.
43
+
44
+ Linear-history rules exclude `no-ff`. `git-default` remains eligible for a
45
+ fast-forward, but publication must refuse its divergent two-parent result under
46
+ that rule. Method configuration describes permission, not proof that an engine
47
+ method is available. Rebase replay and additional content strategies retain
48
+ separate contracts before being exposed as supported methods.
49
+
50
+ ```python
51
+ from gitcx import MergeMethod, MergePolicyService, PullRequestService
52
+
53
+ policy = MergePolicyService(catalog)
54
+ settings = policy.settings(actor, repository_id)
55
+ policy.configure(
56
+ actor, repository_id,
57
+ allowed={MergeMethod.GIT_DEFAULT, MergeMethod.NO_FF, MergeMethod.SQUASH},
58
+ default=MergeMethod.GIT_DEFAULT,
59
+ expected_version=settings.version,
60
+ )
61
+
62
+ service = PullRequestService(catalog, backend)
63
+ pull = service.create(
64
+ actor, repository_id, title="Integrate feature", body="Review context",
65
+ base_ref="refs/heads/main", head_ref="refs/heads/feature",
66
+ method=MergeMethod.SQUASH,
67
+ )
68
+ ```
69
+
70
+ ## Reviewed snapshots and discussion
71
+
72
+ A request has a stable ID and per-repository number, explicit base/head refs
73
+ and native-format commit IDs, a selected method, revision and policy versions.
74
+ Create requires a ready managed repository and two distinct direct branches.
75
+ `comparison()` derives bounded diffs from the saved Git commits and reports
76
+ whether current branch tips or either policy version changed. It never
77
+ silently adopts a newer head while displaying a reviewed comparison.
78
+
79
+ `refresh(expected_revision=...)` explicitly adopts current branch/policy
80
+ snapshots or a newly selected method. A changed snapshot increments the request
81
+ revision. Closing/reopening also increments it; reopening captures fresh tips.
82
+ Every prior review stays in history but ceases to approve the new revision.
83
+ Deleted source branches leave historical comparisons readable and stale.
84
+
85
+ Comments and reviews require current write access and authenticated accounts.
86
+ Readers can inspect permitted discussions; public visibility grants no write
87
+ capability. Authors cannot approve/block their own requests. Reviews select
88
+ `approve`, `request-changes` or `comment`, and require fresh compared tips and
89
+ policy versions. The latest non-comment decision per reviewer determines their
90
+ current decision; a comment does not dismiss an approval. Review summaries
91
+ exclude stale revisions and reviewers who have lost write permission.
92
+
93
+ ```python
94
+ service.comment(actor, pull.id, body="Review context", expected_revision=pull.revision)
95
+ service.review(reviewer, pull.id, decision="approve", body="Reviewed",
96
+ expected_revision=pull.revision)
97
+ summary = service.review_summary(actor, pull.id)
98
+ ```
99
+
100
+ Each collection has bounded pagination. Titles are at most 256 UTF-8 bytes,
101
+ bodies/comments/review text at most 64 KiB, and each request has at most 1000
102
+ comments and 1000 reviews. NUL is refused. Text remains text for escaped
103
+ presentation. Credential activity/scope and repository grants are refreshed
104
+ through the shared authentication policy.
105
+
106
+ Schema 10 upgrades preserve the existing catalog. Request/settings mutations,
107
+ audit events and outbox rows share one SQLite transaction. Expected revisions
108
+ and serialized numbering handle competing writers; an audit failure rolls back
109
+ the associated state. Comparison/review summaries are advisory; publication repeats
110
+ authorization, current protections, method eligibility, reviews and both
111
+ expected tips under the catalog/ref locks.
112
+
113
+ ## Checked publication and recovery
114
+
115
+ `MergeService.publish(actor, checked)` recomputes the canonical proposal, refreshes
116
+ write credentials/grants and current reviews, and retains catalog exclusion
117
+ before acquiring both engine ref locks. Required reviews need a fresh approval
118
+ from another current writer; current change requests block publication. Matching
119
+ method/protection rules and actual linear topology remain enforced. Ordinary
120
+ receive-pack continues to refuse review-required pushes.
121
+
122
+ Hosted publication retains SHA-256-only qualified Linux storage and explicit
123
+ untrusted ingestion. Only the destination changes; the source branch is guarded
124
+ read-only. Already-integrated heads require explicit closure instead of a new
125
+ publication. This is not an atomic transaction between Git refs and the catalog.
126
+ Default preview tree/content and pack bytes are capped to the selected receive
127
+ wire budget (16 MiB); callers can select typed engine budgets explicitly.
128
+
129
+ Each attempt has a durable receive receipt linked to its pull revision, method,
130
+ fingerprint, exact target/tree and resulting parents. Only an accepted matching
131
+ Git transaction marks the request merged and emits its merge/index event.
132
+ Rejected attempts leave it open. Unknown/prepared attempts block another merge
133
+ in the repository and block refreshing or closing that request until resolved.
134
+ Discussion history remains available.
135
+
136
+ `MergeService.operation()` reads a freshly authorized receipt. Administrators can
137
+ explicitly call `recover()` for repository ref-journal recovery; a recovered
138
+ transaction only completes this merge when its recorded ID matches. An observed
139
+ accepted receipt retained after catalog finalization failure can be completed
140
+ without guessing from later branch tips. A crash with no tied Git receipt stays
141
+ unknown and needs owner reconciliation. Engine recovery retains its refusal of
142
+ foreign locks, corrupt journals and later conflicting ref edits.
143
+
144
+ ## HTTP and browser views
145
+
146
+ `GET /repos/{repository_id}/pulls` lists accessible requests and the repository's
147
+ default merge method. `GET /repos/{repository_id}/pulls/{pull_request_id}` shows
148
+ the reviewed comparison, method, state, current approval count and paged
149
+ discussion. Branch/commit links retain exact saved snapshots. Stale comparisons
150
+ are clearly marked. Titles, messages, file patches, author names and discussions
151
+ use the repository browser's escaped text presentation, output limit, no-store
152
+ headers and restrictive content policy.
153
+
154
+ Public repository discussions can be read anonymously; private views use the
155
+ existing Basic-token/Bearer browser authorization. Browser pages are read-only.
156
+ Mutations use the management API's explicit Bearer authorization, bounded JSON
157
+ body and authentication refresh after body reading. Basic browser credentials
158
+ cannot authorize JSON mutations. Checked publication uses the selected published
159
+ backend; browser pages remain read-only.
160
+
161
+ All API paths below begin with `/api/repositories/{repository_id}`:
162
+
163
+ | Method and suffix | Purpose |
164
+ | --- | --- |
165
+ | `GET /pulls` | List requests with numeric `limit`/`after` pagination |
166
+ | `POST /pulls` | Create with `title`, `base_ref`, `head_ref`; optional `body`/`method` |
167
+ | `GET /pulls/{id}` | Read a permitted request snapshot |
168
+ | `POST /pulls/{id}/refresh` | Refresh using `expected_revision`; optional `method` |
169
+ | `POST /pulls/{id}/state` | Close/reopen using `expected_revision` and boolean `open` |
170
+ | `GET, POST /pulls/{id}/comments` | Page comments or append `body` with `expected_revision` |
171
+ | `GET, POST /pulls/{id}/reviews` | Page reviews/current decisions or submit `decision`, `expected_revision` and optional `body` |
172
+ | `POST /pulls/{id}/merge-preview` | Read the exact target/tree/parents using `expected_revision` |
173
+ | `POST /pulls/{id}/merge` | Publish using `expected_revision` and the preview's `proposal` fingerprint |
174
+ | `GET /pulls/{id}/merges` | Page outcome receipts using `limit` and opaque `after` operation ID |
175
+ | `GET /merges/{operation_id}` | Read an authorized operation receipt |
176
+ | `POST /merges/{operation_id}/recover` | Administrator repository-journal recovery with an empty JSON object |
177
+ | `GET /merge-policy` | Read settings and branch rules |
178
+ | `PUT /merge-policy` | Configure `allowed` array, `default` and `expected_version` as administrator |
179
+ | `PUT /merge-policy/rules` | Set `pattern`, `allowed`, `expected_version` and optional `linear_history` |
180
+ | `DELETE /merge-policy/rules` | Delete `pattern` using `expected_version` as administrator |
181
+
182
+ Create/comment/review return 201. Stale revisions/policies return 409; unavailable
183
+ or denied resources are concealed as 404. Invalid fields/refs return 400 and
184
+ excessive bodies/output return 413. Responses and rendered errors omit raw
185
+ credentials and use no-store caching. API response OIDs are native full hex
186
+ values; browser Git paths remain byte-preserving through the existing views.
187
+
188
+ Merge preview requires read access; publication requires current write access and
189
+ an exact fingerprint from the preview. Completed publication returns 200;
190
+ rejected/unknown operations return 409 with the durable receipt. Method/conflict
191
+ refusals return 409, exhausted limits return 413 and capacity returns 503. Invalid
192
+ write profiles are explicit refusals. Operation IDs remain concealed across
193
+ repository paths and private access boundaries.
194
+
195
+ Publication and recovery must own their catalog transaction boundaries; trusted
196
+ Python callers invoke them outside an enclosing `Catalog.transaction()`. HTTP
197
+ workers use an independent catalog handle after short authentication, allowing
198
+ prepared receipts to commit before Git writes. Expensive preparation releases
199
+ the catalog lock and revalidates its snapshot afterward. Two concurrent merge
200
+ workers are admitted by default (`max_merges` selects 1–16); cancelled requests
201
+ retain admission until their worker actually exits.