Repository navigation
Conversation
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.
bla_initwas the one mutating MCP tool that skipped the write-confirmation boundary. Every other destructive tool (bla_hardenapply and restore,bla_defend,bla_protect,bla_encrypt_strings,bla_bind_scope) refuses withconfirmation_requireduntil the caller retries withconfirm_overwrite: true;bla_initwrote or replacedbla.config.jsonimmediately, with no preview and no ask.What changed
bla_inithandler now consultswouldInitBlaConfigWrite(directory, overwrite), a new helper insrc/core/config.tsthat mirrorsinitBlaConfig's exact write decision, and returnsconfirmation_requiredwith the resolvedbla.config.jsonpath when the call would actually create or replace that file (src/mcp/server.ts).confirm_overwriteis added to the tool schema, and a confirmed write now returns awriteReceiptshaped like the other mutating tools.tests/mcp-init-write-confirmation.test.tscovers the create-without-gate, clobber-gated, confirm-then-write and no-op paths;tests/mcp-engine-capability-parity.test.tsrecords the new parameter so the agent-facing surface stays pinned.Why this matters
A destructive tool should not touch an existing file until the user is asked, and that is the rule the other six tools already follow.
bla.config.jsonis not inert: it carriesintensity,seedand the protection opt-ins that every laterbla_hardenrun reads, so a host agent invokingbla_initunprompted could quietly change a project's security posture. The gate was simply missing from this one branch.Tests
npx vitest run tests/mcp-init-write-confirmation.test.ts tests/mcp-inplace-write-confirmation.test.ts tests/blarc-config-validation.test.ts tests/mcp-engine-capability-parity.test.tspasses, 23 tests.npx vitest run tests/setup-mcp-doctor-release.test.ts tests/hardening-cli-mcp-setup.test.ts tests/mcp-arg-length-bounds.test.tspasses, 44 tests with 2 skipped.Compatibility
The create path is unchanged, so a caller that only ever initialises a fresh project sees the same behaviour. A caller that relied on
bla_initclobbering an existingbla.config.jsonsilently now receivesconfirmation_requiredfirst and must repeat the call withconfirm_overwrite: true, which is the intended contract.