Skip to content

Mirror/sync manager inject observability hooks#217

Merged
ToadAid merged 9 commits into
mainfrom
mirror/sync-manager-inject-observability-hooks
Mar 23, 2026
Merged

Mirror/sync manager inject observability hooks#217
ToadAid merged 9 commits into
mainfrom
mirror/sync-manager-inject-observability-hooks

Conversation

@ToadAid
Copy link
Copy Markdown
Owner

@ToadAid ToadAid commented Mar 23, 2026

Title:
sync: inject observability hooks through sync manager

Description:

  • centralize sync observability hook normalization at the sync-manager seam
  • let runtime_host pass daemon.getObservability() directly
  • preserve sync action result shapes, policy flow, event ordering, and HTTP/error wrapper behavior
  • keep scope limited to sync_manager and runtime_host
  • verification passed:
    • pnpm check
    • pnpm vitest run src/mirror-sync/mirror_sync.test.ts
    • pnpm vitest run src/mirror-service/mirror_service.test.ts

Agent 0 and others added 8 commits March 23, 2026 12:24
## 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>
@github-actions github-actions Bot added size: S and removed size: M labels Mar 23, 2026
@ToadAid ToadAid merged commit 44e8e32 into main Mar 23, 2026
27 of 28 checks passed
@ToadAid ToadAid deleted the mirror/sync-manager-inject-observability-hooks branch March 23, 2026 23:53
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