GeezerVison is showing github.com — id(discovery): resolve_config pairs a CLI topic/secret with the public default for the other half under --no-default-topic · Issue #4756 · developing-today/code
id(discovery): resolve_config pairs a CLI topic/secret with the public default for the other half under --no-default-topic #4756Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DescriptionProblem
id_core::discovery::resolve_config resolves the gossip topic and the topic secret independently, so with --no-default-topic and exactly one of --topic / --topic-secret given, the result pairs a CLI-provided value with the public network's hardcoded default for the other half:
--no-default-topic --topic my-private-net (no secret) → topic my-private-net, secret = DEFAULT_TOPIC_SECRET (the public, in-source secret id-public-discovery-v1).
--no-default-topic --topic-secret my-private-secret (no topic) → topic = DEFAULT_TOPIC (id-peer-discovery-v1, the public topic), secret = the CLI secret.
That contradicts resolve_config's own documented cascade (step 7, crates/id-core/src/discovery.rs:231-232): "If no_default_topic is true, drop the default topic and secret (keep only CLI-provided values; if none, fall back to hardcoded constants to avoid empty values)". The per-field fallback at discovery.rs:275-278 (topic) and discovery.rs:294-295 (secret) fires even when the other half was CLI-provided, so "skip the defaults" silently reintroduces one default.
Topic and secret are consumed as a pair at both call sites — TopicId::new(config.topic) together with RecordPublisher::new(..., config.topic_secret, ...) in pkgs/id/src/commands/serve.rs (~1239-1248) and pkgs/id/src/commands/peers.rs (~430-438) — and the secret is what encrypts the topic's DHT bootstrap records (DEFAULT_TOPIC_SECRET doc, discovery.rs:57-65: nodes with the same secret discover each other; the default is public knowledge). A "private" topic paired with the public secret is discoverable by anyone who knows the topic name; a private secret paired with the public topic name puts the node's records on the public topic under a secret nobody else shares.
Evidence (verified this run, laptop probe at origin/main f28aa79)
Probe test crates/id-core/tests/probe_resolve_pair.rs in a detached laptop worktree (~/git/fleet/probe-2026-11-02-laneB-scan4), run with cargo test -p id-core --test probe_resolve_pair:
resolve_config(&[], Some("my-private-net"), None, false, false, true) printed topic="my-private-net" and secret_is_public_default=true (secret bytes equal DEFAULT_TOPIC_SECRET).
resolve_config(&[], None, Some("my-private-secret"), false, false, true) printed topic="id-peer-discovery-v1" and secret_is_cli=true.
Both assertions of pair-consistency failed, as expected from reading the two independent fallback chains.
Acceptance criteria
- With
no_default_topic = true and exactly one of cli_topic / cli_topic_secret provided, resolve_config never pairs it with the public hardcoded default for the other half: either the pair falls back together (both hardcoded) only when neither is provided, or resolution refuses/names the missing half — one behaviour, documented in the step-7 cascade text and matched by the code.
- New unit tests cover both single-sided cases under
no_default_topic, plus the existing both-provided and neither-provided cases (test_resolve_config_no_default_topic* keep passing or are updated to the documented behaviour).
- The non-
no_default_topic cascade (conf pair, per-field CLI override) is unchanged.
Found by new-issue-creator lane B (code) while scanning id-core modules not covered by lane A's recent passes (discovery.rs was not in its scan lists). Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests app/idPackage/app: id (pkgs/ or apps/ in this repo) on Nov 3, 2026dezren39 commented on Nov 3, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (lane B, new-issue-creator-code-b)
- Session / ID: cron new-issue-creator-code-b run 2026-11-02 22:20 CST
- Found via: filed this run
- Task: resolve_config under --no-default-topic pairs a single-sided CLI topic or secret with the public hardcoded default for the other half; verified by a laptop probe test at origin/main f28aa79 (both directions)
- Expectation: effort s — one documented pair behaviour in resolve_config plus unit tests for both single-sided cases; done when the acceptance criteria on this issue pass
- Links: probe worktree ~/git/fleet/probe-2026-11-02-laneB-scan4 (laptop), test crates/id-core/tests/probe_resolve_pair.rs there
dezren39 commented on Nov 3, 2026 🤖 Agent note · handed off
- Agent: opencode-claimant
- Queue task: 6754
- Session / ID: ses_e5e603f3a8dffewTUBVONL4f4N
- Route: opencode-route/workhorse · build
OpenCode worker session bound and prompted for this already-claimed task.
dezren39 commented on Nov 3, 2026 🤖 Agent note · handed_off
dezren39 commented on Nov 4, 2026 agent-note:v1
state: blocked
queue: repo-health-code-pilot
task: 6754 (small_fix, worker repo-worker-code, lane ec118cad-0fd3-4652-91c4-27432f2f2efd)
by: openchamber-scheduled-lane
at: 2026-11-04T01:11Z
Verified: task is blocked as escalated-to-user. Issue #4756 remains OPEN. Canonical PR #4763 remains OPEN, is mergeable with checks SUCCESS (2/2) and no unresolved feedback, but GitHub identifies dezren39 as both author and assignee. The runbook forbids touching Drew-owned PRs. No PR changes were made.
Drew decision required: explicitly authorize this lane to shepherd or merge PR #4763 despite that restriction, or handle the merge directly. If authorized, revalidate PR state before acting.
labels: queue/blocked + status/blocked + user/escalated; claim labels removed. dezren39 commented on Nov 10, 2026
Agent note — task 14758 PARKED (verification running), lane code-h
dezren39 commented on Nov 11, 2026
Agent note — state: done · task 14758, lane code-p
PR #4763 MERGED as 03b094a; issue #4756 closed by the merge.
Resume conditions from lane code-h's park were all met and verified fresh:
MetadataMetadataapp/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DevelopmentNo branches or pull requestsIssue actions
|