From 404ed8d0eb94f1678012529c8330b6db42e61490 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Tue, 8 Sep 2026 03:02:44 +0900 Subject: [PATCH] Track the current 1.x-dev of bear/query-repository SafeSemanticLogger's constructor changed there: it takes an optional LogSinkInterface and a session store, not a delegate logger. Both places that bind the cache log by hand passed a logger, so the release candidate answers them with a TypeError before a single flow runs - every oracle flow and the corpus cache test died in the DI graph. Bound with to() in Singleton scope instead of an instance: the two sites resolve the logger from the injector, and a service object on a binding keeps DI out of its construction and stops the injector from serialising. Verified against the pinned 5abe573: tests/Resource/AgentCorpusCacheTest 4 tests green, and the gate reports 12 flows ok with exit 0 (the library line reads NOT A CHECKOUT, which is what a dist install looks like). composer.lock also records my-vendor/be-mart-be's path-package hash recomputed on a clean checkout. --- composer.lock | 10 +++++----- tests/Resource/AgentCorpusCacheTest.php | 4 ++-- var/loop/verify-cache.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index b53d2164..5bdccd96 100644 --- a/composer.lock +++ b/composer.lock @@ -819,12 +819,12 @@ "source": { "type": "git", "url": "https://github.com/bearsunday/BEAR.QueryRepository.git", - "reference": "bec4c4dc5852098415d126c00c9716742f3b9ddb" + "reference": "5abe57368553e00aa752551f7f70f63d43abcb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bearsunday/BEAR.QueryRepository/zipball/bec4c4dc5852098415d126c00c9716742f3b9ddb", - "reference": "bec4c4dc5852098415d126c00c9716742f3b9ddb", + "url": "https://api.github.com/repos/bearsunday/BEAR.QueryRepository/zipball/5abe57368553e00aa752551f7f70f63d43abcb53", + "reference": "5abe57368553e00aa752551f7f70f63d43abcb53", "shasum": "" }, "require": { @@ -896,7 +896,7 @@ "issues": "https://github.com/bearsunday/BEAR.QueryRepository/issues", "source": "https://github.com/bearsunday/BEAR.QueryRepository/tree/1.x" }, - "time": "2026-08-31T10:09:23+00:00" + "time": "2026-09-07T12:50:29+00:00" }, { "name": "bear/resource", @@ -2060,7 +2060,7 @@ "dist": { "type": "path", "url": "be", - "reference": "cc46e612ebe9925c013ce9d34014d6b022c80270" + "reference": "582b54fe20c555993e476620e427f520c37864e1" }, "require": { "be-framework/be": "dev-semantic-logger-0.9 as 0.1.0", diff --git a/tests/Resource/AgentCorpusCacheTest.php b/tests/Resource/AgentCorpusCacheTest.php index 00152e64..614e9e63 100644 --- a/tests/Resource/AgentCorpusCacheTest.php +++ b/tests/Resource/AgentCorpusCacheTest.php @@ -11,7 +11,6 @@ use BEAR\RepositoryModule\Annotation\ResourceObjectPool; use BEAR\Resource\ResourceInterface; use Koriym\SemanticLogger\LogJson; -use Koriym\SemanticLogger\SemanticLogger; use Koriym\SemanticLogger\SemanticLoggerInterface; use MyVendor\BeMart\Be\Reason\Service\ProductCacheInvalidatorInterface; use MyVendor\BeMart\Injector; @@ -22,6 +21,7 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Ray\Di\AbstractModule; +use Ray\Di\Scope; use ReflectionClass; use Symfony\Component\Cache\Adapter\AdapterInterface; use Symfony\Component\Cache\Adapter\ArrayAdapter; @@ -92,7 +92,7 @@ protected function configure(): void { $this->bind(AdapterInterface::class)->annotatedWith(ResourceObjectPool::class)->toInstance(new ArrayAdapter()); $this->bind(SemanticLoggerInterface::class)->annotatedWith(CacheLog::class) - ->toInstance(new SafeSemanticLogger(new SemanticLogger())); + ->to(SafeSemanticLogger::class)->in(Scope::SINGLETON); } }; $injector = Injector::getOverrideInstance('cli-fake-hal-app', $override); diff --git a/var/loop/verify-cache.php b/var/loop/verify-cache.php index 53c4f48e..bb9798b9 100644 --- a/var/loop/verify-cache.php +++ b/var/loop/verify-cache.php @@ -40,10 +40,10 @@ use BEAR\Sunday\Extension\Transfer\HttpCacheInterface; use BEAR\Resource\Uri; use Koriym\SemanticLogger\LogJson; -use Koriym\SemanticLogger\SemanticLogger; use Koriym\SemanticLogger\SemanticLoggerInterface; use MyVendor\BeMart\Injector; use Ray\Di\AbstractModule; +use Ray\Di\Scope; use Symfony\Component\Cache\Adapter\RedisAdapter; require dirname(__DIR__, 2) . '/vendor/autoload.php'; @@ -216,7 +216,7 @@ protected function configure(): void : new StorageRedisDsnModule($this->dsn)); // Recording on, by replacing the one binding that decides it $this->bind(SemanticLoggerInterface::class)->annotatedWith(CacheLog::class) - ->toInstance(new SafeSemanticLogger(new SemanticLogger())); + ->to(SafeSemanticLogger::class)->in(Scope::SINGLETON); if ($this->cdn) { // The CDN flavour BeMart would deploy behind, with the purge recorded instead of sent.