fix(implement-task): add symbol dedup and null guard guidance - #269
fix(implement-task): add symbol dedup and null guard guidance#269ruromero wants to merge 1 commit into
Conversation
…access guidance Add two new quality guidelines to Step 6: - Symbol deduplication: search the target package for existing constants, enums, and type aliases before declaring new ones to prevent duplication across sibling modules. - Defensive property access: add null/undefined guards when consuming data from external modules, using language-idiomatic patterns. Add eval cases 12 and 13 with fixtures to cover the new behaviors. Implements TC-5516 Assisted-by: Claude Code
Reviewer's GuideAdds new guidance to the implement-task skill for symbol deduplication and defensive handling of external data, and extends the eval suite with two synthetic tasks that validate these behaviors. Flow diagram for symbol deduplication guidanceflowchart TD
A[Need new constant/enum/type alias] --> B[Search target package for symbol using find_symbol / search_for_pattern / Grep]
B --> C{Existing definition found?}
C -->|Yes| D[Import and reuse existing symbol]
D --> E[If not exported, decide to export or inline per reuse_over_duplication]
C -->|No| F[Declare new symbol in shared utilities/constants or local file]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In the new “Symbol deduplication” section, consider clarifying what constitutes the “target package” (e.g., crate, npm package, monorepo subtree) so users know the exact search scope for
find_symbol/grep. - For the “Defensive property access on external data” guidance, it may help to explicitly distinguish between data crossing module boundaries inside the same repository versus true external APIs, as the level of required defensiveness can differ and this nuance could avoid over-guarding internal, well-typed interfaces.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the new “Symbol deduplication” section, consider clarifying what constitutes the “target package” (e.g., crate, npm package, monorepo subtree) so users know the exact search scope for `find_symbol`/grep.
- For the “Defensive property access on external data” guidance, it may help to explicitly distinguish between data crossing module boundaries inside the same repository versus true external APIs, as the level of required defensiveness can differ and this nuance could avoid over-guarding internal, well-typed interfaces.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Eval Results
implement-task Eval Results
Skill version: 0.13.8
Per-Eval Results
| Eval | Name | Assertions | Passed | Failed | Pass Rate |
|---|---|---|---|---|---|
| 1 | Standard task | 10 | 9 | 1 | 90.0% |
| 2 | Incomplete task | 5 | 5 | 0 | 100.0% |
| 3 | Task with reuse | 6 | 6 | 0 | 100.0% |
| 4 | Adversarial task | 6 | 6 | 0 | 100.0% |
| 5 | Feature branch | 7 | 7 | 0 | 100.0% |
| 6 | Digest match | 4 | 4 | 0 | 100.0% |
| 7 | Digest mismatch | 5 | 5 | 0 | 100.0% |
| 8 | Private reuse | 5 | 5 | 0 | 100.0% |
| 9 | Dead parameter | 5 | 5 | 0 | 100.0% |
| 10 | Sibling override | 5 | 5 | 0 | 100.0% |
| 11 | Query scope | 5 | 5 | 0 | 100.0% |
| 12 | Symbol dedup | 5 | 5 | 0 | 100.0% |
| 13 | External data | 5 | 5 | 0 | 100.0% |
Failed Assertions
Eval 1 — Standard task (1 failed)
Assertion: The plan mentions checking for a description digest comment (Step 1.5) and notes that when no digest is found, it proceeds with a warning rather than blocking execution (backward compatibility per shared/description-digest-protocol.md)
Evidence: plan.md Step 1.5 mentions checking for a description digest: 'Would fetch issue comments via jira.get_issue_comments(TC-9201) and look for digest comment starting with [sdlc-workflow] Description digest:'. However, the plan does NOT note the backward-compatible behavior of proceeding with a warning when no digest is found. It only says '(Skipped per eval instructions -- no external tool calls.)' without describing the fallback behavior. The assertion requires the plan to explicitly state that missing digest results in a warning rather than blocking, which is absent.
Aggregate
| Metric | Mean | Stddev |
|---|---|---|
| Pass rate | 0.992 | 0.027 |
| Time (seconds) | 133.35 | 43.89 |
| Tokens | 39,599 | 2,899 |
Baseline Comparison
Baseline: 0adea80
| Metric | Baseline | Current | Delta |
|---|---|---|---|
| Pass rate | 0.943 | 0.992 | +0.049 (+5.2%) |
| Time (seconds) | 93.63 | 133.35 | +39.72 (+42.4%) |
| Tokens | 31,348 | 39,599 | +8,251 (+26.3%) |
Note: The baseline had 7 evals; this run has 13 evals (6 new eval cases added). Time and token increases are expected due to the expanded eval suite. Pass rate improved from 94.3% to 99.2%.
Generated by sdlc-workflow v0.13.8
|
[sdlc-workflow/verify-pr] Re: @sourcery-ai[bot] review — Classified as suggestion (2 items):
|
Verification Report for TC-5516 (commit d9d5df8)
Overall: WARNScope Containment is WARN due to 3 eval files not listed in the task's Files to Modify section. These files (evals.json, task-symbol-dedup.md, task-external-data.md) are eval fixtures that directly test the new SKILL.md guidance and were added per user request during implementation. No task-specified files are missing. This comment was AI-generated by sdlc-workflow/verify-pr v0.13.8. |
Summary
Implements TC-5516
Summary by Sourcery
Strengthen implement-task workflow guidance around reusing existing symbols and defensively handling external data, and add eval coverage for these behaviors.
Documentation:
Tests: