sdac-analyze-comment-quality
Purpose
Scores comment quality for unusual salary/fringe entries and flags poor documentation.
Tool type
AI-assisted (LLM; non-deterministic)
Tool ID
sdac-analyze-comment-quality
Inputs
report_id(string)min_quality_threshold(number, optional, default: 0.5)batch_size(number, optional, default: 100)
Outputs
- Per-record quality scores and recommendations
- Summary statistics
Example output
{
"success": true,
"report_id": "SDAC-2024-Q2-001",
"total_analyzed": 2,
"poor_quality_count": 1,
"results": [
{
"record_id": 1024,
"row_number": 18,
"quality_score": 0.32,
"risk_level": "HIGH",
"explanation": "The comment notes a replacement but does not identify the main roster row or dates covered.",
"recommendation": "Ask the district to identify the replaced roster position and the replacement period.",
"original_comment": "Replacement for SLP",
"context_summary": "$0 salary, high fringe"
}
],
"summary": {
"total_analyzed": 2,
"avg_quality_score": 0.61,
"high_risk_count": 1,
"medium_risk_count": 0,
"low_risk_count": 1,
"poor_quality_count": 1
}
}
Functional details
- Uses the SDAC Comment Analyzer agent to assess comment adequacy.
- Produces quality scores (0.0–1.0) and risk flags.
- Provides remediation suggestions for low-quality notes.
Implementation details
- Loads personnel records and filters to unusual contexts (e.g., $0 salary/fringe).
- Sends batches to the Comment Analyzer agent for LLM-backed scoring.
- Flags records below
min_quality_thresholdand returns targeted recommendations. - Calculates context summary based on salary/fringe magnitude and zero values.
Code Location: packages/domain-sdac/src/tools/analyze-comment-quality.tool.ts