Skip to content

refactor(agent-runtime): replace dead litter-bridge gateway with metadata publisher - #270

Open
0xSero wants to merge 1 commit into
devfrom
refactor/litter-bridge-metadata
Open

refactor(agent-runtime): replace dead litter-bridge gateway with metadata publisher#270
0xSero wants to merge 1 commit into
devfrom
refactor/litter-bridge-metadata

Conversation

@0xSero

@0xSero 0xSero commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Delete the dead litter-bridge HTTP gateway (Design A) and keep only the litter-bridge.json metadata publishing that the KittyLitter daemon still reads.

The gateway served /api/litter-bridge/v1 on :8081 — a signed, versioned bridge forwarding controller-status, session-read, and agent-turn from the KittyLitter daemon. Design B replaced it with a scoped PiBridge on the daemon side (alleycat f443a83), and the alleycat HTTP client that called this endpoint was deleted in alleycat PR #34. The gateway was left running, used by nobody.

Key changes

The gateway did two things; only #2 is live:

  1. Served /api/litter-bridge/v1 (dead — no caller remains).
  2. Wrote litter-bridge.json publishing piAgentDir and piRuntime so the daemon launches the same Pi version and data dir this instance owns (live — alleycat reads it via load_gateway_metadata).

Extract #2 into a focused 150-line module (litter-bridge-metadata.ts) and delete the rest:

  • services/agent-runtime/src/litter-bridge-gateway.ts (3,346 lines)
  • services/agent-runtime/src/litter-bridge-mutation-ledger.ts (571 lines)
  • services/agent-runtime/test/litter-bridge-gateway.test.ts (1,596 lines)
  • services/agent-runtime/test/litter-bridge-mutation-ledger.test.ts (229 lines)
  • shared/agent/litter-bridge.ts (700 lines) — only imported by the gateway
  • shared/agent/litter-bridge.test.ts (526 lines)

server.ts drops the HTTP route and calls the new publisher's publishMetadata/dispose, which write and clean up the same litter-bridge.json with the same schema.

Size

  • ~150 additions / 6,968 deletions across 8 files

Verification

  • services/agent-runtime: bun test — 25 pass, 0 fail.
  • services/agent-runtime: tsc --noEmit — clean.
  • npm run check:contracts — passed.
  • npm run check:structure — passed.

Notes

Depends conceptually on alleycat PR #34 (which deleted the HTTP client). The litter-bridge.json schema is unchanged, so the daemon's load_gateway_metadata continues to work. The install-desktop-app.sh change stashed on dev is unrelated and not included.

…data publisher

The litter-bridge HTTP gateway (/api/litter-bridge/v1) was Design A: a
signed, versioned bridge that forwarded controller-status, session-read,
and agent-turn requests from the KittyLitter daemon. Design B replaced
it with a scoped PiBridge on the daemon side (alleycat f443a83), and the
alleycat HTTP client that called this endpoint was deleted in alleycat
PR #34. The gateway was left running on 127.0.0.1:8081, used by nobody.

The gateway did two things; only one is still live:

1. Served /api/litter-bridge/v1 (dead — no caller remains).
2. Wrote litter-bridge.json publishing piAgentDir and piRuntime so the
   KittyLitter daemon can launch the same Pi version and data dir this
   instance owns (live — alleycat reads it via load_gateway_metadata).

Extract the live metadata publishing into a focused 150-line module
(litter-bridge-metadata.ts) and delete the rest:

- services/agent-runtime/src/litter-bridge-gateway.ts (3,346 lines)
- services/agent-runtime/src/litter-bridge-mutation-ledger.ts (571 lines)
- services/agent-runtime/test/litter-bridge-gateway.test.ts (1,596 lines)
- services/agent-runtime/test/litter-bridge-mutation-ledger.test.ts (229 lines)
- shared/agent/litter-bridge.ts (700 lines) — only imported by the gateway
- shared/agent/litter-bridge.test.ts (526 lines)

server.ts drops the HTTP route and calls the new publisher's
publishMetadata/dispose, which write and clean up the same
litter-bridge.json with the same schema.

Verified:
- services/agent-runtime: bun test 25 pass, 0 fail.
- services/agent-runtime: tsc --noEmit clean.
- npm run check:contracts: passed.
- npm run check:structure: passed.
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