fix(block-kit): resolve CLI before validation - #119
Conversation
🦋 Changeset detectedLatest commit: 5819e36 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for the contribution! Before we can merge this, we need @wildcard to sign the Salesforce Inc. Contributor License Agreement. |
wildcard
left a comment
There was a problem hiding this comment.
Self-review guide for the narrowed CLI-validation slice. I checked the exact draft head against issue #99 items 6–10, the repository contribution rules, project-native tests, permission boundaries, and the open #85 overlap. These notes explain the key design decisions; they are not maintainer approval.
| ## Resolve Tooling | ||
|
|
||
| Before choosing the Fast Path, Modification Mode, or full workflow, use the | ||
| `slack:slack-cli` skill, **Step 1: Detect the Slack CLI**, to resolve the public |
There was a problem hiding this comment.
The preflight is deliberately capability-only and runs before every workflow path. Recording SLACK_CMD once avoids the original late-discovery failure and prevents validation and preview from repeating detection or drifting into the CLI skill's install/alias branch.
| Use the `slack:slack-cli` skill, **Step 4: Calling Web API Methods (`slack api`)**, | ||
| for the argument-passing contract. The canonical `blocks.validate` invocation | ||
| below is already known: attempt it directly without running `api --help`, | ||
| `--version`, or generic help first. |
There was a problem hiding this comment.
This is the narrow exception to generic help-driven command discovery: blocks.validate --no-auth is a documented Slack CLI contract, so the skill attempts it directly. The controlled Claude evidence showed that this removes three rejected help/version probes before validation.
|
|
||
| **Path B: curl (fallback, when the CLI isn't installed).** | ||
| If the command cannot start because the host blocks writes to the Slack CLI's | ||
| config or log path, ask for the host's normal narrowly scoped permission and |
There was a problem hiding this comment.
The fallback boundary received the closest security review. A config/log denial may retry the identical command only through normal scoped host approval; if approval is denied, validation stops rather than using curl to route around the operator's decision. Semantic API and shared network failures likewise cannot be hidden by changing transport.
| SKILL = Path("skills/block-kit/SKILL.md").read_text() | ||
|
|
||
|
|
||
| def test_tooling_is_resolved_before_every_workflow_path() -> None: |
There was a problem hiding this comment.
These focused tests intentionally assert durable policy invariants rather than transcript wording: preflight ordering/reuse, canonical calls, semantic same-transport retry, permission non-bypass, and final disclosure. Native agent runs remain supporting behavioral evidence, not unit tests.
|
Full-suite follow-up for exact draft head
The five full-suite failures were:
As a same-environment control, I ran the identical full command on pristine The change-specific regression contract remains deterministic: four unit tests |
Summary
Addresses the CLI-validation portion of #99 (items 6–10).
full workflow, then reuse that result for validation and preview
transport
approval path, and stop unvalidated if that approval is denied
This draft intentionally leaves the issue's five editorial simplifications for
maintainer direction. That keeps the demonstrated CLI behavior independently
reviewable and avoids deciding the Step 2 overlap with #85 in the same change.
Design rationale and alternatives considered
smaller textually, but it reproduces the observed late-discovery problem and
leaves Fast Path without a recorded capability. Installing the CLI during
preflight was rejected because validation already has a public curl fallback
and installation is an unrelated mutation.
useful for changing commands such as preview, but
api blocks.validate --no-authis already documented and owned by Slack CLI. Probing threeunsupported forms first added latency without improving compatibility.
ok:falsewould conceal a payload error as a transport problem. The skillinstead corrects the payload and retries through the same resolved CLI.
after a config/log write denial. Self-review rejected it because another
executable would bypass the operator's denied boundary; the final wording
stops unvalidated instead.
locally validated, but it mixes the objectively demonstrated CLI correction
with editorial changes and the semantic overlap in feat(block-kit): add poll, wizard modal, and empty state templates to common patterns #85. This draft asks for
maintainer direction before combining those concerns.
The formal inline self-review anchors these decisions to the exact changed
lines. It contains no apply-able suggestion because review did not identify a
concrete replacement that is better than the submitted wording; manufacturing
one would add noise rather than help review.
Preview
The attached controlled Claude Code recording is prior supporting evidence from
the broader locally validated candidate that motivated this narrow slice. An
intermediate implementation probes three unsupported help/version forms before
validation; the corrected implementation fingerprints the CLI and immediately
uses the canonical validation command.
claude-code-review-correction-combined.mp4
Video provenance and objective command oracle
The recording uses the same prompt, controlled executable, Claude Fable 5
model, and high effort on both sides. That model/effort was unnecessarily
expensive, but keeping it identical makes the comparison controlled. Future
recordings default to Sonnet 5 at medium effort.
This is a controlled CLI fixture—not live Slack API execution or an official
client-support claim. The first clip is intermediate implementation commit
5e219b8, not upstreammain; the final clip is the broader all-ten localcandidate
edb8e35, not this tooling-only branch. It demonstrates the sameCLI-state-machine correction isolated by this draft:
Neither event oracle contains curl. The public-safe combined artifact is H.264,
174 seconds, SHA-256
b618dc2bea9f55675c392f9238b51b2d3cf55c7e70f7879e16fed61d0e546837.Testing
make lint— passedmake typecheck— passedmake test-unit— 22 passed, including four focused Block Kit validationpolicy tests
claude plugin validate .— passedPYTEST_ADDOPTS='-k skill-block-kit-modal' make test-eval— the onechange-relevant Block Kit tool-selection scenario passed
make test— executed with working Gemini and Slack MCP credentials on exactdraft head
5819e368; units passed 22/22 and evals passed 26/31The five full-suite failures were outside this PR's three-file Block Kit diff:
two transient Gemini
503 UNAVAILABLEresponses, two existing scenarios thatexpect
slack_list_channel_membersalthough the current hosted MCP endpointdid not return that tool, and one model response using
slack_docsinstead ofthe accepted
slack-docsskill name.For comparison, the same
make testcommand on pristineupstream/main77a10794under the same host, model, MCP token, and environment passed only22/31 evals and reproduced all three failure classes. This comparison shows the
failures are baseline/environmental; it does not make the full command green.
Prior supporting evidence, not exact-branch test results:
the same Block Kit prompt and canonical validation command
blocks.validate --no-authchecks, which verify thecanonical command contract but not this skill revision's agent behavior
Why the full-test checkbox remains unchecked
The required command was run rather than replaced by narrower tests. Its unit
portion and the change-relevant Block Kit eval pass, and the branch performs no
worse than pristine main. However,
make testexits nonzero, so the truthfulchecklist state remains unchecked pending maintainer CI or resolution of the
current upstream eval/tool-surface failures.
Notes
This draft changes only
skills/block-kit/SKILL.md, a focused unit contract,and one patch changeset. It does not include #99's editorial cleanup, modify
common-patterns.md, change Slack CLI or MCP/OAuth behavior, or claim officialCodex support.
The draft is intentionally open for scope discussion: if maintainers prefer
the issue's simplification and CLI-hardening halves together, the complete
locally validated version can be folded into this branch. If they prefer one
behavioral concern per PR, this branch is independently reviewable as-is.
Requirements
make testand the tests pass.make testwas run, but the suite is not fully green, so this combinedrequirement remains unchecked. See the
full test report
for the passing subsets, five failure classes, and same-environment upstream
comparison.