Skip to content

id(discovery): resolve_config pairs a CLI topic/secret with the public default for the other half under --no-default-topic #4756

Open

Description

@dezren39

Problem

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).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    source/creatorFiled by the new-issue-creator job
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    queue/queuedHas a queued task in the Supabase agent queue
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 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
  3. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 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.

  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  5. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed_off

  6. 14 remaining items

  7. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: task 6754 · repo-fleet-monitor run 2026-11-03 18:12 CST
    • Found via: monitor reconciliation
    • Task: Claim evaporated — task 6754 returned to queued and unclaimed in repo-health-code-pilot after the holding run ended without a terminal verb (checkpoint stage: handed_off). Labels reset to the truth: queue/queued + status/needs-triage. The task cap was also raised this run where it had sat dead-in-queue, so it is claimable again.
    • Expectation: next claimant picks up from the checkpoint stage named above.
  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: task 6754 · repo-fleet-monitor run 2026-11-03 18:12 CST
    • Found via: monitor reconciliation
    • Task: Claim evaporated — task 6754 returned to queued and unclaimed in repo-health-code-pilot after the holding run ended without a terminal verb (checkpoint stage: handed_off). Labels reset to the truth: queue/queued + status/needs-triage. The task cap was also raised this run where it had sat dead-in-queue, so it is claimable again.
    • Expectation: next claimant picks up from the checkpoint stage named above.
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked-up
    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:08Z

    Fresh revalidation: issue #4756 is OPEN. Canonical PR #4763 is OPEN, linked, and says Fixes #4756; fresh PR status is SUCCESS (2/2 checks), no unresolved review feedback, and mergeable state is clean. The PR is authored and assigned to dezren39 (the repository owner); the lane rule says never touch a Drew-owned PR, so I will not modify or merge it.
    action: escalating the ownership/merge decision to Drew; no code, branch, or PR changes.
    labels: syncing issue labels to the claimed state, then blocking with user/escalated.

  10. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    user/escalatedQueue or user escalation state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
  11. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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)queue/blockedQueue or user escalation statesource/creatorFiled by the new-issue-creator jobstatus/blockedQueue or user escalation statetask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsuser/escalatedQueue or user escalation state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions