cohorte-engine 1.0.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. cohorte_engine-1.0.0a1/.github/workflows/ci.yml +29 -0
  2. cohorte_engine-1.0.0a1/.github/workflows/release.yml +88 -0
  3. cohorte_engine-1.0.0a1/.gitignore +13 -0
  4. cohorte_engine-1.0.0a1/CHANGELOG.md +26 -0
  5. cohorte_engine-1.0.0a1/LICENSE +4 -0
  6. cohorte_engine-1.0.0a1/PKG-INFO +200 -0
  7. cohorte_engine-1.0.0a1/README.md +174 -0
  8. cohorte_engine-1.0.0a1/docs/IMPLEMENTATION.md +168 -0
  9. cohorte_engine-1.0.0a1/docs/PROTOCOL.md +41 -0
  10. cohorte_engine-1.0.0a1/docs/RELEASING.md +47 -0
  11. cohorte_engine-1.0.0a1/docs/ROADMAP.md +72 -0
  12. cohorte_engine-1.0.0a1/docs/evidence/g0-claude-sdk-darwin-arm64.json +110 -0
  13. cohorte_engine-1.0.0a1/docs/evidence/g0-claude-subscription-blocked-darwin-arm64.json +34 -0
  14. cohorte_engine-1.0.0a1/docs/evidence/g0-codex-darwin-arm64.json +42 -0
  15. cohorte_engine-1.0.0a1/docs/evidence/g1-claude-vertical-darwin-arm64.json +48 -0
  16. cohorte_engine-1.0.0a1/docs/evidence/g1-codex-recovery-darwin-arm64.json +42 -0
  17. cohorte_engine-1.0.0a1/docs/evidence/g1-codex-vertical-darwin-arm64.json +58 -0
  18. cohorte_engine-1.0.0a1/docs/evidence/g2-github-darwin-arm64.json +48 -0
  19. cohorte_engine-1.0.0a1/docs/evidence/g2-local-delivery.json +32 -0
  20. cohorte_engine-1.0.0a1/docs/evidence/g3-codex-align-ds-darwin-arm64.json +53 -0
  21. cohorte_engine-1.0.0a1/docs/evidence/g3-codex-fleet-darwin-arm64.json +63 -0
  22. cohorte_engine-1.0.0a1/docs/evidence/g3-codex-intake-patch-darwin-arm64.json +55 -0
  23. cohorte_engine-1.0.0a1/docs/evidence/g3-codex-maintenance-darwin-arm64.json +57 -0
  24. cohorte_engine-1.0.0a1/docs/evidence/g3-codex-mid-wave-recovery-darwin-arm64.json +65 -0
  25. cohorte_engine-1.0.0a1/docs/evidence/g3-codex-multisurface-darwin-arm64.json +67 -0
  26. cohorte_engine-1.0.0a1/docs/evidence/g3-local-design-retrieval.json +43 -0
  27. cohorte_engine-1.0.0a1/docs/evidence/g3-local-kanban-metrics.json +36 -0
  28. cohorte_engine-1.0.0a1/docs/evidence/g3-unified-agent-events-darwin-arm64.json +62 -0
  29. cohorte_engine-1.0.0a1/docs/evidence/g4-local-francois-protocol.json +42 -0
  30. cohorte_engine-1.0.0a1/docs/evidence/g4-local-service-host-darwin-arm64.json +41 -0
  31. cohorte_engine-1.0.0a1/docs/evidence/g4-local-v2-migration-upgrade.json +45 -0
  32. cohorte_engine-1.0.0a1/docs/evidence/g4-windows-named-pipe-implementation.json +42 -0
  33. cohorte_engine-1.0.0a1/docs/evidence/g5-ac01-clean-install-darwin-arm64.json +47 -0
  34. cohorte_engine-1.0.0a1/docs/evidence/g5-ac02-cohorte-login-handoff-darwin-arm64.json +44 -0
  35. cohorte_engine-1.0.0a1/docs/evidence/g5-ac02-isolated-native-login-darwin-arm64.json +25 -0
  36. cohorte_engine-1.0.0a1/docs/evidence/g5-ac14-gitlab-darwin-arm64.json +48 -0
  37. cohorte_engine-1.0.0a1/docs/evidence/g5-ac19-francois-current-integration.json +33 -0
  38. cohorte_engine-1.0.0a1/docs/evidence/g5-ac23-figma-file-snapshot-darwin-arm64.json +37 -0
  39. cohorte_engine-1.0.0a1/docs/evidence/g5-ac23-graphify-mcp-darwin-arm64.json +32 -0
  40. cohorte_engine-1.0.0a1/docs/evidence/g5-ac23-serena-mcp-darwin-arm64.json +30 -0
  41. cohorte_engine-1.0.0a1/docs/evidence/g5-ac26-installed-upgrade.json +42 -0
  42. cohorte_engine-1.0.0a1/docs/evidence/g5-ac30-agent-file-denial-darwin-arm64.json +36 -0
  43. cohorte_engine-1.0.0a1/docs/evidence/g5-ac30-readonly-command-retry-darwin-arm64.json +38 -0
  44. cohorte_engine-1.0.0a1/docs/evidence/g5-ac30-readonly-reviewer-darwin-arm64.json +50 -0
  45. cohorte_engine-1.0.0a1/docs/evidence/g5-ac30-runtime-sandbox-darwin-arm64.json +39 -0
  46. cohorte_engine-1.0.0a1/docs/evidence/g5-codex-brainstorm-darwin-arm64.json +40 -0
  47. cohorte_engine-1.0.0a1/docs/evidence/g5-codex-control-darwin-arm64.json +49 -0
  48. cohorte_engine-1.0.0a1/docs/qualification/README.md +59 -0
  49. cohorte_engine-1.0.0a1/docs/qualification/ac-matrix.json +261 -0
  50. cohorte_engine-1.0.0a1/examples/g1/profile.json +61 -0
  51. cohorte_engine-1.0.0a1/examples/g1/spec.json +28 -0
  52. cohorte_engine-1.0.0a1/examples/g2/profile.json +61 -0
  53. cohorte_engine-1.0.0a1/examples/g3/fleet-api-base.json +22 -0
  54. cohorte_engine-1.0.0a1/examples/g3/fleet-api-followup.json +22 -0
  55. cohorte_engine-1.0.0a1/examples/g3/fleet-profile.json +90 -0
  56. cohorte_engine-1.0.0a1/examples/g3/fleet-web-banner.json +22 -0
  57. cohorte_engine-1.0.0a1/examples/g3/patch-profile.json +61 -0
  58. cohorte_engine-1.0.0a1/examples/g3/patch-spec.json +23 -0
  59. cohorte_engine-1.0.0a1/examples/g3/profile.json +79 -0
  60. cohorte_engine-1.0.0a1/examples/g3/spec.json +56 -0
  61. cohorte_engine-1.0.0a1/examples/project.json +15 -0
  62. cohorte_engine-1.0.0a1/pyproject.toml +57 -0
  63. cohorte_engine-1.0.0a1/scripts/release_meta.py +141 -0
  64. cohorte_engine-1.0.0a1/src/cohorte/__init__.py +3 -0
  65. cohorte_engine-1.0.0a1/src/cohorte/adapters/__init__.py +1 -0
  66. cohorte_engine-1.0.0a1/src/cohorte/adapters/claude.py +438 -0
  67. cohorte_engine-1.0.0a1/src/cohorte/adapters/codex.py +638 -0
  68. cohorte_engine-1.0.0a1/src/cohorte/adapters/events.py +157 -0
  69. cohorte_engine-1.0.0a1/src/cohorte/adapters/figma.py +75 -0
  70. cohorte_engine-1.0.0a1/src/cohorte/adapters/git.py +146 -0
  71. cohorte_engine-1.0.0a1/src/cohorte/adapters/graphify.py +153 -0
  72. cohorte_engine-1.0.0a1/src/cohorte/adapters/hosting.py +166 -0
  73. cohorte_engine-1.0.0a1/src/cohorte/adapters/native_login.py +126 -0
  74. cohorte_engine-1.0.0a1/src/cohorte/adapters/providers.py +64 -0
  75. cohorte_engine-1.0.0a1/src/cohorte/adapters/serena.py +181 -0
  76. cohorte_engine-1.0.0a1/src/cohorte/application/__init__.py +3 -0
  77. cohorte_engine-1.0.0a1/src/cohorte/application/alignment.py +192 -0
  78. cohorte_engine-1.0.0a1/src/cohorte/application/context.py +367 -0
  79. cohorte_engine-1.0.0a1/src/cohorte/application/delivery.py +235 -0
  80. cohorte_engine-1.0.0a1/src/cohorte/application/discovery.py +106 -0
  81. cohorte_engine-1.0.0a1/src/cohorte/application/durable.py +231 -0
  82. cohorte_engine-1.0.0a1/src/cohorte/application/fleet.py +395 -0
  83. cohorte_engine-1.0.0a1/src/cohorte/application/intake.py +137 -0
  84. cohorte_engine-1.0.0a1/src/cohorte/application/kanban.py +154 -0
  85. cohorte_engine-1.0.0a1/src/cohorte/application/maintenance.py +475 -0
  86. cohorte_engine-1.0.0a1/src/cohorte/application/metrics.py +194 -0
  87. cohorte_engine-1.0.0a1/src/cohorte/application/migration.py +282 -0
  88. cohorte_engine-1.0.0a1/src/cohorte/application/multisurface.py +560 -0
  89. cohorte_engine-1.0.0a1/src/cohorte/application/patch.py +217 -0
  90. cohorte_engine-1.0.0a1/src/cohorte/application/preparation.py +349 -0
  91. cohorte_engine-1.0.0a1/src/cohorte/application/readiness.py +44 -0
  92. cohorte_engine-1.0.0a1/src/cohorte/application/service.py +126 -0
  93. cohorte_engine-1.0.0a1/src/cohorte/application/vertical.py +377 -0
  94. cohorte_engine-1.0.0a1/src/cohorte/assets/prompts/README.md +4 -0
  95. cohorte_engine-1.0.0a1/src/cohorte/cli/__init__.py +1 -0
  96. cohorte_engine-1.0.0a1/src/cohorte/cli/main.py +1576 -0
  97. cohorte_engine-1.0.0a1/src/cohorte/domain/__init__.py +1 -0
  98. cohorte_engine-1.0.0a1/src/cohorte/domain/auth.py +125 -0
  99. cohorte_engine-1.0.0a1/src/cohorte/domain/errors.py +67 -0
  100. cohorte_engine-1.0.0a1/src/cohorte/domain/evidence.py +100 -0
  101. cohorte_engine-1.0.0a1/src/cohorte/domain/models.py +532 -0
  102. cohorte_engine-1.0.0a1/src/cohorte/domain/redaction.py +36 -0
  103. cohorte_engine-1.0.0a1/src/cohorte/execution/__init__.py +3 -0
  104. cohorte_engine-1.0.0a1/src/cohorte/execution/checks.py +107 -0
  105. cohorte_engine-1.0.0a1/src/cohorte/execution/scheduler.py +53 -0
  106. cohorte_engine-1.0.0a1/src/cohorte/persistence/__init__.py +3 -0
  107. cohorte_engine-1.0.0a1/src/cohorte/persistence/sqlite.py +1204 -0
  108. cohorte_engine-1.0.0a1/src/cohorte/protocol/__init__.py +3 -0
  109. cohorte_engine-1.0.0a1/src/cohorte/protocol/models.py +52 -0
  110. cohorte_engine-1.0.0a1/src/cohorte/protocol/rpc.py +332 -0
  111. cohorte_engine-1.0.0a1/src/cohorte/py.typed +1 -0
  112. cohorte_engine-1.0.0a1/src/cohorte/service/__init__.py +1 -0
  113. cohorte_engine-1.0.0a1/src/cohorte/service/host.py +316 -0
  114. cohorte_engine-1.0.0a1/src/cohorte/service/windows_pipe.py +235 -0
  115. cohorte_engine-1.0.0a1/tests/acceptance/test_cli.py +303 -0
  116. cohorte_engine-1.0.0a1/tests/acceptance/test_qualification_matrix.py +27 -0
  117. cohorte_engine-1.0.0a1/tests/integration/test_agent_events.py +97 -0
  118. cohorte_engine-1.0.0a1/tests/integration/test_alignment.py +156 -0
  119. cohorte_engine-1.0.0a1/tests/integration/test_checks.py +48 -0
  120. cohorte_engine-1.0.0a1/tests/integration/test_context.py +107 -0
  121. cohorte_engine-1.0.0a1/tests/integration/test_controller_sigkill.py +124 -0
  122. cohorte_engine-1.0.0a1/tests/integration/test_database.py +261 -0
  123. cohorte_engine-1.0.0a1/tests/integration/test_degraded_environment.py +71 -0
  124. cohorte_engine-1.0.0a1/tests/integration/test_delivery.py +174 -0
  125. cohorte_engine-1.0.0a1/tests/integration/test_discovery.py +57 -0
  126. cohorte_engine-1.0.0a1/tests/integration/test_figma_design.py +90 -0
  127. cohorte_engine-1.0.0a1/tests/integration/test_fleet.py +210 -0
  128. cohorte_engine-1.0.0a1/tests/integration/test_francois_conformance.py +237 -0
  129. cohorte_engine-1.0.0a1/tests/integration/test_graphify_retrieval.py +54 -0
  130. cohorte_engine-1.0.0a1/tests/integration/test_kanban_metrics.py +162 -0
  131. cohorte_engine-1.0.0a1/tests/integration/test_maintenance.py +243 -0
  132. cohorte_engine-1.0.0a1/tests/integration/test_migration.py +180 -0
  133. cohorte_engine-1.0.0a1/tests/integration/test_multisurface.py +357 -0
  134. cohorte_engine-1.0.0a1/tests/integration/test_patch.py +133 -0
  135. cohorte_engine-1.0.0a1/tests/integration/test_preparation.py +347 -0
  136. cohorte_engine-1.0.0a1/tests/integration/test_protocol.py +366 -0
  137. cohorte_engine-1.0.0a1/tests/integration/test_provider_suspension.py +136 -0
  138. cohorte_engine-1.0.0a1/tests/integration/test_serena_retrieval.py +51 -0
  139. cohorte_engine-1.0.0a1/tests/integration/test_service_host.py +297 -0
  140. cohorte_engine-1.0.0a1/tests/integration/test_vertical.py +287 -0
  141. cohorte_engine-1.0.0a1/tests/integration/test_windows_pipe.py +31 -0
  142. cohorte_engine-1.0.0a1/tests/live/verify_codex_command_sandbox.py +76 -0
  143. cohorte_engine-1.0.0a1/tests/live/verify_codex_permission_retry.py +105 -0
  144. cohorte_engine-1.0.0a1/tests/live/verify_codex_readonly_retry.py +131 -0
  145. cohorte_engine-1.0.0a1/tests/live/verify_figma_snapshot.py +87 -0
  146. cohorte_engine-1.0.0a1/tests/live/verify_graphify_retrieval.py +112 -0
  147. cohorte_engine-1.0.0a1/tests/live/verify_serena_retrieval.py +98 -0
  148. cohorte_engine-1.0.0a1/tests/packaging/fixtures/README.md +7 -0
  149. cohorte_engine-1.0.0a1/tests/packaging/fixtures/cohorte-local-0.1.0a1-source.tar.gz +0 -0
  150. cohorte_engine-1.0.0a1/tests/packaging/verify_clean_install.py +73 -0
  151. cohorte_engine-1.0.0a1/tests/packaging/verify_upgrade.py +200 -0
  152. cohorte_engine-1.0.0a1/tests/test_release_meta.py +85 -0
  153. cohorte_engine-1.0.0a1/tests/unit/test_agent_event_mapping.py +36 -0
  154. cohorte_engine-1.0.0a1/tests/unit/test_auth.py +64 -0
  155. cohorte_engine-1.0.0a1/tests/unit/test_claude_adapter.py +352 -0
  156. cohorte_engine-1.0.0a1/tests/unit/test_cli_errors.py +19 -0
  157. cohorte_engine-1.0.0a1/tests/unit/test_codex_adapter.py +498 -0
  158. cohorte_engine-1.0.0a1/tests/unit/test_delivery_notes.py +35 -0
  159. cohorte_engine-1.0.0a1/tests/unit/test_evidence.py +74 -0
  160. cohorte_engine-1.0.0a1/tests/unit/test_git_adapter.py +34 -0
  161. cohorte_engine-1.0.0a1/tests/unit/test_hosting.py +45 -0
  162. cohorte_engine-1.0.0a1/tests/unit/test_intake.py +45 -0
  163. cohorte_engine-1.0.0a1/tests/unit/test_models.py +194 -0
  164. cohorte_engine-1.0.0a1/tests/unit/test_native_login.py +100 -0
  165. cohorte_engine-1.0.0a1/tests/unit/test_redaction.py +32 -0
  166. cohorte_engine-1.0.0a1/tests/unit/test_scheduler.py +45 -0
  167. cohorte_engine-1.0.0a1/uv.lock +1687 -0
@@ -0,0 +1,29 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ workflow_call:
7
+ jobs:
8
+ test:
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ os: [ubuntu-latest, macos-latest, windows-latest]
13
+ python: ["3.12", "3.13"]
14
+ runs-on: ${{ matrix.os }}
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+ - uses: astral-sh/setup-uv@v6
20
+ with:
21
+ python-version: ${{ matrix.python }}
22
+ - run: uv sync --all-extras
23
+ - run: uv run ruff check .
24
+ - run: uv run ruff format --check .
25
+ - run: uv run mypy
26
+ - run: uv run pytest
27
+ - run: uv build
28
+ - run: uv run python tests/packaging/verify_clean_install.py
29
+ - run: uv run python tests/packaging/verify_upgrade.py
@@ -0,0 +1,88 @@
1
+ name: Release Python Cohorte
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ concurrency:
7
+ group: python-release
8
+ cancel-in-progress: false
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ metadata:
15
+ runs-on: ubuntu-latest
16
+ outputs:
17
+ version: ${{ steps.version.outputs.version }}
18
+ steps:
19
+ - name: Require main branch
20
+ env:
21
+ RELEASE_REF: ${{ github.ref }}
22
+ run: test "$RELEASE_REF" = refs/heads/main
23
+ - uses: actions/checkout@v4
24
+ - uses: astral-sh/setup-uv@v6
25
+ with:
26
+ python-version: '3.12'
27
+ enable-cache: false
28
+ - name: Validate version and release notes
29
+ run: python scripts/release_meta.py check
30
+ - id: version
31
+ run: echo "version=$(python scripts/release_meta.py version)" >> "$GITHUB_OUTPUT"
32
+
33
+ ci:
34
+ needs: metadata
35
+ uses: ./.github/workflows/ci.yml
36
+
37
+ publish:
38
+ needs: [metadata, ci]
39
+ runs-on: ubuntu-latest
40
+ environment: pypi
41
+ permissions:
42
+ contents: write
43
+ id-token: write
44
+ outputs:
45
+ release_url: ${{ steps.release.outputs.url }}
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ - uses: astral-sh/setup-uv@v6
49
+ with:
50
+ python-version: '3.12'
51
+ - name: Build and verify clean installation
52
+ run: |
53
+ uv build --no-sources
54
+ uv run python tests/packaging/verify_clean_install.py
55
+ - name: Publish wheel and source archive to PyPI
56
+ run: uv publish --trusted-publishing always --check-url https://pypi.org/simple/
57
+ - name: Create GitHub prerelease with changelog and artifacts
58
+ id: release
59
+ env:
60
+ GH_TOKEN: ${{ github.token }}
61
+ VERSION: ${{ needs.metadata.outputs.version }}
62
+ run: |
63
+ python scripts/release_meta.py notes --output release-notes.md
64
+ TAG="python-v${VERSION}"
65
+ if ! gh release view "$TAG" >/dev/null 2>&1; then
66
+ if [[ "$VERSION" == *a* || "$VERSION" == *b* || "$VERSION" == *rc* ]]; then
67
+ gh release create "$TAG" dist/* --target "$GITHUB_SHA" --title "Cohorte $VERSION" --notes-file release-notes.md --prerelease
68
+ else
69
+ gh release create "$TAG" dist/* --target "$GITHUB_SHA" --title "Cohorte $VERSION" --notes-file release-notes.md
70
+ fi
71
+ fi
72
+ echo "url=$(gh release view "$TAG" --json url --jq .url)" >> "$GITHUB_OUTPUT"
73
+
74
+ discord:
75
+ needs: publish
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - uses: actions/checkout@v4
79
+ - uses: astral-sh/setup-uv@v6
80
+ with:
81
+ python-version: '3.12'
82
+ enable-cache: false
83
+ - name: Post changelog to the Cohorte Discord thread
84
+ env:
85
+ DISCORD_FORUM_WEBHOOK: ${{ secrets.DISCORD_FORUM_WEBHOOK }}
86
+ DISCORD_THREAD_ID: ${{ secrets.DISCORD_THREAD_ID }}
87
+ RELEASE_URL: ${{ needs.publish.outputs.release_url }}
88
+ run: python scripts/release_meta.py discord --release-url "$RELEASE_URL"
@@ -0,0 +1,13 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ htmlcov/
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+ .DS_Store
13
+ .cohorte/
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ Release notes for the Python Cohorte package. Add a dated section for each published version,
4
+ with the newest version first. Describe the verified scope and known limitations of a dev release.
5
+
6
+ ## Unreleased
7
+
8
+ _No changes recorded yet._
9
+
10
+ ## 1.0.0a1 — 2026-09-23
11
+
12
+ - First scoped preview of the Python Cohorte engine, published as `cohorte-engine` with the `cohorte` CLI. It is separate from the earlier npm package and its version series.
13
+ - Add durable SQLite workflows, isolated worktrees, review and fix gates, Fleet scheduling, V2 import, and local `cohorte/1` JSON-RPC service with event replay and run controls.
14
+ - Add official Codex and Claude SDK adapters, native login handoff, and common redacted turn, tool and usage events. Live provider evidence is currently bounded to the qualified Darwin arm64 accounts and runtimes.
15
+ - Qualify wheel installation and upgrade checks in CI on Ubuntu, macOS and Windows with Python 3.12 and 3.13; GitHub and GitLab delivery have also been exercised on disposable repositories.
16
+ - Scope limits: François's Python-service PR remains open, so real François UI integration is not yet certified. The two-provider model corpus and real-host qualification across all target platforms are not complete. This alpha is not a V2-parity or full-platform support claim.
17
+
18
+ ## 0.1.0a1 — unreleased
19
+
20
+ - Start the Python 3.12 root rewrite with no dependency on former Cohorte implementations.
21
+ - Add strict contracts, a pure reducer, SQLite persistence and immutable artifacts.
22
+ - Add project discovery, readiness/auth gates, conflict-aware scheduling and controlled checks.
23
+ - Add the CLI, JSON-RPC stdio bridge, event replay and operation deduplication.
24
+ - Add Codex subscription inspection and an explicit read-only live verification probe.
25
+ - Certify Codex 0.155.1 read-only enforcement, interruption and session resume on Darwin arm64.
26
+ - Build and verify wheel/sdist packaging while keeping provider support explicitly uncertified.
@@ -0,0 +1,4 @@
1
+ SPDX-License-Identifier: AGPL-3.0-only
2
+
3
+ This project is licensed under the GNU Affero General Public License version 3 only.
4
+ The complete license text is available at https://www.gnu.org/licenses/agpl-3.0.txt.
@@ -0,0 +1,200 @@
1
+ Metadata-Version: 2.5
2
+ Name: cohorte-engine
3
+ Version: 1.0.0a1
4
+ Summary: Local, evidence-driven orchestration for coding agents
5
+ Author: Cohorte contributors
6
+ License: AGPL-3.0-only
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.12
9
+ Requires-Dist: openai-codex==0.155.1
10
+ Requires-Dist: platformdirs<5,>=4.3
11
+ Requires-Dist: pydantic<3,>=2.10
12
+ Requires-Dist: pywin32>=312; sys_platform == 'win32'
13
+ Requires-Dist: pyyaml<7,>=6.0
14
+ Provides-Extra: claude
15
+ Requires-Dist: claude-agent-sdk==0.2.157; extra == 'claude'
16
+ Provides-Extra: dev
17
+ Requires-Dist: mypy<2,>=1.15; extra == 'dev'
18
+ Requires-Dist: pytest-asyncio<1,>=0.25; extra == 'dev'
19
+ Requires-Dist: pytest<9,>=8.3; extra == 'dev'
20
+ Requires-Dist: ruff<1,>=0.11; extra == 'dev'
21
+ Provides-Extra: graphify
22
+ Requires-Dist: graphifyy[mcp]==0.9.66; extra == 'graphify'
23
+ Provides-Extra: serena
24
+ Requires-Dist: mcp==2.2.0; extra == 'serena'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Cohorte V3
28
+
29
+ For Python dev releases, see [the release runbook](docs/RELEASING.md).
30
+
31
+ Cohorte is a local, evidence-driven workflow engine for official coding-agent clients. This
32
+ repository is a Python 3.12 rewrite built at the repository root. It does not depend on the former
33
+ TypeScript/Pi implementations.
34
+
35
+ The current pre-release provides the deterministic core, bounded feature and Patch
36
+ workflows, and overlap-aware Fleet execution:
37
+ strict contracts, a pure workflow reducer, SQLite persistence, immutable artifacts, project
38
+ discovery, DAG validation, isolated Git worktrees, controlled checks, independent read-only review,
39
+ a review/fix loop, a JSON-RPC stdio bridge, and a CLI. Codex authentication and live execution are
40
+ capability-gated. A Claude Agent SDK adapter is available through the optional `claude` dependency
41
+ and `agent_defaults.provider: claude`; a bounded single-surface Claude workflow has passed live
42
+ build, checks and review on Darwin arm64.
43
+ Passive `auth status claude` checks the native CLI without exposing credentials. An explicit
44
+ `auth verify claude --live` probe is available after confirming the account to use.
45
+ The connected native account passed the Claude SDK smoke, structured read, workspace edit,
46
+ outside-write denial, a guarded read-only write denial, and CLI cancellation/pause/resume probes.
47
+ G0 remains partial: the full login interaction and safe native session recovery inside a workflow
48
+ are not yet qualified.
49
+ Both adapters now persist common turn, tool and usage events for workflow runs. The event payloads
50
+ contain provider, phase, access and bounded metadata, without prompts, responses, commands or file
51
+ paths. SDK token accounting can differ, and Claude's reported cost is an estimate rather than a
52
+ provider billing statement.
53
+
54
+ ```bash
55
+ uv sync --all-extras
56
+ uv run cohorte doctor
57
+ uv run cohorte --json init /path/to/project
58
+ uv run cohorte --json status
59
+ uv run pytest
60
+ ```
61
+
62
+ For external context, set `integrations.retrieval.provider` to `serena` or `graphify` in the
63
+ project profile. Serena needs the installed `serena` MCP executable. Graphify-Labs needs the
64
+ `graphify` optional extra and a prebuilt `<repo>/graphify-out/graph.json`; for a code-only graph,
65
+ run `graphify extract <repo> --code-only --no-cluster --out <repo>` explicitly before retrieval.
66
+ Both providers fail visibly when unavailable; file fallback requires
67
+ `integrations.retrieval.fallback_to_files: true`. Figma design snapshots use a file or node URL in
68
+ `integrations.design.source` and a locally supplied `FIGMA_ACCESS_TOKEN` with
69
+ `file_content:read` scope. The token is never part of the profile. To verify a real Figma snapshot
70
+ without printing its contents, run `python tests/live/verify_figma_snapshot.py --source <file-or-node-url>`
71
+ in a shell where the token is already set, or enter it at the hidden prompt.
72
+
73
+ Prepare a feature with independent product, architecture and QA sessions, then approve the exact
74
+ completed spec before freezing it:
75
+
76
+ ```bash
77
+ cohorte --json --data-dir /path/to/data brainstorm PROJECT_ID \
78
+ --feature-id safe-export --idea "Add a safe run export" \
79
+ --answer "Keep data local and require atomic output" \
80
+ --repo /path/to/project --output brief.json --live
81
+ cohorte --json --data-dir /path/to/data spec-freeze-request draft.json \
82
+ --profile project.json --repo /path/to/project
83
+ cohorte --json --data-dir /path/to/data approve REQUEST_ID
84
+ cohorte --json --data-dir /path/to/data spec-freeze draft.json \
85
+ --profile project.json --repo /path/to/project \
86
+ --decision-id DECISION_ID --output frozen.json
87
+ ```
88
+
89
+ The brainstorm keeps each native session reference, contribution and disagreement. Freeze rejects
90
+ incomplete drafts and approvals for a different spec hash, profile, reference set or generated plan.
91
+
92
+ Run the disposable Codex vertical with the included frozen example:
93
+
94
+ ```bash
95
+ cohorte --json loop examples/g1/spec.json \
96
+ --profile examples/g1/profile.json \
97
+ --repo /path/to/disposable/repository \
98
+ --worktrees /tmp/cohorte-worktrees \
99
+ --run-id demo-1 \
100
+ --live
101
+ ```
102
+
103
+ Run several frozen feature specs as an overlap-aware fleet:
104
+
105
+ ```bash
106
+ cohorte --json fleet specs/feature-a.json specs/feature-b.json \
107
+ --profile project.json \
108
+ --repo /path/to/disposable/repository \
109
+ --worktrees /tmp/cohorte-fleet-worktrees \
110
+ --fleet-id release-train-1 \
111
+ --live
112
+ ```
113
+
114
+ Fleet computes the cross-feature dependency graph, parallelizes disjoint features, serializes
115
+ overlapping write sets, integrates each candidate in order and reruns its declared checks after the
116
+ base changes.
117
+
118
+ Capture a ticket, freeze a bounded patch, and run it with a pre-existing regression:
119
+
120
+ ```bash
121
+ cohorte --json --data-dir /path/to/data intake PROJECT_ID --file ticket.txt
122
+ cohorte --json --data-dir /path/to/data patch-spec \
123
+ --source-artifact-id SOURCE_ID --source-revision 1 \
124
+ --profile project.json --patch-id fix-total --title "Fix total" \
125
+ --reproduction "Run the regression test" --observed "It returns 6" \
126
+ --expected "It returns 5" --surface python --write-path calc.py \
127
+ --check regression --in-scope "Correct total" --rollback "Revert calc.py" \
128
+ --output patch.json
129
+ cohorte --json --data-dir /path/to/data patch patch.json \
130
+ --profile project.json --repo /path/to/repository \
131
+ --worktrees /tmp/cohorte-patch-worktrees --run-id patch-1 --live
132
+ ```
133
+
134
+ Patch refuses to build unless every declared automatic regression is red on the original commit.
135
+ The agent can edit only the frozen patch paths; the same checks and an independent review then gate
136
+ the candidate-bound ship request.
137
+
138
+ The command creates a branch and isolated worktree, but does not commit, push, open a pull request,
139
+ or modify the source checkout.
140
+
141
+ Runs checkpoint every completed phase in SQLite. After an interrupted controller process, resume the
142
+ same worktree with:
143
+
144
+ ```bash
145
+ cohorte --json --data-dir /path/to/data resume RUN_ID --live
146
+ ```
147
+
148
+ `pause RUN_ID` and `cancel RUN_ID` are cooperative: an active provider turn finishes, then Cohorte
149
+ records the completed phase boundary and stops before starting another phase.
150
+
151
+ Delivery remains separately authorized:
152
+
153
+ ```bash
154
+ cohorte --json --data-dir /path/to/data approve REQUEST_ID
155
+ cohorte --json --data-dir /path/to/data ship RUN_ID --live
156
+ cohorte --json --data-dir /path/to/data delivery-status RUN_ID --live --watch
157
+ ```
158
+
159
+ `ship` rechecks the candidate hash and remote base, creates a commit with a run marker, pushes without
160
+ force, then confirms the GitHub PR or GitLab MR through the provider CLI. Every effect is journaled
161
+ before execution and reconciled on retry. It never merges or deploys.
162
+
163
+ When `integrations.release_notes.enabled` is `true` in the project profile, `ship` appends a
164
+ release-notes section to the PR/MR description. Its optional `heading` defaults to `Release notes`;
165
+ its optional `template` defaults to `{title}\n\n{problem}`. Templates may use only `{title}`,
166
+ `{problem}`, and `{acceptance}` (a bulleted list). Notes are omitted when the integration is
167
+ disabled, and do not modify the reviewed candidate.
168
+
169
+ Inspect and apply a bounded V2 metadata migration with an explicit rollback point:
170
+
171
+ ```bash
172
+ cohorte --json --data-dir /path/to/data migrate \
173
+ --from-v2 /path/to/v2-copy --plan migration-plan.json
174
+ cohorte --json --data-dir /path/to/data migrate --apply migration-plan.json
175
+ cohorte --json --data-dir /path/to/data migrate --rollback /path/from/apply/backup.bak
176
+ ```
177
+
178
+ The plan contains exact hashes, mappings, exclusions, losses and ambiguities. Apply fails if a
179
+ source changed, imports no credentials or active run, and stores specs as historical artifacts that
180
+ require V3 validation before build.
181
+
182
+ Run the persistent local service used by protocol clients:
183
+
184
+ ```bash
185
+ cohorte --json --data-dir /path/to/data service start
186
+ cohorte --json --data-dir /path/to/data service status
187
+ cohorte --json --data-dir /path/to/data service stop
188
+ ```
189
+
190
+ On POSIX this uses a private Unix socket and verifies the connecting process belongs to the same
191
+ user. On Windows it uses a local named pipe with a DACL restricted to the current user SID. No
192
+ network port is opened. The lifecycle passes on GitHub-hosted Windows 3.12 and 3.13; release support
193
+ still requires real-host and slow-client qualification.
194
+
195
+ By default, Cohorte stores configuration and state outside target repositories using platform
196
+ standard directories. Pass `--config-dir` and `--data-dir` for isolated automation. Cohorte never
197
+ stores provider tokens.
198
+
199
+ See [the implementation status](docs/IMPLEMENTATION.md), [qualification matrix](docs/qualification/README.md)
200
+ and [protocol reference](docs/PROTOCOL.md).
@@ -0,0 +1,174 @@
1
+ # Cohorte V3
2
+
3
+ For Python dev releases, see [the release runbook](docs/RELEASING.md).
4
+
5
+ Cohorte is a local, evidence-driven workflow engine for official coding-agent clients. This
6
+ repository is a Python 3.12 rewrite built at the repository root. It does not depend on the former
7
+ TypeScript/Pi implementations.
8
+
9
+ The current pre-release provides the deterministic core, bounded feature and Patch
10
+ workflows, and overlap-aware Fleet execution:
11
+ strict contracts, a pure workflow reducer, SQLite persistence, immutable artifacts, project
12
+ discovery, DAG validation, isolated Git worktrees, controlled checks, independent read-only review,
13
+ a review/fix loop, a JSON-RPC stdio bridge, and a CLI. Codex authentication and live execution are
14
+ capability-gated. A Claude Agent SDK adapter is available through the optional `claude` dependency
15
+ and `agent_defaults.provider: claude`; a bounded single-surface Claude workflow has passed live
16
+ build, checks and review on Darwin arm64.
17
+ Passive `auth status claude` checks the native CLI without exposing credentials. An explicit
18
+ `auth verify claude --live` probe is available after confirming the account to use.
19
+ The connected native account passed the Claude SDK smoke, structured read, workspace edit,
20
+ outside-write denial, a guarded read-only write denial, and CLI cancellation/pause/resume probes.
21
+ G0 remains partial: the full login interaction and safe native session recovery inside a workflow
22
+ are not yet qualified.
23
+ Both adapters now persist common turn, tool and usage events for workflow runs. The event payloads
24
+ contain provider, phase, access and bounded metadata, without prompts, responses, commands or file
25
+ paths. SDK token accounting can differ, and Claude's reported cost is an estimate rather than a
26
+ provider billing statement.
27
+
28
+ ```bash
29
+ uv sync --all-extras
30
+ uv run cohorte doctor
31
+ uv run cohorte --json init /path/to/project
32
+ uv run cohorte --json status
33
+ uv run pytest
34
+ ```
35
+
36
+ For external context, set `integrations.retrieval.provider` to `serena` or `graphify` in the
37
+ project profile. Serena needs the installed `serena` MCP executable. Graphify-Labs needs the
38
+ `graphify` optional extra and a prebuilt `<repo>/graphify-out/graph.json`; for a code-only graph,
39
+ run `graphify extract <repo> --code-only --no-cluster --out <repo>` explicitly before retrieval.
40
+ Both providers fail visibly when unavailable; file fallback requires
41
+ `integrations.retrieval.fallback_to_files: true`. Figma design snapshots use a file or node URL in
42
+ `integrations.design.source` and a locally supplied `FIGMA_ACCESS_TOKEN` with
43
+ `file_content:read` scope. The token is never part of the profile. To verify a real Figma snapshot
44
+ without printing its contents, run `python tests/live/verify_figma_snapshot.py --source <file-or-node-url>`
45
+ in a shell where the token is already set, or enter it at the hidden prompt.
46
+
47
+ Prepare a feature with independent product, architecture and QA sessions, then approve the exact
48
+ completed spec before freezing it:
49
+
50
+ ```bash
51
+ cohorte --json --data-dir /path/to/data brainstorm PROJECT_ID \
52
+ --feature-id safe-export --idea "Add a safe run export" \
53
+ --answer "Keep data local and require atomic output" \
54
+ --repo /path/to/project --output brief.json --live
55
+ cohorte --json --data-dir /path/to/data spec-freeze-request draft.json \
56
+ --profile project.json --repo /path/to/project
57
+ cohorte --json --data-dir /path/to/data approve REQUEST_ID
58
+ cohorte --json --data-dir /path/to/data spec-freeze draft.json \
59
+ --profile project.json --repo /path/to/project \
60
+ --decision-id DECISION_ID --output frozen.json
61
+ ```
62
+
63
+ The brainstorm keeps each native session reference, contribution and disagreement. Freeze rejects
64
+ incomplete drafts and approvals for a different spec hash, profile, reference set or generated plan.
65
+
66
+ Run the disposable Codex vertical with the included frozen example:
67
+
68
+ ```bash
69
+ cohorte --json loop examples/g1/spec.json \
70
+ --profile examples/g1/profile.json \
71
+ --repo /path/to/disposable/repository \
72
+ --worktrees /tmp/cohorte-worktrees \
73
+ --run-id demo-1 \
74
+ --live
75
+ ```
76
+
77
+ Run several frozen feature specs as an overlap-aware fleet:
78
+
79
+ ```bash
80
+ cohorte --json fleet specs/feature-a.json specs/feature-b.json \
81
+ --profile project.json \
82
+ --repo /path/to/disposable/repository \
83
+ --worktrees /tmp/cohorte-fleet-worktrees \
84
+ --fleet-id release-train-1 \
85
+ --live
86
+ ```
87
+
88
+ Fleet computes the cross-feature dependency graph, parallelizes disjoint features, serializes
89
+ overlapping write sets, integrates each candidate in order and reruns its declared checks after the
90
+ base changes.
91
+
92
+ Capture a ticket, freeze a bounded patch, and run it with a pre-existing regression:
93
+
94
+ ```bash
95
+ cohorte --json --data-dir /path/to/data intake PROJECT_ID --file ticket.txt
96
+ cohorte --json --data-dir /path/to/data patch-spec \
97
+ --source-artifact-id SOURCE_ID --source-revision 1 \
98
+ --profile project.json --patch-id fix-total --title "Fix total" \
99
+ --reproduction "Run the regression test" --observed "It returns 6" \
100
+ --expected "It returns 5" --surface python --write-path calc.py \
101
+ --check regression --in-scope "Correct total" --rollback "Revert calc.py" \
102
+ --output patch.json
103
+ cohorte --json --data-dir /path/to/data patch patch.json \
104
+ --profile project.json --repo /path/to/repository \
105
+ --worktrees /tmp/cohorte-patch-worktrees --run-id patch-1 --live
106
+ ```
107
+
108
+ Patch refuses to build unless every declared automatic regression is red on the original commit.
109
+ The agent can edit only the frozen patch paths; the same checks and an independent review then gate
110
+ the candidate-bound ship request.
111
+
112
+ The command creates a branch and isolated worktree, but does not commit, push, open a pull request,
113
+ or modify the source checkout.
114
+
115
+ Runs checkpoint every completed phase in SQLite. After an interrupted controller process, resume the
116
+ same worktree with:
117
+
118
+ ```bash
119
+ cohorte --json --data-dir /path/to/data resume RUN_ID --live
120
+ ```
121
+
122
+ `pause RUN_ID` and `cancel RUN_ID` are cooperative: an active provider turn finishes, then Cohorte
123
+ records the completed phase boundary and stops before starting another phase.
124
+
125
+ Delivery remains separately authorized:
126
+
127
+ ```bash
128
+ cohorte --json --data-dir /path/to/data approve REQUEST_ID
129
+ cohorte --json --data-dir /path/to/data ship RUN_ID --live
130
+ cohorte --json --data-dir /path/to/data delivery-status RUN_ID --live --watch
131
+ ```
132
+
133
+ `ship` rechecks the candidate hash and remote base, creates a commit with a run marker, pushes without
134
+ force, then confirms the GitHub PR or GitLab MR through the provider CLI. Every effect is journaled
135
+ before execution and reconciled on retry. It never merges or deploys.
136
+
137
+ When `integrations.release_notes.enabled` is `true` in the project profile, `ship` appends a
138
+ release-notes section to the PR/MR description. Its optional `heading` defaults to `Release notes`;
139
+ its optional `template` defaults to `{title}\n\n{problem}`. Templates may use only `{title}`,
140
+ `{problem}`, and `{acceptance}` (a bulleted list). Notes are omitted when the integration is
141
+ disabled, and do not modify the reviewed candidate.
142
+
143
+ Inspect and apply a bounded V2 metadata migration with an explicit rollback point:
144
+
145
+ ```bash
146
+ cohorte --json --data-dir /path/to/data migrate \
147
+ --from-v2 /path/to/v2-copy --plan migration-plan.json
148
+ cohorte --json --data-dir /path/to/data migrate --apply migration-plan.json
149
+ cohorte --json --data-dir /path/to/data migrate --rollback /path/from/apply/backup.bak
150
+ ```
151
+
152
+ The plan contains exact hashes, mappings, exclusions, losses and ambiguities. Apply fails if a
153
+ source changed, imports no credentials or active run, and stores specs as historical artifacts that
154
+ require V3 validation before build.
155
+
156
+ Run the persistent local service used by protocol clients:
157
+
158
+ ```bash
159
+ cohorte --json --data-dir /path/to/data service start
160
+ cohorte --json --data-dir /path/to/data service status
161
+ cohorte --json --data-dir /path/to/data service stop
162
+ ```
163
+
164
+ On POSIX this uses a private Unix socket and verifies the connecting process belongs to the same
165
+ user. On Windows it uses a local named pipe with a DACL restricted to the current user SID. No
166
+ network port is opened. The lifecycle passes on GitHub-hosted Windows 3.12 and 3.13; release support
167
+ still requires real-host and slow-client qualification.
168
+
169
+ By default, Cohorte stores configuration and state outside target repositories using platform
170
+ standard directories. Pass `--config-dir` and `--data-dir` for isolated automation. Cohorte never
171
+ stores provider tokens.
172
+
173
+ See [the implementation status](docs/IMPLEMENTATION.md), [qualification matrix](docs/qualification/README.md)
174
+ and [protocol reference](docs/PROTOCOL.md).