Overall savings should now be 50%+ tokens used
perf: tweaks to schema descriptions, aiming to reduce token usage without performance degradation
This commit is contained in:
@@ -34,37 +34,31 @@ logger = logging.getLogger(__name__)
|
||||
# Tool-specific field descriptions for precommit workflow
|
||||
PRECOMMIT_WORKFLOW_FIELD_DESCRIPTIONS = {
|
||||
"step": (
|
||||
"Validation plan. Step 1: State strategy. Later: Report findings. "
|
||||
"MUST examine git changes, analyze impacts. Use 'relevant_files' for code. NO large snippets."
|
||||
"Step 1: outline how you'll validate the git changes. Later steps: report findings. Review diffs and impacts, use `relevant_files`, and avoid pasting large snippets."
|
||||
),
|
||||
"step_number": "Current step index in pre-commit sequence (starts at 1). Build upon previous steps.",
|
||||
"step_number": "Current pre-commit step number (starts at 1).",
|
||||
"total_steps": (
|
||||
"Estimated steps needed to complete validation. "
|
||||
"IMPORTANT: For external validation, use max 3 steps. For internal validation, use 1 step. "
|
||||
"When continuation_id is provided (continuing a previous conversation), set to 3 max for external, 1 for internal."
|
||||
"Planned number of validation steps. External validation: use at most three (analysis → follow-ups → summary). Internal validation: a single step. Honour these limits when resuming via continuation_id."
|
||||
),
|
||||
"next_step_required": (
|
||||
"True to continue with another step, False when validation is complete. "
|
||||
"CRITICAL: If total_steps>=3, set to True until the final step. "
|
||||
"CRITICAL: If total_steps>=3 or when `precommit_type = external`, set to True until the final step. "
|
||||
"When continuation_id is provided: Follow the same validation rules based on precommit_type."
|
||||
),
|
||||
"findings": (
|
||||
"Discoveries: git diffs, modifications, issues (bugs, missing tests, security). "
|
||||
"Document positive+concerns. Update in later steps."
|
||||
),
|
||||
"files_checked": "All examined files (absolute paths), including ruled-out ones.",
|
||||
"relevant_files": "Files with changes or relevant to validation (absolute paths). Modified files, config, tests, docs.",
|
||||
"relevant_context": "Methods/functions central to changes: 'Class.method' or 'function'. Focus on modified/added.",
|
||||
"issues_found": "Issues with 'severity' (critical/high/medium/low) and 'description'. Bugs, security, performance.",
|
||||
"precommit_type": "'external' (default, expert review) or 'internal' (local only). Default external unless user specifies.",
|
||||
"backtrack_from_step": "Step number to backtrack from if revision needed.",
|
||||
"images": "Optional screenshots/visuals for validation (absolute paths).",
|
||||
"path": "Starting path for git repos (FULL absolute path). REQUIRED step 1.",
|
||||
"compare_to": "Optional git ref (branch/tag/commit) to compare. Checks remotes if needed. Without: checks staged/unstaged.",
|
||||
"include_staged": "Analyze staged changes. Ignored if 'compare_to' provided.",
|
||||
"include_unstaged": "Analyze unstaged changes. Ignored if 'compare_to' provided.",
|
||||
"focus_on": "Focus aspects: security, performance, test coverage.",
|
||||
"severity_filter": "Minimum severity to report.",
|
||||
"findings": "Record git diff insights, risks, missing tests, security concerns, and positives; update previous notes as you go.",
|
||||
"files_checked": "Absolute paths for every file examined, including ruled-out candidates.",
|
||||
"relevant_files": "Absolute paths of files involved in the change or validation (code, configs, tests, docs). Must be absolute full non-abbreviated paths.",
|
||||
"relevant_context": "Key functions/methods touched by the change (e.g. 'Class.method', 'function_name').",
|
||||
"issues_found": "List issues with severity (critical/high/medium/low) plus descriptions (bugs, security, performance, coverage).",
|
||||
"precommit_type": "'external' (default, triggers expert model) or 'internal' (local-only validation).",
|
||||
"backtrack_from_step": "Step number to revisit when revising earlier analysis.",
|
||||
"images": "Optional absolute paths to screenshots or diagrams that aid validation.",
|
||||
"path": "Absolute path to the repository root. Required in step 1.",
|
||||
"compare_to": "Optional git ref (branch/tag/commit) to diff against; falls back to staged/unstaged changes.",
|
||||
"include_staged": "Whether to inspect staged changes (ignored when `compare_to` is set).",
|
||||
"include_unstaged": "Whether to inspect unstaged changes (ignored when `compare_to` is set).",
|
||||
"focus_on": "Optional emphasis areas such as security, performance, or test coverage.",
|
||||
"severity_filter": "Lowest severity to include when reporting issues.",
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user