Skip to content

fix(register): st_register honors configured faction, not hardcoded COSMIC (v2.9.4)#58

Merged
mabry1985 merged 1 commit into
mainfrom
fix/register-honors-config-faction
Jul 12, 2026
Merged

fix(register): st_register honors configured faction, not hardcoded COSMIC (v2.9.4)#58
mabry1985 merged 1 commit into
mainfrom
fix/register-honors-config-faction

Conversation

@mabry1985

Copy link
Copy Markdown
Member

Closes #57.

The bug that lost the wipe

st_register defaulted faction="COSMIC" (a literal). At the 2026-07-12 wipe we had pre-configured DOMINION to escape COSMIC's crowded home system. Recovery raced:

  • _recoverrecover_from_reset registered PROTOTRADER@DOMINION correctly (it uses faction()).
  • The agent's own auto-st_register (the 4113 error message prompts "re-register", no faction passed) minted PROTOTRADER-98@COSMIC — the tool default — and its token overwrote the DOMINION one.

The faction was doomed either way: the agent's path never honored the config. We landed in COSMIC, whose new system saturated within ~35 min — the exact dead-end the switch was meant to avoid.

Fix

st_register's faction now defaults to the configured faction() (then COSMIC as the ultimate fallback for brand-new users). Every registration path — agent tool call and supervisor recovery — honors the operator's Starting Faction, so the race is harmless (both register the same faction).

One line where it mattered:

-async def st_register(symbol: str, faction: str = "COSMIC", ...):
+async def st_register(symbol: str, faction: str = "", ...):
+    faction = (faction or "").strip() or _config_faction()

Tests

test_register_faction.py (3): omitted faction → configured DOMINION; explicit faction overrides; unconfigured → COSMIC fallback preserved. Full suite 342 green, ruff clean.

Follow-ups (in #57)

Cosmetic now that faction is correct: the double-register still mints a suffixed call sign (both paths register) — an idempotency guard (skip re-register when the current token is already valid) would keep the clean call sign. Separately: call-sign-persist (set_call_sign is in-process only).

🤖 Generated with Claude Code

…oded COSMIC (v2.9.4)

Closes #57. st_register defaulted faction to the literal "COSMIC". At the 2026-07-12
wipe, the agent auto-re-registered (the 4113 error prompts "re-register", no faction
passed) and minted a COSMIC agent — clobbering _recover's configured-DOMINION
registration (recover_from_reset correctly uses faction()). Whichever token saved
last won, so the operator's pre-wipe DOMINION switch was defeated regardless of the
race; we landed in the crowded default faction (which saturated within ~35 min).

Fix: st_register's faction defaults to the CONFIGURED faction() (then COSMIC as the
ultimate fallback for brand-new users), so EVERY registration path — agent tool call
and supervisor recovery alike — honors the operator's Starting Faction, and the
race becomes harmless (both paths register the same faction).

3 tests (test_register_faction.py): omitted faction → configured (DOMINION); explicit
faction still overrides; unconfigured → COSMIC fallback preserved. Full suite 342 green.

Follow-up (noted in #57): the double-register still mints a suffixed call sign
(PROTOTRADER-98) because both paths register — cosmetic now that faction is correct;
an idempotency guard (skip re-register when the current token is already valid) would
also keep the clean call sign. Separate: v2.9.x call-sign-persist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@protoquinn

protoquinn Bot commented Jul 12, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Audit — PR #58 | fix(register): st_register honors configured faction, not hardcoded COSMIC (v2.9.4)

VERDICT: PASS


CI Status

  • test: in_progress ⏳

Diff Review

  • tools.py: st_register faction default changed from "COSMIC""", resolved via _config_faction() with COSMIC ultimate fallback — correct logic
  • test_register_faction.py: 3 tests cover all paths (configured → DOMINION, explicit override, unconfigured → COSMIC)
  • protoagent.plugin.yaml: version bump 2.9.3 → 2.9.4

Observations

  • LOW: CI still settling — approve-on-green policy promotes this to APPROVED once terminal-green

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jul 12, 2026

Copy link
Copy Markdown

Submitted COMMENT review on #58.

@protoquinn

protoquinn Bot commented Jul 12, 2026

Copy link
Copy Markdown

✅ CI went terminal-green with no blockers on the prior review — promoting it to APPROVED per the approve-on-green policy (#748).

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI terminal-green, no blockers on prior review — auto-approving on green (#748).

@mabry1985
mabry1985 merged commit 26c3e74 into main Jul 12, 2026
1 check passed
@mabry1985
mabry1985 deleted the fix/register-honors-config-faction branch July 12, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wipe: agent's autonomous st_register races _recover and overwrites the faction-correct registration

1 participant