feat(ai): op-design-lint — pen-ai-skills S1 detector layer Rust port#131
Open
finiking wants to merge 2 commits into
Open
feat(ai): op-design-lint — pen-ai-skills S1 detector layer Rust port#131finiking wants to merge 2 commits into
finiking wants to merge 2 commits into
Conversation
685570b to
c554a8b
Compare
Port the pen-ai-skills diagnostics layer to a new pure Rust crate `op-design-lint`: 14 design-lint detectors, the detect_all aggregator, apply_fixes / detect_and_fix, and golden parity tests against the TS oracle. Wire it into op-mcp as the read-only debug_validation_report tool, gated by OPENPENCIL_DEBUG_TOOLS=1. Detectors: empty_paths, unexpected_rotation, excessive_frame_effects, invisible_containers, text_explicit_heights, text_effect, text_corner_radius, text_stroke, text_bg_contrast, edge_section_padding, stacked_horizontal_padding, sibling_inconsistencies (+ check_consistency), detect_all. Also includes: node_util shared helpers + pen-core color/visibility ports, node_mut field accessors, set_property issue->node mutation dispatch, golden fixture corpus + TS dump script, structural-parity test, a CI golden-drift guard, and the gitignore fix so the fixture docs/ dir is tracked. This branch's per-commit history was squashed: the original 28 commits carried fabricated timestamps and could not be honestly reconstructed, so the work is recorded as a single commit at its real completion time.
c554a8b to
91f0485
Compare
debug_validation_report was registered in rebuild_registry and listed in tools/list unconditionally — only call() consulted OPENPENCIL_DEBUG_TOOLS. A production client (flag unset) still saw the debug tool in its catalog and could invoke it, getting a bare ToolFailed. That leaks the debug surface into the production catalog. Gate it everywhere instead of only at call time: rebuild_registry registers the tool only when debug_tools_enabled(), and tools_list_response appends the debug schema — now a separate DEBUG_TOOL_SCHEMAS const, removed from TOOL_SCHEMAS — only when the flag is set. A client without the flag never sees the tool at all, matching the TS design where debug tools ship only in a debug build. debug_tools_enabled() is promoted to pub and re-exported from op-mcp. The tools/list catalog test now exercises both gate states (82 tools flag-off, debug tool present flag-on).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sub-project S1 of the
pen-ai-skillsRust-ification — ports the TS design-diagnostics layer to a new pure-Rust crateop-design-lint, and restores thedebug_validation_reportMCP tool on the Rust side.crates/op-design-lint— wasm-clean pure crate:Issue/FixProperty/FixReportmodel, WCAGcolor,node_util/node_mut, all 14 detectors +detect_all,apply_fixes/detect_and_fix(verbatim port of TSapplyFixes).PenDocumentfixtures +tools/dump-diagnostics-golden.ts+tests/parity.rs(structural parity vs the TS oracle) + a CI drift-guard job inrust-check.yml.op-mcp— new read-onlydebug_validation_reporttool, gated byOPENPENCIL_DEBUG_TOOLS=1.Detectors are a verbatim TS port (parity-tested).
detectTextCornerRadius/detectTextStrokeare structural no-ops on jian docs — jian's typedTextNodecannot carrystroke/cornerRadius(T0 schema audit decision a).apply_fixesis history-agnostic (the production caller + history-snapshot wrapper belong to S3).Spec / plans / audit:
openpencil-docs/superpowers/{specs,plans,notes}/2026-05-1*-pen-ai-skills-s1-*and2026-05-18-s1-gate-complete.md.Test Plan
cargo test -p op-design-lint— 149 pass (136 lib + 13 parity)cargo test -p op-mcp— 139 passcargo clippy -p op-design-lint -p op-mcp --all-targets -- -D warnings— cleancargo build -p op-design-lint --target wasm32-unknown-unknown— wasm-clean invariant holdss1-op-design-lint: Rust Check (incl. golden drift guard) + WASM bundle check + Rust multi-platform builddebug_validation_reportverified end-to-end viaopenpencil-desktop --mcpwithOPENPENCIL_DEBUG_TOOLS=1