chore(agents): scripts/wt and workflow-doc follow-ups from #139 review #140
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#140
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-ups from the second-pass review of #139 (review comment). All are P3. Each item names its fix, so the design is settled.
Standards
scripts/wtlocal_files(): build the ignore regex fromSHAREDinstead of hard-coding^(\.venv|\.env|scripts/tailwindcss)$, so adding a shared symlink is a one-place edit.scripts/wtcmd_pr: giveunpushed()a ref argument and reuse it, replacing the inlinerev-list --count "$branch" --not --remotes=….scripts/wtcmd_rm: canonicalise the resolved directory withrealpathbefore the"$WT_DIR"/*prefix check, so.and..are rejected (todaywt rm .. -freachesgit worktree remove --forceon the main checkout).scripts/wtcmd_pr, where a local branch has no worktree: verify fast-forward (merge-base --is-ancestor) beforegit worktree add, so a divergence leaves no orphan worktree.scripts/wtremove(): message should read "removed ; deleted merged branch ".docs/agents/forgejo-cli.md: drop "Installed at~/.local/bin/teaon the dev workstation" (it caches the environment).docs/standards/git-and-workflow.md: "Merge commit (no squash or rebase)" → "Merge commit only".Spec
scripts/wtshould refuse to remove the worktree containing$PWD(in bothrmandprune, with a "run from the main checkout" message), andforgejo-cli.md§Merging should say "from the main checkout".scripts/wt prune: when a worktree's branch has no upstream (pushed without-u), printkept <dir>: no upstreaminstead of skipping it silently.Verification
Exercise each
wtchange on local throwaway branches. Pre-commit (ruff, pytest) andscripts/check_docs.pymust be green.Maintainer triage — 2026-09-27
For C2-3, prevent test and documentation runs from creating runtime databases/logs in worktrees: use isolated temporary storage and avoid runtime initialization during documentation inspection where possible. Keep ordinary pruning conservative for remaining local databases; do not automatically delete them based on size or make force removal the routine workflow. Verify no data/hikcentral.db or logs/lifecycle.log artifacts are left by the affected test/doc commands. Retain all outstanding listed chores; #141 already completed the checked items.
C2-3 (found while merging #139):
prunekeeps almost every worktree. Open design pointAfter #139 merged,
scripts/wt prunefrom the main checkout kept.worktrees/docs-agent-workspaces("holds ignored local files"). Only two files blocked it, both produced by ordinary test and doc runs inside the worktree:data/hikcentral.db: 4 KB, empty schema, created at app import (scripts/check_docs.py/ pytest)logs/lifecycle.logSo any worktree that has run the suite needs
wt rm -fafter merge, which weakens the S1 guard: once-fbecomes routine, it stops protecting anything.A decision is needed before implementation. Options:
logs/as expendable inlocal_files(), and only protectdata/files larger than an empty-schema DB (or any non-empty table). This is precise, but needs a sqlite check in bash.data/. Point the app at a temp DB under test (env var / conftest) sodata/only appears when someone deliberately runs the app in the worktree. This fixes the cause, but touches app config.-f. The cheapest option; the guard still asks a human or agent to judge.Relabelled
needs-triageuntil this is settled; the other items in this issue are ready as written.#141 merged (
02f0971): S2-3 (wt rmpath canonicalisation) and C2-1 (cwd guard inrm/prune, docs say "from the main checkout") are done and ticked. C2-3 got an interim mitigation only: refusals list each blocking file with its size (quoted names, symlinks, capped at 20), andprunereports only merged candidates. The permanent policy is still open, so this issue staysneeds-triage.Added from the #154 second-pass review (P3): in
docs/agents/forgejo-cli.md, change "your worktree's scratchpad subfolder" to "your scratchpad subfolder". The rule inworkspaces.md#scratch-filesalso covers agents without a worktree (reviewers, orchestrators), who name the subfolder after their task.