feat(mentor): native deslop lint as fix cards (#6)
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
PRD S3.4: the deslop doctrine's deterministic findings — banned-vocab tiers and em-dash density — are now computed in Swift at pass invocation, one line after the #31 stats capture, with no engine round-trip. Findings land as real fix cards (emitter lint) through FixCardStore, so they render in the existing palette with ask-before Apply on mechanical mapping cards; mapped phrases (the skill's verb swaps + #31, e.g. utilize→use) case-match their anchor per ADR-0006, everything else closes Done/Skip. One card per phrase over its tier allowance, whole-word case-insensitive matching (delved never fires delve), em-dash density card first when over budget; emit dedups against OPEN cards so re-runs make progress and the engine never re-cards a live lint finding. The tiers ship as data (Resources/deslop-lint.json mirroring the deslop skill verbatim — key/landscape/highlight/bare-underscore omitted as POS-ambiguous) with a <home>/deslop-lint.json override that wins whenever it exists and decodes: trivially editable without a recompile. Finish-audit fixes folded in: whitespace-only override phrases can no longer silently kill a whole submit (the guard mirrors the store's trimmed validation), and submit now refuses a symlinked cards/ dir (promote's posture — the lint auto-fires it every Run Pass). Suite 489; one EditorSession load-flake cleared in isolation and on the idle re-run. Closes #6
This commit is contained in:
1 parent
22bca36857
commit
4724e00b73
13 files changed
+687
-7
No files matched your search
@@ -149,6 +149,19 @@ struct MCPToolsTests {
|
||||
)
|
||||
}
|
||||
|
||||
@Test func `submit refuses a symlinked cards dir`() throws {
|
||||
let home = try toolsHome()
|
||||
let piece = try writePiece(home)
|
||||
let target = home.appendingPathComponent("drop-target", isDirectory: true)
|
||||
try FileManager.default.createDirectory(at: target, withIntermediateDirectories: true)
|
||||
try FileManager.default.createSymbolicLink(
|
||||
at: piece.appendingPathComponent("cards"),
|
||||
withDestinationURL: target,
|
||||
)
|
||||
#expect(throws: Error.self) { try FixCardStore.submit(piecePath: piece.path, cards: [card()]) }
|
||||
#expect(try FileManager.default.contentsOfDirectory(atPath: target.path).isEmpty)
|
||||
}
|
||||
|
||||
@Test func `submit throws on missing piece`() throws {
|
||||
let home = try toolsHome()
|
||||
// A lazy piece folder without post.md is not a piece.
|
||||
|
||||
Reference in new issue
Block a user