core/lib/ipc: generalize for multi-tool use #20
Labels
No labels
harness
proj-core-console
proj-core-demo
proj-core-edit
proj-core-init
proj-core-lib
proj-core-login
proj-core-res
proj-core-sh
proj-core-theme
proj-docs
proj-extra-calc
proj-extra-code
proj-extra-playbook
proj-extra-sheets
proj-harness
proj-os
residual
tier-0-trivial
tier-1-easy
tier-2-medium
tier-3-hard
tier-4-major
tier-5-epic
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/.agent#20
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
IPC library generalization
The
core/lib/ipclibrary is currently tightly coupled toresidual-init's use case. It needs to become a general-purpose IPC library that other tools (res-playbook, res-code plugins, res-console plugins) can use with program-specific wrappers.current state
core/lib/ipcprovides:Message{Type, Payload, ID}— wire formatServer— UDS listener with handler dispatchClient— UDS connector with Call/NotifyThis works for
residual-initbut has limitations for other use cases:ReadMessage()on Client for handshake/declare patternsgoal
Make
core/lib/ipca generic foundation, with program-specific wrappers living in each tool's own packages.plan
Phase 1: Core improvements
ReadMessage()toipc.Client— reads one raw message from the connection (for handshake/declare patterns)ReadMessage()toipc.Serverconn handler — allows server-side reading of client-initiated messagesPhase 2: Simplified helpers (optional, low priority)
Phase 3: Program-specific wrappers
Each tool implements its own wrappers on top of the generic library:
res-playbook/internal/playbook/langs/— runtime client/serverres-code/internal/code/plugin/— plugin client/server (future)res-console/internal/libs/console/plugin/— plugin client/server (future)design principle
Follow the pattern from
core/lib/script:files to change
core/lib/ipc/client.go— addReadMessage()core/lib/ipc/ipc_test.go— add tests for new functionalityverification
cd core && go build ./... && go test ./...residual-initIPC continues to work unchangedres-playbookuses the newReadMessage()for declare handshakelabels
proj-core-lib,tier-2-medium