Define shared search filtering, grouping, and ordering #27

Merged
JayKobe6k merged 4 commits from issue-13-shared-search-pipeline into main 2026-09-04 21:38:03 +00:00
Owner

Summary

  • add application-owned typed search requests, prepared regex plans, flat repository hits, and recursive grouped results
  • apply deterministic filtering, ordering, limits, truncation, and complete source-provenance tie-breaking across every search target
  • expose shared CLI options and parity-preserving typed text/JSON output, with documented matching and field applicability

Tests

  • nix develop --command cargo fmt --all -- --check
  • nix develop --command cargo lint
  • nix develop --command cargo test --all-targets --all-features
  • nix develop --command cargo doc --no-deps --all-features
  • nix develop --command cargo check --all-targets --all-features --target x86_64-pc-windows-gnu
  • git diff --check

Depends on #25.
Closes #13.

## Summary - add application-owned typed search requests, prepared regex plans, flat repository hits, and recursive grouped results - apply deterministic filtering, ordering, limits, truncation, and complete source-provenance tie-breaking across every search target - expose shared CLI options and parity-preserving typed text/JSON output, with documented matching and field applicability ## Tests - `nix develop --command cargo fmt --all -- --check` - `nix develop --command cargo lint` - `nix develop --command cargo test --all-targets --all-features` - `nix develop --command cargo doc --no-deps --all-features` - `nix develop --command cargo check --all-targets --all-features --target x86_64-pc-windows-gnu` - `git diff --check` Depends on #25. Closes #13.
Define shared search pipeline
All checks were successful
Validate / Formatting, linting, and tests (push) Successful in 2m21s
Validate / Formatting, linting, and tests (pull_request) Successful in 2m13s
b126978694
JayKobe6k left a comment

Found two actionable search-pipeline defects.

Found two actionable search-pipeline defects.
@ -0,0 +469,4 @@
structure: Option<String>,
enumeration: Option<String>,
canonical_type: Option<String>,
source_anchor: SearchSourceAnchor,
Author
Owner

[P2] This requires a source anchor for every hit, but the value contract permits anchorless definitions and issue #10 explicitly requires merge handles, identified by an occurrence anchor or ordinal, to be returned by search. An ordinal control-flow merge therefore cannot be mapped faithfully without dropping it or inventing source provenance, making value search incomplete or misleading. Please represent source-or-ordinal/missing provenance and define its tie-break and JSON behavior.

[P2] This requires a source anchor for every hit, but the value contract permits anchorless definitions and issue #10 explicitly requires merge handles, identified by an occurrence anchor or ordinal, to be returned by search. An ordinal control-flow merge therefore cannot be mapped faithfully without dropping it or inventing source provenance, making value search incomplete or misleading. Please represent source-or-ordinal/missing provenance and define its tie-break and JSON behavior.
@ -0,0 +787,4 @@
});
}
for field in &request.group_by {
validate_field(request.target, *field, "--group-by")?;
Author
Owner

[P3] This validates only applicability, leaving grouping depth unbounded. Against this head, a one-hit probe with 5,000 repeated SearchField::Type terms was accepted and execute aborted with a stack overflow; the CLI also accepts an unbounded grouping vector. Please reject duplicate/excess grouping terms during preparation, naturally limiting depth to six distinct fields, or make grouping and rendering iterative.

[P3] This validates only applicability, leaving grouping depth unbounded. Against this head, a one-hit probe with 5,000 repeated `SearchField::Type` terms was accepted and `execute` aborted with a stack overflow; the CLI also accepts an unbounded grouping vector. Please reject duplicate/excess grouping terms during preparation, naturally limiting depth to six distinct fields, or make grouping and rendering iterative.
Preserve value provenance in search results
All checks were successful
Validate / Formatting, linting, and tests (push) Successful in 3m0s
Validate / Formatting, linting, and tests (pull_request) Successful in 18m13s
ad33903aa4
Author
Owner

Review comment #1074: Fixed in ad33903. Value search hits now retain the typed ValueOccurrenceSite, including both source anchors plus structural ordinal or a source-less semantic ordinal; deterministic ties and tagged JSON include that provenance. Regressions include value_sites_order_by_source_discriminator_then_source_less_ordinal and search_json_tags_source_less_value_ordinals_without_inventing_source; full validation passed.

Review comment #1074: Fixed in ad33903. Value search hits now retain the typed `ValueOccurrenceSite`, including both source anchors plus structural ordinal or a source-less semantic ordinal; deterministic ties and tagged JSON include that provenance. Regressions include `value_sites_order_by_source_discriminator_then_source_less_ordinal` and `search_json_tags_source_less_value_ordinals_without_inventing_source`; full validation passed.
Author
Owner

Review comment #1078: Fixed in ad33903. PreparedSearchPlan now rejects duplicate grouping fields, so the closed six-field enum bounds grouping recursion. Regressions: duplicate_grouping_fields_are_rejected_and_distinct_fields_bound_depth and service_rejects_duplicate_grouping_before_catalog_or_repository_access; full all-target/all-feature tests, lint, rustdoc, Windows target check, and diff check passed.

Review comment #1078: Fixed in ad33903. `PreparedSearchPlan` now rejects duplicate grouping fields, so the closed six-field enum bounds grouping recursion. Regressions: `duplicate_grouping_fields_are_rejected_and_distinct_fields_bound_depth` and `service_rejects_duplicate_grouping_before_catalog_or_repository_access`; full all-target/all-feature tests, lint, rustdoc, Windows target check, and diff check passed.
JayKobe6k changed target branch from issue-10-durable-value-handles to main 2026-09-04 21:30:40 +00:00
Merge branch 'main' of https://git.jacoby6000.com/JayKobe6k/ClariTree into issue-13-shared-search-pipeline
All checks were successful
Validate / Formatting, linting, and tests (push) Successful in 2m41s
Validate / Formatting, linting, and tests (pull_request) Successful in 2m18s
5f6cdd14f4
# Conflicts:
#	docs/value-handles.md
#	src/application/mod.rs
Sign in to join this conversation.
No description provided.