Add preflight-tests step to mol-polecat-work
Checks tests on main BEFORE starting work. Scotty Principle: - Quick fix (<15 min): Fix it, commit, continue - Big fix: File bead, notify Witness, proceed Closes gt-3zkjw
This commit is contained in:
@@ -33,7 +33,7 @@ You are an autonomous worker. You:
|
|||||||
| Context filling | Use gt handoff to cycle to fresh session |
|
| Context filling | Use gt handoff to cycle to fresh session |
|
||||||
| Unsure what to do | Mail Witness, don't guess |"""
|
| Unsure what to do | Mail Witness, don't guess |"""
|
||||||
formula = "mol-polecat-work"
|
formula = "mol-polecat-work"
|
||||||
version = 2
|
version = 3
|
||||||
|
|
||||||
[[steps]]
|
[[steps]]
|
||||||
id = "load-context"
|
id = "load-context"
|
||||||
@@ -131,10 +131,81 @@ If rebase conflicts:
|
|||||||
|
|
||||||
**Exit criteria:** You're on a clean feature branch, rebased on latest main."""
|
**Exit criteria:** You're on a clean feature branch, rebased on latest main."""
|
||||||
|
|
||||||
|
[[steps]]
|
||||||
|
id = "preflight-tests"
|
||||||
|
title = "Verify tests pass on main"
|
||||||
|
needs = ["branch-setup"]
|
||||||
|
description = """
|
||||||
|
Check if the codebase is healthy BEFORE starting your work.
|
||||||
|
|
||||||
|
**The Scotty Principle:** Don't walk past a broken warp core. But also don't
|
||||||
|
let someone else's mess consume your entire mission.
|
||||||
|
|
||||||
|
**1. Check tests on main:**
|
||||||
|
```bash
|
||||||
|
git stash # Save your branch state
|
||||||
|
git checkout origin/main
|
||||||
|
go test ./... # Or appropriate test command
|
||||||
|
```
|
||||||
|
|
||||||
|
**2. If tests PASS:**
|
||||||
|
```bash
|
||||||
|
git checkout - # Back to your branch
|
||||||
|
git stash pop # Restore state
|
||||||
|
```
|
||||||
|
Continue to implement step.
|
||||||
|
|
||||||
|
**3. If tests FAIL on main:**
|
||||||
|
|
||||||
|
Make a judgment call:
|
||||||
|
|
||||||
|
| Situation | Action |
|
||||||
|
|-----------|--------|
|
||||||
|
| Quick fix (<15 min) | Fix it, commit to main, then continue |
|
||||||
|
| Medium fix (15-60 min) | Fix if it blocks your work, else file bead |
|
||||||
|
| Big fix (>1 hour) | File bead, notify Witness, proceed with your work |
|
||||||
|
|
||||||
|
**Quick fix path:**
|
||||||
|
```bash
|
||||||
|
# Fix the issue
|
||||||
|
git add <files>
|
||||||
|
git commit -m "fix: <description> (pre-existing failure)"
|
||||||
|
git push origin main
|
||||||
|
git checkout -
|
||||||
|
git stash pop
|
||||||
|
git rebase origin/main # Get your fix
|
||||||
|
```
|
||||||
|
|
||||||
|
**File and proceed path:**
|
||||||
|
```bash
|
||||||
|
bd create --title "Pre-existing test failure: <description>" \
|
||||||
|
--type bug --priority 1
|
||||||
|
|
||||||
|
gt mail send <rig>/witness -s "NOTICE: Main has failing tests" \
|
||||||
|
-m "Found pre-existing test failures on main.
|
||||||
|
Filed: <bead-id>
|
||||||
|
Proceeding with my assigned work ({{issue}})."
|
||||||
|
|
||||||
|
git checkout -
|
||||||
|
git stash pop
|
||||||
|
```
|
||||||
|
|
||||||
|
**Context consideration:**
|
||||||
|
If fixing pre-existing failures consumed significant context:
|
||||||
|
```bash
|
||||||
|
gt handoff -s "Fixed pre-existing failures, ready for assigned work" \
|
||||||
|
-m "Issue: {{issue}}
|
||||||
|
Fixed: <what you fixed>
|
||||||
|
Ready to start: implement step"
|
||||||
|
```
|
||||||
|
Fresh session continues from implement.
|
||||||
|
|
||||||
|
**Exit criteria:** Tests pass on main (or issue filed), ready to implement."""
|
||||||
|
|
||||||
[[steps]]
|
[[steps]]
|
||||||
id = "implement"
|
id = "implement"
|
||||||
title = "Implement the solution"
|
title = "Implement the solution"
|
||||||
needs = ["branch-setup"]
|
needs = ["preflight-tests"]
|
||||||
description = """
|
description = """
|
||||||
Do the actual implementation work.
|
Do the actual implementation work.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user