Skip to content

feat: add the concept write verbs to okf mcp - #28

Merged
leoafarias merged 1 commit into
mainfrom
feature/12-mcp-concept-writes
Aug 21, 2026
Merged

feat: add the concept write verbs to okf mcp#28
leoafarias merged 1 commit into
mainfrom
feature/12-mcp-concept-writes

Conversation

@chrishiguto

@chrishiguto chrishiguto commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Why

Raw concept edits can bypass Spec preparation, reserved-path safety, atomic index/log maintenance, and preservation of unmanaged content.

What

Adds create-concept and update-concept as thin adapters over the prepared-change module. Arguments become a change set, and OkfBundleChangeApplier.apply serializes preparation and the exact prepared commit under the shared bundle lock.

Malformed input remains a report-free tool error. A Spec-invalid candidate returns the stable Spec report and changes no file. Advisory-only candidates, including safe Unicode IDs, can commit. The server has no injected validator or executable rule-registration parameter.

The MCP annotations are explicit: create is additive and non-idempotent; update is destructive and idempotent; both operate only on the local bundle.

Reviewer's guide

Start with the write registrations and _write in lib/src/mcp/server.dart, then the protocol tests. The branch is restacked directly onto current main.

Prepared multi-file writes are rollback-backed for ordinary filesystem failures. They are not process- or power-loss crash-atomic because destination files are replaced independently; the README now states that boundary explicitly.

Testing

  • dart format --output=none --set-exit-if-changed .
  • dart analyze --fatal-infos
  • dart test — 160 tests pass
  • dart pub publish --dry-run — 0 warnings
  • MCP protocol suite on Dart 3.4.0 — 10 tests pass
  • Adversarial probes cover same-concept concurrent updates, two independent MCP writer processes, Unicode filesystem aliases, stable Spec refusals, and no-mutation error paths

Links

Fixes #12.

@chrishiguto chrishiguto left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RESOLVED — MCP writes use canonical apply

The MCP adapter now translates arguments into typed changes and delegates to the canonical serialized prepare/commit boundary through 0df28ac. It has no injected validator or strict write policy, commits advisory-only candidates, reports Spec refusals, and keeps malformed input in the tool-error tier.

Protocol and concurrency coverage pass with all four CI checks. This review no longer blocks the PR.

Base automatically changed from feature/11-mcp-read-surface to main August 21, 2026 17:13
@leoafarias
leoafarias force-pushed the feature/12-mcp-concept-writes branch from 0df28ac to 3b1d412 Compare August 21, 2026 17:30
@leoafarias
leoafarias merged commit 2013f65 into main Aug 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP server: concept writes through prepare and commit

2 participants