sessionyard 0.7.0__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 (183) hide show
  1. sessionyard-0.7.0/.dockerignore +23 -0
  2. sessionyard-0.7.0/.github/ISSUE_TEMPLATE/bug_report.yml +56 -0
  3. sessionyard-0.7.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. sessionyard-0.7.0/.github/ISSUE_TEMPLATE/feature_request.yml +31 -0
  5. sessionyard-0.7.0/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  6. sessionyard-0.7.0/.github/dependabot.yml +26 -0
  7. sessionyard-0.7.0/.github/workflows/automerge.yml +59 -0
  8. sessionyard-0.7.0/.github/workflows/ci.yml +196 -0
  9. sessionyard-0.7.0/.github/workflows/publish.yml +74 -0
  10. sessionyard-0.7.0/.github/workflows/release-please.yml +39 -0
  11. sessionyard-0.7.0/.github/workflows/review-gate.yml +42 -0
  12. sessionyard-0.7.0/.github/workflows/review-signal.yml +32 -0
  13. sessionyard-0.7.0/.gitignore +28 -0
  14. sessionyard-0.7.0/.gitleaks.toml +30 -0
  15. sessionyard-0.7.0/.release-please-manifest.json +3 -0
  16. sessionyard-0.7.0/AGENTS.md +92 -0
  17. sessionyard-0.7.0/CHANGELOG.md +122 -0
  18. sessionyard-0.7.0/CLAUDE.md +1 -0
  19. sessionyard-0.7.0/CODE_OF_CONDUCT.md +133 -0
  20. sessionyard-0.7.0/CONTRIBUTING.md +164 -0
  21. sessionyard-0.7.0/Dockerfile +49 -0
  22. sessionyard-0.7.0/LICENSE +661 -0
  23. sessionyard-0.7.0/PKG-INFO +314 -0
  24. sessionyard-0.7.0/README.md +280 -0
  25. sessionyard-0.7.0/SECURITY.md +42 -0
  26. sessionyard-0.7.0/agent_chat/001_core.sql +172 -0
  27. sessionyard-0.7.0/agent_chat/002_coordination.sql +63 -0
  28. sessionyard-0.7.0/agent_chat/003_harness_admission.sql +10 -0
  29. sessionyard-0.7.0/agent_chat/004_session_titles.sql +3 -0
  30. sessionyard-0.7.0/agent_chat/005_viewer.sql +9 -0
  31. sessionyard-0.7.0/agent_chat/006_quotas.sql +6 -0
  32. sessionyard-0.7.0/agent_chat/007_sender_receipts.sql +20 -0
  33. sessionyard-0.7.0/agent_chat/008_direct_threads.sql +49 -0
  34. sessionyard-0.7.0/agent_chat/009_pm_mark.sql +23 -0
  35. sessionyard-0.7.0/agent_chat/010_quota_backfill.sql +12 -0
  36. sessionyard-0.7.0/agent_chat/011_roles_and_work.sql +31 -0
  37. sessionyard-0.7.0/agent_chat/__init__.py +1 -0
  38. sessionyard-0.7.0/agent_chat/adapter.py +414 -0
  39. sessionyard-0.7.0/agent_chat/admin.py +524 -0
  40. sessionyard-0.7.0/agent_chat/api.py +641 -0
  41. sessionyard-0.7.0/agent_chat/auth.py +226 -0
  42. sessionyard-0.7.0/agent_chat/browser.py +118 -0
  43. sessionyard-0.7.0/agent_chat/browser_verify.py +487 -0
  44. sessionyard-0.7.0/agent_chat/browser_verify_artifacts.py +280 -0
  45. sessionyard-0.7.0/agent_chat/browser_verify_checks.py +236 -0
  46. sessionyard-0.7.0/agent_chat/browser_verify_run.py +523 -0
  47. sessionyard-0.7.0/agent_chat/cli.py +532 -0
  48. sessionyard-0.7.0/agent_chat/client.py +272 -0
  49. sessionyard-0.7.0/agent_chat/deliveries.py +555 -0
  50. sessionyard-0.7.0/agent_chat/events.py +48 -0
  51. sessionyard-0.7.0/agent_chat/feed.py +193 -0
  52. sessionyard-0.7.0/agent_chat/http_boundary.py +154 -0
  53. sessionyard-0.7.0/agent_chat/instance_client.py +349 -0
  54. sessionyard-0.7.0/agent_chat/instance_file.py +207 -0
  55. sessionyard-0.7.0/agent_chat/instance_worker.py +326 -0
  56. sessionyard-0.7.0/agent_chat/mcp/__init__.py +5 -0
  57. sessionyard-0.7.0/agent_chat/mcp/__main__.py +39 -0
  58. sessionyard-0.7.0/agent_chat/mcp/app.py +183 -0
  59. sessionyard-0.7.0/agent_chat/mcp/auth.py +67 -0
  60. sessionyard-0.7.0/agent_chat/mcp/config.py +55 -0
  61. sessionyard-0.7.0/agent_chat/mcp/tools.py +295 -0
  62. sessionyard-0.7.0/agent_chat/metrics.py +60 -0
  63. sessionyard-0.7.0/agent_chat/models.py +430 -0
  64. sessionyard-0.7.0/agent_chat/openapi.py +322 -0
  65. sessionyard-0.7.0/agent_chat/producer.py +208 -0
  66. sessionyard-0.7.0/agent_chat/protocol.py +71 -0
  67. sessionyard-0.7.0/agent_chat/publication.py +252 -0
  68. sessionyard-0.7.0/agent_chat/receipts.py +225 -0
  69. sessionyard-0.7.0/agent_chat/retention.py +154 -0
  70. sessionyard-0.7.0/agent_chat/roles.py +153 -0
  71. sessionyard-0.7.0/agent_chat/rooms.py +179 -0
  72. sessionyard-0.7.0/agent_chat/sessions.py +340 -0
  73. sessionyard-0.7.0/agent_chat/skills/agent-chat/SKILL.md +64 -0
  74. sessionyard-0.7.0/agent_chat/state.py +144 -0
  75. sessionyard-0.7.0/agent_chat/storage.py +110 -0
  76. sessionyard-0.7.0/agent_chat/threads.py +50 -0
  77. sessionyard-0.7.0/agent_chat/web/Manrope-OFL.txt +93 -0
  78. sessionyard-0.7.0/agent_chat/web/Manrope-Variable.ttf +0 -0
  79. sessionyard-0.7.0/agent_chat/web/chat.css +936 -0
  80. sessionyard-0.7.0/agent_chat/web/chat.js +1922 -0
  81. sessionyard-0.7.0/agent_chat/web/i18n.js +340 -0
  82. sessionyard-0.7.0/agent_chat/web/index.html +264 -0
  83. sessionyard-0.7.0/deploy/.env.example +5 -0
  84. sessionyard-0.7.0/deploy/compose.yaml +109 -0
  85. sessionyard-0.7.0/deploy/config/mcp.example.json +7 -0
  86. sessionyard-0.7.0/deploy/config/server.example.json +8 -0
  87. sessionyard-0.7.0/deploy/observability/README.md +58 -0
  88. sessionyard-0.7.0/deploy/observability/agent-chat-alerts.example.yml +51 -0
  89. sessionyard-0.7.0/deploy/observability/alloy.example.alloy +82 -0
  90. sessionyard-0.7.0/deploy/podman/agent-chat-mcp.container +31 -0
  91. sessionyard-0.7.0/deploy/podman/agent-chat-migrate.container +29 -0
  92. sessionyard-0.7.0/deploy/podman/agent-chat.container +36 -0
  93. sessionyard-0.7.0/deploy/podman/agent-chat.network +2 -0
  94. sessionyard-0.7.0/deploy/traefik/dynamic.example.yml +36 -0
  95. sessionyard-0.7.0/docs/api.md +41 -0
  96. sessionyard-0.7.0/docs/containers.md +301 -0
  97. sessionyard-0.7.0/docs/openapi.json +3682 -0
  98. sessionyard-0.7.0/docs/podman.md +418 -0
  99. sessionyard-0.7.0/docs/self-hosting.md +402 -0
  100. sessionyard-0.7.0/integrations/README.md +59 -0
  101. sessionyard-0.7.0/integrations/deepseek/README.md +198 -0
  102. sessionyard-0.7.0/integrations/deepseek/extensions/agent-chat.js +290 -0
  103. sessionyard-0.7.0/integrations/deepseek/lib/config.js +43 -0
  104. sessionyard-0.7.0/integrations/deepseek/lib/delivery.js +272 -0
  105. sessionyard-0.7.0/integrations/deepseek/lib/lifecycle.js +411 -0
  106. sessionyard-0.7.0/integrations/deepseek/lib/notice.js +71 -0
  107. sessionyard-0.7.0/integrations/deepseek/lib/policy.js +50 -0
  108. sessionyard-0.7.0/integrations/deepseek/lib/worker.js +148 -0
  109. sessionyard-0.7.0/integrations/deepseek/package.json +20 -0
  110. sessionyard-0.7.0/integrations/deepseek/test/config.test.js +111 -0
  111. sessionyard-0.7.0/integrations/deepseek/test/delivery.test.js +294 -0
  112. sessionyard-0.7.0/integrations/deepseek/test/lifecycle.test.js +441 -0
  113. sessionyard-0.7.0/integrations/deepseek/test/notice.test.js +64 -0
  114. sessionyard-0.7.0/integrations/deepseek/test/plugin.test.js +261 -0
  115. sessionyard-0.7.0/integrations/deepseek/test/policy.test.js +77 -0
  116. sessionyard-0.7.0/integrations/deepseek/test/worker.test.js +97 -0
  117. sessionyard-0.7.0/integrations/pi/README.md +124 -0
  118. sessionyard-0.7.0/integrations/pi/extensions/agent-chat.js +10 -0
  119. sessionyard-0.7.0/integrations/pi/lib/config.js +44 -0
  120. sessionyard-0.7.0/integrations/pi/lib/lifecycle.js +399 -0
  121. sessionyard-0.7.0/integrations/pi/lib/notice.js +71 -0
  122. sessionyard-0.7.0/integrations/pi/lib/policy.js +50 -0
  123. sessionyard-0.7.0/integrations/pi/lib/worker.js +147 -0
  124. sessionyard-0.7.0/integrations/pi/package.json +18 -0
  125. sessionyard-0.7.0/integrations/pi/test/config.test.js +66 -0
  126. sessionyard-0.7.0/integrations/pi/test/lifecycle.test.js +327 -0
  127. sessionyard-0.7.0/integrations/pi/test/policy.test.js +69 -0
  128. sessionyard-0.7.0/integrations/pi/test/worker.test.js +73 -0
  129. sessionyard-0.7.0/openspec/config.yaml +22 -0
  130. sessionyard-0.7.0/pyproject.toml +105 -0
  131. sessionyard-0.7.0/release-please-config.json +27 -0
  132. sessionyard-0.7.0/ruff.toml +40 -0
  133. sessionyard-0.7.0/scripts/check_estate_identifiers.py +134 -0
  134. sessionyard-0.7.0/scripts/export_openapi.py +17 -0
  135. sessionyard-0.7.0/scripts/github_pr_automation.py +320 -0
  136. sessionyard-0.7.0/scripts/pr_policy.py +231 -0
  137. sessionyard-0.7.0/tests/agent_chat/conftest.py +646 -0
  138. sessionyard-0.7.0/tests/agent_chat/http_server_fixture.py +50 -0
  139. sessionyard-0.7.0/tests/agent_chat/postgres_binaries.py +39 -0
  140. sessionyard-0.7.0/tests/agent_chat/test_adapter.py +424 -0
  141. sessionyard-0.7.0/tests/agent_chat/test_admin.py +1324 -0
  142. sessionyard-0.7.0/tests/agent_chat/test_api.py +576 -0
  143. sessionyard-0.7.0/tests/agent_chat/test_browser.py +258 -0
  144. sessionyard-0.7.0/tests/agent_chat/test_browser_verify.py +1657 -0
  145. sessionyard-0.7.0/tests/agent_chat/test_browser_verify_integration.py +124 -0
  146. sessionyard-0.7.0/tests/agent_chat/test_cli.py +941 -0
  147. sessionyard-0.7.0/tests/agent_chat/test_cli_coordination.py +230 -0
  148. sessionyard-0.7.0/tests/agent_chat/test_client_boundary.py +66 -0
  149. sessionyard-0.7.0/tests/agent_chat/test_client_deadline.py +422 -0
  150. sessionyard-0.7.0/tests/agent_chat/test_coordination.py +329 -0
  151. sessionyard-0.7.0/tests/agent_chat/test_database_teardown.py +58 -0
  152. sessionyard-0.7.0/tests/agent_chat/test_deliveries.py +1050 -0
  153. sessionyard-0.7.0/tests/agent_chat/test_direct_threads.py +732 -0
  154. sessionyard-0.7.0/tests/agent_chat/test_feed.py +461 -0
  155. sessionyard-0.7.0/tests/agent_chat/test_harness_admission.py +85 -0
  156. sessionyard-0.7.0/tests/agent_chat/test_http_boundary.py +124 -0
  157. sessionyard-0.7.0/tests/agent_chat/test_instance_client.py +596 -0
  158. sessionyard-0.7.0/tests/agent_chat/test_instance_client_bodies.py +67 -0
  159. sessionyard-0.7.0/tests/agent_chat/test_instance_file.py +196 -0
  160. sessionyard-0.7.0/tests/agent_chat/test_instance_worker.py +1044 -0
  161. sessionyard-0.7.0/tests/agent_chat/test_mcp.py +584 -0
  162. sessionyard-0.7.0/tests/agent_chat/test_metrics.py +15 -0
  163. sessionyard-0.7.0/tests/agent_chat/test_pm_mark.py +548 -0
  164. sessionyard-0.7.0/tests/agent_chat/test_postgres_binaries.py +70 -0
  165. sessionyard-0.7.0/tests/agent_chat/test_producer.py +255 -0
  166. sessionyard-0.7.0/tests/agent_chat/test_publication.py +491 -0
  167. sessionyard-0.7.0/tests/agent_chat/test_quotas.py +369 -0
  168. sessionyard-0.7.0/tests/agent_chat/test_receipts.py +467 -0
  169. sessionyard-0.7.0/tests/agent_chat/test_retention.py +428 -0
  170. sessionyard-0.7.0/tests/agent_chat/test_roles.py +373 -0
  171. sessionyard-0.7.0/tests/agent_chat/test_sender_receipts.py +323 -0
  172. sessionyard-0.7.0/tests/agent_chat/test_session_titles.py +95 -0
  173. sessionyard-0.7.0/tests/agent_chat/test_state.py +473 -0
  174. sessionyard-0.7.0/tests/agent_chat/test_threads.py +311 -0
  175. sessionyard-0.7.0/tests/agent_chat/test_ui.py +3108 -0
  176. sessionyard-0.7.0/tests/agent_chat/test_viewer.py +695 -0
  177. sessionyard-0.7.0/tests/agent_chat/test_work.py +203 -0
  178. sessionyard-0.7.0/tests/test_deploy.py +214 -0
  179. sessionyard-0.7.0/tests/test_estate_identifier_scan.py +52 -0
  180. sessionyard-0.7.0/tests/test_openapi.py +62 -0
  181. sessionyard-0.7.0/tests/test_pr_policy.py +83 -0
  182. sessionyard-0.7.0/tests/test_workflow_policy.py +472 -0
  183. sessionyard-0.7.0/uv.lock +1882 -0
@@ -0,0 +1,23 @@
1
+ .git
2
+ .github
3
+ .gitignore
4
+ .venv
5
+ .playwright
6
+ .pytest_cache
7
+ .ruff_cache
8
+ .cache
9
+ docs
10
+ tests
11
+ deploy
12
+ **/__pycache__
13
+ **/*.pyc
14
+ *.egg-info
15
+ dist
16
+ build
17
+ .coverage
18
+ .env
19
+ .env.*
20
+ *.sqlite
21
+ *.sqlite-*
22
+ *.sqlite3
23
+ *.sqlite3-*
@@ -0,0 +1,56 @@
1
+ name: Bug report
2
+ description: Report a defect in the Agent Chat service or its clients.
3
+ title: "[bug] "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Do not include deployment details, secrets, tokens or personal data.
10
+ Use synthetic values and redact logs before posting.
11
+ - type: textarea
12
+ id: summary
13
+ attributes:
14
+ label: Summary
15
+ description: What failed, and where.
16
+ validations:
17
+ required: true
18
+ - type: input
19
+ id: version
20
+ attributes:
21
+ label: Version
22
+ placeholder: 0.1.0 or commit SHA
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: expected
27
+ attributes:
28
+ label: Expected behaviour
29
+ - type: textarea
30
+ id: actual
31
+ attributes:
32
+ label: Actual behaviour
33
+ - type: textarea
34
+ id: reproduction
35
+ attributes:
36
+ label: Reproduction
37
+ description: Minimal steps or a synthetic reproduction.
38
+ validations:
39
+ required: true
40
+ - type: input
41
+ id: environment
42
+ attributes:
43
+ label: Environment
44
+ description: Python version, PostgreSQL version, OS.
45
+ - type: textarea
46
+ id: logs
47
+ attributes:
48
+ label: Logs
49
+ description: Optional. Redact before posting.
50
+ - type: checkboxes
51
+ id: confirm
52
+ attributes:
53
+ label: Confirmation
54
+ options:
55
+ - label: I removed credentials, private addresses and deployment details from this report.
56
+ required: true
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Report a vulnerability
4
+ url: https://github.com/mikomiel/agent-chat/security/advisories/new
5
+ about: Report vulnerabilities privately; never in a public issue.
6
+ - name: Contributing guide
7
+ url: https://github.com/mikomiel/agent-chat/blob/main/CONTRIBUTING.md
8
+ about: Read the contribution and review workflow before opening a pull request.
@@ -0,0 +1,31 @@
1
+ name: Feature request
2
+ description: Propose a change in behaviour or a new capability.
3
+ title: "[feature] "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Behaviour changes start from an issue before a pull request.
10
+ - type: textarea
11
+ id: problem
12
+ attributes:
13
+ label: Problem
14
+ description: What problem should this solve?
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: proposal
19
+ attributes:
20
+ label: Proposal
21
+ validations:
22
+ required: true
23
+ - type: textarea
24
+ id: alternatives
25
+ attributes:
26
+ label: Alternatives considered
27
+ - type: textarea
28
+ id: scope
29
+ attributes:
30
+ label: Out of scope
31
+ description: What is explicitly out of scope for this request?
@@ -0,0 +1,20 @@
1
+ ## Summary
2
+
3
+ <!-- What changed and why. -->
4
+
5
+ ## Linked issue
6
+
7
+ <!-- Closes # -->
8
+
9
+ ## Checks run
10
+
11
+ - `uv run ruff check .`
12
+ - `uv run ty check`
13
+ - `uv run python -m pytest -q`
14
+
15
+ ## Checklist
16
+
17
+ - [ ] Tests added or updated for behaviour changes.
18
+ - [ ] No credentials, private addresses or deployment details.
19
+ - [ ] `CHANGELOG.md` updated for user-visible changes.
20
+ - [ ] The change touches one decision and does not include unrelated refactors.
@@ -0,0 +1,26 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: github-actions
5
+ directory: /
6
+ schedule:
7
+ interval: weekly
8
+ open-pull-requests-limit: 5
9
+ labels:
10
+ - dependencies
11
+ groups:
12
+ github-actions:
13
+ patterns:
14
+ - "*"
15
+
16
+ - package-ecosystem: uv
17
+ directory: /
18
+ schedule:
19
+ interval: weekly
20
+ open-pull-requests-limit: 5
21
+ labels:
22
+ - dependencies
23
+ groups:
24
+ python-dependencies:
25
+ patterns:
26
+ - "*"
@@ -0,0 +1,59 @@
1
+ # Repository automation, not a standing GitHub --auto order or an author action.
2
+ # Only default-branch definitions/scripts run with this token. Every candidate
3
+ # is re-read; immutable refs, all required checks, independent current approval
4
+ # and the sensitive-path guard must pass. GitHub strict protection is the
5
+ # server-side guard against a base advance after the final read.
6
+ name: automerge
7
+
8
+ on:
9
+ workflow_run:
10
+ workflows: [CI, review-gate]
11
+ types: [completed]
12
+ schedule:
13
+ - cron: '*/30 * * * *'
14
+
15
+ permissions:
16
+ contents: write
17
+ pull-requests: write
18
+ # This workflow's token performs the merge, and GitHub closes a pull request's
19
+ # linked issues only for the identity that holds `issues: write`; without it the
20
+ # auto-close is skipped silently and the tracking issue stays open. Nothing here
21
+ # parses the body -- the close is GitHub's own, from its existing keyword rules.
22
+ issues: write
23
+ checks: read
24
+ statuses: read
25
+
26
+ concurrency:
27
+ group: automerge
28
+ cancel-in-progress: false
29
+
30
+ jobs:
31
+ merge:
32
+ # The only fact the release workflow needs. A sweep or a gate pass that
33
+ # merges nothing leaves it "false", so it costs no release run.
34
+ outputs:
35
+ merged: ${{ steps.merge.outputs.merged }}
36
+ runs-on: ubuntu-24.04
37
+ timeout-minutes: 10
38
+ steps:
39
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40
+ with:
41
+ ref: ${{ github.event.repository.default_branch }}
42
+ persist-credentials: false
43
+ - name: Revalidate and merge at most one eligible ordinary pull request
44
+ id: merge
45
+ env:
46
+ GH_TOKEN: ${{ github.token }}
47
+ run: python3 scripts/github_pr_automation.py merge --apply --github-output "$GITHUB_OUTPUT"
48
+
49
+ release:
50
+ # Called, not observed: a `workflow_run` trigger on this workflow fired on
51
+ # every completion, merged or not, which cost one release run per sweep and
52
+ # per gate pass.
53
+ needs: merge
54
+ if: needs.merge.outputs.merged == 'true'
55
+ uses: ./.github/workflows/release-please.yml
56
+ secrets: inherit
57
+ permissions:
58
+ contents: write
59
+ pull-requests: write
@@ -0,0 +1,196 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ['v*']
7
+ pull_request:
8
+
9
+ concurrency:
10
+ group: ci-${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ checks:
18
+ name: checks
19
+ runs-on: ubuntu-24.04
20
+ timeout-minutes: 45
21
+ env:
22
+ # The suite starts its own disposable cluster from these server binaries;
23
+ # no PostgreSQL server runs on the host. Ubuntu 24.04 ships 16.
24
+ PG_TEST_BIN_DIR: /usr/lib/postgresql/16/bin
25
+ # Explicit because the browser fixture resets HOME for the child.
26
+ PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.cache/ms-playwright
27
+ steps:
28
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29
+ with:
30
+ persist-credentials: false
31
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
32
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
33
+ with:
34
+ python-version: '3.12'
35
+ - name: Install PostgreSQL server binaries
36
+ run: |
37
+ sudo apt-get update
38
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postgresql-16
39
+ - name: Install pinned uv
40
+ run: python -m pip install --disable-pip-version-check uv==0.13.8
41
+ - name: Sync the locked environment
42
+ run: uv sync --frozen
43
+ - name: Lockfile is current
44
+ # release-please bumps pyproject.toml and, through release-please-config.json, uv.lock.
45
+ # `uv sync --frozen` installs the lock as written, so a release that skipped the lock
46
+ # would leave main stale while CI stayed green; this fails that release PR instead.
47
+ run: uv lock --check
48
+ - name: Install pinned Playwright Chromium
49
+ run: uv run python -m playwright install --with-deps chromium
50
+ - name: Lint
51
+ run: uv run ruff check .
52
+ - name: Type check
53
+ # Pinned in the dev group; `[tool.ty]` in pyproject.toml owns the rules and the checked source.
54
+ run: uv run ty check
55
+ - name: Test
56
+ run: uv run python -m pytest -q -n 4 --durations=15
57
+
58
+ checks-python-3-11:
59
+ name: checks-python-3.11
60
+ runs-on: ubuntu-24.04
61
+ timeout-minutes: 45
62
+ env:
63
+ PG_TEST_BIN_DIR: /usr/lib/postgresql/16/bin
64
+ PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.cache/ms-playwright
65
+ UV_PYTHON: '3.11'
66
+ steps:
67
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
68
+ with:
69
+ persist-credentials: false
70
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
71
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
72
+ with:
73
+ python-version: '3.11'
74
+ - name: Install PostgreSQL server binaries
75
+ run: |
76
+ sudo apt-get update
77
+ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends postgresql-16
78
+ - name: Install pinned uv
79
+ run: python -m pip install --disable-pip-version-check uv==0.13.8
80
+ - name: Sync the locked environment
81
+ run: uv sync --frozen
82
+ - name: Install pinned Playwright Chromium
83
+ run: uv run python -m playwright install --with-deps chromium
84
+ - name: Lint
85
+ run: uv run ruff check .
86
+ - name: Test
87
+ run: uv run python -m pytest -q -n 4 --durations=15
88
+
89
+ integrations:
90
+ name: integrations
91
+ runs-on: ubuntu-24.04
92
+ timeout-minutes: 10
93
+ steps:
94
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
95
+ with:
96
+ persist-credentials: false
97
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
98
+ # The runner image's Node 20 satisfies the package engine; no dependency
99
+ # install or third-party action is needed for the contract tests.
100
+ - name: Test the Pi integration contract
101
+ working-directory: integrations/pi
102
+ run: node --test
103
+ - name: Test the DeepSeek integration contract
104
+ working-directory: integrations/deepseek
105
+ run: node --test
106
+
107
+ build:
108
+ name: build
109
+ runs-on: ubuntu-24.04
110
+ timeout-minutes: 15
111
+ steps:
112
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
113
+ with:
114
+ persist-credentials: false
115
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
116
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
117
+ with:
118
+ python-version: '3.12'
119
+ - name: Install pinned uv
120
+ run: python -m pip install --disable-pip-version-check uv==0.13.8
121
+ - name: Build the distribution
122
+ run: uv build
123
+ - name: Prove the built wheel
124
+ run: |
125
+ set -euo pipefail
126
+ wheel=$(ls dist/*.whl)
127
+ uv venv --python 3.12 /tmp/agent-chat-wheel
128
+ uv pip install --python /tmp/agent-chat-wheel/bin/python "sessionyard[server] @ file://${PWD}/${wheel}"
129
+ /tmp/agent-chat-wheel/bin/agent-chat --help
130
+ # Run from outside the checkout in isolated mode so these probes read
131
+ # the installed wheel, never the source tree on the working directory.
132
+ (cd /tmp && /tmp/agent-chat-wheel/bin/python -I -c "import importlib.resources as r, agent_chat; assert '/tmp/agent-chat-wheel/' in agent_chat.__file__, agent_chat.__file__; root = r.files('agent_chat'); assert (root / 'web/index.html').is_file(); assert (root / '001_core.sql').is_file(); import agent_chat.api")
133
+ uv venv --python 3.12 /tmp/agent-chat-client
134
+ uv pip install --python /tmp/agent-chat-client/bin/python "${wheel}"
135
+ (cd /tmp && /tmp/agent-chat-client/bin/python -I -c "import importlib.util, agent_chat; assert '/tmp/agent-chat-client/' in agent_chat.__file__, agent_chat.__file__; assert importlib.util.find_spec('psycopg') is None; import agent_chat.cli, agent_chat.client, agent_chat.protocol, agent_chat.instance_file")
136
+
137
+ public-content:
138
+ name: public-content
139
+ runs-on: ubuntu-24.04
140
+ timeout-minutes: 10
141
+ steps:
142
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
143
+ with:
144
+ fetch-depth: 0
145
+ persist-credentials: false
146
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
147
+ - name: Verify pinned Gitleaks and scan history and messages
148
+ shell: bash
149
+ run: |
150
+ set -euo pipefail
151
+ tools="$RUNNER_TEMP/agent-chat-tools"
152
+ mkdir -p "$tools"
153
+ curl --fail --location --silent --show-error --max-time 60 \
154
+ --max-filesize 33554432 \
155
+ https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz \
156
+ --output "$tools/gitleaks.tar.gz"
157
+ printf '%s %s\n' \
158
+ '551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb' \
159
+ "$tools/gitleaks.tar.gz" | sha256sum --check -
160
+ tar --extract --gzip --file "$tools/gitleaks.tar.gz" \
161
+ --directory "$tools" gitleaks
162
+ "$tools/gitleaks" git --config .gitleaks.toml --redact \
163
+ --no-banner --log-opts='--all' .
164
+ git ls-tree --name-only -r -z HEAD | while IFS= read -r -d '' path; do
165
+ git show "HEAD:$path"
166
+ printf '\n'
167
+ done | "$tools/gitleaks" stdin \
168
+ --config .gitleaks.toml --redact --no-banner
169
+ git log --all --format=%B | "$tools/gitleaks" stdin \
170
+ --config .gitleaks.toml --redact --no-banner
171
+ - name: Scan for private estate identifiers
172
+ run: python3 scripts/check_estate_identifiers.py
173
+ - name: Scan the commit range for private estate identifiers
174
+ # A value introduced in one commit and removed in a later one is clean
175
+ # in the tree but still public in the history; the patch stream catches
176
+ # both commits. `pipefail` is required: without it a failed `git log`
177
+ # feeds an empty stream to the scanner, which passes.
178
+ shell: bash
179
+ run: |
180
+ set -euo pipefail
181
+ git log --all --format= --patch | python3 scripts/check_estate_identifiers.py --stdin
182
+
183
+ dependency-review:
184
+ name: dependency-review
185
+ if: github.event_name == 'pull_request'
186
+ runs-on: ubuntu-24.04
187
+ timeout-minutes: 5
188
+ steps:
189
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
190
+ with:
191
+ persist-credentials: false
192
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
193
+ - uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
194
+ with:
195
+ # No PR comment: the job keeps the read-only workflow token.
196
+ comment-summary-in-pr: never
@@ -0,0 +1,74 @@
1
+ # Publishes the distribution to PyPI as `sessionyard` when a GitHub Release is
2
+ # published. release-please creates that release with a personal access token,
3
+ # so the `release` event does start this workflow; a release created with the
4
+ # default GITHUB_TOKEN would not.
5
+ #
6
+ # PyPI trusted publishing does not support reusable workflows, and `automerge`
7
+ # calls release-please.yml through `workflow_call`, so publication is its own
8
+ # workflow and not a job in release-please.yml. No token is stored: PyPI trusts
9
+ # this repository, this file name and the `pypi` environment, so renaming any of
10
+ # them needs a matching change on PyPI.
11
+ #
12
+ # `build` is read-only, checks out the commit the release event names, checks
13
+ # that the release tag is `v` plus the project version and builds with the
14
+ # pinned uv. `publish` holds only `id-token: write`,
15
+ # runs no repository code and waits in the `pypi` environment, where a required
16
+ # reviewer is the per-release approval.
17
+ name: publish
18
+
19
+ on:
20
+ release:
21
+ types: [published]
22
+
23
+ permissions: {}
24
+
25
+ jobs:
26
+ build:
27
+ runs-on: ubuntu-24.04
28
+ timeout-minutes: 15
29
+ permissions:
30
+ contents: read
31
+ steps:
32
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
33
+ with:
34
+ persist-credentials: false
35
+ # The commit the release event names, never a ref resolved again
36
+ # by name: a branch named like the tag, or a moved tag, would
37
+ # otherwise change what is built.
38
+ ref: ${{ github.sha }}
39
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
40
+ with:
41
+ python-version: '3.12'
42
+ - name: Install pinned uv
43
+ run: python -m pip install --disable-pip-version-check uv==0.13.8
44
+ - name: Release tag matches the project version
45
+ env:
46
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
47
+ run: |
48
+ set -euo pipefail
49
+ version=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
50
+ if [ "$RELEASE_TAG" != "v${version}" ]; then
51
+ echo "The release tag must be v${version}, the version in pyproject.toml." >&2
52
+ exit 1
53
+ fi
54
+ - name: Build the distribution
55
+ run: uv build
56
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
57
+ with:
58
+ name: dist
59
+ path: dist/
60
+ if-no-files-found: error
61
+
62
+ publish:
63
+ needs: build
64
+ runs-on: ubuntu-24.04
65
+ timeout-minutes: 10
66
+ environment: pypi
67
+ permissions:
68
+ id-token: write
69
+ steps:
70
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
71
+ with:
72
+ name: dist
73
+ path: dist/
74
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
@@ -0,0 +1,39 @@
1
+ # Release automation under the repository's own merge policy: release-please
2
+ # opens one release pull request on a release-relevant conventional commit, and
3
+ # merging that pull request is the maintainer's release decision. The release
4
+ # pull request always changes a sensitive path (pyproject.toml, this
5
+ # configuration or the manifest), so scripts/pr_policy.py never auto-merges it.
6
+ #
7
+ # `automerge` calls this workflow when its own run landed a pull request, so a
8
+ # sweep or a gate pass that merges nothing costs no release run. `push` keeps the
9
+ # path for a merge performed with a token that does create push events.
10
+ # `workflow_run` is not a trigger here: it fires on every completion of the
11
+ # automation, whether or not that run merged anything. `workflow_dispatch` is the
12
+ # manual reconciliation path.
13
+ #
14
+ # The token is a fine-grained personal access token with Contents: write and
15
+ # Pull requests: write on this repository, stored as RELEASE_PLEASE_TOKEN. The
16
+ # default GITHUB_TOKEN cannot be used: a pull request it creates does not
17
+ # trigger the pull-request workflows, so the required checks would never run.
18
+ name: release-please
19
+
20
+ on:
21
+ push:
22
+ branches: [main]
23
+ workflow_call:
24
+ workflow_dispatch:
25
+
26
+ permissions:
27
+ contents: write
28
+ pull-requests: write
29
+
30
+ jobs:
31
+ release-please:
32
+ runs-on: ubuntu-24.04
33
+ timeout-minutes: 10
34
+ steps:
35
+ - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
36
+ with:
37
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
38
+ config-file: release-please-config.json
39
+ manifest-file: .release-please-manifest.json
@@ -0,0 +1,42 @@
1
+ # Trusted metadata-only publisher for the required `review` commit status.
2
+ # Never run PR-head code with this write token. A review event cannot safely
3
+ # select its own workflow definition; trusted lifecycle events and the sweep
4
+ # refresh the stored status instead. Automerge independently re-reads reviews.
5
+ name: review-gate
6
+
7
+ on:
8
+ workflow_run:
9
+ # `review-signal` is the relay for review events: a review has no trusted trigger of its own, so a
10
+ # no-op workflow on the head's copy starts this one from the default branch instead. Without it a fresh
11
+ # approval is only noticed at the next schedule, which GitHub runs hours apart.
12
+ workflows: [CI, review-signal]
13
+ types: [completed]
14
+ pull_request_target:
15
+ types: [opened, reopened, synchronize, ready_for_review, converted_to_draft, closed]
16
+ schedule:
17
+ - cron: '*/5 * * * *'
18
+
19
+ permissions:
20
+ contents: read
21
+ pull-requests: read
22
+ statuses: write
23
+
24
+ concurrency:
25
+ group: review-gate
26
+ cancel-in-progress: false
27
+
28
+ jobs:
29
+ publish-review:
30
+ if: github.event_name != 'pull_request_target' || github.event.pull_request.base.ref == 'main'
31
+ runs-on: ubuntu-24.04
32
+ timeout-minutes: 10
33
+ steps:
34
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35
+ with:
36
+ ref: ${{ github.event.repository.default_branch }}
37
+ persist-credentials: false
38
+ - name: Evaluate complete review snapshot and publish current verdicts
39
+ env:
40
+ GH_TOKEN: ${{ github.token }}
41
+ EVENT_HEAD: ${{ github.event.pull_request.head.sha }}
42
+ run: python3 scripts/github_pr_automation.py review --apply
@@ -0,0 +1,32 @@
1
+ # The review signal: a workflow that does nothing, on purpose.
2
+ #
3
+ # `pull_request_review` runs the pull request's own copy of the workflow that declares it, so neither
4
+ # `review-gate.yml` nor `automerge.yml` may listen for a review directly: a pull request could rewrite that
5
+ # copy to do work of its own choosing. This file may run from a head because, *as committed here*, it does
6
+ # nothing -- no checkout, no secret, no expression that reads the pull request, and `permissions: {}`, so the
7
+ # token this version receives can act on nothing. A rewritten copy could declare permissions for itself; what
8
+ # it cannot do is decide anything downstream, because the two consumers below run the default branch's copy and
9
+ # derive every answer again from the GitHub API.
10
+ #
11
+ # Its only product is a completed run. That completion starts `review-gate`, and `review-gate`'s own completion
12
+ # starts `automerge`: each hop runs the default branch's copy, and those two are where the privileged work
13
+ # happens. Nothing downstream reads this workflow's result as a verdict -- a review is a reason to look again,
14
+ # not an answer.
15
+ #
16
+ # A review posted through the reviewer App's installation token does start this workflow. A status or comment
17
+ # written with `GITHUB_TOKEN` would not: GitHub never starts a workflow from an event the repository's own token
18
+ # created, which is why the reviewer is a GitHub App and not a workflow.
19
+ name: review-signal
20
+
21
+ on:
22
+ pull_request_review:
23
+ types: [submitted, dismissed]
24
+
25
+ permissions: {}
26
+
27
+ jobs:
28
+ signal:
29
+ runs-on: ubuntu-24.04
30
+ steps:
31
+ - name: Hand the review event to the default branch
32
+ run: echo "review event relayed to review-gate and automerge"
@@ -0,0 +1,28 @@
1
+ node_modules/
2
+ .venv/
3
+ __pycache__/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .cache/
7
+ .estate-identifiers
8
+ *.egg-info/
9
+ dist/
10
+ build/
11
+ .coverage
12
+ .env
13
+ .env.*
14
+ .aws/
15
+ *.pem
16
+ *.key
17
+ *.sqlite
18
+ *.sqlite-*
19
+ *.sqlite3
20
+ *.sqlite3-*
21
+
22
+ # Local container deployment state
23
+ deploy/.env
24
+ deploy/config/server.json
25
+ deploy/config/mcp.json
26
+ deploy/secrets/
27
+ deploy/traefik/dynamic.yml
28
+ !deploy/.env.example
@@ -0,0 +1,30 @@
1
+ title = "agent-chat public-content policy"
2
+
3
+ [extend]
4
+ useDefault = true
5
+
6
+ [[rules]]
7
+ id = "private-ipv4"
8
+ description = "Do not publish private deployment IPv4 addresses"
9
+ regex = '''\b(?:10\.(?:[0-9]{1,3}\.){2}[0-9]{1,3}|192\.168\.[0-9]{1,3}\.[0-9]{1,3}|172\.(?:1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.[0-9]{1,3})\b'''
10
+
11
+ [[rules]]
12
+ id = "private-dns-name"
13
+ description = "Do not publish internal deployment DNS names"
14
+ # The leading (?:^|[^\w.])(?:\w+/)? consumes the preceding context into the
15
+ # match: the first prefix char cannot be a dot, so a dot-prefixed filename
16
+ # (the dotenv file) never matches at all, and an optional word/ path segment
17
+ # lets path-style mentions be recognized as paths. The hostname is group 1.
18
+ regex = '''(?i)(?:^|[^\w.])(?:\w+/)?((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:internal|lan|local))\b'''
19
+ secretGroup = 1
20
+ # Prose (space, quote or backtick before it) and path-style (word/ before
21
+ # it) mentions of the dotenv word are not hostnames and are exempted here.
22
+ # URL (`http://...`, the match keeps a bare `/` prefix) and assignment
23
+ # (`HOST=...`, the match keeps the `=` prefix) uses are still flagged.
24
+ [[rules.allowlists]]
25
+ description = "Prose and path-style mentions of the dotenv word are not hostnames; URL and assignment uses still flag"
26
+ regexTarget = "match"
27
+ regexes = [
28
+ '''(?i)(?:^|[\s"'`])env\.local$''',
29
+ '''(?i)\w+/env\.local$''',
30
+ ]
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.7.0"
3
+ }