LearnNewsExamplesServices
Frontmatter
id7901
titleSplit Playwright tests into granular knowledge base chunks for better retrieval
stateClosed
labels
enhancementaitesting
assigneestobiu
createdAtNov 25, 2025, 3:01 PM
updatedAtNov 25, 2025, 3:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/7901
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 25, 2025, 3:42 PM

Split Playwright tests into granular knowledge base chunks for better retrieval

Closed v11.11.0 enhancementaitesting
tobiu
tobiu commented on Nov 25, 2025, 3:01 PM

Currently, test/playwright files are indexed as single monolithic chunks. This dilutes the semantic signal of individual test cases, making it harder for the vector search to find specific testing patterns.

Goal: Decompose test files into smaller, semantically distinct chunks to improve search scoring and relevance.

Requirements:

  1. File-Level Context Chunk:

    • Create a dedicated chunk for the file's "header".
    • Content: Top-level comments, imports, and outer test.describe descriptions.
    • Purpose: Captures high-level intent (e.g., "Grid Filtering Tests") and shared context.
  2. Test-Case Chunks:

    • Parse individual test('description', ...) blocks.
    • Create a separate chunk for each test case.
    • Content: The test description + the full function body.
    • Name: [RelativePath] - [Test Description].
  3. Location Metadata (New):

    • Calculate and store line_start and line_end for each test chunk.
    • Benefit: Enables agents to pinpoint the exact location of a test within a large file, allowing for targeted read_file operations (using offset/limit) when safe to do so.
  4. Source Mapping:

    • All chunks must retain the exact source property pointing to the original .spec.mjs file.
tobiu added the enhancement label on Nov 25, 2025, 3:01 PM
tobiu added the ai label on Nov 25, 2025, 3:01 PM
tobiu added the testing label on Nov 25, 2025, 3:01 PM
tobiu assigned to @tobiu on Nov 25, 2025, 3:02 PM
tobiu referenced in commit 06c2c4a - "Split Playwright tests into granular chunks for improved Knowledge Base indexing #7901 on Nov 25, 2025, 3:33 PM
tobiu
tobiu Nov 25, 2025, 3:41 PM

Input from Neo Agent:

◆ I have verified the implementation by performing a full rebuild of the Knowledge Base.

Verification Results:

  • Chunk Generation: The process successfully parsed Playwright test files, generating granular chunks for individual test cases and file-level headers.
  • Total Chunks: The database size increased from 7,252 to 7,448 chunks, reflecting the increased granularity of the test suite indexing.
  • Embedding: The synchronization script successfully computed and upserted embeddings for all new and modified chunks.

The system is now correctly indexing test/playwright with the new granular structure and metadata.

tobiu closed this issue on Nov 25, 2025, 3:42 PM