@pennixrv/trellis 0.7.2-beta.3 → 0.7.2-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/ablate.d.ts.map +1 -1
- package/dist/commands/ablate.js +13 -0
- package/dist/commands/ablate.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +138 -120
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/teamwork/adapters/acp.d.ts.map +1 -1
- package/dist/commands/teamwork/adapters/acp.js +3 -0
- package/dist/commands/teamwork/adapters/acp.js.map +1 -1
- package/dist/commands/teamwork/adapters/index.d.ts +1 -1
- package/dist/commands/teamwork/adapters/index.d.ts.map +1 -1
- package/dist/commands/teamwork/artifact.d.ts +2 -0
- package/dist/commands/teamwork/artifact.d.ts.map +1 -1
- package/dist/commands/teamwork/artifact.js +4 -2
- package/dist/commands/teamwork/artifact.js.map +1 -1
- package/dist/commands/teamwork/batch-reservation.d.ts.map +1 -1
- package/dist/commands/teamwork/batch-reservation.js +16 -8
- package/dist/commands/teamwork/batch-reservation.js.map +1 -1
- package/dist/commands/teamwork/batch.d.ts +15 -1
- package/dist/commands/teamwork/batch.d.ts.map +1 -1
- package/dist/commands/teamwork/batch.js +279 -24
- package/dist/commands/teamwork/batch.js.map +1 -1
- package/dist/commands/teamwork/coordinator.d.ts +3 -0
- package/dist/commands/teamwork/coordinator.d.ts.map +1 -1
- package/dist/commands/teamwork/coordinator.js +22 -3
- package/dist/commands/teamwork/coordinator.js.map +1 -1
- package/dist/commands/teamwork/create.d.ts +1 -0
- package/dist/commands/teamwork/create.d.ts.map +1 -1
- package/dist/commands/teamwork/create.js +4 -0
- package/dist/commands/teamwork/create.js.map +1 -1
- package/dist/commands/teamwork/evidence-references.d.ts +19 -0
- package/dist/commands/teamwork/evidence-references.d.ts.map +1 -0
- package/dist/commands/teamwork/evidence-references.js +249 -0
- package/dist/commands/teamwork/evidence-references.js.map +1 -0
- package/dist/commands/teamwork/foreground-wait.d.ts +4 -1
- package/dist/commands/teamwork/foreground-wait.d.ts.map +1 -1
- package/dist/commands/teamwork/foreground-wait.js +15 -1
- package/dist/commands/teamwork/foreground-wait.js.map +1 -1
- package/dist/commands/teamwork/index.d.ts.map +1 -1
- package/dist/commands/teamwork/index.js +47 -5
- package/dist/commands/teamwork/index.js.map +1 -1
- package/dist/commands/teamwork/list.d.ts +1 -0
- package/dist/commands/teamwork/list.d.ts.map +1 -1
- package/dist/commands/teamwork/list.js +4 -1
- package/dist/commands/teamwork/list.js.map +1 -1
- package/dist/commands/teamwork/prompt.js +1 -1
- package/dist/commands/teamwork/prompt.js.map +1 -1
- package/dist/commands/teamwork/rm.d.ts +27 -4
- package/dist/commands/teamwork/rm.d.ts.map +1 -1
- package/dist/commands/teamwork/rm.js +155 -51
- package/dist/commands/teamwork/rm.js.map +1 -1
- package/dist/commands/teamwork/run.d.ts.map +1 -1
- package/dist/commands/teamwork/run.js +10 -1
- package/dist/commands/teamwork/run.js.map +1 -1
- package/dist/commands/teamwork/runtime.d.ts +1 -1
- package/dist/commands/teamwork/runtime.d.ts.map +1 -1
- package/dist/commands/teamwork/runtime.js +14 -4
- package/dist/commands/teamwork/runtime.js.map +1 -1
- package/dist/commands/teamwork/spawn.d.ts.map +1 -1
- package/dist/commands/teamwork/spawn.js +4 -1
- package/dist/commands/teamwork/spawn.js.map +1 -1
- package/dist/commands/teamwork/supervisor/stdout.d.ts.map +1 -1
- package/dist/commands/teamwork/supervisor/stdout.js +7 -0
- package/dist/commands/teamwork/supervisor/stdout.js.map +1 -1
- package/dist/commands/teamwork/supervisor.d.ts +1 -1
- package/dist/commands/teamwork/supervisor.d.ts.map +1 -1
- package/dist/commands/teamwork/teammate-adapters.d.ts +3 -0
- package/dist/commands/teamwork/teammate-adapters.d.ts.map +1 -1
- package/dist/commands/teamwork/teammate-adapters.js +14 -5
- package/dist/commands/teamwork/teammate-adapters.js.map +1 -1
- package/dist/commands/teamwork/teammate-launch.d.ts +3 -1
- package/dist/commands/teamwork/teammate-launch.d.ts.map +1 -1
- package/dist/commands/teamwork/teammate-launch.js +7 -5
- package/dist/commands/teamwork/teammate-launch.js.map +1 -1
- package/dist/commands/teamwork/workers.d.ts +8 -0
- package/dist/commands/teamwork/workers.d.ts.map +1 -0
- package/dist/commands/teamwork/workers.js +67 -0
- package/dist/commands/teamwork/workers.js.map +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +188 -59
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +5 -7
- package/dist/commands/workflow.js.map +1 -1
- package/dist/configurators/codebuddy.d.ts +1 -8
- package/dist/configurators/codebuddy.d.ts.map +1 -1
- package/dist/configurators/codebuddy.js +2 -12
- package/dist/configurators/codebuddy.js.map +1 -1
- package/dist/configurators/codex.d.ts +0 -36
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +13 -106
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts +1 -12
- package/dist/configurators/copilot.d.ts.map +1 -1
- package/dist/configurators/copilot.js +2 -20
- package/dist/configurators/copilot.js.map +1 -1
- package/dist/configurators/cursor.d.ts +1 -8
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +2 -12
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/droid.d.ts +1 -8
- package/dist/configurators/droid.d.ts.map +1 -1
- package/dist/configurators/droid.js +2 -12
- package/dist/configurators/droid.js.map +1 -1
- package/dist/configurators/dsh.d.ts +1 -21
- package/dist/configurators/dsh.d.ts.map +1 -1
- package/dist/configurators/dsh.js +4 -37
- package/dist/configurators/dsh.js.map +1 -1
- package/dist/configurators/gemini.d.ts +1 -16
- package/dist/configurators/gemini.d.ts.map +1 -1
- package/dist/configurators/gemini.js +3 -21
- package/dist/configurators/gemini.js.map +1 -1
- package/dist/configurators/grok.d.ts +1 -12
- package/dist/configurators/grok.d.ts.map +1 -1
- package/dist/configurators/grok.js +2 -18
- package/dist/configurators/grok.js.map +1 -1
- package/dist/configurators/kimi.d.ts +1 -21
- package/dist/configurators/kimi.d.ts.map +1 -1
- package/dist/configurators/kimi.js +2 -38
- package/dist/configurators/kimi.js.map +1 -1
- package/dist/configurators/kiro.d.ts +1 -9
- package/dist/configurators/kiro.d.ts.map +1 -1
- package/dist/configurators/kiro.js +1 -9
- package/dist/configurators/kiro.js.map +1 -1
- package/dist/configurators/omp.d.ts.map +1 -1
- package/dist/configurators/omp.js +1 -5
- package/dist/configurators/omp.js.map +1 -1
- package/dist/configurators/pi.d.ts.map +1 -1
- package/dist/configurators/pi.js +2 -5
- package/dist/configurators/pi.js.map +1 -1
- package/dist/configurators/qoder.d.ts +1 -10
- package/dist/configurators/qoder.d.ts.map +1 -1
- package/dist/configurators/qoder.js +3 -15
- package/dist/configurators/qoder.js.map +1 -1
- package/dist/configurators/reasonix.d.ts +1 -12
- package/dist/configurators/reasonix.d.ts.map +1 -1
- package/dist/configurators/reasonix.js +3 -22
- package/dist/configurators/reasonix.js.map +1 -1
- package/dist/configurators/shared.d.ts +1 -24
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +5 -184
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/snow.d.ts +1 -20
- package/dist/configurators/snow.d.ts.map +1 -1
- package/dist/configurators/snow.js +2 -25
- package/dist/configurators/snow.js.map +1 -1
- package/dist/configurators/trae.d.ts +1 -14
- package/dist/configurators/trae.d.ts.map +1 -1
- package/dist/configurators/trae.js +3 -19
- package/dist/configurators/trae.js.map +1 -1
- package/dist/configurators/workflow.d.ts +5 -0
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +85 -57
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/configurators/zcode.d.ts +1 -13
- package/dist/configurators/zcode.d.ts.map +1 -1
- package/dist/configurators/zcode.js +2 -18
- package/dist/configurators/zcode.js.map +1 -1
- package/dist/migrations/manifests/0.5.0-beta.5.json +1 -212
- package/dist/migrations/manifests/0.7.2-beta.10.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.11.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.12.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.13.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.14.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.15.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.16.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.17.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.18.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.19.json +11 -0
- package/dist/migrations/manifests/0.7.2-beta.20.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.21.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.22.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.23.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.24.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.25.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.26.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.27.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.28.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.29.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.30.json +10 -0
- package/dist/migrations/manifests/0.7.2-beta.31.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.4.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.5.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.6.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.7.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.8.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.9.json +9 -0
- package/dist/migrations/retired-native-paths.d.ts +109 -0
- package/dist/migrations/retired-native-paths.d.ts.map +1 -0
- package/dist/migrations/retired-native-paths.js +263 -0
- package/dist/migrations/retired-native-paths.js.map +1 -0
- package/dist/templates/claude/index.d.ts +1 -16
- package/dist/templates/claude/index.d.ts.map +1 -1
- package/dist/templates/claude/index.js +5 -32
- package/dist/templates/claude/index.js.map +1 -1
- package/dist/templates/claude/settings.json +0 -22
- package/dist/templates/codebuddy/index.d.ts +2 -3
- package/dist/templates/codebuddy/index.d.ts.map +1 -1
- package/dist/templates/codebuddy/index.js +2 -3
- package/dist/templates/codebuddy/index.js.map +1 -1
- package/dist/templates/codebuddy/settings.json +0 -10
- package/dist/templates/codex/config.toml +4 -19
- package/dist/templates/codex/hooks/session-start.py +25 -30
- package/dist/templates/codex/hooks/turn-guard.py +74 -0
- package/dist/templates/codex/hooks.json +57 -6
- package/dist/templates/codex/index.d.ts +0 -5
- package/dist/templates/codex/index.d.ts.map +1 -1
- package/dist/templates/codex/index.js +0 -13
- package/dist/templates/codex/index.js.map +1 -1
- package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +13 -3
- package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/workflow.md +17 -9
- package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md +7 -3
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +7 -7
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +9 -51
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +3 -15
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +4 -9
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +6 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +10 -8
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +9 -79
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +2 -4
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +3 -6
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +24 -103
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +27 -6
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +9 -7
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +12 -84
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +5 -25
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +5 -9
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +8 -0
- package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +7 -3
- package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +8 -1
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +21 -1
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +13 -2
- package/dist/templates/common/bundled-skills/trellis-worktree-delegation/SKILL.md +14 -0
- package/dist/templates/common/bundled-skills/trellis-worktree-delegation/workflow.md +86 -0
- package/dist/templates/common/commands/continue.md +16 -1
- package/dist/templates/common/commands/start.md +2 -0
- package/dist/templates/common/skills/before-dev.md +3 -1
- package/dist/templates/common/skills/check.md +3 -1
- package/dist/templates/common/skills/request-intake.md +14 -1
- package/dist/templates/copilot/hooks/session-start.py +11 -30
- package/dist/templates/cursor/hooks.json +0 -7
- package/dist/templates/cursor/index.d.ts +1 -11
- package/dist/templates/cursor/index.d.ts.map +1 -1
- package/dist/templates/cursor/index.js +2 -10
- package/dist/templates/cursor/index.js.map +1 -1
- package/dist/templates/droid/index.d.ts +2 -3
- package/dist/templates/droid/index.d.ts.map +1 -1
- package/dist/templates/droid/index.js +2 -3
- package/dist/templates/droid/index.js.map +1 -1
- package/dist/templates/droid/settings.json +0 -10
- package/dist/templates/dsh/DSH.md +2 -33
- package/dist/templates/dsh/index.d.ts +1 -19
- package/dist/templates/dsh/index.d.ts.map +1 -1
- package/dist/templates/dsh/index.js +2 -21
- package/dist/templates/dsh/index.js.map +1 -1
- package/dist/templates/gemini/index.d.ts +1 -11
- package/dist/templates/gemini/index.d.ts.map +1 -1
- package/dist/templates/gemini/index.js +2 -10
- package/dist/templates/gemini/index.js.map +1 -1
- package/dist/templates/kiro/index.d.ts +1 -13
- package/dist/templates/kiro/index.d.ts.map +1 -1
- package/dist/templates/kiro/index.js +1 -13
- package/dist/templates/kiro/index.js.map +1 -1
- package/dist/templates/markdown/agents.md +9 -14
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +1 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/spec/index.md.txt +20 -0
- package/dist/templates/omp/extensions/trellis/index.ts.txt +27 -60
- package/dist/templates/omp/index.d.ts +0 -2
- package/dist/templates/omp/index.d.ts.map +1 -1
- package/dist/templates/omp/index.js +1 -4
- package/dist/templates/omp/index.js.map +1 -1
- package/dist/templates/opencode/lib/session-utils.js +17 -5
- package/dist/templates/opencode/lib/trellis-context.js +12 -321
- package/dist/templates/opencode/plugins/inject-shell-session-context.js +93 -0
- package/dist/templates/opencode/plugins/inject-workflow-state.js +19 -17
- package/dist/templates/opencode/plugins/session-start.js +2 -6
- package/dist/templates/pi/extensions/trellis/index.ts.txt +17 -1436
- package/dist/templates/pi/index.d.ts +1 -2
- package/dist/templates/pi/index.d.ts.map +1 -1
- package/dist/templates/pi/index.js +2 -5
- package/dist/templates/pi/index.js.map +1 -1
- package/dist/templates/qoder/index.d.ts +2 -3
- package/dist/templates/qoder/index.d.ts.map +1 -1
- package/dist/templates/qoder/index.js +2 -3
- package/dist/templates/qoder/index.js.map +1 -1
- package/dist/templates/shared-hooks/guard-teamwork-wait.py +118 -12
- package/dist/templates/shared-hooks/index.d.ts +2 -56
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +4 -70
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-shell-session-context.py +46 -1
- package/dist/templates/shared-hooks/inject-spec-context.py +6 -35
- package/dist/templates/shared-hooks/inject-workflow-state.py +66 -104
- package/dist/templates/shared-hooks/session-start.py +8 -6
- package/dist/templates/snow/SNOW.md +6 -18
- package/dist/templates/snow/hooks/write-trellis-context.py +51 -133
- package/dist/templates/snow/index.d.ts +2 -21
- package/dist/templates/snow/index.d.ts.map +1 -1
- package/dist/templates/snow/index.js +3 -24
- package/dist/templates/snow/index.js.map +1 -1
- package/dist/templates/template-utils.d.ts +1 -2
- package/dist/templates/template-utils.d.ts.map +1 -1
- package/dist/templates/template-utils.js +1 -11
- package/dist/templates/template-utils.js.map +1 -1
- package/dist/templates/trae/index.d.ts +2 -3
- package/dist/templates/trae/index.d.ts.map +1 -1
- package/dist/templates/trae/index.js +2 -3
- package/dist/templates/trae/index.js.map +1 -1
- package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +22 -22
- package/dist/templates/trellis/agents/teammate.md +6 -2
- package/dist/templates/trellis/agents/worktree-delegation-node.md +32 -0
- package/dist/templates/trellis/config.yaml +7 -36
- package/dist/templates/trellis/gitignore.txt +4 -0
- package/dist/templates/trellis/index.d.ts +1 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +9 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/active_task.py +23 -31
- package/dist/templates/trellis/scripts/common/config.py +16 -36
- package/dist/templates/trellis/scripts/common/git_context.py +13 -4
- package/dist/templates/trellis/scripts/common/io.py +2 -2
- package/dist/templates/trellis/scripts/common/markdown_format.py +107 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +29 -1
- package/dist/templates/trellis/scripts/common/session_context.py +25 -50
- package/dist/templates/trellis/scripts/common/task_context.py +5 -3
- package/dist/templates/trellis/scripts/common/task_continuity.py +66 -9
- package/dist/templates/trellis/scripts/common/task_move.py +11 -5
- package/dist/templates/trellis/scripts/common/task_runtime.py +211 -0
- package/dist/templates/trellis/scripts/common/task_store.py +12 -82
- package/dist/templates/trellis/scripts/common/task_turn.py +518 -0
- package/dist/templates/trellis/scripts/common/task_workflow.py +383 -395
- package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -36
- package/dist/templates/trellis/scripts/common/workflow_selection.py +35 -40
- package/dist/templates/trellis/scripts/common/worktree_delegation.py +690 -0
- package/dist/templates/trellis/scripts/common/worktree_delegation_contract.py +446 -0
- package/dist/templates/trellis/scripts/common/worktree_delegation_messages.py +376 -0
- package/dist/templates/trellis/scripts/common/worktree_delegation_transport.py +57 -0
- package/dist/templates/trellis/scripts/markdown_format.py +40 -0
- package/dist/templates/trellis/scripts/task.py +73 -10
- package/dist/templates/trellis/workflow.md +52 -11
- package/dist/templates/zcode/config.json +0 -10
- package/dist/templates/zcode/index.d.ts +3 -22
- package/dist/templates/zcode/index.d.ts.map +1 -1
- package/dist/templates/zcode/index.js +3 -24
- package/dist/templates/zcode/index.js.map +1 -1
- package/dist/types/ai-tools.d.ts +0 -4
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +4 -109
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/ablation-store.d.ts.map +1 -1
- package/dist/utils/ablation-store.js +41 -1
- package/dist/utils/ablation-store.js.map +1 -1
- package/dist/utils/asset-backup.d.ts +1 -0
- package/dist/utils/asset-backup.d.ts.map +1 -1
- package/dist/utils/asset-backup.js +131 -31
- package/dist/utils/asset-backup.js.map +1 -1
- package/dist/utils/atomic-write.d.ts +1 -1
- package/dist/utils/atomic-write.d.ts.map +1 -1
- package/dist/utils/atomic-write.js +8 -2
- package/dist/utils/atomic-write.js.map +1 -1
- package/dist/utils/codex-config-ownership.d.ts +13 -0
- package/dist/utils/codex-config-ownership.d.ts.map +1 -0
- package/dist/utils/codex-config-ownership.js +64 -0
- package/dist/utils/codex-config-ownership.js.map +1 -0
- package/dist/utils/file-writer.d.ts +2 -0
- package/dist/utils/file-writer.d.ts.map +1 -1
- package/dist/utils/file-writer.js +1 -1
- package/dist/utils/file-writer.js.map +1 -1
- package/dist/utils/managed-markdown.d.ts +5 -0
- package/dist/utils/managed-markdown.d.ts.map +1 -0
- package/dist/utils/managed-markdown.js +64 -0
- package/dist/utils/managed-markdown.js.map +1 -0
- package/dist/utils/managed-removal.d.ts +2 -0
- package/dist/utils/managed-removal.d.ts.map +1 -1
- package/dist/utils/managed-removal.js +62 -8
- package/dist/utils/managed-removal.js.map +1 -1
- package/dist/utils/manifest-prune.d.ts.map +1 -1
- package/dist/utils/manifest-prune.js +5 -12
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/project-init.d.ts +26 -0
- package/dist/utils/project-init.d.ts.map +1 -0
- package/dist/utils/project-init.js +484 -0
- package/dist/utils/project-init.js.map +1 -0
- package/dist/utils/retired-native-assets.d.ts +17 -0
- package/dist/utils/retired-native-assets.d.ts.map +1 -0
- package/dist/utils/retired-native-assets.js +221 -0
- package/dist/utils/retired-native-assets.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +6 -12
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/package.json +2 -2
- package/dist/templates/claude/agents/trellis-check.md +0 -115
- package/dist/templates/claude/agents/trellis-implement.md +0 -110
- package/dist/templates/claude/agents/trellis-research.md +0 -137
- package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
- package/dist/templates/codebuddy/agents/trellis-implement.md +0 -110
- package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
- package/dist/templates/codex/agents/trellis-check.toml +0 -56
- package/dist/templates/codex/agents/trellis-implement.toml +0 -37
- package/dist/templates/codex/agents/trellis-research.toml +0 -78
- package/dist/templates/cursor/agents/trellis-check.md +0 -114
- package/dist/templates/cursor/agents/trellis-implement.md +0 -109
- package/dist/templates/cursor/agents/trellis-research.md +0 -136
- package/dist/templates/droid/droids/trellis-check.md +0 -107
- package/dist/templates/droid/droids/trellis-implement.md +0 -102
- package/dist/templates/droid/droids/trellis-research.md +0 -137
- package/dist/templates/dsh/agents/trellis-check.md +0 -99
- package/dist/templates/dsh/agents/trellis-implement.md +0 -106
- package/dist/templates/dsh/agents/trellis-research.md +0 -134
- package/dist/templates/gemini/agents/trellis-check.md +0 -107
- package/dist/templates/gemini/agents/trellis-implement.md +0 -102
- package/dist/templates/gemini/agents/trellis-research.md +0 -136
- package/dist/templates/grok/agents/trellis-check.md +0 -105
- package/dist/templates/grok/agents/trellis-implement.md +0 -116
- package/dist/templates/grok/agents/trellis-research.md +0 -146
- package/dist/templates/grok/index.d.ts +0 -16
- package/dist/templates/grok/index.d.ts.map +0 -1
- package/dist/templates/grok/index.js +0 -19
- package/dist/templates/grok/index.js.map +0 -1
- package/dist/templates/kimi/agents/trellis-check.md +0 -103
- package/dist/templates/kimi/agents/trellis-implement.md +0 -115
- package/dist/templates/kimi/agents/trellis-research.md +0 -144
- package/dist/templates/kimi/index.d.ts +0 -20
- package/dist/templates/kimi/index.d.ts.map +0 -1
- package/dist/templates/kimi/index.js +0 -23
- package/dist/templates/kimi/index.js.map +0 -1
- package/dist/templates/kiro/agents/trellis-check.json +0 -26
- package/dist/templates/kiro/agents/trellis-implement.json +0 -26
- package/dist/templates/kiro/agents/trellis-research.json +0 -30
- package/dist/templates/omp/agents/trellis-check.md +0 -41
- package/dist/templates/omp/agents/trellis-implement.md +0 -45
- package/dist/templates/omp/agents/trellis-research.md +0 -30
- package/dist/templates/opencode/agents/trellis-check.md +0 -122
- package/dist/templates/opencode/agents/trellis-implement.md +0 -118
- package/dist/templates/opencode/agents/trellis-research.md +0 -145
- package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -569
- package/dist/templates/pi/agents/trellis-check.md +0 -37
- package/dist/templates/pi/agents/trellis-implement.md +0 -42
- package/dist/templates/pi/agents/trellis-research.md +0 -25
- package/dist/templates/qoder/agents/trellis-check.md +0 -108
- package/dist/templates/qoder/agents/trellis-implement.md +0 -103
- package/dist/templates/qoder/agents/trellis-research.md +0 -137
- package/dist/templates/reasonix/agents/trellis-check.md +0 -36
- package/dist/templates/reasonix/agents/trellis-implement.md +0 -41
- package/dist/templates/reasonix/index.d.ts +0 -13
- package/dist/templates/reasonix/index.d.ts.map +0 -1
- package/dist/templates/reasonix/index.js +0 -16
- package/dist/templates/reasonix/index.js.map +0 -1
- package/dist/templates/shared-hooks/inject-subagent-context.py +0 -1217
- package/dist/templates/snow/agents/trellis-check.md +0 -135
- package/dist/templates/snow/agents/trellis-implement.md +0 -153
- package/dist/templates/snow/agents/trellis-research.md +0 -114
- package/dist/templates/snow/hooks/beforeSubAgentStart.json +0 -15
- package/dist/templates/trae/agents/trellis-check.md +0 -108
- package/dist/templates/trae/agents/trellis-implement.md +0 -103
- package/dist/templates/trae/agents/trellis-research.md +0 -137
- package/dist/templates/zcode/agents/trellis-check.md +0 -109
- package/dist/templates/zcode/agents/trellis-implement.md +0 -111
- package/dist/templates/zcode/agents/trellis-research.md +0 -133
|
@@ -10,7 +10,7 @@ Provides:
|
|
|
10
10
|
Note:
|
|
11
11
|
``cmd_init_context`` was removed in v0.5.0-beta.12. JSONL context files
|
|
12
12
|
are created empty at ``task.py create`` time; the AI agent curates real
|
|
13
|
-
entries during planning when the task needs
|
|
13
|
+
entries during planning when the task needs spec/research context. See
|
|
14
14
|
``.trellis/workflow.md`` for the current planning artifact contract.
|
|
15
15
|
|
|
16
16
|
Older Trellis versions seeded those files with a ``{"_example": ...}``
|
|
@@ -35,7 +35,7 @@ from .task_utils import resolve_task_dir
|
|
|
35
35
|
# Extensions that look like code rather than spec/research docs. Entries with
|
|
36
36
|
# one of these extensions outside .trellis/spec/, docs/docs-site, or the
|
|
37
37
|
# task's own directory get a hygiene warning in `task.py validate` — the
|
|
38
|
-
# reader is
|
|
38
|
+
# reader is an AI session, so code paths belong in the diff the
|
|
39
39
|
# agent reads itself, not in implement.jsonl / check.jsonl.
|
|
40
40
|
_CODE_FILE_EXTENSIONS = {
|
|
41
41
|
".ts",
|
|
@@ -153,6 +153,8 @@ def cmd_validate(args: argparse.Namespace) -> int:
|
|
|
153
153
|
task_json_path = target_dir / FILE_TASK_JSON
|
|
154
154
|
if task_json_path.is_file():
|
|
155
155
|
task_data = read_json(task_json_path)
|
|
156
|
+
if task_data and task_data.get("status") in {"completed", "cancelled"}:
|
|
157
|
+
print("Historical context diagnostic: missing references do not revoke accepted task history or authorize deletion.")
|
|
156
158
|
stored_branch = task_data.get("branch") if task_data else None
|
|
157
159
|
if stored_branch and not branch_exists_locally(stored_branch, repo_root):
|
|
158
160
|
print(
|
|
@@ -208,7 +210,7 @@ def _validate_jsonl(jsonl_file: Path, repo_root: Path, task_dir: Path | None = N
|
|
|
208
210
|
non-blocking hygiene warnings (never counted in ``errors``, never change
|
|
209
211
|
the exit code): entries that look like code files rather than
|
|
210
212
|
spec/research docs, and entries whose file size exceeds the configured
|
|
211
|
-
|
|
213
|
+
main-session context injection cap (``context_injection.max_file_bytes``).
|
|
212
214
|
"""
|
|
213
215
|
file_name = jsonl_file.name
|
|
214
216
|
errors = 0
|
|
@@ -242,8 +242,16 @@ def _projection(root: Path, directory: Path, data: dict, task_id: str) -> dict:
|
|
|
242
242
|
evidence_digest = hashlib.sha256(
|
|
243
243
|
json.dumps(sorted(evidence), ensure_ascii=False, separators=(",", ":")).encode("utf-8")
|
|
244
244
|
).hexdigest()
|
|
245
|
+
from .worktree_delegation import runtime_path, read as read_delegation
|
|
246
|
+
delegations = {}
|
|
247
|
+
for task_name in [directory.name, *data.get("children", [])]:
|
|
248
|
+
path = runtime_path(root, task_name)
|
|
249
|
+
if path.exists():
|
|
250
|
+
record = read_delegation(path)
|
|
251
|
+
delegations[task_name] = {"record_digest": _digest(record), "attempt_id": record.get("attempt_id"), "status": record.get("status"), "intent": record.get("intent")}
|
|
245
252
|
return {
|
|
246
253
|
"task": {"id": task_id, "path": directory.relative_to(root).as_posix(), "status": data.get("status")},
|
|
254
|
+
"delegations": delegations,
|
|
247
255
|
"phase": {"current_phase_id": current_phase, "task_route_revision": route_revision, "input_revision": input_revision, "phases": phases},
|
|
248
256
|
"evidence_digest": evidence_digest,
|
|
249
257
|
"git": {
|
|
@@ -300,6 +308,15 @@ def continuity_show(args: argparse.Namespace) -> int:
|
|
|
300
308
|
|
|
301
309
|
|
|
302
310
|
def continuity_capture(args: argparse.Namespace) -> int:
|
|
311
|
+
from .task_move import layout_lock
|
|
312
|
+
|
|
313
|
+
with layout_lock(get_repo_root()):
|
|
314
|
+
return _continuity_capture_locked(args)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
def _continuity_capture_locked(args: argparse.Namespace) -> int:
|
|
318
|
+
from .task_move import layout_lock
|
|
319
|
+
|
|
303
320
|
root = get_repo_root()
|
|
304
321
|
try:
|
|
305
322
|
directory, data, task_id, _ = _task(root)
|
|
@@ -307,7 +324,8 @@ def continuity_capture(args: argparse.Namespace) -> int:
|
|
|
307
324
|
source_digest = _digest(current)
|
|
308
325
|
task_path = directory.relative_to(root).as_posix()
|
|
309
326
|
path = _continuity_path(root, task_path)
|
|
310
|
-
with
|
|
327
|
+
with layout_lock(root):
|
|
328
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
311
329
|
record, _ = _read_record(path)
|
|
312
330
|
actual = record.get("source_digest") if record else "absent"
|
|
313
331
|
if actual != args.expected_source_digest:
|
|
@@ -372,6 +390,15 @@ def _current_projection_digest(root: Path, task_dir: Path, data: dict, task_id:
|
|
|
372
390
|
|
|
373
391
|
|
|
374
392
|
def transfer_task_ownership(args: argparse.Namespace) -> int:
|
|
393
|
+
from .task_move import layout_lock
|
|
394
|
+
|
|
395
|
+
with layout_lock(get_repo_root()):
|
|
396
|
+
return _transfer_task_ownership_locked(args)
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def _transfer_task_ownership_locked(args: argparse.Namespace) -> int:
|
|
400
|
+
from .task_move import layout_lock
|
|
401
|
+
|
|
375
402
|
root = get_repo_root()
|
|
376
403
|
operation = args.transfer_action
|
|
377
404
|
try:
|
|
@@ -392,7 +419,7 @@ def transfer_task_ownership(args: argparse.Namespace) -> int:
|
|
|
392
419
|
if operation != "status" and data.get("status") in {"completed", "cancelled"}:
|
|
393
420
|
raise ContinuityError("TASK_TRANSFER_WITHHELD", "terminal tasks cannot change ownership")
|
|
394
421
|
path = _ownership_path(root, task_path)
|
|
395
|
-
with
|
|
422
|
+
with layout_lock(root):
|
|
396
423
|
record = _load_owner(path)
|
|
397
424
|
if record and (record["task_id"] != task_id or record["task_path"] != task_path):
|
|
398
425
|
raise ContinuityError("TASK_TRANSFER_WITHHELD", "ownership record does not match the requested task")
|
|
@@ -409,6 +436,7 @@ def transfer_task_ownership(args: argparse.Namespace) -> int:
|
|
|
409
436
|
raise ContinuityError("TASK_TRANSFER_NOT_AUTHORIZED", "ownership changes require an explicit user request")
|
|
410
437
|
if args.expected_generation is None or args.expected_generation < 0:
|
|
411
438
|
raise ContinuityError("TASK_TRANSFER_INVALID_INPUT", "a non-negative expected generation is required")
|
|
439
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
412
440
|
if operation == "quiesce":
|
|
413
441
|
context_key, current_path = _direct_pointer(root, task_path)
|
|
414
442
|
if current_path is None:
|
|
@@ -598,10 +626,10 @@ def add_continuity_commands(subparsers) -> None:
|
|
|
598
626
|
|
|
599
627
|
def clear_task_runtime_records(repo_root: Path, task_path: str) -> bool:
|
|
600
628
|
"""Remove only this task's current continuity and ownership projections."""
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
629
|
+
from .task_move import layout_lock
|
|
630
|
+
|
|
631
|
+
with layout_lock(repo_root):
|
|
632
|
+
for path in (_continuity_path(repo_root, task_path), _ownership_path(repo_root, task_path)):
|
|
605
633
|
try:
|
|
606
634
|
path.unlink(missing_ok=True)
|
|
607
635
|
except OSError:
|
|
@@ -622,7 +650,7 @@ def active_task_change_guard(repo_root: Path, context_key: str, task_path: str,
|
|
|
622
650
|
return
|
|
623
651
|
task_path = directory.relative_to(repo_root).as_posix()
|
|
624
652
|
path = _ownership_path(repo_root, task_path)
|
|
625
|
-
with
|
|
653
|
+
with layout_lock(repo_root):
|
|
626
654
|
try:
|
|
627
655
|
record = _load_owner(path)
|
|
628
656
|
except ContinuityError:
|
|
@@ -654,11 +682,37 @@ def assert_task_mutation_allowed(repo_root: Path, task_dir: Path, data: dict) ->
|
|
|
654
682
|
raise TaskWorkflowError("TASK_TRANSFER_ACTIVE", "task changes are fenced until the target session consumes ownership or the source releases the transfer")
|
|
655
683
|
|
|
656
684
|
|
|
685
|
+
def assert_task_safety_allowed(repo_root: Path, task_dir: Path, data: dict) -> None:
|
|
686
|
+
"""Allow only the recorded source/target to stop and preserve bound resources."""
|
|
687
|
+
from .task_move import layout_lock, require_settled_layout
|
|
688
|
+
|
|
689
|
+
if os.environ.get("TRELLIS_DELEGATION_CONTEXT"):
|
|
690
|
+
raise TaskWorkflowError("TASK_TRANSFER_ACTIVE", "delegated nodes cannot control task resources")
|
|
691
|
+
with layout_lock(repo_root):
|
|
692
|
+
require_settled_layout(repo_root)
|
|
693
|
+
task_path = task_dir.relative_to(repo_root).as_posix()
|
|
694
|
+
try:
|
|
695
|
+
record = _load_owner(_ownership_path(repo_root, task_path))
|
|
696
|
+
except ContinuityError as error:
|
|
697
|
+
raise TaskWorkflowError(error.code, str(error)) from error
|
|
698
|
+
if record is None:
|
|
699
|
+
return
|
|
700
|
+
active = resolve_active_task(repo_root)
|
|
701
|
+
identity_matches = record["task_id"] == (data.get("id") or data.get("name")) and record["task_path"] == task_path
|
|
702
|
+
source_allowed = (record["status"] in {"quiescing", "sealed", "retiring", "ready", "recovery_required"}
|
|
703
|
+
and record["target_session_id"] is None and active.context_key == record["source_session_id"])
|
|
704
|
+
target_allowed = record["status"] in {"claiming", "claimed", "consumed"} and active.context_key == record["target_session_id"]
|
|
705
|
+
if not identity_matches or active.source_type == "session-fallback" or not (source_allowed or target_allowed):
|
|
706
|
+
raise TaskWorkflowError("TASK_TRANSFER_ACTIVE", "only the current recorded resource owner may perform bound safety controls")
|
|
707
|
+
|
|
708
|
+
|
|
657
709
|
def assert_task_identity_change_allowed(repo_root: Path, task_dir: Path, data: dict) -> None:
|
|
658
710
|
"""Keep an active ownership record addressable while the task ID is fixed."""
|
|
711
|
+
from .task_move import layout_lock
|
|
712
|
+
|
|
659
713
|
task_path = task_dir.relative_to(repo_root).as_posix()
|
|
660
714
|
path = _ownership_path(repo_root, task_path)
|
|
661
|
-
with
|
|
715
|
+
with layout_lock(repo_root):
|
|
662
716
|
try:
|
|
663
717
|
record = _load_owner(path)
|
|
664
718
|
except ContinuityError as error:
|
|
@@ -670,13 +724,16 @@ def assert_task_identity_change_allowed(repo_root: Path, task_dir: Path, data: d
|
|
|
670
724
|
@contextlib.contextmanager
|
|
671
725
|
def task_mutation_guard(repo_root: Path, task_dir: Path, data: dict):
|
|
672
726
|
"""Hold the ownership lock across a single task mutation."""
|
|
727
|
+
if os.environ.get("TRELLIS_DELEGATION_CONTEXT"):
|
|
728
|
+
yield False
|
|
729
|
+
return
|
|
673
730
|
from .task_move import layout_lock, require_settled_layout
|
|
674
731
|
|
|
675
732
|
with layout_lock(repo_root):
|
|
676
733
|
require_settled_layout(repo_root)
|
|
677
734
|
task_path = task_dir.relative_to(repo_root).as_posix()
|
|
678
735
|
path = _ownership_path(repo_root, task_path)
|
|
679
|
-
with
|
|
736
|
+
with layout_lock(repo_root):
|
|
680
737
|
try:
|
|
681
738
|
record = _load_owner(path)
|
|
682
739
|
except ContinuityError:
|
|
@@ -107,8 +107,8 @@ def _plan(root: Path, moves: list[tuple[Path, Path]], updates: dict[Path, dict])
|
|
|
107
107
|
elif not path.is_dir():
|
|
108
108
|
raise ValueError(f"Unsupported task content: {path}")
|
|
109
109
|
data = _read(source / "task.json")
|
|
110
|
-
|
|
111
|
-
delegated =
|
|
110
|
+
from .worktree_delegation import resolve_record
|
|
111
|
+
delegated = resolve_record(root, source, data)
|
|
112
112
|
if delegated is not None:
|
|
113
113
|
from .task_workflow import _assert_delegated_record_closed
|
|
114
114
|
_assert_delegated_record_closed(source.name, delegated)
|
|
@@ -156,9 +156,15 @@ def _plan(root: Path, moves: list[tuple[Path, Path]], updates: dict[Path, dict])
|
|
|
156
156
|
for folder in ("sessions", "continuity", "task-ownership"):
|
|
157
157
|
for path in sorted((runtime / folder).glob("*.json")):
|
|
158
158
|
record = _read(path)
|
|
159
|
-
if
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
if folder == "sessions" and record.get("current_task") in terminal_refs:
|
|
160
|
+
if "turn" in record:
|
|
161
|
+
updated = {key: _rewrite(value, rewrites) for key, value in record.items()
|
|
162
|
+
if key != "current_task"}
|
|
163
|
+
change(path, _json(updated))
|
|
164
|
+
else:
|
|
165
|
+
change(path, None)
|
|
166
|
+
continue
|
|
167
|
+
if folder != "sessions" and path.stem in terminal_hashes:
|
|
162
168
|
change(path, None)
|
|
163
169
|
continue
|
|
164
170
|
updated = _rewrite(record, rewrites)
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"""Bounded retirement of Trellis-owned projections; never task evidence."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import ast
|
|
7
|
+
import hashlib
|
|
8
|
+
from itertools import islice
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
import re
|
|
13
|
+
import stat
|
|
14
|
+
import sys
|
|
15
|
+
|
|
16
|
+
from .io import read_json_checked
|
|
17
|
+
from .paths import get_repo_root
|
|
18
|
+
from .task_move import layout_lock, require_settled_layout
|
|
19
|
+
from .task_utils import is_within_tasks_dir, resolve_task_dir
|
|
20
|
+
|
|
21
|
+
MAX_FILES = 2048
|
|
22
|
+
MAX_BYTES = 256 * 1024
|
|
23
|
+
SESSION_KEYS = {"current_task", "current_run", "platform", "last_seen_at"}
|
|
24
|
+
MARKER = re.compile(r"update-check-[A-Za-z0-9_.-]+\.marker\Z")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _fingerprint(path: Path) -> dict:
|
|
28
|
+
info = path.lstat()
|
|
29
|
+
if not stat.S_ISREG(info.st_mode) or info.st_size > MAX_BYTES:
|
|
30
|
+
raise ValueError("not a bounded regular file")
|
|
31
|
+
return {"device": info.st_dev, "inode": info.st_ino, "size": info.st_size,
|
|
32
|
+
"mtime_ns": info.st_mtime_ns, "mode": info.st_mode,
|
|
33
|
+
"sha256": hashlib.sha256(path.read_bytes()).hexdigest()}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _protocol(root: Path) -> dict:
|
|
37
|
+
"""Check the materialized writers, not merely the executing CLI version."""
|
|
38
|
+
scripts = root / ".trellis/scripts"
|
|
39
|
+
result = {}
|
|
40
|
+
checks = {"common/active_task.py": "_session_file_lock",
|
|
41
|
+
"common/task_workflow.py": "_task_lock",
|
|
42
|
+
"common/task_continuity.py": "continuity_capture",
|
|
43
|
+
"task.py": "main"}
|
|
44
|
+
for relative, function in checks.items():
|
|
45
|
+
path = scripts / relative
|
|
46
|
+
try:
|
|
47
|
+
if path.resolve() != path.absolute():
|
|
48
|
+
return {"ready": False, "reason": "redirected native writer"}
|
|
49
|
+
raw = path.read_bytes()
|
|
50
|
+
tree = ast.parse(raw)
|
|
51
|
+
node = next(n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name == function)
|
|
52
|
+
calls = {n.func.id for n in ast.walk(node)
|
|
53
|
+
if isinstance(n, ast.Call) and isinstance(n.func, ast.Name)}
|
|
54
|
+
if "layout_lock" not in calls:
|
|
55
|
+
return {"ready": False, "reason": "native writers still use the old protocol"}
|
|
56
|
+
if relative == "common/task_continuity.py" and any(
|
|
57
|
+
isinstance(n, ast.Call) and isinstance(n.func, ast.Name) and n.func.id == "_record_lock"
|
|
58
|
+
for n in ast.walk(tree)
|
|
59
|
+
):
|
|
60
|
+
return {"ready": False, "reason": "per-record continuity writer remains"}
|
|
61
|
+
result[relative] = hashlib.sha256(raw).hexdigest()
|
|
62
|
+
except (OSError, SyntaxError, StopIteration, ValueError):
|
|
63
|
+
return {"ready": False, "reason": "cannot verify materialized native writers"}
|
|
64
|
+
return {"ready": True, "writers": result}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _open_anchors(identities: set[tuple[int, int]]) -> tuple[set[tuple[int, int]], str | None]:
|
|
68
|
+
# Open descriptors include flock waiters; an empty /proc/locks snapshot does not.
|
|
69
|
+
if not identities:
|
|
70
|
+
return set(), None
|
|
71
|
+
if sys.platform != "linux":
|
|
72
|
+
return set(), "legacy anchor retirement requires descriptor verification on this platform"
|
|
73
|
+
opened: set[tuple[int, int]] = set()
|
|
74
|
+
inspected = 0
|
|
75
|
+
try:
|
|
76
|
+
processes = list(Path("/proc").iterdir())
|
|
77
|
+
if len(processes) > 8192:
|
|
78
|
+
return opened, "process inspection limit exceeded"
|
|
79
|
+
for process in processes:
|
|
80
|
+
if not process.name.isdigit():
|
|
81
|
+
continue
|
|
82
|
+
try:
|
|
83
|
+
if process.stat().st_uid != os.getuid():
|
|
84
|
+
continue
|
|
85
|
+
for descriptor in (process / "fd").iterdir():
|
|
86
|
+
inspected += 1
|
|
87
|
+
if inspected > 50000:
|
|
88
|
+
return opened, "descriptor inspection limit exceeded"
|
|
89
|
+
try:
|
|
90
|
+
info = descriptor.stat()
|
|
91
|
+
identity = (info.st_dev, info.st_ino)
|
|
92
|
+
if identity in identities:
|
|
93
|
+
opened.add(identity)
|
|
94
|
+
except FileNotFoundError:
|
|
95
|
+
pass
|
|
96
|
+
except FileNotFoundError:
|
|
97
|
+
pass
|
|
98
|
+
except OSError:
|
|
99
|
+
return opened, "cannot completely inspect same-user open descriptors"
|
|
100
|
+
return opened, None
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def preview(root: Path, task: str | None = None) -> dict:
|
|
104
|
+
runtime = root / ".trellis/.runtime"
|
|
105
|
+
if runtime.resolve() != runtime.absolute():
|
|
106
|
+
raise ValueError("redirected runtime directory")
|
|
107
|
+
task_dir = resolve_task_dir(task, root) if task else None
|
|
108
|
+
if task and (task_dir is None or not is_within_tasks_dir(task_dir, root)):
|
|
109
|
+
raise ValueError("task scope must resolve to an existing native task")
|
|
110
|
+
task_path = task_dir.relative_to(root).as_posix() if task_dir else None
|
|
111
|
+
task_key = hashlib.sha256(task_path.encode()).hexdigest() if task_path else None
|
|
112
|
+
protocol = _protocol(root)
|
|
113
|
+
items: list[dict] = []
|
|
114
|
+
for family in ("sessions", "task-phase", "task-ownership", "continuity", ""):
|
|
115
|
+
directory = runtime / family
|
|
116
|
+
if not directory.exists():
|
|
117
|
+
continue
|
|
118
|
+
if directory.resolve() != directory.absolute() or not directory.is_dir():
|
|
119
|
+
raise ValueError("redirected or invalid runtime family")
|
|
120
|
+
paths = list(islice(directory.iterdir(), MAX_FILES + 1))
|
|
121
|
+
if len(paths) > MAX_FILES:
|
|
122
|
+
raise ValueError("runtime family scan limit exceeded; nothing may be removed")
|
|
123
|
+
for path in sorted(paths):
|
|
124
|
+
if family == "" and (task or not MARKER.fullmatch(path.name)):
|
|
125
|
+
continue
|
|
126
|
+
if family and path.suffix not in {".json", ".lock"}:
|
|
127
|
+
continue
|
|
128
|
+
if task_dir and not (family == "task-phase" and path.stem == task_dir.name or
|
|
129
|
+
family in {"continuity", "task-ownership"} and path.stem == task_key):
|
|
130
|
+
continue
|
|
131
|
+
if len(items) >= MAX_FILES:
|
|
132
|
+
raise ValueError("runtime preview limit exceeded; nothing may be removed")
|
|
133
|
+
item = {"path": path.relative_to(root).as_posix(), "family": family or "update-hint",
|
|
134
|
+
"eligible": False, "reason": "business record or unknown content"}
|
|
135
|
+
try:
|
|
136
|
+
fingerprint = _fingerprint(path)
|
|
137
|
+
item["fingerprint"] = fingerprint
|
|
138
|
+
if path.suffix == ".lock":
|
|
139
|
+
item["role"] = "retired-anchor"
|
|
140
|
+
if family in {"continuity", "task-ownership"}:
|
|
141
|
+
pattern = r"[0-9a-f]{64}"
|
|
142
|
+
elif family == "task-phase":
|
|
143
|
+
pattern = r"\d{2}-\d{2}-[A-Za-z0-9_.-]+"
|
|
144
|
+
else:
|
|
145
|
+
pattern = r"[A-Za-z0-9_.-]{1,128}"
|
|
146
|
+
known_name = bool(re.fullmatch(pattern, path.stem))
|
|
147
|
+
item["eligible"] = known_name and protocol["ready"] and path.read_bytes() in {b"", b"\0"}
|
|
148
|
+
item["reason"] = "native writers use the fixed layout anchor" if item["eligible"] else "writer protocol or anchor content is not verified"
|
|
149
|
+
elif family == "":
|
|
150
|
+
item["role"] = "obsolete-update-hint"
|
|
151
|
+
item["eligible"] = protocol["ready"] and path.read_bytes() == b"checked\n"
|
|
152
|
+
item["reason"] = "replaced by one version-pair record" if item["eligible"] else "unknown marker or old writer protocol"
|
|
153
|
+
elif family == "sessions":
|
|
154
|
+
data, _ = read_json_checked(path)
|
|
155
|
+
item["role"] = "session-projection"
|
|
156
|
+
item["eligible"] = (
|
|
157
|
+
data is not None and set(data) <= SESSION_KEYS
|
|
158
|
+
and data.get("current_task") in (None, "") and data.get("current_run") is None
|
|
159
|
+
and all(data.get(key) is None or isinstance(data[key], str) for key in ("platform", "last_seen_at"))
|
|
160
|
+
)
|
|
161
|
+
item["reason"] = "known empty business projection" if item["eligible"] else "task, run, unknown field or invalid record is retained"
|
|
162
|
+
else:
|
|
163
|
+
item["role"] = "control-evidence"
|
|
164
|
+
except (OSError, ValueError):
|
|
165
|
+
item["reason"] = "unreadable, redirected, nonregular or oversized object"
|
|
166
|
+
items.append(item)
|
|
167
|
+
anchors = {(i["fingerprint"]["device"], i["fingerprint"]["inode"])
|
|
168
|
+
for i in items if i.get("role") == "retired-anchor" and i["eligible"]}
|
|
169
|
+
opened, error = _open_anchors(anchors)
|
|
170
|
+
for item in items:
|
|
171
|
+
if item.get("role") != "retired-anchor" or not item["eligible"]:
|
|
172
|
+
continue
|
|
173
|
+
info = item["fingerprint"]
|
|
174
|
+
if error or (info["device"], info["inode"]) in opened:
|
|
175
|
+
item.update(eligible=False, reason=error or "an existing writer or waiter has the anchor open")
|
|
176
|
+
result = {"owner": "trellis-task", "scope": task_path or "project-runtime",
|
|
177
|
+
"writer_protocol": protocol, "items": items}
|
|
178
|
+
result["digest"] = hashlib.sha256(json.dumps(result, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
|
|
179
|
+
return result
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def cmd_runtime(args: argparse.Namespace) -> int:
|
|
183
|
+
root = get_repo_root()
|
|
184
|
+
with layout_lock(root):
|
|
185
|
+
require_settled_layout(root)
|
|
186
|
+
result = preview(root, args.dir)
|
|
187
|
+
result["dry_run"] = not bool(args.confirm)
|
|
188
|
+
result["removed"] = []
|
|
189
|
+
result["failed"] = []
|
|
190
|
+
if args.confirm:
|
|
191
|
+
if args.confirm != result["digest"]:
|
|
192
|
+
print(json.dumps({"status": "stale", "preview": result}, ensure_ascii=False))
|
|
193
|
+
return 1
|
|
194
|
+
for item in result["items"]:
|
|
195
|
+
if not item["eligible"]:
|
|
196
|
+
continue
|
|
197
|
+
path = root / item["path"]
|
|
198
|
+
try:
|
|
199
|
+
if _fingerprint(path) != item["fingerprint"]:
|
|
200
|
+
raise ValueError("object changed after confirmation")
|
|
201
|
+
if item["role"] == "retired-anchor":
|
|
202
|
+
info = item["fingerprint"]
|
|
203
|
+
opened, error = _open_anchors({(info["device"], info["inode"])})
|
|
204
|
+
if error or opened:
|
|
205
|
+
raise ValueError(error or "anchor became open")
|
|
206
|
+
path.unlink()
|
|
207
|
+
result["removed"].append(item["path"])
|
|
208
|
+
except (OSError, ValueError) as error:
|
|
209
|
+
result["failed"].append({"path": item["path"], "reason": str(error)})
|
|
210
|
+
print(json.dumps(result, ensure_ascii=False, sort_keys=True))
|
|
211
|
+
return 1 if result["failed"] else 0
|
|
@@ -25,7 +25,6 @@ from datetime import datetime
|
|
|
25
25
|
from pathlib import Path
|
|
26
26
|
|
|
27
27
|
from .config import (
|
|
28
|
-
get_codex_dispatch_mode,
|
|
29
28
|
get_packages,
|
|
30
29
|
is_monorepo,
|
|
31
30
|
resolve_package,
|
|
@@ -195,52 +194,6 @@ def _task_identity_change_allowed(repo_root: Path, task_dir: Path, data: dict) -
|
|
|
195
194
|
return True
|
|
196
195
|
|
|
197
196
|
|
|
198
|
-
# Sub-agent platform detection + JSONL context files
|
|
199
|
-
# =============================================================================
|
|
200
|
-
|
|
201
|
-
# Config directories of platforms that consume implement.jsonl / check.jsonl.
|
|
202
|
-
# Keep in sync with src/types/ai-tools.ts AI_TOOLS entries — these are the
|
|
203
|
-
# platforms listed in workflow.md's "agent-capable" Skill Routing block.
|
|
204
|
-
# Codex is checked separately because explicit inline mode does not consume
|
|
205
|
-
# JSONL. Kilo / Antigravity / Devin are NOT in this list either: they load
|
|
206
|
-
# specs through skills instead of JSONL.
|
|
207
|
-
_SUBAGENT_CONFIG_DIRS: tuple[str, ...] = (
|
|
208
|
-
".claude",
|
|
209
|
-
".cursor",
|
|
210
|
-
".kiro",
|
|
211
|
-
".gemini",
|
|
212
|
-
".opencode",
|
|
213
|
-
".qoder",
|
|
214
|
-
".codebuddy",
|
|
215
|
-
".factory", # Factory Droid
|
|
216
|
-
".github/copilot",
|
|
217
|
-
".pi", # Pi Agent
|
|
218
|
-
".trae", # Trae IDE
|
|
219
|
-
".omp", # Oh My Pi
|
|
220
|
-
".zcode", # ZCode
|
|
221
|
-
".grok", # Grok Build
|
|
222
|
-
".kimi-code", # Kimi Code
|
|
223
|
-
".dsh", # DeepSeek Harness
|
|
224
|
-
)
|
|
225
|
-
_CODEX_CONFIG_DIR = ".codex"
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
def _has_subagent_platform(repo_root: Path) -> bool:
|
|
229
|
-
"""Return True if any sub-agent-capable platform is configured.
|
|
230
|
-
|
|
231
|
-
Detected by probing well-known config directories at the repo root. Codex
|
|
232
|
-
counts by default through ``codex.dispatch_mode: auto`` (including the
|
|
233
|
-
legacy ``sub-agent`` alias); explicit inline mode loads context through
|
|
234
|
-
skills, not JSONL.
|
|
235
|
-
"""
|
|
236
|
-
for config_dir in _SUBAGENT_CONFIG_DIRS:
|
|
237
|
-
if (repo_root / config_dir).is_dir():
|
|
238
|
-
return True
|
|
239
|
-
if (repo_root / _CODEX_CONFIG_DIR).is_dir():
|
|
240
|
-
return get_codex_dispatch_mode(repo_root) == "auto"
|
|
241
|
-
return False
|
|
242
|
-
|
|
243
|
-
|
|
244
197
|
def _parse_meta_pairs(pairs: list[str] | None) -> dict[str, str] | None:
|
|
245
198
|
"""Parse repeatable ``--meta key=value`` pairs into a dict.
|
|
246
199
|
|
|
@@ -285,8 +238,8 @@ def _default_prd_content(title: str, description: str | None = None) -> str:
|
|
|
285
238
|
## Notes
|
|
286
239
|
|
|
287
240
|
- Keep `prd.md` focused on requirements, constraints, and acceptance criteria.
|
|
288
|
-
-
|
|
289
|
-
-
|
|
241
|
+
- Select the applicable native phase route; keep artifacts proportional to the task.
|
|
242
|
+
- Follow the current phase and its actual artifact references; files alone do not establish acceptance or implementation authority.
|
|
290
243
|
"""
|
|
291
244
|
|
|
292
245
|
|
|
@@ -580,21 +533,6 @@ def cmd_create(args: argparse.Namespace) -> int:
|
|
|
580
533
|
encoding="utf-8",
|
|
581
534
|
)
|
|
582
535
|
|
|
583
|
-
# Create empty implement.jsonl / check.jsonl for sub-agent-capable
|
|
584
|
-
# platforms. They stay empty until the agent curates real entries during
|
|
585
|
-
# planning — a placeholder row would read as unresolved scaffolding to
|
|
586
|
-
# `task.py validate` and to PR preflight, so the curation instructions go
|
|
587
|
-
# to the console below instead of into the files. Agent-less platforms
|
|
588
|
-
# (Kilo / Antigravity / Devin) skip this — they load specs via the
|
|
589
|
-
# trellis-before-dev skill instead of JSONL.
|
|
590
|
-
created_jsonl = False
|
|
591
|
-
if _has_subagent_platform(repo_root):
|
|
592
|
-
for jsonl_name in ("implement.jsonl", "check.jsonl"):
|
|
593
|
-
jsonl_path = task_dir / jsonl_name
|
|
594
|
-
if not jsonl_path.exists():
|
|
595
|
-
jsonl_path.write_text("", encoding="utf-8")
|
|
596
|
-
created_jsonl = True
|
|
597
|
-
|
|
598
536
|
# Establish the bidirectional link. Both sides were validated above, so a
|
|
599
537
|
# failure here is a write failure, not a bad argument.
|
|
600
538
|
if parent_dir is not None and parent_data is not None:
|
|
@@ -689,23 +627,9 @@ def cmd_create(args: argparse.Namespace) -> int:
|
|
|
689
627
|
print("", file=sys.stderr)
|
|
690
628
|
print(colored("Next steps:", Colors.BLUE), file=sys.stderr)
|
|
691
629
|
print(" - Fill prd.md with requirements and acceptance criteria", file=sys.stderr)
|
|
692
|
-
print(" -
|
|
693
|
-
print(" -
|
|
694
|
-
|
|
695
|
-
print(
|
|
696
|
-
" - Curate implement.jsonl / check.jsonl (created empty) as spec/research "
|
|
697
|
-
"manifests before task.py start when sub-agents need context:",
|
|
698
|
-
file=sys.stderr,
|
|
699
|
-
)
|
|
700
|
-
print(
|
|
701
|
-
' one JSON object per line — {"file": "<path>", "reason": "<why>"}; '
|
|
702
|
-
"spec/research docs only, no code paths",
|
|
703
|
-
file=sys.stderr,
|
|
704
|
-
)
|
|
705
|
-
print(
|
|
706
|
-
" list available specs: python3 .trellis/scripts/get_context.py --mode packages",
|
|
707
|
-
file=sys.stderr,
|
|
708
|
-
)
|
|
630
|
+
print(" - Select the applicable native phase route; keep artifacts proportional to the task", file=sys.stderr)
|
|
631
|
+
print(" - Follow actual phase artifacts and obtain implementation authorization before starting work", file=sys.stderr)
|
|
632
|
+
print(" - Add optional spec/research context with task.py add-context when needed", file=sys.stderr)
|
|
709
633
|
print(" - Use /trellis:continue or phase context to decide the next step", file=sys.stderr)
|
|
710
634
|
print("", file=sys.stderr)
|
|
711
635
|
|
|
@@ -1019,6 +943,11 @@ def cmd_rename(args: argparse.Namespace) -> int:
|
|
|
1019
943
|
print(colored(f"Error: Task not found: {args.name}", Colors.RED), file=sys.stderr)
|
|
1020
944
|
return 1
|
|
1021
945
|
|
|
946
|
+
from .worktree_delegation import runtime_path
|
|
947
|
+
if runtime_path(repo_root, task_dir.name).exists():
|
|
948
|
+
print("Error: preserve delegation identity; a task with delegation runtime cannot be renamed", file=sys.stderr)
|
|
949
|
+
return 1
|
|
950
|
+
|
|
1022
951
|
# Restrict renames to the prescribed status directory levels.
|
|
1023
952
|
if not is_within_tasks_dir(task_dir, repo_root):
|
|
1024
953
|
print(
|
|
@@ -1259,7 +1188,8 @@ def cmd_remove_subtask(args: argparse.Namespace) -> int:
|
|
|
1259
1188
|
|
|
1260
1189
|
if parent_data.get("status") != "cancelled":
|
|
1261
1190
|
from .task_workflow import _assert_delegated_record_closed
|
|
1262
|
-
|
|
1191
|
+
from .worktree_delegation import resolve_record
|
|
1192
|
+
_assert_delegated_record_closed(child_dir.name, resolve_record(repo_root, child_dir, child_data))
|
|
1263
1193
|
original_parent = json.loads(json.dumps(parent_data))
|
|
1264
1194
|
# Remove child from parent's children list
|
|
1265
1195
|
parent_children = _ensure_children_list(parent_data)
|