Repository navigation
[SCR-59] Derive a prefix the config will accept - #60
Conversation
derivePrefix returned 'a-' for a name ending in a separator and '---' for one made only of separators. Both are the right length by accident, so they cleared the two length fallbacks and were rejected downstream by loadConfig with a message about the config rather than about the name. Avoiding exactly that message is why the fallbacks exist. Only letters count toward the prefix now, and the result is validated before return. The prose documented the branch pattern as [0-9]+ while the validator has always used [1-9][0-9]*. One issue must have exactly one branch name, so cr-0-x and cr-007-x are not valid and the prose was wrong.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe PR validates derived repository prefixes and aligns the documented branch pattern with the validator. It adds fallback handling for malformed names and tests for invalid prefixes, zero issue numbers, leading zeros, and valid issue numbers. ChangesPR standards validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change keeps derived prefixes within the accepted lowercase-letter format and aligns the documented branch-number pattern with validation; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Reviewed the fix to derivePrefix: stripping non-letters before slicing, then re-validating the derived value with isValidPrefix (falling back to zz), correctly closes the gap where a- and --- were the right length by accident and would previously sail past the length-only fallbacks and fail downstream in loadConfig with a config-pointed error message instead of a name-pointed one. Traced through the new test cases (a- → aa, --- → zz, 3d-tools, etc.) by hand against the implementation and they check out. The doc regex update ([0-9]+ → [1-9][0-9]*) also correctly brings pr-standards.md in line with the validator's existing behavior. No bugs, security issues, or convention violations found.
🧑⚖️ Council
| Model | Lens | Result |
|---|---|---|
| GPT-5.6 (Codex) | correctness | no findings |
| Gemini 3 Pro | performance | no findings |
| Kimi K3 (via OpenRouter) | security | no findings |
| Grok 4.5 | maintainability | no findings |
| Sonnet 5 (synthesizer) | conventions + test coverage | no findings |
Closes #59
What
Two fixes that were found in review of #54 and landed after it merged.
derivePrefixnow counts only letters toward the prefix and validates the result beforereturning it.
pr-standards.mddocuments[1-9][0-9]*, matching the validator.Why
derivePrefix('a-')returneda-, andderivePrefix('---')returned---. Both arethe right length by accident, so they cleared the two length fallbacks and were rejected
downstream by
loadConfigwith "prefix must be 2-4 lowercase letters" — a message aboutthe config rather than about the name that caused it. The comment above those fallbacks
says avoiding exactly that message is why they exist, so the guard was in the wrong place.
The prose and the validator disagreed on the branch pattern.
[0-9]+admitscr-0-xandcr-007-x; one issue must have exactly one branch name, so the prose was wrong, not thecode.
How I verified
Checked every input against
^[a-z]{2,4}$:a-,---,-,__,a,x1,123,9,3d-tools— all valid.Then broke each guard to confirm the tests are not theatre:
derivePrefix[0-9]+Assisted-by: claude-personal-2:claude-opus-5
Summary by CodeRabbit
New Features
Bug Fixes
Tests