mainsequence 9.0.4__tar.gz → 9.0.5.dev35__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 (101) hide show
  1. {mainsequence-9.0.4/mainsequence.egg-info → mainsequence-9.0.5.dev35}/PKG-INFO +1 -1
  2. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/AGENTS.md +2 -2
  3. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/application_surfaces/api_surfaces/SKILL.md +13 -5
  4. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/maintenance/bug_auditor/SKILL.md +2 -1
  5. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/maintenance/code_repository_maintenance/SKILL.md +87 -52
  6. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/platform_operations/orchestration_and_releases/SKILL.md +21 -10
  7. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/sdk_code_repository_execution/SKILL.md +1 -1
  8. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/api.py +0 -30
  9. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/cli.py +48 -240
  10. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/local_ops.py +0 -64
  11. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/ssh_utils.py +0 -74
  12. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/models_helpers.py +18 -10
  13. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35/mainsequence.egg-info}/PKG-INFO +1 -1
  14. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/pyproject.toml +1 -1
  15. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_cli.py +175 -496
  16. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_code_repository_skills.py +2 -1
  17. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_local_ops.py +0 -51
  18. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_ssh_utils.py +0 -78
  19. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/LICENSE +0 -0
  20. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/README.md +0 -0
  21. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/a2a_sdk_execution/SKILL.md +0 -0
  22. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/mainsequence-inference/SKILL.md +0 -0
  23. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/maintenance/metatables_transition/SKILL.md +0 -0
  24. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/agent_scaffold/skills/platform_operations/access_control_and_sharing/SKILL.md +0 -0
  25. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/__init__.py +0 -0
  26. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/__main__.py +0 -0
  27. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/_request_identity.py +0 -0
  28. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/bootstrap.py +0 -0
  29. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/__init__.py +0 -0
  30. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/browser_auth.py +0 -0
  31. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/code_repository_status.py +0 -0
  32. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/config.py +0 -0
  33. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/docker_utils.py +0 -0
  34. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/doctor.py +0 -0
  35. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/model_filters.py +0 -0
  36. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/pydantic_cli.py +0 -0
  37. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/sdk_utils.py +0 -0
  38. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/cli/ui.py +0 -0
  39. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/__init__.py +0 -0
  40. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/agent_runtime_models.py +0 -0
  41. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/base.py +0 -0
  42. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/client.py +0 -0
  43. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/compute_validation.py +0 -0
  44. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/exceptions.py +0 -0
  45. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/github_issues.py +0 -0
  46. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/inference.py +0 -0
  47. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/models_foundry.py +0 -0
  48. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/models_user.py +0 -0
  49. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/observability.py +0 -0
  50. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/utils.py +0 -0
  51. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/client/value_sets.py +0 -0
  52. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/code_repository_context.py +0 -0
  53. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/code_repository_skills.py +0 -0
  54. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/defaults.py +0 -0
  55. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/instrumentation/__init__.py +0 -0
  56. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/instrumentation/utils.py +0 -0
  57. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/logconf.py +0 -0
  58. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/repository_identity_security.py +0 -0
  59. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/runtime_flags.py +0 -0
  60. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/scaffold_skills.py +0 -0
  61. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/server/__init__.py +0 -0
  62. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/server/caller_assertions.py +0 -0
  63. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence/server/fastapi.py +0 -0
  64. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence.egg-info/SOURCES.txt +0 -0
  65. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence.egg-info/dependency_links.txt +0 -0
  66. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence.egg-info/entry_points.txt +0 -0
  67. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence.egg-info/requires.txt +0 -0
  68. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/mainsequence.egg-info/top_level.txt +0 -0
  69. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/setup.cfg +0 -0
  70. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_auth_bootstrap.py +0 -0
  71. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_auth_precedence.py +0 -0
  72. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_caller_assertions.py +0 -0
  73. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_canonical_api_route_contract.py +0 -0
  74. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_cli_auth_contract.py +0 -0
  75. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_cli_browser_auth.py +0 -0
  76. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_cli_secure_storage.py +0 -0
  77. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_client.py +0 -0
  78. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_code_repository_branch_contract.py +0 -0
  79. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_code_repository_documentation_contract.py +0 -0
  80. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_code_repository_runtime_context.py +0 -0
  81. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_dependency_extras.py +0 -0
  82. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_dev_release_version.py +0 -0
  83. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_environment_resource_context.py +0 -0
  84. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_environment_response_contracts.py +0 -0
  85. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_fastapi_request_identity.py +0 -0
  86. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_filter_normalization.py +0 -0
  87. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_github_issues_client.py +0 -0
  88. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_independent_context.py +0 -0
  89. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_inference_client.py +0 -0
  90. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_instrumentation.py +0 -0
  91. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_job_client.py +0 -0
  92. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_logconf.py +0 -0
  93. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_models_user_request_bound_auth.py +0 -0
  94. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_notification_uid_contract.py +0 -0
  95. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_observability_client.py +0 -0
  96. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_scaffold_skills.py +0 -0
  97. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_secret_client_model.py +0 -0
  98. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_source_ownership.py +0 -0
  99. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_tolerant_response_reading.py +0 -0
  100. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_tolerant_value_sets.py +0 -0
  101. {mainsequence-9.0.4 → mainsequence-9.0.5.dev35}/tests/test_user_application_facts.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mainsequence
3
- Version: 9.0.4
3
+ Version: 9.0.5.dev35
4
4
  Summary: Main Sequence SDK
5
5
  Author-email: Main Sequence GmbH <dev@main-sequence.io>
6
6
  License-Expression: MIT
@@ -65,8 +65,8 @@ bundle. Platform skills are installed separately under
65
65
  - CodeRepository context, local SDK execution, repository structure, and
66
66
  implementation routing:
67
67
  `.agents/skills/mainsequence/sdk_code_repository_execution/SKILL.md`
68
- - Local environment repair, authentication, explicitly requested updates, and
69
- canonical CodeRepository sync:
68
+ - Local environment repair, authentication, explicitly requested updates,
69
+ dependency sync after a dependency change, and publishing with Git:
70
70
  `.agents/skills/mainsequence/maintenance/code_repository_maintenance/SKILL.md`
71
71
  - Blocker analysis, failure classification, and SDK/platform contract mismatches:
72
72
  `.agents/skills/mainsequence/maintenance/bug_auditor/SKILL.md`
@@ -241,17 +241,24 @@ mainsequence code-repository current --debug --json
241
241
  ```
242
242
 
243
243
  Declare the FastAPI resource in `.mainsequence/workflows/`, validate the
244
- workflow against the backend template, then move the tested commit through the
245
- canonical lifecycle:
244
+ workflow against the backend template, then commit and push the tested commit
245
+ with Git and inspect the result:
246
246
 
247
247
  ```bash
248
- mainsequence code-repository sync -m "Release Command Center API"
248
+ git commit -m "Release Command Center API"
249
+ git push
249
250
  mainsequence code-repository resources list --filter resource_type=fastapi
250
251
  ```
251
252
 
253
+ When the dependencies changed, run `mainsequence code-repository sync --path .`
254
+ before the commit and include the refreshed `uv.lock` and `requirements.txt`.
255
+ The command runs no Git command and makes no platform request.
256
+
252
257
  Verify that:
253
258
 
254
- - code-repository sync used the intended Git branch
259
+ - the push went to the intended Git branch
260
+ - when the workflow sets a `tag_regex`, the repository's CI tagged the pushed
261
+ commit with a matching tag; without a `tag_regex` every push deploys
255
262
  - the workflow declaration identifies the tested FastAPI source path
256
263
  - resource discovery found that path at the exact deployed commit
257
264
  - Django resolved and built the exact image for the workflow event
@@ -261,7 +268,8 @@ Verify that:
261
268
 
262
269
  Enable automatic deployment in the repository workflow when the route paths,
263
270
  resource path, and frontend contracts are stable enough for future repository
264
- events to promote exact images.
271
+ events to promote exact images. Automatic deployment and its `tag_regex` are
272
+ set in the workflow file only; a release update does not accept them.
265
273
 
266
274
  ### 6. Verify the deployed API
267
275
 
@@ -61,7 +61,8 @@ This skill audits. It does not implement by default.
61
61
  - RBAC and access issues:
62
62
  `.agents/skills/mainsequence/platform_operations/access_control_and_sharing/SKILL.md`
63
63
  - environment repair, authentication refresh, SDK updates, managed skill
64
- refresh, and CodeRepository sync after the failure is classified:
64
+ refresh, dependency sync, and publishing with Git after the failure is
65
+ classified:
65
66
  `.agents/skills/mainsequence/maintenance/code_repository_maintenance/SKILL.md`
66
67
 
67
68
  ## Read First
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mainsequence-code-repository-maintenance
3
- description: Maintain an existing Main Sequence CodeRepository checkout using the SDK-version-matched CLI. Use for inspecting repository state, building or repairing .venv, refreshing local authentication, performing explicitly requested SDK, skill, or AGENTS.md updates, publishing changes with CodeRepository sync, or diagnosing a partially completed maintenance workflow.
3
+ description: Maintain an existing Main Sequence CodeRepository checkout using the SDK-version-matched CLI. Use for inspecting repository state, building or repairing .venv, refreshing local authentication, performing explicitly requested SDK, skill, or AGENTS.md updates, refreshing dependency files with CodeRepository sync, publishing changes with Git, or diagnosing a partially completed maintenance workflow.
4
4
  ---
5
5
 
6
6
  # Main Sequence CodeRepository Maintenance
@@ -16,7 +16,8 @@ workflows.
16
16
  Own:
17
17
 
18
18
  - local CodeRepository inspection and maintenance sequencing;
19
- - `.venv`, SDK, managed skill, `AGENTS.md`, and Git-release workflows;
19
+ - `.venv`, SDK, managed skill, `AGENTS.md`, dependency sync, and Git publishing
20
+ workflows;
20
21
  - precondition checks, explicit approval gates, and partial-failure diagnosis.
21
22
 
22
23
  Do not own:
@@ -208,60 +209,96 @@ preserve the previous valid managed tree. Because this operation can update
208
209
  this skill, reload the refreshed `code_repository_maintenance/SKILL.md` before starting
209
210
  another maintenance routine.
210
211
 
211
- ## Publish With Canonical CodeRepository Sync
212
+ ## Sync Dependencies After A Dependency Change
212
213
 
213
- Use CodeRepository sync only when the user intends to commit, tag, and push all
214
- reviewed repository changes.
215
-
216
- Before execution:
214
+ Run CodeRepository sync only after the dependencies changed, for example after
215
+ editing `[project.dependencies]` in `pyproject.toml`:
217
216
 
218
217
  ```bash
219
- git status --short
220
- git diff --stat
221
- mainsequence code-repository sync --path . -m "<specific commit message>" --dry-run
218
+ mainsequence code-repository sync --path .
222
219
  ```
223
220
 
224
- Review every pending file because the command stages with `git add -A`. Do not
225
- continue when unrelated or unexplained changes would be included.
221
+ In the project root it runs `uv lock`, `uv sync`, and the locked runtime export
222
+ `uv export --locked --no-dev --no-hashes` into `requirements.txt`. It accepts
223
+ only `--path`. It sends no request to the platform, creates no SSH or deploy
224
+ key, changes no version, and runs no `git add`, `commit`, `tag`, or `push`.
225
+ Review the changed `uv.lock` and `requirements.txt` and publish them with the
226
+ dependency change.
226
227
 
227
- The command performs the same branch preflight even for `--dry-run`: it rejects
228
- a detached checkout and rejects a Git branch that is not registered under the
229
- logical CodeRepository. Do not bypass that validation or supply a CodeRepositoryBranch UID
230
- manually. Register or select the correct Git branch first.
228
+ ## Publish With Git
231
229
 
232
- After that branch preflight, `--dry-run` resolves the existing `uv` executable,
233
- previews its patch version without mutation, requests the backend-owned tag for
234
- that future version, rejects an invalid or existing local tag, prints the
235
- complete plan, and returns without generating an SSH key, querying private
236
- remote refs, changing dependencies or repository files, or mutating Git state.
237
-
238
- After review:
230
+ Publish only when the user intends to commit and push the reviewed changes.
231
+ Commit and push with Git as usual:
239
232
 
240
233
  ```bash
241
- mainsequence code-repository sync --path . -m "<specific commit message>"
234
+ git status --short
235
+ git diff --stat
236
+ git add <reviewed paths>
237
+ git commit -m "<specific commit message>"
238
+ git push
239
+ ```
240
+
241
+ Review every pending file and stage only the files that belong to the change.
242
+ Do not continue when unrelated or unexplained changes would be included. Push
243
+ to the attached branch that `mainsequence code-repository current` resolved; a
244
+ detached checkout or an unregistered branch is a preflight failure.
245
+
246
+ The platform deploys from the push according to the repository's
247
+ `.mainsequence/workflows/*.yaml`. A declaration's `tag_regex` decides which
248
+ pushes deploy:
249
+
250
+ - omitted or `null`: every push to the branch deploys;
251
+ - a regular expression: a push deploys only when a matching tag points at the
252
+ branch's latest commit.
253
+
254
+ Automatic deployment and `tag_regex` are set in the workflow file only; a
255
+ `ResourceRelease` or `Job` update does not accept them. The Main Sequence
256
+ platform does not create tag names and the CLI does not tag. Versions and
257
+ release tags belong to the repository: the version is raised in
258
+ `pyproject.toml` (for example `uv version --bump patch`) in the commit to
259
+ release, and the repository's own CI creates the tag. Do not create or push a
260
+ release tag by hand unless the user asks for it. When the user wants tag-based
261
+ releases and the repository has no such CI yet, propose a workflow like this
262
+ example and wait for approval before adding it:
263
+
264
+ ```yaml
265
+ # Example: .github/workflows/release.yml in the CodeRepository
266
+ name: release
267
+ on:
268
+ push:
269
+ branches: [main]
270
+ concurrency:
271
+ group: release-main
272
+ cancel-in-progress: false
273
+ permissions:
274
+ contents: write
275
+ jobs:
276
+ release:
277
+ runs-on: ubuntu-latest
278
+ steps:
279
+ - uses: actions/checkout@v4
280
+ with:
281
+ fetch-depth: 0
282
+ - uses: astral-sh/setup-uv@v6
283
+ - run: uv sync --locked
284
+ - run: uv run pytest
285
+ - name: Tag the version declared in pyproject.toml
286
+ run: |
287
+ TAG="v$(uv version --short)"
288
+ if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
289
+ echo "$TAG already exists; nothing to release"
290
+ exit 0
291
+ fi
292
+ git tag "$TAG" "$GITHUB_SHA"
293
+ git push origin "refs/tags/$TAG"
242
294
  ```
243
295
 
244
- The canonical command always:
245
-
246
- 1. selects `mainsequence-<repository-slug>-<first-16-sha256>` from the normalized
247
- `host[:non-default-port]/repository/path`, never from the repository basename alone and never
248
- from a legacy basename-only key;
249
- 2. previews the `uv` patch version, requests the backend-owned CodeRepositoryBranch tag, and rejects an
250
- invalid or existing local tag;
251
- 3. registers a new or inaccessible key through the owning CodeRepository and verifies a dry-run push with
252
- that forced identity;
253
- 4. queries the exact tag ref on `origin` and stops if it exists or cannot be checked;
254
- 5. applies the patch version bump and verifies it matches the preview;
255
- 6. runs `uv lock` and `uv sync`;
256
- 7. exports locked production requirements;
257
- 8. stages and commits the changes;
258
- 9. creates the returned annotated tag unchanged; and
259
- 10. atomically pushes the explicit branch and tag refs with `--follow-tags`.
260
-
261
- Do not offer alternate bump modes, a no-push mode, or a hand-written sequence
262
- of equivalent commands. Do not call `sync-after-commit` or any backend repair
263
- endpoint. The GitHub branch-push webhook owns backend repository
264
- reconciliation.
296
+ With that example, a `tag_regex` such as `^v[0-9]+\.[0-9]+\.[0-9]+$` deploys
297
+ only the commits CI tagged. Details:
298
+ <https://mainsequence-sdk.github.io/mainsequence-sdk/knowledge/infrastructure/scheduling_jobs/>
299
+
300
+ Do not call `sync-after-commit` or any backend repair endpoint. The GitHub
301
+ branch-push webhook owns backend repository reconciliation.
265
302
 
266
303
  ## Diagnose Partial Completion Before Retrying
267
304
 
@@ -273,12 +310,10 @@ Never rerun an entire mutating workflow blindly.
273
310
  environment, and the failed command before retrying.
274
311
  - After a skill refresh failure, keep the previous managed tree and identify
275
312
  whether the SDK or platform lane failed.
276
- - After a sync failure, inspect `git status`, `git log -1`, the current package
277
- version, tags pointing at `HEAD`, the upstream branch, and remote tags before
278
- deciding which step remains.
279
-
280
- A blind sync retry may create another patch bump or collide with an existing
281
- commit or tag.
313
+ - After a dependency sync failure, inspect `pyproject.toml`, `uv.lock`, and the
314
+ exact failing `uv` output; the command stops at the first failing step.
315
+ - After a push failure, inspect `git status`, `git log -1`, and the upstream
316
+ branch before retrying.
282
317
 
283
318
  ## Validate And Report
284
319
 
@@ -289,7 +324,7 @@ documentation, and the changed files. Report:
289
324
  - the code repository path and installed SDK version;
290
325
  - files or generated state changed;
291
326
  - validation run and its result;
292
- - whether changes remain local or were committed, tagged, and pushed;
327
+ - whether changes remain local or were committed and pushed;
293
328
  - any remaining authentication, environment, Git, or webhook verification
294
329
  gap.
295
330
 
@@ -217,24 +217,33 @@ For deployed APIs, agents, or other supported resources:
217
217
 
218
218
  ### 6.1 Automatic ResourceRelease deployment
219
219
 
220
- `automatic_deployment` is the automated deployment opt-in flag on a `ResourceRelease`. It means repository synchronization can rotate an existing release to the latest synced CodeRepository commit for the same resource path.
220
+ `automatic_deployment` is the automated deployment opt-in flag on a `ResourceRelease`. It means a Git push can rotate an existing release to the pushed CodeRepository commit for the same resource path.
221
221
 
222
- When `automatic_deployment=True`, repository-sync events may create a unified `DeploymentRun` with `target_type="resource_release"` and source `repository_event`. That run:
222
+ Automatic deployment and its `tag_regex` are set in the repository's `.mainsequence/workflows/*.yaml` only. A `ResourceRelease` or `Job` update does not accept `automatic_deployment` or `automatic_redeployment_policy`; the SDK models expose both as read-only fields. Change the workflow file, commit it, and push it.
223
223
 
224
- - reads the CodeRepository's current synced commit
224
+ The declaration's `tag_regex` decides which pushes deploy:
225
+
226
+ - omitted or `null`: every push to the branch deploys
227
+ - a regular expression: a push deploys only when a matching tag points at the branch's latest commit
228
+
229
+ The platform does not create or name tags. Release tags come from the repository's own CI, for example a GitHub Actions workflow that tags the version declared in `pyproject.toml` after the tests pass. The maintenance skill `.agents/skills/mainsequence/maintenance/code_repository_maintenance/SKILL.md` has an example. `mainsequence code-repository sync` only refreshes `uv.lock`, the local environment, and `requirements.txt`; it does not commit, tag, or push.
230
+
231
+ When `automatic_deployment=True`, a qualifying push may create a unified `DeploymentRun` with `target_type="resource_release"` and source `repository_event`. That run:
232
+
233
+ - reads the pushed commit
225
234
  - resolves the current code repository resource at the release's existing resource path
226
235
  - resolves supporting resources required by the release kind
227
236
  - creates or resolves the code repository image for that commit
228
237
  - redeploys the existing release to the current resource, README, and code repository image
229
238
  - records state, phase, outcome, revision context, artifact context, steps, logs, result, and errors on the deployment run
230
239
 
231
- This is not a local development shortcut. It does not deploy unpushed local files. The repository must be pushed, the code repository must be synced, and code repository resource discovery must find the resource at the same path for the current commit.
240
+ This is not a local development shortcut. It does not deploy unpushed local files. The commit must be pushed, carry a matching tag when the workflow sets a `tag_regex`, and code repository resource discovery must find the resource at the same path for that commit.
232
241
 
233
242
  Enable `automatic_deployment` only when:
234
243
 
235
- - the release should track the CodeRepository's synced version
244
+ - the release should track the branch's pushed commits, or its tagged releases when a `tag_regex` is set
236
245
  - the resource path is stable across commits
237
- - the current synced branch/version is an acceptable deployment source for that release
246
+ - the pushed branch, and its tags when a `tag_regex` is set, are an acceptable deployment source for that release
238
247
  - required supporting resources are available for the current commit
239
248
  - the team accepts CI/CD-style rotation for this release
240
249
 
@@ -244,7 +253,7 @@ Keep `automatic_deployment` disabled when:
244
253
  - each release rotation needs human approval
245
254
  - the resource path or entrypoint is still moving
246
255
  - API or widget contracts are not stable enough for automatic rotation
247
- - the current branch/CodeRepository sync target is not the intended deployment source
256
+ - the pushed branch is not the intended deployment source
248
257
 
249
258
  Declare opted-in releases in the repository workflow and validate the file
250
259
  against the backend template. Repository events create deployment runs.
@@ -276,7 +285,8 @@ When reviewing an orchestration task, look for:
276
285
  - no run/log verification after creation
277
286
  - unsafe use of `--strict`
278
287
  - workflows depending on laptop-specific file paths instead of Artifacts
279
- - `automatic_deployment` enabled without an explicit decision about repository-sync CI/CD rotation
288
+ - `automatic_deployment` enabled without an explicit decision about push-driven CI/CD rotation and `tag_regex`
289
+ - client code that tries to set `automatic_deployment` or `automatic_redeployment_policy` through a release or Job update instead of the workflow file
280
290
  - assumptions that automatic deployment will deploy local unpushed changes
281
291
  - automatic release rotation where the resource path or required supporting resources are not stable
282
292
  - tasks that are really resource/release problems rather than simple job problems
@@ -297,7 +307,8 @@ Do not claim success until you have checked:
297
307
  - runs and logs were inspected when execution success matters
298
308
  - resources and releases were verified when deployment success matters
299
309
  - `automatic_deployment` is intentionally enabled or disabled on each release
300
- - automatic deployment runs were inspected when repository-sync rotation matters
310
+ - the workflow's `tag_regex` is intentional, and the repository's CI creates matching tags when one is set
311
+ - automatic deployment runs were inspected when push-driven rotation matters
301
312
  - automatic deployment results match the intended commit, resource, README, image, and terminal status
302
313
 
303
314
  If the workflow uses `.mainsequence/workflows/`, also check:
@@ -320,7 +331,7 @@ If the workflow uses Artifacts, also check:
320
331
  - a Job workflow cannot resolve an exact source image
321
332
  - an automatically deployed Job has no persisted synchronized CodeRepositoryBranch commit
322
333
  - the workflow depends on local file paths that should be platform Artifacts
323
- - automatic deployment is requested but the deployment source branch/current synced CodeRepository version is unclear
334
+ - automatic deployment is requested but the deployment source branch or its `tag_regex` is unclear
324
335
  - automatic deployment is requested but the resource path or required README is not stable
325
336
  - the task is actually about RBAC policy rather than orchestration
326
337
  - the task is actually about producer semantics rather than platform execution
@@ -54,7 +54,7 @@ Do not let this skill become a domain manual.
54
54
  - CodeRepository audits, blocker analysis, and upstream SDK assessment:
55
55
  `.agents/skills/mainsequence/maintenance/bug_auditor/SKILL.md`
56
56
  - local environment repair, CodeRepository authentication refresh, SDK updates,
57
- managed skill refresh, and canonical CodeRepository sync:
57
+ managed skill refresh, dependency sync, and publishing with Git:
58
58
  `.agents/skills/mainsequence/maintenance/code_repository_maintenance/SKILL.md`
59
59
  - jobs, schedules, artifacts, images, resources, and releases:
60
60
  `.agents/skills/mainsequence/platform_operations/orchestration_and_releases/SKILL.md`
@@ -949,36 +949,6 @@ def get_code_repository_repository(
949
949
  raise ApiError(f"GitHubRepositoryBinding fetch failed: {e}") from e
950
950
 
951
951
 
952
- def render_code_repository_branch_default_redeployment_tag(
953
- code_repository_branch_uid: str,
954
- *,
955
- version: str,
956
- ) -> str:
957
- normalized_uid = str(code_repository_branch_uid).strip()
958
- normalized_version = str(version).strip()
959
- if not normalized_uid:
960
- raise ApiError("CodeRepositoryBranch UID is required.")
961
- if not normalized_version:
962
- raise ApiError("CodeRepository version is required.")
963
-
964
- r = authed(
965
- "POST",
966
- f"/api/v1/code-repository-branches/{normalized_uid}/default-redeployment-tag/",
967
- {"version": normalized_version},
968
- )
969
- if not r.ok:
970
- raise ApiError(f"Default redeployment tag rendering failed ({r.status_code}).")
971
- payload = r.json()
972
- if not isinstance(payload, dict):
973
- raise ApiError("Default redeployment tag rendering returned an unexpected payload.")
974
- if str(payload.get("version") or "").strip() != normalized_version:
975
- raise ApiError("Default redeployment tag rendering returned another version.")
976
- tag_name = str(payload.get("tag_name") or "").strip()
977
- if not tag_name:
978
- raise ApiError("Default redeployment tag rendering returned no tag name.")
979
- return tag_name
980
-
981
-
982
952
  def resolve_code_repository_branch_uid(code_repository_branch_ref: str) -> str:
983
953
  payload = get_code_repository_branch(code_repository_branch_ref)
984
954
  normalized_uid = str(payload.get("uid") or "").strip()