-
Notifications
You must be signed in to change notification settings - Fork 1
Fix repeated default registry contract tests #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dennisonbertram
merged 1 commit into
main
from
codex/issue-1042-default-registry-repeat
Jul 31, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
docs/plans/2026-07-30-issue-1042-default-registry-repeat-impact-map.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Cross-Surface Impact Map: Issue #1042 Default Registry Repeatability | ||
|
|
||
| ## Task | ||
|
|
||
| - Task / issue: isolate repeated default-registry test invocations, #1042. | ||
| - Plan: `2026-07-30-issue-1042-default-registry-repeat-plan.md`. | ||
| - Owner: Codex. | ||
| - Status: implemented and fully verified; merge pending. | ||
|
|
||
| ## Current Ownership, Callers, and Data Flow | ||
|
|
||
| - Entry: `TestDefaultRegistry_Functions`. | ||
| - Source of truth: package-level `defaultRegistry`; top-level | ||
| `Register/List/New` delegate to it. | ||
| - Search: all `workspace.Register`, default-registry tests, init registration, | ||
| and reset/unregister APIs. | ||
| - Conclusion: production correctly retains registrations; only the fixed test | ||
| identity incorrectly assumes one invocation per process. | ||
|
|
||
| ## Config, API, CLI, and Tools | ||
|
|
||
| - Config/env/defaults: none. | ||
| - API/CLI/wire/tools: production top-level registry API remains exercised. | ||
| - Errors: retain explicit `ErrAlreadyExists` and provisioning checks. | ||
|
|
||
| ## Persistence and Compatibility | ||
|
|
||
| - State: process-local test registry only. | ||
| - Schemas/migrations/caches: none. | ||
| - Compatibility: no runtime change. | ||
|
|
||
| ## Lifecycle, Security, and Reliability | ||
|
|
||
| - Concurrency: process-local atomic counter assigns invocation ownership. | ||
| - Auth/privacy/secrets: none. | ||
| - Failure/recovery: assertion output includes the generated name. | ||
|
|
||
| ## Product and Integration Surfaces | ||
|
|
||
| - Server/TUI/web/macOS/providers: none. | ||
| - Automation: normal, race, repeated, and coverage gates become deterministic. | ||
| - UX/accessibility: none. | ||
|
|
||
| ## Deployment and Operations | ||
|
|
||
| - Deployment/migration/flags: none. | ||
| - Rollback: revert if first/duplicate registration is no longer distinguished. | ||
| - Operator docs: none. | ||
|
|
||
| ## Regression Tests | ||
|
|
||
| - Red: focused `-count=2` fixed-name failure. | ||
| - Green: focused normal/race `-count=100`. | ||
| - Controls: List contains the invocation's name; New provisions exactly its | ||
| factory; duplicate still fails. | ||
| - Full: workspace normal/race and `./scripts/test-regression.sh`. | ||
|
|
||
| ## Documentation and Handoff | ||
|
|
||
| - Update engineering log, long-term log, plan, impact map, and plans index. | ||
| - No public docs. | ||
|
|
||
| ## Warning Check | ||
|
|
||
| - All runtime/product surfaces are explicitly unaffected because the change is | ||
| confined to fixture identity. |
61 changes: 61 additions & 0 deletions
61
docs/plans/2026-07-30-issue-1042-default-registry-repeat-plan.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Plan: Make the Default Registry Contract Test Repeatable | ||
|
|
||
| ## Context | ||
|
|
||
| - Governing GitHub issue: #1042. | ||
| - Problem: `TestDefaultRegistry_Functions` registers a fixed name in a | ||
| process-global registry, so the second `-count` invocation fails before it | ||
| can test its own duplicate-registration contract. | ||
| - User impact: an unrelated workspace package failure blocks the accepted | ||
| cron/callback GUI merge chain. | ||
| - Constraint: keep production registry semantics and every top-level API | ||
| assertion unchanged. | ||
|
|
||
| ## Scope | ||
|
|
||
| - In scope: allocate a collision-free name for each test invocation. | ||
| - Out of scope: production reset/unregister APIs, registry ownership, package | ||
| serialization, and runtime behavior. | ||
|
|
||
| ## Documentation Contract | ||
|
|
||
| - Feature status: test-only bug repair in implementation. | ||
| - Public docs affected: none. | ||
| - Evidence: engineering and long-term logs, plan, impact map, plans index. | ||
|
|
||
| ## Test Plan (TDD) | ||
|
|
||
| - Red: existing focused test at `-count=2` fails deterministically on the second | ||
| invocation with `ErrAlreadyExists`. | ||
| - Green: focused normal/race at `-count=100`; each invocation still asserts | ||
| first registration, duplicate rejection, listing, and provisioning. | ||
| - Full: workspace normal/race and repository normal/race/coverage gate. | ||
|
|
||
| ## Cross-Surface Impact Map | ||
|
|
||
| - See `2026-07-30-issue-1042-default-registry-repeat-impact-map.md`. | ||
|
|
||
| ## Implementation Checklist | ||
|
|
||
| - [x] Create contract-complete bug #1042. | ||
| - [x] Capture deterministic red evidence. | ||
| - [x] Record registry ownership/search evidence. | ||
| - [x] Write plan and impact map before code. | ||
| - [x] Implement invocation-unique identity. | ||
| - [x] Run focused stress and full gates. | ||
| - [ ] Merge through a closing PR. | ||
|
|
||
| ## Verification | ||
|
|
||
| - Focused normal and race tests passed at `-count=100`. | ||
| - The complete workspace package passed normal and race tests at `-count=5`. | ||
| - `./scripts/test-regression.sh` passed normal, race, and the 85.6% coverage | ||
| gate with zero uncovered functions. | ||
|
|
||
| ## Risks and Mitigations | ||
|
|
||
| - Risk: unique names could stop testing duplicate rejection. | ||
| - Mitigation: register the same invocation-local name twice and retain the | ||
| explicit `ErrAlreadyExists` assertion. | ||
| - Risk: a timing-derived name could collide. | ||
| - Mitigation: use a process-local atomic sequence, not wall-clock time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an automated repeat case to a required test path. I checked
.github/workflows/test-fast.ymland.github/workflows/test-regression.yml; both ultimately run this package withgo testwithout-count, so replacing this generated name with the original fixed name would still pass every checked-in gate and the defect would recur whenever a developer manually repeats the suite. Encode at least two invocations in a permanent regression test or make the repeat command part of the gate.AGENTS.md reference: AGENTS.md:L55-L55
Useful? React with 👍 / 👎.