From 7fa00abce3ff800b4059fc1cd4f01bfd86fa6528 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:03:46 +0800 Subject: [PATCH 1/4] feat: require Git checkpoints for task versions --- hooks/README.md | 2 + hooks/archive | 2 + hooks/smoke-test | 17 +- hooks/task | 3 + hooks/test-version-baseline | 148 ++++++++++++++++++ hooks/version | 3 + hooks/version-baseline | 37 +++++ skills/taskflow/SKILL.md | 3 + skills/taskflow/references/runtime.md | 2 + .../references/versioning-and-recovery.md | 2 + 10 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 hooks/test-version-baseline create mode 100644 hooks/version-baseline diff --git a/hooks/README.md b/hooks/README.md index 64cf5b1..5205812 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -28,6 +28,7 @@ taskflow/hooks/ ├── task-id # the one rule for what is a legal task name; used by task/archive/reopen ├── approval-check # the one rule for whether a Plan's current version is approved ├── completion-gate # the one rule for what counts as an approved, finished Plan +├── version-baseline # verify each task version has a Git rollback point ├── task # explicit intake/promote/unpromote/state/progress/unaided/recover/complete edits ├── archive # full archive transaction (incl. Todo update) ├── version # atomic version transition (changed docs only) @@ -42,6 +43,7 @@ taskflow/hooks/ ├── run-hook.cmd # cross-platform launcher (polyglot batch/bash) ├── test-host-parity # synthetic host event and capability declaration fixture ├── smoke-test-windows.ps1 # Windows PowerShell/cmd lifecycle regression +├── test-version-baseline # real Git lifecycle regression fixture └── smoke-test # assert-style smoke tests ``` diff --git a/hooks/archive b/hooks/archive index 0f1806c..f1e58b4 100755 --- a/hooks/archive +++ b/hooks/archive @@ -42,6 +42,8 @@ grep -q '> Status: completed' "$docs/$task/plan.md" || { echo "plan.md not compl # enters the rollback path — the active directory, the Todo and the absent # achieved path are all untouched. bash "$HERE/completion-gate" "$docs/$task" || exit 1 +version="$(sed -n 's/^> Task version: //p' "$docs/$task/plan.md" | head -1)" +bash "$HERE/version-baseline" check "$root" "$task" "$version" || exit 1 todo="$docs/todo.md" [ -f "$todo" ] || { echo "todo.md missing; archive not started"; exit 1; } diff --git a/hooks/smoke-test b/hooks/smoke-test index eec36f1..7b9f320 100755 --- a/hooks/smoke-test +++ b/hooks/smoke-test @@ -29,6 +29,8 @@ if [ $# -eq 0 ]; then trap 'rm -rf "$tmp"' EXIT fi +bash "$HERE/test-version-baseline" "$tmp/version-baseline-fixture" + echo "== completion-gate decides the one shared answer ==" # `archive`, `task complete`, `task state in_progress` and `task progress` all # ask this file whether the Plan may be treated as approved/finished. Two copies @@ -1031,6 +1033,8 @@ EOF git add -A && git commit -qm base git worktree add -q .worktrees/tear-task -b chore/tear-task ) || { echo "FAIL teardown fixture worktree"; exit 1; } +bash "$HERE/version-baseline" init "$tear/.worktrees/tear-task" 2026-09-08-tear v1 +printf '.worktrees/\n' >> "$tear/.git/info/exclude" tear_out="$tmp/archive-teardown-out" bash "$HERE/archive" 2026-09-08-tear "$tear/.worktrees/tear-task" > "$tear_out" 2>&1 \ || { echo "FAIL archive in a linked worktree:"; cat "$tear_out"; exit 1; } @@ -1068,6 +1072,7 @@ cat >> "$tear/TaskFlowDocs/todo.md" <<'EOF' - Status: in_progress - Task: `TaskFlowDocs/2026-09-08-tear-base/` EOF +bash "$HERE/version-baseline" init "$tear" 2026-09-08-tear-base v1 tear_base_out="$tmp/archive-teardown-base-out" bash "$HERE/archive" 2026-09-08-tear-base "$tear" > "$tear_base_out" 2>&1 \ || { echo "FAIL archive from the main working tree:"; cat "$tear_base_out"; exit 1; } @@ -1115,6 +1120,7 @@ lcl_plan_body='# Sessions — local only ' # The record is written in the worktree, the way a session there would leave it. printf '%s' "$lcl_plan_body" > "$lcl_wt/TaskFlowDocs/$lcl_task/sessions.md" +bash "$HERE/version-baseline" init "$lcl_wt" "$lcl_task" v1 lcl_out="$tmp/archive-local-only-out" bash "$HERE/archive" "$lcl_task" "$lcl_wt" > "$lcl_out" 2>&1 \ || { echo "FAIL archive with a clone-local file:"; cat "$lcl_out"; exit 1; } @@ -1131,6 +1137,7 @@ git -C "$lcl" status --porcelain -- "TaskFlowDocs/achieved/$lcl_task" > "$tmp/lc && { echo "FAIL the carried copy showed up in the base checkout's git status:"; cat "$tmp/lcl.status"; exit 1; } # Nothing to carry means nothing said, and no empty directory left behind in the # base checkout on behalf of a file that does not exist. +git -C "$lcl_wt" add -A && git -C "$lcl_wt" commit -qm 'archive first fixture' lcl2_task=2026-09-08-nolocal mkdir -p "$lcl_wt/TaskFlowDocs/$lcl2_task" "$lcl/TaskFlowDocs/achieved" cat > "$lcl_wt/TaskFlowDocs/$lcl2_task/prd.md" <<'EOF' @@ -1145,6 +1152,7 @@ cat >> "$lcl_wt/TaskFlowDocs/todo.md" <<'EOF' - Status: in_progress - Task: `TaskFlowDocs/2026-09-08-nolocal/` EOF +bash "$HERE/version-baseline" init "$lcl_wt" "$lcl2_task" v1 lcl2_out="$tmp/archive-nolocal-out" bash "$HERE/archive" "$lcl2_task" "$lcl_wt" > "$lcl2_out" 2>&1 \ || { echo "FAIL archive without a clone-local file:"; cat "$lcl2_out"; exit 1; } @@ -1155,6 +1163,7 @@ grep -q 'archive note' "$lcl2_out" \ # A copy that cannot be written is reported and does not fail the archive: the # transaction is the directory move and the Todo entry, and a resume record is # neither. Nothing else in the output changes. +git -C "$lcl_wt" add -A && git -C "$lcl_wt" commit -qm 'archive second fixture' lcl3_task=2026-09-08-nocopy mkdir -p "$lcl_wt/TaskFlowDocs/$lcl3_task" cat > "$lcl_wt/TaskFlowDocs/$lcl3_task/prd.md" <<'EOF' @@ -1170,6 +1179,7 @@ cat >> "$lcl_wt/TaskFlowDocs/todo.md" <<'EOF' - Task: `TaskFlowDocs/2026-09-08-nocopy/` EOF printf 'x\n' > "$lcl_wt/TaskFlowDocs/$lcl3_task/sessions.md" +bash "$HERE/version-baseline" init "$lcl_wt" "$lcl3_task" v1 chmod a-w "$lcl/TaskFlowDocs/achieved" lcl3_out="$tmp/archive-nocopy-out" lcl3_rc=0 @@ -1479,6 +1489,7 @@ cp "$HERE/task" "$roll/task" cp "$HERE/task-id" "$roll/task-id" cp "$HERE/completion-gate" "$roll/completion-gate" cp "$HERE/approval-check" "$roll/approval-check" +cp "$HERE/version-baseline" "$roll/version-baseline" printf '%s\n' '#!/bin/sh' 'echo "archive stub: forced failure"' 'exit 1' > "$roll/archive" chmod +x "$roll/archive" "$roll/task-id" "$roll/completion-gate" "$roll/approval-check" "$roll/task" rf="$tmp/rollback-root" @@ -1757,6 +1768,7 @@ write_dirty_fixture "$vroot/TaskFlowDocs/2026-09-09-dirty" git add -A && git commit -q -m fixture ) || { echo "FAIL version fixture repository"; exit 1; } dirty="$vroot/TaskFlowDocs/2026-09-09-dirty" +bash "$HERE/version-baseline" init "$vroot" 2026-09-09-dirty v2 # The next version's content, written before the bump was taken: the case that # silently polluted old/v1 for 2026-09-15-no-python-hooks. printf '# PRD — Dirty\n> Task version: v2\n> Status: in_progress\n\n## Goal\n\nv3 CONTENT ALREADY WRITTEN\n' > "$dirty/prd.md" @@ -1781,7 +1793,9 @@ printf '# PRD — Dirty\n> Task version: v2\n> Status: in_progress\n\n## Goal\n\ ( cd "$uroot" || exit 1 git init -q . && git config user.email smoke@example.invalid && git config user.name smoke + git commit --allow-empty -qm baseline ) || { echo "FAIL untracked fixture repository"; exit 1; } +bash "$HERE/version-baseline" init "$uroot" 2026-09-09-untracked v2 bash "$HERE/version" 2026-09-09-untracked v3 "$uroot" prd.md >/dev/null || { echo "FAIL untracked document refused"; exit 1; } [ -f "$uroot/TaskFlowDocs/2026-09-09-untracked/old/v2/prd.md" ] || { echo "FAIL untracked document not archived"; exit 1; } @@ -2468,6 +2482,7 @@ for ef_ok in '## External Facts done # `promote` leaves the section unanswered, and an unanswered skeleton is refused. # This is the half that makes the field mandatory rather than merely available. +git -C "$ap" add -A && git -C "$ap" commit -qm 'record earlier approval fixtures' ap_new="$ap/TaskFlowDocs/2026-09-09-approve-skeleton" bash "$HERE/task" intake "Approve skeleton goal." "local fixture" --root "$ap" >/dev/null bash "$HERE/task" promote "$(awk '/^- ID: TF-/{id=$3} END{print id}' "$ap/TaskFlowDocs/todo.md")" \ @@ -8122,7 +8137,7 @@ echo "== a defect task has to name what investigates the cause ==" # — a check on how to investigate belongs to the capability, not to this repo. kd="$tmp/kind" mkdir -p "$kd/.worktrees/t" -( cd "$kd" && git init -q . ) >/dev/null 2>&1 || true +( cd "$kd" && git init -q . && git config user.email smoke@example.invalid && git config user.name smoke && git commit --allow-empty -qm baseline ) >/dev/null 2>&1 || true ( cd "$kd" && git worktree add .worktrees/t -b feature/kind >/dev/null 2>&1 ) || { echo "FAIL kind fixture worktree"; exit 1; } kdw="$kd/.worktrees/t" diff --git a/hooks/task b/hooks/task index f1c4ace..725d9e7 100755 --- a/hooks/task +++ b/hooks/task @@ -979,6 +979,7 @@ case "$command" in goal="$(run_task_awk "$todo" TASKFLOW_CMD=get TASKFLOW_ID="$todo_id" TASKFLOW_KEYS="Goal" \ TASKFLOW_NOTFOUND="Todo entry not found: $todo_id" | sed -n '2p')" + bash "$SCRIPT_DIR/version-baseline" init "$root" "$task" v1 || fail "Git baseline not established; promotion not started" mkdir -p "$base" { printf '%s\n' "# $title" @@ -2153,6 +2154,8 @@ STAGE_LINES # than the pipe buffer, so a 111 KB Plan with an unchecked item first in the # file was archived 15 times out of 15. See `completion-gate`. bash "$SCRIPT_DIR/completion-gate" "$base" || exit 1 + version="$(sed -n 's/^> Task version: //p' "$plan" | head -1)" + bash "$SCRIPT_DIR/version-baseline" check "$root" "$task" "$version" || exit 1 [ -e "$docs/achieved/$task" ] && fail "achieved/$task already exists" todo="$docs/todo.md" [ -f "$todo" ] || fail "todo.md missing; completion not started" diff --git a/hooks/test-version-baseline b/hooks/test-version-baseline new file mode 100644 index 0000000..f560650 --- /dev/null +++ b/hooks/test-version-baseline @@ -0,0 +1,148 @@ +#!/usr/bin/env bash +# Run with a new, dedicated directory; the fixture is retained for inspection. +set -euo pipefail +[ "$#" -eq 1 ] || { echo 'usage: test-version-baseline ' >&2; exit 1; } +fixture="$1" +[ ! -e "$fixture" ] || { echo 'fixture already exists' >&2; exit 1; } +mkdir -p "$fixture" +fixture="$(cd "$fixture" && pwd -P)" +HERE="$(cd "$(dirname "$0")" && pwd)" +check() { bash "$HERE/version-baseline" "$@"; } +reject() { if "$@"; then echo 'expected refusal' >&2; exit 1; fi; } +task=2026-11-12-fixture +git -C "$fixture" init -q +git -C "$fixture" config user.name 'Fixture Test' +git -C "$fixture" config user.email 'fixture@example.invalid' +printf 'initial\n' > "$fixture/code.txt" +git -C "$fixture" add code.txt +git -C "$fixture" commit -qm baseline +mkdir -p "$fixture/TaskFlowDocs/$task" +printf 'task only\n' > "$fixture/TaskFlowDocs/$task/plan.md" +printf 'todo\n' > "$fixture/TaskFlowDocs/todo.md" +check init "$fixture" "$task" v1 +check check "$fixture" "$task" v1 +printf 'changed\n' >> "$fixture/code.txt" +reject check check "$fixture" "$task" v1 +git -C "$fixture" add code.txt +reject check check "$fixture" "$task" v1 +git -C "$fixture" commit -qm code +check check "$fixture" "$task" v1 +printf 'outside task\n' > "$fixture/design with spaces.md" +reject check check "$fixture" "$task" v1 +git -C "$fixture" add 'design with spaces.md' +git -C "$fixture" commit -qm design +git -C "$fixture" mv 'design with spaces.md' 'design renamed.md' +reject check check "$fixture" "$task" v1 +git -C "$fixture" commit -qm rename +git -C "$fixture" rm --cached -q 'design renamed.md' +reject check check "$fixture" "$task" v1 +git -C "$fixture" add 'design renamed.md' +check init "$fixture" "$task" v2 +check check "$fixture" "$task" v2 +reject check check "$fixture" "$task" v3 +printf 'other task\n' > "$fixture/TaskFlowDocs/other-task.md" +reject check check "$fixture" "$task" v2 +git -C "$fixture" add TaskFlowDocs/other-task.md +git -C "$fixture" commit -qm other +printf '# PRD\n> Task version: v2\n> Status: in_progress\n' > "$fixture/TaskFlowDocs/$task/prd.md" +printf '# Plan\n> Task version: v2\n> Status: in_progress\n\n## Approval\n- Status: approved\n' > "$fixture/TaskFlowDocs/$task/plan.md" +printf 'new code\n' >> "$fixture/code.txt" +reject bash "$HERE/version" "$task" v3 "$fixture" prd.md +grep -q '^> Task version: v2$' "$fixture/TaskFlowDocs/$task/plan.md" +[ ! -e "$fixture/TaskFlowDocs/$task/old/v2" ] +git -C "$fixture" add code.txt +git -C "$fixture" commit -qm next-version +bash "$HERE/version" "$task" v3 "$fixture" prd.md +check check "$fixture" "$task" v3 +cat > "$fixture/TaskFlowDocs/$task/prd.md" <<'EOF' +# PRD +> Task version: v3 +> Status: completed +EOF +cat > "$fixture/TaskFlowDocs/$task/plan.md" <<'EOF' +# Plan +> Task version: v3 +> Status: completed + +## Approval +- Status: approved +- Approved by: user +- Approved at: 2026-11-12 00:00 +0800 +- Approved version: v3 +- Approved scope: PRD / Plan + +## Steps +### Step 1 — fixture +- Status: done +EOF +cat > "$fixture/TaskFlowDocs/todo.md" <> "$fixture/code.txt" +reject bash "$HERE/archive" "$task" "$fixture" +[ -d "$fixture/TaskFlowDocs/$task" ] +[ ! -e "$fixture/TaskFlowDocs/achieved/$task" ] +git -C "$fixture" add code.txt +git -C "$fixture" commit -qm archive-check +bash "$HERE/archive" "$task" "$fixture" +[ -d "$fixture/TaskFlowDocs/achieved/$task" ] +git -C "$fixture" add TaskFlowDocs +git -C "$fixture" commit -qm archived-fixture +task=2026-11-12-complete +mkdir -p "$fixture/TaskFlowDocs/$task" +cat > "$fixture/TaskFlowDocs/$task/prd.md" <<'EOF' +# PRD +> Task version: v1 +> Status: in_progress +EOF +cat > "$fixture/TaskFlowDocs/$task/plan.md" <<'EOF' +# Plan +> Task version: v1 +> Status: in_progress + +## Approval +- Status: approved +- Approved by: user +- Approved at: 2026-11-12 00:00 +0800 +- Approved version: v1 +- Approved scope: PRD / Plan + +## Steps +### Step 1 — fixture +- Status: done +EOF +cat > "$fixture/TaskFlowDocs/todo.md" <> "$fixture/code.txt" +reject bash "$HERE/task" complete "$task" --user-accepted --root "$fixture" +grep -q '^> Status: in_progress$' "$fixture/TaskFlowDocs/$task/plan.md" +[ -d "$fixture/TaskFlowDocs/$task" ] +git -C "$fixture" add code.txt +git -C "$fixture" commit -qm complete-check +bash "$HERE/task" complete "$task" --user-accepted --root "$fixture" +[ -d "$fixture/TaskFlowDocs/achieved/$task" ] +linked="${fixture}-linked" +git -C "$fixture" worktree add -q --detach "$linked" HEAD +reject check check "$linked" "$task" v1 +check init "$linked" "$task" v1 +printf 'unicode\n' > "$linked/测试 文件.txt" +reject check check "$linked" "$task" v1 +git -C "$linked" add '测试 文件.txt' +git -C "$linked" commit -qm unicode +check check "$linked" "$task" v1 +orphan="$(printf 'unrelated history\n' | git -C "$linked" commit-tree HEAD^{tree})" +git -C "$linked" update-ref HEAD "$orphan" +reject check check "$linked" "$task" v1 +printf 'PASS: real Git checkpoints, lifecycle and worktree isolation; fixtures retained at %s and %s\n' "$fixture" "$linked" diff --git a/hooks/version b/hooks/version index c3bb165..44f32c5 100755 --- a/hooks/version +++ b/hooks/version @@ -57,6 +57,9 @@ fi archdir="$docs/$task/old/$oldv" [ ! -e "$archdir" ] || { echo "archive already exists: $archdir"; exit 1; } +HERE="$(cd "$(dirname "$0")" && pwd)" +bash "$HERE/version-baseline" check "$root" "$task" "$oldv" || exit 1 +bash "$HERE/version-baseline" init "$root" "$task" "$newv" || exit 1 mkdir -p "$archdir" # version.md (always) diff --git a/hooks/version-baseline b/hooks/version-baseline new file mode 100644 index 0000000..a630f86 --- /dev/null +++ b/hooks/version-baseline @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# version-baseline — record and verify a task version's repository checkpoint. +set -euo pipefail +[ "$#" -eq 4 ] || { echo 'usage: version-baseline ' >&2; exit 1; } +action="$1"; root="$2"; task="$3"; version="$4" +HERE="$(cd "$(dirname "$0")" && pwd)" +bash "$HERE/task-id" "$task" || exit 1 +[[ "$version" =~ ^v[1-9][0-9]*$ ]] || { echo 'invalid task version' >&2; exit 1; } +case "$action" in init|check) ;; *) echo 'invalid baseline action' >&2; exit 1;; esac +# A non-Git task retains its existing lifecycle; an unreadable Git repository fails. +[ -e "$root/.git" ] || exit 0 +git_dir="$(git -C "$root" rev-parse --absolute-git-dir)" || { echo 'cannot locate Git metadata' >&2; exit 1; } +head="$(git -C "$root" rev-parse --verify HEAD^{commit})" || { echo 'Git HEAD is not a commit' >&2; exit 1; } +store="$git_dir/taskflow/version-baselines/$task" +file="$store/$version" +# Porcelain quotes unusual path names, so a newline in a file name is not lost. +status="$(git -C "$root" status --porcelain --untracked-files=all -- . ":(exclude,top)TaskFlowDocs/$task/**" ':(exclude,top)TaskFlowDocs/todo.md')" || { echo 'cannot inspect Git worktree' >&2; exit 1; } +if [ -n "$status" ]; then + printf 'repository changes must be committed before %s %s:\n%s\n' "$action" "$version" "$status" >&2 + exit 1 +fi +if [ "$action" = init ]; then + mkdir -p "$store" + if [ -e "$file" ]; then + existing="$(cat "$file")" + [ "$existing" = "$head" ] || { echo "baseline already exists for $task $version with a different HEAD" >&2; exit 1; } + else + (set -o noclobber; printf '%s\n' "$head" > "$file") || { echo "cannot record baseline for $task $version" >&2; exit 1; } + fi + exit 0 +fi +[ -f "$file" ] || { echo "missing Git baseline for $task $version; cannot verify this version" >&2; exit 1; } +base="$(cat "$file")" +[[ "$base" =~ ^[0-9a-f]{40,64}$ ]] || { echo "invalid Git baseline for $task $version" >&2; exit 1; } +git -C "$root" cat-file -e "$base^{commit}" 2>/dev/null || { echo "Git baseline is not an available commit: $base" >&2; exit 1; } +git -C "$root" merge-base --is-ancestor "$base" "$head" || { echo "Git baseline is not an ancestor of HEAD: $base" >&2; exit 1; } +printf 'Git version checkpoint: %s..%s (ignored files excluded)\n' "$base" "$head" diff --git a/skills/taskflow/SKILL.md b/skills/taskflow/SKILL.md index 6286ae4..c7fef52 100644 --- a/skills/taskflow/SKILL.md +++ b/skills/taskflow/SKILL.md @@ -320,6 +320,9 @@ When a merge or rebase you run hits a conflict, stop and put both sides in front After approval, read `prd.md`, `spec.md` if present, `reference/` if present, and `plan.md`. Implement one focused Step at a time. Keep changes within the PRD scope and current Spec contracts. Update `plan.md` after each meaningful Step and run its smallest useful check. +**Keep a Git rollback point for each Task version.** `task promote` records the starting commit for v1; `version` verifies the current version and records the next starting commit. Before a version transition, `task complete`, or direct `archive`, commit all changes outside this task's `TaskFlowDocs//` and `TaskFlowDocs/todo.md`. This includes README and other design files outside those two paths. A version with only those task records needs no empty commit. Commit earlier when the impact of a coherent change makes an additional rollback point useful. Never stage, commit, or delete another person's files merely to pass the check. The check includes staged, unstaged, and untracked non-ignored files; ignored files are outside its view. A missing baseline, missing commit, rewritten history, or unrelated uncommitted files blocks the transition and must be resolved without inventing a baseline or discarding work. The baseline is local to the task worktree; it does not prove authorship, preserve ignored files, or guarantee that a later squash or rebase retains the commit. Non-Git tasks retain the existing workflow. + + **A failure is fixed in the layer that owns it — never by making its output look right to whatever layer reads it next.** Adjusting an intermediate value, a serialized form, a fixture, an error message, or an assertion's input so a downstream check goes green is not a fix; it is a false claim that the layer below is correct, made in the one place nothing checks. This is goal deception, and it is prohibited however small the edit and however passing the suite afterwards. The reason is that a symptom's location and a failure's location are different facts. The check that goes red sits where the wrong value was *noticed*; the defect sits where it was *produced*. When the producing layer is not understood, the noticing layer is the only place that looks available, and editing what sits between them is the shortcut that appears to work. That is why the architecture sections of `spec.md` are required before a cross-layer change: they are what makes the producing layer findable. diff --git a/skills/taskflow/references/runtime.md b/skills/taskflow/references/runtime.md index fa75bd4..8e1ce94 100644 --- a/skills/taskflow/references/runtime.md +++ b/skills/taskflow/references/runtime.md @@ -391,6 +391,7 @@ repo-root/ ├── task-id # the one rule for a legal task name ├── approval-check # the one rule for whether a Plan's version is approved ├── completion-gate # the one rule for an approved, finished Plan + ├── version-baseline # verify each task version has a Git rollback point ├── task # explicit intake/promote/state/progress/unaided/complete ├── summarize-state # shared state-summary generator ├── archive # full archive transaction (incl. Todo update) @@ -405,6 +406,7 @@ repo-root/ ├── todo-check # no merge in a commit or rev range dropped a Todo entry ├── test-host-parity # synthetic host event and declaration fixture ├── smoke-test-windows.ps1 # PowerShell/cmd full lifecycle regression + ├── test-version-baseline # real Git lifecycle regression fixture └── smoke-test # assert-style smoke tests ``` diff --git a/skills/taskflow/references/versioning-and-recovery.md b/skills/taskflow/references/versioning-and-recovery.md index 997f45b..ca3d3c6 100644 --- a/skills/taskflow/references/versioning-and-recovery.md +++ b/skills/taskflow/references/versioning-and-recovery.md @@ -40,6 +40,8 @@ Create `old/vN/version.md` with: ## Git mode +`task promote` records the task version's starting Git commit in the current worktree. `version`, `task complete`, and direct `archive` verify that baseline and refuse outstanding changes outside the current task directory and `TaskFlowDocs/todo.md`; other repository documents count too. Make one or more focused commits as the change warrants before ending a version; do not make an empty commit for a version with only task-record changes. The baseline is local Git metadata: a lost baseline or rewritten history cannot be silently reconstructed, ignored files are not checked, and later squash or rebase may remove an individual commit. Do not stage or discard unrelated work to satisfy the check. + When task documents may be committed, record the exact start and end commits or commit range in `version.md`. Use Git diff/history to inspect mechanical edits. `old/vN/` only needs the semantic archive entry; do not duplicate the repository history. ## File mode From 1ddea08710c9a0c14b302221c195f20557b8040e Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:12:02 +0800 Subject: [PATCH 2/4] fix: detect hidden Git index changes --- hooks/test-version-baseline | 6 ++++++ hooks/version-baseline | 8 ++++++++ skills/taskflow/SKILL.md | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hooks/test-version-baseline b/hooks/test-version-baseline index f560650..b0f7bf7 100644 --- a/hooks/test-version-baseline +++ b/hooks/test-version-baseline @@ -21,12 +21,18 @@ printf 'task only\n' > "$fixture/TaskFlowDocs/$task/plan.md" printf 'todo\n' > "$fixture/TaskFlowDocs/todo.md" check init "$fixture" "$task" v1 check check "$fixture" "$task" v1 +git -C "$fixture" update-index --assume-unchanged code.txt printf 'changed\n' >> "$fixture/code.txt" reject check check "$fixture" "$task" v1 +git -C "$fixture" update-index --no-assume-unchanged code.txt +reject check check "$fixture" "$task" v1 git -C "$fixture" add code.txt reject check check "$fixture" "$task" v1 git -C "$fixture" commit -qm code check check "$fixture" "$task" v1 +git -C "$fixture" update-index --skip-worktree code.txt +reject check check "$fixture" "$task" v1 +git -C "$fixture" update-index --no-skip-worktree code.txt printf 'outside task\n' > "$fixture/design with spaces.md" reject check check "$fixture" "$task" v1 git -C "$fixture" add 'design with spaces.md' diff --git a/hooks/version-baseline b/hooks/version-baseline index a630f86..4065574 100644 --- a/hooks/version-baseline +++ b/hooks/version-baseline @@ -13,6 +13,14 @@ git_dir="$(git -C "$root" rev-parse --absolute-git-dir)" || { echo 'cannot locat head="$(git -C "$root" rev-parse --verify HEAD^{commit})" || { echo 'Git HEAD is not a commit' >&2; exit 1; } store="$git_dir/taskflow/version-baselines/$task" file="$store/$version" +# Git status omits assume-unchanged and skip-worktree files, so refuse those +# flags rather than silently treating a potentially modified file as clean. +tracked="$(git -C "$root" ls-files -v -- . ":(exclude,top)TaskFlowDocs/$task/**" ':(exclude,top)TaskFlowDocs/todo.md')" || { echo 'cannot inspect Git index' >&2; exit 1; } +hidden="$(printf '%s\n' "$tracked" | grep -E '^[a-zS] ' || true)" +if [ -n "$hidden" ]; then + printf 'Git index hides paths from status; inspect and clear their flags before %s %s:\n%s\n' "$action" "$version" "$hidden" >&2 + exit 1 +fi # Porcelain quotes unusual path names, so a newline in a file name is not lost. status="$(git -C "$root" status --porcelain --untracked-files=all -- . ":(exclude,top)TaskFlowDocs/$task/**" ':(exclude,top)TaskFlowDocs/todo.md')" || { echo 'cannot inspect Git worktree' >&2; exit 1; } if [ -n "$status" ]; then diff --git a/skills/taskflow/SKILL.md b/skills/taskflow/SKILL.md index c7fef52..7a26636 100644 --- a/skills/taskflow/SKILL.md +++ b/skills/taskflow/SKILL.md @@ -320,7 +320,7 @@ When a merge or rebase you run hits a conflict, stop and put both sides in front After approval, read `prd.md`, `spec.md` if present, `reference/` if present, and `plan.md`. Implement one focused Step at a time. Keep changes within the PRD scope and current Spec contracts. Update `plan.md` after each meaningful Step and run its smallest useful check. -**Keep a Git rollback point for each Task version.** `task promote` records the starting commit for v1; `version` verifies the current version and records the next starting commit. Before a version transition, `task complete`, or direct `archive`, commit all changes outside this task's `TaskFlowDocs//` and `TaskFlowDocs/todo.md`. This includes README and other design files outside those two paths. A version with only those task records needs no empty commit. Commit earlier when the impact of a coherent change makes an additional rollback point useful. Never stage, commit, or delete another person's files merely to pass the check. The check includes staged, unstaged, and untracked non-ignored files; ignored files are outside its view. A missing baseline, missing commit, rewritten history, or unrelated uncommitted files blocks the transition and must be resolved without inventing a baseline or discarding work. The baseline is local to the task worktree; it does not prove authorship, preserve ignored files, or guarantee that a later squash or rebase retains the commit. Non-Git tasks retain the existing workflow. +**Keep a Git rollback point for each Task version.** `task promote` records the starting commit for v1; `version` verifies the current version and records the next starting commit. Before a version transition, `task complete`, or direct `archive`, commit all changes outside this task's `TaskFlowDocs//` and `TaskFlowDocs/todo.md`. This includes README and other design files outside those two paths. A version with only those task records needs no empty commit. Commit earlier when the impact of a coherent change makes an additional rollback point useful. Never stage, commit, or delete another person's files merely to pass the check. The check includes staged, unstaged, and untracked non-ignored files; it refuses index flags that hide tracked changes, and ignored files are outside its view. A missing baseline, missing commit, rewritten history, or unrelated uncommitted files blocks the transition and must be resolved without inventing a baseline or discarding work. The baseline is local to the task worktree; it does not prove authorship, preserve ignored files, or guarantee that a later squash or rebase retains the commit. Non-Git tasks retain the existing workflow. **A failure is fixed in the layer that owns it — never by making its output look right to whatever layer reads it next.** Adjusting an intermediate value, a serialized form, a fixture, an error message, or an assertion's input so a downstream check goes green is not a fix; it is a false claim that the layer below is correct, made in the one place nothing checks. This is goal deception, and it is prohibited however small the edit and however passing the suite afterwards. From b3a90b7b6ddc9cf406d7f76c00d179870a30c815 Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:21:11 +0800 Subject: [PATCH 3/4] docs: record task version checkpoint verification --- .../2026-11-12-version-commits/plan.md | 107 ++++++++++++++++++ .../2026-11-12-version-commits/prd.md | 51 +++++++++ .../2026-11-12-version-commits/spec.md | 43 +++++++ TaskFlowDocs/todo.md | 14 +++ 4 files changed, 215 insertions(+) create mode 100644 TaskFlowDocs/2026-11-12-version-commits/plan.md create mode 100644 TaskFlowDocs/2026-11-12-version-commits/prd.md create mode 100644 TaskFlowDocs/2026-11-12-version-commits/spec.md diff --git a/TaskFlowDocs/2026-11-12-version-commits/plan.md b/TaskFlowDocs/2026-11-12-version-commits/plan.md new file mode 100644 index 0000000..ca67b8a --- /dev/null +++ b/TaskFlowDocs/2026-11-12-version-commits/plan.md @@ -0,0 +1,107 @@ +# Plan — 仓库代码版本提交与回退点 +> Task version: v1 +> Status: checking + +## Spec Pointers + +- `spec.md` + +## Reference Pointers + +- `skills/taskflow/references/versioning-and-recovery.md`:逻辑版本与 Git 历史的关系。 +- `hooks/task`、`hooks/version`、`hooks/archive`:版本起点与全部结束入口。 +- `CONTRIBUTING.md`、`CODE_STYLE.md` 和 `TaskFlowDocs/repository-docs/index.md`:独立工作树、提交及项目规则。 + +## Related Tasks + +- `TF-20261112-21a0ce`:能力选择与真实效果调查,独立实现与验收。 +- `TF-20261008-ca2fce`:长程任务兼容性待办,本任务不更改其状态。 + +## Skills / Tools Used + +- [PRD] Unaided — 根据用户决定界定仓库级需求;considered: requirements elicitation +- [Spec] Unaided — 对照现有生命周期入口和 Git 状态设计;considered: architecture and design +- [Plan] Unaided — 首次制定时自行拆解;considered: work breakdown +- [Test] Unaided — 设计真实 Git 场景;considered: testing strategy +- 复审时读取 `agent-skills:planning-and-task-breakdown`,按依赖和可验证性修订方案;首次阶段已登记 unaided,不将本次读取伪称宿主观察。 + +## Preconditions + +- 工作区:`D:/WorkSpace/Agent/TaskFlow/.worktrees/task-version-commits`,分支 `feature/task-version-commits`。 +- 用户明确批准本版本计划后才开始产品实现。 + +## Plan Review + +- Verdict: sound +- Coverage: PRD 关于仓库提交、纯任务记录及保守路径边界由 Step 1 覆盖;阶段性提交指导和恢复边界由 Step 2 覆盖;自动验证和不破坏用户文件由两步的真实 Git 验证覆盖。 +- Verifiability: 测试以实际 Git 提交、工作区与退出状态检查条件;包含提交前拒绝和提交后成功的对照,以及直接 archive 和失败后文档不变,避免仅凭字符串或标记通过。忽略文件与人为归属不可验证,作为限制而非保证。 +- Layer ownership: 版本基线与检查由生命周期脚本负责;现有 fixture 若因新基线契约改变,只在真正代表合法任务时补真实 Git 初始状态,绝不通过放宽检查让测试绿。 + +## Approval + +- Status: approved +- Approved by: user +- Approved at: 2026-11-12 16:05 +0800 +- Approved version: v1 +- Approved scope: PRD / Spec / Plan + +## Steps + +### Step 1 — 建立版本起点与 Git 检查 + +- Goal: 为各任务版本建立 Git 起点,并在升版、完成和直接归档前检查整个仓库。 +- Dependencies: 本计划获得用户批准。 +- Files: `hooks/task`、`hooks/version`、`hooks/archive`、共享 Git 检查脚本和现有 smoke tests。 +- Implementation checklist: + - [x] 实现独立 worktree 的任务版本基线、出错回滚与仓库状态检查。 + - [x] 将检查接入三个结束入口并保留纯任务记录免提交行为。 + - [x] 以真实 Git 仓库覆盖提交、有未提交内容、版本切换、缺失基线、路径边界和并行 worktree。 +- Acceptance: 当前任务记录以外的改动须在版本结束前提交;未提交、不可验证或已改写历史时不执行版本切换及归档,不更改用户文件。 +- Verification: 对真实 Git 场景运行定向自动测试,断言实际提交范围、文件内容与失败前后的状态;运行相关 smoke。 +- Rollback: 在任务分支回退本步骤提交。 +- Status: done + +### Step 2 — 规则和端到端复核 + +- Goal: 解释版本回退点和按影响增加提交的做法,明确用户数据、忽略文件和历史改写边界。 +- Dependencies: Step 1。 +- Files: `skills/taskflow/SKILL.md`、`skills/taskflow/references/versioning-and-recovery.md`、相关测试。 +- Implementation checklist: + - [x] 更新版本、提交、恢复和失败处理指导。 + - [x] 核对各入口及真实 Git 测试,运行适用项目检查并记录限制。 +- Acceptance: 工作流规则与实际检查一致;Git 未能证明的归属和远端留存不被表述为已保证。 +- Verification: 用户场景复核、针对性测试、项目规定的适用检查与差异审查。 +- Rollback: 回退本步骤提交。 +- Status: done + +## Checkpoints + +完成 Step 1 后核对失败不改用户文件;按变更影响创建聚焦提交。 + +## Verification / Review + +- 已在 `hooks/version-baseline` 实现任务版本 Git 起点与工作区检查,接入 `promote`、`version`、`complete` 和 `archive`;当前任务在首次改代码前记录 v1 起点 `b502679ef2b517376336891a5524824c106e2c64`。 +- 在 Git 元数据下保留真实仓库夹具:暂存、未暂存、未跟踪、其他任务文档、空格和中文路径、暂存删除、重命名、版本切换、直接归档、complete、worktree 隔离和非祖先历史均验证通过;每项拒绝均检查工作区或文档未被归档/升版。 +- `bash -n` 覆盖六个修改或新增的 shell 脚本;`python evals/runner.py` 通过 6 项离线检查;`git diff --check` 通过。使用已有 torch Python 环境并设置 `PYTHONUTF8=1` 后,Skill 校验通过;默认 Python 缺少 PyYAML,未安装依赖。 +- 用户同意清理测试自己新建的文件;在 WSL 私有内存挂载内移除 DAC 权限绕过能力后运行完整 `bash hooks/smoke-test`,结果 `ALL SMOKE PASSED`。该方式具备真实 Linux 不可写目录语义,Windows 专项子测试在前一轮单独通过;未运行 macOS CI。 +- 采用 `agent-skills:code-review-and-quality` 自审 Git 入口、基线失败和数据保护;尚未有独立审查或三平台 CI。 +- 审查中用真实 Git 夹具复现 `assume-unchanged` 会让已修改文件被普通状态检查漏掉;修复后拒绝隐藏索引路径,Windows 定向测试同时覆盖 `assume-unchanged` 与 `skip-worktree`,完整 Linux smoke 重跑 `ALL SMOKE PASSED`。 +- 代码提交 `7fa00ab` 与 `1ddea08`;实际任务运行 `hooks/version-baseline check . 2026-11-12-version-commits v1` 通过,报告从 `b502679` 到 `1ddea08` 的提交范围。 + +- PR 模板 `.github/pull_request_template.md`:Summary 说明版本回退点及未提交变更拒绝;TaskFlow traceability 对应本任务、hooks/skill 范围、`hkwuks/TaskFlow:main`;Verification 对应 Hooks CI、`git diff --check`、Skill 校验及本 Plan;Review boundaries 对应秘密、文件范围、远端/基线和已知限制。 +- 2026-11-12 只读核对 `origin` 为 `https://github.com/hkwuks/TaskFlow.git`,GitHub 默认分支 `main`,非 fork;`git ls-remote` 的 main 为 `b502679ef2b517376336891a5524824c106e2c64`,是当前任务分支祖先;远端状态会随时间变化。 +- 已审查工作树变更只涉及本任务记录及已提交的 hooks / skill 文件;测试使用虚构 Git 夹具,不纳入凭据或用户文件。忽略文件、旧任务基线缺失和本地基线丢失的限制已写入 `spec.md`。 + +## Change Log + +- 2026-11-12:用户明确检查整个仓库;复审补入可独立调用的 archive。 +- 2026-11-12:用户确认 TaskFlow 任务记录以外的仓库路径采用保守提交规则;明确工作树起点、不可恢复历史与忽略文件边界。 +- 2026-11-12:用户批准 v1;完成实现、定向 Git 验证和完整 Linux smoke,Windows 专项子测试通过;发现并修复 Git 隐藏索引标记绕过后重跑 smoke。 + +## Follow-ups + +无。 + +## Version History + +- v1 — ready,等待用户批准。 diff --git a/TaskFlowDocs/2026-11-12-version-commits/prd.md b/TaskFlowDocs/2026-11-12-version-commits/prd.md new file mode 100644 index 0000000..cb26c82 --- /dev/null +++ b/TaskFlowDocs/2026-11-12-version-commits/prd.md @@ -0,0 +1,51 @@ +# 仓库代码版本提交与回退点 +> Task version: v1 +> Status: checking + +## Goal + +保证 Git 仓库的每个有代码迭代的 TaskFlow 任务版本至少有一个包含该版本仓库改动的提交,以便溯源和回退;根据改动影响适时增加聚焦提交。 + +## Task Kind + +- Kind: capability + +## Background / Confirmed Facts + +现有版本工具仅检查选定任务文档,完成流程不检查仓库代码提交。用户明确检查范围是整个仓库,不是仅检查任务文档。 + +## Requirements + +- 对所有使用 Git 的 TaskFlow 开发任务,以任务版本作为最低检查边界。 +- 有仓库代码或运行配置等开发改动的版本,在进入下一版本或完成前至少有涵盖该版本改动的提交;任务文档提交不能单独充当代码提交。 +- 基于改动影响合理增加提交;不自动提交或推送,不纳入不属于任务的改动。 +- 当前任务目录与 Todo 的 TaskFlow 任务记录可免提交;仓库其他路径的改动(包括 README、配置及设计文档)均按用户确认的保守规则纳入检查。没有其他路径改动的版本无需空提交。检查无法确定时明确提示,不凭任务文档内容宣称代码已提交。 +- 检查整个仓库的已提交和未提交变更,包含暂存与未跟踪文件;保留已有用户文件和任务数据。 + +## Acceptance Criteria + +- 版本切换与任务完成路径能发现缺失代码提交或尚未提交的仓库开发改动,并在操作前阻止。 +- 已提交开发改动可通过;纯设计版本可通过;纯文档提交不能冒充代码提交。 +- 不依靠文件扩展名判断代码;对无法自动归属的变更提供清晰可核验的处理方式,不静默放行、不自动提交用户改动。 +- 自动化验证覆盖多版本、已提交和未提交文件、纯设计版本以及边界和失败场景。 + +## External Facts + +- Depends on external facts: no +- Why not: 任务生命周期由 `hooks/task`、`hooks/version` 和 `hooks/archive` 决定;提交边界由用户确定并以本地 Git 状态验证。 + +## In Scope + +仓库级版本回退点、阶段检查、工作流说明与测试。 + +## Out of Scope + +自动提交、推送、重写历史、对已有任务历史追溯补造提交。 + +## Risks / Deferred Items + +Git 本身不能自动判断改动归属或文件语义;需要明确基线和对不确定情况的可审计处理,不能将任意提交视为充分证据。 + +## Open Questions + +无。2026-11-12 用户确认仓库其他路径的设计文档也按保守规则要求提交。 diff --git a/TaskFlowDocs/2026-11-12-version-commits/spec.md b/TaskFlowDocs/2026-11-12-version-commits/spec.md new file mode 100644 index 0000000..d7205d3 --- /dev/null +++ b/TaskFlowDocs/2026-11-12-version-commits/spec.md @@ -0,0 +1,43 @@ +# Spec — 仓库代码版本提交与回退点 +> Task version: v1 + +## Objective and Success Criteria + +Git 任务的每个版本若修改当前任务记录以外的仓库路径,在升版或完成前必须将这些改动提交到该任务分支,形成可追溯的版本回退点。 + +## Architecture Boundaries and Responsibilities + +`hooks/task promote` 为 v1 建立版本起点;`hooks/version` 在修改文档前检查旧版本,并为新版本建立起点;`hooks/task complete` 与可独立调用的 `hooks/archive` 在改变状态或移动文件前检查。共享检查只读取 Git 状态和版本起点,不提交、推送或清理文件。 + +## Project Structure / Affected Files + +`hooks/task`、`hooks/version`、`hooks/archive`、共享检查脚本、现有 smoke tests、`skills/taskflow/SKILL.md` 和 `skills/taskflow/references/versioning-and-recovery.md`。 + +## Interfaces, Data Flow, and Contracts + +- 版本起点是该 worktree 的 Git HEAD 提交,按任务 ID 与版本保存在 worktree 独立的 Git 元数据中;不得在结束时用当前 HEAD 补造起点。v1 在 promote 时建立;升版先验证旧版本,再以当前 HEAD 建立新版本起点。失败时不得留下被误认为有效的半成品或修改用户代码。 +- 建立起点前,检查暂存、未暂存和未跟踪的非忽略文件;仅排除当前任务的 `TaskFlowDocs//` 与 `TaskFlowDocs/todo.md`。其他路径如已有未提交内容,列出并拒绝建立基线,不自动提交或删除。Git 忽略文件不纳入,须如实说明。 +- 结束或升版前验证基线存在、指向有效提交且为 HEAD 的祖先;检查该 worktree 暂存、未暂存及未跟踪的非忽略文件。当前任务目录和 Todo 以外有未提交变更则拒绝;若基线后存在涉及这些路径的提交,记录可回溯的提交范围;仅有任务记录变更可通过,无需空提交。 +- 必须检查整个仓库,不能按后缀判定代码。用户确认 TaskFlow 任务记录之外的 README 等设计文档也视作需要提交的改动;其他任务文件也不能作为本任务自动排除。 +- 文件路径含空格、中文、换行、重命名和删除时必须正确处理;不可将其他人的未提交文件加入提交。路径归属无法由 Git 自动证明,隔离分支与清晰提示是前提;不得声称排他归属已被机器证明。 +- 版本状态和文档在任一检查失败时保持原状。不存在有效基线、提交已被历史改写移除、Git 错误或存在不明未提交内容时拒绝并说明原因;不静默建立补造基线。非 Git 仓库按现行行为处理。 + +## Invariants and Compatibility + +基线按 worktree、任务、版本隔离;检查不修改 Git 用户内容。旧活动任务或丢失本机基线的任务没有可靠起点时明确阻止,不能伪造过去版本的提交;不引入自动兼容或绕过逻辑。Git 忽略文件不受保护,本地提交也不保证后续 squash/rebase 或远端仍保留同一提交点。 + +## Validation and Error Semantics + +以独立的真实 Git 仓库验证:仓库文件提交后通过;仅任务记录无需提交;非任务文档路径也要求提交;暂存、未暂存、未跟踪、重命名、删除、空格与中文路径正确判断;缺失基线、无祖先关系、版本切换、直接 archive 和失败不改状态;并行 worktree 互不串扰。断言 Git 内容和状态而非单纯匹配标记。 + +## Code and Test Constraints + +沿用 shell 和项目现有 smoke 测试,无新增依赖;不写自动提交或推送代码;跨平台处理 Git 路径及错误。 + +## Design Decisions and Alternatives + +用户选择将 TaskFlow 任务记录以外的仓库路径保守视为需要提交,避免不可靠的代码后缀推断。Git 可验证范围和内容,不能证明每个提交是否由该任务创造;不应把无关提交、忽略文件或远端留存视为已受保证。 + +## Open Questions + +无;如果实现验证显示无法可靠记录版本起点或保持失败无副作用,停止并重新设计。 diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index 022d8c9..ad50643 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -35,6 +35,20 @@ has an issue number or URL. +## 长程任务的每个代码迭代版本至少一次 Git 提交,并按改动影 + +- ID: TF-20261112-8dd98e +- Status: in_progress +- Priority: normal +- Owner: Unknown +- Source: user:2026-11-12 +- Kind: capability +- Added: 2026-11-12 +- Updated: 2026-11-12 +- Goal: 长程任务的每个代码迭代版本至少一次 Git 提交,并按改动影响适时增加提交,确保溯源和回退 +- Task: `TaskFlowDocs/2026-11-12-version-commits/` +- Next action: Complete PRD / Spec / Plan and request approval. + ## 在真实 GitHub PR 中验证已合并的文档跟进 CI 复用及失败回退 - ID: TF-20261110-8c4e24 From 234ad347926a6a287317807bd3f71b96ac5bfd7f Mon Sep 17 00:00:00 2001 From: hkwuks <25031515+hkwuks@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:27:09 +0800 Subject: [PATCH 4/4] docs: archive task version checkpoints --- .../2026-11-12-version-commits/plan.md | 3 ++- .../{ => achieved}/2026-11-12-version-commits/prd.md | 2 +- .../2026-11-12-version-commits/spec.md | 0 TaskFlowDocs/todo.md | 12 +++--------- 4 files changed, 6 insertions(+), 11 deletions(-) rename TaskFlowDocs/{ => achieved}/2026-11-12-version-commits/plan.md (96%) rename TaskFlowDocs/{ => achieved}/2026-11-12-version-commits/prd.md (99%) rename TaskFlowDocs/{ => achieved}/2026-11-12-version-commits/spec.md (100%) diff --git a/TaskFlowDocs/2026-11-12-version-commits/plan.md b/TaskFlowDocs/achieved/2026-11-12-version-commits/plan.md similarity index 96% rename from TaskFlowDocs/2026-11-12-version-commits/plan.md rename to TaskFlowDocs/achieved/2026-11-12-version-commits/plan.md index ca67b8a..8a397f1 100644 --- a/TaskFlowDocs/2026-11-12-version-commits/plan.md +++ b/TaskFlowDocs/achieved/2026-11-12-version-commits/plan.md @@ -1,6 +1,6 @@ # Plan — 仓库代码版本提交与回退点 > Task version: v1 -> Status: checking +> Status: completed ## Spec Pointers @@ -88,6 +88,7 @@ - 审查中用真实 Git 夹具复现 `assume-unchanged` 会让已修改文件被普通状态检查漏掉;修复后拒绝隐藏索引路径,Windows 定向测试同时覆盖 `assume-unchanged` 与 `skip-worktree`,完整 Linux smoke 重跑 `ALL SMOKE PASSED`。 - 代码提交 `7fa00ab` 与 `1ddea08`;实际任务运行 `hooks/version-baseline check . 2026-11-12-version-commits v1` 通过,报告从 `b502679` 到 `1ddea08` 的提交范围。 +- GitHub [Hooks CI](https://github.com/hkwuks/TaskFlow/actions/runs/43190832429) 在提交 `b3a90b7` 上通过 Ubuntu、macOS、Windows smoke、evals、Todo merge audit 和 CI 复用测试;release 按路径跳过。 - PR 模板 `.github/pull_request_template.md`:Summary 说明版本回退点及未提交变更拒绝;TaskFlow traceability 对应本任务、hooks/skill 范围、`hkwuks/TaskFlow:main`;Verification 对应 Hooks CI、`git diff --check`、Skill 校验及本 Plan;Review boundaries 对应秘密、文件范围、远端/基线和已知限制。 - 2026-11-12 只读核对 `origin` 为 `https://github.com/hkwuks/TaskFlow.git`,GitHub 默认分支 `main`,非 fork;`git ls-remote` 的 main 为 `b502679ef2b517376336891a5524824c106e2c64`,是当前任务分支祖先;远端状态会随时间变化。 - 已审查工作树变更只涉及本任务记录及已提交的 hooks / skill 文件;测试使用虚构 Git 夹具,不纳入凭据或用户文件。忽略文件、旧任务基线缺失和本地基线丢失的限制已写入 `spec.md`。 diff --git a/TaskFlowDocs/2026-11-12-version-commits/prd.md b/TaskFlowDocs/achieved/2026-11-12-version-commits/prd.md similarity index 99% rename from TaskFlowDocs/2026-11-12-version-commits/prd.md rename to TaskFlowDocs/achieved/2026-11-12-version-commits/prd.md index cb26c82..aa50048 100644 --- a/TaskFlowDocs/2026-11-12-version-commits/prd.md +++ b/TaskFlowDocs/achieved/2026-11-12-version-commits/prd.md @@ -1,6 +1,6 @@ # 仓库代码版本提交与回退点 > Task version: v1 -> Status: checking +> Status: completed ## Goal diff --git a/TaskFlowDocs/2026-11-12-version-commits/spec.md b/TaskFlowDocs/achieved/2026-11-12-version-commits/spec.md similarity index 100% rename from TaskFlowDocs/2026-11-12-version-commits/spec.md rename to TaskFlowDocs/achieved/2026-11-12-version-commits/spec.md diff --git a/TaskFlowDocs/todo.md b/TaskFlowDocs/todo.md index ad50643..95bb998 100644 --- a/TaskFlowDocs/todo.md +++ b/TaskFlowDocs/todo.md @@ -38,16 +38,10 @@ has an issue number or URL. ## 长程任务的每个代码迭代版本至少一次 Git 提交,并按改动影 - ID: TF-20261112-8dd98e -- Status: in_progress -- Priority: normal -- Owner: Unknown -- Source: user:2026-11-12 -- Kind: capability -- Added: 2026-11-12 -- Updated: 2026-11-12 +- Status: done - Goal: 长程任务的每个代码迭代版本至少一次 Git 提交,并按改动影响适时增加提交,确保溯源和回退 -- Task: `TaskFlowDocs/2026-11-12-version-commits/` -- Next action: Complete PRD / Spec / Plan and request approval. +- Task: `TaskFlowDocs/achieved/2026-11-12-version-commits/` +- Next action: None — completed and archived. ## 在真实 GitHub PR 中验证已合并的文档跟进 CI 复用及失败回退