Skip to content

Remember valid queries while recording - #800

Merged
staabm merged 14 commits into
mainfrom
va
Jul 16, 2026
Merged

Remember valid queries while recording#800
staabm merged 14 commits into
mainfrom
va

Conversation

@staabm

@staabm staabm commented Jul 15, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the query reflection cache to explicitly remember successful query validations (not just validation errors), so replay mode can avoid re-validating/recording queries that were already proven valid.

Changes:

  • Introduces a Valid marker type to represent “validated successfully” in cached records.
  • Updates ReflectionCache to store and distinguish Valid vs Error for validation outcomes, and adds contains() / putValidationSuccess().
  • Adjusts ReplayAndRecordingQueryReflector::validateQueryString() to replay validation only when the query is already present in the cache; otherwise it records and persists the validation result.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Valid.php Adds a marker type used to persist “validated successfully” state.
src/QueryReflection/TypeSerializer.php Updates record type annotations to allow the new Valid marker.
src/QueryReflection/ReplayAndRecordingQueryReflector.php Uses cache presence to decide between replay vs recording for validation.
src/QueryReflection/ReflectionCache.php Adds schema bump and new APIs to store validation success + query presence.
src/QueryReflection/RecordingQueryReflector.php Records validation success in the cache when no error is returned.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Valid.php Outdated
final class ReflectionCache
{
private const SCHEMA_VERSION = 'v12-new-cache5';
private const SCHEMA_VERSION = 'v13-valid-query';
staabm and others added 7 commits July 15, 2026 17:51
@staabm
staabm marked this pull request as ready for review July 15, 2026 16:52
@staabm
staabm requested a review from Copilot July 15, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Comment thread src/QueryReflection/ReflectionCache.php
@staabm
staabm merged commit 78c763f into main Jul 16, 2026
31 checks passed
@staabm
staabm deleted the va branch July 16, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants