Skip to content

Restore codedb serve --port HTTP endpoint on Zig 0.16 #307

@justrach

Description

@justrach

Summary

codedb serve --port is currently stubbed out with error.ServerDisabledOn016 (commit 56ea465, v0.2.578) after the Zig 0.16 migration removed std.net. MCP stdio is the primary entry, but losing the HTTP port means several local workflows no longer work:

  • Pointing a browser/tool at http://localhost:7719 for a quick symbol/outline lookup without wiring up MCP
  • curl probes from shell scripts, test harnesses, and CI health checks
  • Non-MCP clients (editors, dashboards) that speak plain HTTP/JSON
  • Running multiple lightweight readers against one indexed project

What's needed

Port the pre-0.16 implementation to the new std.Io.net surface:

  • std.Io.net.IpAddress.parse / .listen to bind 127.0.0.1:<port>
  • srv.accept(io) loop, handing each stream off to a detached thread (matches prior behavior)
  • stream.close(io) for teardown

The route set and JSON response shapes should match the pre-0.16 build byte-for-byte so existing clients don't need changes. The reference implementation is recoverable via git show 0.2.578~0:src/server.zig — the logic stays, only the transport layer is rewritten.

Scope

  • src/server.zig — replace the stub with a working implementation
  • No API surface changes outside of re-enabling the command

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions