@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,766 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Review-pool data access layer (`.pactile/pool/`).
|
|
4
|
+
|
|
5
|
+
Pure read helpers plus the authoritative write path for item ↔ task
|
|
6
|
+
bidirectional links (human index). ``pool:`` satisfaction lives in
|
|
7
|
+
``pool_refs`` (delivery field), not here.
|
|
8
|
+
|
|
9
|
+
Frontmatter reading reuses artifact_search.split_frontmatter /
|
|
10
|
+
parse_frontmatter (the single simple-frontmatter parser; no PyYAML).
|
|
11
|
+
Frontmatter writes splice a re-serialized header between the raw `---`
|
|
12
|
+
fences so the body is preserved byte-for-byte (including the blank line
|
|
13
|
+
after the closing fence and the final newline), and key order stays stable:
|
|
14
|
+
known keys first (id, title, status, type, locale, created, approved,
|
|
15
|
+
priority, delivery, linked_tasks), unknown keys keep their original relative order.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import re
|
|
21
|
+
from dataclasses import dataclass, field
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
from .artifact_search import parse_frontmatter, split_frontmatter
|
|
25
|
+
from .io import read_json
|
|
26
|
+
from .kernel_command import kernel_expected_revision, kernel_patch, kernel_projection_extras
|
|
27
|
+
from .paths import get_repo_root, get_tasks_dir
|
|
28
|
+
from .pool_refs import DELIVERIES
|
|
29
|
+
|
|
30
|
+
POOL_STATUSES = frozenset({"inbox", "review", "accepted", "rejected", "rework"})
|
|
31
|
+
|
|
32
|
+
LINKED_TASKS_KEY = "linked_tasks"
|
|
33
|
+
POOL_ITEMS_KEY = "pool_items"
|
|
34
|
+
META_KEY = "meta"
|
|
35
|
+
|
|
36
|
+
KNOWN_FRONTMATTER_KEY_ORDER = (
|
|
37
|
+
"id",
|
|
38
|
+
"title",
|
|
39
|
+
"status",
|
|
40
|
+
"type",
|
|
41
|
+
"locale",
|
|
42
|
+
"created",
|
|
43
|
+
"approved",
|
|
44
|
+
"priority",
|
|
45
|
+
"delivery",
|
|
46
|
+
LINKED_TASKS_KEY,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
PLAN_TOKEN_RE = re.compile(r"\bP\d+\b")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass
|
|
53
|
+
class PoolItem:
|
|
54
|
+
"""One parsed pool entry from `.pactile/pool/items/`."""
|
|
55
|
+
|
|
56
|
+
id: str
|
|
57
|
+
path: Path
|
|
58
|
+
status: str
|
|
59
|
+
type: str
|
|
60
|
+
title: str | None
|
|
61
|
+
linked_tasks: list[str]
|
|
62
|
+
frontmatter: dict[str, object]
|
|
63
|
+
body: str
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass
|
|
67
|
+
class Issue:
|
|
68
|
+
"""One validation finding. severity is "error" or "warning"."""
|
|
69
|
+
|
|
70
|
+
severity: str
|
|
71
|
+
code: str
|
|
72
|
+
message: str
|
|
73
|
+
path: Path | None = None
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def is_error(self) -> bool:
|
|
77
|
+
return self.severity == "error"
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@dataclass
|
|
81
|
+
class LinkResult:
|
|
82
|
+
"""Outcome of link_item_task / unlink_item_task."""
|
|
83
|
+
|
|
84
|
+
ok: bool
|
|
85
|
+
item_id: str
|
|
86
|
+
task_ref: str
|
|
87
|
+
item_path: Path | None = None
|
|
88
|
+
task_path: Path | None = None
|
|
89
|
+
errors: list[Issue] = field(default_factory=list)
|
|
90
|
+
warnings: list[Issue] = field(default_factory=list)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# =============================================================================
|
|
94
|
+
# Paths and listing
|
|
95
|
+
# =============================================================================
|
|
96
|
+
|
|
97
|
+
def get_pool_root(repo_root: Path | None = None) -> Path:
|
|
98
|
+
"""Return the `.pactile/pool/` directory for the repository."""
|
|
99
|
+
if repo_root is None:
|
|
100
|
+
repo_root = get_repo_root()
|
|
101
|
+
return repo_root / ".pactile" / "pool"
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def list_items(repo_root: Path | None = None) -> list[PoolItem]:
|
|
105
|
+
"""Parse every entry in `.pactile/pool/items/`, sorted by id."""
|
|
106
|
+
if repo_root is None:
|
|
107
|
+
repo_root = get_repo_root()
|
|
108
|
+
items_dir = get_pool_root(repo_root) / "items"
|
|
109
|
+
if not items_dir.is_dir():
|
|
110
|
+
return []
|
|
111
|
+
items = [parse_item_file(path) for path in sorted(items_dir.glob("*.md"))]
|
|
112
|
+
return sorted(items, key=lambda item: item.id)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def find_item_path(repo_root: Path | None, item_id: str) -> Path | None:
|
|
116
|
+
"""Locate the item file whose frontmatter id equals item_id, else None."""
|
|
117
|
+
for item in list_items(repo_root):
|
|
118
|
+
if item.id == item_id:
|
|
119
|
+
return item.path
|
|
120
|
+
return None
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def load_item(repo_root: Path | None, item_id: str) -> PoolItem | None:
|
|
124
|
+
"""Load one pool entry by exact frontmatter id, else None."""
|
|
125
|
+
for item in list_items(repo_root):
|
|
126
|
+
if item.id == item_id:
|
|
127
|
+
return item
|
|
128
|
+
return None
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def parse_item_file(path: Path) -> PoolItem:
|
|
132
|
+
"""Parse one pool entry file into a PoolItem (read-only)."""
|
|
133
|
+
content = path.read_text(encoding="utf-8")
|
|
134
|
+
frontmatter, body, _ = split_frontmatter(content)
|
|
135
|
+
return PoolItem(
|
|
136
|
+
id=_scalar_str(frontmatter.get("id"), ""),
|
|
137
|
+
path=path,
|
|
138
|
+
status=_scalar_str(frontmatter.get("status"), ""),
|
|
139
|
+
type=_scalar_str(frontmatter.get("type"), ""),
|
|
140
|
+
title=_scalar_str(frontmatter.get("title"), None),
|
|
141
|
+
linked_tasks=normalize_id_list(frontmatter.get(LINKED_TASKS_KEY)),
|
|
142
|
+
frontmatter=frontmatter,
|
|
143
|
+
body=body,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def _scalar_str(value: object, default: str | None) -> str | None:
|
|
148
|
+
if isinstance(value, str):
|
|
149
|
+
return value
|
|
150
|
+
return default
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
# =============================================================================
|
|
154
|
+
# Link field helpers
|
|
155
|
+
# =============================================================================
|
|
156
|
+
|
|
157
|
+
def normalize_id_list(raw: object) -> list[str]:
|
|
158
|
+
"""Normalize a list field: strip, drop empties/non-strings, dedupe in order."""
|
|
159
|
+
if isinstance(raw, str):
|
|
160
|
+
raw = [raw]
|
|
161
|
+
if not isinstance(raw, list):
|
|
162
|
+
return []
|
|
163
|
+
normalized: list[str] = []
|
|
164
|
+
seen: set[str] = set()
|
|
165
|
+
for item in raw:
|
|
166
|
+
if not isinstance(item, str):
|
|
167
|
+
continue
|
|
168
|
+
value = item.strip()
|
|
169
|
+
if not value or value in seen:
|
|
170
|
+
continue
|
|
171
|
+
seen.add(value)
|
|
172
|
+
normalized.append(value)
|
|
173
|
+
return normalized
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def get_item_delivery(item: PoolItem) -> str:
|
|
177
|
+
"""delivery frontmatter value, or empty string."""
|
|
178
|
+
return _scalar_str(item.frontmatter.get("delivery"), "") or ""
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def delivery_groups(repo_root: Path | None = None) -> dict[str, list[PoolItem]]:
|
|
182
|
+
"""Group accepted items by delivery. Keys are delivery values plus 'unset'."""
|
|
183
|
+
groups: dict[str, list[PoolItem]] = {key: [] for key in sorted(DELIVERIES)}
|
|
184
|
+
groups["unset"] = []
|
|
185
|
+
for item in list_items(repo_root):
|
|
186
|
+
if item.status != "accepted":
|
|
187
|
+
continue
|
|
188
|
+
delivery = get_item_delivery(item)
|
|
189
|
+
if delivery in groups:
|
|
190
|
+
groups[delivery].append(item)
|
|
191
|
+
else:
|
|
192
|
+
groups["unset"].append(item)
|
|
193
|
+
return groups
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def get_linked_tasks(item: PoolItem) -> list[str]:
|
|
197
|
+
"""Linked task dir names of one pool item (normalized)."""
|
|
198
|
+
return normalize_id_list(item.frontmatter.get(LINKED_TASKS_KEY))
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def get_pool_items(task_data: dict | None) -> list[str]:
|
|
202
|
+
"""meta.pool_items of one task.json dict (normalized)."""
|
|
203
|
+
if not isinstance(task_data, dict):
|
|
204
|
+
return []
|
|
205
|
+
meta = task_data.get(META_KEY)
|
|
206
|
+
if not isinstance(meta, dict):
|
|
207
|
+
return []
|
|
208
|
+
return normalize_id_list(meta.get(POOL_ITEMS_KEY))
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
# =============================================================================
|
|
212
|
+
# Frontmatter write (body-preserving)
|
|
213
|
+
# =============================================================================
|
|
214
|
+
|
|
215
|
+
def write_item_frontmatter(path: Path, updates: dict[str, object]) -> None:
|
|
216
|
+
"""Merge `updates` into the item's frontmatter and write the file back.
|
|
217
|
+
|
|
218
|
+
Only the frontmatter block changes; the body is preserved byte-for-byte.
|
|
219
|
+
List values are whole-key replaced with a normalized list.
|
|
220
|
+
"""
|
|
221
|
+
content = path.read_text(encoding="utf-8")
|
|
222
|
+
span = _frontmatter_span(content)
|
|
223
|
+
if span is None:
|
|
224
|
+
raise ValueError(f"no frontmatter block in {path}")
|
|
225
|
+
start, end = span # line indices between the two `---` fences
|
|
226
|
+
lines = content.splitlines(keepends=True)
|
|
227
|
+
raw_fm_lines = lines[start:end]
|
|
228
|
+
eol = "\r\n" if raw_fm_lines and "\r\n" in raw_fm_lines[0] else "\n"
|
|
229
|
+
|
|
230
|
+
frontmatter = parse_frontmatter([line.rstrip("\r\n") for line in raw_fm_lines])
|
|
231
|
+
merged = dict(frontmatter)
|
|
232
|
+
for key, value in updates.items():
|
|
233
|
+
merged[key] = normalize_id_list(value) if isinstance(value, list) else value
|
|
234
|
+
header = _serialize_frontmatter(merged, original_keys=list(frontmatter.keys()))
|
|
235
|
+
|
|
236
|
+
body = "".join(lines[end + 1 :])
|
|
237
|
+
new_content = "---" + eol + header.replace("\n", eol) + eol + "---" + eol + body
|
|
238
|
+
if new_content != content:
|
|
239
|
+
path.write_text(new_content, encoding="utf-8")
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def update_item_frontmatter(path: Path, mutator) -> None:
|
|
243
|
+
"""Mutator-style frontmatter write: call mutator(current_fm) -> updates."""
|
|
244
|
+
content = path.read_text(encoding="utf-8")
|
|
245
|
+
span = _frontmatter_span(content)
|
|
246
|
+
if span is None:
|
|
247
|
+
raise ValueError(f"no frontmatter block in {path}")
|
|
248
|
+
lines = content.splitlines(keepends=True)
|
|
249
|
+
frontmatter = parse_frontmatter(
|
|
250
|
+
[line.rstrip("\r\n") for line in lines[span[0] : span[1]]]
|
|
251
|
+
)
|
|
252
|
+
updates = mutator(frontmatter)
|
|
253
|
+
if not isinstance(updates, dict):
|
|
254
|
+
raise TypeError("frontmatter mutator must return a dict of updates")
|
|
255
|
+
write_item_frontmatter(path, updates)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def _frontmatter_span(content: str) -> tuple[int, int] | None:
|
|
259
|
+
"""Line indices of the frontmatter content between the two fences."""
|
|
260
|
+
lines = content.splitlines(keepends=True)
|
|
261
|
+
if not lines or lines[0].strip() != "---":
|
|
262
|
+
return None
|
|
263
|
+
for idx in range(1, len(lines)):
|
|
264
|
+
if lines[idx].strip() == "---":
|
|
265
|
+
return 1, idx
|
|
266
|
+
return None
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def _serialize_frontmatter(data: dict[str, object], original_keys: list[str]) -> str:
|
|
270
|
+
known = [key for key in KNOWN_FRONTMATTER_KEY_ORDER if key in data]
|
|
271
|
+
rest = [
|
|
272
|
+
key
|
|
273
|
+
for key in original_keys
|
|
274
|
+
if key not in KNOWN_FRONTMATTER_KEY_ORDER and key in data
|
|
275
|
+
]
|
|
276
|
+
added = [
|
|
277
|
+
key
|
|
278
|
+
for key in data
|
|
279
|
+
if key not in KNOWN_FRONTMATTER_KEY_ORDER and key not in original_keys
|
|
280
|
+
]
|
|
281
|
+
lines: list[str] = []
|
|
282
|
+
for key in known + rest + added:
|
|
283
|
+
value = data[key]
|
|
284
|
+
if isinstance(value, list):
|
|
285
|
+
lines.append(f"{key}:")
|
|
286
|
+
for item in value:
|
|
287
|
+
lines.append(f" - {_format_scalar(item)}")
|
|
288
|
+
else:
|
|
289
|
+
lines.append(f"{key}: {_format_scalar(value)}")
|
|
290
|
+
return "\n".join(lines)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
def _format_scalar(value: object) -> str:
|
|
294
|
+
text = "" if value is None else str(value)
|
|
295
|
+
if text == "":
|
|
296
|
+
return '""'
|
|
297
|
+
if (
|
|
298
|
+
text != text.strip()
|
|
299
|
+
or ":" in text
|
|
300
|
+
or "#" in text
|
|
301
|
+
or text in ("null", "true", "false")
|
|
302
|
+
):
|
|
303
|
+
return f'"{text}"'
|
|
304
|
+
return text
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
# =============================================================================
|
|
308
|
+
# Bidirectional link write path (authoritative: both sides in one call)
|
|
309
|
+
# =============================================================================
|
|
310
|
+
|
|
311
|
+
def find_task_dir(task_ref: str, tasks_dir: Path) -> Path | None:
|
|
312
|
+
"""Resolve a task ref to a task directory with task.json.
|
|
313
|
+
|
|
314
|
+
Order: exact `tasks/<ref>` -> suffix match -> archive/<month>/<ref> ->
|
|
315
|
+
archive suffix match. Mirrors task_dependencies._find_task_dir semantics.
|
|
316
|
+
"""
|
|
317
|
+
candidates = [tasks_dir / task_ref]
|
|
318
|
+
if tasks_dir.is_dir():
|
|
319
|
+
for d in sorted(tasks_dir.iterdir()):
|
|
320
|
+
if d.is_dir() and d.name != "archive" and d.name.endswith(f"-{task_ref}"):
|
|
321
|
+
candidates.append(d)
|
|
322
|
+
archive_root = tasks_dir / "archive"
|
|
323
|
+
if archive_root.is_dir():
|
|
324
|
+
for month_dir in sorted(archive_root.iterdir()):
|
|
325
|
+
if not month_dir.is_dir():
|
|
326
|
+
continue
|
|
327
|
+
candidates.append(month_dir / task_ref)
|
|
328
|
+
for d in sorted(month_dir.iterdir()):
|
|
329
|
+
if d.is_dir() and d.name.endswith(f"-{task_ref}"):
|
|
330
|
+
candidates.append(d)
|
|
331
|
+
for candidate in candidates:
|
|
332
|
+
if candidate.is_dir() and (candidate / "task.json").is_file():
|
|
333
|
+
return candidate
|
|
334
|
+
return None
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
def _iter_task_dirs(tasks_dir: Path):
|
|
338
|
+
"""Yield task dirs with task.json: active tasks, then archive tasks."""
|
|
339
|
+
if not tasks_dir.is_dir():
|
|
340
|
+
return
|
|
341
|
+
for d in sorted(tasks_dir.iterdir()):
|
|
342
|
+
if d.is_dir() and d.name != "archive" and (d / "task.json").is_file():
|
|
343
|
+
yield d
|
|
344
|
+
archive_root = tasks_dir / "archive"
|
|
345
|
+
if archive_root.is_dir():
|
|
346
|
+
for month_dir in sorted(archive_root.iterdir()):
|
|
347
|
+
if not month_dir.is_dir():
|
|
348
|
+
continue
|
|
349
|
+
for d in sorted(month_dir.iterdir()):
|
|
350
|
+
if d.is_dir() and (d / "task.json").is_file():
|
|
351
|
+
yield d
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def _task_meta_with_pool_items(task_dir: Path, item_id: str, *, remove: bool) -> bool:
|
|
355
|
+
"""Add/remove item_id in task.json meta.pool_items via Kernel patch."""
|
|
356
|
+
data = read_json(task_dir / "task.json")
|
|
357
|
+
if not isinstance(data, dict):
|
|
358
|
+
return False
|
|
359
|
+
meta = data.get(META_KEY)
|
|
360
|
+
if not isinstance(meta, dict):
|
|
361
|
+
meta = {}
|
|
362
|
+
pool_items = normalize_id_list(meta.get(POOL_ITEMS_KEY))
|
|
363
|
+
if remove:
|
|
364
|
+
if item_id not in pool_items:
|
|
365
|
+
return False
|
|
366
|
+
pool_items = [value for value in pool_items if value != item_id]
|
|
367
|
+
else:
|
|
368
|
+
if item_id in pool_items:
|
|
369
|
+
return False
|
|
370
|
+
pool_items.append(item_id)
|
|
371
|
+
meta[POOL_ITEMS_KEY] = pool_items
|
|
372
|
+
data[META_KEY] = meta
|
|
373
|
+
action = "unlink" if remove else "link"
|
|
374
|
+
kernel_patch(
|
|
375
|
+
task_dir,
|
|
376
|
+
data,
|
|
377
|
+
kernel_projection_extras(data),
|
|
378
|
+
expected_revision=kernel_expected_revision(task_dir),
|
|
379
|
+
actor="pool.py link" if not remove else "pool.py unlink",
|
|
380
|
+
idempotency_key=f"patch:pool-{action}:{task_dir.name}:{item_id}",
|
|
381
|
+
evidence="pool_store._task_meta_with_pool_items",
|
|
382
|
+
)
|
|
383
|
+
return True
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def link_item_task(
|
|
387
|
+
repo_root: Path | None,
|
|
388
|
+
item_id: str,
|
|
389
|
+
task_ref: str,
|
|
390
|
+
) -> LinkResult:
|
|
391
|
+
"""Link one pool item to one task on both sides (idempotent).
|
|
392
|
+
|
|
393
|
+
Item side stores the resolved task directory name in linked_tasks; task
|
|
394
|
+
side stores the item id in meta.pool_items. Missing item or task -> error.
|
|
395
|
+
"""
|
|
396
|
+
if repo_root is None:
|
|
397
|
+
repo_root = get_repo_root()
|
|
398
|
+
tasks_dir = get_tasks_dir(repo_root)
|
|
399
|
+
|
|
400
|
+
item = load_item(repo_root, item_id)
|
|
401
|
+
if item is None:
|
|
402
|
+
return LinkResult(
|
|
403
|
+
ok=False,
|
|
404
|
+
item_id=item_id,
|
|
405
|
+
task_ref=task_ref,
|
|
406
|
+
errors=[
|
|
407
|
+
Issue(
|
|
408
|
+
"error",
|
|
409
|
+
"item-not-found",
|
|
410
|
+
f"pool item {item_id!r} not found under {get_pool_root(repo_root) / 'items'}",
|
|
411
|
+
)
|
|
412
|
+
],
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
task_dir = find_task_dir(task_ref, tasks_dir)
|
|
416
|
+
if task_dir is None:
|
|
417
|
+
return LinkResult(
|
|
418
|
+
ok=False,
|
|
419
|
+
item_id=item_id,
|
|
420
|
+
task_ref=task_ref,
|
|
421
|
+
item_path=item.path,
|
|
422
|
+
errors=[
|
|
423
|
+
Issue(
|
|
424
|
+
"error",
|
|
425
|
+
"task-not-found",
|
|
426
|
+
f"task {task_ref!r} not found under {tasks_dir} or archive",
|
|
427
|
+
)
|
|
428
|
+
],
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
canonical_ref = task_dir.name
|
|
432
|
+
linked = get_linked_tasks(item)
|
|
433
|
+
if canonical_ref not in linked:
|
|
434
|
+
linked.append(canonical_ref)
|
|
435
|
+
write_item_frontmatter(item.path, {LINKED_TASKS_KEY: linked})
|
|
436
|
+
_task_meta_with_pool_items(task_dir, item_id, remove=False)
|
|
437
|
+
|
|
438
|
+
return LinkResult(
|
|
439
|
+
ok=True,
|
|
440
|
+
item_id=item_id,
|
|
441
|
+
task_ref=canonical_ref,
|
|
442
|
+
item_path=item.path,
|
|
443
|
+
task_path=task_dir,
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
def unlink_item_task(
|
|
448
|
+
repo_root: Path | None,
|
|
449
|
+
item_id: str,
|
|
450
|
+
task_ref: str,
|
|
451
|
+
) -> LinkResult:
|
|
452
|
+
"""Remove the item<->task link on both sides, best-effort.
|
|
453
|
+
|
|
454
|
+
Missing item -> error. When the task side is absent (unresolvable ref or
|
|
455
|
+
no link recorded), the item side is still cleaned and a warning is issued;
|
|
456
|
+
exit semantics are left to the CLI (warnings -> exit 0).
|
|
457
|
+
"""
|
|
458
|
+
if repo_root is None:
|
|
459
|
+
repo_root = get_repo_root()
|
|
460
|
+
tasks_dir = get_tasks_dir(repo_root)
|
|
461
|
+
|
|
462
|
+
item = load_item(repo_root, item_id)
|
|
463
|
+
if item is None:
|
|
464
|
+
return LinkResult(
|
|
465
|
+
ok=False,
|
|
466
|
+
item_id=item_id,
|
|
467
|
+
task_ref=task_ref,
|
|
468
|
+
errors=[
|
|
469
|
+
Issue(
|
|
470
|
+
"error",
|
|
471
|
+
"item-not-found",
|
|
472
|
+
f"pool item {item_id!r} not found under {get_pool_root(repo_root) / 'items'}",
|
|
473
|
+
)
|
|
474
|
+
],
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
warnings: list[Issue] = []
|
|
478
|
+
task_dir = find_task_dir(task_ref, tasks_dir)
|
|
479
|
+
canonical_ref = task_dir.name if task_dir is not None else task_ref.strip()
|
|
480
|
+
|
|
481
|
+
linked = get_linked_tasks(item)
|
|
482
|
+
removed_item_side = any(value in linked for value in (canonical_ref, task_ref.strip()))
|
|
483
|
+
if removed_item_side:
|
|
484
|
+
linked = [value for value in linked if value not in (canonical_ref, task_ref.strip())]
|
|
485
|
+
write_item_frontmatter(item.path, {LINKED_TASKS_KEY: linked})
|
|
486
|
+
|
|
487
|
+
removed_task_side = False
|
|
488
|
+
if task_dir is not None:
|
|
489
|
+
removed_task_side = _task_meta_with_pool_items(task_dir, item_id, remove=True)
|
|
490
|
+
|
|
491
|
+
if task_dir is None:
|
|
492
|
+
warnings.append(
|
|
493
|
+
Issue(
|
|
494
|
+
"warning",
|
|
495
|
+
"task-not-found",
|
|
496
|
+
f"task {task_ref!r} not found; could not clean task side (item side cleaned)",
|
|
497
|
+
item.path,
|
|
498
|
+
)
|
|
499
|
+
)
|
|
500
|
+
elif not removed_task_side:
|
|
501
|
+
warnings.append(
|
|
502
|
+
Issue(
|
|
503
|
+
"warning",
|
|
504
|
+
"no-task-side-link",
|
|
505
|
+
f"task {task_dir.name} had no meta.pool_items entry for {item_id!r}",
|
|
506
|
+
task_dir,
|
|
507
|
+
)
|
|
508
|
+
)
|
|
509
|
+
if not removed_item_side and task_dir is not None:
|
|
510
|
+
warnings.append(
|
|
511
|
+
Issue(
|
|
512
|
+
"warning",
|
|
513
|
+
"no-item-side-link",
|
|
514
|
+
f"item {item_id} had no linked_tasks entry for {canonical_ref!r}",
|
|
515
|
+
item.path,
|
|
516
|
+
)
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
return LinkResult(
|
|
520
|
+
ok=True,
|
|
521
|
+
item_id=item_id,
|
|
522
|
+
task_ref=canonical_ref,
|
|
523
|
+
item_path=item.path,
|
|
524
|
+
task_path=task_dir,
|
|
525
|
+
warnings=warnings,
|
|
526
|
+
)
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
# =============================================================================
|
|
530
|
+
# Validation
|
|
531
|
+
# =============================================================================
|
|
532
|
+
|
|
533
|
+
REQUIRED_SECTIONS = ("意图", "动机", "粗验收", "非目标")
|
|
534
|
+
_SECTION_RE = {
|
|
535
|
+
section: re.compile(rf"(?im)^\s{{0,3}}#{{1,6}}\s*{section}\s*$")
|
|
536
|
+
for section in REQUIRED_SECTIONS
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def _has_section(body: str, section: str) -> bool:
|
|
541
|
+
return _SECTION_RE[section].search(body) is not None
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
def validate_pool(repo_root: Path | None = None) -> list[Issue]:
|
|
545
|
+
"""Full item validation: required keys, status, sections, id uniqueness,
|
|
546
|
+
dangling links, and bidirectional link consistency."""
|
|
547
|
+
if repo_root is None:
|
|
548
|
+
repo_root = get_repo_root()
|
|
549
|
+
issues: list[Issue] = []
|
|
550
|
+
seen_ids: dict[str, Path] = {}
|
|
551
|
+
tasks_dir = get_tasks_dir(repo_root)
|
|
552
|
+
|
|
553
|
+
for item in list_items(repo_root):
|
|
554
|
+
label = item.id or item.path.name
|
|
555
|
+
for key in ("id", "status", "type"):
|
|
556
|
+
if not item.frontmatter.get(key):
|
|
557
|
+
issues.append(
|
|
558
|
+
Issue(
|
|
559
|
+
"error",
|
|
560
|
+
"missing-frontmatter-key",
|
|
561
|
+
f"item {label}: required frontmatter key {key!r} missing",
|
|
562
|
+
item.path,
|
|
563
|
+
)
|
|
564
|
+
)
|
|
565
|
+
if item.status and item.status not in POOL_STATUSES:
|
|
566
|
+
issues.append(
|
|
567
|
+
Issue(
|
|
568
|
+
"error",
|
|
569
|
+
"invalid-status",
|
|
570
|
+
f"item {label}: status {item.status!r} not in {sorted(POOL_STATUSES)}",
|
|
571
|
+
item.path,
|
|
572
|
+
)
|
|
573
|
+
)
|
|
574
|
+
delivery = _scalar_str(item.frontmatter.get("delivery"), "") or ""
|
|
575
|
+
if item.status == "accepted":
|
|
576
|
+
if not delivery:
|
|
577
|
+
issues.append(
|
|
578
|
+
Issue(
|
|
579
|
+
"error",
|
|
580
|
+
"missing-delivery",
|
|
581
|
+
f"item {label}: accepted items require delivery "
|
|
582
|
+
f"({', '.join(sorted(DELIVERIES))})",
|
|
583
|
+
item.path,
|
|
584
|
+
)
|
|
585
|
+
)
|
|
586
|
+
elif delivery not in DELIVERIES:
|
|
587
|
+
issues.append(
|
|
588
|
+
Issue(
|
|
589
|
+
"error",
|
|
590
|
+
"invalid-delivery",
|
|
591
|
+
f"item {label}: delivery {delivery!r} not in {sorted(DELIVERIES)}",
|
|
592
|
+
item.path,
|
|
593
|
+
)
|
|
594
|
+
)
|
|
595
|
+
elif delivery and delivery not in DELIVERIES:
|
|
596
|
+
issues.append(
|
|
597
|
+
Issue(
|
|
598
|
+
"error",
|
|
599
|
+
"invalid-delivery",
|
|
600
|
+
f"item {label}: delivery {delivery!r} not in {sorted(DELIVERIES)}",
|
|
601
|
+
item.path,
|
|
602
|
+
)
|
|
603
|
+
)
|
|
604
|
+
for section in REQUIRED_SECTIONS:
|
|
605
|
+
if not _has_section(item.body, section):
|
|
606
|
+
severity = (
|
|
607
|
+
"warning"
|
|
608
|
+
if item.status in {"inbox", "review"}
|
|
609
|
+
else "error"
|
|
610
|
+
)
|
|
611
|
+
issues.append(
|
|
612
|
+
Issue(
|
|
613
|
+
severity,
|
|
614
|
+
"missing-section",
|
|
615
|
+
f"item {label}: missing required section {section!r}",
|
|
616
|
+
item.path,
|
|
617
|
+
)
|
|
618
|
+
)
|
|
619
|
+
for ref in item.linked_tasks:
|
|
620
|
+
if find_task_dir(ref, tasks_dir) is None:
|
|
621
|
+
issues.append(
|
|
622
|
+
Issue(
|
|
623
|
+
"error",
|
|
624
|
+
"dangling-link",
|
|
625
|
+
f"item {label}: linked_tasks entry {ref!r} does not resolve to a task",
|
|
626
|
+
item.path,
|
|
627
|
+
)
|
|
628
|
+
)
|
|
629
|
+
if item.id:
|
|
630
|
+
if item.id in seen_ids:
|
|
631
|
+
issues.append(
|
|
632
|
+
Issue(
|
|
633
|
+
"error",
|
|
634
|
+
"duplicate-id",
|
|
635
|
+
f"pool item id {item.id!r} duplicated at {seen_ids[item.id]} and {item.path}",
|
|
636
|
+
item.path,
|
|
637
|
+
)
|
|
638
|
+
)
|
|
639
|
+
else:
|
|
640
|
+
seen_ids[item.id] = item.path
|
|
641
|
+
|
|
642
|
+
issues.extend(check_link_consistency(repo_root))
|
|
643
|
+
return issues
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
def check_link_consistency(repo_root: Path | None = None) -> list[Issue]:
|
|
647
|
+
"""Detect one-sided links: item links a task whose meta.pool_items lacks
|
|
648
|
+
the item, or a task lists a pool item the entry does not link back."""
|
|
649
|
+
if repo_root is None:
|
|
650
|
+
repo_root = get_repo_root()
|
|
651
|
+
issues: list[Issue] = []
|
|
652
|
+
tasks_dir = get_tasks_dir(repo_root)
|
|
653
|
+
|
|
654
|
+
for item in list_items(repo_root):
|
|
655
|
+
for ref in item.linked_tasks:
|
|
656
|
+
task_dir = find_task_dir(ref, tasks_dir)
|
|
657
|
+
if task_dir is None:
|
|
658
|
+
continue # dangling links are flagged by validate_pool
|
|
659
|
+
data = read_json(task_dir / "task.json") or {}
|
|
660
|
+
if item.id and item.id not in get_pool_items(data):
|
|
661
|
+
issues.append(
|
|
662
|
+
Issue(
|
|
663
|
+
"error",
|
|
664
|
+
"link-missing-task-side",
|
|
665
|
+
f"item {item.id} links task {task_dir.name} but task.json meta.pool_items is missing {item.id!r}",
|
|
666
|
+
item.path,
|
|
667
|
+
)
|
|
668
|
+
)
|
|
669
|
+
|
|
670
|
+
for task_dir in _iter_task_dirs(tasks_dir):
|
|
671
|
+
data = read_json(task_dir / "task.json") or {}
|
|
672
|
+
for pool_id in get_pool_items(data):
|
|
673
|
+
item = load_item(repo_root, pool_id)
|
|
674
|
+
if item is None:
|
|
675
|
+
issues.append(
|
|
676
|
+
Issue(
|
|
677
|
+
"error",
|
|
678
|
+
"link-item-missing",
|
|
679
|
+
f"task {task_dir.name} meta.pool_items references unknown pool item {pool_id!r}",
|
|
680
|
+
task_dir,
|
|
681
|
+
)
|
|
682
|
+
)
|
|
683
|
+
elif task_dir.name not in item.linked_tasks:
|
|
684
|
+
issues.append(
|
|
685
|
+
Issue(
|
|
686
|
+
"error",
|
|
687
|
+
"link-missing-item-side",
|
|
688
|
+
f"task {task_dir.name} meta.pool_items lists {pool_id} but item linked_tasks is missing {task_dir.name!r}",
|
|
689
|
+
item.path,
|
|
690
|
+
)
|
|
691
|
+
)
|
|
692
|
+
return issues
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
# =============================================================================
|
|
696
|
+
# plan.md reference checking
|
|
697
|
+
# =============================================================================
|
|
698
|
+
|
|
699
|
+
def _strip_code_blocks(text: str) -> str:
|
|
700
|
+
lines: list[str] = []
|
|
701
|
+
in_block = False
|
|
702
|
+
for line in text.splitlines():
|
|
703
|
+
if line.lstrip().startswith("```"):
|
|
704
|
+
in_block = not in_block
|
|
705
|
+
continue
|
|
706
|
+
if not in_block:
|
|
707
|
+
lines.append(line)
|
|
708
|
+
return "\n".join(lines)
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
def _plan_tokens(plan_text: str) -> set[str]:
|
|
712
|
+
"""All `P<digits>` tokens in plan text, outside fenced code blocks."""
|
|
713
|
+
return set(PLAN_TOKEN_RE.findall(_strip_code_blocks(plan_text)))
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
def plan_referenced_ids(plan_text: str, known_ids: set[str]) -> set[str]:
|
|
717
|
+
"""Plan tokens that intersect the known item ids (conservative scan)."""
|
|
718
|
+
return _plan_tokens(plan_text) & known_ids
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
def _known_item_ids(repo_root: Path) -> set[str]:
|
|
722
|
+
"""Item ids from items/ plus any archived entries under pool/archive/."""
|
|
723
|
+
ids = {item.id for item in list_items(repo_root) if item.id}
|
|
724
|
+
archive_dir = get_pool_root(repo_root) / "archive"
|
|
725
|
+
if archive_dir.is_dir():
|
|
726
|
+
for path in sorted(archive_dir.rglob("*.md")):
|
|
727
|
+
item = parse_item_file(path)
|
|
728
|
+
if item.id:
|
|
729
|
+
ids.add(item.id)
|
|
730
|
+
return ids
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
def check_plan(repo_root: Path | None = None) -> list[Issue]:
|
|
734
|
+
"""plan.md checks: ghost references -> error; accepted items not mentioned
|
|
735
|
+
-> warning."""
|
|
736
|
+
if repo_root is None:
|
|
737
|
+
repo_root = get_repo_root()
|
|
738
|
+
plan_file = get_pool_root(repo_root) / "plan.md"
|
|
739
|
+
if not plan_file.is_file():
|
|
740
|
+
return [
|
|
741
|
+
Issue("error", "plan-missing", "plan.md not found", plan_file)
|
|
742
|
+
]
|
|
743
|
+
|
|
744
|
+
known_ids = _known_item_ids(repo_root)
|
|
745
|
+
tokens = _plan_tokens(plan_file.read_text(encoding="utf-8"))
|
|
746
|
+
issues: list[Issue] = []
|
|
747
|
+
for ghost in sorted(tokens - known_ids):
|
|
748
|
+
issues.append(
|
|
749
|
+
Issue(
|
|
750
|
+
"error",
|
|
751
|
+
"plan-ghost-id",
|
|
752
|
+
f"plan.md references unknown pool id {ghost!r}",
|
|
753
|
+
plan_file,
|
|
754
|
+
)
|
|
755
|
+
)
|
|
756
|
+
for item in list_items(repo_root):
|
|
757
|
+
if item.status == "accepted" and item.id and item.id not in tokens:
|
|
758
|
+
issues.append(
|
|
759
|
+
Issue(
|
|
760
|
+
"warning",
|
|
761
|
+
"accepted-not-in-plan",
|
|
762
|
+
f"accepted item {item.id} not referenced in plan.md",
|
|
763
|
+
item.path,
|
|
764
|
+
)
|
|
765
|
+
)
|
|
766
|
+
return issues
|