51 lines
1.5 KiB
Markdown
51 lines
1.5 KiB
Markdown
|
|
---
|
||
|
|
model: claude-opus-4-6
|
||
|
|
service: claude
|
||
|
|
session: 76154e65-d8e1-4b5f-9275-0ea45ba7e98a
|
||
|
|
timestamp: 2026-04-13T20:50:48Z
|
||
|
|
git_ref: 269d939c
|
||
|
|
scope: code
|
||
|
|
substantive: true
|
||
|
|
raw_file: 20260413T205048Z_269d939c_prompt_io.raw.md
|
||
|
|
---
|
||
|
|
|
||
|
|
## Prompt
|
||
|
|
|
||
|
|
Implement a `parse_endpoints()` API in
|
||
|
|
`tractor.discovery._multiaddr` that lets downstream
|
||
|
|
projects declare per-actor transport bind addresses
|
||
|
|
as a service table of actor-name -> multiaddr
|
||
|
|
strings (loaded from config, e.g. TOML `[network]`
|
||
|
|
section). Add type aliases `EndpointsTable` and
|
||
|
|
`ParsedEndpoints`, plus 7 unit tests covering TCP,
|
||
|
|
UDS, tuples, mixed input, unsupported protocols, and
|
||
|
|
edge cases.
|
||
|
|
|
||
|
|
A detailed implementation plan was provided
|
||
|
|
specifying insertion points, type signatures, test
|
||
|
|
names, and verification commands.
|
||
|
|
|
||
|
|
## Response summary
|
||
|
|
|
||
|
|
Add `parse_endpoints()` function with two supporting
|
||
|
|
type aliases to `_multiaddr.py`. The function
|
||
|
|
iterates a `dict[str, list[str|tuple]]` service
|
||
|
|
table and delegates each entry to the existing
|
||
|
|
`wrap_address()` helper, which already handles maddr
|
||
|
|
strings, raw tuples, and pre-wrapped `Address`
|
||
|
|
objects. Seven pure unit tests (no trio runtime)
|
||
|
|
validate all input variants and edge cases. All 22
|
||
|
|
multiaddr tests pass.
|
||
|
|
|
||
|
|
## Files changed
|
||
|
|
|
||
|
|
- `tractor/discovery/_multiaddr.py` — add
|
||
|
|
`EndpointsTable`, `ParsedEndpoints` type aliases
|
||
|
|
and `parse_endpoints()` function after line 133
|
||
|
|
- `tests/discovery/test_multiaddr.py` — add
|
||
|
|
`parse_endpoints` import and 7 new test functions
|
||
|
|
|
||
|
|
## Human edits
|
||
|
|
|
||
|
|
None — committed as generated.
|