#183: Add _ROW_COUNT_BETWEEN_SCOPE_INSTRUCTION - #191
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThis PR implements the missing ChangesRow-count-between and unique-combination scope instructions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the missing narrative SCOPE-instruction block for the row_count_between test primitive, mirroring the two existing sibling blocks (_UNIQUE_COMBINATION_SCOPE_INSTRUCTION, _ROW_COUNT_ANOMALY_SCOPE_INSTRUCTION). The primitive itself shipped its catalogue line in #169 but never got a dedicated scope-instruction block. - prompts.py: define _ROW_COUNT_BETWEEN_SCOPE_INSTRUCTION (embeds the DEC-012 worked example), insert {row_count_between_scope} placeholder in primitive order, wire the allowed/scope toggle through _render_system_prompt + the format() call. - test_prompt_cache_stability.py: rotate _EXPECTED_PROMPT_VERSION c11a73cc95b31614 -> e568fb3e4602e465 with a #183 rotation-history entry. _CACHED_BLOCK_GOLDEN untouched (system-prompt edit only). - test_prompts.py: add bounded-aggregation / calibration prose tests, default-render-inclusion test, keep-when-other-types-excluded test, and extend the row_count_between exclude test to assert the scope prose disappears too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…COPE_INSTRUCTION (#183) 4 code-review passes: plumbing + test-quality + fidelity clean. One finding: docs/draft-ops.md row_count_between section now names the scope-instruction constant for parity with the sibling sections. CodeRabbit skill unavailable in this environment (skipped). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tion (#183) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Implementation landed (Ralph run complete)All four beads under epic
Validation: Maintainer post-merge validation (not CI-gated, per DEC-005): re-run 🤖 Generated with Claude Code |
There was a problem hiding this comment.
Pull request overview
Adds the missing narrative SCOPE-instruction block for the existing row_count_between test primitive in the drafter prompt, rotates the drafter prompt version pin accordingly, and backfills prose-level prompt tests (including parity coverage for unique_combination) so future prompt edits are behaviorally pinned in CI.
Changes:
- Add
_ROW_COUNT_BETWEEN_SCOPE_INSTRUCTIONand wire it into_SYSTEM_PROMPT_TEMPLATE/_render_system_prompt. - Rotate the drafter prompt version pin (
_EXPECTED_PROMPT_VERSION) and extend prompt tests to assert inclusion/exclusion + key heuristic substrings. - Update operational docs/rules and add a detailed plan document for #183.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/signalforge/draft/prompts.py |
Introduces row_count_between SCOPE prose and gates it via exclude_tests in the rendered system prompt. |
tests/llm/test_prompt_cache_stability.py |
Updates the pinned _EXPECTED_PROMPT_VERSION and records the new rotation in the history docstring. |
tests/draft/test_prompts.py |
Adds prose “content pin” tests for row_count_between and backfills missing unique_combination prose tests + exclude-gating assertions. |
docs/draft-ops.md |
Documents that the system prompt now includes the row_count_between scope-instruction guidance (plus calibration notes). |
.claude/rules/business-rule-tests.md |
Adds a rule requiring scope-instruction blocks to ship with paired prose tests. |
plans/super/183-row-count-between-scope.md |
Adds the super-plan for #183 implementation/validation steps and conventions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR Review SummaryFixed (1 item)
False Positives (0 items)None. All review threads resolved. |
Summary
Super plan for #183 — add the missing
_ROW_COUNT_BETWEEN_SCOPE_INSTRUCTIONto the drafter, the DEC-012 worked example that never landed with #169.Base:
dev(0.6.0.dev0) — the only branch carrying #169/#170/#171/#179.main(0.5.0) lacks all the deps.Phase: detailing (awaiting approval)
Stories: 2 implementation (US-001 prompt+lockstep pin, US-002 #170 test-parity backfill) + Quality Gate + Patterns & Memory
Decisions: DEC-001…DEC-007 captured
Key findings
row_count_betweenprimitive is already complete end-to-end (model,VALID_TEST_TYPES, catalogue line, all 6 dispatch sites). The only gap is the narrative scope-instruction block — plumbing precedent from Add unique_combination as a 7th first-class test primitive (composite-key uniqueness) #170/Add row_count_anomaly_by_period: drafter-proposed historical-trend row-count guard #171 is exact._PROMPT_VERSIONauto-rotates;_EXPECTED_PROMPT_VERSION+ rotation-history docstring move in lockstep._CACHED_BLOCK_GOLDEN(manifest summary) stays untouched._UNIQUE_COMBINATION_SCOPE_INSTRUCTIONwithout prose tests — backfilled in US-002.intuit_airflowre-validation (AC PII safety: schema-only default, sample opt-in, redaction patterns #4) is a documented maintainer post-merge step (needs Anthropic spend + external substrate), not a Ralph story.Plan document
See
plans/super/183-row-count-between-scope.md.Next steps
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
row_count_betweentests, including bounded aggregation heuristics and parameter calibration recommendations.unique_combinationtests with composite-key grain examples and anti-vacuity safeguards.Tests