Commit Graph
16 Commits
Author SHA1 Message Date
weichen f4eeba1733 Detect squash-merged PRs when closing task cards
Why: card_merge only recognized "Merge ... from <branch> into main"
merge commits, so a PR landed as a squash (real case: #457) left its
task card in .task/ forever; task-close reported nothing to close and
precheck showed no debt. Closing required a manual backfill (PR #541).

Evidence: card_merge now returns sha|subject|pr and falls back to a
Gitea API lookup by head ref or label (deleted branches keep the
original name only in label), gated by merge_commit_sha ancestry in
origin/main; precheck [cards] reuses card_merge so both surfaces agree.
Live probe against production Gitea returns 226a4af15791|Reset
per-service runtime state in svc.sh env_config|457 for
feature/svc-pidcheck-leak; stub-server tests cover squash landing,
decoy skip and the not-on-main refusal; full governance suite follows
in-card evidence.

Impact: scripts/task.sh close and precheck detect squash-merged cards
when GITEA_TOKEN is set (merge-commit path unchanged without token);
tests/test_task.py adds two regressions; no protocol change for
existing merge-commit closures beyond the appended pr field.

Refs: card-merge-misses-squash-merges (memory); PR #541 manual closure.
2026-10-14 07:53:52 +00:00
weichen 3b0e100fba Fix facts registry commands and make precheck parsing escape-aware
ci / svc-realcombo (pull_request) Successful in 1m59s
ci / test (pull_request) Successful in 5m13s
ci / test-pg (pull_request) Successful in 8m6s
Why: F2 token extraction predates the two-section (HOME/IMC) layout of
~/.secrets/gitea so it concatenated both tokens and always failed; F6
registered a grep BRE alternation that facts-verify unescapes into a
literal pipe, failing re-verification and misaligning precheck's naive
pipe split into a spurious F6 date-format expiry warning, while both
underlying facts still hold.

Evidence: make facts-verify now 6/6 PASS with last_verified refreshed
to 2026-10-14; new regression test for escaped pipes in facts rows;
full governance suite 342 tests OK (18 skipped); precheck [facts] line
reports all facts fresh on the fixed parser.

Impact: policy/facts.md F2 (HOME-section awk extraction) and F6
(negated pipe-free grep); scripts/task.sh precheck neutralizes escaped
pipes the same way facts-verify does; tests/test_task.py covers it.

Refs: precheck WARN 过期事实 F6(日期格式); AGENTS.md 证据与验证门禁.
2026-10-14 06:13:51 +00:00
weichen deff43ae59 Close trial task cards and keep long histories visible
Why: pipefail treated a recent merged-card match as a failed git log after grep exited early, hiding completed cards from precheck and task-close.

Evidence: A disposable long-history regression failed before the fix and passed after it; make test-governance passed 341 cases. Git history confirms PR #489/#488/#486 merge SHAs.

Impact: Detect merged cards reliably and archive only the three authorized trial cards; four unrelated eligible cards remain untouched.

Refs: Dev merge queue #518; Dev #489, #488, #486
2026-10-14 04:50:06 +00:00
weichen 4629b871db Connect delivery windows and recovery to the repository rules
Why: agents need consistent entrypoints and recording defaults to avoid retrying synchronization and CI outside the final delivery window.

Evidence: SELF generated-task-card red-green regression and governance suite recorded through make evidence; pending shared record created as Issue #518.

Impact: rules, task template and capability matrix stay explicit about pending activation, default strict startup, manual coordination and unchanged CI triggers.

Refs: U4; policy/merge-queue.md; .task/feature-merge-queue-policy-draft.md
2026-10-13 08:21:46 +00:00
weichen eb46bbb296 Separate local task recovery from delivery readiness
Why: an existing authorized task should not merge a moving target merely to resume local work, while new task startup and delivery remain strict.

Evidence: SELF red-green recovery and environment regressions; task, recovery, evidence and local-mode write-guard suites passed through make evidence.

Impact: add explicit LOCAL_READY and task-resume, validate worktree/card/baseline and receipt purpose, preserve schema 1 and prevent local receipts from starting or releasing tasks.

Refs: U2; policy/merge-queue.md; .task/feature-merge-queue-policy-draft.md
2026-10-13 07:42:12 +00:00
weichen 03cbeac8e6 Avoid new commits when the task already contains the integration baseline
Why: repeated task-sync calls changed HEAD and invalidated CI even when main had not advanced.

Evidence: SELF red-green regression and 58 task lifecycle tests recorded through make evidence in the task card.

Impact: sync still fetches and validates components, creates records only for an actual merge, and reports the complete final source SHA.

Refs: U1; policy/merge-queue.md; .task/feature-merge-queue-policy-draft.md
2026-10-13 07:05:06 +00:00
weichen ab622e5bc8 Delegate reviewed PR merges to agents after conflict and CI checks
Why: make the agent responsible for merging reviewed PRs without another human merge step.

Evidence: SELF governance and generated-card checks are captured in .task/feature-agent-pr-merge.md; CI remains required on the final PR HEAD.

Impact: update project delivery policy, agent entry points, task metadata and closure guidance; preserve platform protection and scoped authorization.

Refs: .task/feature-agent-pr-merge.md; user instruction on 2026-10-12
2026-10-12 12:35:31 +00:00
weichen bbdd3f4505 Disable auto-gc in the task-lifecycle remote fixture
ci / test (pull_request) Successful in 2m13s
Why: git receive-pack runs 'gc --auto' in the background after a push;
the fixture's TemporaryDirectory teardown then races the gc writer and
fails with OSError 39 (remote.git not empty) — observed on the PR #285
runner (job 1967). The fixture remote holds no durable value, so auto-gc
is pure flake surface.

Evidence: the failing test passes 5/5 locally after the fix; full
make test-governance green (104 tests).

Impact: test fixture only; no governance-script behavior change.

Refs: Dev CI run 1438 job 1967; same race family as the upload-host
TempDir flake fixed earlier.
2026-10-09 17:10:18 +00:00
weichen 908504e8b5 Connect long-term plans to task completion
Why: preserve project direction across tasks and require grounded next-task recommendations.

Evidence: the generated task-card regression fails before the template update and passes afterward; original SELF receipts are in the task card.

Impact: document the planning entrypoint and extend task records without granting new-task execution rights.

Refs: .task/feature-goal-continuity.md; policy/delivery.md
2026-10-07 06:10:51 +00:00
weichen 14c55def98 Preserve delivery references after task archival
Why: archived task cards change directory and must retain an unambiguous policy reference.

Evidence: review finding 1, focused red-green proof and 104 passing governance tests are preserved in the task card.

Impact: use a repository-root text reference; record the completed review and its resolved finding.

Refs: .task/feature-iterative-delivery.md; .task/reviews/iterative-delivery.json
2026-10-07 03:10:09 +00:00
weichen 1ac79c2a90 Define iterative delivery with explicit stage reviews
Why: make requirements, experiments and implementation revisions reviewable while retaining bounded continuous authorization.

Evidence: task-card SELF receipts include expected red regressions and 104 passing governance checks; full candidate verification follows.

Impact: add project delivery policy and generated task fields; make post-merge reminders read-only.

Refs: .task/feature-iterative-delivery.md; policy/delivery.md
2026-10-07 02:53:20 +00:00
weichen a5f0ca107d Only count remote-unreachable commits as local work in finish guard
ci / test (pull_request) Successful in 2m19s
Why: 本地 main 停在 origin/main 顶端(克隆默认态)在 pin 为 feature 顶端时不在 pin
历史内,--branches 直判仍会误阻(本 worktree 自身收尾实测踩到)。
Evidence: 第五例回归(本地默认分支+克隆 reflog 不阻)全绿;五例套件+全套治理回归
GOVERNANCE-SUITE-OK;worktree 实际 finish 通过即端到端自证。
Impact: local_work_outside 候选提交先过 --not --remotes 过滤(远端可达即已保全);
stash 仍恒算本地独有。
2026-10-05 15:05:54 +00:00
weichen 91d25a3ed1 Fix two finish-guard false positives: IDE locks and remote-only refs
ci / test (pull_request) Successful in 2m21s
Why: 2026-10-05 两次实测踩到——①rglob("*.lock") 把 .git/cursor/ IDE 产物当 Git 锁
(五天陈锁阻断 worktree 回收);②pinned-history 用 --all --reflog 把 refs/remotes
计入,pin 在 feature 顶端的子仓永远无法 finish(被迫删远端引用+清 reflog 损害现场)。
Evidence: FinishGuardFixTests 四例全绿(误报修复+真实锁仍拦+独有提交仍保);
全套治理回归 91 例 OK;make test 全链证据入卡。
Impact: 仅 finish 模式两处判定;IDE 产物与远端引用不再误伤,本地独有工作保全语义不变。
Refs: 本仓 governance 收尾实录(EXT-1 与 governance-reliability 两轮)。
2026-10-05 15:00:20 +00:00
weichen c1fdf0141c Merge current main while preserving governance repairs
Why: main advanced with merged-task-name and legacy evidence guards during this task.

Evidence: SELF 44 lifecycle regressions pass after resolving both hunks; independent review repairs are recorded in the task card.

Impact: retains both task-start protections and the stronger JSON/legacy receipt reader, without rewriting either branch history.

Refs: Dev PR #211 and #212; .task/feature-governance-reliability.md
2026-10-05 13:11:50 +00:00
weichen b84667a697 Close review gaps in cleanup and evidence handling
Why: independent review found shared submodule metadata risk, quoted header leakage, stale JSON receipt blindness and missing abandon coverage.

Evidence: SELF 92 governance regressions pass; the original review receipt and replay output are recorded in the task card.

Impact: preserves external component worktrees, handles both evidence formats and adds targeted failure-path coverage; no product behavior changes.

Refs: .task/feature-governance-reliability.md; .task/reviews/governance-reliability.json
2026-10-05 13:07:10 +00:00
weichen 8af945a1d5 Make development gates preserve work and verifiable evidence
Why: cleanup, component synchronization, receipt recording and credential handling could contradict the documented development boundaries.

Evidence: SELF 75 isolated governance tests and source checks are captured in .task/feature-governance-reliability.md; combination and CI verification follow.

Impact: hardens local task and CI tooling, aligns policy and component documentation, and adds continuous regression tests without changing product behavior.

Refs: .task/feature-governance-reliability.md; policy/governance.md; policy/platform-admission.md
2026-10-05 12:36:02 +00:00