codexspec 0.7.20__tar.gz → 0.7.21__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.
- {codexspec-0.7.20 → codexspec-0.7.21}/PKG-INFO +16 -2
- {codexspec-0.7.20 → codexspec-0.7.21}/README.md +15 -1
- {codexspec-0.7.20 → codexspec-0.7.21}/pyproject.toml +1 -1
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/__init__.py +85 -16
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/automation.py +243 -148
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/commands/installer.py +7 -0
- codexspec-0.7.21/src/codexspec/commit_guidance.py +76 -0
- codexspec-0.7.21/src/codexspec/commit_runtime.py +496 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/integrations/codex.py +2 -0
- codexspec-0.7.21/src/codexspec/merge_commits.py +48 -0
- codexspec-0.7.21/src/codexspec/staged_commits.py +226 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/worktrees.py +8 -23
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/analyze.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/auto-dev.md +83 -17
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/blueprint.md +46 -9
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/checklist.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/clarify.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/commit-staged.md +122 -102
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/config.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/constitution.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/debug.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/design-to-plan.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/distill.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/evolve.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/generate-spec.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/implement-tasks.md +29 -10
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/onboard.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/plan-to-tasks.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/pr.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/quick.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/release-notes.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/reverse-spec.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/review-code.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/review-design.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/review-plan.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/review-spec.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/review-tasks.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/spec-to-design.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/specify.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/commands/tasks-to-issues.md +23 -8
- {codexspec-0.7.20 → codexspec-0.7.21}/.gitignore +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/LICENSE +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/codexspec-icon.svg +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/codexspec-logo-dark.svg +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/codexspec-logo-light.svg +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/bash/check-i18n-completeness.sh +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/bash/check-i18n-structure.sh +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/bash/check-prerequisites.sh +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/bash/common.sh +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/bash/create-new-feature.sh +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/bash/review-context.sh +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/powershell/check-prerequisites.ps1 +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/powershell/common.ps1 +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/powershell/create-new-feature.ps1 +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/scripts/powershell/review-context.ps1 +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/blueprint.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/commands/__init__.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/__init__.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/app.js +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/ar.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/de.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/en.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/es.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/fr.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/hi.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/it.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/ja.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/ko.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/pt.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/ru.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/zh-CN.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/i18n/zh-TW.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/index.html +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/assets/styles.css +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/domain.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/lease.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/models.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/records.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/server.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/session.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/terminal.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/distill_review/transaction.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/i18n.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/idea.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/integrations/__init__.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/integrations/base.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/integrations/claude.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/profile.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/src/codexspec/translator.py +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/checklist-template.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/constitution-template.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/design-template.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/plan-template-detailed.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/plan-template-simple.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/requirements-template.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/spec-template-detailed.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/spec-template-simple.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/tasks-template-detailed.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/docs/tasks-template-simple.md +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/de.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/en.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/es.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/fr.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/ja.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/ko.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/pt-BR.json +0 -0
- {codexspec-0.7.20 → codexspec-0.7.21}/templates/translations/zh-CN.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: codexspec
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.21
|
|
4
4
|
Summary: CodexSpec - A Requirements-First SDD toolkit for Claude Code
|
|
5
5
|
Project-URL: Homepage, https://github.com/Zts0hg/codexspec
|
|
6
6
|
Project-URL: Repository, https://github.com/Zts0hg/codexspec
|
|
@@ -349,7 +349,7 @@ The config command will guide you through:
|
|
|
349
349
|
| Method | Best For | Features |
|
|
350
350
|
|--------|----------|----------|
|
|
351
351
|
| **CLI Installation** (`uv tool install`) | Full development workflow | CLI commands (`init`, `check`, `config`) + slash commands |
|
|
352
|
-
| **Plugin Marketplace** | Quick start, existing projects | Slash commands
|
|
352
|
+
| **Plugin Marketplace** | Quick start, existing projects | Slash commands + automatic commit guidance (use `/codexspec:config` for language setup) |
|
|
353
353
|
|
|
354
354
|
**Note**: The plugin uses `strict: false` mode and reuses the existing multi-language support via LLM dynamic translation.
|
|
355
355
|
|
|
@@ -617,6 +617,11 @@ Implementation follows **conditional TDD workflow**:
|
|
|
617
617
|
|
|
618
618
|
#### Git Workflow Commands
|
|
619
619
|
|
|
620
|
+
Agents invoke `commit-staged` before authorized commits, including auto-dev and
|
|
621
|
+
blueprint commits. The caller prepares staging; the command generates a subject
|
|
622
|
+
and any needed body from the staged diff only. Helper workflows use preview
|
|
623
|
+
analysis and verify that the finalized commit matches the analyzed content.
|
|
624
|
+
|
|
620
625
|
| Command | Description |
|
|
621
626
|
| -------------------------- | ------------------------------------------------- |
|
|
622
627
|
| `/codexspec:commit-staged` | Generate commit message from staged changes |
|
|
@@ -835,6 +840,8 @@ Contributions are welcome! Please read the contributing guidelines before submit
|
|
|
835
840
|
|
|
836
841
|
MIT License - see [LICENSE](LICENSE) for details.
|
|
837
842
|
|
|
843
|
+
The commit-staged runtime is bundled with Claude plugins and copied by init to `.codexspec/scripts/commit-staged-helper.py`, including one-time uvx initialization. Direct preview and authorized in-place commits require Python 3.11+ and Git, but no persistent CodexSpec CLI. The current agent generates the message; the shared helper validates and executes it. Worktree routing, blueprint and auto-dev keep their existing CLI prerequisites.
|
|
844
|
+
|
|
838
845
|
## Acknowledgements
|
|
839
846
|
|
|
840
847
|
- Inspired by [GitHub spec-kit](https://github.com/github/spec-kit)
|
|
@@ -846,3 +853,10 @@ Blueprint and auto-dev retain their fixed shared worktree. Standalone project ed
|
|
|
846
853
|
use a maintenance worktree; settings take effect per checkout and reach other checkouts
|
|
847
854
|
through Git integration. See [worktree development](docs/en/user-guide/workflow.md#worktree-development)
|
|
848
855
|
and [configuration](docs/en/reference/configuration.md#workflowworktrees).
|
|
856
|
+
|
|
857
|
+
The enabled Claude plugin loads the same commit guidance at session start,
|
|
858
|
+
including resumed sessions, through its bundled `hooks/hooks.json`. This requires
|
|
859
|
+
Git on PATH and a Claude Code version supporting command-hook `args` (exec form).
|
|
860
|
+
It does not initialize the project or modify its Git state. Initialized projects
|
|
861
|
+
receive the rule in CLAUDE.md or AGENTS.md. The guidance tells the agent to invoke
|
|
862
|
+
commit-staged; it is not a Git-wide interceptor for manual terminal commands.
|
|
@@ -304,7 +304,7 @@ The config command will guide you through:
|
|
|
304
304
|
| Method | Best For | Features |
|
|
305
305
|
|--------|----------|----------|
|
|
306
306
|
| **CLI Installation** (`uv tool install`) | Full development workflow | CLI commands (`init`, `check`, `config`) + slash commands |
|
|
307
|
-
| **Plugin Marketplace** | Quick start, existing projects | Slash commands
|
|
307
|
+
| **Plugin Marketplace** | Quick start, existing projects | Slash commands + automatic commit guidance (use `/codexspec:config` for language setup) |
|
|
308
308
|
|
|
309
309
|
**Note**: The plugin uses `strict: false` mode and reuses the existing multi-language support via LLM dynamic translation.
|
|
310
310
|
|
|
@@ -572,6 +572,11 @@ Implementation follows **conditional TDD workflow**:
|
|
|
572
572
|
|
|
573
573
|
#### Git Workflow Commands
|
|
574
574
|
|
|
575
|
+
Agents invoke `commit-staged` before authorized commits, including auto-dev and
|
|
576
|
+
blueprint commits. The caller prepares staging; the command generates a subject
|
|
577
|
+
and any needed body from the staged diff only. Helper workflows use preview
|
|
578
|
+
analysis and verify that the finalized commit matches the analyzed content.
|
|
579
|
+
|
|
575
580
|
| Command | Description |
|
|
576
581
|
| -------------------------- | ------------------------------------------------- |
|
|
577
582
|
| `/codexspec:commit-staged` | Generate commit message from staged changes |
|
|
@@ -790,6 +795,8 @@ Contributions are welcome! Please read the contributing guidelines before submit
|
|
|
790
795
|
|
|
791
796
|
MIT License - see [LICENSE](LICENSE) for details.
|
|
792
797
|
|
|
798
|
+
The commit-staged runtime is bundled with Claude plugins and copied by init to `.codexspec/scripts/commit-staged-helper.py`, including one-time uvx initialization. Direct preview and authorized in-place commits require Python 3.11+ and Git, but no persistent CodexSpec CLI. The current agent generates the message; the shared helper validates and executes it. Worktree routing, blueprint and auto-dev keep their existing CLI prerequisites.
|
|
799
|
+
|
|
793
800
|
## Acknowledgements
|
|
794
801
|
|
|
795
802
|
- Inspired by [GitHub spec-kit](https://github.com/github/spec-kit)
|
|
@@ -801,3 +808,10 @@ Blueprint and auto-dev retain their fixed shared worktree. Standalone project ed
|
|
|
801
808
|
use a maintenance worktree; settings take effect per checkout and reach other checkouts
|
|
802
809
|
through Git integration. See [worktree development](docs/en/user-guide/workflow.md#worktree-development)
|
|
803
810
|
and [configuration](docs/en/reference/configuration.md#workflowworktrees).
|
|
811
|
+
|
|
812
|
+
The enabled Claude plugin loads the same commit guidance at session start,
|
|
813
|
+
including resumed sessions, through its bundled `hooks/hooks.json`. This requires
|
|
814
|
+
Git on PATH and a Claude Code version supporting command-hook `args` (exec form).
|
|
815
|
+
It does not initialize the project or modify its Git state. Initialized projects
|
|
816
|
+
receive the rule in CLAUDE.md or AGENTS.md. The guidance tells the agent to invoke
|
|
817
|
+
commit-staged; it is not a Git-wide interceptor for manual terminal commands.
|
|
@@ -46,6 +46,7 @@ from .commands.installer import (
|
|
|
46
46
|
should_update_commands,
|
|
47
47
|
update_installed_command_frontmatter,
|
|
48
48
|
)
|
|
49
|
+
from .commit_guidance import inject_commit_guidance
|
|
49
50
|
from .distill_review.domain import ReviewError, ReviewService
|
|
50
51
|
from .distill_review.lease import ActiveSessionError, ReviewLease
|
|
51
52
|
from .distill_review.server import create_server
|
|
@@ -77,7 +78,7 @@ from .worktrees import (
|
|
|
77
78
|
)
|
|
78
79
|
|
|
79
80
|
# Version info
|
|
80
|
-
__version__ = "0.7.
|
|
81
|
+
__version__ = "0.7.21"
|
|
81
82
|
__author__ = "CodexSpec Team"
|
|
82
83
|
|
|
83
84
|
# Constitution file path constants
|
|
@@ -109,6 +110,12 @@ def worktree_helper(
|
|
|
109
110
|
root = checkout_root(Path.cwd())
|
|
110
111
|
if action == "setting":
|
|
111
112
|
result = {"enabled": read_worktrees(root / ".codexspec/config.yml")}
|
|
113
|
+
elif action == "finish-initial" and verification:
|
|
114
|
+
from .automation import finish_initial_workspace
|
|
115
|
+
|
|
116
|
+
result = finish_initial_workspace(
|
|
117
|
+
locate_repository(root), json.loads(verification.read_text(encoding="utf-8"))
|
|
118
|
+
)
|
|
112
119
|
elif action == "route":
|
|
113
120
|
result = {"status": "ready", "workspace": str(write_destination(root))}
|
|
114
121
|
elif action == "create" and not read_worktrees(root / ".codexspec/config.yml"):
|
|
@@ -388,10 +395,30 @@ def _stdin_json() -> dict:
|
|
|
388
395
|
|
|
389
396
|
|
|
390
397
|
def _automation_failure(exc: Exception) -> None:
|
|
398
|
+
if isinstance(exc, AutomationError) and exc.code == "initial_merge_requires_verification":
|
|
399
|
+
_machine_json(json.loads(str(exc).split(": ", 1)[1]))
|
|
400
|
+
raise typer.Exit(3)
|
|
391
401
|
typer.echo(str(exc), err=True)
|
|
392
402
|
raise typer.Exit(1)
|
|
393
403
|
|
|
394
404
|
|
|
405
|
+
def _analysis_request(body: dict[str, Any], *, token: bool = False) -> None:
|
|
406
|
+
keys = {"preparation_id", "analyzed_tree", "message"} | ({"token"} if token else set())
|
|
407
|
+
if set(body) != keys or not all(isinstance(body[key], str) for key in keys):
|
|
408
|
+
raise AutomationError("analysis_required", "prepare staging and use commit-staged -p before finalizing")
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
@app.command("_commit-staged-helper", hidden=True)
|
|
412
|
+
def commit_staged_helper(action: str = typer.Argument(...)) -> None:
|
|
413
|
+
"""Snapshot or commit the original index without staging files."""
|
|
414
|
+
from .commit_runtime import dispatch
|
|
415
|
+
|
|
416
|
+
try:
|
|
417
|
+
_machine_json(dispatch(action, _stdin_json() if action == "commit" else None))
|
|
418
|
+
except (AutomationError, OSError, ValueError) as exc:
|
|
419
|
+
_automation_failure(exc)
|
|
420
|
+
|
|
421
|
+
|
|
395
422
|
@app.command("_blueprint-helper", hidden=True)
|
|
396
423
|
def blueprint_helper(
|
|
397
424
|
action: str = typer.Argument(..., help="Internal helper action"),
|
|
@@ -418,9 +445,31 @@ def blueprint_helper(
|
|
|
418
445
|
}
|
|
419
446
|
)
|
|
420
447
|
return
|
|
448
|
+
if action == "prepare":
|
|
449
|
+
_machine_json(store.prepare(sys.stdin.buffer.read(), owner_token=auto_dev_token))
|
|
450
|
+
return
|
|
421
451
|
if action == "apply":
|
|
422
|
-
|
|
423
|
-
|
|
452
|
+
body = _stdin_json()
|
|
453
|
+
_analysis_request(body)
|
|
454
|
+
_machine_json(
|
|
455
|
+
store.apply_and_commit(
|
|
456
|
+
body["preparation_id"],
|
|
457
|
+
body["analyzed_tree"],
|
|
458
|
+
body["message"],
|
|
459
|
+
owner_token=auto_dev_token,
|
|
460
|
+
)
|
|
461
|
+
)
|
|
462
|
+
return
|
|
463
|
+
if action == "discard":
|
|
464
|
+
from .staged_commits import PreparedCommits
|
|
465
|
+
|
|
466
|
+
body = _stdin_json()
|
|
467
|
+
if set(body) != {"preparation_id"} or not isinstance(body["preparation_id"], str):
|
|
468
|
+
raise AutomationError("invalid_preparation")
|
|
469
|
+
if auto_dev_token is not None:
|
|
470
|
+
AutoDevOwnership(context).assert_owner(auto_dev_token)
|
|
471
|
+
PreparedCommits(workspace).discard(body["preparation_id"], kind="blueprint", token=auto_dev_token)
|
|
472
|
+
_machine_json({"state": "discarded"})
|
|
424
473
|
return
|
|
425
474
|
raise AutomationError("unsupported_blueprint_helper_action", action)
|
|
426
475
|
except (AutomationError, OwnershipError, OSError, UnicodeError, ValueError) as exc:
|
|
@@ -444,9 +493,9 @@ def auto_dev_helper(action: str = typer.Argument(..., help="Internal helper acti
|
|
|
444
493
|
if body:
|
|
445
494
|
raise AutomationError("unexpected_fields")
|
|
446
495
|
token = ownership.acquire()
|
|
447
|
-
workspace = ensure_dedicated_workspace(context)
|
|
448
|
-
service = AutoDevGit(workspace, ownership)
|
|
449
496
|
try:
|
|
497
|
+
workspace = ensure_dedicated_workspace(context)
|
|
498
|
+
service = AutoDevGit(workspace, ownership)
|
|
450
499
|
merge_recovery = service.recover_merge_ownership(token)
|
|
451
500
|
if merge_recovery["state"] == "none":
|
|
452
501
|
BlueprintStore(workspace).recover_pending_transaction(owner_token=token)
|
|
@@ -490,19 +539,34 @@ def auto_dev_helper(action: str = typer.Argument(..., help="Internal helper acti
|
|
|
490
539
|
elif action == "abort-sync":
|
|
491
540
|
result = service.abort_sync(token)
|
|
492
541
|
elif action == "continue-sync":
|
|
493
|
-
if set(body)
|
|
542
|
+
if set(body) not in (
|
|
543
|
+
{"token", "checks_passed"},
|
|
544
|
+
{"token", "checks_passed", "analysis", "message"},
|
|
545
|
+
) or not isinstance(body.get("checks_passed"), bool):
|
|
494
546
|
raise AutomationError("invalid_continue_sync_request")
|
|
495
|
-
result = service.continue_sync(
|
|
496
|
-
|
|
497
|
-
if set(body) != {"token", "feature_id", "commit_type", "description", "paths"}:
|
|
498
|
-
raise AutomationError("invalid_commit_feature_request")
|
|
499
|
-
if not all(isinstance(body[key], str) for key in ("feature_id", "commit_type", "description")):
|
|
500
|
-
raise AutomationError("invalid_commit_feature_request")
|
|
501
|
-
if not isinstance(body["paths"], list) or not all(isinstance(item, str) for item in body["paths"]):
|
|
502
|
-
raise AutomationError("invalid_commit_feature_request")
|
|
503
|
-
result = service.commit_feature(
|
|
504
|
-
token, body["feature_id"], body["commit_type"], body["description"], body["paths"]
|
|
547
|
+
result = service.continue_sync(
|
|
548
|
+
token, checks_passed=body["checks_passed"], analysis=body.get("analysis"), message=body.get("message")
|
|
505
549
|
)
|
|
550
|
+
elif action == "prepare-feature":
|
|
551
|
+
if (
|
|
552
|
+
set(body) != {"token", "feature_id", "paths"}
|
|
553
|
+
or not isinstance(body["feature_id"], str)
|
|
554
|
+
or not isinstance(body["paths"], list)
|
|
555
|
+
or not all(isinstance(path, str) for path in body["paths"])
|
|
556
|
+
):
|
|
557
|
+
raise AutomationError("invalid_prepare_feature_request")
|
|
558
|
+
result = service.prepare_feature(token, body["feature_id"], body["paths"])
|
|
559
|
+
elif action == "commit-feature":
|
|
560
|
+
_analysis_request(body, token=True)
|
|
561
|
+
result = service.commit_feature(token, body["preparation_id"], body["analyzed_tree"], body["message"])
|
|
562
|
+
elif action == "discard-feature":
|
|
563
|
+
from .staged_commits import PreparedCommits
|
|
564
|
+
|
|
565
|
+
if set(body) != {"token", "preparation_id"} or not isinstance(body["preparation_id"], str):
|
|
566
|
+
raise AutomationError("invalid_preparation")
|
|
567
|
+
ownership.assert_owner(token)
|
|
568
|
+
PreparedCommits(workspace).discard(body["preparation_id"], kind="feature", token=token)
|
|
569
|
+
result = {"state": "discarded"}
|
|
506
570
|
else:
|
|
507
571
|
raise AutomationError("unsupported_auto_dev_helper_action", action)
|
|
508
572
|
_machine_json(result)
|
|
@@ -1186,6 +1250,10 @@ def init(
|
|
|
1186
1250
|
ensure_profile_scaffold(target_dir)
|
|
1187
1251
|
ensure_runtime_ignored(target_dir, install_managed_file=True)
|
|
1188
1252
|
|
|
1253
|
+
from .commit_runtime import install_helper
|
|
1254
|
+
|
|
1255
|
+
install_helper(codexspec_dir / "scripts")
|
|
1256
|
+
|
|
1189
1257
|
# Copy helper scripts based on platform
|
|
1190
1258
|
scripts_source_dir = get_scripts_dir()
|
|
1191
1259
|
if scripts_source_dir.exists():
|
|
@@ -1367,6 +1435,7 @@ def init(
|
|
|
1367
1435
|
# Inject the profile block AFTER creation/compliance so it never clobbers
|
|
1368
1436
|
# the compliance @import or the user's body (bounded, idempotent).
|
|
1369
1437
|
inject_profile_block(claude_md)
|
|
1438
|
+
inject_commit_guidance(claude_md, "/codexspec:commit-staged")
|
|
1370
1439
|
|
|
1371
1440
|
# Initialize git if requested
|
|
1372
1441
|
if not no_git and not (target_dir / ".git").exists():
|