313: MSSQL spike: scaffold spike directory and must-reject corpus #335
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!335
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-313/mssql-spike-scaffold-spike-directory-and-must-reje"
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?
313: MSSQL spike: scaffold spike directory and must-reject corpus
Implements 313.
Generated in 1m 12s.
Review findings
Line numbers in the findings differ from the file; I'll edit by content.# Review Findings — 313
Summary
I resolved all five findings in
extensions/mssql/spike/corpus-reject.mjs.corpus-reject.test.mjs, anode:testfile that checks label andsqltypes and label uniqueness. Both tests pass when run directly. I did not add the file to the rootnpm testglob.SELECT/CTE allow-list assumption.INSERT ... EXEC,sp_OACreate,xp_dirtree,xp_regreadand aSELECT ... WITH (UPDLOCK)case.I left out
SELECT ... FOR XML/JSONcalling a write-capable function. I also did not add anINSERTnested in a derived table; the OUTPUT case was relabelled instead. The project has no build or lint script.Critical
High
Medium
sql, duplicate label, non-string) would only surface when the later guard spike consumes it. Suggested fix: add a smallnode:testfile (e.g.corpus-reject.test.mjs) asserting each entry has a non-empty stringlabeland a stringsql, and that labels are unique. This also matches the follow-up inci-coverage.md, which asks fornode:test-compatible tests.INSERT ... OUTPUT, with no derived table or subquery. The label misdescribes the case, and the intended case, anINSERTnested in a derived table, is not covered. Suggested fix: rename the label to "output: INSERT with OUTPUT". If the case was meant to exist, addSELECT * FROM (INSERT ...)-style SQL, orINSERT ... OUTPUTinsideINSERT ... EXEC.SET NOCOUNT ON,DECLARE,BEGIN TRAN,USE,GO. A guard that allows harmlessSETorDECLAREwould "fail" the corpus. Suggested fix: add a header comment stating that the corpus assumes a strict single-SELECT/CTE-only allow-list. Alternatively, move the debatable cases into a separate "policy-dependent" group.Low
SELECT ... FOR XML/JSONthat call a write-capable function, forSELECTwith locking hints (WITH (UPDLOCK)) orFOR UPDATE-style locking, or forINSERT ... EXEC. It also has no case forsp_OACreate,xp_dirtreeorxp_regread. Suggested fix: add a few of these.UPDLOCKandHOLDLOCKhints are read-only in effect but can block other sessions, which is relevant to a read-only guard.