@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,886 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Five-layer Session pack compiler (`context-progressive`).
|
|
3
|
+
|
|
4
|
+
Legal inputs: Kernel Phase/Condition/Outcome, activated module ids, current
|
|
5
|
+
artifact roles. Illegal inputs: `workflow.md`, AGENTS longform,
|
|
6
|
+
`[workflow-state:*]`, unactivated module bodies.
|
|
7
|
+
|
|
8
|
+
Activation is profile-runtime: layer 2 Baseline ids are phase-needed
|
|
9
|
+
intersect still-active. On-demand ids come only from
|
|
10
|
+
`ondemand_modules.active`. Unactivated modules are not installed.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import argparse
|
|
16
|
+
import json
|
|
17
|
+
import os
|
|
18
|
+
from datetime import datetime, timezone
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
22
|
+
PACK_VERSION = 1
|
|
23
|
+
PACK_SOURCE = "context-progressive"
|
|
24
|
+
ACTIVATION_SOURCE_KIND = "profile-runtime"
|
|
25
|
+
|
|
26
|
+
# Same budget envelope as Personal Lite / retrieval context_pack (do not
|
|
27
|
+
# import maintainer-only context_pack.py; SessionStart must load this file
|
|
28
|
+
# via importlib without executing common/__init__.py).
|
|
29
|
+
SESSION_MAX_ITEMS = 8
|
|
30
|
+
SESSION_MAX_ESTIMATED_TOKENS = 4000
|
|
31
|
+
SESSION_CHARS_PER_TOKEN = 4
|
|
32
|
+
SESSION_MIN_ITEM_TOKENS = 40
|
|
33
|
+
CONTRACT_EXCERPT_CHARS = 2200
|
|
34
|
+
ARTIFACT_EXCERPT_CHARS = 1200
|
|
35
|
+
|
|
36
|
+
RETRIEVAL_INTENTS = ("exact", "semantic", "structural", "external")
|
|
37
|
+
|
|
38
|
+
BASELINE_EIGHT = (
|
|
39
|
+
"intake-basic",
|
|
40
|
+
"define-basic",
|
|
41
|
+
"approval-personal",
|
|
42
|
+
"execute-agent",
|
|
43
|
+
"verify-basic",
|
|
44
|
+
"close-basic",
|
|
45
|
+
"context-progressive",
|
|
46
|
+
"observability-local",
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
# Compiler / telemetry modules never occupy resident layer 2.
|
|
50
|
+
NEVER_LAYER2 = frozenset(
|
|
51
|
+
{
|
|
52
|
+
"context-progressive",
|
|
53
|
+
"observability-local",
|
|
54
|
+
"debug-recovery",
|
|
55
|
+
"retention-storage",
|
|
56
|
+
"retrieval-extended",
|
|
57
|
+
"personal-memory",
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
LITE_BLOCKED_LAYER2 = frozenset(
|
|
62
|
+
{
|
|
63
|
+
"parent-child",
|
|
64
|
+
"vcs-integration",
|
|
65
|
+
"personal-memory",
|
|
66
|
+
"retention-storage",
|
|
67
|
+
"retrieval-extended",
|
|
68
|
+
"worker-orchestration",
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
NO_TASK_BLOCKED = frozenset(
|
|
73
|
+
{
|
|
74
|
+
"parent-child",
|
|
75
|
+
"worker-orchestration",
|
|
76
|
+
"vcs-integration",
|
|
77
|
+
"personal-memory",
|
|
78
|
+
"retention-storage",
|
|
79
|
+
"retrieval-extended",
|
|
80
|
+
"independent-check",
|
|
81
|
+
"define-extended",
|
|
82
|
+
"spec-learning",
|
|
83
|
+
"session-transfer",
|
|
84
|
+
"candidate-pool",
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
PHASE_LAYER2_BASELINE: dict[str, tuple[str, ...]] = {
|
|
89
|
+
"open": (),
|
|
90
|
+
"define": ("define-basic",),
|
|
91
|
+
"approve": ("approval-personal",),
|
|
92
|
+
"execute": ("execute-agent",),
|
|
93
|
+
"verify": ("verify-basic",),
|
|
94
|
+
"integrate": (),
|
|
95
|
+
"close": ("close-basic",),
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
PHASE_ARTIFACT_ROLES: dict[str, tuple[tuple[str, str], ...]] = {
|
|
99
|
+
"open": (),
|
|
100
|
+
"define": (("prd.md", "definition"),),
|
|
101
|
+
"approve": (("prd.md", "definition"),),
|
|
102
|
+
"execute": (("prd.md", "definition"),),
|
|
103
|
+
"verify": (("prd.md", "definition"), ("verify.md", "evidence")),
|
|
104
|
+
"integrate": (("prd.md", "definition"), ("handoff.md", "integration-handoff")),
|
|
105
|
+
"close": (("verify.md", "evidence"),),
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
ONDEMAND_PHASE: dict[str, frozenset[str] | None] = {
|
|
109
|
+
"candidate-pool": None,
|
|
110
|
+
"define-extended": frozenset({"define"}),
|
|
111
|
+
"independent-check": frozenset({"verify"}),
|
|
112
|
+
"worker-orchestration": frozenset({"execute"}),
|
|
113
|
+
"parent-child": frozenset({"define", "execute", "integrate", "verify"}),
|
|
114
|
+
"debug-recovery": None,
|
|
115
|
+
"session-transfer": None,
|
|
116
|
+
"spec-learning": frozenset({"close"}),
|
|
117
|
+
"vcs-integration": frozenset({"close"}),
|
|
118
|
+
"personal-memory": None,
|
|
119
|
+
"retention-storage": None,
|
|
120
|
+
"retrieval-extended": None,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
ILLEGAL_BASENAMES = frozenset({"workflow.md", "agents.md"})
|
|
124
|
+
KERNEL_PHASES = (
|
|
125
|
+
"open",
|
|
126
|
+
"define",
|
|
127
|
+
"approve",
|
|
128
|
+
"execute",
|
|
129
|
+
"verify",
|
|
130
|
+
"integrate",
|
|
131
|
+
"close",
|
|
132
|
+
)
|
|
133
|
+
KERNEL_PHASE_HUMAN = {
|
|
134
|
+
"open": "Open",
|
|
135
|
+
"define": "Define",
|
|
136
|
+
"approve": "Approve",
|
|
137
|
+
"execute": "Execute",
|
|
138
|
+
"verify": "Verify",
|
|
139
|
+
"integrate": "Integrate",
|
|
140
|
+
"close": "Close",
|
|
141
|
+
}
|
|
142
|
+
STATUS_TO_PHASE = {
|
|
143
|
+
"planning": "define",
|
|
144
|
+
"in_progress": "execute",
|
|
145
|
+
"review": "verify",
|
|
146
|
+
"completed": "close",
|
|
147
|
+
"done": "close",
|
|
148
|
+
}
|
|
149
|
+
PHASE_DEFAULT_CONDITION = {
|
|
150
|
+
"open": "ready",
|
|
151
|
+
"define": "ready",
|
|
152
|
+
"approve": "waiting",
|
|
153
|
+
"execute": "active",
|
|
154
|
+
"verify": "waiting",
|
|
155
|
+
"integrate": "waiting",
|
|
156
|
+
"close": "ready",
|
|
157
|
+
}
|
|
158
|
+
VALID_CONDITIONS = frozenset({"ready", "active", "waiting", "blocked"})
|
|
159
|
+
VALID_OUTCOMES = frozenset({"completed", "cancelled", "failed"})
|
|
160
|
+
|
|
161
|
+
LAYER_NAMES = {
|
|
162
|
+
1: "resident-min",
|
|
163
|
+
2: "activated-contracts",
|
|
164
|
+
3: "artifact-snippets",
|
|
165
|
+
4: "retrieval-pointer",
|
|
166
|
+
5: "deep-diagnosis",
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def estimate_tokens(text: str) -> int:
|
|
171
|
+
if not text:
|
|
172
|
+
return SESSION_MIN_ITEM_TOKENS
|
|
173
|
+
return max(SESSION_MIN_ITEM_TOKENS, len(text) // SESSION_CHARS_PER_TOKEN + 20)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def _unique(values: list[str]) -> list[str]:
|
|
177
|
+
seen: set[str] = set()
|
|
178
|
+
out: list[str] = []
|
|
179
|
+
for value in values:
|
|
180
|
+
name = str(value).strip()
|
|
181
|
+
if not name or name in seen:
|
|
182
|
+
continue
|
|
183
|
+
seen.add(name)
|
|
184
|
+
out.append(name)
|
|
185
|
+
return out
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def _read_json(path: Path) -> dict[str, Any]:
|
|
189
|
+
if not path.is_file():
|
|
190
|
+
return {}
|
|
191
|
+
try:
|
|
192
|
+
parsed = json.loads(path.read_text(encoding="utf-8"))
|
|
193
|
+
except (OSError, UnicodeDecodeError, json.JSONDecodeError):
|
|
194
|
+
return {}
|
|
195
|
+
return parsed if isinstance(parsed, dict) else {}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def _illegal_path(path: str) -> bool:
|
|
199
|
+
base = path.replace("\\", "/").rsplit("/", 1)[-1].lower()
|
|
200
|
+
return base in ILLEGAL_BASENAMES
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def project_kernel(
|
|
204
|
+
*,
|
|
205
|
+
phase: str | None = None,
|
|
206
|
+
condition: str | None = None,
|
|
207
|
+
outcome: str | None = None,
|
|
208
|
+
status: str | None = None,
|
|
209
|
+
selected: bool = False,
|
|
210
|
+
stale: bool = False,
|
|
211
|
+
) -> dict[str, Any]:
|
|
212
|
+
resolved_phase = phase if phase in KERNEL_PHASE_HUMAN else None
|
|
213
|
+
if resolved_phase is None:
|
|
214
|
+
resolved_phase = STATUS_TO_PHASE.get(status or "", "open") if selected else "open"
|
|
215
|
+
resolved_condition = condition if condition in VALID_CONDITIONS else None
|
|
216
|
+
if resolved_condition is None:
|
|
217
|
+
resolved_condition = PHASE_DEFAULT_CONDITION.get(resolved_phase, "ready")
|
|
218
|
+
resolved_outcome = outcome if outcome in VALID_OUTCOMES else None
|
|
219
|
+
return {
|
|
220
|
+
"phase": resolved_phase,
|
|
221
|
+
"condition": resolved_condition,
|
|
222
|
+
"outcome": resolved_outcome,
|
|
223
|
+
"status": status or "",
|
|
224
|
+
"humanPhase": KERNEL_PHASE_HUMAN[resolved_phase],
|
|
225
|
+
"selected": bool(selected),
|
|
226
|
+
"stale": bool(stale),
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def kernel_from_task_dir(task_dir: Path | None, *, stale: bool = False) -> dict[str, Any]:
|
|
231
|
+
if task_dir is None or not task_dir.is_dir():
|
|
232
|
+
return project_kernel(selected=False, stale=False)
|
|
233
|
+
task_data = _read_json(task_dir / "task.json")
|
|
234
|
+
kernel = _read_json(task_dir / "kernel.json")
|
|
235
|
+
phase = kernel.get("phase") if kernel.get("phase") in KERNEL_PHASE_HUMAN else None
|
|
236
|
+
condition = kernel.get("condition") if isinstance(kernel.get("condition"), str) else None
|
|
237
|
+
outcome = kernel.get("outcome") if kernel.get("outcome") in VALID_OUTCOMES else None
|
|
238
|
+
status = task_data.get("status") if isinstance(task_data.get("status"), str) else None
|
|
239
|
+
surface = project_kernel(
|
|
240
|
+
phase=phase,
|
|
241
|
+
condition=condition,
|
|
242
|
+
outcome=outcome,
|
|
243
|
+
status=status,
|
|
244
|
+
selected=True,
|
|
245
|
+
stale=stale,
|
|
246
|
+
)
|
|
247
|
+
surface["taskDir"] = str(task_dir)
|
|
248
|
+
surface["title"] = str(task_data.get("title") or task_data.get("name") or task_dir.name)
|
|
249
|
+
return surface
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def _extras(task_dir: Path | None) -> dict[str, Any]:
|
|
253
|
+
if task_dir is None:
|
|
254
|
+
return {}
|
|
255
|
+
kernel = _read_json(task_dir / "kernel.json")
|
|
256
|
+
projection = kernel.get("projection") if isinstance(kernel.get("projection"), dict) else {}
|
|
257
|
+
extras = projection.get("extras") if isinstance(projection.get("extras"), dict) else {}
|
|
258
|
+
task_data = _read_json(task_dir / "task.json")
|
|
259
|
+
merged = dict(extras)
|
|
260
|
+
for key in (
|
|
261
|
+
"ondemand_modules",
|
|
262
|
+
"baseline_modules",
|
|
263
|
+
"required_controls",
|
|
264
|
+
"topology",
|
|
265
|
+
"capability_router",
|
|
266
|
+
"event_bridge",
|
|
267
|
+
):
|
|
268
|
+
if key not in merged and isinstance(task_data.get(key), dict):
|
|
269
|
+
merged[key] = task_data[key]
|
|
270
|
+
return merged
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def _ondemand_active(task_dir: Path | None) -> list[str]:
|
|
274
|
+
extras = _extras(task_dir)
|
|
275
|
+
block = extras.get("ondemand_modules")
|
|
276
|
+
if not isinstance(block, dict):
|
|
277
|
+
return []
|
|
278
|
+
raw = block.get("active")
|
|
279
|
+
if not isinstance(raw, list):
|
|
280
|
+
return []
|
|
281
|
+
return _unique([str(item) for item in raw if isinstance(item, str)])
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def _baseline_active(task_dir: Path | None) -> list[str]:
|
|
285
|
+
extras = _extras(task_dir)
|
|
286
|
+
block = extras.get("baseline_modules")
|
|
287
|
+
if not isinstance(block, dict) or "active" not in block:
|
|
288
|
+
return list(BASELINE_EIGHT)
|
|
289
|
+
raw = block.get("active")
|
|
290
|
+
if not isinstance(raw, list):
|
|
291
|
+
return []
|
|
292
|
+
allowed = set(BASELINE_EIGHT)
|
|
293
|
+
return _unique(
|
|
294
|
+
[
|
|
295
|
+
str(item).strip()
|
|
296
|
+
for item in raw
|
|
297
|
+
if isinstance(item, str) and str(item).strip() in allowed
|
|
298
|
+
]
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def _rigor(task_dir: Path | None) -> str:
|
|
303
|
+
extras = _extras(task_dir)
|
|
304
|
+
controls = extras.get("required_controls")
|
|
305
|
+
if isinstance(controls, dict) and isinstance(controls.get("rigor"), str):
|
|
306
|
+
value = controls["rigor"].strip().lower()
|
|
307
|
+
if value in {"lite", "full"}:
|
|
308
|
+
return value
|
|
309
|
+
return "lite"
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
def _topology_kind(task_dir: Path | None) -> str:
|
|
313
|
+
extras = _extras(task_dir)
|
|
314
|
+
topo = extras.get("topology")
|
|
315
|
+
if isinstance(topo, dict) and isinstance(topo.get("kind"), str):
|
|
316
|
+
return topo["kind"]
|
|
317
|
+
return "single"
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
def load_module_catalog(modules_root: Path | None) -> dict[str, Any]:
|
|
321
|
+
if modules_root is None:
|
|
322
|
+
return {"modules": [], "byId": {}}
|
|
323
|
+
catalog = _read_json(modules_root / "index.json")
|
|
324
|
+
modules = catalog.get("modules") if isinstance(catalog.get("modules"), list) else []
|
|
325
|
+
by_id: dict[str, dict[str, Any]] = {}
|
|
326
|
+
for entry in modules:
|
|
327
|
+
if not isinstance(entry, dict):
|
|
328
|
+
continue
|
|
329
|
+
module_id = str(entry.get("id") or "").strip()
|
|
330
|
+
if module_id:
|
|
331
|
+
by_id[module_id] = entry
|
|
332
|
+
catalog["byId"] = by_id
|
|
333
|
+
return catalog
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
def read_contract(modules_root: Path | None, module_id: str, catalog: dict[str, Any]) -> str:
|
|
337
|
+
if modules_root is None:
|
|
338
|
+
return ""
|
|
339
|
+
entry = catalog.get("byId", {}).get(module_id)
|
|
340
|
+
rel = ""
|
|
341
|
+
if isinstance(entry, dict) and isinstance(entry.get("contract"), str):
|
|
342
|
+
rel = entry["contract"]
|
|
343
|
+
path = modules_root / (rel or f"{module_id}/contract.md")
|
|
344
|
+
if not path.is_file():
|
|
345
|
+
return ""
|
|
346
|
+
try:
|
|
347
|
+
text = path.read_text(encoding="utf-8")
|
|
348
|
+
except (OSError, UnicodeDecodeError):
|
|
349
|
+
return ""
|
|
350
|
+
if _illegal_path(str(path)):
|
|
351
|
+
return ""
|
|
352
|
+
return text[:CONTRACT_EXCERPT_CHARS].strip()
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
def resolve_layer2_ids(
|
|
356
|
+
*,
|
|
357
|
+
kernel: dict[str, Any],
|
|
358
|
+
ondemand_active: list[str],
|
|
359
|
+
rigor: str,
|
|
360
|
+
topology_kind: str,
|
|
361
|
+
intake_event: bool,
|
|
362
|
+
baseline_active: list[str] | None = None,
|
|
363
|
+
) -> list[str]:
|
|
364
|
+
selected = bool(kernel.get("selected"))
|
|
365
|
+
phase = str(kernel.get("phase") or "open")
|
|
366
|
+
still_active = set(
|
|
367
|
+
baseline_active if baseline_active is not None else list(BASELINE_EIGHT)
|
|
368
|
+
)
|
|
369
|
+
ids: list[str] = []
|
|
370
|
+
|
|
371
|
+
if not selected:
|
|
372
|
+
if intake_event and "intake-basic" in still_active:
|
|
373
|
+
ids.append("intake-basic")
|
|
374
|
+
return [name for name in _unique(ids) if name not in NO_TASK_BLOCKED]
|
|
375
|
+
|
|
376
|
+
ids.extend(
|
|
377
|
+
module_id
|
|
378
|
+
for module_id in PHASE_LAYER2_BASELINE.get(phase, ())
|
|
379
|
+
if module_id in still_active
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
lite_single = rigor == "lite" and topology_kind != "parent-child"
|
|
383
|
+
for module_id in ondemand_active:
|
|
384
|
+
if module_id in NEVER_LAYER2:
|
|
385
|
+
continue
|
|
386
|
+
allowed_phases = ONDEMAND_PHASE.get(module_id, frozenset())
|
|
387
|
+
if allowed_phases is None:
|
|
388
|
+
continue
|
|
389
|
+
if phase not in allowed_phases:
|
|
390
|
+
continue
|
|
391
|
+
if lite_single and module_id in LITE_BLOCKED_LAYER2:
|
|
392
|
+
continue
|
|
393
|
+
ids.append(module_id)
|
|
394
|
+
|
|
395
|
+
filtered: list[str] = []
|
|
396
|
+
for module_id in _unique(ids):
|
|
397
|
+
if module_id in NEVER_LAYER2:
|
|
398
|
+
continue
|
|
399
|
+
if lite_single and module_id in LITE_BLOCKED_LAYER2:
|
|
400
|
+
continue
|
|
401
|
+
if not selected and module_id in NO_TASK_BLOCKED:
|
|
402
|
+
continue
|
|
403
|
+
filtered.append(module_id)
|
|
404
|
+
return filtered
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
def _next_action(kernel: dict[str, Any], layer2_ids: list[str]) -> str:
|
|
408
|
+
if kernel.get("stale"):
|
|
409
|
+
return (
|
|
410
|
+
"Clear the stale selection with `python ./.pactile/scripts/task.py exit`, "
|
|
411
|
+
"then ask what to work on next."
|
|
412
|
+
)
|
|
413
|
+
if not kernel.get("selected"):
|
|
414
|
+
return (
|
|
415
|
+
"Intake: answer directly, clarify whether there is work, capture a pool "
|
|
416
|
+
"intent, or draft an Open Proposal. Do not `task.py create` without Open approval."
|
|
417
|
+
)
|
|
418
|
+
if kernel.get("condition") == "blocked":
|
|
419
|
+
return "Stop. Classify the stall before retrying the same hypothesis."
|
|
420
|
+
phase = kernel.get("phase")
|
|
421
|
+
if phase == "open":
|
|
422
|
+
return "Task exists. Move into Define: measurable Acceptance Criteria before Execute."
|
|
423
|
+
if phase == "define":
|
|
424
|
+
return "Finish Definition + measurable AC. Do not implement; do not `--approved`."
|
|
425
|
+
if phase == "approve":
|
|
426
|
+
return (
|
|
427
|
+
"Request the Execute gate. `--check` PASS is a preflight, not human approval."
|
|
428
|
+
)
|
|
429
|
+
if phase == "execute":
|
|
430
|
+
return "Implement inside the approved contract. Contract change → Return-to-Define."
|
|
431
|
+
if phase == "verify":
|
|
432
|
+
return "Map every AC to locatable evidence. Placeholder or fake-green cannot Close."
|
|
433
|
+
if phase == "integrate":
|
|
434
|
+
return "Parent integrates children. Child must not `integrate-child`."
|
|
435
|
+
if phase == "close":
|
|
436
|
+
return "Write Outcome + learning disposition. Git commit is not Close."
|
|
437
|
+
if "intake-basic" in layer2_ids:
|
|
438
|
+
return "Intake is in layer 2. Do not treat missing modules as installed."
|
|
439
|
+
return "Follow Kernel Phase / Condition. Unlisted modules are not installed."
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
def _key_constraints(kernel: dict[str, Any], *, rigor: str, topology_kind: str) -> str:
|
|
443
|
+
lines = [
|
|
444
|
+
"Do not treat `.pactile/workflow.md` or AGENTS longform as runtime SSOT.",
|
|
445
|
+
"Modules absent from this pack are not installed.",
|
|
446
|
+
f"Rigor={rigor}; topology={topology_kind}.",
|
|
447
|
+
]
|
|
448
|
+
if kernel.get("selected"):
|
|
449
|
+
lines.append("Stay inside the selected task contract.")
|
|
450
|
+
else:
|
|
451
|
+
lines.append("No selected task: no task-directory dump; no Parent/Worker/VCS teaching.")
|
|
452
|
+
if kernel.get("condition") == "blocked":
|
|
453
|
+
lines.append("Condition=blocked: do not silently retry.")
|
|
454
|
+
return "\n".join(lines)
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
def collect_artifact_snippets(
|
|
458
|
+
task_dir: Path | None,
|
|
459
|
+
kernel: dict[str, Any],
|
|
460
|
+
) -> list[dict[str, Any]]:
|
|
461
|
+
if task_dir is None or not kernel.get("selected") or kernel.get("stale"):
|
|
462
|
+
return []
|
|
463
|
+
phase = str(kernel.get("phase") or "open")
|
|
464
|
+
items: list[dict[str, Any]] = []
|
|
465
|
+
for name, role in PHASE_ARTIFACT_ROLES.get(phase, ()):
|
|
466
|
+
path = task_dir / name
|
|
467
|
+
if not path.is_file() or _illegal_path(name):
|
|
468
|
+
continue
|
|
469
|
+
try:
|
|
470
|
+
raw = path.read_text(encoding="utf-8")
|
|
471
|
+
except (OSError, UnicodeDecodeError):
|
|
472
|
+
continue
|
|
473
|
+
excerpt = raw[:ARTIFACT_EXCERPT_CHARS].strip()
|
|
474
|
+
if not excerpt:
|
|
475
|
+
continue
|
|
476
|
+
freshness = ""
|
|
477
|
+
try:
|
|
478
|
+
mtime = path.stat().st_mtime
|
|
479
|
+
freshness = datetime.fromtimestamp(mtime, tz=timezone.utc).strftime(
|
|
480
|
+
"%Y-%m-%dT%H:%M:%SZ"
|
|
481
|
+
)
|
|
482
|
+
except OSError:
|
|
483
|
+
freshness = ""
|
|
484
|
+
try:
|
|
485
|
+
rel = path.as_posix()
|
|
486
|
+
except Exception:
|
|
487
|
+
rel = str(path)
|
|
488
|
+
items.append(
|
|
489
|
+
{
|
|
490
|
+
"role": role,
|
|
491
|
+
"path": rel,
|
|
492
|
+
"excerpt": excerpt,
|
|
493
|
+
"freshness": freshness,
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
return items
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
def _apply_budget(items: list[dict[str, Any]]) -> tuple[list[dict[str, Any]], list[dict[str, str]], int]:
|
|
500
|
+
selected: list[dict[str, Any]] = []
|
|
501
|
+
omitted: list[dict[str, str]] = []
|
|
502
|
+
tokens = 0
|
|
503
|
+
for item in items:
|
|
504
|
+
cost = int(item.get("estimatedTokens") or estimate_tokens(str(item.get("text") or "")))
|
|
505
|
+
would_items = len(selected) >= SESSION_MAX_ITEMS
|
|
506
|
+
would_tokens = tokens + cost > SESSION_MAX_ESTIMATED_TOKENS
|
|
507
|
+
if would_items or would_tokens:
|
|
508
|
+
omitted.append(
|
|
509
|
+
{
|
|
510
|
+
"id": str(item.get("id") or item.get("path") or ""),
|
|
511
|
+
"reason": "outside session pack budget",
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
continue
|
|
515
|
+
selected.append(item)
|
|
516
|
+
tokens += cost
|
|
517
|
+
return selected, omitted, tokens
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
def compile_session_pack(
|
|
521
|
+
*,
|
|
522
|
+
kernel: dict[str, Any],
|
|
523
|
+
ondemand_active: list[str] | None = None,
|
|
524
|
+
baseline_active: list[str] | None = None,
|
|
525
|
+
modules_root: Path | str | None = None,
|
|
526
|
+
artifacts: list[dict[str, Any]] | None = None,
|
|
527
|
+
rigor: str = "lite",
|
|
528
|
+
topology_kind: str = "single",
|
|
529
|
+
intake_event: bool | None = None,
|
|
530
|
+
fact_gap: bool = False,
|
|
531
|
+
catalog: dict[str, Any] | None = None,
|
|
532
|
+
) -> dict[str, Any]:
|
|
533
|
+
"""Compile a five-layer Session pack. Never dumps all 20 contracts."""
|
|
534
|
+
modules_path = Path(modules_root) if modules_root else None
|
|
535
|
+
loaded_catalog = catalog or load_module_catalog(modules_path)
|
|
536
|
+
selected = bool(kernel.get("selected"))
|
|
537
|
+
if intake_event is None:
|
|
538
|
+
intake_event = not selected
|
|
539
|
+
active = _unique(list(ondemand_active or []))
|
|
540
|
+
if baseline_active is None:
|
|
541
|
+
resolved_baseline = list(BASELINE_EIGHT)
|
|
542
|
+
else:
|
|
543
|
+
allowed = set(BASELINE_EIGHT)
|
|
544
|
+
resolved_baseline = _unique(
|
|
545
|
+
[
|
|
546
|
+
str(item).strip()
|
|
547
|
+
for item in baseline_active
|
|
548
|
+
if str(item).strip() in allowed
|
|
549
|
+
]
|
|
550
|
+
)
|
|
551
|
+
layer2_ids = resolve_layer2_ids(
|
|
552
|
+
kernel=kernel,
|
|
553
|
+
ondemand_active=active,
|
|
554
|
+
rigor=rigor,
|
|
555
|
+
topology_kind=topology_kind,
|
|
556
|
+
intake_event=bool(intake_event),
|
|
557
|
+
baseline_active=resolved_baseline,
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
budget_candidates: list[dict[str, Any]] = []
|
|
561
|
+
contracts: dict[str, str] = {}
|
|
562
|
+
for module_id in layer2_ids:
|
|
563
|
+
body = read_contract(modules_path, module_id, loaded_catalog)
|
|
564
|
+
if not body:
|
|
565
|
+
continue
|
|
566
|
+
contracts[module_id] = body
|
|
567
|
+
budget_candidates.append(
|
|
568
|
+
{
|
|
569
|
+
"id": module_id,
|
|
570
|
+
"kind": "contract",
|
|
571
|
+
"text": body,
|
|
572
|
+
"estimatedTokens": estimate_tokens(body),
|
|
573
|
+
}
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
snippet_items = list(artifacts or [])
|
|
577
|
+
for item in snippet_items:
|
|
578
|
+
path = str(item.get("path") or "")
|
|
579
|
+
if _illegal_path(path):
|
|
580
|
+
continue
|
|
581
|
+
text = str(item.get("excerpt") or "")
|
|
582
|
+
budget_candidates.append(
|
|
583
|
+
{
|
|
584
|
+
"id": path,
|
|
585
|
+
"kind": "artifact",
|
|
586
|
+
"path": path,
|
|
587
|
+
"role": item.get("role") or "",
|
|
588
|
+
"text": text,
|
|
589
|
+
"freshness": item.get("freshness") or "",
|
|
590
|
+
"estimatedTokens": estimate_tokens(text),
|
|
591
|
+
}
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
kept, omitted, tokens = _apply_budget(budget_candidates)
|
|
595
|
+
kept_contract_ids = [row["id"] for row in kept if row.get("kind") == "contract"]
|
|
596
|
+
kept_artifacts = [row for row in kept if row.get("kind") == "artifact"]
|
|
597
|
+
layer2_ids = [module_id for module_id in layer2_ids if module_id in kept_contract_ids]
|
|
598
|
+
|
|
599
|
+
stuck = kernel.get("condition") == "blocked" or bool(kernel.get("stale"))
|
|
600
|
+
diagnosis_ids: list[str] = []
|
|
601
|
+
if stuck:
|
|
602
|
+
diagnosis_ids = ["debug-recovery"]
|
|
603
|
+
|
|
604
|
+
layer1_text = "\n".join(
|
|
605
|
+
[
|
|
606
|
+
f"Phase: {kernel.get('humanPhase') or kernel.get('phase')} ({kernel.get('phase')})",
|
|
607
|
+
f"Condition: {kernel.get('condition')}",
|
|
608
|
+
f"Outcome: {kernel.get('outcome') or '(none)'}",
|
|
609
|
+
"Constraints:",
|
|
610
|
+
_key_constraints(kernel, rigor=rigor, topology_kind=topology_kind),
|
|
611
|
+
f"Next: {_next_action(kernel, layer2_ids)}",
|
|
612
|
+
]
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
layer2_parts: list[str] = []
|
|
616
|
+
for module_id in layer2_ids:
|
|
617
|
+
body = contracts.get(module_id, "")
|
|
618
|
+
if not body:
|
|
619
|
+
continue
|
|
620
|
+
layer2_parts.append(f"### `{module_id}`\n{body}")
|
|
621
|
+
|
|
622
|
+
layer3_parts: list[str] = []
|
|
623
|
+
layer3_meta: list[dict[str, Any]] = []
|
|
624
|
+
if selected:
|
|
625
|
+
for row in kept_artifacts:
|
|
626
|
+
path = str(row.get("path") or "")
|
|
627
|
+
excerpt = str(row.get("text") or "")
|
|
628
|
+
layer3_meta.append(
|
|
629
|
+
{
|
|
630
|
+
"path": path,
|
|
631
|
+
"role": row.get("role") or "",
|
|
632
|
+
"freshness": row.get("freshness") or "",
|
|
633
|
+
"excerpt": excerpt,
|
|
634
|
+
}
|
|
635
|
+
)
|
|
636
|
+
layer3_parts.append(f"{path}\n{excerpt}")
|
|
637
|
+
|
|
638
|
+
layer4_text = ""
|
|
639
|
+
if fact_gap:
|
|
640
|
+
layer4_text = (
|
|
641
|
+
"Fact gap: route with intents exact / semantic / structural / external. "
|
|
642
|
+
"Do not bind Agent tool names. Ranking and retrieval-pack stay with "
|
|
643
|
+
"`retrieval-extended`."
|
|
644
|
+
)
|
|
645
|
+
|
|
646
|
+
layer5_text = ""
|
|
647
|
+
if stuck:
|
|
648
|
+
layer5_text = (
|
|
649
|
+
"Deep diagnosis pointer only (not a layer-2 contract): `debug-recovery`. "
|
|
650
|
+
"Stop homogeneous retries. Classify implementation / contract / "
|
|
651
|
+
"environment / platform / process-loop. First failure is not break-loop."
|
|
652
|
+
)
|
|
653
|
+
|
|
654
|
+
layers = [
|
|
655
|
+
{
|
|
656
|
+
"n": 1,
|
|
657
|
+
"name": LAYER_NAMES[1],
|
|
658
|
+
"text": layer1_text,
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"n": 2,
|
|
662
|
+
"name": LAYER_NAMES[2],
|
|
663
|
+
"moduleIds": layer2_ids,
|
|
664
|
+
"text": "\n\n".join(layer2_parts),
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"n": 3,
|
|
668
|
+
"name": LAYER_NAMES[3],
|
|
669
|
+
"items": layer3_meta,
|
|
670
|
+
"text": "\n\n".join(layer3_parts),
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"n": 4,
|
|
674
|
+
"name": LAYER_NAMES[4],
|
|
675
|
+
"present": bool(fact_gap),
|
|
676
|
+
"intents": list(RETRIEVAL_INTENTS) if fact_gap else [],
|
|
677
|
+
"text": layer4_text,
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"n": 5,
|
|
681
|
+
"name": LAYER_NAMES[5],
|
|
682
|
+
"present": bool(stuck),
|
|
683
|
+
"moduleIds": diagnosis_ids,
|
|
684
|
+
"text": layer5_text,
|
|
685
|
+
},
|
|
686
|
+
]
|
|
687
|
+
|
|
688
|
+
catalog_ids = list(loaded_catalog.get("byId", {}).keys())
|
|
689
|
+
return {
|
|
690
|
+
"version": PACK_VERSION,
|
|
691
|
+
"source": PACK_SOURCE,
|
|
692
|
+
"activationSource": {
|
|
693
|
+
"kind": ACTIVATION_SOURCE_KIND,
|
|
694
|
+
"filter": "phase-intersect-active",
|
|
695
|
+
"baselineActive": resolved_baseline,
|
|
696
|
+
"ondemandActive": active,
|
|
697
|
+
"note": (
|
|
698
|
+
"Layer 2 is phase-needed intersect still-active. "
|
|
699
|
+
"Unactivated modules are not installed."
|
|
700
|
+
),
|
|
701
|
+
},
|
|
702
|
+
"kernel": {
|
|
703
|
+
"phase": kernel.get("phase"),
|
|
704
|
+
"condition": kernel.get("condition"),
|
|
705
|
+
"outcome": kernel.get("outcome"),
|
|
706
|
+
"humanPhase": kernel.get("humanPhase"),
|
|
707
|
+
"selected": selected,
|
|
708
|
+
},
|
|
709
|
+
"rigor": rigor,
|
|
710
|
+
"topologyKind": topology_kind,
|
|
711
|
+
"layers": layers,
|
|
712
|
+
"budget": {
|
|
713
|
+
"maxItems": SESSION_MAX_ITEMS,
|
|
714
|
+
"maxEstimatedTokens": SESSION_MAX_ESTIMATED_TOKENS,
|
|
715
|
+
"estimatedTokens": tokens,
|
|
716
|
+
"itemsUsed": len(kept),
|
|
717
|
+
},
|
|
718
|
+
"omitted": omitted,
|
|
719
|
+
"illegalInputsRejected": [
|
|
720
|
+
"workflow.md",
|
|
721
|
+
"AGENTS.md",
|
|
722
|
+
"[workflow-state:*]",
|
|
723
|
+
"unactivated-module-bodies",
|
|
724
|
+
],
|
|
725
|
+
"catalogSize": len(catalog_ids),
|
|
726
|
+
"retrievalIntents": list(RETRIEVAL_INTENTS),
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
def render_session_pack(pack: dict[str, Any]) -> str:
|
|
731
|
+
"""Render the pack as tagged SessionStart additional_context."""
|
|
732
|
+
meta = {
|
|
733
|
+
"source": pack.get("source"),
|
|
734
|
+
"activationSource": pack.get("activationSource"),
|
|
735
|
+
"layer2ModuleIds": (pack.get("layers") or [{}])[1].get("moduleIds")
|
|
736
|
+
if len(pack.get("layers") or []) > 1
|
|
737
|
+
else [],
|
|
738
|
+
"layers": [row.get("n") for row in pack.get("layers") or []],
|
|
739
|
+
"kernel": pack.get("kernel"),
|
|
740
|
+
"illegalInputsRejected": pack.get("illegalInputsRejected"),
|
|
741
|
+
}
|
|
742
|
+
lines = [
|
|
743
|
+
"<session-pack source=\"context-progressive\">",
|
|
744
|
+
"<session-pack-meta>",
|
|
745
|
+
json.dumps(meta, ensure_ascii=False, indent=2),
|
|
746
|
+
"</session-pack-meta>",
|
|
747
|
+
]
|
|
748
|
+
for layer in pack.get("layers") or []:
|
|
749
|
+
n = int(layer.get("n") or 0)
|
|
750
|
+
name = str(layer.get("name") or "")
|
|
751
|
+
extra = ""
|
|
752
|
+
ids = layer.get("moduleIds")
|
|
753
|
+
if isinstance(ids, list) and ids:
|
|
754
|
+
extra += f" ids=\"{','.join(str(i) for i in ids)}\""
|
|
755
|
+
if layer.get("present") is False:
|
|
756
|
+
extra += " present=\"false\""
|
|
757
|
+
elif layer.get("present") is True:
|
|
758
|
+
extra += " present=\"true\""
|
|
759
|
+
body = str(layer.get("text") or "").strip()
|
|
760
|
+
lines.append(f"<layer n=\"{n}\" name=\"{name}\"{extra}>")
|
|
761
|
+
lines.append(body if body else "(empty)")
|
|
762
|
+
lines.append("</layer>")
|
|
763
|
+
lines.append("</session-pack>")
|
|
764
|
+
return "\n".join(lines)
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
def resolve_task_dir(pactile_dir: Path, task_ref: str | None) -> Path | None:
|
|
768
|
+
if not task_ref:
|
|
769
|
+
return None
|
|
770
|
+
normalized = task_ref.strip().replace("\\", "/")
|
|
771
|
+
path_obj = Path(normalized)
|
|
772
|
+
if path_obj.is_absolute():
|
|
773
|
+
return path_obj
|
|
774
|
+
if normalized.startswith(".pactile/"):
|
|
775
|
+
return pactile_dir.parent / path_obj
|
|
776
|
+
if normalized.startswith("tasks/"):
|
|
777
|
+
return pactile_dir / path_obj
|
|
778
|
+
return pactile_dir / "tasks" / path_obj
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
def compile_session_pack_from_pactile(
|
|
782
|
+
pactile_dir: Path,
|
|
783
|
+
*,
|
|
784
|
+
selected_task_path: str | None = None,
|
|
785
|
+
selected_stale: bool = False,
|
|
786
|
+
fact_gap: bool = False,
|
|
787
|
+
intake_event: bool | None = None,
|
|
788
|
+
) -> dict[str, Any]:
|
|
789
|
+
task_dir = resolve_task_dir(pactile_dir, selected_task_path)
|
|
790
|
+
if selected_task_path and (task_dir is None or not task_dir.is_dir()):
|
|
791
|
+
selected_stale = True
|
|
792
|
+
task_dir = None
|
|
793
|
+
kernel = kernel_from_task_dir(task_dir, stale=selected_stale)
|
|
794
|
+
if selected_stale:
|
|
795
|
+
kernel["stale"] = True
|
|
796
|
+
kernel["selected"] = bool(selected_task_path)
|
|
797
|
+
modules_root = pactile_dir / "modules"
|
|
798
|
+
artifacts = collect_artifact_snippets(task_dir, kernel)
|
|
799
|
+
return compile_session_pack(
|
|
800
|
+
kernel=kernel,
|
|
801
|
+
ondemand_active=_ondemand_active(task_dir),
|
|
802
|
+
baseline_active=_baseline_active(task_dir),
|
|
803
|
+
modules_root=modules_root if modules_root.is_dir() else None,
|
|
804
|
+
artifacts=artifacts,
|
|
805
|
+
rigor=_rigor(task_dir),
|
|
806
|
+
topology_kind=_topology_kind(task_dir),
|
|
807
|
+
intake_event=intake_event,
|
|
808
|
+
fact_gap=fact_gap,
|
|
809
|
+
)
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
def compile_session_pack_for_repo(repo_root: Path | None = None) -> dict[str, Any]:
|
|
813
|
+
"""CLI helper used by `get_context.py --mode session`."""
|
|
814
|
+
root = repo_root or Path.cwd()
|
|
815
|
+
pactile_dir = root / ".pactile"
|
|
816
|
+
if not pactile_dir.is_dir():
|
|
817
|
+
current = root.resolve()
|
|
818
|
+
while True:
|
|
819
|
+
if (current / ".pactile").is_dir():
|
|
820
|
+
pactile_dir = current / ".pactile"
|
|
821
|
+
root = current
|
|
822
|
+
break
|
|
823
|
+
if current.parent == current:
|
|
824
|
+
break
|
|
825
|
+
current = current.parent
|
|
826
|
+
selected_path: str | None = None
|
|
827
|
+
try:
|
|
828
|
+
from .paths import get_selected_task
|
|
829
|
+
|
|
830
|
+
selected_path = get_selected_task(root)
|
|
831
|
+
except Exception:
|
|
832
|
+
selected_path = None
|
|
833
|
+
fact_gap = os.environ.get("PACTILE_SESSION_FACT_GAP") == "1"
|
|
834
|
+
return compile_session_pack_from_pactile(
|
|
835
|
+
pactile_dir,
|
|
836
|
+
selected_task_path=selected_path,
|
|
837
|
+
fact_gap=fact_gap,
|
|
838
|
+
)
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
def main(argv: list[str] | None = None) -> int:
|
|
842
|
+
parser = argparse.ArgumentParser(
|
|
843
|
+
description="Compile a five-layer context-progressive Session pack.",
|
|
844
|
+
)
|
|
845
|
+
parser.add_argument("--json", action="store_true", help="Emit JSON instead of XML.")
|
|
846
|
+
parser.add_argument(
|
|
847
|
+
"--pactile-dir",
|
|
848
|
+
help="Path to `.pactile`. Defaults to nearest `.pactile` from cwd.",
|
|
849
|
+
)
|
|
850
|
+
parser.add_argument(
|
|
851
|
+
"--task",
|
|
852
|
+
help="Selected task path (repo-relative or absolute). Default: none.",
|
|
853
|
+
)
|
|
854
|
+
parser.add_argument(
|
|
855
|
+
"--fact-gap",
|
|
856
|
+
action="store_true",
|
|
857
|
+
help="Include layer-4 retrieval intent pointer.",
|
|
858
|
+
)
|
|
859
|
+
args = parser.parse_args(argv)
|
|
860
|
+
if args.pactile_dir:
|
|
861
|
+
pactile_dir = Path(args.pactile_dir)
|
|
862
|
+
else:
|
|
863
|
+
cwd = Path.cwd()
|
|
864
|
+
pactile_dir = cwd / ".pactile" if (cwd / ".pactile").is_dir() else cwd
|
|
865
|
+
selected = args.task
|
|
866
|
+
if not selected:
|
|
867
|
+
try:
|
|
868
|
+
from .paths import get_selected_task
|
|
869
|
+
|
|
870
|
+
selected = get_selected_task(pactile_dir.parent)
|
|
871
|
+
except Exception:
|
|
872
|
+
selected = None
|
|
873
|
+
pack = compile_session_pack_from_pactile(
|
|
874
|
+
pactile_dir,
|
|
875
|
+
selected_task_path=selected,
|
|
876
|
+
fact_gap=bool(args.fact_gap),
|
|
877
|
+
)
|
|
878
|
+
if args.json:
|
|
879
|
+
print(json.dumps(pack, ensure_ascii=False, indent=2))
|
|
880
|
+
else:
|
|
881
|
+
print(render_session_pack(pack))
|
|
882
|
+
return 0
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
if __name__ == "__main__":
|
|
886
|
+
raise SystemExit(main())
|