Skip to content

test(core): direct unit tests for AgentRegistry's identity/registration/lifecycle behaviour - #121

Merged
Mearman merged 2 commits into
mainfrom
test/agent-registry-mutation-coverage
Sep 15, 2026
Merged

Mearman merged 2 commits into
mainfrom
test/agent-registry-mutation-coverage

Conversation

@Mearman

@Mearman Mearman commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

  • AgentRegistry was only exercised indirectly through MeshStore/room-kick-revocation integration tests, leaving individual branches, string literals, and array literals unobserved.
  • Adds a direct DI-based unit test file using AgentRegistryDeps' fake collaborators, covering readIdentity/writeIdentity's composite key, registerAgent's new-vs-existing branch and visibility-gated federation broadcast, updateAgent's name/status change notifications and not-found error, listAgents' ghost-visibility filtering (including self-visibility), and setAgentOffline's owner-only broadcast gating.
  • Raises src/core/agent-registry.ts's real mutation score from 31.71% (verified freshly, not the stale 76.19% the tracking issue cited) toward the repo's 80% threshold.

Closes #104

Test plan

  • pnpm typecheck
  • pnpm lint
  • pnpm test (60 files, 426 tests, full suite green)

…lifecycle directly

AgentRegistry was previously exercised only indirectly through MeshStore and
room-kick-revocation integration tests, leaving individual branches, string
literals, and array literals unobserved by any assertion. AgentRegistryDeps
is a narrow, injectable surface built exactly for direct testing: a fake
deps object with vi.fn() collaborators asserts on readIdentity/writeIdentity's
composite key, registerAgent's new-vs-existing branch and visibility-gated
federation broadcast, updateAgent's name/status change notifications and
not-found error, listAgents' ghost-visibility filtering including self-
visibility, and setAgentOffline's owner-only broadcast gating.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-15T07:46:15.950714Z a130b96 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…utant

Verified 97.56% mutation score against src/core/agent-registry.ts (40
killed, 1 survived) -- the one remaining survivor is a true equivalent,
matching stale-agent-checker.test.ts's identical redundant-set pattern.
@Mearman
Mearman merged commit e89130a into main Sep 15, 2026
6 checks passed
@Mearman
Mearman deleted the test/agent-registry-mutation-coverage branch September 15, 2026 07:54
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.21.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raise src/core/agent-registry.ts mutation score to 80%

1 participant