Conversation
Add --with-context for query JSON output, backed by a shared language-agnostic source context helper. Also expose compatible search JSON metadata for language, leading comments, and classified text matches, and unwrap JS/TS export statements in symbols output.
Track block comments, HTML comments, and multiline quoted strings when adding search match metadata so the new JSON fields do not regress existing search comment handling.
Architecture Issues (10)
Performance Issues (11)
Architecture Issues (10)
Quality Issues (1)
Powered by Visor from Probelabs Last updated: 2026-05-06T10:18:41.601Z | Triggered by: pr_updated | Commit: 1a9be12 💡 TIP: You can chat with Visor using |
|
Thanks, this PR now covers the important first slice for Proof's source-discovery path. The scoped split in the description is right: Probe should expose source facts, while Proof keeps requirement/test-policy interpretation and language-specific instrumentation. For Proof's planned cleanup, this is enough to move req-id text discovery/autolink toward Probe:
What is still missing before Proof can remove the remaining non-instrumentation AST/source readers:
With those additions, Proof could use Probe as the generic source-reader for trace/evidence discovery across Go/JS/TS and reserve local AST parsing for cases that truly require transformation or language execution semantics, such as MC/DC instrumentation and coverage/tool-specific processing. |
Summary
probe query --with-context/--owner-contextfor opt-in JSON owner-block metadatasymbolsoutput by unwrapping exported declarations to their semantic inner names--no-mergeevidence path, including negative string/comment hit classificationImplemented:
probe query --with-contextprobe querynow has a new opt-in flag:probe query 'fetch($$$ARGS)' ./src -l typescript --format json --with-contextThe default query JSON remains backward-compatible. With
--with-context, each result keeps the existing fields and additionally includes:schema_version: "probe.query.context.v1"at the top levellanguage: inferred source languagepattern: source pattern and nullable pattern IDmatch: exact AST match node type, content, line range, and column rangeowner: smallest useful enclosing source block where availableowner.symbolandowner.qualified_symbolowner.node_type,owner.scope,owner.lines, andowner.columnsowner.comments: attached leading/source comments as raw source factsowner.enclosing_symbols: containing class/module/impl-style symbols where knowableowner.enclosing_call/owner.enclosing_calls: generic call context for callback/call nesting where knowableowner.content: owning block source text when availableThis is intentionally generic. Probe reports source facts only; it does not parse requirement IDs, policy annotations, checklist semantics, test frameworks, or security meanings.
Implemented: search JSON source metadata
Search JSON keeps its existing shape but now includes additional source facts useful for text-first evidence discovery:
languageowner_symbolfor common owner blocks, including TS/JS methods and exported const arrowsowner_qualified_symbol, e.g.PolicyService.evaluatePolicyenclosing_symbols, e.g. containing class/module/impl symbolsenclosing_call/enclosing_calls, e.g. genericdescribe(...)/it(...)callback call chains without framework interpretationleading_commentswith line ranges and raw textmatcheswith text, line/column range,kind(comment,string,code), andcomment_rolewhen applicableThe added regressions cover the intended search path:
probe search --allow-tests --strict-elastic-syntax --max-results 20 --no-merge \ --format json '"SYS-REQ-424" OR "SYS-REQ-425"' ./fixtureThey verify TS method ownership, exported const arrow ownership, qualified class-method identity, nested callback call chains, test callback scope, leading comments, classified comment matches, string-literal hits, and loose comment hits. Probe still does not interpret which comments are valid evidence; downstream tools decide that from the raw source facts.
JS/TS fixes
probe search -o jsoncan now report owner symbols for TS/JSmethod_definitionblocks.probe search -o jsoncan now report owner symbols for exported const arrow functions even when the returned block is anexport_statement.probe symbolsnow unwraps common TS/JSexport_statement/declare_statementwrappers and returns semantic names likePolicyServiceandnormalizeDecisioninstead of genericexport_statementnames.Architecture notes
--with-context.Out of scope for this PR
--patterns-filesearch --semantic-blocksbehaviorextract --semantic-blockbehaviorTests
Refs #557
Refs #558