| name | trellis-continue |
| description | Guru Team Trellis continue entry. Use to advance the current task through planning, implementation, commit, and Branch Review Gate before finish-work. |
Guru Team Trellis Continue
Resume through the canonical workflow, not by remembering ad hoc steps.
python3 ./.trellis/scripts/get_context.py
python3 ./.trellis/scripts/get_context.py --mode phase
Route by current task status and .trellis/workflow.md.
planning: apply the business-project Chinese documentation default from .trellis/workflow.md across .trellis/spec/**, .trellis/tasks/**, docs/**, 00-bootstrap-guidelines docs SSOT, and human-readable artifact fields; create or update the Docs SSOT Plan required by .trellis/workflow.md, and run the Middle-platform Knowledge Gate when relevant; if intake evidence is ambiguous, use trellis-brainstorm and update the GitHub issue comment/body or proposed issue body as appropriate. After prd.md, design.md, and implement.md exist, perform the planning artifact ambiguity review required by .trellis/workflow.md before presenting links, then confirm the repo root is the task worktree resolved from the current checkout, .trellis/.runtime/guru-team/**, and git worktree list with check-workspace-boundary.sh --json --task <task-path>, display clickable or absolute links to all three files, and explicitly state that implementation, trellis-implement dispatch, and phase2-check.json recording are blocked until the user confirms after seeing those links. Phase 0 handoff approval is not planning approval. Only after that post-planning confirmation may the main session record schema 1.2 planning-approval.json with passed ambiguity_review evidence, fixed-scope scanner hits[], empty unchecked_normative_hits[], and user_confirmation.source=explicit-post-planning-review, run check-planning-approval.sh --json, and then run task.py start.
in_progress: confirm knowledge-gate and the approved Docs SSOT Plan from artifacts; first rerun check-workspace-boundary.sh --json --task <task-path> and check-planning-approval.sh --json, and stop if either fails; in default sub-agent mode dispatch trellis-implement / channel implement and wait for its implementation handoff, then dispatch trellis-check / channel check; require the implementation handoff to name plan strategy, docs sync result, task delta merged to durable docs, task-history-only content, no-update or follow-up / PR limits, and durable-docs versus task-delta inputs; require the Phase 2 check report to verify durable docs / task artifacts / code/API/schema/config/deploy/test consistency by strategy before phase2-check.json; record assigned, progress/status-request, terminal, resume/replacement, and completed evidence for both roles through record-subagent-liveness-event.sh / check-subagent-liveness.sh; before every recorder/validator call, confirm all task artifact paths are task-worktree local; record and check phase2-check.json only after the completed trellis-check AI report, with the current pre-commit dirty_paths; reconcile specs/docs; then commit in Phase 3.4. The main session coordinates this path and must not directly implement, directly check, or treat validation command output as sub-agent evidence.
- after commit and before
finish-work: in default sub-agent mode dispatch an independent review sub-agent over the full diff from the intake base branch to HEAD; record review role/reuse/status decisions in agent-assignment.json, including Docs SSOT reconciliation evidence; write task-local {TASK_DIR}/reviews/*.md raw reports plus a final {TASK_DIR}/review.md rollup that links them. Before writing these artifacts or running review-branch.sh, rerun check-workspace-boundary.sh --json --task <task-path>. Both reports are human-readable task artifacts: use Chinese Markdown headings, Chinese field labels, and Chinese review narrative, with literal command/path/JSON/HEAD/API/code tokens left as-is when needed. Then record that review with Branch Review Gate. The review sub-agent verifies the approved Docs SSOT Plan, implementation handoff, phase2-check.json, durable docs, task artifacts, and full diff; it must not continue implementation, patch missing Phase 2 check work, or first merge durable docs. Current-scope Docs SSOT inconsistency is a blocking finding. Do not pass the gate from main-session self-review:
Before any planning, Phase 2, or Branch Review stop/completion reply, run:
.trellis/guru-team/scripts/bash/resolve-human-artifacts.sh --json --task <task-path>
Render a Markdown 产物 review 表 with only prd.md, design.md,
implement.md, review.md, and pr-body.md. Link only resolver rows with
exists=true; for missing files show the status without a Markdown link.
After Branch Review, the review.md row is the AI/human review report; raw
reviews/*.md reports are reached through review.md, not listed as default
table rows. Do not list JSON artifacts in the standard table.
If a user adds requirements, references another issue, or discovers new scope during the task, pause and follow .trellis/workflow.md Scope Change Gate before continuing implementation: recommend whether the change belongs in current close_issues, related_issues, or followup_issues / new issue, get user confirmation when classification is not explicit, update planning artifacts and issue-scope-ledger.json, and leave GitHub-visible issue evidence.
.trellis/guru-team/scripts/bash/review-branch.sh --json --pass \
--review-source independent-agent \
--reviewer "trellis-check-agent" \
--review-report ".trellis/tasks/<task>/review.md" \
--agent-assignment ".trellis/tasks/<task>/agent-assignment.json" \
--summary "中文审查结论" \
--evidence "已按 intake base 到 HEAD 的完整 diff 覆盖文档、代码、测试、Trellis artifacts、CI/CD、容器、K8s/Kustomize、数据库 migration、Makefile,并判断本次变更的部署影响及是否需要同步修改部署资产"
Use --finding 'P3|message|path' or --findings-file findings.json when review finds any current-scope issue. Any finding priority P0/P1/P2/P3 blocks Branch Review Gate and finish-work. Current-scope Docs SSOT inconsistency, missing Phase 2 docs merge, or a final diff that invalidates no_docs_update_needed is a finding, not an observation or follow-up. The findings recorder path still requires --review-source independent-agent, --review-report pointing at task-local review.md, and task-local --agent-assignment with a matching current-head review round/raw report digest; failed artifacts also record a prior independent review, not reviewer identity alone. Use --observation 'message|path' for non-blocking notes and --followup-candidate 'message|path' for out-of-scope future work; do not downgrade an actual defect to either category to pass the gate. If a review agent finds findings, close that finding through one explicit form: the same technical agent_id returns as 问题闭环审查代理 with findings_count: 0 and reuse_decision: reuse-for-closure; a different fresh closure agent whose technical agent_id has not appeared in any earlier review round is linked by reuse_decisions[] decision=new-agent with exact from_round, to_round, closure agent_id, reviewed head, and non-empty reason; or, if the finding owner failed, was interrupted, or became stale and cannot continue, record a replacement closure chain with predecessor status_events[] evidence and replacement-started predecessor_agent_id=<predecessor> predecessor_event_id=<failed|stale-assessed|terminated-unfinished event_id> replacement_reason=<terminal_failed_incomplete|max_progress_silence_exceeded|manual_or_platform_terminated_unfinished>, plus reuse_decisions[] decision=replace from_round/to_round, and a replacement closure round with findings_count: 0 / reuse_decision: replace. A closure round that still has findings becomes a new finding owner and must itself be closed before dispatching a fresh new 最终放行审查代理 for the full current HEAD diff. A passing gate must include zero findings, the fresh final review, --review-source independent-agent, a non-main-session --reviewer, a Chinese --summary, at least one concrete --evidence line, --review-report pointing at task-local review.md that links every raw report and uses Chinese rollup sections such as 审查轮次, 问题生命周期, 最终审查, 证据, 观察项, 后续候选, and 结论, plus task-local --agent-assignment so the recorder can validate raw review_reports[], closure-before-final, and final reviewer freshness. Raw {TASK_DIR}/reviews/*.md reports must likewise use Chinese titles, Chinese labels, Chinese findings/observations/follow-up candidate wording, Chinese deployment/safety and Docs SSOT judgments, and Chinese final conclusions. --reviewer is identity metadata only. review-branch.sh records and validates the prior independent review; it is not the reviewer. Independent review sub-agents review docs, code, tests, artifacts, and diffs as AI reviewers and must not continue implementation, fill missing Phase 2 check coverage, first merge durable docs, or run Guru Team recorder/validator extension scripts such as review-branch.sh, check-review-gate.sh, record-agent-assignment.sh, or record-*; the main session runs those scripts only after the review result exists. If independent Agent review is unavailable, stop with Branch Review Gate pending instead of writing a passing gate.
Sub-agent identity rule: logical_role is the Chinese Trellis role (实现代理, 阶段二检查代理, 问题发现审查代理, 问题闭环审查代理, 最终放行审查代理); agent_id is the technical identity; platform_nickname is display-only and never used for gate judgment. Any review agent that found findings, including a previous final reviewer that found a new issue, is a finding owner; any same-agent, fresh new-agent, or replacement reviewer used to close a finding is a closure agent. Neither a finding owner nor any closure agent may become final. The final passing review must be the last round, use a fresh new 最终放行审查代理 whose technical agent_id has not appeared in any earlier review round with findings_count: 0, reviewed_head equal to current HEAD, and reuse_decision: new-agent. Every --review-round record must include --review-round-report <task-local reviews/*.md> so the ledger stores raw report path/sha256/size/modified_at. Use record-agent-assignment.sh / check-agent-assignment.sh only as recorder/validator tools, not to decide agent reuse.
Sub-agent liveness rule: wait_agent, trellis channel wait, or equivalent timeout is only a wait-window result, not failure or acceptable partial-completion evidence. Do not stop a still-progressing sub-agent because total runtime is long. After dispatch, record assigned with record-subagent-liveness-event.sh, then run check-subagent-liveness.sh at progress_scan_interval=120s or the checker-provided next_wait_ms. max_progress_silence=180s is measured from progress_anchor_at; status-requested does not refresh that anchor or extend max_progress_silence_deadline_at. Non-machine-readable progress must be written by the main session to status_events[] before it becomes checker evidence. Only checker decision status_request_required authorizes one status request; after recording status-requested, immediately rerun checker and do not repeat the ping while pending. Only checker decision stale_allowed authorizes stale-assessed. After stale-assessed, do not resume or keep waiting for that predecessor; record terminated-unfinished termination_reason=stale_cutover termination_source_event_id=<stale-assessed.event_id>, then replacement assigned and replacement-started replacement_reason=max_progress_silence_exceeded in the same liveness handling turn. Manual/platform unfinished termination uses termination_reason=manual_or_platform_terminated_unfinished. Failed, unfinished, stale, or replacement partial output cannot support Phase 2 check or Branch Review Gate pass until a same-agent resume or replacement chain reaches completed.
task.py start is only a status transition; planning-approval.json is the start gate evidence. It must use schema 1.2, passed ambiguity_review evidence, fixed-scope scanner hits[], empty unchecked_normative_hits[], user_confirmation.source=explicit-post-planning-review, and matching hash/size/mtime metadata for prd.md, design.md, and implement.md; old schema/source, missing ambiguity evidence, or Phase 0 handoff confirmations fail closed. Before any implementation dispatch or phase2-check.json recording, rerun check-planning-approval.sh --json; freshness is based on the reviewed planning document content digests, so current HEAD or dirty-path drift alone does not require a new user review. phase2-check.json is the Guru Team artifact that freezes the completed trellis-check AI judgment and validation evidence; validation commands, record-phase2-check.sh, or check-phase2-check.sh do not replace complete trellis-check coverage. review-branch.sh validates that Phase 2 check evidence exists before recording Branch Review Gate and performs the post-commit audit: committed non-metadata task work after the Phase 2 recorded HEAD must be covered by phase2-check.json.dirty_paths, and the current working tree must not contain non-metadata dirty paths. Task-local Branch Review Gate / publish readiness metadata (issue-scope-ledger.json, pr-body.md, pr-readiness.json, agent-assignment.json, review.md, reviews/*.md, review-gate.json) may change after Phase 2 and is revalidated by gate or publish validators. Durable docs, .trellis/spec/, source, tests, schema, config, scripts, preset, overlay, CI/CD, deployment, migration, and Makefile drift after the gate must return to Phase 2/3; it is not metadata tail. Do not re-record Phase 2 after the task work commit just to make HEAD match; return to Phase 2 only when new non-metadata changes appear or evidence is invalid. Missing planning approval evidence, implementation handoff, Phase 2 check evidence, or review sub-agent evidence in default sub-agent mode fails closed unless explicit inline/self-exemption evidence exists.
Manual edit rule: all relative task artifact paths are relative to the task worktree. If the editor or patch tool cannot receive an explicit workdir, use an absolute path under the task worktree resolved from the current checkout, .trellis/.runtime/guru-team/**, and git worktree list. Do not write task artifacts or patches through source-checkout relative paths.
Do not stage/commit review.md, reviews/*.md, review-gate.json, handoff, journal, archive, or other Trellis metadata in trellis-continue. Do not push the branch, create a PR, call publish-pr, or invoke finish-work from trellis-continue. Stop after Branch Review Gate and wait for the user/session to explicitly invoke trellis-finish-work; that finish entrypoint commits remaining metadata-only changes and publishes after archive and journal succeed.