refactor(agent-runtime): replace dead litter-bridge gateway with metadata publisher - #270
Open
0xSero wants to merge 1 commit into
Open
refactor(agent-runtime): replace dead litter-bridge gateway with metadata publisher#2700xSero wants to merge 1 commit into
0xSero wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Delete the dead
litter-bridgeHTTP gateway (Design A) and keep only thelitter-bridge.jsonmetadata publishing that the KittyLitter daemon still reads.The gateway served
/api/litter-bridge/v1on:8081— a signed, versioned bridge forwarding controller-status, session-read, and agent-turn from the KittyLitter daemon. Design B replaced it with a scopedPiBridgeon the daemon side (alleycatf443a83), 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:
/api/litter-bridge/v1(dead — no caller remains).litter-bridge.jsonpublishingpiAgentDirandpiRuntimeso the daemon launches the same Pi version and data dir this instance owns (live — alleycat reads it viaload_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 gatewayshared/agent/litter-bridge.test.ts(526 lines)server.tsdrops the HTTP route and calls the new publisher'spublishMetadata/dispose, which write and clean up the samelitter-bridge.jsonwith the same schema.Size
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.jsonschema is unchanged, so the daemon'sload_gateway_metadatacontinues to work. Theinstall-desktop-app.shchange stashed ondevis unrelated and not included.