Skip to content

feat(core): bounded query debug trace (#992)#1115

Merged
shaun0927 merged 1 commit into
feat/986-agentql-query-dslfrom
feat/992-query-debug
May 13, 2026
Merged

feat(core): bounded query debug trace (#992)#1115
shaun0927 merged 1 commit into
feat/986-agentql-query-dslfrom
feat/992-query-debug

Conversation

@shaun0927
Copy link
Copy Markdown
Owner

@shaun0927 shaun0927 commented May 12, 2026

Progress / Review status

Auto-refreshed 2026-05-13 — owner comments cleaned up to reduce review noise.

Field Value
Branch feat/992-query-debugfeat/986-agentql-query-dsl
Draft no
CI
Mergeable ✅ MERGEABLE
Review decision
Codex (latest)
Other reviewers (latest)
Head b565579 — Make extraction failures inspectable without bloating responses
Commits 1

Owner comment cleanup: 0 issue + 0 inline review comments deleted. Outstanding feedback from automated/external reviewers above is unchanged.


Summary

  • adds bounded in-memory query debug store with text caps and token/password-style redaction
  • registers oc_query_debug for latest { tabId, kind } debug retrieval
  • instruments extract_data query/schema paths for found/missing fields, strategies, duration, output size, and parser/schema failures

Repo-fit / duplicate check

Tests

  • npx jest tests/query-debug/store.test.ts tests/tools/oc-query-debug.test.ts tests/tools/extract-data.test.ts --runInBand
  • npm run build
  • npm run lint:changed

Merge-time real OpenChrome verification

  1. Start OpenChrome and navigate to a fixture with partial structured data.
  2. Run extract_data with a query containing one existing and one missing field.
  3. Call oc_query_debug({ tabId, kind: "extract" }).
  4. Verify payload includes normalized query, parsed field summary, strategies, found/missing fields, duration, output size, and no full DOM/HTML.
  5. Repeat with malformed query and verify notes[0] reports parser failure.
  6. Run a fixture containing password/token-like text and verify debug JSON redacts those values.

Closes #992

Constraint: Debug traces must stay local, bounded, sanitized, and opt-in through oc_query_debug.
Rejected: Persist full DOM/debug artifacts or add AgentQL/cloud debugger dependency | too heavy and outside OpenChrome's local MCP direction.
Confidence: high
Scope-risk: moderate
Directive: Keep normal extract_data responses compact; add element debug records in a follow-up only after resolver instrumentation lands.
Tested: npx jest tests/query-debug/store.test.ts tests/tools/oc-query-debug.test.ts tests/tools/extract-data.test.ts --runInBand; npm run build; npm run lint:changed
Not-tested: Real OpenChrome fixture evidence is documented in the PR for merge-time validation.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Repository owner deleted a comment from gemini-code-assist Bot May 13, 2026
Repository owner deleted a comment from qodo-code-review Bot May 13, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot May 13, 2026
@shaun0927
Copy link
Copy Markdown
Owner Author

Merge rationale (stack consolidation)

Intent. Closes #992 — adds a bounded in-memory query debug store, registers oc_query_debug for retrieving the latest { tabId, kind } debug entry, and instruments extract_data query/schema paths (found/missing fields, strategies, duration, output size, parser/schema failures).

Why this is correct.

CI. Targets the AgentQL query DSL feature branch; workflow runs only on main/develop PRs, so this PR has no CI of its own. CI will run on the chain root when consolidated to develop.

@shaun0927 shaun0927 merged commit 2e48202 into feat/986-agentql-query-dsl May 13, 2026
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.

1 participant