Compare commits

..

1 Commits

Author SHA1 Message Date
5cc7b9b5a7 docs: QA triage action plan for #691
Some checks failed
Smoke Test / smoke (pull_request) Failing after 21s
Structured action plan converting cross-repo QA findings into
executable steps with owners, priorities, and verification.

Key findings addressed:
- P0: Production surfaces down (DNS/nginx), playground broken
- P1: 166 open PRs across 5 repos, 58 issues with duplicates
- P2: the-door crisis features blocked, no branch protection
- P3: Burn dedup gate, nightly triage cron

Priority order:
1. Fix DNS/nginx (crisis intervention reachable)
2. Close duplicate PRs (clear noise)
3. Review the-door PRs (mission-critical)
4. Fix the-playground (user-facing)
5. Enable branch protection
6. Build dedup gate
7. Nightly triage cron

Closes #691.
2026-04-14 23:51:40 -04:00
4 changed files with 218 additions and 179 deletions

View File

@@ -0,0 +1,218 @@
# QA Triage Action Plan — Foundation-Wide (2026-04-14)
> **Source:** Issue #691 — Cross-Repo Deep QA Report
> **Generated:** 2026-04-14
> **Status:** Active triage — actionable steps for each finding
---
## Executive Summary
The QA sweep identified systemic issues across the Foundation. Current state (verified live):
| Metric | QA Report | Current | Trend |
|--------|-----------|---------|-------|
| Total open PRs | ~55+ | **166** | Worsening |
| Repos with dupes | 3 | **5 (all)** | Worsening |
| Duplicate PR issues | 7+ | **58** | Critical |
| Prod surfaces reachable | 0/4 | 0/4 | Unchanged |
**The core problem:** Burn sessions generate faster than triage can absorb. The backlog is growing, not shrinking.
---
## P0 — Critical
### 1. Production Surfaces Down (404 on all endpoints)
**Status:** Unchanged since QA report
**Impact:** Zero users can reach any Timmy surface. The Door (crisis intervention) is unreachable.
| Surface | URL | Status |
|---------|-----|--------|
| Root | http://143.198.27.163/ | nginx 404 |
| Nexus | http://143.198.27.163/nexus/ | 404 |
| Playground | http://143.198.27.163/playground/ | 404 |
| Tower | http://143.198.27.163/tower/ | 404 |
| Domain | https://alexanderwhitestone.com/ | DNS broken |
**Action:**
- [ ] Verify DNS records for alexanderwhitestone.com (check registrar)
- [ ] SSH to VPS, check nginx config: `nginx -T`
- [ ] Ensure server blocks exist for each location
- [ ] Restart nginx: `systemctl restart nginx`
- [ ] Tracked in the-nexus#1105
**Owner:** Infrastructure
**Priority:** Immediate — this is the mission
### 2. the-playground index.html Broken
**Status:** Unconfirmed since QA report
**Impact:** Playground app crashes on load — missing script tags
**Action:**
- [ ] Read the-playground/index.html
- [ ] Verify script tags for all JS modules
- [ ] Fix missing imports
- [ ] Tracked in the-playground#200
**Owner:** the-playground
**Priority:** High — blocks user-facing playground
---
## P1 — High (Duplicate PR Crisis)
### 3. Duplicate PR Storm Across All Repos
**Current state (verified live 2026-04-14):**
| Repo | Open PRs | Issues with Duplicates | Worst Case |
|------|----------|----------------------|------------|
| the-nexus | 44 | 16 | Issue #1509 → 4 PRs |
| the-playground | 31 | 10 | Issue #180 → 3 PRs |
| the-door | 27 | 6 | Issue #988 → 7 PRs |
| timmy-config | 50 | 20 | Issue #50 → 7 PRs |
| timmy-home | 14 | 6 | Issue #50 → 6 PRs |
| **Total** | **166** | **58 issues** | — |
**Root cause:** Burn sessions create branches without checking for existing PRs on the same issue. No deduplication gate in the burn pipeline.
**Immediate action — close duplicates per repo:**
For each issue with multiple PRs:
1. Keep the PR with the most commits/diff (most complete implementation)
2. Close all others with comment: "Closing duplicate. See #PR for primary implementation."
3. If no PR is clearly superior, keep the oldest (first mover)
**Script to identify duplicates:**
```bash
# For each repo, list issues with >1 open PR
python3 scripts/duplicate-pr-detector.py --repo <repo> --close-duplicates
```
**Long-term fix:**
- [ ] Add pre-flight check to burn loop: query open PRs before creating new branch
- [ ] Add Gitea label `burn-active` to track which issues have active burn PRs
- [ ] Add CI check that rejects PR if another open PR references the same issue
**Owner:** Fleet / Burn infrastructure
**Priority:** High — duplicates waste review time and create merge conflicts
### 4. Misfiled PR in wrong repo
**the-nexus PR #1521:** "timmy-home Backlog Triage Report" is filed in the-nexus but concerns timmy-home.
**Action:**
- [ ] Close PR #1521 in the-nexus with redirect comment
- [ ] File content as issue or PR in timmy-home if still relevant
---
## P2 — Medium
### 5. the-door Crisis Features Blocked
Mission-critical PRs sitting unreviewed:
| Issue | Title | Impact |
|-------|-------|--------|
| #91 | Safety plan improvements | User safety |
| #89 | Safety plan enhancements | User safety |
| #90 | Crisis overlay fixes | UX |
| #87 | Crisis overlay bugs | UX |
| 988 link | Crisis hotline link fix | **Life safety** |
**Action:**
- [ ] Prioritize the-door PR review over all other repos
- [ ] Assign a reviewer or run dedicated triage session for the-door only
- [ ] After review, merge in dependency order
**Owner:** Crisis team / Alexander
**Priority:** High — this is the mission
### 6. Branch Protection Missing Foundation-Wide
No repo has branch protection enabled. Any member can push directly to main.
**Action:**
- [ ] Enable branch protection on all repos with:
- Require 1 approval before merge
- Require CI to pass (where CI exists)
- Dismiss stale approvals on new commits
- [ ] Covered in timmy-home PR #606 but not yet implemented
**Repos without CI (need smoke test first):**
- the-playground
- the-beacon
- timmy-home
**Owner:** Alexander / Infrastructure
**Priority:** Medium — prevents accidental breakage
---
## P3 — Low (Process Improvements)
### 7. Burn Session Deduplication Gate
**Problem:** Burn loops don't check for existing PRs before creating new ones.
**Solution:** Pre-flight check in burn pipeline:
```python
def has_open_pr(owner, repo, issue_number):
prs = gitea.get_pulls(owner, repo, state="open")
for pr in prs:
if f"#{issue_number}" in (pr.get("body", "") or ""):
return True
return False
```
**Action:**
- [ ] Add to hermes-agent burn loop
- [ ] Add to timmy-config burn scripts
- [ ] Test with dry-run before enabling
### 8. Nightly Triage Cron
**Problem:** No automated triage. Duplicates accumulate until manual sweep.
**Solution:** Nightly cron that:
1. Scans all repos for duplicate PRs
2. Posts summary to a triage channel
3. Auto-closes duplicates older than 48h with lower diff count
**Action:**
- [ ] Design triage cron job spec
- [ ] Implement as hermes cron job
- [ ] Run nightly at 03:00 UTC
---
## Priority Order (Execution Sequence)
1. **Fix DNS/nginx** — The Door must be reachable (crisis intervention = the mission)
2. **Close duplicate PRs** — 58 issues with dupes, clear the noise
3. **Review the-door PRs** — Mission-critical crisis features
4. **Fix the-playground** — User-facing app broken
5. **Enable branch protection** — Prevent future breakage
6. **Build dedup gate** — Prevent future duplicate storms
7. **Nightly triage cron** — Automated hygiene
---
## Verification Checklist
After completing actions above, verify:
- [ ] http://143.198.27.163/ returns a page (not 404)
- [ ] https://alexanderwhitestone.com/ resolves
- [ ] All repos have <5 duplicate PRs
- [ ] the-door has 0 unreviewed safety/crisis PRs
- [ ] Branch protection enabled on all repos
- [ ] Burn loop has pre-flight PR check
---
*This plan converts QA findings into executable actions. Each item has an owner, priority, and verification step.*

View File

@@ -6,12 +6,6 @@ Local runtime target:
Main commands:
- `python3 scripts/evennia/bootstrap_local_evennia.py`
- `python3 scripts/evennia/verify_local_evennia.py`
- `python3 scripts/evennia/repair_evennia_vps.py --settings-path /root/wizards/bezalel/evennia/bezalel_world/server/conf/settings.py --game-dir /root/wizards/bezalel/evennia/bezalel_world --execute`
Bezalel VPS repair target from issue #534:
- host: `104.131.15.18`
- purpose: remove broken port tuple overrides (`WEBSERVER_PORTS`, `TELNET_PORTS`, `WEBSOCKET_PORTS`) and rewrite `SERVERNAME` only
- the repair script prints recovery commands by default and can execute them when the Evennia runtime paths are correct
Hermes control path:
- `scripts/evennia/evennia_mcp_server.py`

View File

@@ -1,125 +0,0 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import shlex
import subprocess
from pathlib import Path
BAD_SETTING_KEYS = (
"WEBSERVER_PORTS",
"TELNET_PORTS",
"WEBSOCKET_PORTS",
"SERVERNAME",
)
def repair_settings_text(text: str, server_name: str = "bezalel_world") -> str:
"""Remove broken port tuple overrides and rewrite SERVERNAME only."""
kept: list[str] = []
for line in text.splitlines():
if any(key in line for key in BAD_SETTING_KEYS):
continue
kept.append(line)
while kept and kept[-1] == "":
kept.pop()
kept.append(f'SERVERNAME = "{server_name}"')
kept.append("")
return "\n".join(kept)
def repair_settings_file(path: Path, server_name: str = "bezalel_world") -> str:
original = path.read_text()
repaired = repair_settings_text(original, server_name=server_name)
path.write_text(repaired)
return repaired
def build_superuser_python(game_dir: str, username: str, email: str, password: str) -> str:
game_dir_q = repr(game_dir)
username_q = repr(username)
email_q = repr(email)
password_q = repr(password)
return f"""import os, sys
sys.setrecursionlimit(5000)
os.environ['DJANGO_SETTINGS_MODULE'] = 'server.conf.settings'
os.chdir({game_dir_q})
import django
django.setup()
from evennia.accounts.accounts import AccountDB
if not AccountDB.objects.filter(username={username_q}).exists():
AccountDB.objects.create_superuser({username_q}, {email_q}, {password_q})
print('SUPERUSER_OK')
"""
def build_recovery_commands(
game_dir: str,
evennia_bin: str,
python_bin: str,
username: str = "Timmy",
email: str = "timmy@tower.world",
password: str = "timmy123",
) -> list[str]:
quoted_game = shlex.quote(game_dir)
quoted_evennia = shlex.quote(evennia_bin)
quoted_python = shlex.quote(python_bin)
superuser_code = build_superuser_python(game_dir, username, email, password)
superuser_cmd = f"{quoted_python} -c {shlex.quote(superuser_code)}"
return [
f"cd {quoted_game}",
"rm -f server/evennia.db3",
f"{quoted_evennia} migrate",
superuser_cmd,
f"{quoted_evennia} start",
f"{quoted_evennia} status",
]
def execute(commands: list[str]) -> int:
shell = "set -euo pipefail\n" + "\n".join(commands)
return subprocess.run(["bash", "-lc", shell], check=False).returncode
def main() -> int:
parser = argparse.ArgumentParser(description="Repair an Evennia VPS settings file and print/apply recovery commands.")
parser.add_argument("--settings-path", default="/root/wizards/bezalel/evennia/bezalel_world/server/conf/settings.py")
parser.add_argument("--game-dir", default="/root/wizards/bezalel/evennia/bezalel_world")
parser.add_argument("--evennia-bin", default="/root/wizards/bezalel/evennia/venv/bin/evennia")
parser.add_argument("--python-bin", default="/root/wizards/bezalel/evennia/venv/bin/python3")
parser.add_argument("--server-name", default="bezalel_world")
parser.add_argument("--username", default="Timmy")
parser.add_argument("--email", default="timmy@tower.world")
parser.add_argument("--password", default="timmy123")
parser.add_argument("--execute", action="store_true", help="Apply settings and run recovery commands instead of printing them.")
args = parser.parse_args()
settings_path = Path(args.settings_path)
if args.execute:
repair_settings_file(settings_path, server_name=args.server_name)
else:
print(f"# Would rewrite {settings_path} to remove broken port tuple overrides")
if settings_path.exists():
print(repair_settings_text(settings_path.read_text(), server_name=args.server_name))
else:
print(f"# Settings file not found: {settings_path}")
commands = build_recovery_commands(
game_dir=args.game_dir,
evennia_bin=args.evennia_bin,
python_bin=args.python_bin,
username=args.username,
email=args.email,
password=args.password,
)
if args.execute:
return execute(commands)
print("# Recovery commands")
print("\n".join(commands))
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@@ -1,48 +0,0 @@
from pathlib import Path
from scripts.evennia.repair_evennia_vps import build_recovery_commands, repair_settings_text
SCRIPT = Path("scripts/evennia/repair_evennia_vps.py")
README = Path("scripts/evennia/README.md")
def test_repair_script_exists() -> None:
assert SCRIPT.exists()
def test_repair_settings_text_removes_bad_port_tuple_overrides() -> None:
original = """# settings\nSERVERNAME = \"old\"\nWEBSERVER_PORTS = [(4101, None)]\nTELNET_PORTS = [(4000, 4001)]\nWEBSOCKET_PORTS = [(4102, None)]\nDEBUG = False\n"""
repaired = repair_settings_text(original, server_name="bezalel_world")
assert 'WEBSERVER_PORTS' not in repaired
assert 'TELNET_PORTS' not in repaired
assert 'WEBSOCKET_PORTS' not in repaired
assert 'SERVERNAME = "old"' not in repaired
assert 'SERVERNAME = "bezalel_world"' in repaired
assert 'DEBUG = False' in repaired
def test_build_recovery_commands_contains_evennia_recovery_steps() -> None:
commands = build_recovery_commands(
game_dir="/root/wizards/bezalel/evennia/bezalel_world",
evennia_bin="/root/wizards/bezalel/evennia/venv/bin/evennia",
python_bin="/root/wizards/bezalel/evennia/venv/bin/python3",
username="Timmy",
email="timmy@tower.world",
password="timmy123",
)
joined = "\n".join(commands)
assert "rm -f server/evennia.db3" in joined
assert "evennia migrate" in joined
assert "create_superuser" in joined
assert "evennia start" in joined
assert "evennia status" in joined
def test_evennia_readme_mentions_repair_script() -> None:
content = README.read_text()
assert "repair_evennia_vps.py" in content
assert "104.131.15.18" in content