Skip to content

LLC dashboard: company-context plumbing + 5 missing/redesign endpoints (from wiring audit #9851) #9861

Closed

Description

@mrveiss

Follow-up from the API wiring audit (#9851). These LLC items need backend work or a frontend redesign beyond path wiring, so they were not patched blind. Until implemented, the relevant UI elements should be feature-flagged off (no dead buttons).

Root blocker: company-context plumbing

CompanyDashboard.vue, SubCompanyTree.vue, GoalTree.vue, OrgChart.vue read route.params.companyId, but their routes (/llc/dashboard, /llc/companies, /llc/goals, /llc/org-chart) define no :companyId param, and there is no company store. So companyId is always undefined and these views can't call the (company-scoped) backend. Decide the source of company context (route param vs Pinia store vs query) and thread it through.

Endpoints needing implementation / redesign

  • GET /api/llc/companies/tree (SubCompanyTree) — no global tree route; build client-side from /api/llc/companies/ once context exists.
  • GET /api/llc/goals/tree (GoalTree fetchGoals) — assemble client-side from flat /api/llc/goals?company_id= (parent_goal_id present) once context exists.
  • GET /api/llc/org-chart (OrgChart) — no agent reporting hierarchy is exposed; add a backend endpoint or render a degraded flat list. Pause/resume must use /api/llc/companies/{company_id}/controls/agents/{agent_id}/pause|resume.
  • POST /api/llc/companies/{id}/backlog/reorder (BacklogView) — LLCWorkItem.backlog_position exists; add a bulk-reorder write endpoint + ordering semantics.
  • POST /api/llc/work-items/suggest-ac (BacklogView) — needs an LLM-backed acceptance-criteria service; only the storage field exists.

Security hardening (noted by commit review)

  • Pre-existing work_items.py routes (/products, get_work_item, etc.) query by id without a tenant check (potential IDOR). The new /activity route was hardened with require_org_context; apply the same to the siblings.

Parent: #9851

Activity

  1. mrveiss commented on Jun 10, 2026

    @mrveiss
    OwnerAuthor

    LLC ship pass — PR #9902 (llc-ship → Dev_new_gui)

    After rebasing onto latest Dev_new_gui (PR #9862 had already fixed 9 of the original 16 unwired LLC calls), the remaining 7 unwired /api/llc calls are now resolved and the module is functional end-to-end:

    Resolved here

    • ✅ OrgChart → new read-only GET /companies/{id}/org-chart + controls pause/resume
    • ✅ Company hierarchy (SubCompanyTree) → companies/ + per-root tree
    • ✅ Goal tree → flat goals?company_id= + client build
    • ✅ HeartbeatMonitor agents query
    • ✅ Company-context root blocker → useLlcCompanyContext (route param → ?company= → first company); wired into OrgChart, GoalTree, CompanyDashboard
    • ✅ LLC wiring audit exits 0 for /api/llc; blocking CI gate added (llc-contract.yml) + hermetic core-loop e2e (1 passed)

    Flagged off (no backend — no dead buttons), still tracked under this issue:

    • ⏳ POST /companies/{id}/backlog/reorder (BacklogView drag-reorder) — VITE_FEATURE_LLC_BACKLOG_REORDER
    • ⏳ POST /work-items/suggest-ac (LLM-backed) — VITE_FEATURE_LLC_SUGGEST_AC
    • ⏳ org-chart budget/assigned_item_count enrichment (currently 0 when no budget row)

    Discoveries filed: #9899 (AgentOrgNode↔migration drift), #9900 (2 unmounted routers, non-LLC), #9901 (no budget-provisioning endpoint).

    Keeping this issue open for the three ⏳ backend items above.

  2. mrveiss commented on Jun 10, 2026

    @mrveiss
    OwnerAuthor

    Bug sweep 2026-06-10 → TOO-BIG. Needs backend + frontend work beyond path wiring: a company-context source (route param vs Pinia store) threaded through 4 LLC views, 5 missing/redesigned endpoints (org-chart, goals/tree, backlog/reorder, suggest-ac LLM service, companies/tree), plus IDOR hardening on sibling work_items.py routes. Multi-surface feature work — out of scope for the sweep.

  3. mrveiss commented on Jun 10, 2026

    @mrveiss
    OwnerAuthor

    Session wrap-up (2026-06-10): the LLC ship (PR #9902, merged) also surfaced follow-up discoveries now tracked separately — #9909 (consolidate duplicated tree-build / statusColor / run-status mapping across the LLC views) is in this issue's frontend area. Open backend items for this umbrella remain: backlog-reorder endpoint, work-items/suggest-ac (LLM-backed), org-chart budget/assigned-count enrichment. Discoveries #9899 (AgentOrgNode↔migration drift) and #9901 (no budget-provisioning endpoint) also relate.

  4. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

    PR #10034 (merged to Dev_new_gui) references this issue with a close keyword.

    feat(llc/api): backlog reorder + suggest-AC, org-chart enrichment, full work-items tenant scoping (#9861)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  5. mrveiss commented on Jun 12, 2026

    @mrveiss
    OwnerAuthor

    Closed — merged to Dev_new_gui via PR #10034 (squash commit 824552668). This completes the issue's rescoped remainder; earlier portions shipped via PR #9902 (context plumbing, tree assembly, org-chart endpoint), #9627/PR #9997 (company selector/store), #9901/PR #9981 (budget provisioning).

    Checklist accounting:

    76 tests green; independent review round (3 HIGH security/functional findings fixed — both new endpoints initially lacked auth; write-only backlog_position); all 4 LLC CI gates green.

    Follow-ups: UI re-enabling of the reorder/suggest-AC buttons in BacklogView (flags still off — payload contract is { work_item_ids: [...] }); discoveries #10032 (dual agent-id keyspace), #9980 linked at the enum-filter site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions