From c04d00c15e285b1e6422dd432da5355a5da2d005 Mon Sep 17 00:00:00 2001 From: haelyra <49814733+haelyra@users.noreply.github.com> Date: Tue, 20 Oct 2026 18:17:37 -0400 Subject: [PATCH] fix(integration): address review findings in docs and diagnostics --- manifests/context-packs/skill-triggers@1.json | 2 +- pi/core/skills/python-testing/SKILL.md | 11 ++++++----- scripts/lib/inspection.js | 5 +++-- skills/python-testing/SKILL.md | 11 ++++++----- tests/commands/santa-loop.test.js | 2 ++ tests/lib/inspection.test.js | 13 +++++++++++++ 6 files changed, 31 insertions(+), 13 deletions(-) diff --git a/manifests/context-packs/skill-triggers@1.json b/manifests/context-packs/skill-triggers@1.json index 62df0662b..1b8035e53 100644 --- a/manifests/context-packs/skill-triggers@1.json +++ b/manifests/context-packs/skill-triggers@1.json @@ -10,7 +10,7 @@ "id": "hand-seeded", "source": "manual-curation-pending-regeneration" }, - "registryDigest": "eb958f9f43b73851550a2142dc5c5da693bba33bf1c8267db3d9722cee4b891b", + "registryDigest": "1cbe4074364e551b4cc250b18e476b041e4829e95238fabfc1459a9c2fb563da", "schemaVersion": 1, "triggers": { "skill:agent-runtime-gateway-smoke-test": [ diff --git a/pi/core/skills/python-testing/SKILL.md b/pi/core/skills/python-testing/SKILL.md index 713aeb429..8e68a084a 100644 --- a/pi/core/skills/python-testing/SKILL.md +++ b/pi/core/skills/python-testing/SKILL.md @@ -486,20 +486,21 @@ async def test_async_with_fixture(async_client): ### Async Fixture (FastAPI) -`ASGITransport` does not run lifespan events. If the app needs startup/shutdown, wrap the client block in `async with LifespanManager(app) as manager:` (from `asgi_lifespan`) -and use `ASGITransport(app=manager.app)`. See [FastAPI's async testing guidance](https://github.com/fastapi/fastapi/blob/master/docs/en/docs/advanced/async-tests.md). +`ASGITransport` does not run lifespan events. Install `asgi-lifespan` and wrap the client in `LifespanManager` when the app uses startup or shutdown handlers. See [FastAPI's async testing guidance](https://github.com/fastapi/fastapi/blob/master/docs/en/docs/advanced/async-tests.md). ```python import pytest import pytest_asyncio +from asgi_lifespan import LifespanManager from httpx import ASGITransport, AsyncClient @pytest_asyncio.fixture async def async_client(): - """Async fixture providing async test client.""" + """Async fixture providing async test client with lifespan events.""" app = create_app() # Returns a FastAPI application - async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client: - yield client + async with LifespanManager(app) as manager: + async with AsyncClient(transport=ASGITransport(app=manager.app), base_url="http://test") as client: + yield client @pytest.mark.asyncio async def test_api_endpoint(async_client): diff --git a/scripts/lib/inspection.js b/scripts/lib/inspection.js index 43ed7046e..1e24df064 100644 --- a/scripts/lib/inspection.js +++ b/scripts/lib/inspection.js @@ -25,8 +25,9 @@ function normalizeFailureReason(reason) { // A closing quote must be followed by a delimiter, not another name character. .replace(/(["'])(?:[a-z]:[\\/]|\\\\)[^\r\n]*?\1(?=[:\s),;.!?]|$)/gu, '$1$1') // Directories may contain spaces, but trailing whitespace separates diagnostic prose. - // Spaced leaves need an extension before a colon, or quotes; preserve extensionless diagnostics. - .replace(/(?:\b[a-z]:|\\)[\\/](?:[^\\/:*?"<>|\r\n]*[^\s\\/:*?"<>|][\\/])*[^\s\\/:*?"<>|(),;]+(?: [^\\/:*?"<>|\r\n]*\.[^\s\\/:*?"<>|]+(?=:))?[\\/]*/gu, '') + // Unquoted spaced leaves allow one final dotted token; longer prose stays diagnostic. + // Quote paths with multiple spaces in the final filename to remove ambiguity. + .replace(/(?:\b[a-z]:|\\)[\\/](?:[^\\/:*?"<>|\r\n]*[^\s\\/:*?"<>|][\\/])*[^\s\\/:*?"<>|(),;]+(?: (?!failed\b|timed\b|could\b|cannot\b|unable\b|error\b)[^\s\\/:*?"<>|]+\.[^\s\\/:*?"<>|]+(?=:))?[\\/]*/gu, '') // Strip remaining file paths .replace(/(?:\b[a-z]:)?[\\/][\w./\\-]+/g, '') // Collapse whitespace diff --git a/skills/python-testing/SKILL.md b/skills/python-testing/SKILL.md index 713aeb429..8e68a084a 100644 --- a/skills/python-testing/SKILL.md +++ b/skills/python-testing/SKILL.md @@ -486,20 +486,21 @@ async def test_async_with_fixture(async_client): ### Async Fixture (FastAPI) -`ASGITransport` does not run lifespan events. If the app needs startup/shutdown, wrap the client block in `async with LifespanManager(app) as manager:` (from `asgi_lifespan`) -and use `ASGITransport(app=manager.app)`. See [FastAPI's async testing guidance](https://github.com/fastapi/fastapi/blob/master/docs/en/docs/advanced/async-tests.md). +`ASGITransport` does not run lifespan events. Install `asgi-lifespan` and wrap the client in `LifespanManager` when the app uses startup or shutdown handlers. See [FastAPI's async testing guidance](https://github.com/fastapi/fastapi/blob/master/docs/en/docs/advanced/async-tests.md). ```python import pytest import pytest_asyncio +from asgi_lifespan import LifespanManager from httpx import ASGITransport, AsyncClient @pytest_asyncio.fixture async def async_client(): - """Async fixture providing async test client.""" + """Async fixture providing async test client with lifespan events.""" app = create_app() # Returns a FastAPI application - async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client: - yield client + async with LifespanManager(app) as manager: + async with AsyncClient(transport=ASGITransport(app=manager.app), base_url="http://test") as client: + yield client @pytest.mark.asyncio async def test_api_endpoint(async_client): diff --git a/tests/commands/santa-loop.test.js b/tests/commands/santa-loop.test.js index a1ae5a2d2..69248e18f 100644 --- a/tests/commands/santa-loop.test.js +++ b/tests/commands/santa-loop.test.js @@ -15,6 +15,8 @@ const commands = [ if (process.platform === 'win32') { console.log('Skipped: Santa Loop examples require Bash'); + console.log('Passed: 0'); + console.log('Failed: 0'); process.exit(0); } diff --git a/tests/lib/inspection.test.js b/tests/lib/inspection.test.js index 9005dad28..80082b25b 100644 --- a/tests/lib/inspection.test.js +++ b/tests/lib/inspection.test.js @@ -172,6 +172,19 @@ async function runTests() { assert.strictEqual(groupFailures(runs).size, 3); })) passed += 1; else failed += 1; + if (await test('keeps dotted diagnostic prose after extensionless Windows paths separate', async () => { + const reasons = [ + String.raw`Command C:\tools\node failed to open config.json: EACCES`, + String.raw`Command D:\tools\node timed out opening config.json: EACCES`, + ]; + assert.deepStrictEqual(reasons.map(normalizeFailureReason), [ + 'command failed to open config.json: eacces', + 'command timed out opening config.json: eacces', + ]); + const runs = reasons.map((failureReason, index) => makeSkillRun({ id: `dotted-${index}`, failureReason })); + assert.strictEqual(groupFailures(runs).size, 2); + })) passed += 1; else failed += 1; + if (await test('groupFailures handles mixed outcome casing', async () => { const runs = [ makeSkillRun({ id: 'r1', outcome: 'FAILURE', failureReason: 'timeout' }),