Repository navigation
feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) - #183
Conversation
…nguage queries (#172) Default-off (LCM_FTS_PROSE_MODE). Flag-on: prose queries become stopword-filtered OR disjunctions capped at 12 terms with relevance ranking — the measured implicit-AND collapse (delivered FTS hit-mix 5,855 -> 1/12,500) gets its rescue path. Keyword, quoted-phrase, and caller-composed operator semantics unchanged (balanced quotes stay conjunctive — an explicit precision signal). Unindexed unicode symbols preserved via literal fallback. Flag-off byte-identical (sha-verified cross-checkout probe). Paired non-inferiority run is the pre-registered gate before default-on — this PR ships the mechanism dormant. Author: codex sol-high; review: orchestrator.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
Cache: Disabled due to Reviews > Disable Cache setting Disabled knowledge base sources:
📝 WalkthroughWalkthroughAdds opt-in ChangesFTS prose-mode search
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant MessageStore
participant SummaryDAG
participant SearchQuery
Caller->>MessageStore: Search with fts_prose_mode
Caller->>SummaryDAG: Search with fts_prose_mode
MessageStore->>SearchQuery: Build MATCH expression and fallback terms
SummaryDAG->>SearchQuery: Build MATCH expression and fallback terms
SearchQuery-->>MessageStore: Bounded prose query
SearchQuery-->>SummaryDAG: Bounded prose query
MessageStore-->>Caller: Ranked message results
SummaryDAG-->>Caller: Ranked summary results
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
evaOS review status: completedPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review completed for this PR head. Automation note: agents should wait for this comment to reach PR URL: #183 Review URL: #183 (review) |
There was a problem hiding this comment.
Walkthrough
PR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172)
Head: 418db28bcc85f24581cec6de75d6e8e91073f3b0 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).
Estimated review effort: 5/5 (~68 min)
Changed Files
| File | Status | Churn | Purpose | Risk |
|---|---|---|---|---|
README.md |
modified | +1/-0 | Documentation | Low |
config.py |
modified | +4/-0 | Configuration | Low |
dag.py |
modified | +11/-3 | Changed file | Low |
search_query.py |
modified | +109/-7 | Changed file | Elevated: validated P1 finding |
store.py |
modified | +23/-4 | Changed file | Low |
tests/probes/fts_prose_flag_off_probe.py |
added | +83/-0 | Changed file | Low |
tests/test_lcm_core.py |
modified | +93/-3 | Test coverage | Moderate: validated P2 finding |
tests/test_lcm_recall.py |
modified | +33/-0 | Test coverage | Low |
tools.py |
modified | +46/-16 | Changed file | Low |
Review Signal
Validated inline findings: 4 (P0: 0, P1: 1, P2: 1, P3: 2).
Dropped findings before posting: 1. High-severity findings: 1.
Risk Taxonomy
- Auth: 1
- Proof gap: 1
- Release regression: 1
- Runtime correctness: 1
Validation and Proof
No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.
Related Context
Related issues/PRs: #172.
Suggested labels: bug, docs, tests.
Suggested reviewers: none from current metadata.
Review Settings Preview
- Profile: assertive
- Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
- Path instructions: none
- Label suggestions: none
- Reviewer suggestions: none
- Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
- Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks
Pre-merge checklist
- Inline comments target current RIGHT-side diff lines.
- No secret-like content survived into posted inline comments.
- REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
- Required behavior proof is present or not applicable.
- Labels and reviewers are suggestions only; the bot did not auto-apply them.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 418db28bcc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@store.py`:
- Around line 1118-1143: Remove injected FTS operator glue from relevance terms
and phrases before directness and fetch-limit scoring, preferably via a shared
helper in search_query.py. Apply the same fix in store.py lines 1118-1143 and
dag.py lines 567-573, then extend tests/test_lcm_core.py lines 1882-1909 with a
fixture row containing “or” to prevent regression.
In `@tests/test_lcm_core.py`:
- Around line 1882-1909: Update
test_search_prose_mode_restores_bounded_disjunctive_recall by adding a
non-target seeded message containing the standalone word “or”, while keeping the
existing target and assertions intact. Ensure the added row can expose
phantom-term ranking from the injected OR separator without becoming the
expected top result.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 618c37be-956f-4b61-984a-9fc4f8a3ccab
📒 Files selected for processing (9)
README.mdconfig.pydag.pysearch_query.pystore.pytests/probes/fts_prose_flag_off_probe.pytests/test_lcm_core.pytests/test_lcm_recall.pytools.py
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: test (3.11)
- GitHub Check: test (3.13)
- GitHub Check: test (3.14)
- GitHub Check: test (3.12)
🧰 Additional context used
🪛 ast-grep (0.45.0)
tests/probes/fts_prose_flag_off_probe.py
[info] 75-81: use jsonify instead of json.dumps for JSON output
Context: json.dumps(
{
"bytes": len(raw.encode("utf-8")),
"sha256": hashlib.sha256(raw.encode("utf-8")).hexdigest(),
},
sort_keys=True,
)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
🔇 Additional comments (9)
config.py (1)
377-377: LGTM!Also applies to: 657-659
README.md (1)
379-379: LGTM!search_query.py (1)
30-47: LGTM!Also applies to: 134-157, 159-193, 248-261, 272-307
tests/test_lcm_core.py (1)
32-32: LGTM!Also applies to: 581-581, 583-660, 1911-1940, 1965-1985, 2008-2028
dag.py (1)
35-35: LGTM!Also applies to: 49-51, 553-556
store.py (1)
33-33: LGTM!Also applies to: 47-50, 1104-1105
tools.py (1)
81-85: LGTM!Also applies to: 2373-2382, 2490-2504, 2524-2534, 5561-5569
tests/probes/fts_prose_flag_off_probe.py (1)
1-84: LGTM! Theuse-jsonifystatic-analysis hint is a false positive here — this is a standalone CLI probe, not a web-framework response path.tests/test_lcm_recall.py (1)
357-388: LGTM!
… backends (probe corpus extended over its blind spot); phantom-OR refuted w/ zero-score regression; stoplist/punctuation/quote fixes; tests strengthened
|
Bot findings dispositioned ( |
evaOS review status: completedPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review completed for this PR head. Automation note: agents should wait for this comment to reach PR URL: #183 Review URL: #183 (review) |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@FINDINGS-VERDICTS-BOTS.md`:
- Around line 6-7: Remove the hard-coded machine-local paths from the report’s
“Raw source” and “Logs” entries; replace them with repository-relative artifact
names if available, otherwise omit the path references.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 490879ec-8f27-4830-be16-b21ee109b6cd
📒 Files selected for processing (6)
FINDINGS-VERDICTS-BOTS.mddag.pysearch_query.pystore.pytests/probes/fts_prose_flag_off_probe.pytests/test_lcm_core.py
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: test (3.11)
- GitHub Check: test (3.12)
- GitHub Check: test (3.14)
- GitHub Check: test (3.13)
🧰 Additional context used
🪛 ast-grep (0.45.0)
tests/probes/fts_prose_flag_off_probe.py
[info] 72-97: use jsonify instead of json.dumps for JSON output
Context: json.dumps(
[
lcm_tools.lcm_recall(
{
"query": "What did I say about my dog's vet appointment?",
"limit": 8,
"include": "verbatim",
"detail": "snippets",
"scope_bias": 0.0,
},
engine=engine,
),
lcm_tools.lcm_recall(
{
"query": "licensed ©",
"limit": 8,
"include": "verbatim",
"detail": "snippets",
"scope_bias": 0.0,
},
engine=engine,
),
],
ensure_ascii=False,
separators=(",", ":"),
)
Note: [CWE-116] Improper Encoding or Escaping of Output.
(use-jsonify)
search_query.py
[warning] 153-153: XPath query is request-/variable-derived; use parameterized XPath to prevent injection.
Context: _WORD_RE.findall(safe)
Note: [CWE-643] Improper Neutralization of Data within XPath Expressions ('XPath Injection').
(xpath-injection-python)
🪛 LanguageTool
FINDINGS-VERDICTS-BOTS.md
[style] ~93-~93: Consider an alternative for the overused word “exactly”.
Context: ...t, and the remaining ranked IDs must be exactly the two seeded distractors. Evidence: ...
(EXACTLY_PRECISELY)
🔇 Additional comments (7)
dag.py (1)
35-35: LGTM!Also applies to: 49-51, 553-584
store.py (1)
33-33: LGTM!Also applies to: 47-50, 1097-1143
tests/probes/fts_prose_flag_off_probe.py (1)
2-6: LGTM!Also applies to: 57-64, 73-97
tests/test_lcm_core.py (1)
17-17: LGTM!Also applies to: 33-38, 587-587, 625-625, 666-666, 1888-1918, 1920-1938, 1948-1956, 1958-1965, 1967-1976, 1978-1986, 2012-2050, 2081-2092, 3617-3634
search_query.py (2)
26-49: LGTM!Also applies to: 136-165, 167-201, 256-268, 296-315, 318-322, 343-369
280-285: 🚀 Performance & ScalabilityNo issue: the helper default is not exercised by current callers. Internal
store.pyanddag.pycall sites passpreserve_unicode_symbolsexplicitly, so this default does not change the current FTS/LIKE routing.> Likely an incorrect or invalid review comment.FINDINGS-VERDICTS-BOTS.md (1)
1-5: LGTM!Also applies to: 9-124
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af0f14226e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Walkthrough
PR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172)
Head: af0f14226ee61fc9c18a2abfbab8cf4acbdb8516 into main. Review event: COMMENT.
Provider: GLM/Z.ai through ZCode (zcode-glm, zcode, model GLM-5.2).
Estimated review effort: 5/5 (~70 min)
Changed Files
| File | Status | Churn | Purpose | Risk |
|---|---|---|---|---|
FINDINGS-VERDICTS-BOTS.md |
added | +124/-0 | Documentation | Low |
README.md |
modified | +1/-0 | Documentation | Low |
config.py |
modified | +4/-0 | Configuration | Low |
dag.py |
modified | +16/-4 | Changed file | Low |
search_query.py |
modified | +120/-7 | Changed file | Moderate: validated P2 finding |
store.py |
modified | +23/-4 | Changed file | Low |
tests/probes/fts_prose_flag_off_probe.py |
added | +112/-0 | Changed file | Low |
tests/test_lcm_core.py |
modified | +176/-3 | Test coverage | Low |
tests/test_lcm_recall.py |
modified | +33/-0 | Test coverage | Low |
tools.py |
modified | +46/-16 | Changed file | Moderate: validated P3 finding |
Review Signal
Validated inline findings: 3 (P0: 0, P1: 0, P2: 1, P3: 2).
Dropped findings before posting: 0. High-severity findings: 0.
Risk Taxonomy
- Runtime correctness: 3
Validation and Proof
No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.
Related Context
Related issues/PRs: #172.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.
Review Settings Preview
- Profile: assertive
- Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
- Path instructions: none
- Label suggestions: none
- Reviewer suggestions: none
- Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
- Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks
Pre-merge checklist
- Inline comments target current RIGHT-side diff lines.
- No secret-like content survived into posted inline comments.
- REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
- Required behavior proof is present or not applicable.
- Labels and reviewers are suggestions only; the bot did not auto-apply them.
|
@coderabbitai review |
✅ Action performedReview finished.
|
…ve subject term on stopword-empty fallback; prose filtering on unicode LIKE route; shared sort-promotion helper; possessive-s classification; round-2 verdicts
|
@coderabbitai review |
✅ Action performedReview finished.
|
evaOS review status: completedPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review completed for this PR head. Automation note: agents should wait for this comment to reach PR URL: #183 Review URL: #183 (review) |
There was a problem hiding this comment.
Walkthrough
PR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172)
Head: d073426bb149b7da326e97968bd690549b4bd084 into main. Review event: COMMENT.
Provider: Unregistered provider id (builtin:zai-coding-plan, zcode (registry miss), model unknown).
Estimated review effort: 5/5 (~70 min)
Changed Files
| File | Status | Churn | Purpose | Risk |
|---|---|---|---|---|
FINDINGS-VERDICTS-BOTS.md |
added | +170/-0 | Documentation | Low |
README.md |
modified | +1/-0 | Documentation | Low |
config.py |
modified | +4/-0 | Configuration | Low |
dag.py |
modified | +36/-8 | Changed file | Low |
search_query.py |
modified | +172/-7 | Changed file | Moderate: validated P3 finding |
store.py |
modified | +33/-6 | Changed file | Moderate: validated P2 finding |
tests/probes/fts_prose_flag_off_probe.py |
added | +112/-0 | Changed file | Low |
tests/test_lcm_core.py |
modified | +266/-3 | Test coverage | Elevated: large change |
tests/test_lcm_recall.py |
modified | +33/-0 | Test coverage | Low |
tools.py |
modified | +41/-16 | Changed file | Moderate: validated P3 finding |
Review Signal
Validated inline findings: 3 (P0: 0, P1: 0, P2: 1, P3: 2).
Dropped findings before posting: 0. High-severity findings: 0.
Risk Taxonomy
- API compatibility: 1
- Runtime correctness: 2
Validation and Proof
No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.
Related Context
Related issues/PRs: #172.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.
Review Settings Preview
- Profile: assertive
- Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
- Path instructions: none
- Label suggestions: none
- Reviewer suggestions: none
- Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
- Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks
Pre-merge checklist
- Inline comments target current RIGHT-side diff lines.
- No secret-like content survived into posted inline comments.
- REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
- Required behavior proof is present or not applicable.
- Labels and reviewers are suggestions only; the bot did not auto-apply them.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
store.py (1)
1140-1144: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve Unicode-symbol fallback when prose mode is disabled.
Passing
Falsehere changes the prior default behavior: queries such aslicensed ©now use FTS and lose the©ranking signal instead of using LIKE. That violates the PR’s flag-off byte-identity contract.
store.py#L1140-L1144: retainpreserve_unicode_symbols=Truefor the default-off path.dag.py#L577-L581: apply the same compatibility behavior for summary search.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@store.py` around lines 1140 - 1144, Preserve Unicode-symbol fallback when prose mode is disabled by keeping preserve_unicode_symbols enabled on the default-off path in requires_like_fallback within store.py (lines 1140-1144) and applying the same compatibility behavior in dag.py (lines 577-581) for summary search.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@store.py`:
- Around line 1140-1144: Preserve Unicode-symbol fallback when prose mode is
disabled by keeping preserve_unicode_symbols enabled on the default-off path in
requires_like_fallback within store.py (lines 1140-1144) and applying the same
compatibility behavior in dag.py (lines 577-581) for summary search.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 542a3ed5-a790-45f2-9202-88596bd5472d
📒 Files selected for processing (6)
FINDINGS-VERDICTS-BOTS.mddag.pysearch_query.pystore.pytests/test_lcm_core.pytools.py
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: test (3.11)
- GitHub Check: test (3.13)
- GitHub Check: test (3.14)
- GitHub Check: test (3.12)
🧰 Additional context used
🪛 ast-grep (0.45.0)
search_query.py
[warning] 157-157: XPath query is request-/variable-derived; use parameterized XPath to prevent injection.
Context: _WORD_RE.findall(safe)
Note: [CWE-643] Improper Neutralization of Data within XPath Expressions ('XPath Injection').
(xpath-injection-python)
🪛 LanguageTool
FINDINGS-VERDICTS-BOTS.md
[grammar] ~158-~158: Use a hyphen to join words.
Context: ...regression also passed in the 420-test focused parity run. - Changed-file Ruff:...
(QB_NEW_EN_HYPHEN)
🔇 Additional comments (14)
store.py (1)
44-48: LGTM!Also applies to: 1106-1133, 1155-1155, 1220-1220, 1261-1270
dag.py (1)
46-50: LGTM!Also applies to: 557-570, 582-589, 622-629, 668-677
tools.py (1)
84-84: LGTM!Also applies to: 2373-2377, 2485-2500, 2519-2530, 5556-5564
tests/test_lcm_core.py (6)
36-41: LGTM!
591-591: LGTM!Also applies to: 629-629, 670-670
1952-2053: LGTM!
2088-2099: LGTM!
2149-2161: LGTM!
3704-3723: LGTM!search_query.py (3)
154-234: LGTM!
290-348: LGTM!
527-542: LGTM!FINDINGS-VERDICTS-BOTS.md (2)
3-9: LGTM!
111-170: LGTM!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d073426bb1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…fication; direct config attribute access; empty-disjunction guard; classification-input invariant documented
|
@coderabbitai review |
✅ Action performedReview finished.
|
evaOS review status: completedPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review completed for this PR head. Automation note: agents should wait for this comment to reach PR URL: #183 Review URL: #183 (review) |
There was a problem hiding this comment.
Walkthrough
PR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172)
Head: ac21666393c05bee61ef23c5f29ce90dfe1c91e7 into main. Review event: COMMENT.
Provider: Unregistered provider id (builtin:zai-coding-plan, zcode (registry miss), model unknown).
Estimated review effort: 5/5 (~70 min)
Changed Files
| File | Status | Churn | Purpose | Risk |
|---|---|---|---|---|
FINDINGS-VERDICTS-BOTS.md |
added | +183/-0 | Documentation | Low |
README.md |
modified | +1/-0 | Documentation | Low |
config.py |
modified | +4/-0 | Configuration | Low |
dag.py |
modified | +44/-8 | Changed file | Low |
search_query.py |
modified | +177/-7 | Changed file | Moderate: validated P3 finding |
store.py |
modified | +43/-6 | Changed file | Low |
tests/probes/fts_prose_flag_off_probe.py |
added | +112/-0 | Changed file | Low |
tests/test_lcm_core.py |
modified | +286/-3 | Test coverage | Elevated: large change |
tests/test_lcm_recall.py |
modified | +33/-0 | Test coverage | Low |
tools.py |
modified | +41/-16 | Changed file | Moderate: validated P3 finding |
Review Signal
Validated inline findings: 2 (P0: 0, P1: 0, P2: 0, P3: 2).
Dropped findings before posting: 0. High-severity findings: 0.
Risk Taxonomy
- Runtime correctness: 2
Validation and Proof
No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.
Related Context
Related issues/PRs: #172.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.
Review Settings Preview
- Profile: assertive
- Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
- Path instructions: none
- Label suggestions: none
- Reviewer suggestions: none
- Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
- Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks
Pre-merge checklist
- Inline comments target current RIGHT-side diff lines.
- No secret-like content survived into posted inline comments.
- REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
- Required behavior proof is present or not applicable.
- Labels and reviewers are suggestions only; the bot did not auto-apply them.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac21666393
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…explicit allow_operators=False at grep-level sort promotion
evaOS review status: stale headPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review stopped because this queued head is no longer the live PR head. Automation note: agents should wait for this comment to reach PR URL: #183 |
…efore truncating to limit; regression test for best-match-past-first-batch
|
@coderabbitai review |
✅ Action performedReview finished.
|
evaOS review status: completedPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review completed for this PR head. Automation note: agents should wait for this comment to reach PR URL: #183 Review URL: #183 (review) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00b5afda1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Walkthrough
PR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172)
Head: 00b5afda1b61bece0ac7a3a44db1a4e2d465ada3 into main. Review event: COMMENT.
Provider: Unregistered provider id (builtin:zai-coding-plan, zcode (registry miss), model unknown).
Estimated review effort: 5/5 (~70 min)
Changed Files
| File | Status | Churn | Purpose | Risk |
|---|---|---|---|---|
FINDINGS-VERDICTS-BOTS.md |
added | +196/-0 | Documentation | Low |
README.md |
modified | +1/-0 | Documentation | Low |
config.py |
modified | +4/-0 | Configuration | Low |
dag.py |
modified | +48/-9 | Changed file | Moderate: validated P2 finding |
search_query.py |
modified | +180/-7 | Changed file | Moderate: validated P3 finding |
store.py |
modified | +43/-6 | Changed file | Low |
tests/probes/fts_prose_flag_off_probe.py |
added | +112/-0 | Changed file | Low |
tests/test_lcm_core.py |
modified | +311/-3 | Test coverage | Elevated: large change |
tests/test_lcm_recall.py |
modified | +33/-0 | Test coverage | Low |
tools.py |
modified | +45/-16 | Changed file | Moderate: validated P3 finding |
Review Signal
Validated inline findings: 3 (P0: 0, P1: 0, P2: 1, P3: 2).
Dropped findings before posting: 0. High-severity findings: 0.
Risk Taxonomy
- Release regression: 1
- Runtime correctness: 2
Validation and Proof
No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.
Related Context
Related issues/PRs: #172.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.
Review Settings Preview
- Profile: assertive
- Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
- Path instructions: none
- Label suggestions: none
- Reviewer suggestions: none
- Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
- Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks
Pre-merge checklist
- Inline comments target current RIGHT-side diff lines.
- No secret-like content survived into posted inline comments.
- REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
- Required behavior proof is present or not applicable.
- Labels and reviewers are suggestions only; the bot did not auto-apply them.
…traction-fragment set filtered from disjunctions and counts; never-subject fallback guard; two refutations documented
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Review-round stopping rule for this train (declared per program rule — red-team amendment 9 pattern): round 5 on the new head is the FINAL full round. From round 5 onward, findings are dispositioned as: real delivery-affecting or P1-severity defects → fixed in-PR; latent hardening, future-proofing, and documentation-class items → fork issues for the next train (as #186 was). This PR is default-off infrastructure; its gate-run obligations (none — no measured surface) are unchanged. All prior rounds: every finding fixed, refuted in writing, or issue-filed, with threads resolved. |
evaOS review status: completedPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review completed for this PR head. Automation note: agents should wait for this comment to reach PR URL: #183 Review URL: #183 (review) |
There was a problem hiding this comment.
Walkthrough
PR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172)
Head: a7986ae743d083790477ef42d7ab6047a9b21155 into main. Review event: COMMENT.
Provider: Unregistered provider id (builtin:zai-coding-plan, zcode (registry miss), model unknown).
Estimated review effort: 5/5 (~70 min)
Changed Files
| File | Status | Churn | Purpose | Risk |
|---|---|---|---|---|
FINDINGS-VERDICTS-BOTS.md |
added | +209/-0 | Documentation | Elevated: large change |
README.md |
modified | +1/-0 | Documentation | Low |
config.py |
modified | +4/-0 | Configuration | Low |
dag.py |
modified | +48/-9 | Changed file | Moderate: validated P3 finding |
search_query.py |
modified | +216/-7 | Changed file | Moderate: validated P3 finding |
store.py |
modified | +43/-6 | Changed file | Low |
tests/probes/fts_prose_flag_off_probe.py |
added | +112/-0 | Changed file | Low |
tests/test_lcm_core.py |
modified | +349/-3 | Test coverage | Moderate: validated P2 finding |
tests/test_lcm_recall.py |
modified | +33/-0 | Test coverage | Low |
tools.py |
modified | +45/-16 | Changed file | Moderate: validated P3 finding |
Review Signal
Validated inline findings: 4 (P0: 0, P1: 0, P2: 1, P3: 3).
Dropped findings before posting: 0. High-severity findings: 0.
Risk Taxonomy
- API compatibility: 1
- Release regression: 1
- Runtime correctness: 2
Validation and Proof
No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.
Related Context
Related issues/PRs: #172.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.
Review Settings Preview
- Profile: assertive
- Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
- Path instructions: none
- Label suggestions: none
- Reviewer suggestions: none
- Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
- Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks
Pre-merge checklist
- Inline comments target current RIGHT-side diff lines.
- No secret-like content survived into posted inline comments.
- REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
- Required behavior proof is present or not applicable.
- Labels and reviewers are suggestions only; the bot did not auto-apply them.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7986ae743
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…eak closed); total term cap with reserved symbol slots; symbol-aware prose classification; distinct-term prose ranking; ORDER BY rowid pagination; DAG FTS-route test
|
@coderabbitai review |
✅ Action performedReview finished.
|
…s only (PR #183 r5 flag-off leak lesson)
evaOS review status: completedPR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172) evaOS review completed for this PR head. Automation note: agents should wait for this comment to reach PR URL: #183 Review URL: #183 (review) |
There was a problem hiding this comment.
Walkthrough
PR: #183 - feat(search): fts_prose_mode — bounded disjunctive FTS for prose queries (#172)
Head: b305c948051c4f7da0532257030fc0bad616dd15 into main. Review event: COMMENT.
Provider: Unregistered provider id (builtin:zai-coding-plan, zcode (registry miss), model unknown).
Estimated review effort: 5/5 (~70 min)
Changed Files
| File | Status | Churn | Purpose | Risk |
|---|---|---|---|---|
FINDINGS-VERDICTS-BOTS.md |
added | +228/-0 | Documentation | Elevated: large change |
README.md |
modified | +1/-0 | Documentation | Low |
config.py |
modified | +4/-0 | Configuration | Low |
dag.py |
modified | +54/-11 | Changed file | Low |
search_query.py |
modified | +256/-10 | Changed file | Moderate: validated P3 finding |
store.py |
modified | +50/-10 | Changed file | Low |
tests/probes/fts_prose_flag_off_probe.py |
added | +112/-0 | Changed file | Low |
tests/test_lcm_core.py |
modified | +471/-3 | Test coverage | Elevated: large change |
tests/test_lcm_recall.py |
modified | +33/-0 | Test coverage | Low |
tools.py |
modified | +45/-16 | Changed file | Low |
Review Signal
Validated inline findings: 1 (P0: 0, P1: 0, P2: 0, P3: 1).
Dropped findings before posting: 0. High-severity findings: 0.
Risk Taxonomy
- Auth: 1
Validation and Proof
No required validation recommendation selected; rely on existing GitHub checks and human review.
Proof status: not_applicable - No required behavior proof selected for this changed surface.
Profile validation hints: Prefer correctness, security, data-loss, release, and regression findings over style-only feedback.
Profile proof expectations: Look for focused validation, rollback notes, and evidence appropriate to the changed surface.
Related Context
Related issues/PRs: #172.
Suggested labels: docs, tests.
Suggested reviewers: none from current metadata.
Review Settings Preview
- Profile: assertive
- Enabled sections: Review summary (inline_review); Walkthrough (inline_review); Changed-files table (walkthrough); Effort estimate (walkthrough); Related issues/PRs (walkthrough); Review status comment (sticky_status)
- Path instructions: none
- Label suggestions: none
- Reviewer suggestions: none
- Suggestion behavior: suggestions only; labels and reviewers are not auto-applied.
- Roadmap-only settings: auto-apply labels; auto-request reviewers; required status checks
Pre-merge checklist
- Inline comments target current RIGHT-side diff lines.
- No secret-like content survived into posted inline comments.
- REQUEST_CHANGES is only used when eligible P0/P1 findings survive validation.
- Required behavior proof is present or not applicable.
- Labels and reviewers are suggestions only; the bot did not auto-apply them.
| ) | ||
| ) | ||
| or starts_like_prose | ||
| or (len(terms) >= 6 and stopword_count >= 2) |
There was a problem hiding this comment.
P3: No-question-mark prose branch (≥6 terms + ≥2 stopwords) lacks a boundary test
should_use_fts_prose_mode has a third return path that fires WITHOUT a trailing '?': len(terms) >= 6 and stopword_count >= 2 (line 209). A declarative keyword query such as kubernetes the database is scaling replicas (6 terms, 'the'+'is' = 2 stopwords, no '?', non-lead first token) classifies as prose and is rewritten to a disjunction kubernetes OR database OR scaling OR replicas with relevance sort promotion. The compact-keyword conjunctive test (test_search_prose_mode_keeps_compact_question_keywords_conjunctive) only covers 2-3 token queries WITH a '?', so this no-'?' disjunctive path is exercised by no assertion. Whether broadening a non-interrogative 6+ token keyword query to OR semantics is desirable is a product decision, but it is currently un-tested at its boundary and could surprise operators enabling the flag expecting only 'natural-language questions' to be rewritten (the README frames the feature as 'raw natural-language queries'). Add a parametrized case asserting the intended polarity (conjunctive or disjunctive) for a ≥6-token, ≥2-stopword, no-'?' query so the contract is pinned.
Category: Auth
Why this matters: The feature is default-off so there is no release regression, but once enabled this path silently changes AND→OR ranking for a class of non-question keyword queries that the README's description does not clearly scope, and no test guards the chosen polarity against future drift.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b305c94805
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| folded not in _PROSE_LEAD_WORDS | ||
| and folded not in _PROSE_FRAGMENTS | ||
| and folded not in _PROSE_NEVER_SUBJECT |
There was a problem hiding this comment.
Allow nominal lead words in the subject fallback
When prose mode is enabled and every token is stoplisted, rejecting any fallback token that also appears in _PROSE_LEAD_WORDS conflates its vocabulary entry with its grammatical role. For example, Where is my can? is classified as prose, but extraction returns no terms and falls back to the implicit-AND query Where is my can, so both message and summary search miss a row such as the can is on the blue shelf. Fresh evidence beyond the earlier will fix is that can is both a lead word and an ordinary noun, and this new exclusion still drops it; preserve a final subject-shaped token instead of rejecting it solely by set membership.
Useful? React with 👍 / 👎.
…d (root filename collision)
There was a problem hiding this comment.
💡 Codex Review
https://github.com/100yenadmin/hermes-lcm/blob/dc627cc5d9481a063cb7c51019747a7f5fb3d907/search_query.py#L51-L54
Strip
don't and won't fragments contextually
When prose mode receives common contractions such as don't or won't, sanitization produces don t or won t, but this closed fragment set omits don and won because they can also be standalone words. Fresh evidence beyond the earlier didn't finding is that the current head builds don OR deploy for What don't we deploy?; with limit=1, a row repeating the name Don ranks above a row containing the requested deployment evidence. Detect apostrophe-bound n't fragments contextually rather than relying solely on this global token set.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ybench#3) + config-class candidate-generation gap (FTS 0/41 on prose queries, pre-#183 build) + genuine adversarial-attribution weakness; A' cancelled; declared-config re-run next
The branch had merged the MAINTAINER's upstream (v0.21.0-rc2) and that was mistaken for being current. It was not current with OUR main, which carried 56 commits this branch had never seen: V1-M instrument (#199, #198), fts_prose_mode (#183), profile-scoped trajectory embeddings (#182), query views. Bidirectional, not a catch-up -- both lines developed the same files in parallel (tools.py ours=11/theirs=9, vector_store.py 6/8, store.py 5/5), and reasoning.py and requirements_compiler.py do not exist at the merge base at all. 15 files, 52 hunks. Default resolution was BOTH SIDES: ours' security parameter and theirs' feature parameter, additively. ## The leak that was in no conflict hunk Main added a resident-int8 full-corpus fast path (`resident_eligible` -> `_resident_int8_matrix` -> `_rank_resident_int8`) that sits immediately BEFORE the sign-bit prescreen block ours guards with `access_scope is None`, and mirrors that block's eligibility conditions -- without the owner guard. Git auto-merged it CLEANLY. Our guard survived while a bypass around it landed one branch earlier, with no conflict marker anywhere and nothing for a diff review to catch. The resident matrix is a whole-identity snapshot pooled and cached on (identity, data_version) only, so it cannot express a per-row owner predicate. Filtering inside it is not an option; routing around it is, exactly as ours already does for the binary prescreen. Both arms now carry `access_scope is None`. ## The trap that WAS in a conflict hunk Main refactored the message-search call to `**message_search_kwargs`, and that dict carried every field ours listed EXCEPT `access_scope`. Taking main's side verbatim silently unscopes message search -- every principal reads every other principal's memory, with all tests green. Carried into the new form. ## Reconciling two independent models of reasoning.py `resolve_occurrence_time_with_trust(session_date=...)` served two roles at once: theirs' caller-DECLARED anchor (the term the sidecar is compared against to detect disagreement) and the term the occurrence is RESOLVED against. Ours needs the resolution anchor to be host-derived and a caller's declaration to be evidence-free. No single ordering satisfies both: map-first defeats the override check entirely, because tools.py sources that map from `engine._session_occurrence_dates` -- the sidecar's own attribute -- so anchor and sidecar were always equal; declared-first lets a caller relabel a stored observation. Split into two parameters, precedence sidecar > trusted > declared. Main's `"auto"` interval-unit sentinel is replaced by `interval_unit_fixed`, so "the plan's unit" and "the reported unit" decouple and both sides' tests hold. ## Verified, not asserted real-data battery 16/16, identical to the pre-merge baseline default-off A/B 22/22 byte-identical to stock origin/main compile 224 files, 0 syntax errors suite 21 failed / 3234 passed (from 35/3008 pre-merge) The 4b gate also did its job on this merge: it failed closed on six new resident-invalidation triggers and on a `benchmarking/` harness the exclusion list had missed (the -ing spelling was never added alongside bench/benchmarks). Both classified rather than waived.
Addresses #172 (mechanism half; symbol preservation included). Default-off; flag-off byte-identical (sha-verified probe). The pre-registered paired non-inferiority run — McNemar primary, hit-mix restoration secondary per the gate-proxy lesson — is the gate before any default flip; this PR ships the mechanism dormant for review.
Review per program protocol — findings fixed/refuted/deferred with verdicts.
Summary by CodeRabbit
New Features
LCM_FTS_PROSE_MODE.Bug Fixes
Documentation
Tests