Skip to content

fix: repair web interface + restore model tiering + add CI - #2

Merged
Ewertonslv merged 3 commits into
mainfrom
fix/web-module-and-model-tiering
Jun 8, 2026
Merged

fix: repair web interface + restore model tiering + add CI#2
Ewertonslv merged 3 commits into
mainfrom
fix/web-module-and-model-tiering

Conversation

@Ewertonslv

Copy link
Copy Markdown
Owner

Problem

The platform-structure refactor (ed8fdbd) left Monarch-IA half-migrated. On a clean checkout the test suite was 71 passed / 28 failed / 50 errors and python main.py crashed on startup:

  • The web app was moved to apps/monarch-web/ — a hyphenated, non-importable path — while main.py and test_web_app.py still imported interfaces.web.app → 50 import errors + broken entry point.
  • BaseAgent.run() called _call_claude_api directly, bypassing the _call_claude wrapper the tests stub → tests hit the real API (401).
  • Per-agent model routing collapsed to Sonnet-only; the tests expect an Opus/Sonnet/Haiku tier → 28 failures.
  • Agents recorded history under self.label (persona display name) instead of self.name.
  • HUB_READ_ONLY now defaults to true, blocking the write-path web tests (403).
  • A test patched a renamed attribute (agents.base._client_api_client).

Fix

  • Move the web app back to interfaces/web/ — its canonical in-process home next to cli.py and telegram_bot.py (it's an interface, not a standalone service; main.py runs it in-process). Drop the stale .gitignore legacy entry.
  • Restore per-agent model tiering: Opus for heavy reasoning (discovery, architecture, planning, devil's advocate, implementer, reviewer, security), Sonnet for prioritization/testing/deploy, Haiku for documentation/observability.
  • Route run() through _call_claude so the LLM call is stubbable.
  • Record task history under the agent name (orchestrator convention).
  • HUB_READ_ONLY=false in the test env; fix the stale _client patch and the project-detail summary test.
  • Apply ruff safe autofixes repo-wide + tune lint config.
  • Add GitHub Actions CI (ruff + pytest, Python 3.12).

Result

  • 149 passed, 0 failed (was 71/28/50).
  • ruff check . → all checks passed.
  • python main.py imports resolve again.

mypy strict is not yet wired in (118 pre-existing annotation gaps, mostly missing return types in the web layer + main.py) — left for a follow-up.

🤖 Generated with Claude Code

Ewertonslv and others added 3 commits June 8, 2026 16:59
The platform-structure refactor (ed8fdbd) left the project half-migrated:
the web app was moved to apps/monarch-web/ (a non-importable hyphenated path)
while main.py and the test suite still imported interfaces.web.app; the
Claude-call test seam bypassed the _call_claude wrapper, the API client was
renamed, per-agent model routing collapsed to Sonnet-only, and HUB_READ_ONLY
defaulted to true under the write-path tests. Suite was 71 passed/28 failed/50 errors.

- Move the web app back to interfaces/web/ (its canonical in-process home next
  to cli.py and telegram_bot.py); drop the stale .gitignore legacy entry.
- Restore per-agent model tiering: Opus for heavy reasoning (discovery,
  architecture, planning, devils-advocate, implementer, reviewer, security),
  Sonnet for prioritization/testing/deploy, Haiku for documentation/observability.
- Route run() through the _call_claude wrapper so tests can stub the LLM call.
- Record task history under the agent name (not display label), matching the
  orchestrator convention and the tests.
- Set HUB_READ_ONLY=false in the test env; fix stale _client and path references.
- Update the project-detail test for the execution/implementation summaries.
- Apply ruff safe autofixes repo-wide and tune lint config.

Test suite: 149 passed, 0 failed. ruff: all checks passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Runs ruff lint and the core pytest suite on push/PR to main (Python 3.12).
mypy strict is not yet wired in (118 pre-existing annotation gaps in the web
layer and main.py) and is left for a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The file was still under a .gitignore entry when ruff --fix first ran, so its
issues were missed locally and surfaced in CI: remove unused StaticFiles and
TaskStatus imports, hoist 'import os' to the top import block.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Ewertonslv
Ewertonslv merged commit 42cc8a8 into main Jun 8, 2026
1 check passed
@Ewertonslv
Ewertonslv deleted the fix/web-module-and-model-tiering branch June 8, 2026 20:12
Ewertonslv added a commit that referenced this pull request Jun 9, 2026
fix: repair web interface + restore model tiering + add CI
Ewertonslv added a commit that referenced this pull request Jun 11, 2026
fix: repair web interface + restore model tiering + add CI
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.

1 participant