Compare commits
1 Commits
fix/512
...
step35/877
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6595a82afb |
172
research/mathematics/math-001-shadow-maths-triage-rubric.md
Normal file
172
research/mathematics/math-001-shadow-maths-triage-rubric.md
Normal file
@@ -0,0 +1,172 @@
|
||||
# Shadow Maths Triage Rubric (MATH-001)
|
||||
|
||||
**Status**: Draft v1.0 **Date**: 2026-04-26 **Author**: Timmy
|
||||
**Milestone**: Contribute to Mathematics — Shadow Maths Search
|
||||
**Parent**: #876 — [MATH][EPIC] Shadow Maths
|
||||
|
||||
---
|
||||
|
||||
## Purpose
|
||||
|
||||
Timmy's mathematics contribution program targets *bounded, verifiable, useful* problems hiding in plain sight. This rubric operationalizes "shadow maths" — distinguishing legitimate first-crack contributions from crank Grand Unified Theories.
|
||||
|
||||
The rubric serves two roles:
|
||||
1. **Triage gate** — filter submissions and scout list candidates worth pursuing.
|
||||
2. **No-crank guardrail** — explicitly reject unfalsifiable, unscoped, or unsourced claims.
|
||||
|
||||
---
|
||||
|
||||
## Candidate Categories (Positive Types)
|
||||
|
||||
| Category | Description | Verification Path | Useful Because |
|
||||
|----------|-------------|-------------------|---------------|
|
||||
| **Small lemma** | Missing but straightforward piece in an active area (e.g., "Proposition 3.2 in Smith 2021 needs this case analysis") | Check paper + 1–2 related references; prove or give counterexample | Clarifies existing theory, removes ambiguity |
|
||||
| **Counterexample search** | Find explicit counterexample to a claimed-but-unproven statement (often from MO/SE) | Compute/construct + cite the original claim | Prevents propagation of errors |
|
||||
| **Computational classification** | Exhaustive enumeration/classification of a small infinite family (e.g., "all groups of order < 200 with property X") | Code is verifiable; results match known data | Creates reference data, spotlights patterns |
|
||||
| **Formalization gap** | Statement already believed true but missing from Lean/mathlib/Isabelle | Formal proof artifact; merges to mainline library | Makes mathematics machine-checkable |
|
||||
| **OEIS sequence note** | New sequence entry or correction to an existing entry with proof/algorithm | OEIS A-number + formula/generation code | Public archival, enables further work |
|
||||
| **Exposition repair** | Fix an unclear proof, fill a gap, simplify an argument in an existing paper | Side-by-side diff + justification for each change | Improves pedagogy, reduces confusion |
|
||||
| **MathOverflow-quality answer** | Answer to a specific, bounded, research-level question on MO/SE that has no accepted answer | Cite question + self-contained proof/computation | Serves the community directly |
|
||||
|
||||
---
|
||||
|
||||
## Rejection Criteria (No-Crank Guardrails)
|
||||
|
||||
> Any candidate that triggers one or more of these is **rejected outright** — no scoring needed.
|
||||
|
||||
| Rule | What to look for | Why it's crank |
|
||||
|------|------------------|----------------|
|
||||
| **Unsourced grand theory** | Claim introduces new "framework"/"paradigm" without citing specific bounded problem it solves | Mathematics advances by solving problems, not proposing frameworks |
|
||||
| **Impossible scope** | "I will prove/disprove the Riemann Hypothesis", "classify all finite simple groups" | Demonstrably beyond single-attack capability |
|
||||
| **No verification path** | No way for a third party to check the work (no code, no formalization, no explicit examples) | Cannot be wrong if it cannot be checked |
|
||||
| **Novelty claim without literature search** | States "I believe this is new" without checking MathSciNet/arXiv/Google Scholar | Almost certainly reinvention or known result |
|
||||
| **Vague mathematical objects** | Uses undefined or ambiguous terminology ("energy", "resonance", "harmonic" in non-standard ways) | Not mathematics |
|
||||
| **Secrecy or paywall** | Key definition or proof behind a paywall or withheld | Not sovereign; not verifiable |
|
||||
| **Symbolic overloading without definition** | Repurposes standard notation in non-standard ways without explicit redefinition | Creates confusion, not clarity |
|
||||
| **Invariance violations** | Claims "up to isomorphism" or "modulo equivalence" without defining the equivalence relation | Not mathematically precise |
|
||||
| **Cherry-picked examples as proof** | Proves only easy special cases and claims the general case follows | Example ≠ theorem |
|
||||
| **Circular citation chains** | Relies on unpublished/preprint work that itself cites the candidate as motivation | Not a foundation |
|
||||
| **No clear problem statement** | Cannot write a one-sentence problem statement in standard mathematical English | Not a problem; just musings |
|
||||
| **Claims of "obvious" or "clear" for non-trivial steps** | Uses "obviously" or "it is clear that" where a proof requires >2 lines | Evasion |
|
||||
| **References only popular science / non-technical sources** | Cites Penrose, Hawking, Tegmark for technical claims | Wrong tier of source |
|
||||
| **All notation defined in non-standard way** | Redefines basic operators (+, ×, ≤) without explicit warning | Not mathematics |
|
||||
| **No engagement with existing literature** | Zero citations to relevant peer-reviewed work or established preprints | scholarship was not done |
|
||||
| **Claims of "disproof" of widely-accepted theorems** | Without finding a peer-reviewed error in the existing proof | Almost certainly wrong |
|
||||
|
||||
---
|
||||
|
||||
## Evidence Tiers
|
||||
|
||||
| Tier | Artifact | What it Proves |
|
||||
|------|----------|----------------|
|
||||
| **T3 — Literature** | MathSciNet / Zentralblatt / Google Scholar citations showing the problem is real and open | Problem exists in the literature |
|
||||
| **T2 — Executable** | Python/Sage/Lean code that others can run to verify computation/formalization | Result is reproducible |
|
||||
| **T1 — Human-reviewed** | MO answer with upvotes, referee report, or explicit external review | Independent verification |
|
||||
| **T0 — Self-contained** | Clear statement + proof/computation in a single document, all definitions explicit | Standalone correctness |
|
||||
|
||||
A valid candidate must have at least **one** T3 citation (shows the problem is real) AND a verification artifact (T0 minimum; T2 ideal).
|
||||
|
||||
---
|
||||
|
||||
## Scoring Rubric
|
||||
|
||||
Score each candidate on **4 dimensions**, each 0–3. Maximum 12 points.
|
||||
|
||||
| Dimension | 3 (excellent) | 2 (good) | 1 (minimal) | 0 (absent) |
|
||||
|-----------|---------------|----------|-------------|------------|
|
||||
| **Boundedness** | Scope is explicitly finite/small (single lemma, finite classification < N, one SE question) | Scope is implied bounded but not quantified | Scope is large/vague but attackable | Unbounded or impossible scope |
|
||||
| **Verifiability** | T2 artifact (code/formalization) + T3 citation | T0 proof + T3 citation | Proof/computation only, no citations | No way to check independently |
|
||||
| **Usefulness** | Solves problem others actively need (cites known difficulty, fills formalization gap) | Solves a clean exercise or interesting special case | Interesting but no clear audience | Pointless or self-referential |
|
||||
| **Discipline** | No crank flags; explicit rejection criteria cleanly passed | Minor crank flags (vague wording) but overall sound | Some crank flags but bounded scope rescues it | Triggers multiple rejection rules |
|
||||
|
||||
**Thresholds**:
|
||||
- **8–12**: Legitimate shadow maths candidate — queue for work
|
||||
- **4–7**: Needs refinement — reject unless strong disciplinary context
|
||||
- **0–3**: Reject as crank / out-of-scope
|
||||
|
||||
---
|
||||
|
||||
## Three Worked Examples
|
||||
|
||||
### Example 1: Small Lemma — Bounded
|
||||
|
||||
**Candidate**: "Proposition 3.2 in 'Coarse Geometry and Coarse Embeddings' (Lang-Schlichenmaier 2005) states that every finite CW-complex has Markov property. The proof gives 'it follows by induction on skeleta' without handling the attaching map case. Fill the gap."
|
||||
|
||||
**Triage**:
|
||||
- **Category**: Small lemma (exposition repair + proof gap fill)
|
||||
- **Boundedness**: 3 — single proposition in a specific paper, 2–3 pages max
|
||||
- **Verifiability**: 3 — paper is cited (T3), self-contained proof in 20 lines (T0), can formalize in Lean (T2 possible)
|
||||
- **Usefulness**: 3 — readers of this paper hit this gap; Lean formalization needed for mathlib
|
||||
- **Discipline**: 3 — no crank flags; scoped, sourced, technical
|
||||
- **Total**: **12/12** → YES
|
||||
|
||||
**Action**: File ticket "MATH-LEMMA-001"; assign to formalization lane + human review.
|
||||
|
||||
---
|
||||
|
||||
### Example 2: Grand Unified Theory — CRANK
|
||||
|
||||
**Candidate**: "I have discovered the Energy-Conscious Riemann Hypothesis framework. The zeros of ζ(s) correspond to harmonic resonance frequencies in prime-number energy manifolds. Uses my new Operator-Weight theory."
|
||||
|
||||
**Triage**:
|
||||
- **Category**: N/A
|
||||
- **Rejection triggers**:
|
||||
- ✗ Unsourced grand theory (introduces "Energy-Conscious", "Operator-Weight" with no definition in standard math)
|
||||
- ✗ No verification path (no computation, no reference to known data)
|
||||
- ✗ No literature engagement (zero citations)
|
||||
- ✗ Vague mathematical objects ("energy", "resonance", "harmonic")
|
||||
- ✗ Claims new framework
|
||||
- **Score**: 0 — **REJECT**
|
||||
|
||||
**Action**: Close with reason "crank: unsourced grand theory + no verification path".
|
||||
|
||||
---
|
||||
|
||||
### Example 3: Computational Classification — Bounded
|
||||
|
||||
**Candidate**: "Compute all 3-headed Turing machines with 3 states that halt within 100 steps on the blank tape. There are 9 such machines. This fills an OEIS gap: A327000 only lists up to 2-state 2-symbol."
|
||||
|
||||
**Triage**:
|
||||
- **Category**: Computational classification + OEIS sequence
|
||||
- **Boundedness**: 3 — finite exhaustive enumeration (3^6 = 729 machines, filter to 9)
|
||||
- **Verifiability**: 2 — code is executable (T2), but no T3 citation of why this sequence matters yet
|
||||
- **Usefulness**: 2 — plugs a gap in the Busy Beaver frontier; OEIS entry gets concrete data
|
||||
- **Discipline**: 3 — explicit scope, reproducible, submits to OEIS (external review path)
|
||||
- **Total**: **10/12** → YES (minor fix: add motivation/references)
|
||||
|
||||
**Action**: Accept; write exhaustive script; submit OEIS draft with code + results; file MATH-COMP-001.
|
||||
|
||||
---
|
||||
|
||||
## Operational Use
|
||||
|
||||
### Triage Workflow
|
||||
|
||||
1. **Read candidate** (issue, email, self-generated idea).
|
||||
2. **Check rejection criteria first** — if any trigger → **REJECT** immediately, cite rule.
|
||||
3. If passes rejection gate, **score 4 dimensions**.
|
||||
4. **Score ≥8** → mark as `shadow-maths-candidate`, route to appropriate lane:
|
||||
- Lemma/exposition → `formalization-lane`
|
||||
- Computation → `compute-lane`
|
||||
- MO/SE answer → `answer-lane`
|
||||
- OEIS → `oeis-lane`
|
||||
5. **Score 4–7** → requires refinement; ask for:
|
||||
- Explicit scope bound
|
||||
- T3 citation
|
||||
- Verification artifact
|
||||
6. **Score ≤3** → reject with specific rule(s) triggered.
|
||||
|
||||
### Guardrail Enforcement
|
||||
|
||||
The following prompts/agents **must refuse** to work on any candidate that:
|
||||
- Triggers any rejection criterion (before any code/proof work)
|
||||
- Has no T3 citation (real problem statement from literature)
|
||||
- Has no bounded scope (cannot write ≤1-sentence problem statement)
|
||||
|
||||
Enforcement is a **pre-flight check** in the task intake pipeline.
|
||||
|
||||
---
|
||||
|
||||
## Revision History
|
||||
|
||||
- v1.0 — 2026-04-26 — initial rubric + 3 scored examples
|
||||
@@ -1,111 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================================
|
||||
# Agent Dispatch — One-shot prompt generator for fleet workers
|
||||
# ============================================================================
|
||||
# Refs: timmy-home #512
|
||||
#
|
||||
# Packages context, token, repo, issue, and Git/Gitea commands into a
|
||||
# copy-pasteable prompt for any agent (Claude, Sonnet, Kimi, Grok, etc.).
|
||||
#
|
||||
# Usage:
|
||||
# scripts/agent-dispatch.sh <agent> <repo> <issue#> [<org>]
|
||||
#
|
||||
# Supported agents:
|
||||
# sonnet, claude, kimi, grok, gemini, ezra, bezalel, allegro, timmy
|
||||
#
|
||||
# Example:
|
||||
# scripts/agent-dispatch.sh sonnet the-nexus 844 Timmy_Foundation
|
||||
# ============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
AGENT="${1:-}"
|
||||
REPO="${2:-}"
|
||||
ISSUE="${3:-}"
|
||||
ORG="${4:-Timmy_Foundation}"
|
||||
|
||||
TOKEN="${GITEA_TOKEN:-$(cat ~/.config/gitea/token 2>/dev/null || true)}"
|
||||
FORGE="https://forge.alexanderwhitestone.com"
|
||||
|
||||
if [ -z "$AGENT" ] || [ -z "$REPO" ] || [ -z "$ISSUE" ]; then
|
||||
echo "Usage: $0 <agent> <repo> <issue#> [<org>]"
|
||||
echo ""
|
||||
echo "Supported agents:"
|
||||
echo " sonnet — Anthropic Claude Sonnet (cloud, high-reasoning)"
|
||||
echo " claude — Anthropic Claude (general)"
|
||||
echo " kimi — Moonshot Kimi K2.5 (cloud, long-context)"
|
||||
echo " grok — xAI Grok (cloud, real-time)"
|
||||
echo " gemini — Google Gemini (cloud, multimodal)"
|
||||
echo " ezra — Local archivist house (read-before-write)"
|
||||
echo " bezalel — Local artificer house (proof-required)"
|
||||
echo " allegro — Local dispatch house (tempo-and-routing)"
|
||||
echo " timmy — Local sovereign house (final review)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate agent
|
||||
VALID_AGENTS="sonnet claude kimi grok gemini ezra bezalel allegro timmy"
|
||||
if ! echo "$VALID_AGENTS" | grep -qw "$AGENT"; then
|
||||
echo "ERROR: Unknown agent '$AGENT'"
|
||||
echo "Valid agents: $VALID_AGENTS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fetch issue details
|
||||
if [ -n "$TOKEN" ]; then
|
||||
ISSUE_JSON=$(curl -s -H "Authorization: token ${TOKEN}" \
|
||||
"${FORGE}/api/v1/repos/${ORG}/${REPO}/issues/${ISSUE}" 2>/dev/null || true)
|
||||
ISSUE_TITLE=$(echo "$ISSUE_JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('title',''))" 2>/dev/null || true)
|
||||
ISSUE_BODY=$(echo "$ISSUE_JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('body',''))" 2>/dev/null || true)
|
||||
else
|
||||
echo "WARNING: No Gitea token found. Issue details will be blank."
|
||||
ISSUE_TITLE=""
|
||||
ISSUE_BODY=""
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
================================================================================
|
||||
DISPATCH PROMPT — ${AGENT} → ${ORG}/${REPO}#${ISSUE}
|
||||
================================================================================
|
||||
|
||||
Agent: ${AGENT}
|
||||
Repo: ${ORG}/${REPO}
|
||||
Issue: #${ISSUE}
|
||||
Title: ${ISSUE_TITLE}
|
||||
|
||||
--- ISSUE BODY ---
|
||||
${ISSUE_BODY}
|
||||
|
||||
--- INSTRUCTIONS ---
|
||||
|
||||
1. Clone the repo:
|
||||
git clone --depth 1 "https://\${TOKEN}@forge.alexanderwhitestone.com/${ORG}/${REPO}.git"
|
||||
cd ${REPO}
|
||||
|
||||
2. Create branch:
|
||||
git checkout -b ${AGENT}/${REPO}-${ISSUE}
|
||||
|
||||
3. Read the issue, implement the fix or feature.
|
||||
|
||||
4. Test your changes locally.
|
||||
|
||||
5. Commit and push:
|
||||
git add -A
|
||||
git commit -m "[${AGENT}] ${ISSUE_TITLE} (#${ISSUE})"
|
||||
git push origin ${AGENT}/${REPO}-${ISSUE}
|
||||
|
||||
6. Open PR via Gitea API:
|
||||
curl -X POST \\
|
||||
-H "Authorization: token \${TOKEN}" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
"${FORGE}/api/v1/repos/${ORG}/${REPO}/pulls" \\
|
||||
-d '{"title":"[${AGENT}] ${ISSUE_TITLE}","head":"${AGENT}/${REPO}-${ISSUE}","base":"main","body":"Closes #${ISSUE}"}'
|
||||
|
||||
7. File new issues for anything discovered.
|
||||
|
||||
Token: \${GITEA_TOKEN} or ~/.config/gitea/token
|
||||
Forge: ${FORGE}
|
||||
|
||||
Sovereignty and service always.
|
||||
================================================================================
|
||||
EOF
|
||||
@@ -1,195 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ============================================================================
|
||||
# Sonnet Workforce Smoke Test
|
||||
# ============================================================================
|
||||
# Refs: timmy-home #512
|
||||
#
|
||||
# Validates that the Sonnet workforce agent can perform the full
|
||||
# clone → code → commit → push → PR workflow via Gitea HTTP.
|
||||
#
|
||||
# Usage:
|
||||
# scripts/sonnet-smoke-test.sh [--cleanup]
|
||||
#
|
||||
# Exit codes:
|
||||
# 0 — all checks passed
|
||||
# 1 — one or more checks failed
|
||||
# ============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
TOKEN="${GITEA_TOKEN:-$(cat ~/.config/gitea/token 2>/dev/null || true)}"
|
||||
FORGE="https://forge.alexanderwhitestone.com"
|
||||
ORG="Timmy_Foundation"
|
||||
REPO="timmy-home"
|
||||
TEST_BRANCH="smoke/sonnet-$(date +%s)"
|
||||
|
||||
# Colors
|
||||
GREEN='\\033[0;32m'
|
||||
RED='\\033[0;31m'
|
||||
YELLOW='\\033[0;33m'
|
||||
NC='\\033[0m'
|
||||
|
||||
PASS=0
|
||||
FAIL=0
|
||||
|
||||
log_pass() { echo -e "${GREEN}✓${NC} $1"; PASS=$((PASS + 1)); }
|
||||
log_fail() { echo -e "${RED}✗${NC} $1"; FAIL=$((FAIL + 1)); }
|
||||
log_info() { echo -e "${YELLOW}▶${NC} $1"; }
|
||||
|
||||
# ── Prerequisites ──────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
log_info "Checking prerequisites..."
|
||||
|
||||
if [ -z "$TOKEN" ]; then
|
||||
log_fail "Gitea token not found (checked GITEA_TOKEN env and ~/.config/gitea/token)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v git &>/dev/null; then
|
||||
log_fail "git not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v curl &>/dev/null; then
|
||||
log_fail "curl not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v python3 &>/dev/null; then
|
||||
log_fail "python3 not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_pass "Prerequisites OK"
|
||||
|
||||
# ── 1. Clone via Gitea HTTP ───────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
log_info "Step 1: Clone repo via Gitea HTTP..."
|
||||
|
||||
TMPDIR=$(mktemp -d)
|
||||
CLONE_URL="${FORGE}/${ORG}/${REPO}.git"
|
||||
|
||||
cd "$TMPDIR"
|
||||
if git clone --depth 1 "https://${TOKEN}@${FORGE#https://}/${ORG}/${REPO}.git" smoke-clone 2>/dev/null; then
|
||||
log_pass "Clone via Gitea HTTP"
|
||||
else
|
||||
log_fail "Clone via Gitea HTTP"
|
||||
rm -rf "$TMPDIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ── 2. Commit ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
log_info "Step 2: Create branch and commit..."
|
||||
|
||||
cd "$TMPDIR/smoke-clone"
|
||||
git checkout -b "$TEST_BRANCH" 2>/dev/null || true
|
||||
|
||||
# Make a harmless change
|
||||
printf "# Sonnet smoke test marker\\n# timestamp: %s\\n" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" > SONNET_SMOKE_MARKER.md
|
||||
git add SONNET_SMOKE_MARKER.md
|
||||
|
||||
if git -c user.email="sonnet@timmy.local" -c user.name="Sonnet Smoke Test" \
|
||||
commit -m "test: sonnet smoke test marker" 2>/dev/null; then
|
||||
log_pass "Commit created"
|
||||
else
|
||||
log_fail "Commit failed"
|
||||
rm -rf "$TMPDIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ── 3. Push ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
log_info "Step 3: Push branch..."
|
||||
|
||||
if git push origin "$TEST_BRANCH" 2>/dev/null; then
|
||||
log_pass "Push to origin"
|
||||
else
|
||||
log_fail "Push to origin"
|
||||
rm -rf "$TMPDIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ── 4. Create PR ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
log_info "Step 4: Create PR via Gitea API..."
|
||||
|
||||
PR_RESPONSE=$(curl -s -X POST \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${FORGE}/api/v1/repos/${ORG}/${REPO}/pulls" \
|
||||
-d "{
|
||||
\"title\": \"test: sonnet smoke test ${TEST_BRANCH}\",
|
||||
\"head\": \"${TEST_BRANCH}\",
|
||||
\"base\": \"main\",
|
||||
\"body\": \"Automated smoke test verifying Sonnet can clone, commit, push, and open a PR.\\n\\nRefs #512\"
|
||||
}" 2>/dev/null)
|
||||
|
||||
PR_NUMBER=$(echo "$PR_RESPONSE" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('number',''))")
|
||||
|
||||
if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "None" ]; then
|
||||
log_pass "PR created (#${PR_NUMBER})"
|
||||
PR_URL="${FORGE}/${ORG}/${REPO}/pulls/${PR_NUMBER}"
|
||||
echo " URL: $PR_URL"
|
||||
else
|
||||
log_fail "PR creation failed"
|
||||
echo " Response: $PR_RESPONSE"
|
||||
rm -rf "$TMPDIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ── 5. Verify PR exists ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
log_info "Step 5: Verify PR exists via API..."
|
||||
|
||||
PR_CHECK=$(curl -s -H "Authorization: token ${TOKEN}" \
|
||||
"${FORGE}/api/v1/repos/${ORG}/${REPO}/pulls/${PR_NUMBER}" 2>/dev/null)
|
||||
|
||||
PR_STATE=$(echo "$PR_CHECK" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('state',''))")
|
||||
|
||||
if [ "$PR_STATE" = "open" ]; then
|
||||
log_pass "PR verified open via API"
|
||||
else
|
||||
log_fail "PR state is '$PR_STATE', expected 'open'"
|
||||
fi
|
||||
|
||||
# ── Cleanup (optional) ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
if [ "${1:-}" = "--cleanup" ]; then
|
||||
log_info "Cleaning up smoke test artifacts..."
|
||||
curl -s -X PATCH -H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${FORGE}/api/v1/repos/${ORG}/${REPO}/pulls/${PR_NUMBER}" \
|
||||
-d '{"state":"closed"}' >/dev/null 2>&1 || true
|
||||
git push origin --delete "$TEST_BRANCH" 2>/dev/null || true
|
||||
log_pass "Cleanup complete"
|
||||
fi
|
||||
|
||||
rm -rf "$TMPDIR"
|
||||
|
||||
# ── Summary ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
echo ""
|
||||
echo "================================================================"
|
||||
echo " Sonnet Smoke Test Summary"
|
||||
echo "================================================================"
|
||||
echo -e " Passed: ${GREEN}${PASS}${NC}"
|
||||
echo -e " Failed: ${RED}${FAIL}${NC}"
|
||||
echo ""
|
||||
|
||||
if [ "$FAIL" -gt 0 ]; then
|
||||
echo -e "${RED}RESULT: FAILED${NC}"
|
||||
exit 1
|
||||
else
|
||||
echo -e "${GREEN}RESULT: PASSED${NC}"
|
||||
echo ""
|
||||
echo "Sonnet workforce is verified end-to-end:"
|
||||
echo " ✓ Clone via Gitea HTTP"
|
||||
echo " ✓ Branch + commit"
|
||||
echo " ✓ Push to origin"
|
||||
echo " ✓ Open PR via API"
|
||||
echo " ✓ Verify PR state"
|
||||
exit 0
|
||||
fi
|
||||
@@ -38,7 +38,6 @@ class House(Enum):
|
||||
EZRA = "ezra" # Archivist, reader
|
||||
BEZALEL = "bezalel" # Artificer, builder
|
||||
ALLEGRO = "allegro" # Tempo-and-dispatch, connected
|
||||
SONNET = "sonnet" # Anthropic Claude Sonnet (cloud, high-reasoning)
|
||||
|
||||
|
||||
class Mode(Enum):
|
||||
|
||||
Reference in New Issue
Block a user