@blxzer/cursor-trellis 0.1.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 +45 -0
- package/LICENSE +235 -0
- package/README.md +9 -0
- package/bin/smart-search.js +79 -0
- package/bin/trellis.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +258 -0
- package/dist/cli/index.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 +474 -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 +244 -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 +246 -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 +344 -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/init.d.ts +62 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1656 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mem.d.ts +30 -0
- package/dist/commands/mem.d.ts.map +1 -0
- package/dist/commands/mem.js +424 -0
- package/dist/commands/mem.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 +27 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +339 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +80 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +2185 -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/workflow.d.ts +35 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +219 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/configurators/antigravity.d.ts +7 -0
- package/dist/configurators/antigravity.d.ts.map +1 -0
- package/dist/configurators/antigravity.js +19 -0
- package/dist/configurators/antigravity.js.map +1 -0
- package/dist/configurators/claude.d.ts +9 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +72 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/codebuddy.d.ts +10 -0
- package/dist/configurators/codebuddy.d.ts.map +1 -0
- package/dist/configurators/codebuddy.js +30 -0
- package/dist/configurators/codebuddy.js.map +1 -0
- package/dist/configurators/codex.d.ts +8 -0
- package/dist/configurators/codex.d.ts.map +1 -0
- package/dist/configurators/codex.js +87 -0
- package/dist/configurators/codex.js.map +1 -0
- package/dist/configurators/copilot.d.ts +10 -0
- package/dist/configurators/copilot.d.ts.map +1 -0
- package/dist/configurators/copilot.js +51 -0
- package/dist/configurators/copilot.js.map +1 -0
- package/dist/configurators/cursor.d.ts +20 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +49 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/cursor2plus-local.d.ts +6 -0
- package/dist/configurators/cursor2plus-local.d.ts.map +1 -0
- package/dist/configurators/cursor2plus-local.js +20 -0
- package/dist/configurators/cursor2plus-local.js.map +1 -0
- package/dist/configurators/droid.d.ts +10 -0
- package/dist/configurators/droid.d.ts.map +1 -0
- package/dist/configurators/droid.js +30 -0
- package/dist/configurators/droid.js.map +1 -0
- package/dist/configurators/gemini.d.ts +16 -0
- package/dist/configurators/gemini.d.ts.map +1 -0
- package/dist/configurators/gemini.js +38 -0
- package/dist/configurators/gemini.js.map +1 -0
- package/dist/configurators/index.d.ts +69 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +395 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/kilo.d.ts +7 -0
- package/dist/configurators/kilo.d.ts.map +1 -0
- package/dist/configurators/kilo.js +19 -0
- package/dist/configurators/kilo.js.map +1 -0
- package/dist/configurators/kiro.d.ts +8 -0
- package/dist/configurators/kiro.d.ts.map +1 -0
- package/dist/configurators/kiro.js +24 -0
- package/dist/configurators/kiro.js.map +1 -0
- package/dist/configurators/opencode.d.ts +14 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +96 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/pi.d.ts +3 -0
- package/dist/configurators/pi.d.ts.map +1 -0
- package/dist/configurators/pi.js +45 -0
- package/dist/configurators/pi.js.map +1 -0
- package/dist/configurators/qoder.d.ts +11 -0
- package/dist/configurators/qoder.d.ts.map +1 -0
- package/dist/configurators/qoder.js +31 -0
- package/dist/configurators/qoder.js.map +1 -0
- package/dist/configurators/shared.d.ts +183 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +557 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/windsurf.d.ts +7 -0
- package/dist/configurators/windsurf.d.ts.map +1 -0
- package/dist/configurators/windsurf.js +19 -0
- package/dist/configurators/windsurf.js.map +1 -0
- package/dist/configurators/workflow.d.ts +46 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +180 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +70 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +79 -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 +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -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/templates/claude/agents/trellis-check.md +124 -0
- package/dist/templates/claude/agents/trellis-implement.md +110 -0
- package/dist/templates/claude/agents/trellis-research.md +137 -0
- package/dist/templates/claude/index.d.ts +22 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +46 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +84 -0
- package/dist/templates/codebuddy/agents/trellis-check.md +115 -0
- package/dist/templates/codebuddy/agents/trellis-implement.md +110 -0
- package/dist/templates/codebuddy/agents/trellis-research.md +137 -0
- package/dist/templates/codebuddy/index.d.ts +15 -0
- package/dist/templates/codebuddy/index.d.ts.map +1 -0
- package/dist/templates/codebuddy/index.js +15 -0
- package/dist/templates/codebuddy/index.js.map +1 -0
- package/dist/templates/codebuddy/settings.json +70 -0
- package/dist/templates/codex/agents/trellis-check.toml +67 -0
- package/dist/templates/codex/agents/trellis-implement.toml +40 -0
- package/dist/templates/codex/agents/trellis-research.toml +73 -0
- package/dist/templates/codex/config.toml +28 -0
- package/dist/templates/codex/hooks/session-start.py +575 -0
- package/dist/templates/codex/hooks.json +15 -0
- package/dist/templates/codex/index.d.ts +39 -0
- package/dist/templates/codex/index.d.ts.map +1 -0
- package/dist/templates/codex/index.js +85 -0
- package/dist/templates/codex/index.js.map +1 -0
- package/dist/templates/codex/skills/before-dev/SKILL.md +40 -0
- package/dist/templates/codex/skills/brainstorm/SKILL.md +112 -0
- package/dist/templates/codex/skills/break-loop/SKILL.md +130 -0
- package/dist/templates/codex/skills/check/SKILL.md +98 -0
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +158 -0
- package/dist/templates/codex/skills/create-command/SKILL.md +101 -0
- package/dist/templates/codex/skills/finish-work/SKILL.md +90 -0
- package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +221 -0
- package/dist/templates/codex/skills/onboard/SKILL.md +363 -0
- package/dist/templates/codex/skills/record-session/SKILL.md +67 -0
- package/dist/templates/codex/skills/start/SKILL.md +66 -0
- package/dist/templates/codex/skills/update-spec/SKILL.md +335 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +388 -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 +337 -0
- package/dist/templates/common/bundled-skills/trellis-cursor2plus-setup/SKILL.md +62 -0
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +73 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +54 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +84 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +88 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +65 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +133 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +61 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +76 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +128 -0
- package/dist/templates/common/bundled-skills/trellis-micro-grill/SKILL.md +47 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/SKILL.md +44 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/authoring-rules.md +97 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/review-checklist.md +47 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/trellis-skill-locations.md +52 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +41 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +61 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +70 -0
- package/dist/templates/common/commands/continue.md +63 -0
- package/dist/templates/common/commands/finish-work.md +68 -0
- package/dist/templates/common/commands/start.md +69 -0
- package/dist/templates/common/index.d.ts +48 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +104 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/common/skills/before-dev.md +35 -0
- package/dist/templates/common/skills/brainstorm.md +164 -0
- package/dist/templates/common/skills/break-loop.md +125 -0
- package/dist/templates/common/skills/check.md +106 -0
- package/dist/templates/common/skills/update-spec.md +364 -0
- package/dist/templates/copilot/hooks/session-start.py +557 -0
- package/dist/templates/copilot/hooks.json +19 -0
- package/dist/templates/copilot/index.d.ts +23 -0
- package/dist/templates/copilot/index.d.ts.map +1 -0
- package/dist/templates/copilot/index.js +54 -0
- package/dist/templates/copilot/index.js.map +1 -0
- package/dist/templates/copilot/prompts/before-dev.prompt.md +39 -0
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +111 -0
- package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
- package/dist/templates/copilot/prompts/check.prompt.md +97 -0
- package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +99 -0
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
- package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
- package/dist/templates/copilot/prompts/parallel.prompt.md +204 -0
- package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
- package/dist/templates/copilot/prompts/start.prompt.md +63 -0
- package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
- package/dist/templates/cursor/agents/trellis-check.md +139 -0
- package/dist/templates/cursor/agents/trellis-implement.md +119 -0
- package/dist/templates/cursor/agents/trellis-research.md +147 -0
- package/dist/templates/cursor/commands/cursor2plus-setup.md +82 -0
- package/dist/templates/cursor/hooks.json +30 -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/trellis-triage.mdc +38 -0
- package/dist/templates/cursor/worktrees.json +11 -0
- package/dist/templates/droid/droids/trellis-check.md +107 -0
- package/dist/templates/droid/droids/trellis-implement.md +102 -0
- package/dist/templates/droid/droids/trellis-research.md +137 -0
- package/dist/templates/droid/index.d.ts +15 -0
- package/dist/templates/droid/index.d.ts.map +1 -0
- package/dist/templates/droid/index.js +15 -0
- package/dist/templates/droid/index.js.map +1 -0
- package/dist/templates/droid/settings.json +70 -0
- package/dist/templates/extract.d.ts +40 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +106 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/gemini/agents/trellis-check.md +107 -0
- package/dist/templates/gemini/agents/trellis-implement.md +102 -0
- package/dist/templates/gemini/agents/trellis-research.md +136 -0
- package/dist/templates/gemini/index.d.ts +13 -0
- package/dist/templates/gemini/index.d.ts.map +1 -0
- package/dist/templates/gemini/index.js +13 -0
- package/dist/templates/gemini/index.js.map +1 -0
- package/dist/templates/gemini/settings.json +28 -0
- package/dist/templates/kiro/agents/trellis-check.json +26 -0
- package/dist/templates/kiro/agents/trellis-implement.json +26 -0
- package/dist/templates/kiro/agents/trellis-research.json +30 -0
- package/dist/templates/kiro/index.d.ts +18 -0
- package/dist/templates/kiro/index.d.ts.map +1 -0
- package/dist/templates/kiro/index.js +18 -0
- package/dist/templates/kiro/index.js.map +1 -0
- package/dist/templates/markdown/agents.md +32 -0
- package/dist/templates/markdown/gitignore.txt +15 -0
- package/dist/templates/markdown/index.d.ts +30 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +55 -0
- package/dist/templates/markdown/index.js.map +1 -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 +223 -0
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +259 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +633 -0
- package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +65 -0
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +382 -0
- package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +76 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +101 -0
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +92 -0
- package/dist/templates/markdown/workspace-index.md +125 -0
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/dist/templates/opencode/agents/trellis-check.md +122 -0
- package/dist/templates/opencode/agents/trellis-implement.md +118 -0
- package/dist/templates/opencode/agents/trellis-research.md +145 -0
- package/dist/templates/opencode/lib/session-utils.js +667 -0
- package/dist/templates/opencode/lib/trellis-context.js +336 -0
- package/dist/templates/opencode/package.json +5 -0
- package/dist/templates/opencode/plugins/inject-subagent-context.js +495 -0
- package/dist/templates/opencode/plugins/inject-workflow-state.js +159 -0
- package/dist/templates/opencode/plugins/session-start.js +101 -0
- package/dist/templates/pi/agents/trellis-check.md +37 -0
- package/dist/templates/pi/agents/trellis-implement.md +42 -0
- package/dist/templates/pi/agents/trellis-research.md +25 -0
- package/dist/templates/pi/extensions/trellis/index.ts.txt +1600 -0
- package/dist/templates/pi/index.d.ts +5 -0
- package/dist/templates/pi/index.d.ts.map +1 -0
- package/dist/templates/pi/index.js +12 -0
- package/dist/templates/pi/index.js.map +1 -0
- package/dist/templates/pi/settings.json +12 -0
- package/dist/templates/qoder/agents/trellis-check.md +108 -0
- package/dist/templates/qoder/agents/trellis-implement.md +103 -0
- package/dist/templates/qoder/agents/trellis-research.md +137 -0
- package/dist/templates/qoder/index.d.ts +15 -0
- package/dist/templates/qoder/index.d.ts.map +1 -0
- package/dist/templates/qoder/index.js +15 -0
- package/dist/templates/qoder/index.js.map +1 -0
- package/dist/templates/qoder/settings.json +47 -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 +92 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/shared-hooks/inject-shell-session-context.py +183 -0
- package/dist/templates/shared-hooks/inject-subagent-context.py +774 -0
- package/dist/templates/shared-hooks/inject-workflow-state.py +366 -0
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +220 -0
- package/dist/templates/shared-hooks/session-start.py +873 -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/templates/trellis/config.yaml +132 -0
- package/dist/templates/trellis/gitignore.txt +39 -0
- package/dist/templates/trellis/index.d.ts +80 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +171 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/local/README.md +59 -0
- package/dist/templates/trellis/local/config.local.json.example +6 -0
- package/dist/templates/trellis/local/index.d.ts +7 -0
- package/dist/templates/trellis/local/index.d.ts.map +1 -0
- package/dist/templates/trellis/local/index.js +14 -0
- package/dist/templates/trellis/local/index.js.map +1 -0
- package/dist/templates/trellis/local/patch_wpelc8.py +297 -0
- package/dist/templates/trellis/local/subagent-models.json.example +4 -0
- package/dist/templates/trellis/local/trellis-task-models.json.example +10 -0
- package/dist/templates/trellis/local/trellis-task-models.json5.example +45 -0
- package/dist/templates/trellis/local/trellis_task_models_config.py +200 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +547 -0
- package/dist/templates/trellis/scripts/build_context_pack.py +12 -0
- package/dist/templates/trellis/scripts/build_retrieval_pack.py +12 -0
- package/dist/templates/trellis/scripts/common/__init__.py +103 -0
- package/dist/templates/trellis/scripts/common/active_task.py +607 -0
- package/dist/templates/trellis/scripts/common/artifact_search.py +587 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +811 -0
- package/dist/templates/trellis/scripts/common/cli_environment.py +155 -0
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +902 -0
- package/dist/templates/trellis/scripts/common/config.py +458 -0
- package/dist/templates/trellis/scripts/common/context_pack.py +371 -0
- package/dist/templates/trellis/scripts/common/developer.py +190 -0
- package/dist/templates/trellis/scripts/common/git.py +31 -0
- package/dist/templates/trellis/scripts/common/git_context.py +149 -0
- package/dist/templates/trellis/scripts/common/io.py +37 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +239 -0
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +691 -0
- package/dist/templates/trellis/scripts/common/paths.py +457 -0
- package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +889 -0
- package/dist/templates/trellis/scripts/common/retrieval_evidence.py +917 -0
- package/dist/templates/trellis/scripts/common/retrieval_pack.py +425 -0
- package/dist/templates/trellis/scripts/common/retrieval_pack_context.py +126 -0
- package/dist/templates/trellis/scripts/common/safe_commit.py +285 -0
- package/dist/templates/trellis/scripts/common/session_context.py +1159 -0
- package/dist/templates/trellis/scripts/common/session_memory.py +360 -0
- package/dist/templates/trellis/scripts/common/smart_search_evidence.py +479 -0
- package/dist/templates/trellis/scripts/common/smart_search_resolve.py +125 -0
- package/dist/templates/trellis/scripts/common/task_context.py +223 -0
- package/dist/templates/trellis/scripts/common/task_dashboard.py +140 -0
- package/dist/templates/trellis/scripts/common/task_gates.py +1735 -0
- package/dist/templates/trellis/scripts/common/task_map.py +586 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
- package/dist/templates/trellis/scripts/common/task_store.py +1533 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +274 -0
- package/dist/templates/trellis/scripts/common/tasks.py +231 -0
- package/dist/templates/trellis/scripts/common/test_retrieval_arbitration.py +333 -0
- package/dist/templates/trellis/scripts/common/trellis_config.py +131 -0
- package/dist/templates/trellis/scripts/common/types.py +110 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +212 -0
- package/dist/templates/trellis/scripts/get_context.py +17 -0
- package/dist/templates/trellis/scripts/get_developer.py +26 -0
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/templates/trellis/scripts/route_codebase_retrieval.py +77 -0
- package/dist/templates/trellis/scripts/run_smart_search.py +12 -0
- package/dist/templates/trellis/scripts/search_artifacts.py +13 -0
- package/dist/templates/trellis/scripts/search_memory.py +12 -0
- package/dist/templates/trellis/scripts/task.py +851 -0
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/tasks/templates/release-execution/design.md +61 -0
- package/dist/templates/trellis/tasks/templates/release-execution/handoff-template.md +29 -0
- package/dist/templates/trellis/tasks/templates/release-execution/implement.md +29 -0
- package/dist/templates/trellis/tasks/templates/release-execution/prd.md +31 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/design.md +50 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/handoff-template.md +39 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/implement.md +29 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/prd.md +31 -0
- package/dist/templates/trellis/workflow.md +960 -0
- package/dist/types/ai-tools.d.ts +106 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +294 -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/codebase-retrieval-router.d.ts +77 -0
- package/dist/utils/codebase-retrieval-router.d.ts.map +1 -0
- package/dist/utils/codebase-retrieval-router.js +767 -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/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +62 -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 +61 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -0
- package/dist/utils/manifest-prune.js +136 -0
- package/dist/utils/manifest-prune.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 +54 -0
- package/dist/utils/project-capabilities.d.ts.map +1 -0
- package/dist/utils/project-capabilities.js +515 -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 +20 -0
- package/dist/utils/readiness.d.ts.map +1 -0
- package/dist/utils/readiness.js +430 -0
- package/dist/utils/readiness.js.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts +162 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.js +288 -0
- package/dist/utils/retrieval-execution-telemetry.js.map +1 -0
- package/dist/utils/retrieval-result-ranking.d.ts +40 -0
- package/dist/utils/retrieval-result-ranking.d.ts.map +1 -0
- package/dist/utils/retrieval-result-ranking.js +162 -0
- package/dist/utils/retrieval-result-ranking.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 +334 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +66 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
- package/dist/utils/uninstall-scrubbers.js +342 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -0
- package/dist/utils/update-rollout-report.d.ts +137 -0
- package/dist/utils/update-rollout-report.d.ts.map +1 -0
- package/dist/utils/update-rollout-report.js +108 -0
- package/dist/utils/update-rollout-report.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 +137 -0
- package/scripts/postinstall.js +45 -0
- package/vendor/smart-search/LICENSE +21 -0
- package/vendor/smart-search/README.md +412 -0
- package/vendor/smart-search/README.zh-CN.md +430 -0
- package/vendor/smart-search/npm/bin/smart-search.js +63 -0
- package/vendor/smart-search/npm/scripts/postinstall.js +87 -0
- package/vendor/smart-search/npm/scripts/resolve-prerelease-version.js +108 -0
- package/vendor/smart-search/npm/scripts/set-package-version.js +35 -0
- package/vendor/smart-search/npm/scripts/sync-python-version.js +22 -0
- package/vendor/smart-search/npm/scripts/test-wrapper-repair.js +99 -0
- package/vendor/smart-search/npm/scripts/test.js +85 -0
- package/vendor/smart-search/package.json +42 -0
- package/vendor/smart-search/pyproject.toml +37 -0
- package/vendor/smart-search/skills/smart-search-cli/SKILL.md +387 -0
- package/vendor/smart-search/skills/smart-search-cli/agents/openai.yaml +3 -0
- package/vendor/smart-search/skills/smart-search-cli/examples/batch-search.md +98 -0
- package/vendor/smart-search/skills/smart-search-cli/examples/evidence-gathering.md +89 -0
- package/vendor/smart-search/skills/smart-search-cli/references/cli-contract.md +337 -0
- package/vendor/smart-search/src/smart_search/__init__.py +1 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/SKILL.md +387 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/agents/openai.yaml +3 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/batch-search.md +98 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/evidence-gathering.md +89 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/references/cli-contract.md +337 -0
- package/vendor/smart-search/src/smart_search/cli.py +2003 -0
- package/vendor/smart-search/src/smart_search/config.py +580 -0
- package/vendor/smart-search/src/smart_search/logger.py +43 -0
- package/vendor/smart-search/src/smart_search/providers/__init__.py +16 -0
- package/vendor/smart-search/src/smart_search/providers/base.py +41 -0
- package/vendor/smart-search/src/smart_search/providers/context7.py +141 -0
- package/vendor/smart-search/src/smart_search/providers/exa.py +206 -0
- package/vendor/smart-search/src/smart_search/providers/jina.py +136 -0
- package/vendor/smart-search/src/smart_search/providers/openai_compatible.py +370 -0
- package/vendor/smart-search/src/smart_search/providers/zhipu.py +143 -0
- package/vendor/smart-search/src/smart_search/service.py +2865 -0
- package/vendor/smart-search/src/smart_search/sources.py +429 -0
- package/vendor/smart-search/src/smart_search/utils.py +220 -0
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Parent/Child task-map helpers.
|
|
4
|
+
|
|
5
|
+
task-map.md is the Parent Supervisor's orchestration authority. This module
|
|
6
|
+
parses and writes only the small YAML frontmatter subset generated here.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from datetime import datetime, timezone
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
TASK_MAP = "task-map.md"
|
|
16
|
+
|
|
17
|
+
CHILD_STATES = {
|
|
18
|
+
"open",
|
|
19
|
+
"working",
|
|
20
|
+
"blocked",
|
|
21
|
+
"review",
|
|
22
|
+
"changes",
|
|
23
|
+
"accepted",
|
|
24
|
+
"integrating",
|
|
25
|
+
"integrated",
|
|
26
|
+
"cancelled",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
PARENT_TERMINAL_STATES = {"integrated", "cancelled"}
|
|
30
|
+
PARENT_CONTROLLED_STATES = {
|
|
31
|
+
"changes",
|
|
32
|
+
"accepted",
|
|
33
|
+
"integrating",
|
|
34
|
+
"integrated",
|
|
35
|
+
"cancelled",
|
|
36
|
+
}
|
|
37
|
+
CHILD_REPORT_STATES = CHILD_STATES - PARENT_CONTROLLED_STATES
|
|
38
|
+
REF_REQUIRED_STATES = {"accepted", "integrating", "integrated"}
|
|
39
|
+
HANDOFF_REQUIRED_STATES = {"accepted", "integrating", "integrated"}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def utc_now() -> str:
|
|
43
|
+
"""Return a compact UTC timestamp for task-map event log entries."""
|
|
44
|
+
return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace(
|
|
45
|
+
"+00:00", "Z"
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def load_task_map(parent_dir: Path) -> tuple[dict | None, str]:
|
|
50
|
+
"""Load task-map.md frontmatter and body."""
|
|
51
|
+
path = parent_dir / TASK_MAP
|
|
52
|
+
if not path.is_file():
|
|
53
|
+
return None, ""
|
|
54
|
+
|
|
55
|
+
try:
|
|
56
|
+
content = path.read_text(encoding="utf-8")
|
|
57
|
+
except OSError:
|
|
58
|
+
return None, ""
|
|
59
|
+
|
|
60
|
+
frontmatter, body = _split_frontmatter(content)
|
|
61
|
+
if frontmatter is None:
|
|
62
|
+
return None, content
|
|
63
|
+
return _parse_frontmatter(frontmatter), body
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def ensure_task_map(
|
|
67
|
+
parent_dir: Path,
|
|
68
|
+
parent_data: dict,
|
|
69
|
+
child_names: list[str],
|
|
70
|
+
event: str | None = None,
|
|
71
|
+
) -> dict:
|
|
72
|
+
"""Ensure task-map.md exists and contains entries for all child_names."""
|
|
73
|
+
data, body = load_task_map(parent_dir)
|
|
74
|
+
if data is None:
|
|
75
|
+
data = {
|
|
76
|
+
"parent_id": parent_data.get("id") or parent_dir.name,
|
|
77
|
+
"contract_epoch": 1,
|
|
78
|
+
"execution_topology": "serial",
|
|
79
|
+
"merge_limit": 1,
|
|
80
|
+
"children": [],
|
|
81
|
+
"integration_queue": [],
|
|
82
|
+
}
|
|
83
|
+
body = _default_body()
|
|
84
|
+
|
|
85
|
+
data.setdefault("parent_id", parent_data.get("id") or parent_dir.name)
|
|
86
|
+
data.setdefault("contract_epoch", 1)
|
|
87
|
+
data.setdefault("execution_topology", "serial")
|
|
88
|
+
data.setdefault("merge_limit", 1)
|
|
89
|
+
data.setdefault("children", [])
|
|
90
|
+
data.setdefault("integration_queue", [])
|
|
91
|
+
|
|
92
|
+
existing = {
|
|
93
|
+
child.get("id"): child
|
|
94
|
+
for child in data.get("children", [])
|
|
95
|
+
if isinstance(child, dict)
|
|
96
|
+
}
|
|
97
|
+
for child_name in child_names:
|
|
98
|
+
if child_name not in existing:
|
|
99
|
+
child = _default_child(child_name)
|
|
100
|
+
data["children"].append(child)
|
|
101
|
+
existing[child_name] = child
|
|
102
|
+
|
|
103
|
+
write_task_map(parent_dir, data, body, event)
|
|
104
|
+
return data
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def remove_child_from_task_map(
|
|
108
|
+
parent_dir: Path,
|
|
109
|
+
parent_data: dict,
|
|
110
|
+
child_name: str,
|
|
111
|
+
) -> None:
|
|
112
|
+
"""Remove a child entry from task-map.md when structural links are removed."""
|
|
113
|
+
data, body = load_task_map(parent_dir)
|
|
114
|
+
if data is None:
|
|
115
|
+
return
|
|
116
|
+
|
|
117
|
+
children = data.get("children")
|
|
118
|
+
if isinstance(children, list):
|
|
119
|
+
data["children"] = [
|
|
120
|
+
child
|
|
121
|
+
for child in children
|
|
122
|
+
if not isinstance(child, dict) or child.get("id") != child_name
|
|
123
|
+
]
|
|
124
|
+
data.setdefault("parent_id", parent_data.get("id") or parent_dir.name)
|
|
125
|
+
write_task_map(parent_dir, data, body, f"Unlinked Child `{child_name}`.")
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def set_child_state(
|
|
129
|
+
parent_dir: Path,
|
|
130
|
+
parent_data: dict,
|
|
131
|
+
child_name: str,
|
|
132
|
+
state: str,
|
|
133
|
+
evidence: str,
|
|
134
|
+
reason: str | None = None,
|
|
135
|
+
) -> tuple[bool, list[str]]:
|
|
136
|
+
"""Set a child state inside Parent task-map.md."""
|
|
137
|
+
errors: list[str] = []
|
|
138
|
+
if state not in CHILD_STATES:
|
|
139
|
+
errors.append(f"unknown child state: {state}")
|
|
140
|
+
if not _short_text(evidence):
|
|
141
|
+
errors.append("evidence must be a short reference")
|
|
142
|
+
if reason and not _short_text(reason, 500):
|
|
143
|
+
errors.append("reason must be short and single-line")
|
|
144
|
+
if errors:
|
|
145
|
+
return False, errors
|
|
146
|
+
|
|
147
|
+
structural_children = parent_data.get("children", [])
|
|
148
|
+
if child_name not in structural_children:
|
|
149
|
+
errors.append(f"child is not linked to parent: {child_name}")
|
|
150
|
+
return False, errors
|
|
151
|
+
|
|
152
|
+
data = ensure_task_map(parent_dir, parent_data, list(structural_children))
|
|
153
|
+
child = get_child_entry(data, child_name)
|
|
154
|
+
if child is None:
|
|
155
|
+
errors.append(f"child missing from task-map.md: {child_name}")
|
|
156
|
+
return False, errors
|
|
157
|
+
|
|
158
|
+
child["state"] = state
|
|
159
|
+
child["evidence"] = evidence
|
|
160
|
+
if reason:
|
|
161
|
+
child["reason"] = reason
|
|
162
|
+
|
|
163
|
+
event = f"Set Child `{child_name}` state to `{state}`. Evidence: {evidence}."
|
|
164
|
+
if reason:
|
|
165
|
+
event = f"{event} Reason: {reason}."
|
|
166
|
+
_, body = load_task_map(parent_dir)
|
|
167
|
+
write_task_map(parent_dir, data, body, event)
|
|
168
|
+
return True, []
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def validate_parent_child_integration(
|
|
172
|
+
parent_dir: Path,
|
|
173
|
+
parent_data: dict,
|
|
174
|
+
child_dir: Path,
|
|
175
|
+
child_data: dict,
|
|
176
|
+
state: str,
|
|
177
|
+
evidence: str,
|
|
178
|
+
ref: str | None = None,
|
|
179
|
+
reason: str | None = None,
|
|
180
|
+
) -> list[str]:
|
|
181
|
+
"""Validate a Parent-controlled Child integration state transition."""
|
|
182
|
+
errors: list[str] = []
|
|
183
|
+
child_name = child_dir.name
|
|
184
|
+
if state not in PARENT_CONTROLLED_STATES:
|
|
185
|
+
errors.append(f"state is not Parent-controlled: {state}")
|
|
186
|
+
if not _short_text(evidence):
|
|
187
|
+
errors.append("evidence must be a short reference")
|
|
188
|
+
if reason and not _short_text(reason, 500):
|
|
189
|
+
errors.append("reason must be short and single-line")
|
|
190
|
+
if state in {"changes", "cancelled"} and not reason:
|
|
191
|
+
errors.append(f"{state} requires --reason")
|
|
192
|
+
if state in REF_REQUIRED_STATES and not _short_text(ref):
|
|
193
|
+
errors.append(f"{state} requires --ref")
|
|
194
|
+
|
|
195
|
+
if child_data.get("parent") != parent_dir.name:
|
|
196
|
+
errors.append(f"child is not linked to parent: {child_name}")
|
|
197
|
+
|
|
198
|
+
structural_children = parent_data.get("children", [])
|
|
199
|
+
if child_name not in structural_children:
|
|
200
|
+
errors.append(f"child is not linked to parent: {child_name}")
|
|
201
|
+
|
|
202
|
+
data, _ = load_task_map(parent_dir)
|
|
203
|
+
if data is None:
|
|
204
|
+
errors.append(f"{TASK_MAP}")
|
|
205
|
+
return errors
|
|
206
|
+
|
|
207
|
+
child = get_child_entry(data, child_name)
|
|
208
|
+
if child is None:
|
|
209
|
+
errors.append(f"child missing from task-map.md: {child_name}")
|
|
210
|
+
return errors
|
|
211
|
+
|
|
212
|
+
current_state = child.get("state")
|
|
213
|
+
if state in {"accepted", "changes"} and current_state != "review":
|
|
214
|
+
errors.append(f"{state} requires current Child state 'review', got {current_state!r}")
|
|
215
|
+
if state == "integrating" and current_state != "accepted":
|
|
216
|
+
errors.append(f"integrating requires current Child state 'accepted', got {current_state!r}")
|
|
217
|
+
if state == "integrated" and current_state != "integrating":
|
|
218
|
+
errors.append(f"integrated requires current Child state 'integrating', got {current_state!r}")
|
|
219
|
+
|
|
220
|
+
if state in HANDOFF_REQUIRED_STATES:
|
|
221
|
+
errors.extend(_required_child_evidence(child_dir, ["verify.md", "handoff.md"]))
|
|
222
|
+
|
|
223
|
+
if state == "integrating":
|
|
224
|
+
merge_limit = data.get("merge_limit", 1)
|
|
225
|
+
if not isinstance(merge_limit, int) or merge_limit < 1:
|
|
226
|
+
errors.append("merge_limit must be a positive integer")
|
|
227
|
+
else:
|
|
228
|
+
integrating = [
|
|
229
|
+
item.get("id")
|
|
230
|
+
for item in data.get("children", [])
|
|
231
|
+
if isinstance(item, dict)
|
|
232
|
+
and item.get("id") != child_name
|
|
233
|
+
and item.get("state") == "integrating"
|
|
234
|
+
]
|
|
235
|
+
if len(integrating) >= merge_limit:
|
|
236
|
+
errors.append(
|
|
237
|
+
f"merge_limit {merge_limit} blocks integrating {child_name}; already integrating: {', '.join(str(item) for item in integrating)}"
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
return errors
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def set_parent_child_integration_state(
|
|
244
|
+
parent_dir: Path,
|
|
245
|
+
parent_data: dict,
|
|
246
|
+
child_dir: Path,
|
|
247
|
+
child_data: dict,
|
|
248
|
+
state: str,
|
|
249
|
+
evidence: str,
|
|
250
|
+
ref: str | None = None,
|
|
251
|
+
reason: str | None = None,
|
|
252
|
+
merge_ref: str | None = None,
|
|
253
|
+
) -> tuple[bool, list[str]]:
|
|
254
|
+
"""Set a Parent-controlled Child integration state."""
|
|
255
|
+
errors = validate_parent_child_integration(
|
|
256
|
+
parent_dir,
|
|
257
|
+
parent_data,
|
|
258
|
+
child_dir,
|
|
259
|
+
child_data,
|
|
260
|
+
state,
|
|
261
|
+
evidence,
|
|
262
|
+
ref,
|
|
263
|
+
reason,
|
|
264
|
+
)
|
|
265
|
+
if errors:
|
|
266
|
+
return False, errors
|
|
267
|
+
|
|
268
|
+
data = ensure_task_map(parent_dir, parent_data, list(parent_data.get("children", [])))
|
|
269
|
+
child = get_child_entry(data, child_dir.name)
|
|
270
|
+
if child is None:
|
|
271
|
+
return False, [f"child missing from task-map.md: {child_dir.name}"]
|
|
272
|
+
|
|
273
|
+
child["state"] = state
|
|
274
|
+
child["evidence"] = evidence
|
|
275
|
+
if ref:
|
|
276
|
+
child["ref"] = ref
|
|
277
|
+
if merge_ref:
|
|
278
|
+
child["merged_ref"] = merge_ref
|
|
279
|
+
if reason:
|
|
280
|
+
child["reason"] = reason
|
|
281
|
+
elif "reason" in child:
|
|
282
|
+
del child["reason"]
|
|
283
|
+
|
|
284
|
+
queue = data.get("integration_queue")
|
|
285
|
+
if not isinstance(queue, list):
|
|
286
|
+
queue = []
|
|
287
|
+
data["integration_queue"] = queue
|
|
288
|
+
if state == "integrating":
|
|
289
|
+
if child_dir.name not in queue:
|
|
290
|
+
queue.append(child_dir.name)
|
|
291
|
+
elif child_dir.name in queue:
|
|
292
|
+
data["integration_queue"] = [item for item in queue if item != child_dir.name]
|
|
293
|
+
|
|
294
|
+
event = f"Parent set Child `{child_dir.name}` integration state to `{state}`. Evidence: {evidence}."
|
|
295
|
+
if ref:
|
|
296
|
+
event = f"{event} Ref: {ref}."
|
|
297
|
+
if merge_ref:
|
|
298
|
+
event = f"{event} Merge executed: git merge --no-ff --no-commit {merge_ref}."
|
|
299
|
+
if reason:
|
|
300
|
+
event = f"{event} Reason: {reason}."
|
|
301
|
+
_, body = load_task_map(parent_dir)
|
|
302
|
+
write_task_map(parent_dir, data, body, event)
|
|
303
|
+
return True, []
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def record_child_worktree(
|
|
307
|
+
parent_dir: Path,
|
|
308
|
+
parent_data: dict,
|
|
309
|
+
child_name: str,
|
|
310
|
+
branch: str,
|
|
311
|
+
worktree_path: str,
|
|
312
|
+
base_ref: str,
|
|
313
|
+
) -> tuple[bool, list[str]]:
|
|
314
|
+
"""Record a Child git worktree checkout in Parent task-map.md."""
|
|
315
|
+
errors: list[str] = []
|
|
316
|
+
if not _short_text(branch):
|
|
317
|
+
errors.append("branch must be a short reference")
|
|
318
|
+
if not _short_text(worktree_path):
|
|
319
|
+
errors.append("worktree_path must be a short path reference")
|
|
320
|
+
if not _short_text(base_ref):
|
|
321
|
+
errors.append("base_ref must be a short reference")
|
|
322
|
+
|
|
323
|
+
structural_children = parent_data.get("children", [])
|
|
324
|
+
if child_name not in structural_children:
|
|
325
|
+
errors.append(f"child is not linked to parent: {child_name}")
|
|
326
|
+
if errors:
|
|
327
|
+
return False, errors
|
|
328
|
+
|
|
329
|
+
data = ensure_task_map(parent_dir, parent_data, list(structural_children))
|
|
330
|
+
child = get_child_entry(data, child_name)
|
|
331
|
+
if child is None:
|
|
332
|
+
return False, [f"child missing from task-map.md: {child_name}"]
|
|
333
|
+
|
|
334
|
+
child["isolation"] = "git-worktree"
|
|
335
|
+
child["branch"] = branch
|
|
336
|
+
child["worktree_path"] = worktree_path
|
|
337
|
+
child["base_ref"] = base_ref
|
|
338
|
+
child["ref"] = f"refs/heads/{branch}"
|
|
339
|
+
|
|
340
|
+
event = (
|
|
341
|
+
f"Prepared Child `{child_name}` git worktree. "
|
|
342
|
+
f"Branch: {branch}. Path: {worktree_path}. Base: {base_ref}."
|
|
343
|
+
)
|
|
344
|
+
_, body = load_task_map(parent_dir)
|
|
345
|
+
write_task_map(parent_dir, data, body, event)
|
|
346
|
+
return True, []
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
def get_child_entry(data: dict | None, child_name: str) -> dict | None:
|
|
350
|
+
"""Return a child map entry by id."""
|
|
351
|
+
if not data:
|
|
352
|
+
return None
|
|
353
|
+
children = data.get("children")
|
|
354
|
+
if not isinstance(children, list):
|
|
355
|
+
return None
|
|
356
|
+
for child in children:
|
|
357
|
+
if isinstance(child, dict) and child.get("id") == child_name:
|
|
358
|
+
return child
|
|
359
|
+
return None
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
def get_child_state(parent_dir: Path, child_name: str) -> str | None:
|
|
363
|
+
"""Return child state from a Parent task-map.md."""
|
|
364
|
+
data, _ = load_task_map(parent_dir)
|
|
365
|
+
child = get_child_entry(data, child_name)
|
|
366
|
+
if not child:
|
|
367
|
+
return None
|
|
368
|
+
state = child.get("state")
|
|
369
|
+
return state if isinstance(state, str) else None
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
def validate_parent_children_complete(parent_dir: Path, child_names: list[str]) -> list[str]:
|
|
373
|
+
"""Validate every structural child is integrated or cancelled."""
|
|
374
|
+
errors: list[str] = []
|
|
375
|
+
data, _ = load_task_map(parent_dir)
|
|
376
|
+
if data is None:
|
|
377
|
+
return [f"{TASK_MAP}"]
|
|
378
|
+
|
|
379
|
+
for child_name in child_names:
|
|
380
|
+
child = get_child_entry(data, child_name)
|
|
381
|
+
if child is None:
|
|
382
|
+
errors.append(f"{TASK_MAP} missing child entry: {child_name}")
|
|
383
|
+
continue
|
|
384
|
+
state = child.get("state")
|
|
385
|
+
if state not in PARENT_TERMINAL_STATES:
|
|
386
|
+
errors.append(
|
|
387
|
+
f"child {child_name} must be integrated or cancelled before parent archive, got {state!r}"
|
|
388
|
+
)
|
|
389
|
+
return errors
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
def validate_child_archive_state(parent_dir: Path, child_name: str) -> list[str]:
|
|
393
|
+
"""Validate the Parent has marked a Child terminal before child archive."""
|
|
394
|
+
state = get_child_state(parent_dir, child_name)
|
|
395
|
+
if state is None:
|
|
396
|
+
return [f"{TASK_MAP} missing child entry: {child_name}"]
|
|
397
|
+
if state not in PARENT_TERMINAL_STATES:
|
|
398
|
+
return [
|
|
399
|
+
f"Parent task-map.md must mark child {child_name} integrated or cancelled before archive, got {state!r}"
|
|
400
|
+
]
|
|
401
|
+
return []
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
def write_task_map(
|
|
405
|
+
parent_dir: Path,
|
|
406
|
+
data: dict,
|
|
407
|
+
body: str,
|
|
408
|
+
event: str | None = None,
|
|
409
|
+
) -> None:
|
|
410
|
+
"""Write task-map.md from structured snapshot and Markdown body."""
|
|
411
|
+
normalized_body = body if body.strip() else _default_body()
|
|
412
|
+
if event:
|
|
413
|
+
normalized_body = _append_event(normalized_body, event)
|
|
414
|
+
content = f"---\n{_format_frontmatter(data)}---\n{normalized_body.lstrip()}"
|
|
415
|
+
(parent_dir / TASK_MAP).write_text(content, encoding="utf-8")
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
def _default_child(child_name: str) -> dict:
|
|
419
|
+
return {
|
|
420
|
+
"id": child_name,
|
|
421
|
+
"state": "open",
|
|
422
|
+
"depends_on": [],
|
|
423
|
+
"touches": [],
|
|
424
|
+
"isolation": "git-worktree",
|
|
425
|
+
"ref": None,
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
def _default_body() -> str:
|
|
430
|
+
return (
|
|
431
|
+
"# Task Map\n\n"
|
|
432
|
+
"## Orchestration notes\n\n"
|
|
433
|
+
"- `execution_topology: parallel` — children with empty `depends_on` may run concurrently; "
|
|
434
|
+
"Parent integrates serially up to `merge_limit`.\n"
|
|
435
|
+
"- Child-reported states: `open` → `working` → `blocked` | `review`.\n"
|
|
436
|
+
"- Parent-controlled states: `review` → `changes` | `accepted` → `integrating` → "
|
|
437
|
+
"`integrated` | `cancelled`.\n"
|
|
438
|
+
"- Declare `touches` per child before dispatch to reduce merge conflicts.\n"
|
|
439
|
+
"- `isolation: git-worktree` — run `prepare-child-worktree` from the **git package root** "
|
|
440
|
+
"(not a non-git harness root).\n\n"
|
|
441
|
+
"## Event Log\n\n"
|
|
442
|
+
)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
def _append_event(body: str, event: str) -> str:
|
|
446
|
+
stripped = body.rstrip()
|
|
447
|
+
if "## Event Log" not in stripped:
|
|
448
|
+
stripped = f"{stripped}\n\n## Event Log"
|
|
449
|
+
return f"{stripped}\n\n- {utc_now()} - {event}\n"
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
def _split_frontmatter(content: str) -> tuple[str | None, str]:
|
|
453
|
+
lines = content.splitlines(keepends=True)
|
|
454
|
+
if not lines or lines[0].strip() != "---":
|
|
455
|
+
return None, content
|
|
456
|
+
|
|
457
|
+
for idx in range(1, len(lines)):
|
|
458
|
+
if lines[idx].strip() == "---":
|
|
459
|
+
frontmatter = "".join(lines[1:idx])
|
|
460
|
+
body = "".join(lines[idx + 1 :])
|
|
461
|
+
return frontmatter, body
|
|
462
|
+
return None, content
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
def _parse_frontmatter(frontmatter: str) -> dict:
|
|
466
|
+
data: dict = {"children": []}
|
|
467
|
+
current_child: dict | None = None
|
|
468
|
+
in_children = False
|
|
469
|
+
|
|
470
|
+
for raw_line in frontmatter.splitlines():
|
|
471
|
+
if not raw_line.strip():
|
|
472
|
+
continue
|
|
473
|
+
|
|
474
|
+
if raw_line.startswith("children:"):
|
|
475
|
+
in_children = True
|
|
476
|
+
data["children"] = []
|
|
477
|
+
current_child = None
|
|
478
|
+
continue
|
|
479
|
+
|
|
480
|
+
if in_children and raw_line.startswith(" - "):
|
|
481
|
+
current_child = {}
|
|
482
|
+
data["children"].append(current_child)
|
|
483
|
+
item = raw_line[4:].strip()
|
|
484
|
+
if ":" in item:
|
|
485
|
+
key, value = item.split(":", 1)
|
|
486
|
+
current_child[key.strip()] = _parse_value(value.strip())
|
|
487
|
+
continue
|
|
488
|
+
|
|
489
|
+
if in_children and raw_line.startswith(" ") and current_child is not None:
|
|
490
|
+
item = raw_line.strip()
|
|
491
|
+
if ":" in item:
|
|
492
|
+
key, value = item.split(":", 1)
|
|
493
|
+
current_child[key.strip()] = _parse_value(value.strip())
|
|
494
|
+
continue
|
|
495
|
+
|
|
496
|
+
in_children = False
|
|
497
|
+
if ":" in raw_line:
|
|
498
|
+
key, value = raw_line.split(":", 1)
|
|
499
|
+
data[key.strip()] = _parse_value(value.strip())
|
|
500
|
+
|
|
501
|
+
return data
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
def _parse_value(value: str):
|
|
505
|
+
if value == "null":
|
|
506
|
+
return None
|
|
507
|
+
if value == "[]":
|
|
508
|
+
return []
|
|
509
|
+
if value.startswith("[") and value.endswith("]"):
|
|
510
|
+
inner = value[1:-1].strip()
|
|
511
|
+
if not inner:
|
|
512
|
+
return []
|
|
513
|
+
return [item.strip().strip("'\"") for item in inner.split(",") if item.strip()]
|
|
514
|
+
if value.isdigit():
|
|
515
|
+
return int(value)
|
|
516
|
+
return value.strip("'\"")
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def _format_frontmatter(data: dict) -> str:
|
|
520
|
+
lines = [
|
|
521
|
+
f"parent_id: {_format_value(data.get('parent_id'))}",
|
|
522
|
+
f"contract_epoch: {_format_value(data.get('contract_epoch', 1))}",
|
|
523
|
+
f"execution_topology: {_format_value(data.get('execution_topology', 'serial'))}",
|
|
524
|
+
f"merge_limit: {_format_value(data.get('merge_limit', 1))}",
|
|
525
|
+
"children:",
|
|
526
|
+
]
|
|
527
|
+
children = data.get("children", [])
|
|
528
|
+
if isinstance(children, list):
|
|
529
|
+
for child in children:
|
|
530
|
+
if not isinstance(child, dict):
|
|
531
|
+
continue
|
|
532
|
+
lines.append(f" - id: {_format_value(child.get('id'))}")
|
|
533
|
+
lines.append(f" state: {_format_value(child.get('state', 'open'))}")
|
|
534
|
+
lines.append(f" depends_on: {_format_value(child.get('depends_on', []))}")
|
|
535
|
+
lines.append(f" touches: {_format_value(child.get('touches', []))}")
|
|
536
|
+
lines.append(f" isolation: {_format_value(child.get('isolation', 'git-worktree'))}")
|
|
537
|
+
lines.append(f" ref: {_format_value(child.get('ref'))}")
|
|
538
|
+
if child.get("branch"):
|
|
539
|
+
lines.append(f" branch: {_format_value(child.get('branch'))}")
|
|
540
|
+
if child.get("worktree_path"):
|
|
541
|
+
lines.append(f" worktree_path: {_format_value(child.get('worktree_path'))}")
|
|
542
|
+
if child.get("base_ref"):
|
|
543
|
+
lines.append(f" base_ref: {_format_value(child.get('base_ref'))}")
|
|
544
|
+
if child.get("merged_ref"):
|
|
545
|
+
lines.append(f" merged_ref: {_format_value(child.get('merged_ref'))}")
|
|
546
|
+
if child.get("evidence"):
|
|
547
|
+
lines.append(f" evidence: {_format_value(child.get('evidence'))}")
|
|
548
|
+
if child.get("reason"):
|
|
549
|
+
lines.append(f" reason: {_format_value(child.get('reason'))}")
|
|
550
|
+
lines.append(f"integration_queue: {_format_value(data.get('integration_queue', []))}")
|
|
551
|
+
return "\n".join(lines) + "\n"
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
def _format_value(value) -> str:
|
|
555
|
+
if value is None:
|
|
556
|
+
return "null"
|
|
557
|
+
if isinstance(value, list):
|
|
558
|
+
if not value:
|
|
559
|
+
return "[]"
|
|
560
|
+
return "[" + ", ".join(str(item) for item in value) + "]"
|
|
561
|
+
return str(value)
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
def _short_text(value: str | None, max_len: int = 240) -> bool:
|
|
565
|
+
if not value or not isinstance(value, str):
|
|
566
|
+
return False
|
|
567
|
+
if len(value) > max_len:
|
|
568
|
+
return False
|
|
569
|
+
if "\n" in value or "\r" in value:
|
|
570
|
+
return False
|
|
571
|
+
return True
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
def _required_child_evidence(child_dir: Path, names: list[str]) -> list[str]:
|
|
575
|
+
errors: list[str] = []
|
|
576
|
+
for name in names:
|
|
577
|
+
path = child_dir / name
|
|
578
|
+
if not path.is_file():
|
|
579
|
+
errors.append(name)
|
|
580
|
+
continue
|
|
581
|
+
try:
|
|
582
|
+
if not path.read_text(encoding="utf-8").strip():
|
|
583
|
+
errors.append(f"{name} is empty")
|
|
584
|
+
except OSError:
|
|
585
|
+
errors.append(f"{name} could not be read")
|
|
586
|
+
return errors
|