Repository navigation
Feat/paired autonomous orchestration - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces two major capabilities to Taskstitch: (1) strict, verified import of Taskstitch v1 project-export JSON into a fresh workspace, and (2) a new local-only paired autonomous orchestration subsystem (policy, provider adapters, durable manifests/journals/receipts, and hardened Git workflows), along with extensive unit/integration coverage and documentation updates.
Changes:
- Add strict project export v1 import pipeline (parse/validate → materialize SQLite → integrity/foreign-key/revision/content verification → publish without replacement), plus CLI
taskstitch import. - Add paired orchestration framework (policy + capability reporting, supervisor/state/journal/receipts/quarantine/locks, provider adapters, Git adapter/rebase/integration/commit gate, verification runner) plus CLI commands.
- Expand tests and docs to codify portability boundaries, orchestration contracts, and safety invariants.
Reviewed changes
Copilot reviewed 76 out of 76 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_snapshots.py | Adds direct snapshot builder parity assertion. |
| tests/unit/test_review_verification.py | Adds tests for reviewer findings validation and check runner stop-on-failure. |
| tests/unit/test_reporting_portability_workflow.py | Ensures import command help is discoverable and documented. |
| tests/unit/test_readme.py | Expands README assertions for import + updated portability wording. |
| tests/unit/test_provider_contracts.py | Adds provider JSONL/envelope contract tests. |
| tests/unit/test_persistence.py | Adds test asserting packaged Alembic head matches migrated DB. |
| tests/unit/test_orchestration_state.py | Adds state reduction + terminal reconciliation test. |
| tests/unit/test_orchestration_sqlite.py | Adds SQLite enrollment + terminal projection invariants. |
| tests/unit/test_orchestration_receipts.py | Adds receipt store publish/recover + reconstruction coverage. |
| tests/unit/test_orchestration_locks.py | Adds ordered lock acquisition + metadata tests. |
| tests/unit/test_orchestration_journal.py | Adds journal chain validation and corruption rejection tests. |
| tests/unit/test_orchestration_files.py | Adds identity-checked file primitives tests. |
| tests/unit/test_orchestration_contracts.py | Adds contract validation and fixed-limit coverage. |
| tests/unit/test_orchestration_canonical.py | Adds canonical serialization/digest/bounds tests. |
| tests/unit/test_import_workflow.py | Adds end-to-end CLI export/check/import/re-export round-trip tests. |
| tests/unit/test_import_materialization.py | Adds deep import materialization + verification tests. |
| tests/unit/test_git_adapter.py | Adds hardened git adapter allowlist tests. |
| tests/unit/test_automation_policy.py | Adds automation policy normalization and safety parsing tests. |
| tests/unit/test_automation_commands.py | Adds automation init CLI test. |
| tests/unit/test_artifacts.py | Adds safe output parent checks and publish integration test hook. |
| tests/integration/test_repair_loop.py | Adds repair/resume budget integration test. |
| tests/integration/test_rebase_recovery.py | Adds private rebase staging integration test. |
| tests/integration/test_real_provider_capabilities.py | Adds opt-in smoke test marker for real provider capability probing. |
| tests/integration/test_quarantine_resolution.py | Adds quarantine tombstone + resolution integration test. |
| tests/integration/test_provider_adapters.py | Adds adapter argv separation and capability fail-closed tests. |
| tests/integration/test_orchestration_enrollment.py | Adds transaction-level enrollment integration test. |
| tests/integration/test_orchestration_cli.py | Adds supervisor CLI-level integration surface test. |
| tests/integration/test_integration_recovery.py | Adds integration CAS/adoption behavior tests. |
| tests/integration/test_detached_worker.py | Adds detached supervisor launch/resume durability test. |
| tests/integration/test_commit_gate.py | Adds commit gate accept/reject integration tests. |
| tests/integration/test_cleanup_recovery.py | Adds cleanup behavior preservation/removal integration tests. |
| tests/integration/test_batch_reduction.py | Adds batch reduction + overlay store integration tests. |
| src/taskstitch/services/snapshots.py | Factors snapshot building into build_project_snapshot(). |
| src/taskstitch/services/imports.py | Implements verified import materialization + safe destination preparation. |
| src/taskstitch/services/import_validation.py | Adds strict JSON parsing + v1 schema/relationship/lifecycle validation. |
| src/taskstitch/services/import_errors.py | Introduces structured import error types. |
| src/taskstitch/services/exports.py | Centralizes export format constants via import schema module. |
| src/taskstitch/services/artifacts.py | Exposes ensure_safe_output_parent() and uses it in publish path. |
| src/taskstitch/schemas/import_document.py | Defines v1 project export/import document schema constants + dataclass. |
| src/taskstitch/orchestration/verification.py | Adds ordered verification runner that stops on first failure. |
| src/taskstitch/orchestration/supervisor.py | Adds durable supervisor managing orchestration batch manifests/events. |
| src/taskstitch/orchestration/state.py | Adds deterministic session/batch state reductions and reconciliation. |
| src/taskstitch/orchestration/sqlite_projection.py | Adds atomic enrollment + compact terminal projection into existing DB rows. |
| src/taskstitch/orchestration/review.py | Adds bounded reviewer finding validation. |
| src/taskstitch/orchestration/recovery.py | Adds shared repair/provider-resume budget state. |
| src/taskstitch/orchestration/receipts.py | Adds bounded receipt publication + recovery pipeline. |
| src/taskstitch/orchestration/rebase.py | Adds private rebase staging epochs with bounded evidence. |
| src/taskstitch/orchestration/quarantine.py | Adds append-only quarantine tombstones + operator resolutions. |
| src/taskstitch/orchestration/providers/codex.py | Adds restricted Codex CLI adapter argv + capability checks. |
| src/taskstitch/orchestration/providers/claude.py | Adds restricted Claude CLI adapter argv + capability checks. |
| src/taskstitch/orchestration/providers/base.py | Adds provider-neutral parsing/validation + process launching helpers. |
| src/taskstitch/orchestration/providers/init.py | Exposes provider API surface. |
| src/taskstitch/orchestration/provider_runner.py | Adds executable discovery + capability probing helpers. |
| src/taskstitch/orchestration/policy.py | Adds strict policy parsing, normalization digest, and capability reporting. |
| src/taskstitch/orchestration/locks.py | Adds ordered advisory locks with metadata and duplicate detection. |
| src/taskstitch/orchestration/limits.py | Adds fixed v1 orchestration limits and validators. |
| src/taskstitch/orchestration/journal.py | Adds request-rooted hash-chained append-only journals. |
| src/taskstitch/orchestration/integration.py | Adds local-only integration CAS flow with journaling hooks. |
| src/taskstitch/orchestration/git_adapter.py | Adds hardened local-only git command allowlist + worktree management. |
| src/taskstitch/orchestration/files.py | Adds identity-checked filesystem primitives and disposable tree handling. |
| src/taskstitch/orchestration/contracts.py | Adds provider-neutral immutable orchestration contracts/envelopes. |
| src/taskstitch/orchestration/commit_gate.py | Adds private-index commit gate with CAS to managed ref. |
| src/taskstitch/orchestration/cleanup.py | Adds conservative, identity-checked cleanup manager. |
| src/taskstitch/orchestration/canonical.py | Adds canonical bounded JSON + digest primitives. |
| src/taskstitch/orchestration/batch.py | Adds batch reduction + member overlays store. |
| src/taskstitch/orchestration/init.py | Exposes orchestration primitives as a package API. |
| src/taskstitch/db/migrate.py | Adds packaged Alembic head discovery helper. |
| src/taskstitch/commands/portability.py | Adds taskstitch import command wiring + output formatting. |
| src/taskstitch/commands/orchestration.py | Adds taskstitch orchestrate command group and management commands. |
| src/taskstitch/commands/automation.py | Adds taskstitch automation init/check commands. |
| src/taskstitch/cli.py | Registers new automation and orchestration CLI command groups. |
| README.md | Documents import workflow and paired orchestration usage/safety boundaries. |
| pyproject.toml | Adds pytest marker for opt-in real provider smoke tests. |
| docs/DECISIONS.md | Records decisions for JSON import constraints and paired orchestration design. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+370
to
+376
| def capability_report(policy: AutomationPolicy) -> CapabilityReport: | ||
| git = shutil.which("git") is not None | ||
| codex = shutil.which("codex") is not None | ||
| claude = shutil.which("claude") is not None | ||
| return CapabilityReport( | ||
| policy.digest, git, codex, claude, False, bool(policy.checks) | ||
| ) |
Comment on lines
+137
to
+151
| result = subprocess.run( | ||
| command, | ||
| cwd=self.worktree, | ||
| env={ | ||
| key: value | ||
| for key, value in env.items() | ||
| if not key.startswith("GIT_") | ||
| } | ||
| | {key: value for key, value in env.items() if key.startswith("GIT_")}, | ||
| input=input_text, | ||
| text=True, | ||
| capture_output=True, | ||
| timeout=60, | ||
| check=False, | ||
| ) |
Comment on lines
+83
to
+85
| rows = session.scalars( | ||
| select(AgentRun).where(AgentRun.project_id == project_id).order_by(AgentRun.id) | ||
| ).all() |
Comment on lines
+75
to
+78
| if force: | ||
| path.rmdir() | ||
| else: | ||
| path.rmdir() |
Comment on lines
+18
to
+20
| def test_local_worktree_and_expected_tip_cas(tmp_path: Path) -> None: | ||
| adapter = _repo(tmp_path / "repo") if (tmp_path / "repo").mkdir() is None else None | ||
| assert adapter is not None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related issue
Closes #
Testing
make testmake lintmake typecheckmake buildReview checklist
.envfiles, local databases, private data, or internal plans are included.docs/DECISIONS.mdordocs/FAILURES.mdwas updated when relevant.