Skip to content

Establish Go/C++ backend migration foundation with contract-compatible API, orchestration, and agent scaffolding#2

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/convert-backend-to-golang-cpp
Draft

Establish Go/C++ backend migration foundation with contract-compatible API, orchestration, and agent scaffolding#2
Copilot wants to merge 4 commits into
masterfrom
copilot/convert-backend-to-golang-cpp

Conversation

Copy link
Copy Markdown

Copilot AI commented May 19, 2026

This PR lays down the migration baseline to move backend ownership in-house: Go for REST/orchestration services and C++ for systems-level agent logic. It introduces a polyglot monorepo structure, preserves current API/socket contracts, and provides initial vertical-slice implementations for auth/policy/user/log and agent core capabilities.

  • Monorepo structure for migration targets

    • Added service and agent roots:
      • services/go-api
      • services/go-master
      • agents/cpp-node-exporter
      • contracts
    • Added internal ownership/versioning policy for in-repo backend packages.
  • Go API service (services/go-api)

    • Implemented route-compatible handlers for auth, user, policy, and logs.
    • Replaced external shared backend helpers with in-house modules:
      • validation/error response utilities
      • JWT signing/verification
      • password hashing/verification
      • auth/admin middleware
    • Added migration controls:
      • REST shadow forwarding toggle (ORCS_SHADOW_REST)
      • configurable legacy target (ORCS_LEGACY_API_BASE)
    • Added CORS hardening and bounded log response allocation.
  • Go orchestration service (services/go-master)

    • Introduced realtime service scaffold with preserved event names/payload envelope semantics.
    • Added event contract constants aligned with existing socket flows.
    • Added migration flags for staged socket cutover behavior.
  • C++ systems agent foundation (agents/cpp-node-exporter)

    • Added reusable internal libraries:
      • orcs_process (process discovery/termination)
      • orcs_telemetry (system telemetry)
      • orcs_platform (OS adapters for Linux/Windows/macOS)
    • Added agent executable skeleton and CMake/CTest project layout.
  • Contract freeze artifacts (contracts)

    • Added REST contract spec (rest-api.yaml) for current endpoint surface.
    • Added socket event contract map (socket-events.json) to preserve event compatibility.
// in-house auth middleware replacing external shared package usage
mux.HandleFunc("/policy/setPolicy", h.requireAdmin(h.setPolicy))
mux.HandleFunc("/policy/updatePolicy", h.requireAdmin(h.updatePolicy))

Copilot AI and others added 4 commits May 19, 2026 22:52
Agent-Logs-Url: https://github.com/orcs-toolkit/orcs/sessions/5ba679ff-6c5e-428c-b4d3-476d24f5926f

Co-authored-by: shreyasssk <35000429+shreyasssk@users.noreply.github.com>
Agent-Logs-Url: https://github.com/orcs-toolkit/orcs/sessions/5ba679ff-6c5e-428c-b4d3-476d24f5926f

Co-authored-by: shreyasssk <35000429+shreyasssk@users.noreply.github.com>
Agent-Logs-Url: https://github.com/orcs-toolkit/orcs/sessions/5ba679ff-6c5e-428c-b4d3-476d24f5926f

Co-authored-by: shreyasssk <35000429+shreyasssk@users.noreply.github.com>
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.

2 participants