Adds author_proofs.py, the author-side counterpart of review_proofs.py (#173), turning the branch-drift incident from PR #176 into fail-closed gates: - verify_branch_for_commit: the current branch must equal the intended feature branch and may never be a protected branch (master, main, develop, development, dev); missing state fails closed. - detect_branch_drift: any branch or HEAD change between validation time and commit time — including an external branch switch in a shared worktree, which is treated as an expected event to detect — blocks the commit until reconciled. - verify_push_target: a push requires the local branch, remote target branch, and intended issue branch to all match, none protected. - assess_protected_branch_commit: an accidental protected-branch commit must never be pushed, requires repair, and the repair must be reported; pushing the accident or silently continuing is a violation. - build_commit_push_report: final-report block carrying the branch proof before commit and before push; any failed proof, drift, or violation makes the status blocked. tests/test_author_proofs.py (27 tests) covers the issue's harness assertions: commit on master blocked; drift between validation and commit blocked; push target mismatch blocked; shared-worktree branch switch detected; repair path cannot silently continue without reporting. SKILL.md section E and templates/start-issue.md now require recording the validation-time branch/HEAD, the branch proof before commit, the branch proof before push, and non-silent accident repair. No review/merge/ permission gate is weakened. Closes #177 Co-Authored-By: Claude Fable 5 <[email protected]>
3.0 KiB
3.0 KiB
Template: start a new issue
Copy, fill the <...> fields, and paste as the task prompt.
Task: implement <issue title / one-line goal>.
Rules (llm-project-workflow):
- No repo changes without a tracking issue. If none exists, create one first;
if it can't be created, stop.
- Work only in an isolated branch worktree under branches/. The main checkout
is orchestration/status only.
- Do not self-review or self-merge.
Steps:
1. Identity Checklist: Before claiming work, verify and state:
- Required identity/profile for this task: author (allowed to push branches / create PRs)
- Current authenticated identity (from whoami): <username>
- Target task role: author/work identity
*If the current identity does not match the required role (or lacks push/PR permissions), STOP before claiming the issue. Relaunch/switch to the correct profile first.*
2. Verify the orchestration checkout is the right repo and clean.
3. git fetch <remote> --prune; confirm local master == <remote>/master (0 0).
4. Create the issue "<title>" (problem, scope, acceptance) and claim it
(status:in-progress + a "starting work" comment naming the branch).
5. scripts/worktree-start <type>/issue-<n>-<slug> # type = fix|feat|docs
cd branches/<type>-issue-<n>-<slug>
6. Implement the narrow scope only; add/update focused tests if behavior changes.
7. Checks: run the test suite, compile/lint changed files, git diff --check,
and scan the diff for secrets. Record the branch name and HEAD SHA at
validation time.
8. Branch proof before commit (#177) — prove and state:
- git branch --show-current == the intended issue branch from step 5
- the branch is NOT master/main/develop/development/dev
- branch and HEAD unchanged since step 7 (another session can switch a
shared checkout mid-session; if drift is detected, STOP and reconcile
before committing)
If a commit accidentally lands on a protected branch: do NOT push;
report the accident and the exact repair steps — never silently continue.
9. Commit (issue-linked message). Branch proof before push (#177): local
branch == push target branch == intended issue branch, none protected.
Then push the branch and open a PR to master.
*The PR body MUST use closing keywords like `Closes #N` or `Fixes #N` to close the issue; do NOT use `Implements #N` or `Refs #N` for closing, as Gitea will not auto-close it.*
Include an "LLM Handoff Metadata" block in the PR body (attribution only;
never an eligibility input — docs/llm-agent-sha.md):
LLM Handoff Metadata:
- LLM-Agent-SHA: llm-<12 lowercase hex, e.g. llm-8f3a9c2d6b41>
- LLM-Role: implementer
- Authenticated-Gitea-User: <whoami result>
- MCP-Profile: <profile name>
- Branch: <branch>
- Worktree: <worktree path>
- Self-review allowed: no
10. Stop before review/merge — you are the author.
Handoff: issue #, branch, worktree path, files changed, checks + results, PR URL —
formatted as the compact Controller Handoff (SKILL.md §K; long form only on
the high-risk triggers); Review line: "Review needed — PR is open".