[P1-03] Extract concrete adapters behind explicit runtime-owned typed ports #136
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server#136
Loading…
Add table
Add a link
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?
ARDR reconciliation — 2026-08-29
Canonical research/design now exist for this issue:
lost-rob0t/starintel-auto-research/roam/research/star-server/STAR-RESEARCH-041-concrete-adapter-extraction.org—READY_FOR_DESIGN.lost-rob0t/starintel-auto-research/roam/design/star-server/STAR-SERVER-048-concrete-adapter-extraction.org—DESIGN_READY_FOR_OPERATOR_REVIEW.Current-source findings
Current
masterremains one serial:starintel-gserverASDF system whose direct dependency closure includes cl-couch, cl-rabbit, Sento, Dexador, Clack/Hunchentoot, Ningle, lparallel and related service/runtime libraries.Do not interpret this issue as a mechanical five-package rewrite. Current code already has useful seams that must be preserved and promoted:
star.leases:lease-storeis already a backend-neutral protocol with memory and Valkey implementations.The missing invariant is dependency direction: application operations from #40 depend only on narrow typed ports; concrete adapters implement those ports; the existing
star.runtime/ service composition root constructs and owns concrete instances.Dependency order
service-call-context+ typed application ports/results.Adapter responsibilities
HTTP
Transport parsing, auth-context projection, request/result serialization, status/headers, CORS/version aliases. HTTP must not perform CouchDB/Rabbit/lease/scheduling application orchestration directly once the corresponding application operation migrates.
CouchDB
Pool/session/request/view/revision/storage/outbox mechanics and concrete failure normalization. Application code sees capability-specific repository/query/outbox ports, not raw clients or
*couchdb-pool*.RabbitMQ
Connection/channel ownership, topology, envelope transport, settlement, bounded prefetch/backpressure, retry/DLQ/quarantine transport mechanics and broker-failure normalization. Application services decide logical policy/events.
Valkey
Reuse the existing
lease-storeprotocol. Valkey scripts/serialization/server-time/fencing remain concrete details. Do not create another KV/lease abstraction.Scheduler/timers
Own timer registration/cancellation effects under #37 lifecycle. Application services produce typed schedule/recovery intentions and callbacks re-enter application operations.
Proposed implementation slices — ALL PENDING OPERATOR APPROVAL
Slice 1 — first read-only repository vertical
Depends on realized #39/#40 first slices.
Choose the smallest existing document/query operation with an injected-I/O seam. Define one narrow repository port, fake implementation, typed application result, and concrete CouchDB implementation.
Mandatory RED-first target: on the untouched post-#39/#40 baseline, the selected application operation still requires the concrete/default CouchDB seam or lacks the runtime-owned port. The RED must prove the application/core test cannot run with only a fake repository and a dependency closure excluding
cl-couch.GREEN must prove:
cl-couch;Do not obtain GREEN by mocking/rebinding a concrete CouchDB package symbol.
Slice 2 — concrete CouchDB conformance
Success, not-found, conflict/invalid where relevant, deadline/timeout, backend-unavailable and malformed-backend-result behavior normalize into the typed port contract.
Slice 3 — HTTP projection
Route one existing endpoint through that exact application operation. A fake application service must drive HTTP response projection with zero CouchDB/Rabbit invocation.
Slice 4 — Rabbit vertical
Migrate one ingress/publication path through the same application policy. Broker ingress cannot bypass authorization/idempotency/deadline semantics.
Slice 5 — existing lease-store composition
Wire the current backend-neutral lease-store through the runtime-owned port used by the #32 lease application service. No lease algebra rewrite.
Slice 6 — scheduler effect
Extract one target/recovery timer operation behind a scheduler port while #37 remains lifecycle authority.
Slice 7 — dependency gates and vertical expansion
Expand operation-by-operation and add ASDF/package tests preventing concrete libraries from leaking back into application/core systems.
Acceptance criteria
Implementation authorization
PENDING / AWAITING_OPERATOR_IMPLEMENTATION_APPROVALREADY_FOR_DESIGN, design completion/adversarial review, issue state, CI, or publication do not authorize RAGE implementation. Only explicit operator authorization recorded in the canonical approval workflow may do that.