Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

[codex] add toolregistry unit coverage#68

Merged
haasonsaas merged 1 commit intomainfrom
codex/asb-toolregistry-tests
Apr 16, 2026
Merged

[codex] add toolregistry unit coverage#68
haasonsaas merged 1 commit intomainfrom
codex/asb-toolregistry-tests

Conversation

@haasonsaas
Copy link
Copy Markdown
Collaborator

Summary

  • add direct toolregistry package tests for required-field validation, not-found lookups, overwrite behavior, and returned-copy semantics
  • keep the slice scoped to the registry package itself instead of only relying on indirect coverage through internal/app

Why

asb#61 still called out the lack of direct toolregistry unit tests. This keeps that gap small and reviewable without mixing in the larger durable-audit or Helm work.

Validation

  • go test ./internal/authz/toolregistry -count=1
  • go test ./... -count=1
  • GOTOOLCHAIN=go1.26.0 go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.3 run ./internal/authz/toolregistry ./internal/app
  • git diff --check

Scope

This is a second bounded slice of asb#61, limited to direct toolregistry unit coverage.

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 16, 2026

PR Summary

Low Risk
Adds isolated unit tests only; no production logic changes, so behavior risk is minimal aside from tightening expectations around error types and copy semantics.

Overview
Adds a new registry_test.go to directly exercise toolregistry behavior.

Tests now assert Put rejects missing required fields with core.ErrInvalidRequest, Get returns core.ErrNotFound for unknown tools, Put+Get round-trips full core.Tool data, Get returns a defensive copy, and Put overwrites existing entries.

Reviewed by Cursor Bugbot for commit 8db8cff. Bugbot is set up for automated code reviews on this repo. Configure here.

@haasonsaas haasonsaas marked this pull request as ready for review April 16, 2026 02:16
@haasonsaas haasonsaas merged commit ec88be4 into main Apr 16, 2026
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant