cli/pkg/framework/core
Snider 451e84aa76
fix(core): add thread-safety to global Core instance (#95)
Protect the global `instance` variable with sync.RWMutex to prevent
data races when SetInstance/App() are called concurrently (especially
in tests).

Changes:
- Add instanceMu mutex to protect instance variable
- Update App() to use RLock for reading
- Update SetInstance() to use Lock for writing
- Add GetInstance() for non-panicking access
- Add ClearInstance() for test cleanup
- Update tests to use new thread-safe functions
- Add concurrent access test with race detector

Closes #84

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-01 16:03:44 +00:00
..
docs/site feat(framework): add core DI framework and improve dev commands 2026-01-30 09:02:16 +00:00
testdata feat(framework): add core DI framework and improve dev commands 2026-01-30 09:02:16 +00:00
core.go fix(core): add thread-safety to global Core instance (#95) 2026-02-01 16:03:44 +00:00
core_extra_test.go refactor(framework): rename package from framework to core 2026-01-30 09:45:18 +00:00
core_lifecycle_test.go refactor(framework): rename package from framework to core 2026-01-30 09:45:18 +00:00
core_test.go fix(core): add thread-safety to global Core instance (#95) 2026-02-01 16:03:44 +00:00
e.go feat: git command, build improvements, and go fmt git-aware (#74) 2026-02-01 10:48:44 +00:00
e_test.go refactor(framework): rename package from framework to core 2026-01-30 09:45:18 +00:00
interfaces.go fix(core): add thread-safety to global Core instance (#95) 2026-02-01 16:03:44 +00:00
ipc_test.go fix(docs): respect workspace.yaml packages_dir setting (fixes #46) (#55) 2026-02-01 01:59:27 +00:00
query_test.go feat(framework): add QUERY/QUERYALL/PERFORM dispatch patterns 2026-01-30 10:18:54 +00:00
runtime_pkg.go feat(framework): add QUERY/QUERYALL/PERFORM dispatch patterns 2026-01-30 10:18:54 +00:00
runtime_pkg_extra_test.go refactor(framework): rename package from framework to core 2026-01-30 09:45:18 +00:00
runtime_pkg_test.go refactor(framework): rename package from framework to core 2026-01-30 09:45:18 +00:00