Phase 8f-3 + 8f-4: Param alignment audit + QA nits (#24) #25
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-mcp!25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "24-param-alignment-qa-nits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Audit and harden all MCP-to-SDK parameter translations introduced in PR #23 (8f-2 rewrite). Fix edge case #12 (create_note tags=None), harden CSV splitting against trailing commas and whitespace, resolve E741 lint warnings, and add .claude/ to .gitignore.
Changes
src/pal_e_docs_mcp/tools/notes.py— create_note now passestags=[]explicitly when tags param is None (matching old MCP behavior); addedif t.strip()filter to all CSV splits to handle trailing commassrc/pal_e_docs_mcp/tools/sprints.py— renamedltolblin 2 CSV comprehensions (fixes E741), removed# noqa: E741comments, addedif lbl.strip()filter, added docstring onmove_sprint_itemdocumenting SDKupdate_sprint_itemname mappingsrc/pal_e_docs_mcp/tools/links.py— addedif s.strip()filter to update_note_links CSV split.gitignore— added.claude/to prevent worktree artifacts from being stagedtests/conftest.py— new sharedmock_sdkfixture for patching get_sdk across tool modulestests/test_param_alignment.py— 25 unit tests covering all 8 documented param translations, CSV edge cases, sentinel handling, field renames, and defaultsTest Plan
pytest tests/ -v— 25/25 passedruff check— no errorsruff format --check— all files formatted[]to SDK"sop,active,"produces["sop", "active"]" sop , active "produces["sop", "active"]Review Checklist
ruff check+ruff format --check)Related
plan-2026-02-26-tf-modularize-postgresPR #25 Review
BLOCKERS
None.
NITS
conftest.pydoes not patch blocks, projects, repos, or tags modules. Themock_sdkfixture only patchesnotes,sprints, andlinks-- which is correct for the current test file. However, if future test files usemock_sdkexpecting it to cover all tool modules, they will hit realget_sdk()calls. Consider a comment in conftest noting which modules are patched and why, or patching all tool modules preemptively.list_notesandsearch_notespasstagsas a raw CSV string to the SDK (no split). This is correct per the SDK signatures (tags: str | None), but it means trailing-comma and whitespace hardening does NOT apply to those two tools. If a user callslist_notes(tags="sop,active,"), the trailing comma goes straight to the API. This is outside the scope of this PR (it was not in the 8f-3 audit list, and the API likely handles it), but worth noting for a future hardening pass.Minor:
move_sprint_itemlabels with empty string. Whenlabels=""(not None), the code enters the split path and produces[](all elements filtered). The_UNSETsentinel is only used whenlabels is None. Passinglabels=[]toupdate_sprint_itemwould clear all labels rather than leaving them unchanged. This edge case is not tested. If the intent is thatlabels=""should clear labels, that is fine; if it should be a no-op, it needs different handling. Low risk since MCP callers typically omit the param rather than passing empty string.SOP COMPLIANCE
24-param-alignment-qa-nitsreferences issue #24plan-2026-02-26-tf-modularize-postgresreferenced.gitignoreadds.claude/, no.envor credentials in difftest_param_alignment.pycovering all 8 documented param translations plus CSV edge casesCODE QUALITY
Noneto[]increate_note. Theif tags else []pattern handles bothNoneand"". Correct.if t.strip()/if s.strip()/if lbl.strip()applied consistently across all 5 CSV split sites in notes.py, sprints.py, and links.py. No other tool modules have CSV splits. Complete coverage.lrenamed tolblin bothadd_sprint_itemandmove_sprint_item.# noqa: E741comments removed. Clean.update_sprintandmove_sprint_itemcorrectly use_UNSETfrom SDK for optional fields. Tests verify this.move_sprint_itemnow documents the SDKupdate_sprint_itemmapping. Good.conftest.pymock_sdk fixture: Clean shared fixture usingmonkeypatch.setattr. Correctly patches the module-levelget_sdkreference in each tool module.VERDICT: APPROVED