feat: Add opportunity-legitimacy-screener bundle#266
Conversation
:robot_face: AgentKit Structural ValidationNew Contributions Detected
Check Results
🎉 All checks passed! This contribution follows the AgentKit structure. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
WalkthroughChangesAdds the Opportunity Legitimacy Screener kit with configuration, documentation, signal gathering, web-search enrichment, heuristic risk scoring, tier-specific LLM explanations, and normalized verdict responses. Opportunity Legitimacy Screener
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Biome (2.5.3)kits/opportunity-legitimacy-screener/scripts/score-and-explain_code-node-396_code.tsFile contains syntax errors that prevent linting: Line 1: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{triggerNode_1.output.comp; Line 1: Expected a statement but instead found '}'.; Line 2: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{triggerNode_1.output.clai; Line 2: Expected a statement but instead found '}'.; Line 3: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{triggerNode_1.output.send; Line 3: Expected a statement but instead found '}'.; Line 4: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{triggerNode_1.output.stat; Line 4: Expected a statement but instead found '}'.; Line 5: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{triggerNode_1.output.role; Line 5: Expected a statement but instead found '}'.; Line 6: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{triggerNode_1.output.cont; Line 6: Expected a statement but instead found '}'.; Line 7: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{triggerNode_1.output.sear; Line 7: Expected a statement but instead found '}'. kits/opportunity-legitimacy-screener/scripts/score-and-explain_code-node-529_code.tsFile contains syntax errors that prevent linting: Line 38: Illegal return statement outside of a function; Line 41: Illegal return statement outside of a function; Line 43: Illegal return statement outside of a function; Line 49: Illegal return statement outside of a function; Line 53: Illegal return statement outside of a function Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 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
`@kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-353_system_0.md`:
- Around line 3-6: Update the JSON schema examples so the explanation value is a
quoted string placeholder, preserving valid JSON syntax. Apply this change in
kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-353_system_0.md
lines 3-6,
kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-419_system_0.md
lines 3-6, and
kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-645_system_0.md
lines 3-6; keep the recommended_action values unchanged.
In
`@kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-353_user_1.md`:
- Around line 1-7: Harden both prompt files by clearly delimiting all
interpolated signal values as untrusted data and instructing the model to ignore
any instructions embedded within them. Apply this change to
kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-353_user_1.md
lines 1-7 and
kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-419_user_1.md
lines 1-7, preserving the existing signal fields and scoring context.
In
`@kits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-645_user_1.md`:
- Around line 1-4: Update the four template references in the prompt from
codeNode_709 to the existing codeNode_396 output signals, preserving the
company_name, role_title, stated_compensation, and contact_method fields so the
scoring prompt receives the required context.
In
`@kits/opportunity-legitimacy-screener/scripts/gather-signals_code-node-139_code.ts`:
- Around line 1-2: Replace the workflow-object accesses in the script’s results
and companyName initialization with Lamatic template variables using the
{{nodeId.output.x}} format, referencing webSearchNode_810.output.output.organic
and codeNode_512.output.company_name respectively. Preserve the existing
empty-array fallback and lowercase normalization.
In
`@kits/opportunity-legitimacy-screener/scripts/score-and-explain_code-node-396_code.ts`:
- Around line 9-14: The generic-email check in the score-and-explain flow should
evaluate the actual email hostname rather than substring-matching contact or
email text. Update the logic around genericEmailDomains and emailDomainIsGeneric
to parse sender_email, extract its domain, and compare it against exact provider
domains, so domains such as gmail.company.com are not classified as generic.
In
`@kits/opportunity-legitimacy-screener/scripts/score-and-explain_code-node-529_code.ts`:
- Around line 37-43: Reconcile the fallback behavior in the score evaluation
flow so every returned risk_tier conforms to the published low/medium/high
contract. Update both the non-skipped elseNode branch and the final “Nothing ran
at all” fallback to use a supported tier and the corresponding verify-further
action, or consistently extend the documented/API contract to include unknown.
- Around line 27-34: Validate the value returned by JSON.parse in the raw-output
handling path before reading its fields. Require a non-null object with string
explanation and recommended_action properties; otherwise return the same
malformed-output fallback used for parse failures. Keep the valid payload
response unchanged.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 69b14555-21d3-4260-9e9e-13197c24dcce
📒 Files selected for processing (25)
kits/opportunity-legitimacy-screener/.env.examplekits/opportunity-legitimacy-screener/.gitignorekits/opportunity-legitimacy-screener/README.mdkits/opportunity-legitimacy-screener/agent.mdkits/opportunity-legitimacy-screener/constitutions/default.mdkits/opportunity-legitimacy-screener/flows/gather-signals.tskits/opportunity-legitimacy-screener/flows/score-and-explain.tskits/opportunity-legitimacy-screener/lamatic.config.tskits/opportunity-legitimacy-screener/model-configs/gather-signals_llmnode-390_generative-model-name.tskits/opportunity-legitimacy-screener/model-configs/score-and-explain_llmnode-353_generative-model-name.tskits/opportunity-legitimacy-screener/model-configs/score-and-explain_llmnode-419_generative-model-name.tskits/opportunity-legitimacy-screener/model-configs/score-and-explain_llmnode-645_generative-model-name.tskits/opportunity-legitimacy-screener/prompts/gather-signals_llmnode-390_system_0.mdkits/opportunity-legitimacy-screener/prompts/gather-signals_llmnode-390_user_1.mdkits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-353_system_0.mdkits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-353_user_1.mdkits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-419_system_0.mdkits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-419_user_1.mdkits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-645_system_0.mdkits/opportunity-legitimacy-screener/prompts/score-and-explain_llmnode-645_user_1.mdkits/opportunity-legitimacy-screener/scripts/gather-signals_code-node-139_code.tskits/opportunity-legitimacy-screener/scripts/gather-signals_code-node-512_code.tskits/opportunity-legitimacy-screener/scripts/score-and-explain_code-node-396_code.tskits/opportunity-legitimacy-screener/scripts/score-and-explain_code-node-529_code.tskits/opportunity-legitimacy-screener/scripts/score-and-explain_code-node-905_code.ts
…N validation, unknown tier
|
@amanintech @d-pamneja — pushed a fix for all 7 CodeRabbit findings from the initial review (stale codeNode_709 reference in the tier prompts, generic-email-domain substring matching, JSON.parse("null") crash, unquoted JSON example, prompt-injection hardening on the two user prompts, and mapping the fallback path to a documented risk_tier). Re-tested all three tiers + the fallback path against the fix. CodeRabbit's re-review came back clean — no actionable comments, review approved. One item I intentionally left as-is: the suggestion on Ready for another look whenever you get a chance. |
|
Hi @m-hamza-n! 👋 Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review. Steps to follow:
This helps keep the review process efficient for everyone. Thank you! 🙏 |
What this adds
A two-flow AgentKit bundle (
kits/opportunity-legitimacy-screener/) that screens job postings, recruiter emails, and freelance briefs for legitimacy — extracting structured signals, running live web research, and returning a risk tier with a plain-English explanation.Flows
gather-signals: Extracts structured signals from raw text via LLM, enriched with live Serper web search filtered to results actually mentioning the company.score-and-explain: Scores signals for red flags with negation-aware keyword detection, maps to alow/medium/highrisk tier, and generates a tier-specific explanation and recommended action.Testing
Both flows tested end-to-end across all three risk tiers plus the fallback path. See
README.mdfor details.Tradeoffs
Documented in
README.md, including why the two flows are deployed independently rather than chained viaflowNode, and known limitations of the keyword-based scam-signal detection.Note on PR checklist
This repo's PR template checklist (
config.json,bundles/<name>/, per-flowinputs.json/meta.json) appears to describe an earlier version of the contribution structure. This submission follows the structure currently documented inCONTRIBUTING.md(kits/<name>/,lamatic.config.ts,flows/<name>.tswith externalizedprompts//scripts//model-configs/), which matches the existing reference bundlekits/knowledge-chatbot/.Added the
opportunity-legitimacy-screenerAgentKit bundle underkits/opportunity-legitimacy-screener/:lamatic.config.ts(bundle config with the two required steps:gather-signals,score-and-explain).env.example(Lamatic + API key placeholders).gitignore(ignore local Lamatic data,node_modules, and env files)README.md(deployment notes, manual chaining approach, output shape, and limitations/tradeoffs)agent.md+constitutions/default.md(agent/pipeline description and baseline assistant guardrails)flows/gather-signals.tsflows/score-and-explain.tsmodel-configs/gather-signals_llmnode-390_generative-model-name.tsmodel-configs/score-and-explain_llmnode-353_generative-model-name.tsmodel-configs/score-and-explain_llmnode-419_generative-model-name.tsmodel-configs/score-and-explain_llmnode-645_generative-model-name.tsprompts/gather-signals_llmnode-390_system_0.mdprompts/gather-signals_llmnode-390_user_1.mdprompts/score-and-explain_llmnode-353_system_0.mdprompts/score-and-explain_llmnode-353_user_1.mdprompts/score-and-explain_llmnode-419_system_0.mdprompts/score-and-explain_llmnode-419_user_1.mdprompts/score-and-explain_llmnode-645_system_0.mdprompts/score-and-explain_llmnode-645_user_1.mdscripts/gather-signals_code-node-139_code.tsscripts/gather-signals_code-node-512_code.tsscripts/score-and-explain_code-node-396_code.tsscripts/score-and-explain_code-node-529_code.tsscripts/score-and-explain_code-node-905_code.tsgather-signalsflow (flows/gather-signals.ts)triggerNode,model,select,dynamicNode,responseNode(plus edge routing)source_type/raw_textparse_errorand nulls if parsing fails)search_resultsstring (attempts company-name relevance matching; falls back to unfiltered results)search_resultsscore-and-explainflow (flows/score-and-explain.ts)triggerNode,model,conditionNode,dynamicNode,responseNode(plus edge routing)gather-signalsrisk_tier(high/medium/low)conditionNoderoutes to tier-specific LLM prompts:"proceed""verify_further""avoid"risk_tier,explanation, andrecommended_action