Extract runtime directory resolution into starlang-runtime #33

Merged
lost-rob0t merged 7 commits from extract/runtime-directory-core into main 2026-08-15 14:49:26 +00:00
lost-rob0t commented 2026-08-15 14:47:01 +00:00 (Migrated from github.com)

Scope

Continue STAR-LANG-006's dependency-ordered extraction after PR #32 by moving the injected runtime-directory discovery/resolution boundary from prototype/runtime-directory-prototype.lisp into final starlang-runtime.

This slice follows the already-APPROVED STAR-LANG-004 service-discovery contract.

Final runtime authority

starlang-runtime now owns:

  • runtime-directory port construction
  • injected snapshot execution/error boundary
  • portable runtime-directory entry validation
  • actor name/runtime/liveness validation
  • capability list validation
  • STAR service URI ↔ actor/domain/address consistency
  • exact canonical star:// lookup over snapshots
  • duplicate-registration rejection
  • distinct missing-service and unavailable-service conditions
  • :alive :unknown compatibility semantics
  • defensive-copy results

No second registry

This does not add mutable directory storage or a global registry. The final runtime directory remains an injected snapshot port exactly as STAR-LANG-004 specifies. Each resolution obtains a current snapshot from the caller-provided source.

The existing local actor registry inside starlang-runtime remains a separate local execution mechanism; this slice does not merge or duplicate it.

Prototype compatibility

prototype/runtime-directory-prototype.lisp is reduced to:

  • the historical source-facing runtime-directory-error
  • a final type alias / predicate
  • standalone ASDF loading
  • thin delegates
  • condition translation preserving legacy prototype condition names

No independent snapshot validator or resolution algorithm remains in the prototype file.

Preserved failure distinctions

  • malformed STAR URI → protocol invalid-URI condition (translated by prototype compatibility)
  • missing service → typed not-found condition
  • registered with :alive nil → typed unavailable condition
  • duplicate exact service URI → runtime-directory error
  • :alive :unknown remains resolvable because the approved v1 contract rejects only explicit nil

Out of scope

  • deterministic dispatcher extraction
  • remote transport selection
  • Sento registry implementation
  • global/distributed registries
  • DNS/Consul/Kubernetes discovery
  • runtime endpoint materialization
  • lease/fencing changes

Extraction metrics

CI on final head 3655269adcca038af56be7774aae9b06dc59c7e9 reports:

  • aggregate prototype/**/*.lisp: 19,545 → 19,479 LOC (-66)
  • prototype/runtime-directory-prototype.lisp: +37 / -103, net -66 lines
  • final starlang-runtime/src/runtime-directory.lisp: 156 LOC

Validation

GitHub Actions is green:

  • independent target-system loading ✅
  • final actor protocol / canonical JSON / journal / lease / mailbox / Sento tests ✅
  • asdf:test-system :starlang-runtime ✅ with direct runtime-directory coverage
  • runtime directory tested for live resolution, defensive copies, missing vs unavailable, :unknown, duplicate entries, malformed metadata, backend failures, URI errors, and injected/no-global-cache behavior
  • HTTP/scrape final tests ✅
  • asdf:test-system :starlang-prototype ✅ — 34 standalone scripts, including existing service-URI and execution-mode integration tests
  • generated interchange validation ✅
  • frozen canonical fixture/hash verification ✅
  • nix flake check --print-build-logs ✅

Next slice

Inspect the deterministic dispatcher dependency knot before extraction. The dispatcher still relies on prototype-owned portable manifest/message-schema payload validation; do not make starlang-runtime depend on compiler/prototype internals. Extract or inject that portable schema boundary first if required, then move dispatcher coordination without replacing its transport/work queue with the per-actor star-mailbox.

## Scope Continue STAR-LANG-006's dependency-ordered extraction after PR #32 by moving the injected runtime-directory discovery/resolution boundary from `prototype/runtime-directory-prototype.lisp` into final `starlang-runtime`. This slice follows the already-APPROVED STAR-LANG-004 service-discovery contract. ## Final runtime authority `starlang-runtime` now owns: - runtime-directory port construction - injected snapshot execution/error boundary - portable runtime-directory entry validation - actor name/runtime/liveness validation - capability list validation - STAR service URI ↔ actor/domain/address consistency - exact canonical `star://` lookup over snapshots - duplicate-registration rejection - distinct missing-service and unavailable-service conditions - `:alive :unknown` compatibility semantics - defensive-copy results ## No second registry This does **not** add mutable directory storage or a global registry. The final runtime directory remains an injected `snapshot` port exactly as STAR-LANG-004 specifies. Each resolution obtains a current snapshot from the caller-provided source. The existing local actor registry inside `starlang-runtime` remains a separate local execution mechanism; this slice does not merge or duplicate it. ## Prototype compatibility `prototype/runtime-directory-prototype.lisp` is reduced to: - the historical source-facing `runtime-directory-error` - a final type alias / predicate - standalone ASDF loading - thin delegates - condition translation preserving legacy prototype condition names No independent snapshot validator or resolution algorithm remains in the prototype file. ## Preserved failure distinctions - malformed STAR URI → protocol invalid-URI condition (translated by prototype compatibility) - missing service → typed not-found condition - registered with `:alive nil` → typed unavailable condition - duplicate exact service URI → runtime-directory error - `:alive :unknown` remains resolvable because the approved v1 contract rejects only explicit `nil` ## Out of scope - deterministic dispatcher extraction - remote transport selection - Sento registry implementation - global/distributed registries - DNS/Consul/Kubernetes discovery - runtime endpoint materialization - lease/fencing changes ## Extraction metrics CI on final head `3655269adcca038af56be7774aae9b06dc59c7e9` reports: - aggregate `prototype/**/*.lisp`: **19,545 → 19,479 LOC (-66)** - `prototype/runtime-directory-prototype.lisp`: **+37 / -103**, net **-66 lines** - final `starlang-runtime/src/runtime-directory.lisp`: **156 LOC** ## Validation GitHub Actions is green: - independent target-system loading ✅ - final actor protocol / canonical JSON / journal / lease / mailbox / Sento tests ✅ - `asdf:test-system :starlang-runtime` ✅ with direct runtime-directory coverage - runtime directory tested for live resolution, defensive copies, missing vs unavailable, `:unknown`, duplicate entries, malformed metadata, backend failures, URI errors, and injected/no-global-cache behavior - HTTP/scrape final tests ✅ - `asdf:test-system :starlang-prototype` ✅ — **34 standalone scripts**, including existing service-URI and execution-mode integration tests - generated interchange validation ✅ - frozen canonical fixture/hash verification ✅ - `nix flake check --print-build-logs` ✅ ## Next slice Inspect the deterministic dispatcher dependency knot before extraction. The dispatcher still relies on prototype-owned portable manifest/message-schema payload validation; do not make `starlang-runtime` depend on compiler/prototype internals. Extract or inject that portable schema boundary first if required, then move dispatcher coordination without replacing its transport/work queue with the per-actor `star-mailbox`.
Sign in to join this conversation.
No description provided.