Skip to content

feat(p1): IntentExtractor port+adapter with tests - #1

Merged
KooshaPari merged 1 commit into
mainfrom
feat/p1-intent-extractor-v3
Jun 30, 2026
Merged

feat(p1): IntentExtractor port+adapter with tests#1
KooshaPari merged 1 commit into
mainfrom
feat/p1-intent-extractor-v3

Conversation

@KooshaPari

Copy link
Copy Markdown
Owner

Summary

Implements the P1 IntentExtractor port and adapter for SessionLedger. Parses a session's messages and extracts the user's intent (goal, acceptance signals, constraints) into a structured Intent struct.

Changes

  • src/domain/intent.rs — Added Intent struct with goal, acceptance_signals, constraints, user_turn_count fields alongside existing IntentState FSM
  • src/ports/mod.rs — Added IntentExtractor trait (port boundary) with fn extract(&self, &Session) -> Result<Intent, PortError>
  • src/distill/extractor.rsHeuristicIntentExtractor adapter using lightweight string matching for goal, acceptance signals, and constraint extraction
  • src/distill/mod.rs — Wired extractor into distill::compile, replacing the simple latest_user_request with structured intent data in the Intent bundle
  • src/lib.rs — Re-exported Intent in public API

Gates

  • cargo build — 0 errors
  • cargo test — 11 passed, 0 failed (6 new unit tests + 5 existing integration tests)
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean

Closes the prior compile errors from v2 (bool vs () type mismatches) by ensuring all trait method signatures are correct.

Add structured intent extraction to SessionLedger:

- Intent struct (goal, acceptance_signals, constraints) in domain layer
- IntentExtractor trait in ports boundary
- HeuristicIntentExtractor adapter using lightweight string matching
- Wired into distill::compile for structured Intent bundles
- 6 unit tests + all 5 existing integration tests pass
- cargo build, clippy -D warnings, fmt --check all green

Co-Authored-By: ForgeCode <noreply@forgecode.dev>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@KooshaPari, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Free

Run ID: dbd4e1b3-b422-4d2c-9d51-6d61427951cc

📥 Commits

Reviewing files that changed from the base of the PR and between 902185b and 1333c6a.

📒 Files selected for processing (5)
  • src/distill/extractor.rs
  • src/distill/mod.rs
  • src/domain/intent.rs
  • src/lib.rs
  • src/ports/mod.rs

Note

🎁 Summarized by CodeRabbit Free

The PR author is not assigned a seat. To perform a comprehensive line-by-line review, please assign a seat to the pull request author through the subscription management page by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@KooshaPari
KooshaPari merged commit d12210a into main Jun 30, 2026
7 of 11 checks passed
@KooshaPari
KooshaPari deleted the feat/p1-intent-extractor-v3 branch June 30, 2026 06:21
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