Skip to content

mirrordaemon(debug): drop dead peersKnown override#213

Merged
ToadAid merged 10 commits into
mainfrom
mirror/mirrordaemon-drop-dead-debug-peers-known-override
Mar 24, 2026
Merged

mirrordaemon(debug): drop dead peersKnown override#213
ToadAid merged 10 commits into
mainfrom
mirror/mirrordaemon-drop-dead-debug-peers-known-override

Conversation

@ToadAid
Copy link
Copy Markdown
Owner

@ToadAid ToadAid commented Mar 23, 2026

Summary

  • remove the dead peersKnown override from the daemon debug path
  • stop threading peersKnown through service code as if it affected debug output
  • keep the daemon debug response shape unchanged

Why

This removes a misleading dead dependency from the daemon/service debug seam and makes the debug surface more honest before broader daemon-truth consolidation work.

Scope

Changed:

  • src/mirrordaemon/debug_api.ts
  • src/mirrordaemon/runtime_state.ts
  • src/mirror-service/mirror_service.ts
  • src/mirrordaemon/mirrordaemon.test.ts

Not changed:

  • health logic
  • sync orchestration
  • adapter-boundary files
  • status / verify-lore seams
  • packaging
  • workflows
  • docs
  • broader daemon/service truth wiring

Details

This patch:

  • removes peersKnown from the debug-state parameter surface
  • removes peersKnown from buildDebugSnapshot(...) overrides
  • stops passing peersKnown into getMirrordaemonDebugState(...) from service code
  • updates the daemon test so it no longer suggests debug output depends on that dead parameter

Verification

  • pnpm vitest run src/mirrordaemon/mirrordaemon.test.ts
  • pnpm vitest run src/mirror-service/mirror_service.test.ts

@ToadAid
Copy link
Copy Markdown
Owner Author

ToadAid commented Mar 23, 2026

This patch appears blocked by the same known macOS CI failure signature affecting PR #130 and PR #133. Treating it as infra-blocked rather than patch-specific until the macOS lane issue is resolved.

ToadAid and others added 6 commits March 23, 2026 19:29
## Summary
- derive status fields from existing daemon-backed runtime and health summaries instead of reading the boot snapshot directly for those same values
- keep provider list behavior unchanged
- add focused status-test assertions to pin the summary-derived field relationships

## Why
This tightens the Mirror-native status seam by reducing mixed truth sources and leaning on daemon-backed summaries already in use.

## Scope
Changed:
- src/mirror/status/status.ts
- src/mirror/status/tests/status.test.ts

Not changed:
- src/mirror-service/mirror_service.ts
- src/mirrordaemon/runtime_state.ts
- src/mirror-sync/*
- adapter-boundary files
- compat runtime files
- status formatting
- provider list behavior

## Details
This patch:
- derives service.lore_dir from health.service.lore_dir
- derives service.provider_url from health.service.provider_url
- derives service.operator_auth_configured from health.service.operator_auth_configured
- derives service.workspace_users_root from runtime.readiness.workspace.users_root
- derives lore.ready / lore.discovered_files from runtime.readiness.lore
- derives lore.dir from health.service.lore_dir
- derives workspace.ready / workspace.users_root from runtime.readiness.workspace
- derives sync.node_id from runtime.node_id

## Verification
- pnpm vitest run src/mirror/status/tests/status.test.ts

Co-authored-by: Agent 0 <agent0@toadaid>
## Summary
- derive status.provider.providers from the daemon-backed provider summary instead of reading runtimeHost.providerPlane.listProviders() directly
- extend the daemon provider summary to carry url and last_error
- add focused daemon provider-summary coverage for the new fields

## Why
This finishes the remaining provider truth gap in the status seam by making the status provider list come from the same daemon-backed summary path as the other provider aggregate fields.

## Scope
Changed:
- src/mirrordaemon/daemon_types.ts
- src/mirrordaemon/runtime_state.ts
- src/mirrordaemon/runtime_state.test.ts
- src/mirror/status/status.ts

Not changed:
- src/mirror-service/*
- src/mirror-sync/*
- adapter-boundary files
- compat runtime files
- status formatting
- the excluded #130 / #133 seams

## Details
This patch:
- adds url and last_error to MirrordaemonProvidersSummary.providers[]
- populates those fields in buildProvidersSummary(...)
- changes status.ts to source:
  - provider.active_provider_id
  - provider.total
  - provider.available
  - provider.fallback_available
  - provider.providers
  from getMirrordaemonProvidersState(...) instead of mixing in direct providerPlane.listProviders() reads

## Verification
- pnpm vitest run src/mirrordaemon/runtime_state.test.ts
- pnpm vitest run src/mirror/status/tests/status.test.ts

---------

Co-authored-by: Agent 0 <agent0@toadaid>
Description:
- derive websocket hello envelope truth from daemon runtime summary
- source node_id and runtime_started_at from getMirrordaemonRuntimeState(...)
- preserve hello envelope shape, backlog replay, and live event flow
- keep scope limited to runtime_events_ws only
- no routing, sync, compat, daemon-internal, or protocol-shape changes

After merge, run this on home dev:


Co-authored-by: Agent 0 <agent0@toadaid>
@ToadAid ToadAid merged commit c56b440 into main Mar 24, 2026
27 of 28 checks passed
@ToadAid ToadAid deleted the mirror/mirrordaemon-drop-dead-debug-peers-known-override branch March 24, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant