opencode-a2a-server 0.1.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 (71) hide show
  1. opencode_a2a_server-0.1.0/.github/workflows/ci.yml +53 -0
  2. opencode_a2a_server-0.1.0/.github/workflows/dependency-health.yml +31 -0
  3. opencode_a2a_server-0.1.0/.github/workflows/publish.yml +66 -0
  4. opencode_a2a_server-0.1.0/.gitignore +218 -0
  5. opencode_a2a_server-0.1.0/.pre-commit-config.yaml +32 -0
  6. opencode_a2a_server-0.1.0/.secrets.baseline +141 -0
  7. opencode_a2a_server-0.1.0/AGENTS.md +51 -0
  8. opencode_a2a_server-0.1.0/LICENSE +176 -0
  9. opencode_a2a_server-0.1.0/PKG-INFO +199 -0
  10. opencode_a2a_server-0.1.0/README.md +161 -0
  11. opencode_a2a_server-0.1.0/SECURITY.md +55 -0
  12. opencode_a2a_server-0.1.0/docs/agent_deploy_sop.md +370 -0
  13. opencode_a2a_server-0.1.0/docs/guide.md +640 -0
  14. opencode_a2a_server-0.1.0/pyproject.toml +82 -0
  15. opencode_a2a_server-0.1.0/scripts/README.md +33 -0
  16. opencode_a2a_server-0.1.0/scripts/dependency_health.sh +22 -0
  17. opencode_a2a_server-0.1.0/scripts/deploy/enable_instance.sh +34 -0
  18. opencode_a2a_server-0.1.0/scripts/deploy/install_units.sh +88 -0
  19. opencode_a2a_server-0.1.0/scripts/deploy/provider_secret_env_keys.sh +46 -0
  20. opencode_a2a_server-0.1.0/scripts/deploy/run_a2a.sh +18 -0
  21. opencode_a2a_server-0.1.0/scripts/deploy/run_opencode.sh +77 -0
  22. opencode_a2a_server-0.1.0/scripts/deploy/setup_instance.sh +456 -0
  23. opencode_a2a_server-0.1.0/scripts/deploy/update_a2a.sh +27 -0
  24. opencode_a2a_server-0.1.0/scripts/deploy.sh +299 -0
  25. opencode_a2a_server-0.1.0/scripts/deploy_light.sh +452 -0
  26. opencode_a2a_server-0.1.0/scripts/deploy_light_readme.md +84 -0
  27. opencode_a2a_server-0.1.0/scripts/deploy_readme.md +311 -0
  28. opencode_a2a_server-0.1.0/scripts/doctor.sh +22 -0
  29. opencode_a2a_server-0.1.0/scripts/init_system.sh +757 -0
  30. opencode_a2a_server-0.1.0/scripts/init_system_readme.md +59 -0
  31. opencode_a2a_server-0.1.0/scripts/init_system_uv_release_manifest.sh +17 -0
  32. opencode_a2a_server-0.1.0/scripts/lint.sh +22 -0
  33. opencode_a2a_server-0.1.0/scripts/smoke_test_built_cli.sh +93 -0
  34. opencode_a2a_server-0.1.0/scripts/start_services.sh +115 -0
  35. opencode_a2a_server-0.1.0/scripts/start_services_readme.md +41 -0
  36. opencode_a2a_server-0.1.0/scripts/uninstall.sh +378 -0
  37. opencode_a2a_server-0.1.0/scripts/uninstall_readme.md +39 -0
  38. opencode_a2a_server-0.1.0/setup.cfg +4 -0
  39. opencode_a2a_server-0.1.0/src/opencode_a2a_server/__init__.py +13 -0
  40. opencode_a2a_server-0.1.0/src/opencode_a2a_server/agent.py +2042 -0
  41. opencode_a2a_server-0.1.0/src/opencode_a2a_server/app.py +1237 -0
  42. opencode_a2a_server-0.1.0/src/opencode_a2a_server/config.py +91 -0
  43. opencode_a2a_server-0.1.0/src/opencode_a2a_server/extension_contracts.py +590 -0
  44. opencode_a2a_server-0.1.0/src/opencode_a2a_server/jsonrpc_ext.py +1600 -0
  45. opencode_a2a_server-0.1.0/src/opencode_a2a_server/opencode_client.py +446 -0
  46. opencode_a2a_server-0.1.0/src/opencode_a2a_server/text_parts.py +15 -0
  47. opencode_a2a_server-0.1.0/src/opencode_a2a_server.egg-info/PKG-INFO +199 -0
  48. opencode_a2a_server-0.1.0/src/opencode_a2a_server.egg-info/SOURCES.txt +69 -0
  49. opencode_a2a_server-0.1.0/src/opencode_a2a_server.egg-info/dependency_links.txt +1 -0
  50. opencode_a2a_server-0.1.0/src/opencode_a2a_server.egg-info/entry_points.txt +2 -0
  51. opencode_a2a_server-0.1.0/src/opencode_a2a_server.egg-info/requires.txt +16 -0
  52. opencode_a2a_server-0.1.0/src/opencode_a2a_server.egg-info/top_level.txt +1 -0
  53. opencode_a2a_server-0.1.0/tests/__init__.py +1 -0
  54. opencode_a2a_server-0.1.0/tests/helpers.py +368 -0
  55. opencode_a2a_server-0.1.0/tests/test_agent_card.py +203 -0
  56. opencode_a2a_server-0.1.0/tests/test_agent_errors.py +192 -0
  57. opencode_a2a_server-0.1.0/tests/test_call_context_builder.py +44 -0
  58. opencode_a2a_server-0.1.0/tests/test_cancel_contract.py +108 -0
  59. opencode_a2a_server-0.1.0/tests/test_cancellation.py +295 -0
  60. opencode_a2a_server-0.1.0/tests/test_deploy_security_contract.py +79 -0
  61. opencode_a2a_server-0.1.0/tests/test_directory_validation.py +97 -0
  62. opencode_a2a_server-0.1.0/tests/test_extension_contract_consistency.py +237 -0
  63. opencode_a2a_server-0.1.0/tests/test_init_system_security.py +76 -0
  64. opencode_a2a_server-0.1.0/tests/test_opencode_agent_session_binding.py +204 -0
  65. opencode_a2a_server-0.1.0/tests/test_opencode_client_params.py +479 -0
  66. opencode_a2a_server-0.1.0/tests/test_opencode_session_extension.py +2013 -0
  67. opencode_a2a_server-0.1.0/tests/test_session_ownership.py +320 -0
  68. opencode_a2a_server-0.1.0/tests/test_settings.py +59 -0
  69. opencode_a2a_server-0.1.0/tests/test_streaming_output_contract.py +1301 -0
  70. opencode_a2a_server-0.1.0/tests/test_transport_contract.py +547 -0
  71. opencode_a2a_server-0.1.0/uv.lock +1376 -0
@@ -0,0 +1,53 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ quality-gate:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: ["3.11", "3.12", "3.13"]
19
+
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Setup Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+
29
+ - name: Setup uv
30
+ uses: astral-sh/setup-uv@v4
31
+ with:
32
+ enable-cache: true
33
+
34
+ - name: Sync Dependencies
35
+ run: uv sync --all-extras --frozen
36
+
37
+ - name: Run pre-commit
38
+ run: bash ./scripts/lint.sh
39
+
40
+ - name: Run mypy
41
+ run: uv run mypy src/opencode_a2a_server
42
+
43
+ - name: Run pytest
44
+ run: uv run pytest
45
+
46
+ - name: Run dependency vulnerability audit
47
+ run: uv run pip-audit
48
+
49
+ - name: Build package artifacts
50
+ run: uv build --no-sources
51
+
52
+ - name: Smoke test built CLI
53
+ run: bash ./scripts/smoke_test_built_cli.sh
@@ -0,0 +1,31 @@
1
+ name: Dependency Health
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ schedule:
6
+ # 03:00 UTC on day-of-month 1
7
+ - cron: "0 3 1 * *"
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ dependency-health:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Setup Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.13"
24
+
25
+ - name: Setup uv
26
+ uses: astral-sh/setup-uv@v4
27
+ with:
28
+ enable-cache: true
29
+
30
+ - name: Run dependency health checks
31
+ run: bash ./scripts/dependency_health.sh
@@ -0,0 +1,66 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: write
11
+ id-token: write
12
+
13
+ jobs:
14
+ publish:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Setup Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.13"
27
+
28
+ - name: Setup uv
29
+ uses: astral-sh/setup-uv@v4
30
+ with:
31
+ enable-cache: true
32
+
33
+ - name: Build package artifacts
34
+ run: uv build --no-sources
35
+
36
+ - name: Verify published version matches tag
37
+ run: |
38
+ python - <<'PY'
39
+ import os
40
+ import pathlib
41
+
42
+ dist_dir = pathlib.Path("dist")
43
+ wheels = sorted(dist_dir.glob("opencode_a2a_server-*.whl"))
44
+ if not wheels:
45
+ raise SystemExit("No wheel produced in dist/")
46
+ wheel = wheels[0].name
47
+ version = wheel.removeprefix("opencode_a2a_server-").split("-py3", 1)[0]
48
+ tag = os.environ["GITHUB_REF_NAME"].removeprefix("v")
49
+ if version != tag:
50
+ raise SystemExit(f"Wheel version {version!r} does not match tag {tag!r}")
51
+ print(f"Validated release version: {version}")
52
+ PY
53
+
54
+ - name: Smoke test wheel install
55
+ run: bash ./scripts/smoke_test_built_cli.sh
56
+
57
+ - name: Publish to PyPI
58
+ uses: pypa/gh-action-pypi-publish@release/v1
59
+
60
+ - name: Create GitHub Release
61
+ uses: softprops/action-gh-release@v2
62
+ with:
63
+ generate_release_notes: true
64
+ files: |
65
+ dist/*.tar.gz
66
+ dist/*.whl
@@ -0,0 +1,218 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Local logs
40
+ logs/
41
+ run/
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py.cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # UV
102
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ #uv.lock
106
+
107
+ # poetry
108
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
110
+ # commonly ignored for libraries.
111
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
+ #poetry.lock
113
+ #poetry.toml
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
118
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
119
+ #pdm.lock
120
+ #pdm.toml
121
+ .pdm-python
122
+ .pdm-build/
123
+
124
+ # pixi
125
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
126
+ #pixi.lock
127
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
128
+ # in the .venv directory. It is recommended not to include this directory in version control.
129
+ .pixi
130
+
131
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
+ __pypackages__/
133
+
134
+ # Celery stuff
135
+ celerybeat-schedule
136
+ celerybeat.pid
137
+
138
+ # SageMath parsed files
139
+ *.sage.py
140
+
141
+ # Environments
142
+ .env
143
+ .envrc
144
+ .venv
145
+ env/
146
+ venv/
147
+ ENV/
148
+ env.bak/
149
+ venv.bak/
150
+
151
+ # Spyder project settings
152
+ .spyderproject
153
+ .spyproject
154
+
155
+ # Rope project settings
156
+ .ropeproject
157
+
158
+ # mkdocs documentation
159
+ /site
160
+
161
+ # mypy
162
+ .mypy_cache/
163
+ .dmypy.json
164
+ dmypy.json
165
+
166
+ # Pyre type checker
167
+ .pyre/
168
+
169
+ # pytype static type analyzer
170
+ .pytype/
171
+
172
+ # Cython debug symbols
173
+ cython_debug/
174
+
175
+ # PyCharm
176
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
177
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
178
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
179
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
180
+ #.idea/
181
+
182
+ # Abstra
183
+ # Abstra is an AI-powered process automation framework.
184
+ # Ignore directories containing user credentials, local state, and settings.
185
+ # Learn more at https://abstra.io/docs
186
+ .abstra/
187
+
188
+ # Visual Studio Code
189
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
190
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
191
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
192
+ # you could uncomment the following to ignore the entire vscode folder
193
+ # .vscode/
194
+
195
+ # Ruff stuff:
196
+ .ruff_cache/
197
+
198
+ # PyPI configuration file
199
+ .pypirc
200
+
201
+ # Cursor
202
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
203
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
204
+ # refer to https://docs.cursor.com/context/ignore-files
205
+ .cursorignore
206
+ .cursorindexingignore
207
+
208
+ # Marimo
209
+ marimo/_static/
210
+ marimo/_lsp/
211
+ __marimo__/
212
+
213
+ # GitHub CLI temporary body files (should not be committed)
214
+ issue_*.md
215
+
216
+ # Local OpenCode OpenAPI snapshots (high-churn, local reference only)
217
+ docs/operations/opencode/
218
+ .swival/
@@ -0,0 +1,32 @@
1
+ minimum_pre_commit_version: 4.5.1
2
+ repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v4.6.0
5
+ hooks:
6
+ - id: trailing-whitespace
7
+ - id: end-of-file-fixer
8
+ - id: check-yaml
9
+ - repo: https://github.com/shellcheck-py/shellcheck-py
10
+ rev: v0.11.0.1
11
+ hooks:
12
+ - id: shellcheck
13
+ args: ["--severity=error"]
14
+ files: ^scripts/.*\.sh$
15
+ - repo: https://github.com/astral-sh/ruff-pre-commit
16
+ rev: v0.14.14
17
+ hooks:
18
+ - id: ruff
19
+ args: ["--fix"]
20
+ - id: ruff-format
21
+ - repo: https://github.com/Yelp/detect-secrets
22
+ rev: v1.5.0
23
+ hooks:
24
+ - id: detect-secrets
25
+ args: ["--baseline", ".secrets.baseline"]
26
+ - repo: local
27
+ hooks:
28
+ - id: bash-n
29
+ name: bash syntax check
30
+ entry: bash -n
31
+ language: system
32
+ files: ^scripts/.*\.sh$
@@ -0,0 +1,141 @@
1
+ {
2
+ "version": "1.5.0",
3
+ "plugins_used": [
4
+ {
5
+ "name": "ArtifactoryDetector"
6
+ },
7
+ {
8
+ "name": "AWSKeyDetector"
9
+ },
10
+ {
11
+ "name": "AzureStorageKeyDetector"
12
+ },
13
+ {
14
+ "name": "Base64HighEntropyString",
15
+ "limit": 4.5
16
+ },
17
+ {
18
+ "name": "BasicAuthDetector"
19
+ },
20
+ {
21
+ "name": "CloudantDetector"
22
+ },
23
+ {
24
+ "name": "DiscordBotTokenDetector"
25
+ },
26
+ {
27
+ "name": "GitHubTokenDetector"
28
+ },
29
+ {
30
+ "name": "GitLabTokenDetector"
31
+ },
32
+ {
33
+ "name": "HexHighEntropyString",
34
+ "limit": 3.0
35
+ },
36
+ {
37
+ "name": "IbmCloudIamDetector"
38
+ },
39
+ {
40
+ "name": "IbmCosHmacDetector"
41
+ },
42
+ {
43
+ "name": "IPPublicDetector"
44
+ },
45
+ {
46
+ "name": "JwtTokenDetector"
47
+ },
48
+ {
49
+ "name": "KeywordDetector",
50
+ "keyword_exclude": ""
51
+ },
52
+ {
53
+ "name": "MailchimpDetector"
54
+ },
55
+ {
56
+ "name": "NpmDetector"
57
+ },
58
+ {
59
+ "name": "OpenAIDetector"
60
+ },
61
+ {
62
+ "name": "PrivateKeyDetector"
63
+ },
64
+ {
65
+ "name": "PypiTokenDetector"
66
+ },
67
+ {
68
+ "name": "SendGridDetector"
69
+ },
70
+ {
71
+ "name": "SlackDetector"
72
+ },
73
+ {
74
+ "name": "SoftlayerDetector"
75
+ },
76
+ {
77
+ "name": "SquareOAuthDetector"
78
+ },
79
+ {
80
+ "name": "StripeDetector"
81
+ },
82
+ {
83
+ "name": "TelegramBotTokenDetector"
84
+ },
85
+ {
86
+ "name": "TwilioKeyDetector"
87
+ }
88
+ ],
89
+ "filters_used": [
90
+ {
91
+ "path": "detect_secrets.filters.allowlist.is_line_allowlisted"
92
+ },
93
+ {
94
+ "path": "detect_secrets.filters.common.is_baseline_file",
95
+ "filename": ".secrets.baseline"
96
+ },
97
+ {
98
+ "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
99
+ "min_level": 2
100
+ },
101
+ {
102
+ "path": "detect_secrets.filters.heuristic.is_indirect_reference"
103
+ },
104
+ {
105
+ "path": "detect_secrets.filters.heuristic.is_likely_id_string"
106
+ },
107
+ {
108
+ "path": "detect_secrets.filters.heuristic.is_lock_file"
109
+ },
110
+ {
111
+ "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
112
+ },
113
+ {
114
+ "path": "detect_secrets.filters.heuristic.is_potential_uuid"
115
+ },
116
+ {
117
+ "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
118
+ },
119
+ {
120
+ "path": "detect_secrets.filters.heuristic.is_sequential_string"
121
+ },
122
+ {
123
+ "path": "detect_secrets.filters.heuristic.is_swagger_file"
124
+ },
125
+ {
126
+ "path": "detect_secrets.filters.heuristic.is_templated_secret"
127
+ }
128
+ ],
129
+ "results": {
130
+ "scripts/init_system.sh": [
131
+ {
132
+ "type": "Hex High Entropy String",
133
+ "filename": "scripts/init_system.sh",
134
+ "hashed_secret": "96183ea4ff07d786ed3233777364ddbf14eb74cc",
135
+ "is_verified": false,
136
+ "line_number": 23
137
+ }
138
+ ]
139
+ },
140
+ "generated_at": "2026-03-13T14:03:33Z"
141
+ }
@@ -0,0 +1,51 @@
1
+ # AGENTS.md
2
+
3
+ The following rules apply to coding agent collaboration and delivery workflows in this repository.
4
+
5
+ ## 1. Core Principles
6
+
7
+ - Move tasks forward under secure and traceable conditions, while avoiding unnecessary process blockers.
8
+ - Stay consistent with the existing repository structure, implementation style, and engineering conventions.
9
+
10
+ ## 2. Git Workflow
11
+
12
+ - Do not commit or push directly to protected branches: `main` / `master` / `release/*`.
13
+ - Each development task should be implemented on an independent branch, preferably cut from the latest mainline.
14
+ - Prefer `git fetch` + `git merge --ff-only` to sync mainline and avoid implicit merges.
15
+ - It is allowed to push development branches to remote branches with the same name for collaboration and backup.
16
+ - Do not rewrite shared history: no `git push --force`, `git push --force-with-lease`, or arbitrary `rebase`.
17
+ - Commit only files related to the current task; do not clean up or roll back unrelated local changes.
18
+
19
+ ## 3. Issue and PR Collaboration
20
+
21
+ - Before starting a development task, check whether a related open issue already exists (for example, `gh issue list --state open`).
22
+ - If no related issue exists, create a new issue for tracking. The issue should include background, reproduction steps, expected vs. actual behavior, acceptance criteria, and a `git rev-parse HEAD` snapshot.
23
+ - Only collaboration-process documentation changes (such as `AGENTS.md`) can be modified directly without creating an additional issue.
24
+ - Recommended issue title prefixes: `[feat]`, `[bug]`, `[docs]`, `[ops]`, `[chore]`.
25
+ - If a commit serves a specific issue, include the corresponding `#issue` in the commit message.
26
+ - PRs are recommended to be created as Draft by default, and should explicitly indicate linkage in the description (for example, `Closes #xx` / `Relates to #xx`).
27
+ - When key progress, solution changes, or new risks appear, sync updates to the corresponding issue/PR in time and avoid duplicate comments.
28
+
29
+ ## 4. Tooling and Text Conventions
30
+
31
+ - Use `gh` CLI to read and write issues/PRs; do not edit through the web UI manually.
32
+ - Use Simplified Chinese for issues, PRs, and comments; technical terms may remain in English.
33
+ - For multi-line bodies, write to a temporary file first and pass it with `--body-file`; do not concatenate `\\n` in `--body`.
34
+ - Use `#123` for same-repo references (auto-linking); use full URLs for cross-repo references.
35
+
36
+ ## 5. Regression and Validation
37
+
38
+ - Choose regression strategy based on change type. Default baseline:
39
+ - `uv run pre-commit run --all-files`
40
+ - `uv run pytest`
41
+ - If `pre-commit` auto-fixes files (such as `ruff --fix`), review the changes before committing.
42
+ - For shell/deployment script changes, in addition to baseline checks, run at least `bash -n` for syntax validation on modified scripts.
43
+ - For documentation-only changes, tests may be skipped, but commands and path examples must be self-checked for usability.
44
+ - `uv sync --all-extras` is required only for first-time setup or dependency changes; it is not mandatory for every change.
45
+ - If any validation cannot be completed due to environment limits, explicitly state the skipped item and reason in the report.
46
+
47
+ ## 6. Security and Configuration
48
+
49
+ - Never commit keys, tokens, credentials, or other sensitive information (including `.env` content).
50
+ - Logs and debug output must not leak access tokens or private data.
51
+ - Changes related to deployment, authentication, or secret injection must include synchronized documentation updates and minimal acceptance steps.