@blxzer/pactile 0.5.0
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/CHANGELOG.md +602 -0
- package/LICENSE +235 -0
- package/README.md +115 -0
- package/README.zh-CN.md +115 -0
- package/bin/compat-warning.js +11 -0
- package/bin/cstl.js +6 -0
- package/bin/pactile.js +3 -0
- package/bin/smart-search.js +38 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +362 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/capability-smoke.d.ts +24 -0
- package/dist/commands/capability-smoke.d.ts.map +1 -0
- package/dist/commands/capability-smoke.js +83 -0
- package/dist/commands/capability-smoke.js.map +1 -0
- package/dist/commands/channel/adapters/claude.d.ts +29 -0
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
- package/dist/commands/channel/adapters/claude.js +203 -0
- package/dist/commands/channel/adapters/claude.js.map +1 -0
- package/dist/commands/channel/adapters/codex.d.ts +85 -0
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
- package/dist/commands/channel/adapters/codex.js +505 -0
- package/dist/commands/channel/adapters/codex.js.map +1 -0
- package/dist/commands/channel/adapters/index.d.ts +84 -0
- package/dist/commands/channel/adapters/index.d.ts.map +1 -0
- package/dist/commands/channel/adapters/index.js +115 -0
- package/dist/commands/channel/adapters/index.js.map +1 -0
- package/dist/commands/channel/adapters/types.d.ts +33 -0
- package/dist/commands/channel/adapters/types.d.ts.map +1 -0
- package/dist/commands/channel/adapters/types.js +2 -0
- package/dist/commands/channel/adapters/types.js.map +1 -0
- package/dist/commands/channel/agent-loader.d.ts +32 -0
- package/dist/commands/channel/agent-loader.d.ts.map +1 -0
- package/dist/commands/channel/agent-loader.js +154 -0
- package/dist/commands/channel/agent-loader.js.map +1 -0
- package/dist/commands/channel/context-loader.d.ts +26 -0
- package/dist/commands/channel/context-loader.d.ts.map +1 -0
- package/dist/commands/channel/context-loader.js +290 -0
- package/dist/commands/channel/context-loader.js.map +1 -0
- package/dist/commands/channel/context.d.ts +16 -0
- package/dist/commands/channel/context.d.ts.map +1 -0
- package/dist/commands/channel/context.js +83 -0
- package/dist/commands/channel/context.js.map +1 -0
- package/dist/commands/channel/create.d.ts +27 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +39 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
- package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
- package/dist/commands/channel/dev-parse-trace.js +70 -0
- package/dist/commands/channel/dev-parse-trace.js.map +1 -0
- package/dist/commands/channel/guard.d.ts +150 -0
- package/dist/commands/channel/guard.d.ts.map +1 -0
- package/dist/commands/channel/guard.js +475 -0
- package/dist/commands/channel/guard.js.map +1 -0
- package/dist/commands/channel/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +531 -0
- package/dist/commands/channel/index.js.map +1 -0
- package/dist/commands/channel/interrupt.d.ts +10 -0
- package/dist/commands/channel/interrupt.d.ts.map +1 -0
- package/dist/commands/channel/interrupt.js +22 -0
- package/dist/commands/channel/interrupt.js.map +1 -0
- package/dist/commands/channel/kill.d.ts +7 -0
- package/dist/commands/channel/kill.d.ts.map +1 -0
- package/dist/commands/channel/kill.js +121 -0
- package/dist/commands/channel/kill.js.map +1 -0
- package/dist/commands/channel/list.d.ts +17 -0
- package/dist/commands/channel/list.d.ts.map +1 -0
- package/dist/commands/channel/list.js +233 -0
- package/dist/commands/channel/list.js.map +1 -0
- package/dist/commands/channel/messages.d.ts +15 -0
- package/dist/commands/channel/messages.d.ts.map +1 -0
- package/dist/commands/channel/messages.js +245 -0
- package/dist/commands/channel/messages.js.map +1 -0
- package/dist/commands/channel/rm.d.ts +27 -0
- package/dist/commands/channel/rm.d.ts.map +1 -0
- package/dist/commands/channel/rm.js +216 -0
- package/dist/commands/channel/rm.js.map +1 -0
- package/dist/commands/channel/run.d.ts +30 -0
- package/dist/commands/channel/run.d.ts.map +1 -0
- package/dist/commands/channel/run.js +130 -0
- package/dist/commands/channel/run.js.map +1 -0
- package/dist/commands/channel/send.d.ts +11 -0
- package/dist/commands/channel/send.d.ts.map +1 -0
- package/dist/commands/channel/send.js +24 -0
- package/dist/commands/channel/send.js.map +1 -0
- package/dist/commands/channel/spawn.d.ts +40 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -0
- package/dist/commands/channel/spawn.js +242 -0
- package/dist/commands/channel/spawn.js.map +1 -0
- package/dist/commands/channel/store/events.d.ts +39 -0
- package/dist/commands/channel/store/events.d.ts.map +1 -0
- package/dist/commands/channel/store/events.js +87 -0
- package/dist/commands/channel/store/events.js.map +1 -0
- package/dist/commands/channel/store/filter.d.ts +3 -0
- package/dist/commands/channel/store/filter.d.ts.map +1 -0
- package/dist/commands/channel/store/filter.js +2 -0
- package/dist/commands/channel/store/filter.js.map +1 -0
- package/dist/commands/channel/store/lock.d.ts +23 -0
- package/dist/commands/channel/store/lock.d.ts.map +1 -0
- package/dist/commands/channel/store/lock.js +99 -0
- package/dist/commands/channel/store/lock.js.map +1 -0
- package/dist/commands/channel/store/paths.d.ts +63 -0
- package/dist/commands/channel/store/paths.d.ts.map +1 -0
- package/dist/commands/channel/store/paths.js +247 -0
- package/dist/commands/channel/store/paths.js.map +1 -0
- package/dist/commands/channel/store/schema.d.ts +27 -0
- package/dist/commands/channel/store/schema.d.ts.map +1 -0
- package/dist/commands/channel/store/schema.js +34 -0
- package/dist/commands/channel/store/schema.js.map +1 -0
- package/dist/commands/channel/store/thread-state.d.ts +5 -0
- package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
- package/dist/commands/channel/store/thread-state.js +16 -0
- package/dist/commands/channel/store/thread-state.js.map +1 -0
- package/dist/commands/channel/store/watch.d.ts +19 -0
- package/dist/commands/channel/store/watch.d.ts.map +1 -0
- package/dist/commands/channel/store/watch.js +146 -0
- package/dist/commands/channel/store/watch.js.map +1 -0
- package/dist/commands/channel/supervisor/idle.d.ts +46 -0
- package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/idle.js +72 -0
- package/dist/commands/channel/supervisor/idle.js.map +1 -0
- package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
- package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/inbox.js +160 -0
- package/dist/commands/channel/supervisor/inbox.js.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.js +146 -0
- package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
- package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/stdout.js +121 -0
- package/dist/commands/channel/supervisor/stdout.js.map +1 -0
- package/dist/commands/channel/supervisor/turns.d.ts +31 -0
- package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/turns.js +45 -0
- package/dist/commands/channel/supervisor/turns.js.map +1 -0
- package/dist/commands/channel/supervisor/warning.d.ts +48 -0
- package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/warning.js +77 -0
- package/dist/commands/channel/supervisor/warning.js.map +1 -0
- package/dist/commands/channel/supervisor.d.ts +59 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -0
- package/dist/commands/channel/supervisor.js +345 -0
- package/dist/commands/channel/supervisor.js.map +1 -0
- package/dist/commands/channel/text-body.d.ts +13 -0
- package/dist/commands/channel/text-body.d.ts.map +1 -0
- package/dist/commands/channel/text-body.js +47 -0
- package/dist/commands/channel/text-body.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +39 -0
- package/dist/commands/channel/threads.d.ts.map +1 -0
- package/dist/commands/channel/threads.js +106 -0
- package/dist/commands/channel/threads.js.map +1 -0
- package/dist/commands/channel/title.d.ts +12 -0
- package/dist/commands/channel/title.d.ts.map +1 -0
- package/dist/commands/channel/title.js +24 -0
- package/dist/commands/channel/title.js.map +1 -0
- package/dist/commands/channel/wait.d.ts +17 -0
- package/dist/commands/channel/wait.d.ts.map +1 -0
- package/dist/commands/channel/wait.js +75 -0
- package/dist/commands/channel/wait.js.map +1 -0
- package/dist/commands/detach.d.ts +7 -0
- package/dist/commands/detach.d.ts.map +1 -0
- package/dist/commands/detach.js +31 -0
- package/dist/commands/detach.js.map +1 -0
- package/dist/commands/init.d.ts +51 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1660 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/migrate.d.ts +10 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +38 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/purge.d.ts +9 -0
- package/dist/commands/purge.d.ts.map +1 -0
- package/dist/commands/purge.js +29 -0
- package/dist/commands/purge.js.map +1 -0
- package/dist/commands/rollback.d.ts +7 -0
- package/dist/commands/rollback.d.ts.map +1 -0
- package/dist/commands/rollback.js +27 -0
- package/dist/commands/rollback.js.map +1 -0
- package/dist/commands/rollout.d.ts +34 -0
- package/dist/commands/rollout.d.ts.map +1 -0
- package/dist/commands/rollout.js +102 -0
- package/dist/commands/rollout.js.map +1 -0
- package/dist/commands/uninstall.d.ts +23 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +68 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +139 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +2459 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/upgrade.d.ts +28 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +84 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/validate-rules.d.ts +6 -0
- package/dist/commands/validate-rules.d.ts.map +1 -0
- package/dist/commands/validate-rules.js +33 -0
- package/dist/commands/validate-rules.js.map +1 -0
- package/dist/commands/workflow.d.ts +35 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +220 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/configurators/cursor.d.ts +21 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +51 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/index.d.ts +68 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +170 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/shared.d.ts +200 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +602 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/workflow.d.ts +45 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +256 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +93 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +106 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.d.ts +62 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +187 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.1.0.json +9 -0
- package/dist/migrations/manifests/0.1.1.json +9 -0
- package/dist/migrations/manifests/0.1.2.json +9 -0
- package/dist/migrations/manifests/0.1.3.json +9 -0
- package/dist/migrations/manifests/0.1.4.json +9 -0
- package/dist/migrations/manifests/0.2.1.json +9 -0
- package/dist/migrations/manifests/0.2.10.json +374 -0
- package/dist/migrations/manifests/0.2.2.json +9 -0
- package/dist/migrations/manifests/0.2.3.json +9 -0
- package/dist/migrations/manifests/0.2.4.json +9 -0
- package/dist/migrations/manifests/0.2.5.json +9 -0
- package/dist/migrations/manifests/0.2.6.json +9 -0
- package/dist/migrations/manifests/0.2.7.json +9 -0
- package/dist/migrations/manifests/0.2.8.json +9 -0
- package/dist/migrations/manifests/0.2.9.json +9 -0
- package/dist/migrations/manifests/0.3.0.json +89 -0
- package/dist/migrations/manifests/0.3.1.json +32 -0
- package/dist/migrations/manifests/0.3.2.json +16 -0
- package/dist/migrations/manifests/0.3.3.json +9 -0
- package/dist/migrations/manifests/0.3.4.json +9 -0
- package/dist/migrations/manifests/0.3.5.json +9 -0
- package/dist/migrations/manifests/0.3.6.json +9 -0
- package/dist/migrations/manifests/0.4.0.json +9 -0
- package/dist/migrations/manifests/0.4.1.json +9 -0
- package/dist/migrations/manifests/0.4.2.json +9 -0
- package/dist/migrations/manifests/0.4.3.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.0.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.5.json +9 -0
- package/dist/pactile/adapters/codex/index.d.ts +75 -0
- package/dist/pactile/adapters/codex/index.d.ts.map +1 -0
- package/dist/pactile/adapters/codex/index.js +269 -0
- package/dist/pactile/adapters/codex/index.js.map +1 -0
- package/dist/pactile/adapters/cursor/index.d.ts +60 -0
- package/dist/pactile/adapters/cursor/index.d.ts.map +1 -0
- package/dist/pactile/adapters/cursor/index.js +186 -0
- package/dist/pactile/adapters/cursor/index.js.map +1 -0
- package/dist/pactile/adapters/index.d.ts +4 -0
- package/dist/pactile/adapters/index.d.ts.map +1 -0
- package/dist/pactile/adapters/index.js +4 -0
- package/dist/pactile/adapters/index.js.map +1 -0
- package/dist/pactile/adoption/bindings.d.ts +20 -0
- package/dist/pactile/adoption/bindings.d.ts.map +1 -0
- package/dist/pactile/adoption/bindings.js +99 -0
- package/dist/pactile/adoption/bindings.js.map +1 -0
- package/dist/pactile/adoption/discovery.d.ts +8 -0
- package/dist/pactile/adoption/discovery.d.ts.map +1 -0
- package/dist/pactile/adoption/discovery.js +159 -0
- package/dist/pactile/adoption/discovery.js.map +1 -0
- package/dist/pactile/adoption/inventory.d.ts +28 -0
- package/dist/pactile/adoption/inventory.d.ts.map +1 -0
- package/dist/pactile/adoption/inventory.js +261 -0
- package/dist/pactile/adoption/inventory.js.map +1 -0
- package/dist/pactile/adoption/safety.d.ts +19 -0
- package/dist/pactile/adoption/safety.d.ts.map +1 -0
- package/dist/pactile/adoption/safety.js +88 -0
- package/dist/pactile/adoption/safety.js.map +1 -0
- package/dist/pactile/adoption/workflow.d.ts +31 -0
- package/dist/pactile/adoption/workflow.d.ts.map +1 -0
- package/dist/pactile/adoption/workflow.js +259 -0
- package/dist/pactile/adoption/workflow.js.map +1 -0
- package/dist/pactile/compat/cli-options.d.ts +9 -0
- package/dist/pactile/compat/cli-options.d.ts.map +1 -0
- package/dist/pactile/compat/cli-options.js +9 -0
- package/dist/pactile/compat/cli-options.js.map +1 -0
- package/dist/pactile/compat/init-context.d.ts +16 -0
- package/dist/pactile/compat/init-context.d.ts.map +1 -0
- package/dist/pactile/compat/init-context.js +87 -0
- package/dist/pactile/compat/init-context.js.map +1 -0
- package/dist/pactile/compat/legacy-migrations.d.ts +8 -0
- package/dist/pactile/compat/legacy-migrations.d.ts.map +1 -0
- package/dist/pactile/compat/legacy-migrations.js +17 -0
- package/dist/pactile/compat/legacy-migrations.js.map +1 -0
- package/dist/pactile/compat/retired-alternate-client.d.ts +42 -0
- package/dist/pactile/compat/retired-alternate-client.d.ts.map +1 -0
- package/dist/pactile/compat/retired-alternate-client.js +153 -0
- package/dist/pactile/compat/retired-alternate-client.js.map +1 -0
- package/dist/pactile/compat/update-residue.d.ts +4 -0
- package/dist/pactile/compat/update-residue.d.ts.map +1 -0
- package/dist/pactile/compat/update-residue.js +55 -0
- package/dist/pactile/compat/update-residue.js.map +1 -0
- package/dist/pactile/exit/index.d.ts +3 -0
- package/dist/pactile/exit/index.d.ts.map +1 -0
- package/dist/pactile/exit/index.js +3 -0
- package/dist/pactile/exit/index.js.map +1 -0
- package/dist/pactile/exit/receipt.d.ts +23 -0
- package/dist/pactile/exit/receipt.d.ts.map +1 -0
- package/dist/pactile/exit/receipt.js +64 -0
- package/dist/pactile/exit/receipt.js.map +1 -0
- package/dist/pactile/exit/service.d.ts +107 -0
- package/dist/pactile/exit/service.d.ts.map +1 -0
- package/dist/pactile/exit/service.js +774 -0
- package/dist/pactile/exit/service.js.map +1 -0
- package/dist/pactile/index.d.ts +26 -0
- package/dist/pactile/index.d.ts.map +1 -0
- package/dist/pactile/index.js +22 -0
- package/dist/pactile/index.js.map +1 -0
- package/dist/pactile/lifecycle/command-runner.d.ts +26 -0
- package/dist/pactile/lifecycle/command-runner.d.ts.map +1 -0
- package/dist/pactile/lifecycle/command-runner.js +129 -0
- package/dist/pactile/lifecycle/command-runner.js.map +1 -0
- package/dist/pactile/lifecycle/default-adapters.d.ts +5 -0
- package/dist/pactile/lifecycle/default-adapters.d.ts.map +1 -0
- package/dist/pactile/lifecycle/default-adapters.js +136 -0
- package/dist/pactile/lifecycle/default-adapters.js.map +1 -0
- package/dist/pactile/lifecycle/index.d.ts +6 -0
- package/dist/pactile/lifecycle/index.d.ts.map +1 -0
- package/dist/pactile/lifecycle/index.js +6 -0
- package/dist/pactile/lifecycle/index.js.map +1 -0
- package/dist/pactile/lifecycle/legacy-import.d.ts +16 -0
- package/dist/pactile/lifecycle/legacy-import.d.ts.map +1 -0
- package/dist/pactile/lifecycle/legacy-import.js +228 -0
- package/dist/pactile/lifecycle/legacy-import.js.map +1 -0
- package/dist/pactile/lifecycle/orchestrator.d.ts +109 -0
- package/dist/pactile/lifecycle/orchestrator.d.ts.map +1 -0
- package/dist/pactile/lifecycle/orchestrator.js +1030 -0
- package/dist/pactile/lifecycle/orchestrator.js.map +1 -0
- package/dist/pactile/lifecycle/project-files.d.ts +28 -0
- package/dist/pactile/lifecycle/project-files.d.ts.map +1 -0
- package/dist/pactile/lifecycle/project-files.js +297 -0
- package/dist/pactile/lifecycle/project-files.js.map +1 -0
- package/dist/pactile/middleware/index.d.ts +3 -0
- package/dist/pactile/middleware/index.d.ts.map +1 -0
- package/dist/pactile/middleware/index.js +2 -0
- package/dist/pactile/middleware/index.js.map +1 -0
- package/dist/pactile/middleware/manifest-loader.d.ts +22 -0
- package/dist/pactile/middleware/manifest-loader.d.ts.map +1 -0
- package/dist/pactile/middleware/manifest-loader.js +228 -0
- package/dist/pactile/middleware/manifest-loader.js.map +1 -0
- package/dist/pactile/migration/index.d.ts +2 -0
- package/dist/pactile/migration/index.d.ts.map +1 -0
- package/dist/pactile/migration/index.js +2 -0
- package/dist/pactile/migration/index.js.map +1 -0
- package/dist/pactile/migration/transaction.d.ts +54 -0
- package/dist/pactile/migration/transaction.d.ts.map +1 -0
- package/dist/pactile/migration/transaction.js +445 -0
- package/dist/pactile/migration/transaction.js.map +1 -0
- package/dist/pactile/projection/managed-block.d.ts +32 -0
- package/dist/pactile/projection/managed-block.d.ts.map +1 -0
- package/dist/pactile/projection/managed-block.js +78 -0
- package/dist/pactile/projection/managed-block.js.map +1 -0
- package/dist/pactile/projection/planner.d.ts +65 -0
- package/dist/pactile/projection/planner.d.ts.map +1 -0
- package/dist/pactile/projection/planner.js +349 -0
- package/dist/pactile/projection/planner.js.map +1 -0
- package/dist/pactile/projection/shared/index.d.ts +38 -0
- package/dist/pactile/projection/shared/index.d.ts.map +1 -0
- package/dist/pactile/projection/shared/index.js +186 -0
- package/dist/pactile/projection/shared/index.js.map +1 -0
- package/dist/pactile/projection/store.d.ts +72 -0
- package/dist/pactile/projection/store.d.ts.map +1 -0
- package/dist/pactile/projection/store.js +669 -0
- package/dist/pactile/projection/store.js.map +1 -0
- package/dist/pactile/projection/structured-merge.d.ts +11 -0
- package/dist/pactile/projection/structured-merge.d.ts.map +1 -0
- package/dist/pactile/projection/structured-merge.js +347 -0
- package/dist/pactile/projection/structured-merge.js.map +1 -0
- package/dist/pactile/providers/index.d.ts +3 -0
- package/dist/pactile/providers/index.d.ts.map +1 -0
- package/dist/pactile/providers/index.js +3 -0
- package/dist/pactile/providers/index.js.map +1 -0
- package/dist/pactile/providers/probes.d.ts +55 -0
- package/dist/pactile/providers/probes.d.ts.map +1 -0
- package/dist/pactile/providers/probes.js +164 -0
- package/dist/pactile/providers/probes.js.map +1 -0
- package/dist/pactile/registry.d.ts +64 -0
- package/dist/pactile/registry.d.ts.map +1 -0
- package/dist/pactile/registry.js +196 -0
- package/dist/pactile/registry.js.map +1 -0
- package/dist/pactile/retrieval/boundary.d.ts +18 -0
- package/dist/pactile/retrieval/boundary.d.ts.map +1 -0
- package/dist/pactile/retrieval/boundary.js +113 -0
- package/dist/pactile/retrieval/boundary.js.map +1 -0
- package/dist/pactile/retrieval/evidence.d.ts +9 -0
- package/dist/pactile/retrieval/evidence.d.ts.map +1 -0
- package/dist/pactile/retrieval/evidence.js +327 -0
- package/dist/pactile/retrieval/evidence.js.map +1 -0
- package/dist/pactile/retrieval/index.d.ts +4 -0
- package/dist/pactile/retrieval/index.d.ts.map +1 -0
- package/dist/pactile/retrieval/index.js +4 -0
- package/dist/pactile/retrieval/index.js.map +1 -0
- package/dist/pactile/retrieval/planner.d.ts +23 -0
- package/dist/pactile/retrieval/planner.d.ts.map +1 -0
- package/dist/pactile/retrieval/planner.js +702 -0
- package/dist/pactile/retrieval/planner.js.map +1 -0
- package/dist/pactile/retrieval/types.d.ts +108 -0
- package/dist/pactile/retrieval/types.d.ts.map +1 -0
- package/dist/pactile/retrieval/types.js +36 -0
- package/dist/pactile/retrieval/types.js.map +1 -0
- package/dist/pactile/runtime/case-fold.d.ts +2 -0
- package/dist/pactile/runtime/case-fold.d.ts.map +1 -0
- package/dist/pactile/runtime/case-fold.js +31 -0
- package/dist/pactile/runtime/case-fold.js.map +1 -0
- package/dist/pactile/runtime/index.d.ts +8 -0
- package/dist/pactile/runtime/index.d.ts.map +1 -0
- package/dist/pactile/runtime/index.js +5 -0
- package/dist/pactile/runtime/index.js.map +1 -0
- package/dist/pactile/runtime/json-api.d.ts +15 -0
- package/dist/pactile/runtime/json-api.d.ts.map +1 -0
- package/dist/pactile/runtime/json-api.js +68 -0
- package/dist/pactile/runtime/json-api.js.map +1 -0
- package/dist/pactile/runtime/paths.d.ts +59 -0
- package/dist/pactile/runtime/paths.d.ts.map +1 -0
- package/dist/pactile/runtime/paths.js +201 -0
- package/dist/pactile/runtime/paths.js.map +1 -0
- package/dist/pactile/runtime/stores.d.ts +54 -0
- package/dist/pactile/runtime/stores.d.ts.map +1 -0
- package/dist/pactile/runtime/stores.js +375 -0
- package/dist/pactile/runtime/stores.js.map +1 -0
- package/dist/pactile/runtime/unicode-nfc-data.d.ts +12 -0
- package/dist/pactile/runtime/unicode-nfc-data.d.ts.map +1 -0
- package/dist/pactile/runtime/unicode-nfc-data.js +8 -0
- package/dist/pactile/runtime/unicode-nfc-data.js.map +1 -0
- package/dist/pactile/runtime/unicode-nfc.d.ts +3 -0
- package/dist/pactile/runtime/unicode-nfc.d.ts.map +1 -0
- package/dist/pactile/runtime/unicode-nfc.js +77 -0
- package/dist/pactile/runtime/unicode-nfc.js.map +1 -0
- package/dist/pactile/tiles/catalog.d.ts +35 -0
- package/dist/pactile/tiles/catalog.d.ts.map +1 -0
- package/dist/pactile/tiles/catalog.js +235 -0
- package/dist/pactile/tiles/catalog.js.map +1 -0
- package/dist/pactile/tiles/compiler.d.ts +54 -0
- package/dist/pactile/tiles/compiler.d.ts.map +1 -0
- package/dist/pactile/tiles/compiler.js +270 -0
- package/dist/pactile/tiles/compiler.js.map +1 -0
- package/dist/pactile/tiles/content/baseline/index.d.ts +5 -0
- package/dist/pactile/tiles/content/baseline/index.d.ts.map +1 -0
- package/dist/pactile/tiles/content/baseline/index.js +115 -0
- package/dist/pactile/tiles/content/baseline/index.js.map +1 -0
- package/dist/pactile/tiles/content/index.d.ts +4 -0
- package/dist/pactile/tiles/content/index.d.ts.map +1 -0
- package/dist/pactile/tiles/content/index.js +4 -0
- package/dist/pactile/tiles/content/index.js.map +1 -0
- package/dist/pactile/tiles/content/ondemand/index.d.ts +5 -0
- package/dist/pactile/tiles/content/ondemand/index.d.ts.map +1 -0
- package/dist/pactile/tiles/content/ondemand/index.js +184 -0
- package/dist/pactile/tiles/content/ondemand/index.js.map +1 -0
- package/dist/pactile/tiles/content/source.d.ts +29 -0
- package/dist/pactile/tiles/content/source.d.ts.map +1 -0
- package/dist/pactile/tiles/content/source.js +86 -0
- package/dist/pactile/tiles/content/source.js.map +1 -0
- package/dist/pactile/tiles/loader.d.ts +31 -0
- package/dist/pactile/tiles/loader.d.ts.map +1 -0
- package/dist/pactile/tiles/loader.js +139 -0
- package/dist/pactile/tiles/loader.js.map +1 -0
- package/dist/pactile/tiles/safe-yaml.d.ts +11 -0
- package/dist/pactile/tiles/safe-yaml.d.ts.map +1 -0
- package/dist/pactile/tiles/safe-yaml.js +212 -0
- package/dist/pactile/tiles/safe-yaml.js.map +1 -0
- package/dist/templates/common/bundled-skills/pactile-check/SKILL.md +161 -0
- package/dist/templates/common/bundled-skills/pactile-check/references/fowler-12-smells.md +28 -0
- package/dist/templates/common/bundled-skills/pactile-handoff/SKILL.md +117 -0
- package/dist/templates/common/bundled-skills/pactile-meta/SKILL.md +75 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/add-project-local-conventions.md +83 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-agents.md +47 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-context-loading.md +84 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-hooks.md +57 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-skills-or-commands.md +77 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-spec-structure.md +83 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-task-lifecycle.md +88 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/change-workflow.md +65 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/customize-local/overview.md +55 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/context-injection.md +68 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/generated-files.md +83 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/overview.md +51 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/spec-system.md +102 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/task-system.md +133 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/workflow.md +75 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/local-architecture/workspace-memory.md +71 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/agents.md +69 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/hooks-and-settings.md +59 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/overview.md +45 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/platform-map.md +45 -0
- package/dist/templates/common/bundled-skills/pactile-meta/references/platform-files/skills-and-commands.md +108 -0
- package/dist/templates/common/bundled-skills/pactile-micro-grill/SKILL.md +68 -0
- package/dist/templates/common/bundled-skills/pactile-skill-creator/SKILL.md +47 -0
- package/dist/templates/common/bundled-skills/pactile-skill-creator/references/authoring-rules.md +171 -0
- package/dist/templates/common/bundled-skills/pactile-skill-creator/references/general-authoring.md +189 -0
- package/dist/templates/common/bundled-skills/pactile-skill-creator/references/pactile-skill-locations.md +52 -0
- package/dist/templates/common/bundled-skills/pactile-skill-creator/references/review-checklist.md +52 -0
- package/dist/templates/common/bundled-skills/pactile-spec-bootstrap/SKILL.md +41 -0
- package/dist/templates/common/bundled-skills/pactile-spec-bootstrap/references/mcp-setup.md +90 -0
- package/dist/templates/common/bundled-skills/pactile-spec-bootstrap/references/repository-analysis.md +59 -0
- package/dist/templates/common/bundled-skills/pactile-spec-bootstrap/references/spec-task-planning.md +61 -0
- package/dist/templates/common/bundled-skills/pactile-spec-bootstrap/references/spec-writing.md +70 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +393 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/agents/openai.yaml +3 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/examples/batch-search.md +98 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/examples/evidence-gathering.md +89 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/references/cli-contract.md +323 -0
- package/dist/templates/common/commands/continue.md +62 -0
- package/dist/templates/common/commands/finish-work.md +82 -0
- package/dist/templates/common/commands/start.md +66 -0
- package/dist/templates/common/index.d.ts +68 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +123 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/common/optional-skills/chrome-cdp/SKILL.md +179 -0
- package/dist/templates/common/optional-skills/chrome-cdp/examples/fetch-hook-api-capture.md +149 -0
- package/dist/templates/common/optional-skills/chrome-cdp/scripts/cdp.mjs +904 -0
- package/dist/templates/common/skills/before-dev.md +35 -0
- package/dist/templates/common/skills/brainstorm.md +204 -0
- package/dist/templates/common/skills/break-loop.md +125 -0
- package/dist/templates/common/skills/update-spec.md +364 -0
- package/dist/templates/cursor/agents/pactile-check.md +58 -0
- package/dist/templates/cursor/agents/pactile-implement.md +56 -0
- package/dist/templates/cursor/agents/pactile-research.md +51 -0
- package/dist/templates/cursor/commands/handoff.md +101 -0
- package/dist/templates/cursor/fixtures/expected-rules.d.ts +14 -0
- package/dist/templates/cursor/fixtures/expected-rules.d.ts.map +1 -0
- package/dist/templates/cursor/fixtures/expected-rules.js +20 -0
- package/dist/templates/cursor/fixtures/expected-rules.js.map +1 -0
- package/dist/templates/cursor/hooks.json +52 -0
- package/dist/templates/cursor/index.d.ts +19 -0
- package/dist/templates/cursor/index.d.ts.map +1 -0
- package/dist/templates/cursor/index.js +19 -0
- package/dist/templates/cursor/index.js.map +1 -0
- package/dist/templates/cursor/rules/pactile-bootstrap.mdc +18 -0
- package/dist/templates/cursor/worktrees.json +11 -0
- package/dist/templates/extract.d.ts +38 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +120 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/markdown/agents.md +14 -0
- package/dist/templates/markdown/framework/artifact-locale-guide.md.txt +93 -0
- package/dist/templates/markdown/framework/cursor-context-injection-guide.md.txt +85 -0
- package/dist/templates/markdown/framework/cursor-native-modes-guide.md.txt +239 -0
- package/dist/templates/markdown/framework/cursor-semantic-compliance.md.txt +41 -0
- package/dist/templates/markdown/framework/cursor-subagent-policy.md.txt +90 -0
- package/dist/templates/markdown/framework/dogfood-only-surfaces.md.txt +28 -0
- package/dist/templates/markdown/framework/execution-strategy.md.txt +45 -0
- package/dist/templates/markdown/framework/index.md.txt +31 -0
- package/dist/templates/markdown/framework/injection-budget-guide.md.txt +111 -0
- package/dist/templates/markdown/framework/internal-skills-cursor-reachability.md.txt +45 -0
- package/dist/templates/markdown/framework/middleware-protocol.md.txt +238 -0
- package/dist/templates/markdown/framework/parallel-first-execution.md.txt +116 -0
- package/dist/templates/markdown/framework/prd-grill-frontier.md.txt +105 -0
- package/dist/templates/markdown/framework/release-boundary.md.txt +30 -0
- package/dist/templates/markdown/framework/retrieval-daily-guide.md.txt +199 -0
- package/dist/templates/markdown/framework/upgrade.md.txt +15 -0
- package/dist/templates/markdown/framework/verification-strength-guide.md.txt +185 -0
- package/dist/templates/markdown/gitignore.txt +15 -0
- package/dist/templates/markdown/index.d.ts +59 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +144 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +25 -0
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +174 -0
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +162 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +634 -0
- package/dist/templates/markdown/spec/guides/debug-loop-guide.md.txt +227 -0
- package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +76 -0
- package/dist/templates/markdown/spec/guides/e2e-walkthrough-guide.md.txt +93 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +131 -0
- package/dist/templates/markdown/spec/guides/prototype-guide.md.txt +139 -0
- package/dist/templates/markdown/spec/guides/test-discipline-guide.md.txt +179 -0
- package/dist/templates/markdown/workspace-index.md +125 -0
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/dist/templates/pactile/CONTEXT.md +113 -0
- package/dist/templates/pactile/config/execution-strategy-rules.json +31 -0
- package/dist/templates/pactile/config.yaml +130 -0
- package/dist/templates/pactile/docs/adr/README.md +21 -0
- package/dist/templates/pactile/gitignore.txt +35 -0
- package/dist/templates/pactile/index.d.ts +134 -0
- package/dist/templates/pactile/index.d.ts.map +1 -0
- package/dist/templates/pactile/index.js +316 -0
- package/dist/templates/pactile/index.js.map +1 -0
- package/dist/templates/pactile/modules/approval-personal/contract.md +43 -0
- package/dist/templates/pactile/modules/candidate-pool/contract.md +37 -0
- package/dist/templates/pactile/modules/catalog.d.ts +32 -0
- package/dist/templates/pactile/modules/catalog.d.ts.map +1 -0
- package/dist/templates/pactile/modules/catalog.js +46 -0
- package/dist/templates/pactile/modules/catalog.js.map +1 -0
- package/dist/templates/pactile/modules/close-basic/contract.md +38 -0
- package/dist/templates/pactile/modules/context-progressive/contract.md +44 -0
- package/dist/templates/pactile/modules/debug-recovery/contract.md +44 -0
- package/dist/templates/pactile/modules/define-basic/contract.md +39 -0
- package/dist/templates/pactile/modules/define-extended/contract.md +45 -0
- package/dist/templates/pactile/modules/execute-agent/contract.md +38 -0
- package/dist/templates/pactile/modules/independent-check/contract.md +35 -0
- package/dist/templates/pactile/modules/index.json +133 -0
- package/dist/templates/pactile/modules/intake-basic/contract.md +34 -0
- package/dist/templates/pactile/modules/observability-local/contract.md +31 -0
- package/dist/templates/pactile/modules/parent-child/contract.md +45 -0
- package/dist/templates/pactile/modules/personal-memory/contract.md +56 -0
- package/dist/templates/pactile/modules/retention-storage/contract.md +43 -0
- package/dist/templates/pactile/modules/retrieval-extended/contract.md +77 -0
- package/dist/templates/pactile/modules/session-transfer/contract.md +41 -0
- package/dist/templates/pactile/modules/spec-learning/contract.md +50 -0
- package/dist/templates/pactile/modules/vcs-integration/contract.md +46 -0
- package/dist/templates/pactile/modules/verify-basic/contract.md +38 -0
- package/dist/templates/pactile/modules/worker-orchestration/contract.md +47 -0
- package/dist/templates/pactile/pool/README.md +149 -0
- package/dist/templates/pactile/pool/items/.gitkeep +0 -0
- package/dist/templates/pactile/pool/plan.md +50 -0
- package/dist/templates/pactile/scripts/__init__.py +5 -0
- package/dist/templates/pactile/scripts/add_session.py +547 -0
- package/dist/templates/pactile/scripts/build_context_pack.py +17 -0
- package/dist/templates/pactile/scripts/build_retrieval_pack.py +376 -0
- package/dist/templates/pactile/scripts/codegraph_session_smoke.py +76 -0
- package/dist/templates/pactile/scripts/common/__init__.py +103 -0
- package/dist/templates/pactile/scripts/common/active_task.py +576 -0
- package/dist/templates/pactile/scripts/common/adapter_middleware.py +1373 -0
- package/dist/templates/pactile/scripts/common/artifact_locale.py +303 -0
- package/dist/templates/pactile/scripts/common/artifact_search.py +587 -0
- package/dist/templates/pactile/scripts/common/cli_adapter.py +135 -0
- package/dist/templates/pactile/scripts/common/cli_environment.py +155 -0
- package/dist/templates/pactile/scripts/common/codebase_retrieval_router.py +1339 -0
- package/dist/templates/pactile/scripts/common/config.py +497 -0
- package/dist/templates/pactile/scripts/common/context_pack.py +371 -0
- package/dist/templates/pactile/scripts/common/cursor_retrieval_env.py +31 -0
- package/dist/templates/pactile/scripts/common/developer.py +190 -0
- package/dist/templates/pactile/scripts/common/execution_strategy.py +268 -0
- package/dist/templates/pactile/scripts/common/full_quality.py +237 -0
- package/dist/templates/pactile/scripts/common/git.py +37 -0
- package/dist/templates/pactile/scripts/common/git_context.py +198 -0
- package/dist/templates/pactile/scripts/common/injection_budget.py +317 -0
- package/dist/templates/pactile/scripts/common/io.py +37 -0
- package/dist/templates/pactile/scripts/common/kernel_command.py +369 -0
- package/dist/templates/pactile/scripts/common/lite_context.py +280 -0
- package/dist/templates/pactile/scripts/common/log.py +45 -0
- package/dist/templates/pactile/scripts/common/ondemand_topology.py +419 -0
- package/dist/templates/pactile/scripts/common/packages_context.py +239 -0
- package/dist/templates/pactile/scripts/common/pactile_config.py +131 -0
- package/dist/templates/pactile/scripts/common/parallel_declaration.py +369 -0
- package/dist/templates/pactile/scripts/common/parent_orchestration.py +1198 -0
- package/dist/templates/pactile/scripts/common/paths.py +756 -0
- package/dist/templates/pactile/scripts/common/pool_refs.py +119 -0
- package/dist/templates/pactile/scripts/common/pool_slice.py +269 -0
- package/dist/templates/pactile/scripts/common/pool_store.py +766 -0
- package/dist/templates/pactile/scripts/common/project_file_stats.py +91 -0
- package/dist/templates/pactile/scripts/common/retrieval_adapter_metadata.py +943 -0
- package/dist/templates/pactile/scripts/common/retrieval_agent_instructions.py +123 -0
- package/dist/templates/pactile/scripts/common/retrieval_evidence.py +915 -0
- package/dist/templates/pactile/scripts/common/retrieval_pack.py +422 -0
- package/dist/templates/pactile/scripts/common/retrieval_pack_context.py +122 -0
- package/dist/templates/pactile/scripts/common/retrieval_plan_gate.py +61 -0
- package/dist/templates/pactile/scripts/common/retrieval_result_ranking.py +104 -0
- package/dist/templates/pactile/scripts/common/retrieval_tool_classification.py +166 -0
- package/dist/templates/pactile/scripts/common/safe_commit.py +285 -0
- package/dist/templates/pactile/scripts/common/semantic_plan_gate.py +53 -0
- package/dist/templates/pactile/scripts/common/session_context.py +1213 -0
- package/dist/templates/pactile/scripts/common/session_memory.py +386 -0
- package/dist/templates/pactile/scripts/common/session_pack.py +886 -0
- package/dist/templates/pactile/scripts/common/smart_search_evidence.py +514 -0
- package/dist/templates/pactile/scripts/common/smart_search_resolve.py +150 -0
- package/dist/templates/pactile/scripts/common/subagent_dispatch.py +592 -0
- package/dist/templates/pactile/scripts/common/task_context.py +241 -0
- package/dist/templates/pactile/scripts/common/task_dashboard.py +286 -0
- package/dist/templates/pactile/scripts/common/task_dependencies.py +648 -0
- package/dist/templates/pactile/scripts/common/task_gates.py +2478 -0
- package/dist/templates/pactile/scripts/common/task_map.py +703 -0
- package/dist/templates/pactile/scripts/common/task_queue.py +188 -0
- package/dist/templates/pactile/scripts/common/task_store.py +2252 -0
- package/dist/templates/pactile/scripts/common/task_utils.py +274 -0
- package/dist/templates/pactile/scripts/common/tasks.py +231 -0
- package/dist/templates/pactile/scripts/common/test_adapter_middleware.py +199 -0
- package/dist/templates/pactile/scripts/common/test_depends_mode_block.py +509 -0
- package/dist/templates/pactile/scripts/common/test_full_quality.py +197 -0
- package/dist/templates/pactile/scripts/common/test_kernel_command.py +336 -0
- package/dist/templates/pactile/scripts/common/test_lite_path.py +190 -0
- package/dist/templates/pactile/scripts/common/test_observable_defaults.py +141 -0
- package/dist/templates/pactile/scripts/common/test_ondemand_topology.py +237 -0
- package/dist/templates/pactile/scripts/common/test_parallel_declaration.py +264 -0
- package/dist/templates/pactile/scripts/common/test_pool_slice.py +198 -0
- package/dist/templates/pactile/scripts/common/test_pool_store.py +452 -0
- package/dist/templates/pactile/scripts/common/test_retrieval_arbitration.py +331 -0
- package/dist/templates/pactile/scripts/common/test_task_dashboard.py +155 -0
- package/dist/templates/pactile/scripts/common/test_task_dependencies.py +329 -0
- package/dist/templates/pactile/scripts/common/test_task_store_kernel_patch.py +163 -0
- package/dist/templates/pactile/scripts/common/types.py +110 -0
- package/dist/templates/pactile/scripts/common/workflow_phase.py +194 -0
- package/dist/templates/pactile/scripts/compile_session_pack.py +15 -0
- package/dist/templates/pactile/scripts/cursor_retrieval_probe.py +64 -0
- package/dist/templates/pactile/scripts/cursor_retrieval_probe_prompt.md +33 -0
- package/dist/templates/pactile/scripts/generate_dispatch_prompt.py +182 -0
- package/dist/templates/pactile/scripts/get_context.py +19 -0
- package/dist/templates/pactile/scripts/get_developer.py +26 -0
- package/dist/templates/pactile/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/pactile/scripts/init_developer.py +51 -0
- package/dist/templates/pactile/scripts/injection_budget_probe.py +69 -0
- package/dist/templates/pactile/scripts/pool.py +237 -0
- package/dist/templates/pactile/scripts/rank_retrieval_candidates.py +98 -0
- package/dist/templates/pactile/scripts/retrieval_probe_matrix_template.json +43 -0
- package/dist/templates/pactile/scripts/route_codebase_retrieval.py +72 -0
- package/dist/templates/pactile/scripts/run_smart_search.py +12 -0
- package/dist/templates/pactile/scripts/score_evidence.py +131 -0
- package/dist/templates/pactile/scripts/search_artifacts.py +13 -0
- package/dist/templates/pactile/scripts/search_memory.py +12 -0
- package/dist/templates/pactile/scripts/spec_health_outcomes.py +160 -0
- package/dist/templates/pactile/scripts/task.py +1118 -0
- package/dist/templates/pactile/scripts/verify_evidence_probe.py +138 -0
- package/dist/templates/pactile/tasks/.gitkeep +0 -0
- package/dist/templates/pactile/tasks/locale/en/default-prd.md +27 -0
- package/dist/templates/pactile/tasks/locale/zh/default-prd.md +27 -0
- package/dist/templates/pactile/tasks/templates/release-execution/design.md +61 -0
- package/dist/templates/pactile/tasks/templates/release-execution/handoff-template.md +29 -0
- package/dist/templates/pactile/tasks/templates/release-execution/implement.md +29 -0
- package/dist/templates/pactile/tasks/templates/release-execution/prd.md +31 -0
- package/dist/templates/pactile/tasks/templates/release-readiness/design.md +50 -0
- package/dist/templates/pactile/tasks/templates/release-readiness/handoff-template.md +39 -0
- package/dist/templates/pactile/tasks/templates/release-readiness/implement.md +29 -0
- package/dist/templates/pactile/tasks/templates/release-readiness/prd.md +31 -0
- package/dist/templates/pactile/workflow.md +64 -0
- package/dist/templates/shared-hooks/event-bridge.py +121 -0
- package/dist/templates/shared-hooks/index.d.ts +50 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -0
- package/dist/templates/shared-hooks/index.js +96 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/shared-hooks/inject-retrieval-plan.py +217 -0
- package/dist/templates/shared-hooks/inject-shell-session-context.py +183 -0
- package/dist/templates/shared-hooks/inject-subagent-context.py +267 -0
- package/dist/templates/shared-hooks/inject-workflow-state.py +106 -0
- package/dist/templates/shared-hooks/rename-session-for-task.py +231 -0
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +345 -0
- package/dist/templates/shared-hooks/session-start.py +355 -0
- package/dist/templates/shared-hooks/spec-write-audit.py +173 -0
- package/dist/templates/template-utils.d.ts +28 -0
- package/dist/templates/template-utils.d.ts.map +1 -0
- package/dist/templates/template-utils.js +83 -0
- package/dist/templates/template-utils.js.map +1 -0
- package/dist/types/ai-tools.d.ts +102 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +60 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/types/migration.d.ts +125 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/agents-md.d.ts +27 -0
- package/dist/utils/agents-md.d.ts.map +1 -0
- package/dist/utils/agents-md.js +70 -0
- package/dist/utils/agents-md.js.map +1 -0
- package/dist/utils/codebase-retrieval-router.d.ts +31 -0
- package/dist/utils/codebase-retrieval-router.d.ts.map +1 -0
- package/dist/utils/codebase-retrieval-router.js +88 -0
- package/dist/utils/codebase-retrieval-router.js.map +1 -0
- package/dist/utils/compare-versions.d.ts +12 -0
- package/dist/utils/compare-versions.d.ts.map +1 -0
- package/dist/utils/compare-versions.js +86 -0
- package/dist/utils/compare-versions.js.map +1 -0
- package/dist/utils/cursor-retrieval-env.d.ts +17 -0
- package/dist/utils/cursor-retrieval-env.d.ts.map +1 -0
- package/dist/utils/cursor-retrieval-env.js +19 -0
- package/dist/utils/cursor-retrieval-env.js.map +1 -0
- package/dist/utils/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +63 -0
- package/dist/utils/cwd-guard.js.map +1 -0
- package/dist/utils/file-writer.d.ts +36 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +203 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/manifest-prune.d.ts +59 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -0
- package/dist/utils/manifest-prune.js +176 -0
- package/dist/utils/manifest-prune.js.map +1 -0
- package/dist/utils/mirror-check.d.ts +22 -0
- package/dist/utils/mirror-check.d.ts.map +1 -0
- package/dist/utils/mirror-check.js +90 -0
- package/dist/utils/mirror-check.js.map +1 -0
- package/dist/utils/normalize-text.d.ts +7 -0
- package/dist/utils/normalize-text.d.ts.map +1 -0
- package/dist/utils/normalize-text.js +16 -0
- package/dist/utils/normalize-text.js.map +1 -0
- package/dist/utils/p36-upgrade.d.ts +62 -0
- package/dist/utils/p36-upgrade.d.ts.map +1 -0
- package/dist/utils/p36-upgrade.js +165 -0
- package/dist/utils/p36-upgrade.js.map +1 -0
- package/dist/utils/posix.d.ts +13 -0
- package/dist/utils/posix.d.ts.map +1 -0
- package/dist/utils/posix.js +15 -0
- package/dist/utils/posix.js.map +1 -0
- package/dist/utils/post-update-smoke.d.ts +7 -0
- package/dist/utils/post-update-smoke.d.ts.map +1 -0
- package/dist/utils/post-update-smoke.js +40 -0
- package/dist/utils/post-update-smoke.js.map +1 -0
- package/dist/utils/project-capabilities.d.ts +82 -0
- package/dist/utils/project-capabilities.d.ts.map +1 -0
- package/dist/utils/project-capabilities.js +691 -0
- package/dist/utils/project-capabilities.js.map +1 -0
- package/dist/utils/project-detector.d.ts +46 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +666 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/dist/utils/proxy.d.ts +25 -0
- package/dist/utils/proxy.d.ts.map +1 -0
- package/dist/utils/proxy.js +60 -0
- package/dist/utils/proxy.js.map +1 -0
- package/dist/utils/readiness.d.ts +40 -0
- package/dist/utils/readiness.d.ts.map +1 -0
- package/dist/utils/readiness.js +491 -0
- package/dist/utils/readiness.js.map +1 -0
- package/dist/utils/retrieval-agent-instructions.d.ts +10 -0
- package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -0
- package/dist/utils/retrieval-agent-instructions.js +97 -0
- package/dist/utils/retrieval-agent-instructions.js.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts +53 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.js +116 -0
- package/dist/utils/retrieval-execution-telemetry.js.map +1 -0
- package/dist/utils/retrieval-result-ranking.d.ts +34 -0
- package/dist/utils/retrieval-result-ranking.d.ts.map +1 -0
- package/dist/utils/retrieval-result-ranking.js +71 -0
- package/dist/utils/retrieval-result-ranking.js.map +1 -0
- package/dist/utils/retrieval-tool-classification.d.ts +18 -0
- package/dist/utils/retrieval-tool-classification.d.ts.map +1 -0
- package/dist/utils/retrieval-tool-classification.js +118 -0
- package/dist/utils/retrieval-tool-classification.js.map +1 -0
- package/dist/utils/semantic-plan-gate.d.ts +8 -0
- package/dist/utils/semantic-plan-gate.d.ts.map +1 -0
- package/dist/utils/semantic-plan-gate.js +24 -0
- package/dist/utils/semantic-plan-gate.js.map +1 -0
- package/dist/utils/task-json.d.ts +13 -0
- package/dist/utils/task-json.d.ts.map +1 -0
- package/dist/utils/task-json.js +12 -0
- package/dist/utils/task-json.js.map +1 -0
- package/dist/utils/template-fetcher.d.ts +150 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -0
- package/dist/utils/template-fetcher.js +907 -0
- package/dist/utils/template-fetcher.js.map +1 -0
- package/dist/utils/template-hash.d.ts +123 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +375 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +30 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
- package/dist/utils/uninstall-scrubbers.js +196 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -0
- package/dist/utils/update-rollout-report.d.ts +171 -0
- package/dist/utils/update-rollout-report.d.ts.map +1 -0
- package/dist/utils/update-rollout-report.js +126 -0
- package/dist/utils/update-rollout-report.js.map +1 -0
- package/dist/utils/validate-rules.d.ts +21 -0
- package/dist/utils/validate-rules.d.ts.map +1 -0
- package/dist/utils/validate-rules.js +88 -0
- package/dist/utils/validate-rules.js.map +1 -0
- package/dist/utils/workflow-dir.d.ts +15 -0
- package/dist/utils/workflow-dir.d.ts.map +1 -0
- package/dist/utils/workflow-dir.js +33 -0
- package/dist/utils/workflow-dir.js.map +1 -0
- package/dist/utils/workflow-resolver.d.ts +86 -0
- package/dist/utils/workflow-resolver.d.ts.map +1 -0
- package/dist/utils/workflow-resolver.js +265 -0
- package/dist/utils/workflow-resolver.js.map +1 -0
- package/package.json +117 -0
- package/scripts/postinstall.js +6 -0
|
@@ -0,0 +1,1198 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Parent reviewer orchestration: child prompt generation and review workflows.
|
|
4
|
+
|
|
5
|
+
Inline mode prints prompts and review summaries for manual handoff to external agents.
|
|
6
|
+
Subagent-capable platforms may use the same output with platform-specific dispatch.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
from datetime import datetime, timezone
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from .io import read_json
|
|
16
|
+
from .paths import get_repo_root
|
|
17
|
+
from .task_gates import (
|
|
18
|
+
build_spec_update_scaffold,
|
|
19
|
+
durable_learning_decision_status,
|
|
20
|
+
task_closeout_profile,
|
|
21
|
+
)
|
|
22
|
+
from .task_map import (
|
|
23
|
+
PARENT_TERMINAL_STATES,
|
|
24
|
+
get_child_entry,
|
|
25
|
+
load_task_map,
|
|
26
|
+
resolve_child_map_id,
|
|
27
|
+
validate_parent_child_integration,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
_ARTIFACT_NAMES = ("prd.md", "design.md", "implement.md", "verify.md", "handoff.md")
|
|
31
|
+
_GLOBAL_CHILD_CONSTRAINTS = """General constraints:
|
|
32
|
+
- Read the parent task artifacts first: prd.md, design.md, implement.md, task-map.md, and child-prompts.md when present.
|
|
33
|
+
- Read your own child task artifacts: prd.md, design.md, implement.md.
|
|
34
|
+
- Stay inside your child scope and declared touch areas.
|
|
35
|
+
- Do not publish packages, push remotes, create tags, edit credentials, or change global/MCP configuration.
|
|
36
|
+
- Preserve explicit user approval for destructive, remote, credential-bearing, publish, push, tag, and global configuration actions.
|
|
37
|
+
- Write `verify.md` and `handoff.md` in your child task directory.
|
|
38
|
+
- Handoff must include changed files, validation commands/results, residual risks, and parent integration notes.
|
|
39
|
+
- If you find a needed contract change, stop and report it to the parent instead of silently redefining shared state/gate semantics.
|
|
40
|
+
|
|
41
|
+
Validation baseline:
|
|
42
|
+
- Run focused tests for touched behavior.
|
|
43
|
+
- Run typecheck when touching TypeScript.
|
|
44
|
+
- Run ESLint for changed TypeScript test/source files when applicable.
|
|
45
|
+
- Run Python compile checks when touching Python scripts/templates.
|
|
46
|
+
- Run `python ./.pactile/scripts/task.py validate <your-child-task>` before handoff."""
|
|
47
|
+
|
|
48
|
+
_VALIDATION_BASELINE = """Validation baseline:
|
|
49
|
+
- Run focused tests for touched behavior.
|
|
50
|
+
- Run typecheck when touching TypeScript.
|
|
51
|
+
- Run ESLint for changed TypeScript test/source files when applicable.
|
|
52
|
+
- Run Python compile checks when touching Python scripts/templates.
|
|
53
|
+
- Run `python ./.pactile/scripts/task.py validate <child-dir>` before handoff."""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _utc_now() -> str:
|
|
57
|
+
return datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _read_optional(path: Path, max_chars: int = 12000) -> str | None:
|
|
61
|
+
if not path.is_file():
|
|
62
|
+
return None
|
|
63
|
+
try:
|
|
64
|
+
text = path.read_text(encoding="utf-8")
|
|
65
|
+
except OSError:
|
|
66
|
+
return None
|
|
67
|
+
if len(text) > max_chars:
|
|
68
|
+
return text[:max_chars] + "\n\n...[truncated for prompt]...\n"
|
|
69
|
+
return text
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _repo_rel(path: Path, repo_root: Path) -> str:
|
|
73
|
+
try:
|
|
74
|
+
return path.relative_to(repo_root).as_posix()
|
|
75
|
+
except ValueError:
|
|
76
|
+
return str(path)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _unmet_dependencies(child_entry: dict, children_by_id: dict[str, dict]) -> list[str]:
|
|
80
|
+
deps = child_entry.get("depends_on") or []
|
|
81
|
+
if not isinstance(deps, list):
|
|
82
|
+
return []
|
|
83
|
+
blocked: list[str] = []
|
|
84
|
+
for dep_id in deps:
|
|
85
|
+
if not isinstance(dep_id, str):
|
|
86
|
+
continue
|
|
87
|
+
dep = children_by_id.get(dep_id)
|
|
88
|
+
if dep is None:
|
|
89
|
+
blocked.append(f"{dep_id} (missing from task-map)")
|
|
90
|
+
continue
|
|
91
|
+
state = dep.get("state")
|
|
92
|
+
if state not in PARENT_TERMINAL_STATES:
|
|
93
|
+
blocked.append(f"{dep_id} (state={state!r}, need integrated or cancelled)")
|
|
94
|
+
return blocked
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _child_prompt_section(
|
|
98
|
+
parent_dir: Path,
|
|
99
|
+
child_dir: Path,
|
|
100
|
+
child_entry: dict,
|
|
101
|
+
repo_root: Path,
|
|
102
|
+
*,
|
|
103
|
+
include_artifacts: bool,
|
|
104
|
+
) -> str:
|
|
105
|
+
child_name = child_entry.get("id") or child_dir.name
|
|
106
|
+
parent_rel = _repo_rel(parent_dir, repo_root)
|
|
107
|
+
child_rel = _repo_rel(child_dir, repo_root)
|
|
108
|
+
state = child_entry.get("state", "open")
|
|
109
|
+
depends_on = child_entry.get("depends_on") or []
|
|
110
|
+
touches = child_entry.get("touches") or []
|
|
111
|
+
isolation = child_entry.get("isolation") or "git-worktree"
|
|
112
|
+
|
|
113
|
+
lines = [
|
|
114
|
+
f"## Child: `{child_name}`",
|
|
115
|
+
"",
|
|
116
|
+
f"- Parent task: `{parent_rel}`",
|
|
117
|
+
f"- Child task: `{child_rel}`",
|
|
118
|
+
f"- Integration state: `{state}`",
|
|
119
|
+
f"- Isolation: `{isolation}`",
|
|
120
|
+
]
|
|
121
|
+
if depends_on:
|
|
122
|
+
lines.append(f"- Depends on: {', '.join(f'`{d}`' for d in depends_on)}")
|
|
123
|
+
else:
|
|
124
|
+
lines.append("- Depends on: (none)")
|
|
125
|
+
if touches:
|
|
126
|
+
lines.append("- Touch scope:")
|
|
127
|
+
for touch in touches:
|
|
128
|
+
lines.append(f" - `{touch}`")
|
|
129
|
+
else:
|
|
130
|
+
lines.append("- Touch scope: (not declared in task-map; stay within child prd/design/implement)")
|
|
131
|
+
|
|
132
|
+
if include_artifacts:
|
|
133
|
+
lines.append("")
|
|
134
|
+
lines.append("### Child artifacts (context)")
|
|
135
|
+
for name in _ARTIFACT_NAMES:
|
|
136
|
+
content = _read_optional(child_dir / name, max_chars=8000)
|
|
137
|
+
if content:
|
|
138
|
+
lines.append(f"#### {name}")
|
|
139
|
+
lines.append("")
|
|
140
|
+
lines.append(content.strip())
|
|
141
|
+
lines.append("")
|
|
142
|
+
|
|
143
|
+
lines.append("### Suggested child worker commands")
|
|
144
|
+
lines.append("")
|
|
145
|
+
lines.append("```bash")
|
|
146
|
+
lines.append(f"python ./.pactile/scripts/task.py select {child_rel}")
|
|
147
|
+
lines.append(
|
|
148
|
+
f"python ./.pactile/scripts/task.py set-child-state {parent_rel} {child_rel} working --evidence implement.md"
|
|
149
|
+
)
|
|
150
|
+
lines.append("# ... implement ...")
|
|
151
|
+
lines.append(
|
|
152
|
+
f"python ./.pactile/scripts/task.py set-child-state {parent_rel} {child_rel} review --evidence verify.md"
|
|
153
|
+
)
|
|
154
|
+
lines.append("```")
|
|
155
|
+
lines.append("")
|
|
156
|
+
return "\n".join(lines)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def build_child_prompt(
|
|
160
|
+
parent_dir: Path,
|
|
161
|
+
child_dir: Path,
|
|
162
|
+
*,
|
|
163
|
+
include_artifacts: bool = False,
|
|
164
|
+
mode: str = "inline",
|
|
165
|
+
) -> tuple[str | None, list[str]]:
|
|
166
|
+
"""Build an implementation prompt for a linked child task."""
|
|
167
|
+
errors: list[str] = []
|
|
168
|
+
repo_root = get_repo_root()
|
|
169
|
+
|
|
170
|
+
parent_json = parent_dir / "task.json"
|
|
171
|
+
if not parent_json.is_file():
|
|
172
|
+
return None, [f"parent task.json missing: {parent_dir}"]
|
|
173
|
+
|
|
174
|
+
parent_data = read_json(parent_json) or {}
|
|
175
|
+
child_data = read_json(child_dir / "task.json") or {}
|
|
176
|
+
child_name = resolve_child_map_id(parent_data, child_dir, child_data)
|
|
177
|
+
|
|
178
|
+
data, body = load_task_map(parent_dir)
|
|
179
|
+
if data is None:
|
|
180
|
+
return None, ["parent task-map.md missing or invalid"]
|
|
181
|
+
|
|
182
|
+
child_entry = get_child_entry(data, child_name)
|
|
183
|
+
if child_entry is None:
|
|
184
|
+
return None, [f"child not in parent task-map: {child_name}"]
|
|
185
|
+
|
|
186
|
+
children_by_id = {
|
|
187
|
+
item.get("id"): item
|
|
188
|
+
for item in data.get("children", [])
|
|
189
|
+
if isinstance(item, dict) and item.get("id")
|
|
190
|
+
}
|
|
191
|
+
blocked = _unmet_dependencies(child_entry, children_by_id)
|
|
192
|
+
|
|
193
|
+
parent_rel = _repo_rel(parent_dir, repo_root)
|
|
194
|
+
child_rel = _repo_rel(child_dir, repo_root)
|
|
195
|
+
repo_rel = _repo_rel(repo_root, repo_root)
|
|
196
|
+
|
|
197
|
+
child_prd = _read_optional(child_dir / "prd.md", 4000)
|
|
198
|
+
child_design = _read_optional(child_dir / "design.md", 4000)
|
|
199
|
+
child_implement = _read_optional(child_dir / "implement.md", 4000)
|
|
200
|
+
parent_child_prompts = _read_optional(parent_dir / "child-prompts.md", 16000)
|
|
201
|
+
|
|
202
|
+
goal = ""
|
|
203
|
+
if child_prd:
|
|
204
|
+
goal_match = re.search(r"(?ms)^##\s*Goal\s*\n+(.*?)(?:\n##|\Z)", child_prd)
|
|
205
|
+
if goal_match:
|
|
206
|
+
goal = goal_match.group(1).strip()
|
|
207
|
+
|
|
208
|
+
lines = [
|
|
209
|
+
f"You are implementing child task `{child_name}`.",
|
|
210
|
+
"",
|
|
211
|
+
"Workspace:",
|
|
212
|
+
f"- Root: {repo_rel}",
|
|
213
|
+
f"- Parent task: {parent_rel}",
|
|
214
|
+
f"- Child task: {child_rel}",
|
|
215
|
+
"",
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
if blocked:
|
|
219
|
+
lines.extend(
|
|
220
|
+
[
|
|
221
|
+
"Start condition:",
|
|
222
|
+
"- **BLOCKED** — unmet dependencies:",
|
|
223
|
+
]
|
|
224
|
+
)
|
|
225
|
+
for item in blocked:
|
|
226
|
+
lines.append(f" - {item}")
|
|
227
|
+
lines.append("- Do not start implementation until dependencies reach `integrated` or `cancelled`.")
|
|
228
|
+
lines.append("")
|
|
229
|
+
elif depends_on := child_entry.get("depends_on"):
|
|
230
|
+
lines.extend(
|
|
231
|
+
[
|
|
232
|
+
"Start condition:",
|
|
233
|
+
f"- Dependencies satisfied: {', '.join(f'`{d}`' for d in depends_on)}.",
|
|
234
|
+
"",
|
|
235
|
+
]
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
lines.extend(
|
|
239
|
+
[
|
|
240
|
+
"Read first:",
|
|
241
|
+
f"- Parent prd.md/design.md/implement.md/task-map.md",
|
|
242
|
+
f"- Child prd.md/design.md/implement.md under `{child_rel}`",
|
|
243
|
+
]
|
|
244
|
+
)
|
|
245
|
+
if parent_child_prompts and child_name in parent_child_prompts:
|
|
246
|
+
lines.append(f"- Parent child-prompts.md section for `{child_name}` when present")
|
|
247
|
+
|
|
248
|
+
if goal:
|
|
249
|
+
lines.extend(["", "Goal:", goal, ""])
|
|
250
|
+
|
|
251
|
+
lines.append(_GLOBAL_CHILD_CONSTRAINTS)
|
|
252
|
+
lines.append("")
|
|
253
|
+
|
|
254
|
+
if child_implement:
|
|
255
|
+
lines.extend(["Implementation plan (from child implement.md):", child_implement.strip()[:6000], ""])
|
|
256
|
+
elif child_design:
|
|
257
|
+
lines.extend(["Design notes (from child design.md):", child_design.strip()[:4000], ""])
|
|
258
|
+
|
|
259
|
+
touches = child_entry.get("touches") or []
|
|
260
|
+
if touches:
|
|
261
|
+
lines.append("Declared touch scope (parent task-map):")
|
|
262
|
+
for touch in touches:
|
|
263
|
+
lines.append(f"- `{touch}`")
|
|
264
|
+
lines.append("")
|
|
265
|
+
|
|
266
|
+
if mode == "subagent":
|
|
267
|
+
topo = data.get("execution_topology", "serial")
|
|
268
|
+
merge_lim = data.get("merge_limit", 1)
|
|
269
|
+
lines.extend(
|
|
270
|
+
[
|
|
271
|
+
f"Selected task: {child_rel}",
|
|
272
|
+
"",
|
|
273
|
+
"Delivery mode: subagent (Cursor)",
|
|
274
|
+
"- **Default:** Parent session dispatches **Task** with `subagent_type=pactile-implement` and this prompt as the task description (writable sub-agent). Native Cursor `model:` frontmatter still applies.",
|
|
275
|
+
"- **Exception:** If parent `child-prompts.md` or the user names this child for a **separate writable Agent chat**, open a new Agent session, pick the model manually, paste this prompt — do not use Task from Parent.",
|
|
276
|
+
"- Parent retains `review-child` / `integrate-child`. Child must not nest further `pactile-research` / `pactile-implement` / `pactile-check` Task dispatches.",
|
|
277
|
+
f"- Parent orchestration: `execution_topology={topo}`, `merge_limit={merge_lim}`.",
|
|
278
|
+
"- When `isolation: git-worktree`, prepare worktree from a **git repo root** (e.g. `Pactile/`) before large edits.",
|
|
279
|
+
"",
|
|
280
|
+
]
|
|
281
|
+
)
|
|
282
|
+
else:
|
|
283
|
+
lines.extend(
|
|
284
|
+
[
|
|
285
|
+
"Delivery mode: inline",
|
|
286
|
+
"- Hand this prompt to the child worker agent or session manually.",
|
|
287
|
+
"- Parent session retains integration authority (`integrate-child`, `review-child`).",
|
|
288
|
+
"",
|
|
289
|
+
]
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
lines.append(_child_prompt_section(parent_dir, child_dir, child_entry, repo_root, include_artifacts=include_artifacts))
|
|
293
|
+
|
|
294
|
+
return "\n".join(lines), errors
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def _children_by_id(data: dict) -> dict[str, dict]:
|
|
299
|
+
return {
|
|
300
|
+
item.get("id"): item
|
|
301
|
+
for item in data.get("children", [])
|
|
302
|
+
if isinstance(item, dict) and isinstance(item.get("id"), str)
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def _normalize_stages(data: dict) -> tuple[list[dict], list[str], bool]:
|
|
307
|
+
"""Return (stages, errors, used_legacy_default)."""
|
|
308
|
+
errors: list[str] = []
|
|
309
|
+
children = _children_by_id(data)
|
|
310
|
+
raw_stages = data.get("stages") or []
|
|
311
|
+
if not isinstance(raw_stages, list):
|
|
312
|
+
return [], ["task-map stages must be a list"], False
|
|
313
|
+
|
|
314
|
+
if not raw_stages:
|
|
315
|
+
units = list(children.keys())
|
|
316
|
+
return (
|
|
317
|
+
[{"id": "default", "title": "All children (no stages declared)", "units": units}],
|
|
318
|
+
[],
|
|
319
|
+
True,
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
stages: list[dict] = []
|
|
323
|
+
seen_units: set[str] = set()
|
|
324
|
+
for idx, stage in enumerate(raw_stages):
|
|
325
|
+
if not isinstance(stage, dict):
|
|
326
|
+
errors.append(f"stages[{idx}] must be a mapping")
|
|
327
|
+
continue
|
|
328
|
+
stage_id = stage.get("id")
|
|
329
|
+
if not isinstance(stage_id, str) or not stage_id.strip():
|
|
330
|
+
errors.append(f"stages[{idx}] missing id")
|
|
331
|
+
continue
|
|
332
|
+
units = stage.get("units") or []
|
|
333
|
+
if not isinstance(units, list):
|
|
334
|
+
errors.append(f"stage `{stage_id}` units must be a list")
|
|
335
|
+
continue
|
|
336
|
+
norm_units: list[str] = []
|
|
337
|
+
for unit in units:
|
|
338
|
+
if not isinstance(unit, str) or not unit.strip():
|
|
339
|
+
errors.append(f"stage `{stage_id}` has invalid unit entry")
|
|
340
|
+
continue
|
|
341
|
+
if unit not in children:
|
|
342
|
+
errors.append(f"stage `{stage_id}` unit `{unit}` not in children[]")
|
|
343
|
+
continue
|
|
344
|
+
if unit in seen_units:
|
|
345
|
+
errors.append(f"unit `{unit}` appears in multiple stages")
|
|
346
|
+
continue
|
|
347
|
+
seen_units.add(unit)
|
|
348
|
+
norm_units.append(unit)
|
|
349
|
+
stages.append(
|
|
350
|
+
{
|
|
351
|
+
"id": stage_id,
|
|
352
|
+
"title": stage.get("title") if isinstance(stage.get("title"), str) else "",
|
|
353
|
+
"units": norm_units,
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
return stages, errors, False
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
def _unit_readiness(
|
|
360
|
+
unit_id: str,
|
|
361
|
+
children_by_id: dict[str, dict],
|
|
362
|
+
) -> tuple[str, list[str]]:
|
|
363
|
+
entry = children_by_id.get(unit_id) or {}
|
|
364
|
+
blocked = _unmet_dependencies(entry, children_by_id)
|
|
365
|
+
return ("ready" if not blocked else "blocked", blocked)
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
_PACK_GENERATED_RE = re.compile(r"^- Generated:\s*(.+)$", re.MULTILINE)
|
|
369
|
+
_PACK_DASH = r"[\u2014\-]"
|
|
370
|
+
_PACK_UNIT_LINE_RE = re.compile(
|
|
371
|
+
rf"^- `([^`]+)` {_PACK_DASH} `([^`]+)` {_PACK_DASH} \*\*(ready|blocked)\*\*",
|
|
372
|
+
re.MULTILINE,
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
def _parse_iso_timestamp(raw: str) -> datetime | None:
|
|
377
|
+
text = raw.strip()
|
|
378
|
+
if not text:
|
|
379
|
+
return None
|
|
380
|
+
normalized = text[:-1] + "+00:00" if text.endswith("Z") else text
|
|
381
|
+
try:
|
|
382
|
+
parsed = datetime.fromisoformat(normalized)
|
|
383
|
+
except ValueError:
|
|
384
|
+
try:
|
|
385
|
+
parsed = datetime.strptime(text, "%Y-%m-%d")
|
|
386
|
+
except ValueError:
|
|
387
|
+
return None
|
|
388
|
+
if parsed.tzinfo is None:
|
|
389
|
+
return parsed.replace(tzinfo=timezone.utc)
|
|
390
|
+
return parsed
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def _parse_pack_generated(pack_text: str) -> datetime | None:
|
|
394
|
+
match = _PACK_GENERATED_RE.search(pack_text)
|
|
395
|
+
if not match:
|
|
396
|
+
return None
|
|
397
|
+
return _parse_iso_timestamp(match.group(1))
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
def _last_integrate_event_time(body: str) -> datetime | None:
|
|
401
|
+
last: datetime | None = None
|
|
402
|
+
for line in body.splitlines():
|
|
403
|
+
stripped = line.strip()
|
|
404
|
+
if not stripped.startswith("- "):
|
|
405
|
+
continue
|
|
406
|
+
remainder = stripped[2:]
|
|
407
|
+
parts = remainder.split(" - ", 1)
|
|
408
|
+
if len(parts) != 2:
|
|
409
|
+
continue
|
|
410
|
+
ts_raw, message = parts[0].strip(), parts[1]
|
|
411
|
+
lowered = message.lower()
|
|
412
|
+
if "integration state" not in message and "integrate-through" not in lowered:
|
|
413
|
+
continue
|
|
414
|
+
parsed = _parse_iso_timestamp(ts_raw)
|
|
415
|
+
if parsed is not None and (last is None or parsed > last):
|
|
416
|
+
last = parsed
|
|
417
|
+
return last
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
def _pack_ready_units(pack_text: str) -> set[str]:
|
|
421
|
+
ready: set[str] = set()
|
|
422
|
+
for unit_id, _state, readiness in _PACK_UNIT_LINE_RE.findall(pack_text):
|
|
423
|
+
if readiness == "ready":
|
|
424
|
+
ready.add(unit_id)
|
|
425
|
+
return ready
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
def _expected_pack_ready_units(
|
|
429
|
+
data: dict,
|
|
430
|
+
children_by_id: dict[str, dict],
|
|
431
|
+
) -> set[str]:
|
|
432
|
+
stages, _, _ = _normalize_stages(data)
|
|
433
|
+
ready: set[str] = set()
|
|
434
|
+
for stage in stages:
|
|
435
|
+
for unit in stage.get("units") or []:
|
|
436
|
+
if not isinstance(unit, str):
|
|
437
|
+
continue
|
|
438
|
+
readiness, _ = _unit_readiness(unit, children_by_id)
|
|
439
|
+
if readiness == "ready":
|
|
440
|
+
ready.add(unit)
|
|
441
|
+
return ready
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def _pack_unit_states_mismatch(
|
|
445
|
+
pack_text: str,
|
|
446
|
+
children_by_id: dict[str, dict],
|
|
447
|
+
) -> bool:
|
|
448
|
+
for unit_id, pack_state, _readiness in _PACK_UNIT_LINE_RE.findall(pack_text):
|
|
449
|
+
entry = children_by_id.get(unit_id) or {}
|
|
450
|
+
current_state = entry.get("state", "?")
|
|
451
|
+
if str(current_state) != pack_state:
|
|
452
|
+
return True
|
|
453
|
+
return False
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
def _compute_stale_pack(
|
|
457
|
+
parent_dir: Path,
|
|
458
|
+
data: dict,
|
|
459
|
+
body: str,
|
|
460
|
+
children_by_id: dict[str, dict],
|
|
461
|
+
) -> bool | None:
|
|
462
|
+
pack_path = parent_dir / "child-prompts" / "PACK.md"
|
|
463
|
+
if not pack_path.is_file():
|
|
464
|
+
return None
|
|
465
|
+
try:
|
|
466
|
+
pack_text = pack_path.read_text(encoding="utf-8")
|
|
467
|
+
except OSError:
|
|
468
|
+
return None
|
|
469
|
+
|
|
470
|
+
generated = _parse_pack_generated(pack_text)
|
|
471
|
+
if generated is None:
|
|
472
|
+
return None
|
|
473
|
+
|
|
474
|
+
stale = False
|
|
475
|
+
last_integrate = _last_integrate_event_time(body)
|
|
476
|
+
if last_integrate is not None and generated < last_integrate:
|
|
477
|
+
stale = True
|
|
478
|
+
if _pack_unit_states_mismatch(pack_text, children_by_id):
|
|
479
|
+
stale = True
|
|
480
|
+
expected_ready = _expected_pack_ready_units(data, children_by_id)
|
|
481
|
+
if _pack_ready_units(pack_text) != expected_ready:
|
|
482
|
+
stale = True
|
|
483
|
+
return stale
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
def _compute_newly_ready(children_by_id: dict[str, dict]) -> list[str]:
|
|
487
|
+
ready_ids: list[str] = []
|
|
488
|
+
for unit_id in sorted(children_by_id):
|
|
489
|
+
entry = children_by_id[unit_id]
|
|
490
|
+
if entry.get("state") != "open":
|
|
491
|
+
continue
|
|
492
|
+
readiness, _ = _unit_readiness(unit_id, children_by_id)
|
|
493
|
+
if readiness == "ready":
|
|
494
|
+
ready_ids.append(unit_id)
|
|
495
|
+
return ready_ids
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
def _child_prompt_filename(unit_id: str) -> str:
|
|
499
|
+
"""Flat filename for child-prompts (nested slash unit ids use `--`)."""
|
|
500
|
+
return f"{unit_id.replace('/', '--')}.md"
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
def build_publish_pack(
|
|
504
|
+
parent_dir: Path,
|
|
505
|
+
*,
|
|
506
|
+
stage_id: str | None = None,
|
|
507
|
+
mode: str = "inline",
|
|
508
|
+
dry_run: bool = False,
|
|
509
|
+
) -> tuple[str | None, list[str]]:
|
|
510
|
+
"""Build campaign PACK index + per-unit prompts under child-prompts/."""
|
|
511
|
+
errors: list[str] = []
|
|
512
|
+
repo_root = get_repo_root()
|
|
513
|
+
parent_rel = _repo_rel(parent_dir, repo_root)
|
|
514
|
+
|
|
515
|
+
if not (parent_dir / "task.json").is_file():
|
|
516
|
+
return None, [f"parent task.json missing: {parent_dir}"]
|
|
517
|
+
|
|
518
|
+
data, _ = load_task_map(parent_dir)
|
|
519
|
+
if data is None:
|
|
520
|
+
return None, ["parent task-map.md missing or invalid"]
|
|
521
|
+
|
|
522
|
+
stages, stage_errors, legacy = _normalize_stages(data)
|
|
523
|
+
errors.extend(stage_errors)
|
|
524
|
+
if errors:
|
|
525
|
+
return None, errors
|
|
526
|
+
|
|
527
|
+
if stage_id:
|
|
528
|
+
stages = [s for s in stages if s.get("id") == stage_id]
|
|
529
|
+
if not stages:
|
|
530
|
+
return None, [f"unknown stage id: {stage_id}"]
|
|
531
|
+
|
|
532
|
+
children_by_id = _children_by_id(data)
|
|
533
|
+
prompts_dir = parent_dir / "child-prompts"
|
|
534
|
+
ready_rows: list[tuple[str, str, str]] = []
|
|
535
|
+
blocked_rows: list[tuple[str, str, list[str]]] = []
|
|
536
|
+
|
|
537
|
+
pack_lines = [
|
|
538
|
+
f"# Campaign PACK — `{parent_dir.name}`",
|
|
539
|
+
"",
|
|
540
|
+
f"- Parent: `{parent_rel}`",
|
|
541
|
+
f"- Generated: {_utc_now()}",
|
|
542
|
+
f"- Mode: `{mode}`",
|
|
543
|
+
"- Path rule: every worker must `task.py select <explicit-child-path>`; "
|
|
544
|
+
"do not rely on selected_task inheritance across windows.",
|
|
545
|
+
"",
|
|
546
|
+
"## Manual window path (PACK)",
|
|
547
|
+
"",
|
|
548
|
+
"1. Run `publish-pack` (this file) on the Parent.",
|
|
549
|
+
"2. For each **ready** unit: IDE **New Chat** or Agents Window → paste `child-prompts/<child>.md`.",
|
|
550
|
+
"3. In that session run `python ./.pactile/scripts/task.py select <child-path>`.",
|
|
551
|
+
"4. Parent retains `review-child` / `integrate-child`. PACK is not RUN auto-dispatch.",
|
|
552
|
+
"",
|
|
553
|
+
"## Stages",
|
|
554
|
+
"",
|
|
555
|
+
]
|
|
556
|
+
if legacy:
|
|
557
|
+
pack_lines.append(
|
|
558
|
+
"> Warning: no `stages:` in task-map; using implicit `default` stage "
|
|
559
|
+
"with all children. Declare `stages:` for HYBRID campaign packs."
|
|
560
|
+
)
|
|
561
|
+
pack_lines.append("")
|
|
562
|
+
|
|
563
|
+
written: list[str] = []
|
|
564
|
+
for stage in stages:
|
|
565
|
+
sid = stage["id"]
|
|
566
|
+
title = stage.get("title") or ""
|
|
567
|
+
heading = f"### `{sid}`" + (f" — {title}" if title else "")
|
|
568
|
+
pack_lines.append(heading)
|
|
569
|
+
pack_lines.append("")
|
|
570
|
+
for unit in stage.get("units") or []:
|
|
571
|
+
readiness, blocked = _unit_readiness(unit, children_by_id)
|
|
572
|
+
child_dir = parent_dir.parent / unit
|
|
573
|
+
child_rel = _repo_rel(child_dir, repo_root)
|
|
574
|
+
state = (children_by_id.get(unit) or {}).get("state", "?")
|
|
575
|
+
if readiness == "ready":
|
|
576
|
+
prompt, prompt_errors = build_child_prompt(
|
|
577
|
+
parent_dir,
|
|
578
|
+
child_dir,
|
|
579
|
+
include_artifacts=False,
|
|
580
|
+
mode=mode,
|
|
581
|
+
)
|
|
582
|
+
if prompt_errors or not prompt:
|
|
583
|
+
errors.extend(prompt_errors or [f"could not build prompt for `{unit}`"])
|
|
584
|
+
continue
|
|
585
|
+
out_name = _child_prompt_filename(unit)
|
|
586
|
+
out_rel = f"{parent_rel}/child-prompts/{out_name}"
|
|
587
|
+
if not dry_run:
|
|
588
|
+
prompts_dir.mkdir(parents=True, exist_ok=True)
|
|
589
|
+
(prompts_dir / out_name).write_text(prompt + "\n", encoding="utf-8")
|
|
590
|
+
written.append(out_rel)
|
|
591
|
+
ready_rows.append((sid, unit, out_rel))
|
|
592
|
+
pack_lines.append(
|
|
593
|
+
f"- `{unit}` — `{state}` — **ready** — prompt: `child-prompts/{out_name}` "
|
|
594
|
+
f"(select `{child_rel}`)"
|
|
595
|
+
)
|
|
596
|
+
else:
|
|
597
|
+
blocked_rows.append((sid, unit, blocked))
|
|
598
|
+
stub = "\n".join(
|
|
599
|
+
[
|
|
600
|
+
f"# BLOCKED — `{unit}`",
|
|
601
|
+
"",
|
|
602
|
+
f"- Parent: `{parent_rel}`",
|
|
603
|
+
f"- Child: `{child_rel}`",
|
|
604
|
+
f"- Stage: `{sid}`",
|
|
605
|
+
"- Do not start implementation until dependencies reach "
|
|
606
|
+
"`integrated` or `cancelled`.",
|
|
607
|
+
"",
|
|
608
|
+
"Unmet dependencies:",
|
|
609
|
+
*[f"- {item}" for item in blocked],
|
|
610
|
+
"",
|
|
611
|
+
]
|
|
612
|
+
)
|
|
613
|
+
out_name = _child_prompt_filename(unit)
|
|
614
|
+
out_rel = f"{parent_rel}/child-prompts/{out_name}"
|
|
615
|
+
if not dry_run:
|
|
616
|
+
prompts_dir.mkdir(parents=True, exist_ok=True)
|
|
617
|
+
(prompts_dir / out_name).write_text(stub, encoding="utf-8")
|
|
618
|
+
written.append(out_rel)
|
|
619
|
+
pack_lines.append(
|
|
620
|
+
f"- `{unit}` — `{state}` — **blocked** — {', '.join(blocked)}"
|
|
621
|
+
)
|
|
622
|
+
pack_lines.append("")
|
|
623
|
+
|
|
624
|
+
pack_lines.extend(["## Ready", ""])
|
|
625
|
+
if ready_rows:
|
|
626
|
+
for sid, unit, path in ready_rows:
|
|
627
|
+
pack_lines.append(f"- `{sid}` / `{unit}` → `{path}`")
|
|
628
|
+
else:
|
|
629
|
+
pack_lines.append("(none)")
|
|
630
|
+
pack_lines.extend(["", "## Blocked", ""])
|
|
631
|
+
if blocked_rows:
|
|
632
|
+
for sid, unit, deps in blocked_rows:
|
|
633
|
+
pack_lines.append(f"- `{sid}` / `{unit}` — {', '.join(deps)}")
|
|
634
|
+
else:
|
|
635
|
+
pack_lines.append("(none)")
|
|
636
|
+
pack_lines.append("")
|
|
637
|
+
|
|
638
|
+
pack_body = "\n".join(pack_lines)
|
|
639
|
+
pack_rel = f"{parent_rel}/child-prompts/PACK.md"
|
|
640
|
+
if not dry_run:
|
|
641
|
+
prompts_dir.mkdir(parents=True, exist_ok=True)
|
|
642
|
+
(prompts_dir / "PACK.md").write_text(pack_body + "\n", encoding="utf-8")
|
|
643
|
+
written.append(pack_rel)
|
|
644
|
+
|
|
645
|
+
if errors:
|
|
646
|
+
return None, errors
|
|
647
|
+
|
|
648
|
+
summary = [
|
|
649
|
+
f"# publish-pack — `{parent_dir.name}`",
|
|
650
|
+
"",
|
|
651
|
+
f"- Parent: `{parent_rel}`",
|
|
652
|
+
f"- dry_run: {dry_run}",
|
|
653
|
+
f"- legacy_no_stages: {legacy}",
|
|
654
|
+
f"- ready: {len(ready_rows)}",
|
|
655
|
+
f"- blocked: {len(blocked_rows)}",
|
|
656
|
+
f"- pack_index: `{pack_rel}`",
|
|
657
|
+
"",
|
|
658
|
+
]
|
|
659
|
+
if written:
|
|
660
|
+
summary.append("## Written")
|
|
661
|
+
summary.append("")
|
|
662
|
+
for path in written:
|
|
663
|
+
summary.append(f"- `{path}`")
|
|
664
|
+
summary.append("")
|
|
665
|
+
elif dry_run:
|
|
666
|
+
summary.append("(dry-run: no files written)")
|
|
667
|
+
summary.append("")
|
|
668
|
+
summary.append(pack_body)
|
|
669
|
+
return "\n".join(summary), []
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
def build_parent_status_dict(parent_dir: Path) -> dict | None:
|
|
673
|
+
"""Machine-readable parent orchestration snapshot (campaign UI / MCP)."""
|
|
674
|
+
repo_root = get_repo_root()
|
|
675
|
+
parent_rel = _repo_rel(parent_dir, repo_root)
|
|
676
|
+
data, _ = load_task_map(parent_dir)
|
|
677
|
+
if data is None:
|
|
678
|
+
return None
|
|
679
|
+
|
|
680
|
+
children_by_id = _children_by_id(data)
|
|
681
|
+
stages, stage_errors, legacy = _normalize_stages(data)
|
|
682
|
+
_, body = load_task_map(parent_dir)
|
|
683
|
+
stale_pack = _compute_stale_pack(parent_dir, data, body, children_by_id)
|
|
684
|
+
newly_ready = _compute_newly_ready(children_by_id)
|
|
685
|
+
|
|
686
|
+
stage_rows: list[dict] = []
|
|
687
|
+
for stage in stages:
|
|
688
|
+
units: list[dict] = []
|
|
689
|
+
for unit in stage.get("units") or []:
|
|
690
|
+
entry = children_by_id.get(unit) or {}
|
|
691
|
+
readiness, blocked = _unit_readiness(unit, children_by_id)
|
|
692
|
+
units.append(
|
|
693
|
+
{
|
|
694
|
+
"id": unit,
|
|
695
|
+
"state": entry.get("state", "?"),
|
|
696
|
+
"readiness": readiness,
|
|
697
|
+
"blockedBy": blocked,
|
|
698
|
+
}
|
|
699
|
+
)
|
|
700
|
+
stage_rows.append(
|
|
701
|
+
{
|
|
702
|
+
"id": stage["id"],
|
|
703
|
+
"title": stage.get("title") or "",
|
|
704
|
+
"units": units,
|
|
705
|
+
}
|
|
706
|
+
)
|
|
707
|
+
|
|
708
|
+
children_rows: list[dict] = []
|
|
709
|
+
for child in data.get("children") or []:
|
|
710
|
+
if not isinstance(child, dict):
|
|
711
|
+
continue
|
|
712
|
+
cid = child.get("id")
|
|
713
|
+
if not isinstance(cid, str):
|
|
714
|
+
continue
|
|
715
|
+
child_dir = parent_dir.parent / cid
|
|
716
|
+
children_rows.append(
|
|
717
|
+
{
|
|
718
|
+
"id": cid,
|
|
719
|
+
"state": child.get("state", "?"),
|
|
720
|
+
"dependsOn": child.get("depends_on") or [],
|
|
721
|
+
"touches": child.get("touches") or [],
|
|
722
|
+
"isolation": child.get("isolation"),
|
|
723
|
+
"branch": child.get("branch"),
|
|
724
|
+
"worktreePath": child.get("worktree_path"),
|
|
725
|
+
"evidence": child.get("evidence"),
|
|
726
|
+
"ref": child.get("ref"),
|
|
727
|
+
"verifyMd": (child_dir / "verify.md").is_file(),
|
|
728
|
+
"handoffMd": (child_dir / "handoff.md").is_file(),
|
|
729
|
+
}
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
return {
|
|
733
|
+
"id": parent_dir.name,
|
|
734
|
+
"path": parent_rel,
|
|
735
|
+
"contractEpoch": data.get("contract_epoch"),
|
|
736
|
+
"executionTopology": data.get("execution_topology"),
|
|
737
|
+
"mergeLimit": data.get("merge_limit"),
|
|
738
|
+
"stages": stage_rows,
|
|
739
|
+
"children": children_rows,
|
|
740
|
+
"integrationQueue": data.get("integration_queue") or [],
|
|
741
|
+
"stageErrors": stage_errors,
|
|
742
|
+
"legacyStages": legacy,
|
|
743
|
+
"stalePack": stale_pack,
|
|
744
|
+
"newlyReady": newly_ready,
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
def build_parent_status(parent_dir: Path) -> str:
|
|
749
|
+
"""Render a parent task-map status summary for the reviewer."""
|
|
750
|
+
repo_root = get_repo_root()
|
|
751
|
+
parent_rel = _repo_rel(parent_dir, repo_root)
|
|
752
|
+
data, _ = load_task_map(parent_dir)
|
|
753
|
+
if data is None:
|
|
754
|
+
return f"Parent `{parent_rel}`: task-map.md missing or invalid."
|
|
755
|
+
|
|
756
|
+
lines = [
|
|
757
|
+
f"# Parent orchestration status — `{parent_dir.name}`",
|
|
758
|
+
"",
|
|
759
|
+
f"- Path: `{parent_rel}`",
|
|
760
|
+
f"- contract_epoch: {data.get('contract_epoch', '?')}",
|
|
761
|
+
f"- execution_topology: {data.get('execution_topology', '?')}",
|
|
762
|
+
f"- merge_limit: {data.get('merge_limit', '?')}",
|
|
763
|
+
"",
|
|
764
|
+
]
|
|
765
|
+
|
|
766
|
+
children_by_id = _children_by_id(data)
|
|
767
|
+
stages, stage_errors, legacy = _normalize_stages(data)
|
|
768
|
+
_, body = load_task_map(parent_dir)
|
|
769
|
+
stale_pack = _compute_stale_pack(parent_dir, data, body, children_by_id)
|
|
770
|
+
newly_ready = _compute_newly_ready(children_by_id)
|
|
771
|
+
lines.append("## Pack freshness")
|
|
772
|
+
lines.append("")
|
|
773
|
+
lines.append(f"- stalePack: {stale_pack}")
|
|
774
|
+
if newly_ready:
|
|
775
|
+
lines.append(f"- newlyReady: {', '.join(newly_ready)}")
|
|
776
|
+
else:
|
|
777
|
+
lines.append("- newlyReady: (none)")
|
|
778
|
+
lines.append("")
|
|
779
|
+
lines.append("## Stages")
|
|
780
|
+
lines.append("")
|
|
781
|
+
if stage_errors:
|
|
782
|
+
for err in stage_errors:
|
|
783
|
+
lines.append(f"- error: {err}")
|
|
784
|
+
lines.append("")
|
|
785
|
+
elif legacy:
|
|
786
|
+
lines.append("stages: (none declared — implicit `default` for publish-pack)")
|
|
787
|
+
lines.append("")
|
|
788
|
+
else:
|
|
789
|
+
for stage in stages:
|
|
790
|
+
sid = stage["id"]
|
|
791
|
+
title = stage.get("title") or ""
|
|
792
|
+
heading = f"### `{sid}`" + (f" — {title}" if title else "")
|
|
793
|
+
lines.append(heading)
|
|
794
|
+
for unit in stage.get("units") or []:
|
|
795
|
+
entry = children_by_id.get(unit) or {}
|
|
796
|
+
state = entry.get("state", "?")
|
|
797
|
+
readiness, blocked = _unit_readiness(unit, children_by_id)
|
|
798
|
+
if readiness == "ready":
|
|
799
|
+
lines.append(f"- `{unit}` — `{state}` — ready")
|
|
800
|
+
else:
|
|
801
|
+
lines.append(f"- `{unit}` — `{state}` — blocked ({', '.join(blocked)})")
|
|
802
|
+
lines.append("")
|
|
803
|
+
|
|
804
|
+
lines.extend(["## Children", ""])
|
|
805
|
+
|
|
806
|
+
children = data.get("children") or []
|
|
807
|
+
if not children:
|
|
808
|
+
lines.append("(no children in task-map)")
|
|
809
|
+
return "\n".join(lines)
|
|
810
|
+
|
|
811
|
+
for child in children:
|
|
812
|
+
if not isinstance(child, dict):
|
|
813
|
+
continue
|
|
814
|
+
cid = child.get("id", "?")
|
|
815
|
+
state = child.get("state", "?")
|
|
816
|
+
evidence = child.get("evidence")
|
|
817
|
+
ref = child.get("ref")
|
|
818
|
+
deps = child.get("depends_on") or []
|
|
819
|
+
touches = child.get("touches") or []
|
|
820
|
+
isolation = child.get("isolation")
|
|
821
|
+
branch = child.get("branch")
|
|
822
|
+
worktree_path = child.get("worktree_path")
|
|
823
|
+
lines.append(f"### `{cid}` — `{state}`")
|
|
824
|
+
if deps:
|
|
825
|
+
lines.append(f"- depends_on: {', '.join(deps)}")
|
|
826
|
+
if touches:
|
|
827
|
+
lines.append(f"- touches: {', '.join(touches)}")
|
|
828
|
+
if isolation:
|
|
829
|
+
lines.append(f"- isolation: {isolation}")
|
|
830
|
+
if branch:
|
|
831
|
+
lines.append(f"- branch: {branch}")
|
|
832
|
+
if worktree_path:
|
|
833
|
+
lines.append(f"- worktree_path: {worktree_path}")
|
|
834
|
+
if evidence:
|
|
835
|
+
lines.append(f"- evidence: {evidence}")
|
|
836
|
+
if ref:
|
|
837
|
+
lines.append(f"- ref: {ref}")
|
|
838
|
+
child_dir = parent_dir.parent / cid
|
|
839
|
+
for artifact in ("verify.md", "handoff.md"):
|
|
840
|
+
flag = "yes" if (child_dir / artifact).is_file() else "missing"
|
|
841
|
+
lines.append(f"- {artifact}: {flag}")
|
|
842
|
+
lines.append("")
|
|
843
|
+
|
|
844
|
+
queue = data.get("integration_queue") or []
|
|
845
|
+
lines.append(f"integration_queue: {queue}")
|
|
846
|
+
lines.append("")
|
|
847
|
+
lines.append("## Suggested parent commands")
|
|
848
|
+
lines.append("")
|
|
849
|
+
lines.append("```bash")
|
|
850
|
+
lines.append(f"python ./.pactile/scripts/task.py parent-status {parent_rel}")
|
|
851
|
+
lines.append(f"python ./.pactile/scripts/task.py publish-pack {parent_rel}")
|
|
852
|
+
lines.append(f"python ./.pactile/scripts/task.py generate-child-prompt {parent_rel} <child> --mode subagent")
|
|
853
|
+
lines.append(f"python ./.pactile/scripts/task.py generate-child-prompt {parent_rel} <child> --mode inline")
|
|
854
|
+
lines.append(f"python ./.pactile/scripts/task.py review-child {parent_rel} <child> --check")
|
|
855
|
+
lines.append(f"python ./.pactile/scripts/task.py review-child {parent_rel} <child> --decision accept --ref <ref>")
|
|
856
|
+
lines.append("```")
|
|
857
|
+
return "\n".join(lines)
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
def _summarize_handoff(child_dir: Path) -> dict[str, str | list[str] | bool]:
|
|
861
|
+
verify = _read_optional(child_dir / "verify.md", 6000) or ""
|
|
862
|
+
handoff = _read_optional(child_dir / "handoff.md", 12000) or ""
|
|
863
|
+
has_verify = (child_dir / "verify.md").is_file()
|
|
864
|
+
has_handoff = (child_dir / "handoff.md").is_file()
|
|
865
|
+
|
|
866
|
+
validation_ok = bool(
|
|
867
|
+
re.search(r"(?i)validation\s+(evidence|commands|results)", verify)
|
|
868
|
+
or re.search(r"(?i)validation\s*:", verify)
|
|
869
|
+
)
|
|
870
|
+
acceptance_ok = bool(re.search(r"(?i)acceptance\s+evidence|accepted\s+by\s+user", verify))
|
|
871
|
+
learning = durable_learning_decision_status(verify) if verify else {
|
|
872
|
+
"no_durable_learning": False,
|
|
873
|
+
"spec_update": False,
|
|
874
|
+
"learning_artifact": False,
|
|
875
|
+
"any": False,
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
changed_files: list[str] = []
|
|
879
|
+
for line in handoff.splitlines():
|
|
880
|
+
if "|" in line and not line.strip().startswith("| ---"):
|
|
881
|
+
cells = [c.strip() for c in line.split("|") if c.strip()]
|
|
882
|
+
if len(cells) >= 2 and cells[0].lower() not in ("path", "file"):
|
|
883
|
+
changed_files.append(cells[0])
|
|
884
|
+
|
|
885
|
+
return {
|
|
886
|
+
"has_verify": has_verify,
|
|
887
|
+
"has_handoff": has_handoff,
|
|
888
|
+
"validation_section": validation_ok,
|
|
889
|
+
"acceptance_section": acceptance_ok,
|
|
890
|
+
"learning_decision": learning,
|
|
891
|
+
"verify_excerpt": verify.strip()[:2000],
|
|
892
|
+
"handoff_excerpt": handoff.strip()[:4000],
|
|
893
|
+
"changed_files": changed_files[:20],
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
def _learning_decision_review_lines(
|
|
898
|
+
parent_dir: Path,
|
|
899
|
+
child_dir: Path,
|
|
900
|
+
child_data: dict,
|
|
901
|
+
summary: dict,
|
|
902
|
+
*,
|
|
903
|
+
decision: str | None,
|
|
904
|
+
reason: str | None,
|
|
905
|
+
) -> list[str]:
|
|
906
|
+
"""Prompt parent/child to record durable learning before child archive."""
|
|
907
|
+
learning = summary.get("learning_decision") or {}
|
|
908
|
+
if learning.get("any"):
|
|
909
|
+
return []
|
|
910
|
+
|
|
911
|
+
repo_root = get_repo_root()
|
|
912
|
+
child_rel = _repo_rel(child_dir, repo_root)
|
|
913
|
+
lines = [
|
|
914
|
+
"## Durable learning decision (required before child archive)",
|
|
915
|
+
"",
|
|
916
|
+
"Child verify.md has no grep-friendly durable-learning line yet. Pick one outcome:",
|
|
917
|
+
"",
|
|
918
|
+
"- `Durable learning decision: no durable learning` — routine scope, no reusable contract.",
|
|
919
|
+
"- `Spec update evidence: .pactile/spec/<path>` — after `/pactile:update-spec` with reviewer confirmation.",
|
|
920
|
+
f"- `Learning artifact: {child_rel}/handoff.md` — handoff already captures the insight.",
|
|
921
|
+
"",
|
|
922
|
+
f"Helper: `python ./.pactile/scripts/task.py prepare-archive-evidence {child_rel}`",
|
|
923
|
+
"",
|
|
924
|
+
]
|
|
925
|
+
|
|
926
|
+
trigger: str | None = None
|
|
927
|
+
if decision == "changes":
|
|
928
|
+
trigger = f"Parent review requested changes ({reason or 'see review notes'})"
|
|
929
|
+
elif decision in ("accept", "integrate-through"):
|
|
930
|
+
trigger = "Parent accepted child handoff — confirm whether workflow/contracts should be captured in spec"
|
|
931
|
+
|
|
932
|
+
if trigger or decision == "changes":
|
|
933
|
+
lines.append(build_spec_update_scaffold(repo_root, child_dir, child_data, trigger=trigger))
|
|
934
|
+
return lines
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
def build_review_report(
|
|
938
|
+
parent_dir: Path,
|
|
939
|
+
child_dir: Path,
|
|
940
|
+
parent_data: dict,
|
|
941
|
+
child_data: dict,
|
|
942
|
+
*,
|
|
943
|
+
decision: str | None,
|
|
944
|
+
ref: str | None,
|
|
945
|
+
reason: str | None,
|
|
946
|
+
notes: str | None,
|
|
947
|
+
) -> tuple[str, list[str], dict]:
|
|
948
|
+
"""Build review summary and validate integration transitions for a decision."""
|
|
949
|
+
child_name = resolve_child_map_id(parent_data, child_dir, child_data)
|
|
950
|
+
summary = _summarize_handoff(child_dir)
|
|
951
|
+
errors: list[str] = []
|
|
952
|
+
actions: dict = {"integrate": None, "gates": []}
|
|
953
|
+
|
|
954
|
+
data, _ = load_task_map(parent_dir)
|
|
955
|
+
child_entry = get_child_entry(data, child_name) if data else None
|
|
956
|
+
current_state = child_entry.get("state") if child_entry else None
|
|
957
|
+
|
|
958
|
+
lines = [
|
|
959
|
+
f"# Parent review — `{child_name}`",
|
|
960
|
+
"",
|
|
961
|
+
f"- Timestamp: {_utc_now()}",
|
|
962
|
+
f"- Current integration state: `{current_state}`",
|
|
963
|
+
f"- Decision: `{decision or 'check-only'}`",
|
|
964
|
+
"",
|
|
965
|
+
"## Handoff artifacts",
|
|
966
|
+
"",
|
|
967
|
+
f"- verify.md: {'present' if summary['has_verify'] else '**missing**'}",
|
|
968
|
+
f"- handoff.md: {'present' if summary['has_handoff'] else '**missing**'}",
|
|
969
|
+
f"- verify validation section signal: {summary['validation_section']}",
|
|
970
|
+
f"- verify acceptance section signal: {summary['acceptance_section']}",
|
|
971
|
+
f"- durable learning decision signal: {summary['learning_decision'].get('any')}",
|
|
972
|
+
"",
|
|
973
|
+
]
|
|
974
|
+
learning_lines = _learning_decision_review_lines(
|
|
975
|
+
parent_dir,
|
|
976
|
+
child_dir,
|
|
977
|
+
child_data,
|
|
978
|
+
summary,
|
|
979
|
+
decision=decision,
|
|
980
|
+
reason=reason,
|
|
981
|
+
)
|
|
982
|
+
if learning_lines:
|
|
983
|
+
lines.extend(learning_lines)
|
|
984
|
+
|
|
985
|
+
if summary["changed_files"]:
|
|
986
|
+
lines.append("Changed files (from handoff table):")
|
|
987
|
+
for path in summary["changed_files"]:
|
|
988
|
+
lines.append(f"- `{path}`")
|
|
989
|
+
lines.append("")
|
|
990
|
+
|
|
991
|
+
if notes:
|
|
992
|
+
lines.extend(["## Parent notes", "", notes.strip(), ""])
|
|
993
|
+
|
|
994
|
+
if decision in ("accept", "changes", "cancel"):
|
|
995
|
+
if decision == "accept":
|
|
996
|
+
target = "accepted"
|
|
997
|
+
if current_state != "review":
|
|
998
|
+
errors.append(f"accept requires child state 'review', got {current_state!r}")
|
|
999
|
+
errors.extend(
|
|
1000
|
+
validate_parent_child_integration(
|
|
1001
|
+
parent_dir,
|
|
1002
|
+
parent_data,
|
|
1003
|
+
child_dir,
|
|
1004
|
+
child_data,
|
|
1005
|
+
target,
|
|
1006
|
+
"handoff.md",
|
|
1007
|
+
ref,
|
|
1008
|
+
reason,
|
|
1009
|
+
)
|
|
1010
|
+
)
|
|
1011
|
+
actions["integrate"] = {
|
|
1012
|
+
"state": target,
|
|
1013
|
+
"evidence": "handoff.md",
|
|
1014
|
+
"ref": ref,
|
|
1015
|
+
}
|
|
1016
|
+
actions["gates"].append(
|
|
1017
|
+
{
|
|
1018
|
+
"task": "parent",
|
|
1019
|
+
"transition": "parent-accepted",
|
|
1020
|
+
"optional": True,
|
|
1021
|
+
"hint": (
|
|
1022
|
+
f"Optional audit: python ./.pactile/scripts/task.py record-gate {parent_dir.name} "
|
|
1023
|
+
f"--transition parent-accepted --gate code-review --result PASS "
|
|
1024
|
+
f"--reviewer parent --evidence review-{child_name}.md"
|
|
1025
|
+
),
|
|
1026
|
+
}
|
|
1027
|
+
)
|
|
1028
|
+
child_profile = task_closeout_profile(child_dir, child_data)
|
|
1029
|
+
if child_profile == "full":
|
|
1030
|
+
actions["gates"].append(
|
|
1031
|
+
{
|
|
1032
|
+
"task": "child",
|
|
1033
|
+
"transition": "child-review",
|
|
1034
|
+
"optional": False,
|
|
1035
|
+
"hint": (
|
|
1036
|
+
f"Required before accept: python ./.pactile/scripts/task.py record-gate {child_name} "
|
|
1037
|
+
f"--transition child-review --gate code-review --result PASS "
|
|
1038
|
+
f"--reviewer parent --evidence verify.md"
|
|
1039
|
+
),
|
|
1040
|
+
}
|
|
1041
|
+
)
|
|
1042
|
+
elif child_profile == "lite":
|
|
1043
|
+
actions["gates"].append(
|
|
1044
|
+
{
|
|
1045
|
+
"task": "child",
|
|
1046
|
+
"transition": "child-review",
|
|
1047
|
+
"optional": True,
|
|
1048
|
+
"hint": "Lite child: no child-review gate chain required.",
|
|
1049
|
+
}
|
|
1050
|
+
)
|
|
1051
|
+
elif decision == "changes":
|
|
1052
|
+
target = "changes"
|
|
1053
|
+
errors.extend(
|
|
1054
|
+
validate_parent_child_integration(
|
|
1055
|
+
parent_dir,
|
|
1056
|
+
parent_data,
|
|
1057
|
+
child_dir,
|
|
1058
|
+
child_data,
|
|
1059
|
+
target,
|
|
1060
|
+
"handoff.md",
|
|
1061
|
+
ref,
|
|
1062
|
+
reason,
|
|
1063
|
+
)
|
|
1064
|
+
)
|
|
1065
|
+
if not reason:
|
|
1066
|
+
errors.append("changes requires --reason")
|
|
1067
|
+
actions["integrate"] = {
|
|
1068
|
+
"state": target,
|
|
1069
|
+
"evidence": "handoff.md",
|
|
1070
|
+
"ref": ref,
|
|
1071
|
+
"reason": reason,
|
|
1072
|
+
}
|
|
1073
|
+
elif decision == "cancel":
|
|
1074
|
+
target = "cancelled"
|
|
1075
|
+
errors.extend(
|
|
1076
|
+
validate_parent_child_integration(
|
|
1077
|
+
parent_dir,
|
|
1078
|
+
parent_data,
|
|
1079
|
+
child_dir,
|
|
1080
|
+
child_data,
|
|
1081
|
+
target,
|
|
1082
|
+
"handoff.md",
|
|
1083
|
+
ref,
|
|
1084
|
+
reason,
|
|
1085
|
+
)
|
|
1086
|
+
)
|
|
1087
|
+
if not reason:
|
|
1088
|
+
errors.append("cancel requires --reason")
|
|
1089
|
+
actions["integrate"] = {
|
|
1090
|
+
"state": target,
|
|
1091
|
+
"evidence": "handoff.md",
|
|
1092
|
+
"reason": reason,
|
|
1093
|
+
}
|
|
1094
|
+
elif decision == "integrate-through":
|
|
1095
|
+
sequence = [
|
|
1096
|
+
("accepted", "handoff.md"),
|
|
1097
|
+
("integrating", "task-map.md"),
|
|
1098
|
+
("integrated", "task-map.md"),
|
|
1099
|
+
]
|
|
1100
|
+
sim_state = current_state
|
|
1101
|
+
for target, evidence in sequence:
|
|
1102
|
+
if target == "accepted" and sim_state != "review":
|
|
1103
|
+
errors.append(f"integrate-through requires child state 'review', got {sim_state!r}")
|
|
1104
|
+
break
|
|
1105
|
+
if target == "integrating" and sim_state != "accepted":
|
|
1106
|
+
errors.append(f"integrating requires 'accepted', simulated from {sim_state!r}")
|
|
1107
|
+
break
|
|
1108
|
+
if target == "integrated" and sim_state != "integrating":
|
|
1109
|
+
errors.append(f"integrated requires 'integrating', simulated from {sim_state!r}")
|
|
1110
|
+
break
|
|
1111
|
+
step_errors = validate_parent_child_integration(
|
|
1112
|
+
parent_dir,
|
|
1113
|
+
parent_data,
|
|
1114
|
+
child_dir,
|
|
1115
|
+
child_data,
|
|
1116
|
+
target,
|
|
1117
|
+
evidence,
|
|
1118
|
+
ref,
|
|
1119
|
+
reason,
|
|
1120
|
+
current_state_override=sim_state,
|
|
1121
|
+
)
|
|
1122
|
+
errors.extend(step_errors)
|
|
1123
|
+
if step_errors:
|
|
1124
|
+
break
|
|
1125
|
+
sim_state = target
|
|
1126
|
+
if not errors:
|
|
1127
|
+
actions["integrate_sequence"] = [
|
|
1128
|
+
{"state": "accepted", "evidence": "handoff.md", "ref": ref},
|
|
1129
|
+
{"state": "integrating", "evidence": "task-map.md", "ref": ref},
|
|
1130
|
+
{"state": "integrated", "evidence": "task-map.md", "ref": ref},
|
|
1131
|
+
]
|
|
1132
|
+
actions["gates"].append(
|
|
1133
|
+
{
|
|
1134
|
+
"task": "parent",
|
|
1135
|
+
"transition": "parent-integrated",
|
|
1136
|
+
"optional": False,
|
|
1137
|
+
"hint": (
|
|
1138
|
+
f"Required before parent archive: python ./.pactile/scripts/task.py record-gate {parent_dir.name} "
|
|
1139
|
+
f"--transition parent-integrated --gate integration-review --result PASS "
|
|
1140
|
+
f"--reviewer parent --evidence task-map.md"
|
|
1141
|
+
),
|
|
1142
|
+
}
|
|
1143
|
+
)
|
|
1144
|
+
|
|
1145
|
+
lines.extend(
|
|
1146
|
+
[
|
|
1147
|
+
"## verify.md excerpt",
|
|
1148
|
+
"",
|
|
1149
|
+
(summary["verify_excerpt"] or "(empty)"),
|
|
1150
|
+
"",
|
|
1151
|
+
"## handoff.md excerpt",
|
|
1152
|
+
"",
|
|
1153
|
+
(summary["handoff_excerpt"] or "(empty)"),
|
|
1154
|
+
"",
|
|
1155
|
+
]
|
|
1156
|
+
)
|
|
1157
|
+
|
|
1158
|
+
if decision and not errors:
|
|
1159
|
+
lines.append("## Integration plan")
|
|
1160
|
+
lines.append("")
|
|
1161
|
+
if actions.get("integrate_sequence"):
|
|
1162
|
+
for step in actions["integrate_sequence"]:
|
|
1163
|
+
lines.append(
|
|
1164
|
+
f"- integrate-child → `{step['state']}` (evidence={step['evidence']}, ref={step.get('ref')})"
|
|
1165
|
+
)
|
|
1166
|
+
elif actions.get("integrate"):
|
|
1167
|
+
step = actions["integrate"]
|
|
1168
|
+
lines.append(
|
|
1169
|
+
f"- integrate-child → `{step['state']}` (evidence={step['evidence']}, ref={step.get('ref')})"
|
|
1170
|
+
)
|
|
1171
|
+
for gate in actions.get("gates", []):
|
|
1172
|
+
if gate.get("optional"):
|
|
1173
|
+
lines.append(f"- Optional gate ({gate['transition']}): {gate['hint']}")
|
|
1174
|
+
lines.append("")
|
|
1175
|
+
|
|
1176
|
+
report = "\n".join(lines)
|
|
1177
|
+
return report, errors, actions
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
def append_parent_review_notes(parent_dir: Path, child_name: str, report: str) -> None:
|
|
1181
|
+
"""Append a parent review section to parent verify.md."""
|
|
1182
|
+
verify_path = parent_dir / "verify.md"
|
|
1183
|
+
header = f"\n\n## Parent review — `{child_name}` ({_utc_now()})\n\n"
|
|
1184
|
+
if verify_path.is_file():
|
|
1185
|
+
existing = verify_path.read_text(encoding="utf-8")
|
|
1186
|
+
verify_path.write_text(existing.rstrip() + header + report.strip() + "\n", encoding="utf-8")
|
|
1187
|
+
else:
|
|
1188
|
+
verify_path.write_text(
|
|
1189
|
+
"# Verification Evidence\n\n" + header + report.strip() + "\n",
|
|
1190
|
+
encoding="utf-8",
|
|
1191
|
+
)
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
def write_review_artifact(parent_dir: Path, child_name: str, report: str) -> Path:
|
|
1195
|
+
"""Write a standalone review artifact under the parent task directory."""
|
|
1196
|
+
path = parent_dir / f"review-{child_name}.md"
|
|
1197
|
+
path.write_text(report.strip() + "\n", encoding="utf-8")
|
|
1198
|
+
return path
|