@blxzer/pactile 0.6.0-beta.2 → 0.6.0-beta.5
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.
- package/README.md +93 -84
- package/README.zh-CN.md +90 -81
- package/dist/bin/compat-warning.d.ts +2 -0
- package/dist/bin/compat-warning.d.ts.map +1 -0
- package/dist/bin/compat-warning.js +8 -0
- package/dist/bin/compat-warning.js.map +1 -0
- package/dist/bin/cstl.d.ts +3 -0
- package/dist/bin/cstl.d.ts.map +1 -0
- package/{bin → dist/bin}/cstl.js +2 -3
- package/dist/bin/cstl.js.map +1 -0
- package/dist/bin/pactile.d.ts +3 -0
- package/dist/bin/pactile.d.ts.map +1 -0
- package/dist/bin/pactile.js +4 -0
- package/dist/bin/pactile.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +77 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/capability.d.ts +3 -0
- package/dist/commands/capability.d.ts.map +1 -0
- package/dist/commands/capability.js +129 -0
- package/dist/commands/capability.js.map +1 -0
- package/dist/commands/codex.d.ts.map +1 -1
- package/dist/commands/codex.js +54 -6
- package/dist/commands/codex.js.map +1 -1
- package/dist/commands/context.d.ts +2 -0
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +367 -41
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/detach.d.ts.map +1 -1
- package/dist/commands/detach.js +5 -4
- package/dist/commands/detach.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +615 -259
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/legacy-task.d.ts +3 -0
- package/dist/commands/legacy-task.d.ts.map +1 -0
- package/dist/commands/legacy-task.js +295 -0
- package/dist/commands/legacy-task.js.map +1 -0
- package/dist/commands/pi.d.ts +3 -2
- package/dist/commands/pi.d.ts.map +1 -1
- package/dist/commands/pi.js +333 -10
- package/dist/commands/pi.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +148 -24
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/task-schedule.d.ts +17 -0
- package/dist/commands/task-schedule.d.ts.map +1 -0
- package/dist/commands/task-schedule.js +395 -0
- package/dist/commands/task-schedule.js.map +1 -0
- package/dist/commands/task-verify-plan.d.ts +3 -0
- package/dist/commands/task-verify-plan.d.ts.map +1 -0
- package/dist/commands/task-verify-plan.js +503 -0
- package/dist/commands/task-verify-plan.js.map +1 -0
- package/dist/commands/task-worktree-close.d.ts +4 -0
- package/dist/commands/task-worktree-close.d.ts.map +1 -0
- package/dist/commands/task-worktree-close.js +81 -0
- package/dist/commands/task-worktree-close.js.map +1 -0
- package/dist/commands/task.d.ts +3 -0
- package/dist/commands/task.d.ts.map +1 -1
- package/dist/commands/task.js +1373 -184
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tile-selection.d.ts +3 -0
- package/dist/commands/tile-selection.d.ts.map +1 -0
- package/dist/commands/tile-selection.js +174 -0
- package/dist/commands/tile-selection.js.map +1 -0
- package/dist/commands/update.d.ts +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +80 -55
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/worktree.d.ts +4 -0
- package/dist/commands/worktree.d.ts.map +1 -0
- package/dist/commands/worktree.js +198 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/configurators/shared.js +1 -1
- package/dist/configurators/shared.js.map +1 -1
- package/dist/core/compat/environment.d.ts +0 -1
- package/dist/core/compat/environment.d.ts.map +1 -1
- package/dist/core/compat/environment.js +1 -9
- package/dist/core/compat/environment.js.map +1 -1
- package/dist/core/pactile/bounded-capabilities.d.ts +127 -0
- package/dist/core/pactile/bounded-capabilities.d.ts.map +1 -0
- package/dist/core/pactile/bounded-capabilities.js +188 -0
- package/dist/core/pactile/bounded-capabilities.js.map +1 -0
- package/dist/core/pactile/index.d.ts +1 -0
- package/dist/core/pactile/index.d.ts.map +1 -1
- package/dist/core/pactile/index.js +1 -0
- package/dist/core/pactile/index.js.map +1 -1
- package/dist/core/task/index.d.ts +4 -2
- package/dist/core/task/index.d.ts.map +1 -1
- package/dist/core/task/index.js +2 -1
- package/dist/core/task/index.js.map +1 -1
- package/dist/core/task/kernel-cli.d.ts +14 -1
- package/dist/core/task/kernel-cli.d.ts.map +1 -1
- package/dist/core/task/kernel-cli.js +128 -0
- package/dist/core/task/kernel-cli.js.map +1 -1
- package/dist/core/task/kernel-contract.d.ts +6 -3
- package/dist/core/task/kernel-contract.d.ts.map +1 -1
- package/dist/core/task/kernel-contract.js +71 -23
- package/dist/core/task/kernel-contract.js.map +1 -1
- package/dist/core/task/kernel-store.d.ts +6 -0
- package/dist/core/task/kernel-store.d.ts.map +1 -1
- package/dist/core/task/kernel-store.js +54 -2
- package/dist/core/task/kernel-store.js.map +1 -1
- package/dist/core/task/legacy-task-migration-reader.d.ts +137 -0
- package/dist/core/task/legacy-task-migration-reader.d.ts.map +1 -0
- package/dist/core/task/legacy-task-migration-reader.js +512 -0
- package/dist/core/task/legacy-task-migration-reader.js.map +1 -0
- package/dist/core/task/legacy-task-migration.d.ts +105 -0
- package/dist/core/task/legacy-task-migration.d.ts.map +1 -0
- package/dist/core/task/legacy-task-migration.js +562 -0
- package/dist/core/task/legacy-task-migration.js.map +1 -0
- package/dist/core/task/legacy-task-overlay-durable-io.d.ts +18 -0
- package/dist/core/task/legacy-task-overlay-durable-io.d.ts.map +1 -0
- package/dist/core/task/legacy-task-overlay-durable-io.js +66 -0
- package/dist/core/task/legacy-task-overlay-durable-io.js.map +1 -0
- package/dist/core/task/legacy-task-reconciliation-reader.d.ts +26 -0
- package/dist/core/task/legacy-task-reconciliation-reader.d.ts.map +1 -0
- package/dist/core/task/legacy-task-reconciliation-reader.js +324 -0
- package/dist/core/task/legacy-task-reconciliation-reader.js.map +1 -0
- package/dist/core/task/legacy-task-v2-import.d.ts +67 -0
- package/dist/core/task/legacy-task-v2-import.d.ts.map +1 -0
- package/dist/core/task/legacy-task-v2-import.js +1046 -0
- package/dist/core/task/legacy-task-v2-import.js.map +1 -0
- package/dist/core/task/project-file-observer.d.ts +46 -0
- package/dist/core/task/project-file-observer.d.ts.map +1 -0
- package/dist/core/task/project-file-observer.js +618 -0
- package/dist/core/task/project-file-observer.js.map +1 -0
- package/dist/core/task/start-authority.d.ts +14 -0
- package/dist/core/task/start-authority.d.ts.map +1 -0
- package/dist/core/task/start-authority.js +146 -0
- package/dist/core/task/start-authority.js.map +1 -0
- package/dist/core/task/strategy.d.ts +24 -0
- package/dist/core/task/strategy.d.ts.map +1 -0
- package/dist/core/task/strategy.js +136 -0
- package/dist/core/task/strategy.js.map +1 -0
- package/dist/core/task/task-candidate-observer.d.ts +111 -0
- package/dist/core/task/task-candidate-observer.d.ts.map +1 -0
- package/dist/core/task/task-candidate-observer.js +762 -0
- package/dist/core/task/task-candidate-observer.js.map +1 -0
- package/dist/core/task/task-kernel-close.d.ts +5 -0
- package/dist/core/task/task-kernel-close.d.ts.map +1 -0
- package/dist/core/task/task-kernel-close.js +367 -0
- package/dist/core/task/task-kernel-close.js.map +1 -0
- package/dist/core/task/task-kernel-dependencies.d.ts +3 -0
- package/dist/core/task/task-kernel-dependencies.d.ts.map +1 -0
- package/dist/core/task/task-kernel-dependencies.js +24 -0
- package/dist/core/task/task-kernel-dependencies.js.map +1 -0
- package/dist/core/task/task-kernel-host.d.ts +5 -0
- package/dist/core/task/task-kernel-host.d.ts.map +1 -0
- package/dist/core/task/task-kernel-host.js +136 -0
- package/dist/core/task/task-kernel-host.js.map +1 -0
- package/dist/core/task/task-kernel-paths.d.ts +19 -0
- package/dist/core/task/task-kernel-paths.d.ts.map +1 -0
- package/dist/core/task/task-kernel-paths.js +237 -0
- package/dist/core/task/task-kernel-paths.js.map +1 -0
- package/dist/core/task/task-kernel-reviews.d.ts +3 -0
- package/dist/core/task/task-kernel-reviews.d.ts.map +1 -0
- package/dist/core/task/task-kernel-reviews.js +100 -0
- package/dist/core/task/task-kernel-reviews.js.map +1 -0
- package/dist/core/task/task-kernel-runs.d.ts +5 -0
- package/dist/core/task/task-kernel-runs.d.ts.map +1 -0
- package/dist/core/task/task-kernel-runs.js +196 -0
- package/dist/core/task/task-kernel-runs.js.map +1 -0
- package/dist/core/task/task-kernel-schema.d.ts +29 -0
- package/dist/core/task/task-kernel-schema.d.ts.map +1 -0
- package/dist/core/task/task-kernel-schema.js +1169 -0
- package/dist/core/task/task-kernel-schema.js.map +1 -0
- package/dist/core/task/task-kernel-store-v2.d.ts +33 -0
- package/dist/core/task/task-kernel-store-v2.d.ts.map +1 -0
- package/dist/core/task/task-kernel-store-v2.js +574 -0
- package/dist/core/task/task-kernel-store-v2.js.map +1 -0
- package/dist/core/task/task-kernel-types.d.ts +585 -0
- package/dist/core/task/task-kernel-types.d.ts.map +1 -0
- package/dist/core/task/task-kernel-types.js +31 -0
- package/dist/core/task/task-kernel-types.js.map +1 -0
- package/dist/core/task/task-kernel-workspaces.d.ts +10 -0
- package/dist/core/task/task-kernel-workspaces.d.ts.map +1 -0
- package/dist/core/task/task-kernel-workspaces.js +250 -0
- package/dist/core/task/task-kernel-workspaces.js.map +1 -0
- package/dist/core/task/task-kernel-write-set.d.ts +3 -0
- package/dist/core/task/task-kernel-write-set.d.ts.map +1 -0
- package/dist/core/task/task-kernel-write-set.js +12 -0
- package/dist/core/task/task-kernel-write-set.js.map +1 -0
- package/dist/core/task/task-kernel.d.ts +19 -0
- package/dist/core/task/task-kernel.d.ts.map +1 -0
- package/dist/core/task/task-kernel.js +17 -0
- package/dist/core/task/task-kernel.js.map +1 -0
- package/dist/core/task/task-pull-request-observer.d.ts +25 -0
- package/dist/core/task/task-pull-request-observer.d.ts.map +1 -0
- package/dist/core/task/task-pull-request-observer.js +187 -0
- package/dist/core/task/task-pull-request-observer.js.map +1 -0
- package/dist/core/task/task-review-evidence.d.ts +27 -0
- package/dist/core/task/task-review-evidence.d.ts.map +1 -0
- package/dist/core/task/task-review-evidence.js +383 -0
- package/dist/core/task/task-review-evidence.js.map +1 -0
- package/dist/migrations/index.d.ts +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +5 -3
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/manifests/0.6.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.5.json +9 -0
- package/dist/pactile/artifacts/documents.d.ts +72 -0
- package/dist/pactile/artifacts/documents.d.ts.map +1 -0
- package/dist/pactile/artifacts/documents.js +406 -0
- package/dist/pactile/artifacts/documents.js.map +1 -0
- package/dist/pactile/artifacts/index.d.ts +6 -0
- package/dist/pactile/artifacts/index.d.ts.map +1 -0
- package/dist/pactile/artifacts/index.js +6 -0
- package/dist/pactile/artifacts/index.js.map +1 -0
- package/dist/pactile/artifacts/projection.d.ts +50 -0
- package/dist/pactile/artifacts/projection.d.ts.map +1 -0
- package/dist/pactile/artifacts/projection.js +139 -0
- package/dist/pactile/artifacts/projection.js.map +1 -0
- package/dist/pactile/artifacts/reader.d.ts +20 -0
- package/dist/pactile/artifacts/reader.d.ts.map +1 -0
- package/dist/pactile/artifacts/reader.js +559 -0
- package/dist/pactile/artifacts/reader.js.map +1 -0
- package/dist/pactile/artifacts/schema.d.ts +4 -0
- package/dist/pactile/artifacts/schema.d.ts.map +1 -0
- package/dist/pactile/artifacts/schema.js +217 -0
- package/dist/pactile/artifacts/schema.js.map +1 -0
- package/dist/pactile/artifacts/types.d.ts +66 -0
- package/dist/pactile/artifacts/types.d.ts.map +1 -0
- package/dist/pactile/artifacts/types.js +45 -0
- package/dist/pactile/artifacts/types.js.map +1 -0
- package/dist/pactile/capabilities/claim.d.ts +3 -0
- package/dist/pactile/capabilities/claim.d.ts.map +1 -0
- package/dist/pactile/capabilities/claim.js +97 -0
- package/dist/pactile/capabilities/claim.js.map +1 -0
- package/dist/pactile/capabilities/command.d.ts +6 -0
- package/dist/pactile/capabilities/command.d.ts.map +1 -0
- package/dist/pactile/capabilities/command.js +253 -0
- package/dist/pactile/capabilities/command.js.map +1 -0
- package/dist/pactile/capabilities/discover.d.ts +6 -0
- package/dist/pactile/capabilities/discover.d.ts.map +1 -0
- package/dist/pactile/capabilities/discover.js +48 -0
- package/dist/pactile/capabilities/discover.js.map +1 -0
- package/dist/pactile/capabilities/node.d.ts +15 -0
- package/dist/pactile/capabilities/node.d.ts.map +1 -0
- package/dist/pactile/capabilities/node.js +292 -0
- package/dist/pactile/capabilities/node.js.map +1 -0
- package/dist/pactile/capabilities/read.d.ts +6 -0
- package/dist/pactile/capabilities/read.d.ts.map +1 -0
- package/dist/pactile/capabilities/read.js +100 -0
- package/dist/pactile/capabilities/read.js.map +1 -0
- package/dist/pactile/capabilities/receipts.d.ts +17 -0
- package/dist/pactile/capabilities/receipts.d.ts.map +1 -0
- package/dist/pactile/capabilities/receipts.js +90 -0
- package/dist/pactile/capabilities/receipts.js.map +1 -0
- package/dist/pactile/capabilities/search.d.ts +6 -0
- package/dist/pactile/capabilities/search.d.ts.map +1 -0
- package/dist/pactile/capabilities/search.js +181 -0
- package/dist/pactile/capabilities/search.js.map +1 -0
- package/dist/pactile/capabilities/shared.d.ts +29 -0
- package/dist/pactile/capabilities/shared.d.ts.map +1 -0
- package/dist/pactile/capabilities/shared.js +134 -0
- package/dist/pactile/capabilities/shared.js.map +1 -0
- package/dist/pactile/capabilities/workspace.d.ts +19 -0
- package/dist/pactile/capabilities/workspace.d.ts.map +1 -0
- package/dist/pactile/capabilities/workspace.js +273 -0
- package/dist/pactile/capabilities/workspace.js.map +1 -0
- package/dist/pactile/codex/bridge.d.ts +105 -2
- package/dist/pactile/codex/bridge.d.ts.map +1 -1
- package/dist/pactile/codex/bridge.js +1266 -92
- package/dist/pactile/codex/bridge.js.map +1 -1
- package/dist/pactile/codex/dispatch-stop-proof.d.ts +43 -0
- package/dist/pactile/codex/dispatch-stop-proof.d.ts.map +1 -0
- package/dist/pactile/codex/dispatch-stop-proof.js +177 -0
- package/dist/pactile/codex/dispatch-stop-proof.js.map +1 -0
- package/dist/pactile/codex/host-stop.d.ts +47 -0
- package/dist/pactile/codex/host-stop.d.ts.map +1 -0
- package/dist/pactile/codex/host-stop.js +344 -0
- package/dist/pactile/codex/host-stop.js.map +1 -0
- package/dist/pactile/coordination/index.d.ts +4 -0
- package/dist/pactile/coordination/index.d.ts.map +1 -0
- package/dist/pactile/coordination/index.js +4 -0
- package/dist/pactile/coordination/index.js.map +1 -0
- package/dist/pactile/coordination/journal.d.ts +10 -0
- package/dist/pactile/coordination/journal.d.ts.map +1 -0
- package/dist/pactile/coordination/journal.js +255 -0
- package/dist/pactile/coordination/journal.js.map +1 -0
- package/dist/pactile/coordination/kernel-resume.d.ts +8 -0
- package/dist/pactile/coordination/kernel-resume.d.ts.map +1 -0
- package/dist/pactile/coordination/kernel-resume.js +87 -0
- package/dist/pactile/coordination/kernel-resume.js.map +1 -0
- package/dist/pactile/coordination/model.d.ts +553 -0
- package/dist/pactile/coordination/model.d.ts.map +1 -0
- package/dist/pactile/coordination/model.js +239 -0
- package/dist/pactile/coordination/model.js.map +1 -0
- package/dist/pactile/coordination/state.d.ts +46 -0
- package/dist/pactile/coordination/state.d.ts.map +1 -0
- package/dist/pactile/coordination/state.js +301 -0
- package/dist/pactile/coordination/state.js.map +1 -0
- package/dist/pactile/coordination/store.d.ts +94 -0
- package/dist/pactile/coordination/store.d.ts.map +1 -0
- package/dist/pactile/coordination/store.js +396 -0
- package/dist/pactile/coordination/store.js.map +1 -0
- package/dist/pactile/index.d.ts +7 -1
- package/dist/pactile/index.d.ts.map +1 -1
- package/dist/pactile/index.js +7 -1
- package/dist/pactile/index.js.map +1 -1
- package/dist/pactile/jev/contracts.d.ts +104 -0
- package/dist/pactile/jev/contracts.d.ts.map +1 -0
- package/dist/pactile/jev/contracts.js +53 -0
- package/dist/pactile/jev/contracts.js.map +1 -0
- package/dist/pactile/jev/decision.d.ts +58 -0
- package/dist/pactile/jev/decision.d.ts.map +1 -0
- package/dist/pactile/jev/decision.js +149 -0
- package/dist/pactile/jev/decision.js.map +1 -0
- package/dist/pactile/jev/http.d.ts +25 -0
- package/dist/pactile/jev/http.d.ts.map +1 -0
- package/dist/pactile/jev/http.js +234 -0
- package/dist/pactile/jev/http.js.map +1 -0
- package/dist/pactile/jev/index.d.ts +8 -0
- package/dist/pactile/jev/index.d.ts.map +1 -0
- package/dist/pactile/jev/index.js +4 -0
- package/dist/pactile/jev/index.js.map +1 -0
- package/dist/pactile/jev/outbound.d.ts +15 -0
- package/dist/pactile/jev/outbound.d.ts.map +1 -0
- package/dist/pactile/jev/outbound.js +264 -0
- package/dist/pactile/jev/outbound.js.map +1 -0
- package/dist/pactile/jev/project-policy.d.ts +10 -0
- package/dist/pactile/jev/project-policy.d.ts.map +1 -0
- package/dist/pactile/jev/project-policy.js +53 -0
- package/dist/pactile/jev/project-policy.js.map +1 -0
- package/dist/pactile/jev/response.d.ts +17 -0
- package/dist/pactile/jev/response.d.ts.map +1 -0
- package/dist/pactile/jev/response.js +280 -0
- package/dist/pactile/jev/response.js.map +1 -0
- package/dist/pactile/jev/scheduler-advice.d.ts +92 -0
- package/dist/pactile/jev/scheduler-advice.d.ts.map +1 -0
- package/dist/pactile/jev/scheduler-advice.js +323 -0
- package/dist/pactile/jev/scheduler-advice.js.map +1 -0
- package/dist/pactile/jev/transport.d.ts +6 -0
- package/dist/pactile/jev/transport.d.ts.map +1 -0
- package/dist/pactile/jev/transport.js +87 -0
- package/dist/pactile/jev/transport.js.map +1 -0
- package/dist/pactile/lifecycle/deferred-live.d.ts +17 -0
- package/dist/pactile/lifecycle/deferred-live.d.ts.map +1 -0
- package/dist/pactile/lifecycle/deferred-live.js +173 -0
- package/dist/pactile/lifecycle/deferred-live.js.map +1 -0
- package/dist/pactile/lifecycle/legacy-import.d.ts +1 -1
- package/dist/pactile/lifecycle/legacy-import.js +3 -3
- package/dist/pactile/lifecycle/legacy-import.js.map +1 -1
- package/dist/pactile/lifecycle/project-files.d.ts.map +1 -1
- package/dist/pactile/lifecycle/project-files.js +1 -0
- package/dist/pactile/lifecycle/project-files.js.map +1 -1
- package/dist/pactile/migration/legacy-task-batch-generation.d.ts +23 -0
- package/dist/pactile/migration/legacy-task-batch-generation.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-generation.js +102 -0
- package/dist/pactile/migration/legacy-task-batch-generation.js.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-io.d.ts +9 -0
- package/dist/pactile/migration/legacy-task-batch-io.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-io.js +208 -0
- package/dist/pactile/migration/legacy-task-batch-io.js.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-journal.d.ts +6 -0
- package/dist/pactile/migration/legacy-task-batch-journal.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-journal.js +121 -0
- package/dist/pactile/migration/legacy-task-batch-journal.js.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-orchestrator.d.ts +18 -0
- package/dist/pactile/migration/legacy-task-batch-orchestrator.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-orchestrator.js +634 -0
- package/dist/pactile/migration/legacy-task-batch-orchestrator.js.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-source.d.ts +8 -0
- package/dist/pactile/migration/legacy-task-batch-source.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-source.js +158 -0
- package/dist/pactile/migration/legacy-task-batch-source.js.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-types.d.ts +127 -0
- package/dist/pactile/migration/legacy-task-batch-types.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-batch-types.js +127 -0
- package/dist/pactile/migration/legacy-task-batch-types.js.map +1 -0
- package/dist/pactile/migration/legacy-task-batch.d.ts +3 -0
- package/dist/pactile/migration/legacy-task-batch.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-batch.js +2 -0
- package/dist/pactile/migration/legacy-task-batch.js.map +1 -0
- package/dist/pactile/migration/legacy-task-held-source-reader.d.ts +27 -0
- package/dist/pactile/migration/legacy-task-held-source-reader.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-held-source-reader.js +261 -0
- package/dist/pactile/migration/legacy-task-held-source-reader.js.map +1 -0
- package/dist/pactile/migration/legacy-task-reconciliation.d.ts +46 -0
- package/dist/pactile/migration/legacy-task-reconciliation.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-reconciliation.js +589 -0
- package/dist/pactile/migration/legacy-task-reconciliation.js.map +1 -0
- package/dist/pactile/migration/legacy-task-update.d.ts +19 -0
- package/dist/pactile/migration/legacy-task-update.d.ts.map +1 -0
- package/dist/pactile/migration/legacy-task-update.js +164 -0
- package/dist/pactile/migration/legacy-task-update.js.map +1 -0
- package/dist/pactile/parallel/batch.d.ts +21 -2
- package/dist/pactile/parallel/batch.d.ts.map +1 -1
- package/dist/pactile/parallel/batch.js +271 -50
- package/dist/pactile/parallel/batch.js.map +1 -1
- package/dist/pactile/parallel/policy.d.ts +1 -1
- package/dist/pactile/parallel/policy.d.ts.map +1 -1
- package/dist/pactile/parallel/policy.js +130 -102
- package/dist/pactile/parallel/policy.js.map +1 -1
- package/dist/pactile/pi/bridge.d.ts +139 -2
- package/dist/pactile/pi/bridge.d.ts.map +1 -1
- package/dist/pactile/pi/bridge.js +1317 -106
- package/dist/pactile/pi/bridge.js.map +1 -1
- package/dist/pactile/pi/rpc.d.ts +23 -4
- package/dist/pactile/pi/rpc.d.ts.map +1 -1
- package/dist/pactile/pi/rpc.js +243 -42
- package/dist/pactile/pi/rpc.js.map +1 -1
- package/dist/pactile/pi/v2-dispatch.d.ts +113 -0
- package/dist/pactile/pi/v2-dispatch.d.ts.map +1 -0
- package/dist/pactile/pi/v2-dispatch.js +919 -0
- package/dist/pactile/pi/v2-dispatch.js.map +1 -0
- package/dist/pactile/projection/planner.js +1 -1
- package/dist/pactile/projection/planner.js.map +1 -1
- package/dist/pactile/registry.d.ts +63 -1
- package/dist/pactile/registry.d.ts.map +1 -1
- package/dist/pactile/registry.js +633 -4
- package/dist/pactile/registry.js.map +1 -1
- package/dist/pactile/retrieval/index.d.ts +1 -0
- package/dist/pactile/retrieval/index.d.ts.map +1 -1
- package/dist/pactile/retrieval/index.js +1 -0
- package/dist/pactile/retrieval/index.js.map +1 -1
- package/dist/pactile/retrieval/jev-planning.d.ts +28 -0
- package/dist/pactile/retrieval/jev-planning.d.ts.map +1 -0
- package/dist/pactile/retrieval/jev-planning.js +96 -0
- package/dist/pactile/retrieval/jev-planning.js.map +1 -0
- package/dist/pactile/review/contract.d.ts +232 -0
- package/dist/pactile/review/contract.d.ts.map +1 -0
- package/dist/pactile/review/contract.js +695 -0
- package/dist/pactile/review/contract.js.map +1 -0
- package/dist/pactile/review/escalation-artifacts.d.ts +41 -0
- package/dist/pactile/review/escalation-artifacts.d.ts.map +1 -0
- package/dist/pactile/review/escalation-artifacts.js +415 -0
- package/dist/pactile/review/escalation-artifacts.js.map +1 -0
- package/dist/pactile/review/escalation-contract.d.ts +115 -0
- package/dist/pactile/review/escalation-contract.d.ts.map +1 -0
- package/dist/pactile/review/escalation-contract.js +151 -0
- package/dist/pactile/review/escalation-contract.js.map +1 -0
- package/dist/pactile/review/escalation-finalize.d.ts +14 -0
- package/dist/pactile/review/escalation-finalize.d.ts.map +1 -0
- package/dist/pactile/review/escalation-finalize.js +319 -0
- package/dist/pactile/review/escalation-finalize.js.map +1 -0
- package/dist/pactile/review/escalation-reply.d.ts +10 -0
- package/dist/pactile/review/escalation-reply.d.ts.map +1 -0
- package/dist/pactile/review/escalation-reply.js +61 -0
- package/dist/pactile/review/escalation-reply.js.map +1 -0
- package/dist/pactile/review/escalation-transport.d.ts +32 -0
- package/dist/pactile/review/escalation-transport.d.ts.map +1 -0
- package/dist/pactile/review/escalation-transport.js +216 -0
- package/dist/pactile/review/escalation-transport.js.map +1 -0
- package/dist/pactile/review/escalation.d.ts +7 -0
- package/dist/pactile/review/escalation.d.ts.map +1 -0
- package/dist/pactile/review/escalation.js +6 -0
- package/dist/pactile/review/escalation.js.map +1 -0
- package/dist/pactile/review/evidence.d.ts +25 -0
- package/dist/pactile/review/evidence.d.ts.map +1 -0
- package/dist/pactile/review/evidence.js +58 -0
- package/dist/pactile/review/evidence.js.map +1 -0
- package/dist/pactile/review/jev-escalation-advice.d.ts +77 -0
- package/dist/pactile/review/jev-escalation-advice.d.ts.map +1 -0
- package/dist/pactile/review/jev-escalation-advice.js +358 -0
- package/dist/pactile/review/jev-escalation-advice.js.map +1 -0
- package/dist/pactile/scheduler/index.d.ts +6 -0
- package/dist/pactile/scheduler/index.d.ts.map +1 -0
- package/dist/pactile/scheduler/index.js +5 -0
- package/dist/pactile/scheduler/index.js.map +1 -0
- package/dist/pactile/scheduler/project-lease-store.d.ts +35 -0
- package/dist/pactile/scheduler/project-lease-store.d.ts.map +1 -0
- package/dist/pactile/scheduler/project-lease-store.js +189 -0
- package/dist/pactile/scheduler/project-lease-store.js.map +1 -0
- package/dist/pactile/scheduler/scheduler.d.ts +91 -0
- package/dist/pactile/scheduler/scheduler.d.ts.map +1 -0
- package/dist/pactile/scheduler/scheduler.js +589 -0
- package/dist/pactile/scheduler/scheduler.js.map +1 -0
- package/dist/pactile/scheduler/task-kernel-admission.d.ts +173 -0
- package/dist/pactile/scheduler/task-kernel-admission.d.ts.map +1 -0
- package/dist/pactile/scheduler/task-kernel-admission.js +1560 -0
- package/dist/pactile/scheduler/task-kernel-admission.js.map +1 -0
- package/dist/pactile/scheduler/task-kernel-wave-dispatch.d.ts +184 -0
- package/dist/pactile/scheduler/task-kernel-wave-dispatch.d.ts.map +1 -0
- package/dist/pactile/scheduler/task-kernel-wave-dispatch.js +952 -0
- package/dist/pactile/scheduler/task-kernel-wave-dispatch.js.map +1 -0
- package/dist/pactile/scheduler/task-map-scheduler.d.ts +116 -0
- package/dist/pactile/scheduler/task-map-scheduler.d.ts.map +1 -0
- package/dist/pactile/scheduler/task-map-scheduler.js +1448 -0
- package/dist/pactile/scheduler/task-map-scheduler.js.map +1 -0
- package/dist/pactile/scheduler/task-run-dispatch-state.d.ts +7 -0
- package/dist/pactile/scheduler/task-run-dispatch-state.d.ts.map +1 -0
- package/dist/pactile/scheduler/task-run-dispatch-state.js +69 -0
- package/dist/pactile/scheduler/task-run-dispatch-state.js.map +1 -0
- package/dist/pactile/task/authorization.d.ts +3 -0
- package/dist/pactile/task/authorization.d.ts.map +1 -0
- package/dist/pactile/task/authorization.js +43 -0
- package/dist/pactile/task/authorization.js.map +1 -0
- package/dist/pactile/task/creation.d.ts +22 -0
- package/dist/pactile/task/creation.d.ts.map +1 -0
- package/dist/pactile/task/creation.js +95 -0
- package/dist/pactile/task/creation.js.map +1 -0
- package/dist/pactile/task/guards.d.ts +1 -4
- package/dist/pactile/task/guards.d.ts.map +1 -1
- package/dist/pactile/task/guards.js +5 -57
- package/dist/pactile/task/guards.js.map +1 -1
- package/dist/pactile/task/session-jev-receipt.d.ts +58 -0
- package/dist/pactile/task/session-jev-receipt.d.ts.map +1 -0
- package/dist/pactile/task/session-jev-receipt.js +375 -0
- package/dist/pactile/task/session-jev-receipt.js.map +1 -0
- package/dist/pactile/task/session-jev.d.ts +7 -0
- package/dist/pactile/task/session-jev.d.ts.map +1 -0
- package/dist/pactile/task/session-jev.js +217 -0
- package/dist/pactile/task/session-jev.js.map +1 -0
- package/dist/pactile/task/session-pack.d.ts.map +1 -1
- package/dist/pactile/task/session-pack.js +155 -16
- package/dist/pactile/task/session-pack.js.map +1 -1
- package/dist/pactile/task/session-retrieval-jev-receipt.d.ts +49 -0
- package/dist/pactile/task/session-retrieval-jev-receipt.d.ts.map +1 -0
- package/dist/pactile/task/session-retrieval-jev-receipt.js +97 -0
- package/dist/pactile/task/session-retrieval-jev-receipt.js.map +1 -0
- package/dist/pactile/task/session-retrieval-jev.d.ts +8 -0
- package/dist/pactile/task/session-retrieval-jev.d.ts.map +1 -0
- package/dist/pactile/task/session-retrieval-jev.js +352 -0
- package/dist/pactile/task/session-retrieval-jev.js.map +1 -0
- package/dist/pactile/task/strategy.d.ts +1 -23
- package/dist/pactile/task/strategy.d.ts.map +1 -1
- package/dist/pactile/task/strategy.js +2 -135
- package/dist/pactile/task/strategy.js.map +1 -1
- package/dist/pactile/tiles/jev-selection.d.ts +44 -0
- package/dist/pactile/tiles/jev-selection.d.ts.map +1 -0
- package/dist/pactile/tiles/jev-selection.js +210 -0
- package/dist/pactile/tiles/jev-selection.js.map +1 -0
- package/dist/pactile/tiles/safe-yaml.d.ts +5 -1
- package/dist/pactile/tiles/safe-yaml.d.ts.map +1 -1
- package/dist/pactile/tiles/safe-yaml.js +8 -8
- package/dist/pactile/tiles/safe-yaml.js.map +1 -1
- package/dist/pactile/tiles/selection-receipts.d.ts +71 -0
- package/dist/pactile/tiles/selection-receipts.d.ts.map +1 -0
- package/dist/pactile/tiles/selection-receipts.js +319 -0
- package/dist/pactile/tiles/selection-receipts.js.map +1 -0
- package/dist/pactile/tiles/selection.d.ts +185 -0
- package/dist/pactile/tiles/selection.d.ts.map +1 -0
- package/dist/pactile/tiles/selection.js +985 -0
- package/dist/pactile/tiles/selection.js.map +1 -0
- package/dist/pactile/verification/git-observer.d.ts +3 -0
- package/dist/pactile/verification/git-observer.d.ts.map +1 -0
- package/dist/pactile/verification/git-observer.js +3 -0
- package/dist/pactile/verification/git-observer.js.map +1 -0
- package/dist/pactile/verification/index.d.ts +11 -0
- package/dist/pactile/verification/index.d.ts.map +1 -0
- package/dist/pactile/verification/index.js +6 -0
- package/dist/pactile/verification/index.js.map +1 -0
- package/dist/pactile/verification/jev-advice.d.ts +78 -0
- package/dist/pactile/verification/jev-advice.d.ts.map +1 -0
- package/dist/pactile/verification/jev-advice.js +397 -0
- package/dist/pactile/verification/jev-advice.js.map +1 -0
- package/dist/pactile/verification/planner.d.ts +15 -0
- package/dist/pactile/verification/planner.d.ts.map +1 -0
- package/dist/pactile/verification/planner.js +412 -0
- package/dist/pactile/verification/planner.js.map +1 -0
- package/dist/pactile/verification/receipt.d.ts +101 -0
- package/dist/pactile/verification/receipt.d.ts.map +1 -0
- package/dist/pactile/verification/receipt.js +400 -0
- package/dist/pactile/verification/receipt.js.map +1 -0
- package/dist/pactile/verification/types.d.ts +72 -0
- package/dist/pactile/verification/types.d.ts.map +1 -0
- package/dist/pactile/verification/types.js +21 -0
- package/dist/pactile/verification/types.js.map +1 -0
- package/dist/pactile/worktree/git-probe.d.ts +32 -0
- package/dist/pactile/worktree/git-probe.d.ts.map +1 -0
- package/dist/pactile/worktree/git-probe.js +336 -0
- package/dist/pactile/worktree/git-probe.js.map +1 -0
- package/dist/pactile/worktree/git-removal.d.ts +3 -0
- package/dist/pactile/worktree/git-removal.d.ts.map +1 -0
- package/dist/pactile/worktree/git-removal.js +11 -0
- package/dist/pactile/worktree/git-removal.js.map +1 -0
- package/dist/pactile/worktree/index.d.ts +2 -0
- package/dist/pactile/worktree/index.d.ts.map +1 -0
- package/dist/pactile/worktree/index.js +2 -0
- package/dist/pactile/worktree/index.js.map +1 -0
- package/dist/pactile/worktree/integration-evidence.d.ts +80 -0
- package/dist/pactile/worktree/integration-evidence.d.ts.map +1 -0
- package/dist/pactile/worktree/integration-evidence.js +166 -0
- package/dist/pactile/worktree/integration-evidence.js.map +1 -0
- package/dist/pactile/worktree/manager-core.d.ts +50 -0
- package/dist/pactile/worktree/manager-core.d.ts.map +1 -0
- package/dist/pactile/worktree/manager-core.js +359 -0
- package/dist/pactile/worktree/manager-core.js.map +1 -0
- package/dist/pactile/worktree/manager-provenance.d.ts +32 -0
- package/dist/pactile/worktree/manager-provenance.d.ts.map +1 -0
- package/dist/pactile/worktree/manager-provenance.js +409 -0
- package/dist/pactile/worktree/manager-provenance.js.map +1 -0
- package/dist/pactile/worktree/manager-types.d.ts +84 -0
- package/dist/pactile/worktree/manager-types.d.ts.map +1 -0
- package/dist/pactile/worktree/manager-types.js +11 -0
- package/dist/pactile/worktree/manager-types.js.map +1 -0
- package/dist/pactile/worktree/manager.d.ts +10 -0
- package/dist/pactile/worktree/manager.d.ts.map +1 -0
- package/dist/pactile/worktree/manager.js +6 -0
- package/dist/pactile/worktree/manager.js.map +1 -0
- package/dist/pactile/worktree/run-workspace-cleanup.d.ts +10 -0
- package/dist/pactile/worktree/run-workspace-cleanup.d.ts.map +1 -0
- package/dist/pactile/worktree/run-workspace-cleanup.js +695 -0
- package/dist/pactile/worktree/run-workspace-cleanup.js.map +1 -0
- package/dist/pactile/worktree/run-workspace-lifecycle.d.ts +65 -0
- package/dist/pactile/worktree/run-workspace-lifecycle.d.ts.map +1 -0
- package/dist/pactile/worktree/run-workspace-lifecycle.js +276 -0
- package/dist/pactile/worktree/run-workspace-lifecycle.js.map +1 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-hooks.md +1 -1
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/generated-files.md +1 -1
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/hooks-and-settings.md +1 -1
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/overview.md +1 -1
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/platform-map.md +1 -1
- package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +2 -0
- package/dist/templates/common/skills/brainstorm.md +19 -13
- package/dist/templates/markdown/agents.md +2 -2
- package/dist/templates/markdown/framework/execution-strategy.md.txt +1 -1
- package/dist/templates/markdown/framework/index.md.txt +1 -1
- package/dist/templates/markdown/framework/parallel-first-execution.md.txt +17 -105
- package/dist/templates/markdown/framework/prd-grill-frontier.md.txt +3 -3
- package/dist/templates/markdown/framework/release-boundary.md.txt +9 -10
- package/dist/templates/markdown/framework/retrieval-daily-guide.md.txt +1 -1
- package/dist/templates/pactile/CONTEXT.md +48 -36
- package/dist/templates/pactile/modules/approval-personal/contract.md +12 -24
- package/dist/templates/pactile/modules/close-basic/contract.md +15 -18
- package/dist/templates/pactile/modules/debug-recovery/contract.md +4 -4
- package/dist/templates/pactile/modules/define-basic/contract.md +15 -19
- package/dist/templates/pactile/modules/define-extended/contract.md +3 -3
- package/dist/templates/pactile/modules/execute-agent/contract.md +11 -19
- package/dist/templates/pactile/modules/intake-basic/contract.md +16 -13
- package/dist/templates/pactile/modules/verify-basic/contract.md +11 -20
- package/dist/templates/pactile/tasks/templates/release-execution/design.md +5 -5
- package/dist/templates/pactile/tasks/templates/release-readiness/design.md +6 -6
- package/dist/templates/pactile/tasks/templates/release-readiness/handoff-template.md +8 -2
- package/dist/templates/pactile/workflow.md +37 -41
- package/dist/templates/template-utils.d.ts +1 -2
- package/dist/templates/template-utils.d.ts.map +1 -1
- package/dist/templates/template-utils.js +2 -13
- package/dist/templates/template-utils.js.map +1 -1
- package/dist/types/ai-tools.d.ts +1 -1
- package/dist/types/ai-tools.js +1 -1
- package/dist/utils/manifest-prune.js +1 -1
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/p36-upgrade.d.ts +2 -2
- package/dist/utils/p36-upgrade.d.ts.map +1 -1
- package/dist/utils/p36-upgrade.js +2 -10
- package/dist/utils/p36-upgrade.js.map +1 -1
- package/dist/utils/post-update-smoke.js +1 -1
- package/dist/utils/post-update-smoke.js.map +1 -1
- package/dist/utils/readiness.d.ts +2 -2
- package/dist/utils/readiness.js +2 -2
- package/dist/utils/uninstall-scrubbers.js +1 -1
- package/dist/utils/workflow-dir.d.ts +1 -1
- package/dist/utils/workflow-dir.d.ts.map +1 -1
- package/dist/utils/workflow-dir.js +1 -1
- package/dist/utils/workflow-dir.js.map +1 -1
- package/package.json +42 -37
- package/CHANGELOG.md +0 -651
- package/bin/compat-warning.js +0 -11
- package/bin/pactile.js +0 -3
- package/bin/smart-search.js +0 -38
- package/dist/migrations/manifests/0.1.0.json +0 -9
- package/dist/migrations/manifests/0.1.1.json +0 -9
- package/dist/migrations/manifests/0.1.2.json +0 -9
- package/dist/migrations/manifests/0.1.3.json +0 -9
- package/dist/migrations/manifests/0.1.4.json +0 -9
- package/dist/migrations/manifests/0.2.1.json +0 -9
- package/dist/migrations/manifests/0.2.10.json +0 -374
- package/dist/migrations/manifests/0.2.2.json +0 -9
- package/dist/migrations/manifests/0.2.3.json +0 -9
- package/dist/migrations/manifests/0.2.4.json +0 -9
- package/dist/migrations/manifests/0.2.5.json +0 -9
- package/dist/migrations/manifests/0.2.6.json +0 -9
- package/dist/migrations/manifests/0.2.7.json +0 -9
- package/dist/migrations/manifests/0.2.8.json +0 -9
- package/dist/migrations/manifests/0.2.9.json +0 -9
- package/dist/migrations/manifests/0.3.0.json +0 -89
- package/dist/migrations/manifests/0.3.1.json +0 -32
- package/dist/migrations/manifests/0.3.2.json +0 -16
- package/dist/migrations/manifests/0.3.3.json +0 -9
- package/dist/migrations/manifests/0.3.4.json +0 -9
- package/dist/migrations/manifests/0.3.5.json +0 -9
- package/dist/migrations/manifests/0.3.6.json +0 -9
- package/dist/migrations/manifests/0.4.0.json +0 -9
- package/dist/migrations/manifests/0.4.1.json +0 -9
- package/dist/migrations/manifests/0.4.2.json +0 -9
- package/dist/migrations/manifests/0.4.3.json +0 -9
- package/dist/migrations/manifests/0.5.0-beta.0.json +0 -9
- package/dist/migrations/manifests/0.5.0-beta.1.json +0 -9
- package/dist/migrations/manifests/0.5.0-beta.2.json +0 -9
- package/dist/migrations/manifests/0.5.0-beta.3.json +0 -9
- package/dist/migrations/manifests/0.5.0-beta.4.json +0 -9
- package/dist/migrations/manifests/0.5.0-beta.5.json +0 -9
- package/dist/migrations/manifests/0.5.0.json +0 -9
- package/dist/pactile/compat/retired-alternate-client.d.ts +0 -42
- package/dist/pactile/compat/retired-alternate-client.d.ts.map +0 -1
- package/dist/pactile/compat/retired-alternate-client.js +0 -153
- package/dist/pactile/compat/retired-alternate-client.js.map +0 -1
- package/dist/pactile/compat/update-residue.d.ts +0 -4
- package/dist/pactile/compat/update-residue.d.ts.map +0 -1
- package/dist/pactile/compat/update-residue.js +0 -55
- package/dist/pactile/compat/update-residue.js.map +0 -1
- package/dist/utils/cursor-retrieval-env.d.ts +0 -17
- package/dist/utils/cursor-retrieval-env.d.ts.map +0 -1
- package/dist/utils/cursor-retrieval-env.js +0 -19
- package/dist/utils/cursor-retrieval-env.js.map +0 -1
- package/dist/utils/proxy.d.ts +0 -25
- package/dist/utils/proxy.d.ts.map +0 -1
- package/dist/utils/proxy.js +0 -60
- package/dist/utils/proxy.js.map +0 -1
- package/scripts/postinstall.js +0 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TaskRunWorkspaceManagerBinding } from "../../core/task/task-kernel-types.js";
|
|
2
|
+
import { type GitIdentity, type ManagerProvenance, type RunWorkspaceBinding } from "./manager-types.js";
|
|
3
|
+
export declare function provenanceRoot(identity: GitIdentity, create: boolean): string | null;
|
|
4
|
+
export declare function readAllManagerProvenance(identity: GitIdentity): ManagerProvenance[];
|
|
5
|
+
/**
|
|
6
|
+
* Reconcile the manager owner and canonical-path records after Git recreates a
|
|
7
|
+
* linked checkout with a different administrative Git directory. A partial
|
|
8
|
+
* index-first replacement can be retried only while both records still bind the
|
|
9
|
+
* same Run credential and the changed Git directory is either the Run's prior
|
|
10
|
+
* value or the currently verified linked directory.
|
|
11
|
+
*/
|
|
12
|
+
export declare function synchronizeManagerProvenanceGitDir(input: {
|
|
13
|
+
identity: GitIdentity;
|
|
14
|
+
ownerRunId: string;
|
|
15
|
+
credentialId: string;
|
|
16
|
+
priorGitDir: string;
|
|
17
|
+
actualGitDir: string;
|
|
18
|
+
}): ManagerProvenance;
|
|
19
|
+
export declare function persistManagerProvenance(identity: GitIdentity, provenance: ManagerProvenance): void;
|
|
20
|
+
export declare function provenanceFor(input: {
|
|
21
|
+
identity: GitIdentity;
|
|
22
|
+
binding: RunWorkspaceBinding;
|
|
23
|
+
gitDir: string;
|
|
24
|
+
source: "created" | "adopted";
|
|
25
|
+
adoption?: {
|
|
26
|
+
approvedBy: string;
|
|
27
|
+
approvedAt: string;
|
|
28
|
+
evidenceRef: string;
|
|
29
|
+
};
|
|
30
|
+
}): ManagerProvenance;
|
|
31
|
+
export declare function taskKernelManagerBinding(provenance: ManagerProvenance): TaskRunWorkspaceManagerBinding;
|
|
32
|
+
//# sourceMappingURL=manager-provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager-provenance.d.ts","sourceRoot":"","sources":["../../../src/pactile/worktree/manager-provenance.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAE3F,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAqJ5B,wBAAgB,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAUpF;AAkED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,WAAW,GAAG,iBAAiB,EAAE,CAEnF;AAmED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE;IACxD,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,iBAAiB,CAyBpB;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAmCnG;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5E,GAAG,iBAAiB,CAiBpB;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,iBAAiB,GAAG,8BAA8B,CAUtG"}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { assertNoSymlinkBetween, pathKey, pathWithin } from "./git-probe.js";
|
|
5
|
+
import { WorktreeManagerError, } from "./manager-types.js";
|
|
6
|
+
const RUN_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
7
|
+
const SHA = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/i;
|
|
8
|
+
const OWNERSHIP_PROTOCOL = "canonical-path-index-v1";
|
|
9
|
+
function pathHash(canonicalPath) {
|
|
10
|
+
return createHash("sha256").update(pathKey(canonicalPath), "utf8").digest("hex");
|
|
11
|
+
}
|
|
12
|
+
function pathIndexRoot(identity, create) {
|
|
13
|
+
const root = provenanceRoot(identity, create);
|
|
14
|
+
if (!root)
|
|
15
|
+
return null;
|
|
16
|
+
const candidate = path.join(root, "paths");
|
|
17
|
+
assertNoSymlinkBetween(root, candidate);
|
|
18
|
+
if (create)
|
|
19
|
+
fs.mkdirSync(candidate, { recursive: true });
|
|
20
|
+
if (!fs.existsSync(candidate))
|
|
21
|
+
return null;
|
|
22
|
+
assertNoSymlinkBetween(root, candidate);
|
|
23
|
+
const real = fs.realpathSync(candidate);
|
|
24
|
+
if (pathKey(real) !== pathKey(candidate) || !fs.statSync(real).isDirectory()) {
|
|
25
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager path index resolves outside its registry", candidate);
|
|
26
|
+
}
|
|
27
|
+
return real;
|
|
28
|
+
}
|
|
29
|
+
function validPathIndex(value, file, canonicalPath) {
|
|
30
|
+
if (!value || typeof value !== "object")
|
|
31
|
+
return false;
|
|
32
|
+
const record = value;
|
|
33
|
+
return record.version === 1 && record.protocol === OWNERSHIP_PROTOCOL
|
|
34
|
+
&& typeof record.pathHash === "string" && /^[a-f0-9]{64}$/.test(record.pathHash)
|
|
35
|
+
&& record.pathHash === pathHash(canonicalPath) && path.basename(file) === `${record.pathHash}.json`
|
|
36
|
+
&& typeof record.canonicalPath === "string" && path.isAbsolute(record.canonicalPath)
|
|
37
|
+
&& pathKey(record.canonicalPath) === pathKey(canonicalPath)
|
|
38
|
+
&& typeof record.ownerRunId === "string" && RUN_ID.test(record.ownerRunId)
|
|
39
|
+
&& typeof record.credentialId === "string" && !!record.credentialId
|
|
40
|
+
&& typeof record.projectRoot === "string" && path.isAbsolute(record.projectRoot)
|
|
41
|
+
&& typeof record.commonDir === "string" && path.isAbsolute(record.commonDir)
|
|
42
|
+
&& typeof record.gitDir === "string" && path.isAbsolute(record.gitDir)
|
|
43
|
+
&& typeof record.branch === "string" && !!record.branch;
|
|
44
|
+
}
|
|
45
|
+
function readPathIndex(identity, canonicalPath) {
|
|
46
|
+
const root = pathIndexRoot(identity, false);
|
|
47
|
+
if (!root)
|
|
48
|
+
return null;
|
|
49
|
+
const file = path.join(root, `${pathHash(canonicalPath)}.json`);
|
|
50
|
+
const stat = fs.lstatSync(file, { throwIfNoEntry: false });
|
|
51
|
+
if (!stat)
|
|
52
|
+
return null;
|
|
53
|
+
if (stat.isSymbolicLink() || !stat.isFile()) {
|
|
54
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager path index is not a regular file", file);
|
|
55
|
+
}
|
|
56
|
+
const real = fs.realpathSync(file);
|
|
57
|
+
if (!pathWithin(root, real) || pathKey(real) !== pathKey(file)) {
|
|
58
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager path index resolves outside its registry", file);
|
|
59
|
+
}
|
|
60
|
+
let parsed;
|
|
61
|
+
try {
|
|
62
|
+
parsed = JSON.parse(fs.readFileSync(real, "utf8"));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager path index is unreadable", file);
|
|
66
|
+
}
|
|
67
|
+
if (!validPathIndex(parsed, file, canonicalPath)) {
|
|
68
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager path index is malformed or mismatched", file);
|
|
69
|
+
}
|
|
70
|
+
return parsed;
|
|
71
|
+
}
|
|
72
|
+
function pathIndexFor(provenance) {
|
|
73
|
+
return {
|
|
74
|
+
version: 1,
|
|
75
|
+
protocol: OWNERSHIP_PROTOCOL,
|
|
76
|
+
pathHash: pathHash(provenance.canonicalPath),
|
|
77
|
+
canonicalPath: provenance.canonicalPath,
|
|
78
|
+
ownerRunId: provenance.ownerRunId,
|
|
79
|
+
credentialId: provenance.credentialId,
|
|
80
|
+
projectRoot: provenance.projectRoot,
|
|
81
|
+
commonDir: provenance.commonDir,
|
|
82
|
+
gitDir: provenance.gitDir,
|
|
83
|
+
branch: provenance.branch,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function samePathIndex(index, provenance) {
|
|
87
|
+
return index.ownerRunId === provenance.ownerRunId
|
|
88
|
+
&& index.credentialId === provenance.credentialId
|
|
89
|
+
&& pathKey(index.canonicalPath) === pathKey(provenance.canonicalPath)
|
|
90
|
+
&& pathKey(index.projectRoot) === pathKey(provenance.projectRoot)
|
|
91
|
+
&& pathKey(index.commonDir) === pathKey(provenance.commonDir)
|
|
92
|
+
&& pathKey(index.gitDir) === pathKey(provenance.gitDir)
|
|
93
|
+
&& index.branch === provenance.branch;
|
|
94
|
+
}
|
|
95
|
+
function samePathIndexExceptGitDir(index, provenance) {
|
|
96
|
+
return samePathIndex({ ...index, gitDir: provenance.gitDir }, provenance);
|
|
97
|
+
}
|
|
98
|
+
function sameManagerProvenanceExceptGitDir(left, right) {
|
|
99
|
+
return left.version === right.version
|
|
100
|
+
&& left.credentialId === right.credentialId
|
|
101
|
+
&& left.ownerRunId === right.ownerRunId
|
|
102
|
+
&& pathKey(left.canonicalPath) === pathKey(right.canonicalPath)
|
|
103
|
+
&& pathKey(left.projectRoot) === pathKey(right.projectRoot)
|
|
104
|
+
&& pathKey(left.commonDir) === pathKey(right.commonDir)
|
|
105
|
+
&& left.branch === right.branch
|
|
106
|
+
&& left.baseSha.toLowerCase() === right.baseSha.toLowerCase()
|
|
107
|
+
&& left.writeSet.length === right.writeSet.length
|
|
108
|
+
&& left.writeSet.every((item, index) => item === right.writeSet[index])
|
|
109
|
+
&& left.source === right.source
|
|
110
|
+
&& left.recordedAt === right.recordedAt
|
|
111
|
+
&& left.ownershipProtocol === right.ownershipProtocol
|
|
112
|
+
&& JSON.stringify(left.adoption ?? null) === JSON.stringify(right.adoption ?? null);
|
|
113
|
+
}
|
|
114
|
+
function writeExclusiveJson(file, value) {
|
|
115
|
+
let descriptor;
|
|
116
|
+
try {
|
|
117
|
+
descriptor = fs.openSync(file, "wx", 0o600);
|
|
118
|
+
fs.writeFileSync(descriptor, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
119
|
+
fs.fsyncSync(descriptor);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (descriptor !== undefined) {
|
|
123
|
+
try {
|
|
124
|
+
fs.closeSync(descriptor);
|
|
125
|
+
}
|
|
126
|
+
catch { /* keep the original write error */ }
|
|
127
|
+
descriptor = undefined;
|
|
128
|
+
try {
|
|
129
|
+
fs.unlinkSync(file);
|
|
130
|
+
}
|
|
131
|
+
catch { /* an incomplete record is left fail-closed */ }
|
|
132
|
+
}
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
if (descriptor !== undefined)
|
|
137
|
+
fs.closeSync(descriptor);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function removeOwnedRecord(file, provenance) {
|
|
141
|
+
try {
|
|
142
|
+
const stat = fs.lstatSync(file, { throwIfNoEntry: false });
|
|
143
|
+
if (!stat || stat.isSymbolicLink() || !stat.isFile())
|
|
144
|
+
return;
|
|
145
|
+
const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
146
|
+
if (parsed.ownerRunId === provenance.ownerRunId && parsed.credentialId === provenance.credentialId)
|
|
147
|
+
fs.unlinkSync(file);
|
|
148
|
+
}
|
|
149
|
+
catch { /* leave any uncertain ownership record for fail-closed recovery */ }
|
|
150
|
+
}
|
|
151
|
+
export function provenanceRoot(identity, create) {
|
|
152
|
+
const root = path.join(identity.commonDir, "pactile-run-workspaces-v1");
|
|
153
|
+
assertNoSymlinkBetween(identity.commonDir, root);
|
|
154
|
+
if (create)
|
|
155
|
+
fs.mkdirSync(root, { recursive: true });
|
|
156
|
+
if (!fs.existsSync(root))
|
|
157
|
+
return null;
|
|
158
|
+
assertNoSymlinkBetween(identity.commonDir, root);
|
|
159
|
+
const real = fs.realpathSync(root);
|
|
160
|
+
if (pathKey(real) !== pathKey(root))
|
|
161
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance directory resolves through an alias", root);
|
|
162
|
+
if (!fs.statSync(real).isDirectory())
|
|
163
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance location is not a directory", root);
|
|
164
|
+
return real;
|
|
165
|
+
}
|
|
166
|
+
function validManagerProvenance(value) {
|
|
167
|
+
if (!value || typeof value !== "object")
|
|
168
|
+
return false;
|
|
169
|
+
const record = value;
|
|
170
|
+
return record.version === 1 && typeof record.credentialId === "string" && !!record.credentialId
|
|
171
|
+
&& typeof record.ownerRunId === "string" && RUN_ID.test(record.ownerRunId)
|
|
172
|
+
&& typeof record.canonicalPath === "string" && path.isAbsolute(record.canonicalPath)
|
|
173
|
+
&& typeof record.projectRoot === "string" && path.isAbsolute(record.projectRoot)
|
|
174
|
+
&& typeof record.commonDir === "string" && path.isAbsolute(record.commonDir)
|
|
175
|
+
&& typeof record.gitDir === "string" && path.isAbsolute(record.gitDir)
|
|
176
|
+
&& typeof record.branch === "string" && !!record.branch
|
|
177
|
+
&& typeof record.baseSha === "string" && SHA.test(record.baseSha)
|
|
178
|
+
&& Array.isArray(record.writeSet) && record.writeSet.every((item) => typeof item === "string")
|
|
179
|
+
&& (record.source === "created" || record.source === "adopted")
|
|
180
|
+
&& typeof record.recordedAt === "string" && !!record.recordedAt
|
|
181
|
+
&& (record.ownershipProtocol === undefined || record.ownershipProtocol === OWNERSHIP_PROTOCOL);
|
|
182
|
+
}
|
|
183
|
+
function readManagerProvenanceRecords(identity, allowGitDirMismatchForRun) {
|
|
184
|
+
const root = provenanceRoot(identity, false);
|
|
185
|
+
if (!root)
|
|
186
|
+
return [];
|
|
187
|
+
const records = fs.readdirSync(root).filter((name) => name.endsWith(".json")).map((name) => {
|
|
188
|
+
const file = path.join(root, name);
|
|
189
|
+
const stat = fs.lstatSync(file);
|
|
190
|
+
if (stat.isSymbolicLink() || !stat.isFile()) {
|
|
191
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance record is not a regular file", file);
|
|
192
|
+
}
|
|
193
|
+
const real = fs.realpathSync(file);
|
|
194
|
+
if (!pathWithin(root, real) || pathKey(real) !== pathKey(file)) {
|
|
195
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance record resolves outside its registry", file);
|
|
196
|
+
}
|
|
197
|
+
let parsed;
|
|
198
|
+
try {
|
|
199
|
+
parsed = JSON.parse(fs.readFileSync(real, "utf8"));
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance record is unreadable", file);
|
|
203
|
+
}
|
|
204
|
+
if (!validManagerProvenance(parsed) || name !== `${parsed.ownerRunId}.json`) {
|
|
205
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance record is malformed", file);
|
|
206
|
+
}
|
|
207
|
+
if (parsed.ownershipProtocol === OWNERSHIP_PROTOCOL) {
|
|
208
|
+
const index = readPathIndex(identity, parsed.canonicalPath);
|
|
209
|
+
const matches = index && (samePathIndex(index, parsed)
|
|
210
|
+
|| (parsed.ownerRunId === allowGitDirMismatchForRun && samePathIndexExceptGitDir(index, parsed)));
|
|
211
|
+
if (!matches) {
|
|
212
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Run provenance does not match its canonical-path ownership index", file);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return parsed;
|
|
216
|
+
});
|
|
217
|
+
const ownersByRun = new Map();
|
|
218
|
+
const ownersByPath = new Map();
|
|
219
|
+
for (const record of records) {
|
|
220
|
+
const priorRun = ownersByRun.get(record.ownerRunId);
|
|
221
|
+
if (priorRun && pathKey(priorRun.canonicalPath) !== pathKey(record.canonicalPath)) {
|
|
222
|
+
throw new WorktreeManagerError("owner-conflict", "One Run has multiple manager-owned worktree paths", record.canonicalPath);
|
|
223
|
+
}
|
|
224
|
+
const key = pathKey(record.canonicalPath);
|
|
225
|
+
const priorPath = ownersByPath.get(key);
|
|
226
|
+
if (priorPath && priorPath.ownerRunId !== record.ownerRunId) {
|
|
227
|
+
throw new WorktreeManagerError("owner-conflict", "One canonical Git worktree path has multiple Run owners", record.canonicalPath);
|
|
228
|
+
}
|
|
229
|
+
ownersByRun.set(record.ownerRunId, record);
|
|
230
|
+
ownersByPath.set(key, record);
|
|
231
|
+
}
|
|
232
|
+
return records;
|
|
233
|
+
}
|
|
234
|
+
export function readAllManagerProvenance(identity) {
|
|
235
|
+
return readManagerProvenanceRecords(identity);
|
|
236
|
+
}
|
|
237
|
+
function writeReplacementJson(file, value) {
|
|
238
|
+
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
239
|
+
let descriptor;
|
|
240
|
+
try {
|
|
241
|
+
descriptor = fs.openSync(temporary, "wx", 0o600);
|
|
242
|
+
fs.writeFileSync(descriptor, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
243
|
+
fs.fsyncSync(descriptor);
|
|
244
|
+
fs.closeSync(descriptor);
|
|
245
|
+
descriptor = undefined;
|
|
246
|
+
fs.renameSync(temporary, file);
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
if (descriptor !== undefined) {
|
|
250
|
+
try {
|
|
251
|
+
fs.closeSync(descriptor);
|
|
252
|
+
}
|
|
253
|
+
catch { /* preserve the replacement failure */ }
|
|
254
|
+
descriptor = undefined;
|
|
255
|
+
}
|
|
256
|
+
try {
|
|
257
|
+
fs.unlinkSync(temporary);
|
|
258
|
+
}
|
|
259
|
+
catch { /* keep any uncertain registry state fail-closed */ }
|
|
260
|
+
throw new WorktreeManagerError("manager-provenance-write-failed", "Could not persist recovered worktree Git-directory evidence", file);
|
|
261
|
+
}
|
|
262
|
+
finally {
|
|
263
|
+
if (descriptor !== undefined)
|
|
264
|
+
fs.closeSync(descriptor);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function replaceManagerProvenancePair(identity, updated, allowedGitDirs) {
|
|
268
|
+
const root = provenanceRoot(identity, false);
|
|
269
|
+
if (!root)
|
|
270
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance directory is unavailable");
|
|
271
|
+
const records = readManagerProvenanceRecords(identity, updated.ownerRunId);
|
|
272
|
+
const matches = records.filter((record) => record.ownerRunId === updated.ownerRunId);
|
|
273
|
+
const old = matches[0];
|
|
274
|
+
if (matches.length !== 1 || !old || !sameManagerProvenanceExceptGitDir(old, updated)) {
|
|
275
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Recovered manager provenance no longer matches the same Run and credential", updated.canonicalPath);
|
|
276
|
+
}
|
|
277
|
+
const indexRoot = pathIndexRoot(identity, false);
|
|
278
|
+
const index = readPathIndex(identity, old.canonicalPath);
|
|
279
|
+
if (!indexRoot || !index || !samePathIndexExceptGitDir(index, old)) {
|
|
280
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Recovered manager path index no longer matches its Run provenance", old.canonicalPath);
|
|
281
|
+
}
|
|
282
|
+
const allowed = new Set(allowedGitDirs.map((value) => pathKey(value)));
|
|
283
|
+
if (!allowed.has(pathKey(old.gitDir)) || !allowed.has(pathKey(index.gitDir)) || !allowed.has(pathKey(updated.gitDir))) {
|
|
284
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Recovered Git-directory change does not match the recorded Run state", old.canonicalPath);
|
|
285
|
+
}
|
|
286
|
+
const ownerFile = path.join(root, `${updated.ownerRunId}.json`);
|
|
287
|
+
const ownerStat = fs.lstatSync(ownerFile, { throwIfNoEntry: false });
|
|
288
|
+
if (!ownerStat?.isFile() || ownerStat.isSymbolicLink() || pathKey(fs.realpathSync(ownerFile)) !== pathKey(ownerFile)) {
|
|
289
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Existing Run provenance file is not safe to update", ownerFile);
|
|
290
|
+
}
|
|
291
|
+
const indexFile = path.join(indexRoot, `${pathHash(updated.canonicalPath)}.json`);
|
|
292
|
+
const indexStat = fs.lstatSync(indexFile, { throwIfNoEntry: false });
|
|
293
|
+
if (!indexStat?.isFile() || indexStat.isSymbolicLink() || pathKey(fs.realpathSync(indexFile)) !== pathKey(indexFile)) {
|
|
294
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Existing canonical-path index is not safe to update", indexFile);
|
|
295
|
+
}
|
|
296
|
+
// Replace the index first. If a process stops before the owner file follows,
|
|
297
|
+
// the recovery reader can prove and complete this one-field Git-directory transition.
|
|
298
|
+
writeReplacementJson(indexFile, pathIndexFor(updated));
|
|
299
|
+
writeReplacementJson(ownerFile, updated);
|
|
300
|
+
const readBack = readAllManagerProvenance(identity).find((record) => record.ownerRunId === updated.ownerRunId);
|
|
301
|
+
if (!readBack || !sameManagerProvenanceExceptGitDir(readBack, updated) || pathKey(readBack.gitDir) !== pathKey(updated.gitDir)) {
|
|
302
|
+
throw new WorktreeManagerError("manager-provenance-write-failed", "Recovered manager ownership pair failed read-back verification", updated.canonicalPath);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Reconcile the manager owner and canonical-path records after Git recreates a
|
|
307
|
+
* linked checkout with a different administrative Git directory. A partial
|
|
308
|
+
* index-first replacement can be retried only while both records still bind the
|
|
309
|
+
* same Run credential and the changed Git directory is either the Run's prior
|
|
310
|
+
* value or the currently verified linked directory.
|
|
311
|
+
*/
|
|
312
|
+
export function synchronizeManagerProvenanceGitDir(input) {
|
|
313
|
+
const records = readManagerProvenanceRecords(input.identity, input.ownerRunId);
|
|
314
|
+
const matches = records.filter((record) => record.ownerRunId === input.ownerRunId);
|
|
315
|
+
const owner = matches[0];
|
|
316
|
+
if (matches.length !== 1 || owner?.credentialId !== input.credentialId) {
|
|
317
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Recovered manager provenance does not match this Run credential");
|
|
318
|
+
}
|
|
319
|
+
const index = readPathIndex(input.identity, owner.canonicalPath);
|
|
320
|
+
if (!index || !samePathIndexExceptGitDir(index, owner)) {
|
|
321
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Recovered manager path index does not match this Run");
|
|
322
|
+
}
|
|
323
|
+
const allowedGitDirs = [input.priorGitDir, input.actualGitDir];
|
|
324
|
+
const allowed = new Set(allowedGitDirs.map((value) => pathKey(value)));
|
|
325
|
+
if (!allowed.has(pathKey(owner.gitDir)) || !allowed.has(pathKey(index.gitDir))) {
|
|
326
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Recovered Git-directory records changed outside the verified restoration");
|
|
327
|
+
}
|
|
328
|
+
const updated = { ...owner, gitDir: input.actualGitDir };
|
|
329
|
+
if (pathKey(owner.gitDir) !== pathKey(updated.gitDir) || pathKey(index.gitDir) !== pathKey(updated.gitDir)) {
|
|
330
|
+
replaceManagerProvenancePair(input.identity, updated, allowedGitDirs);
|
|
331
|
+
}
|
|
332
|
+
const readBack = readAllManagerProvenance(input.identity).find((record) => record.ownerRunId === input.ownerRunId);
|
|
333
|
+
if (readBack?.credentialId !== input.credentialId || pathKey(readBack.gitDir) !== pathKey(input.actualGitDir)) {
|
|
334
|
+
throw new WorktreeManagerError("manager-provenance-write-failed", "Recovered manager Git-directory records are not synchronized");
|
|
335
|
+
}
|
|
336
|
+
return readBack;
|
|
337
|
+
}
|
|
338
|
+
export function persistManagerProvenance(identity, provenance) {
|
|
339
|
+
const root = provenanceRoot(identity, true);
|
|
340
|
+
if (!root)
|
|
341
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager provenance directory is unavailable");
|
|
342
|
+
const existing = readAllManagerProvenance(identity);
|
|
343
|
+
if (existing.some((item) => item.ownerRunId === provenance.ownerRunId)) {
|
|
344
|
+
throw new WorktreeManagerError("owner-conflict", "Run already has a manager ownership record", provenance.canonicalPath);
|
|
345
|
+
}
|
|
346
|
+
if (existing.some((item) => pathKey(item.canonicalPath) === pathKey(provenance.canonicalPath))) {
|
|
347
|
+
throw new WorktreeManagerError("owner-conflict", "Worktree already has a manager ownership record", provenance.canonicalPath);
|
|
348
|
+
}
|
|
349
|
+
const file = path.join(root, `${provenance.ownerRunId}.json`);
|
|
350
|
+
const pathProvenance = { ...provenance, ownershipProtocol: OWNERSHIP_PROTOCOL };
|
|
351
|
+
const indexRoot = pathIndexRoot(identity, true);
|
|
352
|
+
if (!indexRoot)
|
|
353
|
+
throw new WorktreeManagerError("manager-provenance-invalid", "Manager path index directory is unavailable");
|
|
354
|
+
const indexFile = path.join(indexRoot, `${pathHash(pathProvenance.canonicalPath)}.json`);
|
|
355
|
+
let ownerRecordWritten = false;
|
|
356
|
+
try {
|
|
357
|
+
writeExclusiveJson(file, pathProvenance);
|
|
358
|
+
ownerRecordWritten = true;
|
|
359
|
+
try {
|
|
360
|
+
writeExclusiveJson(indexFile, pathIndexFor(pathProvenance));
|
|
361
|
+
}
|
|
362
|
+
catch (error) {
|
|
363
|
+
if (error && typeof error === "object" && "code" in error && error.code === "EEXIST") {
|
|
364
|
+
throw new WorktreeManagerError("owner-conflict", "Canonical Git worktree path already has a manager ownership reservation", provenance.canonicalPath);
|
|
365
|
+
}
|
|
366
|
+
throw error;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
if (ownerRecordWritten)
|
|
371
|
+
removeOwnedRecord(file, pathProvenance);
|
|
372
|
+
if (error instanceof WorktreeManagerError)
|
|
373
|
+
throw error;
|
|
374
|
+
if (error && typeof error === "object" && "code" in error && error.code === "EEXIST") {
|
|
375
|
+
throw new WorktreeManagerError("owner-conflict", "Run already has a manager ownership record", provenance.canonicalPath);
|
|
376
|
+
}
|
|
377
|
+
throw new WorktreeManagerError("manager-provenance-write-failed", "Could not persist manager ownership evidence", provenance.canonicalPath);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
export function provenanceFor(input) {
|
|
381
|
+
return {
|
|
382
|
+
version: 1,
|
|
383
|
+
credentialId: randomUUID(),
|
|
384
|
+
ownerRunId: input.binding.ownerRunId,
|
|
385
|
+
canonicalPath: input.binding.canonicalPath,
|
|
386
|
+
projectRoot: input.identity.root,
|
|
387
|
+
commonDir: input.identity.commonDir,
|
|
388
|
+
gitDir: input.gitDir,
|
|
389
|
+
branch: input.binding.branch,
|
|
390
|
+
baseSha: input.binding.baseSha,
|
|
391
|
+
writeSet: [...input.binding.writeSet],
|
|
392
|
+
source: input.source,
|
|
393
|
+
recordedAt: new Date().toISOString(),
|
|
394
|
+
ownershipProtocol: OWNERSHIP_PROTOCOL,
|
|
395
|
+
...(input.adoption ? { adoption: input.adoption } : {}),
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
export function taskKernelManagerBinding(provenance) {
|
|
399
|
+
return {
|
|
400
|
+
version: 1,
|
|
401
|
+
credentialId: provenance.credentialId,
|
|
402
|
+
projectRoot: provenance.projectRoot,
|
|
403
|
+
commonDir: provenance.commonDir,
|
|
404
|
+
gitDir: provenance.gitDir,
|
|
405
|
+
source: provenance.source,
|
|
406
|
+
recordedAt: provenance.recordedAt,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=manager-provenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager-provenance.js","sourceRoot":"","sources":["../../../src/pactile/worktree/manager-provenance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE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CAAC,CAAC,EAAE,CAAC;KACxD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,UAA6B;IACpE,OAAO;QACL,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,UAAU,EAAE,UAAU,CAAC,UAAU;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { TaskRunWorkspaceBinding } from "../../core/task/task-kernel.js";
|
|
2
|
+
export type RunWorkspaceBinding = TaskRunWorkspaceBinding;
|
|
3
|
+
export type WorkspaceRunState = "waiting" | "running" | "completed" | "failed" | "blocked" | "cancelled" | "interrupted";
|
|
4
|
+
export interface WorkspaceOwnerRef {
|
|
5
|
+
ownerRunId: string;
|
|
6
|
+
canonicalPath: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RunResultEvidence {
|
|
9
|
+
runId: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
evidenceRefs: string[];
|
|
12
|
+
candidateSnapshotId?: string;
|
|
13
|
+
candidateFingerprint?: string;
|
|
14
|
+
}
|
|
15
|
+
export type WorktreeIssueCode = "path-anomaly" | "owner-mismatch" | "manager-provenance-mismatch" | "gitdir-mismatch" | "not-registered" | "common-dir-mismatch" | "branch-mismatch" | "registered-head-mismatch" | "baseline-mismatch" | "write-set-violation" | "interrupted" | "unintegrated" | "dirty";
|
|
16
|
+
export interface WorktreeInspection {
|
|
17
|
+
state: "clean" | WorktreeIssueCode;
|
|
18
|
+
ownerRunId: string;
|
|
19
|
+
canonicalPath: string;
|
|
20
|
+
actualPath: string | null;
|
|
21
|
+
commonDir: string | null;
|
|
22
|
+
gitDir: string | null;
|
|
23
|
+
branch: string | null;
|
|
24
|
+
baseSha: string;
|
|
25
|
+
headSha: string | null;
|
|
26
|
+
dirty: boolean;
|
|
27
|
+
dirtyEntryCount: number;
|
|
28
|
+
changedPaths: string[];
|
|
29
|
+
scopeViolations: string[];
|
|
30
|
+
issues: WorktreeIssueCode[];
|
|
31
|
+
}
|
|
32
|
+
export interface ParallelWriteSetAuthorization {
|
|
33
|
+
runIds: [string, string];
|
|
34
|
+
overlapPaths: string[];
|
|
35
|
+
approvedBy: string;
|
|
36
|
+
approvedAt: string;
|
|
37
|
+
evidenceRef: string;
|
|
38
|
+
integrationPlan: string;
|
|
39
|
+
}
|
|
40
|
+
export type ParallelWriteSetDecision = {
|
|
41
|
+
allowed: true;
|
|
42
|
+
overlapPaths: string[];
|
|
43
|
+
authorization: ParallelWriteSetAuthorization | null;
|
|
44
|
+
} | {
|
|
45
|
+
allowed: false;
|
|
46
|
+
overlapPaths: string[];
|
|
47
|
+
reason: "write-set-conflict" | "invalid-authorization";
|
|
48
|
+
};
|
|
49
|
+
export declare class WorktreeManagerError extends Error {
|
|
50
|
+
readonly code: string;
|
|
51
|
+
readonly worktreePath: string | null;
|
|
52
|
+
constructor(code: string, message: string, worktreePath?: string | null);
|
|
53
|
+
}
|
|
54
|
+
export interface GitIdentity {
|
|
55
|
+
root: string;
|
|
56
|
+
commonDir: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ManagerProvenance {
|
|
59
|
+
version: 1;
|
|
60
|
+
credentialId: string;
|
|
61
|
+
ownerRunId: string;
|
|
62
|
+
canonicalPath: string;
|
|
63
|
+
projectRoot: string;
|
|
64
|
+
commonDir: string;
|
|
65
|
+
gitDir: string;
|
|
66
|
+
branch: string;
|
|
67
|
+
baseSha: string;
|
|
68
|
+
writeSet: string[];
|
|
69
|
+
source: "created" | "adopted";
|
|
70
|
+
recordedAt: string;
|
|
71
|
+
ownershipProtocol?: "canonical-path-index-v1";
|
|
72
|
+
adoption?: {
|
|
73
|
+
approvedBy: string;
|
|
74
|
+
approvedAt: string;
|
|
75
|
+
evidenceRef: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface GitWorktreeRegistration {
|
|
79
|
+
path: string;
|
|
80
|
+
head: string | null;
|
|
81
|
+
branch: string | null;
|
|
82
|
+
detached: boolean;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=manager-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager-types.d.ts","sourceRoot":"","sources":["../../../src/pactile/worktree/manager-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;AAEzH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,gBAAgB,GAChB,6BAA6B,GAC7B,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GACrB,iBAAiB,GACjB,0BAA0B,GAC1B,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,cAAc,GACd,OAAO,CAAC;AAEZ,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IA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ChC,OAAO,EAAE,CAAC,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5E;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class WorktreeManagerError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
worktreePath;
|
|
4
|
+
constructor(code, message, worktreePath = null) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.worktreePath = worktreePath;
|
|
8
|
+
this.name = "WorktreeManagerError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=manager-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager-types.js","sourceRoot":"","sources":["../../../src/pactile/worktree/manager-types.ts"],"names":[],"mappings":"AA+DA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAElC;IAEA;IAHX,YACW,IAAY,EACrB,OAAe,EACN,eAA8B,IAAI;QAE3C,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,SAAI,GAAJ,IAAI,CAAQ;QAEZ,iBAAY,GAAZ,YAAY,CAAsB;QAG3C,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { RunWorkspaceBinding, WorkspaceRunState, WorkspaceOwnerRef, RunResultEvidence, WorktreeIssueCode, WorktreeInspection, ParallelWriteSetAuthorization, ParallelWriteSetDecision, } from "./manager-types.js";
|
|
2
|
+
export { WorktreeManagerError } from "./manager-types.js";
|
|
3
|
+
export { findWriteSetOverlaps, decideParallelWriteSets, createRunWorktree, adoptRunWorktree, inspectRunWorktree, reconcileRunWorktree, } from "./manager-core.js";
|
|
4
|
+
export type { WorktreeIntegrationReceipt, WorktreeCleanupResult } from "./integration-evidence.js";
|
|
5
|
+
export { verifyWorktreeIntegration, planRunWorktreeCleanup } from "./integration-evidence.js";
|
|
6
|
+
export type { AdoptTaskRunWorktreeInput, CreateTaskRunWorktreeInput, ReconcileTaskRunWorktreeInput, IntegrateTaskRunWorktreeInput } from "./run-workspace-lifecycle.js";
|
|
7
|
+
export { adoptTaskRunWorktree, createTaskRunWorktree, reconcileTaskRunWorktree, integrateTaskRunWorktree } from "./run-workspace-lifecycle.js";
|
|
8
|
+
export type { ReclaimTaskRunWorktreeInput } from "./run-workspace-cleanup.js";
|
|
9
|
+
export { reclaimRunWorktree } from "./run-workspace-cleanup.js";
|
|
10
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/pactile/worktree/manager.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAC9F,YAAY,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AACxK,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC/I,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { WorktreeManagerError } from "./manager-types.js";
|
|
2
|
+
export { findWriteSetOverlaps, decideParallelWriteSets, createRunWorktree, adoptRunWorktree, inspectRunWorktree, reconcileRunWorktree, } from "./manager-core.js";
|
|
3
|
+
export { verifyWorktreeIntegration, planRunWorktreeCleanup } from "./integration-evidence.js";
|
|
4
|
+
export { adoptTaskRunWorktree, createTaskRunWorktree, reconcileTaskRunWorktree, integrateTaskRunWorktree } from "./run-workspace-lifecycle.js";
|
|
5
|
+
export { reclaimRunWorktree } from "./run-workspace-cleanup.js";
|
|
6
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/pactile/worktree/manager.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAE9F,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAE/I,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type WorktreeCleanupResult } from "./integration-evidence.js";
|
|
2
|
+
export interface ReclaimTaskRunWorktreeInput {
|
|
3
|
+
repoRoot: string;
|
|
4
|
+
taskDir: string;
|
|
5
|
+
runId: string;
|
|
6
|
+
actor: string;
|
|
7
|
+
idempotencyKey: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function reclaimRunWorktree(input: ReclaimTaskRunWorktreeInput): Promise<WorktreeCleanupResult>;
|
|
10
|
+
//# sourceMappingURL=run-workspace-cleanup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-workspace-cleanup.d.ts","sourceRoot":"","sources":["../../../src/pactile/worktree/run-workspace-cleanup.ts"],"names":[],"mappings":"AA2BA,OAAO,EAA4D,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAsTjI,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAkW3G"}
|