Skip to content

fix(cli): make mirror status report canonical runtime truth only#130

Merged
ToadAid merged 76 commits into
mainfrom
fix-mirror-status-runtime-truth
Mar 24, 2026
Merged

fix(cli): make mirror status report canonical runtime truth only#130
ToadAid merged 76 commits into
mainfrom
fix-mirror-status-runtime-truth

Conversation

@ToadAid
Copy link
Copy Markdown
Owner

@ToadAid ToadAid commented Mar 21, 2026

Summary

Narrow mirror status so it reports canonical runtime truth only.

This keeps the command daemon-backed while removing non-runtime CLI invocation context and the broader observability snapshot from the status payload and formatter.

What changed

Updated the mirror status data path and formatting to remove:

  • CLI-context fields:
    • ts
    • cwd
  • the raw observability block

This leaves mirror status reporting only current:

  • runtime truth
  • service truth
  • provider truth
  • lore truth
  • workspace truth
  • sync truth

Scope

Changed:

  • src/mirror/status/status.ts
  • src/mirror/status/format.ts
  • src/mirror-cli/mirror_cli.test.ts
  • src/mirror/status/tests/status.test.ts

Did not change:

  • service routing
  • sync code
  • packaging
  • workflows
  • docs
  • broad config plumbing

Behavior

Behavior changed slightly but intentionally.

mirror status remains daemon-backed, but it no longer reports:

  • non-runtime CLI invocation context
  • the broader observability snapshot

This makes the command more strictly aligned with canonical runtime truth.

Tests

Passed:

  • pnpm vitest run src/mirror/status/tests/status.test.ts src/mirror-cli/mirror_cli.test.ts

Result:

  • 2 files passed
  • 23 tests passed

Notes

Remaining operator-truth follow-up seams:

  • mirror verify-lore is still the next obvious operator-truth boundary
  • deeper sync peer detail remains intentionally on /mirror/sync, not in the CLI status summary
  • observability is still useful, but it is no longer presented as canonical operator truth in mirror status

ToadAid added 2 commits March 21, 2026 22:31
## Summary

Tighten shared Vitest fetch cleanup so cross-test fetch leakage is cleaned up without breaking intentional suite-level fetch setup.

## What changed

Updated:
- `test/setup.ts`

The shared test bootstrap now:
- snapshots `globalThis.fetch` at the start of each test
- restores `globalThis.fetch` to that per-test starting value after each test

## Why this patch

A broad macOS CI failure pattern pointed to shared test-state leakage. One proven leak vector was manual `globalThis.fetch` mutation across suites.

The first bootstrap fix restored fetch to the process-original value, but that was too blunt for suites that intentionally install a fetch mock in `beforeAll`.

This refined version preserves suite-level setup while still cleaning up per-test leakage.

## Scope

Changed only:
- `test/setup.ts`

Did not change:
- product/runtime code
- Mirror status code
- suite-local logic
- workflows
- packaging

## Behavior

No product behavior changed.

This is a shared test-bootstrap isolation fix only.

## Validation

Passed:
- `pnpm vitest run src/cli/program.nodes-media.test.ts`
- `pnpm vitest run src/telegram/send.test.ts src/telegram/fetch.test.ts`

Result:
- `program.nodes-media` passed (9 tests)
- `telegram/send` + `telegram/fetch` passed (62 tests)

## Notes

This patch is intentionally narrow:
- it fixes a proven shared leak point
- it preserves intentional suite-scoped fetch mocks
- it avoids broad test harness refactors

Other possible shared isolation seams may still exist, but they are out of scope for this patch.
## Summary

Add focused operator-truth coverage for `mirror verify-lore`.

This locks down what the command should report from canonical Mirror-owned inputs without broadening into a CLI refactor.

## What changed

Added focused tests around `mirror verify-lore` to verify that:

- Mirror-native env/config inputs are used
- reported output is grounded in actual lore path/runtime truth
- operator-facing behavior stays aligned with canonical Mirror semantics

## Scope

Changed only:
- `src/mirror-cli/mirror_cli.test.ts`

Did not change:
- sync code
- daemon/service routing
- workflows
- packaging
- docs
- unrelated CLI surfaces
- broad config plumbing

## Behavior

No broad behavior change.

This is a focused test patch to lock down operator-truth expectations for `mirror verify-lore`.

## Notes

This continues the operator-truth seam work after the `mirror status` cleanup, and helps clarify whether a later narrow correctness patch is needed for `MIRROR_LORE_DIR` defaults.
@ToadAid
Copy link
Copy Markdown
Owner Author

ToadAid commented Mar 22, 2026

The current macOS failures still appear to match the broader CI-noise / shard-contamination pattern we saw earlier, rather than a deterministic regression from this mirror status patch.

Local targeted repro checks around the suspected suites have been passing, and the earlier broad cascade improved after the shared fetch-isolation fix, which further points away from this PR as the root cause.

I’m keeping PR #130 unchanged for now and treating it as blocked by the unresolved macOS CI lane unless a narrow, reproducible failure points directly into the mirror status path.

ToadAid added 19 commits March 22, 2026 00:26
…and mirror sync surfaces

## Summary

Add focused parity coverage for `mirror status` against daemon-backed runtime and sync truth.

This patch verifies that the operator-facing status view stays aligned with the canonical daemon-backed runtime/sync surface, and applies the narrow status-shape fix required by that contract.

## What changed

Added focused CLI/status parity coverage so that:

- `mirror status` remains daemon-backed after a sync announce
- the CLI-reported sync summary matches the live sync registry count
- non-runtime fields are excluded from the status surface

Also tightened the status payload/formatter so the status surface remains limited to canonical runtime truth only.

## Scope

Changed:
- `src/mirror-cli/mirror_cli.test.ts`
- `src/mirror/status/status.ts`
- `src/mirror/status/format.ts`
- `src/mirror/status/tests/status.test.ts`

Did not change:
- daemon/service runtime code
- sync execution code
- docs
- workflows
- packaging
- unrelated CLI commands

## Behavior

Behavior changed slightly but intentionally.

`mirror status` no longer emits:
- `ts`
- `cwd`
- `observability`

in either the status payload or human output.

Everything else remains daemon-backed and unchanged.

## Tests

Passed:
- `pnpm vitest run src/mirror/status/tests/status.test.ts`
- `pnpm vitest run src/mirror-cli/mirror_cli.test.ts`

## Notes

This keeps `mirror status` aligned with canonical runtime truth while leaving peer-level sync detail intentionally on `/mirror/sync`, not in the CLI summary surface.
…ROR_LORE_DIR

## Summary

Align the compatibility `mirror verify-lore` wrapper with the canonical Mirror lore default.

This removes stale hardcoded compatibility defaults so the wrapper now falls through to canonical lore resolution, where `MIRROR_LORE_DIR` is the effective default source of truth.

## What changed

Updated:
- `src/mirror/telemetry_tail/cli.ts`
- `src/mirror/telemetry_tail/tests/cli_wiring.test.ts`

The compatibility wrapper no longer bakes in stale default values such as:
- `lore/manifest.json`
- `lore/canonical`

at command registration time.

Instead, it now defers to the canonical resolution path in `runVerifyLoreCli`.

Also added focused wiring coverage to verify the compatibility command still exposes:
- `--manifest`
- `--dir`

without preset default values.

## Scope

Changed only:
- `src/mirror/telemetry_tail/cli.ts`
- `src/mirror/telemetry_tail/tests/cli_wiring.test.ts`

Did not change:
- canonical `mirror verify-lore` flow
- daemon/service code
- sync code
- docs
- workflows
- packaging
- unrelated CLI commands

## Behavior

Behavior changed slightly but intentionally, compatibility-only.

The compatibility wrapper no longer advertises or injects stale hardcoded lore defaults.

The canonical Mirror verify-lore path remains unchanged.

## Tests

Passed:
- `pnpm vitest run src/mirror/telemetry_tail/tests/cli_wiring.test.ts`

Result:
- 1 test passed

## Notes

This removes a remaining compatibility-era mismatch now that the canonical Mirror CLI path already resolves lore through `MIRROR_LORE_DIR`.

A natural follow-up is a docs-only refresh of the split-readiness checklist so it matches current code reality.
…nc/verify-lore work

## Summary

Refresh the split-readiness checklist so it matches current code reality after the landed status, `/mirror/sync`, parity, verify-lore, and env-boundary work.

## What changed

Updated:
- `docs/architecture/mirror-runtime-split-readiness-checklist.md`

The checklist now:
- marks landed status/sync/verify-lore/env-boundary improvements as done or materially improved
- removes stale statements that `mirror status` and `verify-lore` are still open canonical seams
- reorders the remaining gaps around:
  - compatibility wrappers
  - observability ownership
  - packaging/build boundary
  - dedicated CI gates
- separates macOS shard-order instability into a CI lane instead of leaving it implied as a product seam

## Scope

Changed only:
- `docs/architecture/mirror-runtime-split-readiness-checklist.md`

Did not change:
- runtime code
- tests
- workflows
- packaging
- CI behavior

## Behavior

No behavior changed.

This is a docs-only refresh.

## Notes

Top remaining seams after the refresh:
1. quarantine or retire compatibility-only runtime wrappers and legacy entrypoints
2. continue enriching daemon-owned runtime events where operator/runtime inspection is still thin
3. move observability ownership under daemon/runtime control
…ener state

## Summary

Add focused reset coverage for shared agent event listener state.

This tightens the existing test-only reset hook so agent-event state can be fully cleared between tests, and adds focused coverage proving subscribed listeners do not survive that reset.

## What changed

Updated:
- `src/infra/agent-events.ts`
- `src/infra/agent-events.test.ts`

The existing `resetAgentRunContextForTest()` helper now clears all in-memory agent-event state, including:
- run context
- per-run sequence state
- subscribed listeners

Also added focused test coverage to prove a subscribed listener does not survive the reset, plus a `beforeEach` reset so the test file is self-isolating.

## Scope

Changed only:
- `src/infra/agent-events.ts`
- `src/infra/agent-events.test.ts`

Did not change:
- product runtime behavior
- Mirror status
- sync/runtime code
- docs
- workflows
- packaging
- broad test bootstrap

## Behavior

No runtime product behavior changed.

This is a tiny testability-scoped cleanup to the existing `resetAgentRunContextForTest()` helper only.

## Tests

Passed:
- `pnpm vitest run src/infra/agent-events.test.ts`

Result:
- 4 tests passed

## Notes

This improves one shared CI-isolation seam, but other shard-order sensitivity may still come from unrelated module-level state, especially fake timers and non-reset module mocks in broader `auto-reply/reply/**` flows.
## Summary

Add focused daemon runtime-state coverage for operator-facing action inspection.

This locks down how active actions are surfaced from daemon runtime events without changing runtime code or event plumbing.

## What changed

Updated:
- `src/mirrordaemon/runtime_state.test.ts`

Added focused coverage to verify that:
- active actions disappear after `action.execution.finished`
- active actions disappear after `action.execution.failed`
- incomplete `action.execution.started` events do not surface in operator inspection

## Scope

Changed only:
- `src/mirrordaemon/runtime_state.test.ts`

Did not change:
- runtime code
- event plumbing
- sync execution
- docs
- workflows
- packaging
- unrelated daemon/CLI surfaces

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/mirrordaemon/runtime_state.test.ts src/mirrordaemon/mirrordaemon.test.ts`

Result:
- 2 files passed
- 6 tests passed

## Notes

This strengthens daemon-owned operator inspection coverage around runtime action summaries.

A natural next seam is focused operator-facing runtime event transport coverage for websocket reconnect/disconnect and backlog replay behavior.
…eplay semantics and invalid payload handling

## Summary

Add focused subscriber-facing coverage for daemon websocket control-message behavior on `/mirror/runtime/ws`.

This locks down explicit subscribe replay semantics and error-envelope handling for unsupported or invalid websocket payloads without changing transport code.

## What changed

Updated:
- `src/mirror-service/mirror_service.test.ts`

Added focused coverage to verify that:
- explicit `subscribe` replays backlog only when `backlog: true`
- unsupported control messages return an error envelope with `code: "unsupported_message"`
- invalid non-JSON websocket payloads return an error envelope with `code: "invalid_json"`

## Scope

Changed only:
- `src/mirror-service/mirror_service.test.ts`

Did not change:
- websocket transport code
- daemon runtime behavior
- sync execution
- docs
- workflows
- packaging
- unrelated CLI or service surfaces

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/mirror-service/mirror_service.test.ts -t "streams /mirror/runtime/ws with backlog, live events, and protocol messages|surfaces runtime websocket connect and disconnect events to live subscribers|replays prior websocket transport events from backlog to reconnecting subscribers|replays backlog only when explicitly requested by subscribe control messages|returns websocket error envelopes for unsupported control messages|returns websocket error envelopes for invalid control payloads"`

Result:
- 1 file passed
- 6 tests passed
- 28 tests skipped

## Notes

This strengthens subscriber-facing coverage for daemon websocket control-message behavior.

A natural next seam is verifying that `/mirror/runtime` summary state reflects `event_stream.ws_connections` accurately as sockets connect and disconnect.
…counts

## Summary

Add focused coverage that `/mirror/runtime` summary state reflects websocket connection counts accurately as clients connect and disconnect.

This locks down runtime summary truth for `event_stream.ws_connections` without changing runtime or websocket behavior.

## What changed

Updated:
- `src/mirror-service/mirror_service.test.ts`

Added focused coverage to verify that `/mirror/runtime` reports `event_stream.ws_connections` as:
- `0`
- then `1`
- then `2`
- then back to `1`
- then back to `0`

as websocket clients connect and disconnect.

## Scope

Changed only:
- `src/mirror-service/mirror_service.test.ts`

Did not change:
- websocket transport implementation
- runtime summary code
- sync execution
- docs
- workflows
- packaging
- unrelated service or CLI surfaces

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/mirror-service/mirror_service.test.ts -t "exposes canonical runtime state and debug endpoints|reflects websocket connection counts on the runtime summary as sockets connect and disconnect"`

Result:
- 1 file passed
- 2 tests passed
- 33 tests skipped

## Notes

This strengthens runtime summary truth for websocket connection visibility.

A natural next seam is runtime summary/debug consistency for websocket visibility, especially keeping `/mirror/runtime` and `/mirror/runtime/debug` aligned on websocket-related inspection truth such as live connection counts versus recent transport events.
…cket inspection truth

## Summary

Add focused daemon-side consistency coverage so websocket-related inspection truth stays aligned between runtime summary and debug snapshots.

This locks down overlapping websocket inspection fields without changing runtime code or websocket implementation.

## What changed

Updated:
- `src/mirrordaemon/runtime_state.test.ts`

Added focused coverage to verify that runtime summary and debug snapshots stay aligned on:
- matching `event_stream` websocket-related fields
- matching recent-event counts where those surfaces overlap
- presence of `runtime.ws.connected` and `runtime.ws.disconnected` in debug event history

## Scope

Changed only:
- `src/mirrordaemon/runtime_state.test.ts`

Did not change:
- runtime code
- websocket implementation
- sync execution
- docs
- workflows
- packaging
- unrelated daemon/service surfaces

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/mirrordaemon/runtime_state.test.ts src/mirrordaemon/mirrordaemon.test.ts`

Result:
- 2 files passed
- 7 tests passed

## Notes

This strengthens daemon-side consistency coverage for websocket inspection truth between summary and debug surfaces.

A natural next seam is health/runtime consistency for websocket inspection fields, especially verifying that `buildHealthSummary` preserves the same websocket `event_stream` truth already covered between runtime summary and debug snapshot.
…inspection fields

## Summary

Add focused daemon-side consistency coverage so `buildHealthSummary` preserves the same websocket-related `event_stream` truth as `buildRuntimeSummary`.

This locks down overlapping websocket inspection fields without changing runtime code or websocket implementation.

## What changed

Updated:
- `src/mirrordaemon/runtime_state.test.ts`

Added focused coverage to verify that `buildHealthSummary` preserves the same websocket-related `event_stream` truth as `buildRuntimeSummary` from the same daemon state and overrides.

## Scope

Changed only:
- `src/mirrordaemon/runtime_state.test.ts`

Did not change:
- runtime code
- websocket implementation
- sync execution
- docs
- workflows
- packaging
- unrelated daemon/service surfaces

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/mirrordaemon/runtime_state.test.ts src/mirrordaemon/mirrordaemon.test.ts`

Result:
- 2 files passed
- 8 tests passed

## Notes

This strengthens daemon-side consistency coverage for websocket inspection truth across health and runtime summary surfaces.

A natural next seam is compatibility-quarantine guardrail coverage, especially locking that Mirror compatibility shims remain thin forwarding wrappers and do not quietly regain ownership of canonical runtime behavior.
… and daemon-truth tests

## Summary

Add a narrow Mirror-owned smoke target for high-signal runtime-boundary and daemon-truth checks.

This gives the repo a small, repeatable test target for the key Mirror runtime seams without relying on the full repo matrix.

## What changed

Updated:
- `package.json`

Added:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`
- `src/compat/openclaw/shim-boundary.test.ts`

The smoke target runs only focused high-signal checks around:
- daemon/runtime-state summaries
- websocket transport/control/summary coverage
- Mirror CLI status/sync/operator-truth checks
- compatibility shim guardrails

## Scope

Changed only:
- `package.json`
- `scripts/test-mirror-runtime-boundary-smoke.mjs`
- `src/compat/openclaw/shim-boundary.test.ts`

Did not change:
- product/runtime behavior
- sync execution
- websocket implementation
- broad workflow architecture
- packaging identity
- unrelated tests

## Behavior

No behavior changed.

This is test/config-only.

## Example

Run locally with:

- `pnpm test:mirror:smoke`

## Validation

Passed locally:
- `src/mirrordaemon/mirrordaemon.test.ts`
- `src/mirrordaemon/runtime_state.test.ts`
- `src/compat/openclaw/shim-boundary.test.ts`
- focused `src/mirror-service/mirror_service.test.ts` cases
- focused `src/mirror-cli/mirror_cli.test.ts` cases

## Notes

This creates a small Mirror-owned smoke lane for runtime-boundary and daemon-truth coverage.

A natural next seam is a minimal workflow hookup for this smoke target if you want CI visibility without redesigning the workflow graph.
…inspection fields

## Summary

Add focused daemon-side consistency coverage so `buildHealthSummary` preserves the same websocket-related `event_stream` truth as `buildRuntimeSummary`.

This locks down overlapping websocket inspection fields without changing runtime code or websocket implementation.

## What changed

Updated:
- `src/mirrordaemon/runtime_state.test.ts`

Added focused coverage to verify that `buildHealthSummary` preserves the same websocket-related `event_stream` truth as `buildRuntimeSummary` from the same daemon state and overrides.

## Scope

Changed only:
- `src/mirrordaemon/runtime_state.test.ts`

Did not change:
- runtime code
- websocket implementation
- sync execution
- docs
- workflows
- packaging
- unrelated daemon/service surfaces

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/mirrordaemon/runtime_state.test.ts src/mirrordaemon/mirrordaemon.test.ts`

Result:
- 2 files passed
- 8 tests passed

## Notes

This strengthens daemon-side consistency coverage for websocket inspection truth across health and runtime summary surfaces.

A natural next seam is compatibility-quarantine guardrail coverage, especially locking that Mirror compatibility shims remain thin forwarding wrappers and do not quietly regain ownership of canonical runtime behavior.
## Summary

Add focused compatibility-quarantine guardrail coverage so compatibility shims remain thin forwarding wrappers and do not quietly regain ownership of canonical runtime behavior.

## What changed

Updated:
- `src/compat/openclaw/shim-boundary.test.ts`

Added focused coverage to verify that:
- `src/runtime/server.ts` remains a thin forwarding wrapper to compat modules
- `src/cli/mirror-cli.ts` remains a thin forwarding wrapper to compat modules
- canonical ownership stays with Mirror-native modules:
  - `src/mirror-service/index.ts`
  - `src/mirror-cli/index.ts`

## Scope

Changed only:
- `src/compat/openclaw/shim-boundary.test.ts`

Did not change:
- shim code
- runtime code
- daemon/service behavior
- sync execution
- websocket transport
- docs
- workflows
- packaging

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/compat/openclaw/shim-boundary.test.ts src/compat/openclaw/runtime/server.test.ts`

Result:
- 2 files passed
- 9 tests passed

## Notes

This strengthens compatibility quarantine by making it explicit that legacy entrypoints stay as forwarding shims rather than regaining canonical ownership.

A natural next seam is a narrow Mirror-owned CI/smoke lane so these runtime-boundary and daemon-truth tests are visible without relying on the full repo matrix.
## Summary

Add a minimal CI hook so the existing Mirror-owned smoke target runs in CI and becomes visible without redesigning the workflow graph.

## What changed

Updated:
- `.github/workflows/mirror-runtime-ci.yml`
- `src/mirrordaemon/runtime_state.test.ts`

The workflow now runs the existing Mirror-owned smoke target as a named step inside the existing `mirror-runtime-smoke` job.

Also extended the workflow path filter to include:
- the smoke runner script
- the shim-boundary test file

While validating the hook, tightened one brittle order-dependent assertion in `src/mirrordaemon/runtime_state.test.ts` so the smoke target remains stable against current action ordering.

## Scope

Changed only:
- `.github/workflows/mirror-runtime-ci.yml`
- `src/mirrordaemon/runtime_state.test.ts`

Did not change:
- product/runtime behavior
- sync execution
- websocket implementation
- broad workflow architecture
- packaging identity
- unrelated test commands

## Behavior

No behavior changed.

This is workflow/test-only.

## CI hook

The smoke target now runs via:

- Workflow: `.github/workflows/mirror-runtime-ci.yml`
- Job: `mirror-runtime-smoke`
- Step: `Run Mirror runtime boundary smoke target`
- Command: `pnpm test:mirror:smoke`

## Validation

Passed locally:
- `pnpm test:mirror:smoke`

## Notes

This gives the repo a visible, Mirror-owned CI lane for high-signal runtime-boundary and daemon-truth checks without expanding the full workflow matrix.

A natural next seam is a small naming/reporting polish if even clearer Actions searchability is wanted, but functionally the minimal hook is now in place.
…ntime entrypoints

## Summary

Add focused compatibility-quarantine guardrail coverage for the remaining legacy runtime entrypoints.

This locks down that legacy runtime entrypoints stay as thin forwarding wrappers and do not quietly regain ownership of canonical Mirror runtime behavior.

## What changed

Updated:
- `src/runtime/compat-legacy-boundary.test.ts`

Added focused coverage to verify that:
- `src/runtime/brain-chat.ts` remains a thin forwarding wrapper to compat modules
- `src/runtime/health.ts` remains a thin forwarding wrapper to compat modules
- canonical Mirror-owned modules do not quietly reclaim those legacy handler exports:
  - `src/mirror-runtime/index.ts`
  - `src/mirror-service/index.ts`

## Scope

Changed only:
- `src/runtime/compat-legacy-boundary.test.ts`

Did not change:
- runtime code
- daemon/service behavior
- sync execution
- websocket transport
- docs
- workflows
- package.json
- smoke runner script

## Behavior

No behavior changed.

This is a test-only patch.

## Tests

Passed:
- `pnpm vitest run src/runtime/compat-legacy-boundary.test.ts src/runtime/brain-chat.test.ts src/compat/openclaw/runtime/server.test.ts`

Result:
- 3 files passed
- 13 tests passed

## Notes

This extends compatibility-quarantine guardrails across the remaining legacy runtime entrypoints.

A natural next seam is extending the Mirror smoke target coverage or path filter so the CI smoke lane also covers these legacy-entrypoint boundary tests.
…ndary guardrails

## Summary

Extend the existing Mirror-owned smoke target so it also covers the new legacy-entrypoint compatibility guardrail test.

This keeps the Mirror smoke lane aligned with the current compatibility-quarantine boundary set without redesigning the smoke runner or CI workflow.

## What changed

Updated:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`
- `.github/workflows/mirror-runtime-ci.yml`

The smoke target now includes:
- `src/runtime/compat-legacy-boundary.test.ts`

Also made the smallest workflow visibility update so changes to that new guardrail test still trigger the Mirror runtime workflow.

## Scope

Changed only:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`
- `.github/workflows/mirror-runtime-ci.yml`

Did not change:
- product/runtime behavior
- sync execution
- websocket implementation
- broad workflow architecture
- packaging identity
- unrelated tests

## Behavior

No behavior changed.

This is smoke-target/workflow-only.

## Example

Run locally with:

- `pnpm test:mirror:smoke`

## Notes

This extends the narrow Mirror-owned smoke lane so it continues to cover the full compatibility-quarantine boundary set.

A natural next seam is a small CI/reporting polish if you want the smoke lane to make failing boundary buckets more obvious in Actions output.
## Summary

Add reporting polish to the existing Mirror-owned smoke lane so its output is easier to read and triage in CI.

This keeps the same smoke coverage set while making the boundary buckets explicit in runner output.

## What changed

Updated:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`

The smoke runner now prints clear labels for the existing boundary buckets:
- daemon/runtime-state truth
- compatibility-quarantine guardrails
- websocket transport/control/summary truth
- Mirror CLI/operator truth

## Scope

Changed only:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`

Did not change:
- product/runtime behavior
- sync execution
- websocket implementation
- workflow structure
- package.json
- smoke coverage selection

## Behavior

No behavior changed.

The smoke coverage set is unchanged. Only the runner output is more readable and searchable.

## Example

Run locally with:

- `pnpm test:mirror:smoke`

## Notes

This improves CI triage by making the boundary buckets explicit in smoke output.

A natural next seam is a tiny one-line final bucket summary at the end of the runner, but the current output is already materially clearer.
…e and compat-boundary work

## Summary

Refresh the split-readiness checklist so it matches current main after the recent smoke-lane and compatibility-boundary work.

## What changed

Updated:
- `docs/architecture/mirror-runtime-split-readiness-checklist.md`

The checklist now:
- marks the Mirror smoke lane and CI visibility as materially improved / done
- marks websocket truth coverage as materially improved
- marks CLI/operator-truth progress as materially improved
- marks compatibility-quarantine guardrails as materially improved
- re-ranks the genuinely open seams toward:
  - observability ownership
  - console/runtime ownership
  - package/build boundary
  - a true env/config boundary gate

## Scope

Changed only:
- `docs/architecture/mirror-runtime-split-readiness-checklist.md`

Did not change:
- runtime code
- tests
- workflows
- packaging
- CI behavior

## Behavior

No behavior changed.

This is a docs-only patch.

## Notes

Top remaining seams after the refresh:
1. observability ownership under daemon/runtime control
2. console/runtime ownership seams where console execution is still only partially daemon-backed
3. a true CI boundary gate preventing new OpenClaw-specific env/config coupling inside Mirror-owned modules
## Summary

Add a final summary line to the existing Mirror-owned smoke runner so CI logs are easier to scan.

This keeps the same smoke coverage set, bucket names, and ordering while making the completed boundary buckets clearer at the end of the run.

## What changed

Updated:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`

The smoke runner now prints one concise final summary line after all existing smoke buckets succeed.

## Scope

Changed only:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`

Did not change:
- product/runtime behavior
- sync execution
- websocket implementation
- workflow structure
- package.json
- smoke coverage selection
- test paths

## Behavior

No behavior changed.

This is reporting-only. Coverage and workflow behavior are unchanged.

## Example

Run locally with:

- `pnpm test:mirror:smoke`

## Notes

This is a small CI triage polish now that the Mirror smoke lane itself is in good shape.

A natural next seam is a true CI boundary gate preventing new OpenClaw-specific env/config coupling inside Mirror-owned modules.
…ling in Mirror-owned modules

## Summary

Add a narrow boundary gate that prevents new OpenClaw-specific import/package coupling from creeping into Mirror-owned modules.

This keeps the canonical Mirror-owned source boundary explicit and makes the import/package boundary visible in the existing Mirror smoke lane.

## What changed

Added:
- `src/mirror/openclaw-import-boundary.test.ts`

Updated:
- `scripts/test-mirror-runtime-boundary-smoke.mjs`

The new source-scan boundary gate checks canonical Mirror-owned source under:
- `src/mirror/**`
- `src/mirror-runtime/**`
- `src/mirror-cli/**`

It ignores test-only files, strips comments, and fails on direct OpenClaw-specific import specifiers or package references.

Also extended the existing Mirror smoke runner so this gate runs in the current Mirror-owned smoke lane.

## Scope

Changed only:
- `src/mirror/openclaw-import-boundary.test.ts`
- `scripts/test-mirror-runtime-boundary-smoke.mjs`

Did not change:
- product/runtime behavior
- sync execution
- websocket implementation
- workflow graph broadly
- unrelated tests
- compat modules outside the gate definition

## Behavior

No behavior changed.

This is test/script-only.

## Example

Run locally with:
- `pnpm vitest run src/mirror/openclaw-import-boundary.test.ts`
- `pnpm test:mirror:smoke`

## Validation

Passed locally:
- `pnpm vitest run src/mirror/openclaw-env-boundary.test.ts src/mirror/openclaw-import-boundary.test.ts`
- `pnpm test:mirror:smoke`

## Notes

This adds an explicit import/package boundary gate for canonical Mirror-owned modules.

It is intentionally rebuilt on top of the corrected env-boundary branch so the env/config and import/package boundary gates stack cleanly without the stale branch-state issues from the earlier PR.
ToadAid and others added 15 commits March 22, 2026 23:23
## Summary
- add a static guardrail test for the standalone heartbeat-facing entry surface
- verify the canonical heartbeat entry remains Mirror-native
- verify the heartbeat-facing entry does not drift back toward compat/OpenClaw or legacy wrapper ownership

## Why
This protects the standalone heartbeat surface from drifting away from the intended Mirror-native heartbeat entry wiring.

## Scope
Changed:
- test/mirror-heartbeat-entry-surface.test.ts

Not changed:
- runtime behavior
- workflows
- packaging logic
- adapter-boundary work
- heartbeat-entry source files

## Details
The test:
- reads `src/mirror-heartbeat/index.ts` as the standalone heartbeat-entry owner
- verifies it exports Mirror-native heartbeat surfaces from:
  - `./heartbeat_manager.js`
  - `./heartbeat_store.js`
  - `./heartbeat_evaluator.js`
  - `./heartbeat_templates.js`
  - `./heartbeat_types.js`
- verifies it does not mention:
  - `compat/openclaw`
  - `openclaw-compat`
  - `../runtime/`
  - `../compat/`

## Verification
- `pnpm vitest run test/mirror-heartbeat-entry-surface.test.ts`
## Summary
- add a static guardrail test for the standalone reflection-facing entry surface
- verify the canonical reflection entry remains Mirror-native
- verify the reflection-facing entry does not drift back toward compat/OpenClaw or legacy wrapper ownership

## Why
This protects the standalone reflection surface from drifting away from the intended Mirror-native reflection entry wiring.

## Scope
Changed:
- test/mirror-reflection-entry-surface.test.ts

Not changed:
- runtime behavior
- workflows
- packaging logic
- adapter-boundary work
- reflection-entry source files

## Details
The test:
- reads `src/mirror-reflection/index.ts` as the standalone reflection-entry owner
- verifies it exports Mirror-native reflection/canon-analysis surfaces from:
  - `./reflection_engine.js`
  - `./canon_analysis.js`
  - `./symbol_analysis.js`
  - `./draft_review.js`
  - `./reflection_types.js`
- verifies it does not mention:
  - `compat/openclaw`
  - `openclaw-compat`
  - `../runtime/`
  - `../compat/`

## Verification
- `pnpm vitest run test/mirror-reflection-entry-surface.test.ts`
## Summary
- add a static guardrail test for the standalone lore-graph-facing entry surface
- verify the canonical lore-graph entry remains Mirror-native
- verify the lore-graph-facing entry does not drift back toward compat/OpenClaw or legacy wrapper ownership

## Why
This protects the standalone lore-graph surface from drifting away from the intended Mirror-native lore-graph entry wiring.

## Scope
Changed:
- test/mirror-lore-graph-entry-surface.test.ts

Not changed:
- runtime behavior
- workflows
- packaging logic
- adapter-boundary work
- lore-graph-entry source files

## Details
The test:
- reads `src/mirror-lore-graph/index.ts` as the standalone lore-graph-entry owner
- verifies it exports Mirror-native lore graph/query surfaces from:
  - `./graph_builder.js`
  - `./lore_graph.js`
  - `./node_types.js`
  - `./edge_types.js`
  - `./graph_query.js`
- verifies it does not mention:
  - `compat/openclaw`
  - `openclaw-compat`
  - `../runtime/`
  - `../compat/`

## Verification
- `pnpm vitest run test/mirror-lore-graph-entry-surface.test.ts`
## Summary
- add a static guardrail test for the standalone monk-facing entry surface
- verify the canonical monk entry remains Mirror-native
- verify the monk-facing entry does not drift back toward compat/OpenClaw or legacy wrapper ownership

## Why
This protects the standalone monk surface from drifting away from the intended Mirror-native monk entry wiring.

## Scope
Changed:
- test/mirror-monk-entry-surface.test.ts

Not changed:
- runtime behavior
- workflows
- packaging logic
- adapter-boundary work
- monk-entry source files

## Details
The test:
- reads `src/mirror-monk/index.ts` as the standalone monk-entry owner
- verifies it exports Mirror-native monk/workspace-view surfaces from:
  - `./monk_workspace_bridge.js`
  - `./monk_context.js`
  - `./monk_task_view.js`
  - `./monk_draft_view.js`
  - `./monk_session_view.js`
  - `./monk_types.js`
- verifies it does not mention:
  - `compat/openclaw`
  - `openclaw-compat`
  - `../runtime/`
  - `../compat/`

## Verification
- `pnpm vitest run test/mirror-monk-entry-surface.test.ts`
## Summary
- add a static guardrail test for the standalone monk-actions-facing entry surface
- verify the canonical monk-actions entry remains Mirror-native
- verify the monk-actions-facing entry does not drift back toward compat/OpenClaw or legacy wrapper ownership

## Why
This protects the standalone monk-actions surface from drifting away from the intended Mirror-native monk-actions entry wiring.

## Scope
Changed:
- test/mirror-monk-actions-entry-surface.test.ts

Not changed:
- runtime behavior
- workflows
- packaging logic
- adapter-boundary work
- monk-actions-entry source files

## Details
The test:
- reads `src/mirror-monk-actions/index.ts` as the standalone monk-actions-entry owner
- verifies it exports Mirror-native monk-actions surfaces from:
  - `./monk_task_actions_runtime.js`
  - `./monk_followup.js`
  - `./monk_task_actions.js`
  - `./monk_reminder_actions.js`
  - `./monk_resume.js`
  - `./monk_action_types.js`
- verifies it does not mention:
  - `compat/openclaw`
  - `openclaw-compat`
  - `../runtime/`
  - `../compat/`

## Verification
- `pnpm vitest run test/mirror-monk-actions-entry-surface.test.ts`
…erver handlers

## Summary
- remove the implicit global-context fallback from observability server entrypoints
- require explicit observability context for `createMirrorObservabilityHandlers`
- require explicit handlers for `createMirrorObservabilityRouter`
- update the local observability wrapper-layer test to pass the default context explicitly

## Why
This reduces process-global ownership in the observability server seam and makes caller ownership explicit without broadening into a larger observability refactor.

## Scope
Changed:
- src/mirror-observability/observability_server.ts
- src/mirror-observability/observability.test.ts

Not changed:
- runtime/daemon modules
- CLI implementation
- docs
- workflows
- packaging
- broader observability modules

## Details
This patch:
- removes `getDefaultMirrorObservabilityContext()` as a default parameter from `createMirrorObservabilityHandlers`
- removes implicit handler creation from `createMirrorObservabilityRouter`
- preserves behavior for explicit callers by updating the local test to pass `getDefaultMirrorObservabilityContext()` directly

## Verification
- `pnpm vitest run src/mirror-observability`
…ntext

## Summary
- route console graph-route metrics and diagnostic events through the owned observability context
- stop console graph routes from using global observability helpers directly
- update the local observability integration test to exercise the same explicit-context path

## Why
This reduces hidden process-global ownership in the console graph-route seam and keeps observability emission attached to the service-owned runtime context.

## Scope
Changed:
- src/mirror-console/console_routes.ts
- src/mirror-service/mirror_service.ts
- src/mirror-observability/observability.test.ts

Not changed:
- adapter-boundary files
- sync orchestration
- packaging/workflows/docs
- broader runtime/daemon ownership

## Details
This patch

Co-authored-by: Agent 0 <agent0@toadaid>
## Summary
- route the observability test through the public console index surface
- stop importing the console handler implementation directly from the test

## Why
This tightens the console module ownership boundary by ensuring the test exercises the public export surface instead of the implementation file.

## Scope
Changed:
- src/mirror-observability/observability.test.ts

Not changed:
- production runtime files
- adapter-boundary files
- status / verify-lore seams
- workflows
- packaging
- docs

## Verification
- pnpm vitest run src/mirror-observability/observability.test.ts
## Summary
- add runMirrorDoctorCli to the public telemetry-tail index export surface
- route the doctor CLI test through the public index surface instead of the direct implementation file

## Why
This tightens the doctor CLI ownership boundary by ensuring the test exercises a public export surface instead of importing the implementation file directly.

## Scope
Changed:
- src/mirror/telemetry_tail/index.ts
- src/mirror/doctor/tests/doctor.test.ts

Not changed:
- production doctor logic
- adapter-boundary files
- status / verify-lore seams
- workflows
- packaging
- docs
- other telemetry-tail behavior

## Details
This patch:
- adds runMirrorDoctorCli to src/mirror/telemetry_tail/index.ts
- changes src/mirror/doctor/tests/doctor.test.ts to import from ../../telemetry_tail/index.js
- preserves all doctor CLI behavior and test assertions

## Verification
- pnpm vitest run src/mirror/doctor/tests/doctor.test.ts
## Summary
- route the doctor checks test through the public doctor index surface
- stop importing the checks implementation directly from the test

## Why
This tightens the doctor module ownership boundary by ensuring the test exercises the public export surface instead of the implementation file.

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

Not changed:
- production runtime files
- adapter-boundary files
- status / verify-lore seams
- workflows
- packaging
- docs

## Verification
- pnpm vitest run src/mirror/doctor/tests/checks.test.ts
## Summary
- add registerMirrorTelemetryCli to the public telemetry-tail index export surface
- route the Mirror compatibility loader through the public telemetry-tail index instead of the implementation file
- preserve the compat CLI wrapper path through the same public telemetry-tail surface

## Why
This tightens the telemetry-tail CLI ownership boundary by making both the compat wrapper and the dynamic loader depend on the public Mirror surface instead of implementation files.

## Scope
Changed:
- src/mirror/telemetry_tail/index.ts
- src/cli/program/register.subclis.ts
- src/compat/openclaw/cli/mirror-cli.ts

Not changed:
- telemetry-tail implementation
- adapter-boundary files
- status / verify-lore seams
- workflows
- packaging
- docs
- CLI logic
- runtime behavior

## Verification
- pnpm vitest run src/mirror/telemetry_tail/tests/cli_wiring.test.ts
## Summary
- derive compat /health provider configuration truth and version from the existing runtimeHost
- stop fabricating compat health truth from raw wrapper args and MIRROR_RUNTIME_VERSION
- add a focused test proving /health reflects runtimeHost truth even when wrapper args are undefined

## Why
This reduces hidden compat self-authorship by making the legacy /health wrapper reflect the already-created runtimeHost / daemon-backed truth instead of raw wrapper inputs.

## Scope
Changed:
- src/compat/openclaw/runtime/health.ts
- src/compat/openclaw/runtime/server.ts
- src/compat/openclaw/runtime/server.test.ts

Not changed:
- Mirror service/runtime host logic
- adapter-boundary files
- status / verify-lore seams
- workflows
- packaging
- docs
- broader compat/runtime behavior

## Details
This patch:
- changes handleHealthEndpoint(...) to derive provider configuration and version from runtimeHost
- uses getMirrordaemonRuntimeState(...) for runtime-backed version truth
- preserves the legacy compat /health JSON shape
- updates the compat server test suite with a focused case proving /health reflects runtimeHost truth even when wrapper args are undefined

## Verification
- pnpm vitest run src/compat/openclaw/runtime/server.test.ts

---------

Co-authored-by: Agent 0 <agent0@toadaid>
## Summary
- derive daemon health sync.peers_known from a real peer list instead of a synthetic count override
- pass syncManager.listPeers() into daemon health-state construction from service health call sites
- update daemon and service tests to verify peer-count truth comes from the peer list

## Why
This moves peers_known authority closer to the daemon summary layer and reduces duplicated service-side state derivation in health-style surfaces.

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

Not changed:
- adapter-boundary files
- sync orchestration
- debug behavior
- response shapes

## Details
This patch:
- changes daemon health-state derivation to use an optional peer list override
- passes syncManager.listPeers() into getMirrordaemonHealthState(...) from:
  - the service health handler
  - the UI health closure
  - the status surface
- updates daemon and service tests so peers_known is verified from a real peer list instead of a synthetic count path

## Verification
- pnpm vitest run src/mirrordaemon/mirrordaemon.test.ts
- pnpm vitest run src/mirrordaemon/runtime_state.test.ts
- pnpm vitest run src/mirror-service/mirror_service.test.ts
- pnpm check

---------

Co-authored-by: Agent 0 <agent0@toadaid>
## Summary
- remove the direct global metrics dependency from canon_sync.ts
- make applyRemoteCanonUpdates(...) accept small metric hooks
- supply the existing metric behavior from sync_manager.ts
- preserve metric names and counts exactly

## Why
This cleans up ownership in the canon sync seam by moving observability emission out of canon_sync.ts and back to the owning sync manager layer.

## Scope
Changed:
- src/mirror-sync/canon_sync.ts
- src/mirror-sync/sync_manager.ts

Not changed:
- route handlers
- response shapes
- runtime events
- registry/state transitions
- status surfaces
- adapter-boundary files
- packaging/workflows/docs
- broader observability context wiring

## Details
This patch:
- removes incrementMetric(...) from src/mirror-sync/canon_sync.ts
- adds optional metric hooks to applyRemoteCanonUpdates(...):
  - onConflictWarning
  - onUpdatesPulled
- has src/mirror-sync/sync_manager.ts supply the current metric behavior
- preserves the existing metric names and counts:
  - conflict_warnings
  - updates_pulled

## Verification
- pnpm vitest run src/mirror-sync/mirror_sync.test.ts

---------

Co-authored-by: Agent 0 <agent0@toadaid>
## Summary
- remove the direct global observability calls from sync_manager.ts
- make runtime_host.ts supply the current metric and diagnostic behavior explicitly from the owned daemon observability object
- update mirror_sync.test.ts to provide explicit observability hooks while preserving existing assertions

## Why
This continues sync ownership cleanup by moving observability emission out of sync_manager.ts and back to the owning runtime/daemon layer.

## Scope
Changed:
- src/mirror-sync/sync_manager.ts
- src/mirror-service/runtime_host.ts
- src/mirror-sync/mirror_sync.test.ts

Not changed:
- route handlers
- response shapes
- registry/state transitions
- adapter-boundary files
- broader observability-context refactors
- packaging/workflows/docs

## Details
This patch:
- adds optional observability hooks to createMirrorSyncManager(...) for:
  - conflict warnings
  - updates pulled
  - sync failures
  - peer announced
  - pull completed
  - pull failed
- removes incrementMetric and logMirrorEvent imports from src/mirror-sync/sync_manager.ts
- has src/mirror-service/runtime_host.ts pass the current behavior via daemon.getObservability()
- keeps event names, metric names, and counts unchanged

## Verification
- pnpm vitest run src/mirror-sync/mirror_sync.test.ts

Co-authored-by: Agent 0 <agent0@toadaid>
## 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>
ToadAid and others added 2 commits March 23, 2026 15:35
## 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 added a commit that referenced this pull request Mar 23, 2026
## 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>
ToadAid and others added 3 commits March 23, 2026 19:53
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

---------

Co-authored-by: Agent 0 <agent0@toadaid>
## Summary
- remove the dead peersKnown override from the /mirror/runtime/debug route
- let debug peer truth flow from canonical runtime state instead of service-side observability fallback
- preserve debug response shape and all non-peer behavior

## Why
This removes a dead fallback seam from the runtime debug path and keeps debug peer truth aligned with canonical runtime state.

## Scope
Changed:
- src/mirror-service/mirror_service.ts
- src/mirrordaemon/mirrordaemon.test.ts

Not changed:
- src/mirrordaemon/runtime_state.ts
- health/status behavior
- sync protocol
- websocket behavior
- compat files
- packaging
- workflows

## Verification
- pnpm check
- pnpm vitest run src/mirror-service/mirror_service.test.ts
- pnpm vitest run src/mirrordaemon/mirrordaemon.test.ts

Co-authored-by: Agent 0 <agent0@toadaid>
@ToadAid ToadAid merged commit be89968 into main Mar 24, 2026
27 of 28 checks passed
@ToadAid ToadAid deleted the fix-mirror-status-runtime-truth branch March 24, 2026 00:27
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