Skip to content

fix(llc): address MVA-820 CR medium-priority findings for GH#8211 - #8456

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
issue-8211-fixes
May 23, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
issue-8211-fixes

Conversation

@mrveiss

@mrveiss mrveiss commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #8452. Addresses medium and low-priority findings from the MVA-820 code review that were not covered by the critical-fix squash.

Test plan

  • python -m py_compile llc/services/company.py llc/models/company.py llc/api/companies.py — passes
  • python -m pytest autobot-backend/llc/ -k company -v — existing tests pass
  • Manual: PATCH /{id} with llc_status should be rejected by Pydantic
  • Manual: suspend(ARCHIVED_company) should raise ValueError
  • Manual: soft-delete + re-create same prefix — should succeed

🤖 Generated with Claude Code

- _assert_prefix_unique: add deleted_at IS NULL guard so soft-deleted
  orgs no longer permanently poison their issue_prefix slot (#5)
- CompanyUpdate: remove llc_status field — callers must use dedicated
  suspend()/archive() methods to enforce transition guards (#6)
- API handlers: add session.rollback() in all except branches and a
  bare Exception fallback to keep the connection pool clean on
  IntegrityError and other unexpected failures (#7)
- delete endpoint: catch CompanyHasChildrenError → 409 with rollback (#7)
- suspend()/archive(): add state transition matrix — suspend only from
  ONBOARDING/ACTIVE, archive only from PAUSED/OFFBOARDING; raises
  ValueError on invalid transition (#8)
- get_ancestry: chain.append + chain.reverse() instead of insert(0),
  eliminating O(n²) list-copy on deep hierarchies (#9)
- _build_tree_node: asyncio.gather children instead of sequential
  await, reducing tree fetch to O(depth) round-trips (#10)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ SSOT Configuration Compliance: Violations Found

Metric Count
Total Violations 7
SSOT Violations (high priority) 7
Other Violations 0

⚠️ 7 values have SSOT config equivalents!

These should be replaced with SSOT config imports:

Python:

from src.config.ssot_config import config
# Use: config.vm.main, config.port.backend, config.backend_url

TypeScript:

import config from '@/config/ssot-config'
// Use: config.vm.main, config.port.backend, config.backendUrl

📖 See SSOT_CONFIG_GUIDE.md for documentation.

@mrveiss
mrveiss merged commit 3edba73 into Dev_new_gui May 23, 2026
7 of 14 checks passed
@mrveiss
mrveiss deleted the issue-8211-fixes branch May 23, 2026 09:48
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