Repository navigation
MCP: an assistant can author models with no docs pasted in - #21
Merged
Merged
Conversation
The MCP server could run a model someone else wrote but not teach a client to write one: tools took only paths (a chat client cannot write to the server's disk), no instructions were set, and errors were prose. This implements the feature request in mcp_advanced.md, R1-R8: - inline sources beside every path argument, served as `inline:NAME.writ`, a name no (load …) can reach, so pinned claims stay pinned; model_name keeps revision history per inline model; claims_source is refused under --claims-dir; - writ_guide: index, syntax.model/claims/rules, semantics, idioms, five worked examples (failing check, fix, compare) and one topic per error code, as markdown in tooling/mcp/guide embedded at build time; also writ://guide resources and a writ_model_system prompt; server instructions; a complete example in writ_check's description; - writ_validate: parse and type-check without building the space, with a summary and the situation bound; a misspelt name in claims, which check would answer n/a, is an error here, and check adds a `why n/a` line; - coded errors (code, position, found, expected, hint, corrected line, guide pointer), as prose or JSON; - max_situations / timeout_ms, and a cut-off search that reports how far it got and which cells grew, deciding nothing; - writ_compare names properties still failing in both models. Breaking: a transition clause other than when/do is an error; a bare (set …) outside (do …) was silently dropped. No model in the writ repositories has one. test_mcp_authoring re-runs every guide example against its printed output and every error code's wrong and right example. A cold-start agent given only the tools passed the request's six acceptance scenarios; its findings and a code review are folded in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cold-start acceptance run found that a failing inevitable said only `stuck at: #N` — not how a run avoids the goal from there — and that dead-end routes of hundreds of moves flooded a reply. - inevitable: `avoids: the run stops at #N`, or `loop:` a shortest cycle back to the stuck situation outside F; under (fair …), where one cycle could starve a fair move, `loops among:` the region a fair run circles in. Space.avoidance exposes the region escapes_f already computed. - dead ends: a route over 24 moves keeps its ends and counts the middle; past 20 dead ends the rest are counted. - Prose only; --json and certificates are unchanged (certified as before). - plugin skill: mention writ_guide/writ_validate when the server lists them, so it reads true against the pinned 0.4.0 image and later ones. - docs/mcp.md: an inline model's (load …) searches the working directory first, as a path model's does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With every property n/a and no query, writ-cert re-derives only the situation count, yet the last line read "every answer re-derived". It now reads `certified: the situation count only — every property is n/a, so no claim was checked`, in `writ check` and `writ_check` alike (one renderer, Certify_json.verdict_line). The certification JSON field and the certificate format are unchanged, so writ-cert needs nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Implements the feature request in
mcp_advanced.md(R1–R8). An LLM client with no Writ knowledge can now learn the language from the server, send models inline, fix errors from the error alone, and be told when a model is too big.What changes
*_sourcetwin, at most 256 KB. Inline text is served asinline:NAME.writ, a name no(load …)can reach, so an inline model can never stand in for a library that pinned claims load.claims_sourceis refused under--claims-dir.model_namekeeps revision history per name for as long as the server runs. Inlinewrit_compareandwrit_querymust be given claims, since an inline model has no sibling.claimsfile.writ_guide(R2). Topicsindex,syntax.model,syntax.claims,syntax.rules,semantics(it answers the request's 11 questions),idioms, and five worked examples:mutex,webhooks,consumer,commit,handoff. Each example shows the failing check, the fix and the compare. There is also one topic per error code. The topics are markdown intooling/mcp/guide/, compiled into the server. The largest is about 2k tokens.writ_validate(R5). Parses and type-checks without building the space, then summarises types, arrows, laws, moves, properties and relations, plus the situation bound. It warns when the bound is over budget. A misspelt name in claims, whichwrit_checkwould answern/a, is an error here.fixline for a misspelt name, and a pointer to its guide topic. Codes are assigned in one table (diagnose.ml), and a test proves each code's wrong example still raises it. One error per file: the front ends stop at the first.max_situations(default 200000, at most 2000000) andtimeout_ms(default 60000). A search that is cut off returnsE_STATE_LIMITwith how far it got, the bound, every property marked undecided, and the cells that grew most.writ_comparenow ends with the properties still failing in both models, so a fix that fixed nothing doesn't look clean.n/aas a finding, aswrit checknow does.Breaking
A transition clause other than
whenordois now an error. A bare(set …)outside(do …)used to be dropped silently, leaving a move that changed nothing. None of the 70 models across writ, writ-problems, writ-arch and writ-scheduling-verification has one.Also
docs/interrogator.md§2'scan-reachbase case lacked(situation S);holdsdoes not bind its situation, so the rule was rejected.Also: report readability and certification
inevitableshows how a run avoids its goal. It printsavoids: the run stops at #Nwhen the run stops, orloop:the shortest cycle back to the stuck situation. Under(fair …)it printsloops among:the situations a fair run circles in.--jsonstill lists every dead end.certifiedno longer suggestsn/aclaims were checked. When every property isn/aand no query was asked, the line readscertified: the situation count only — every property is n/a, so no claim was checked. This applies to bothwrit checkandwrit_check.--jsonor the certificate format, sowrit-certneeds no change.SKILL.mdmentionswrit_guideandwrit_validatefor servers that list them. It still reads correctly against the pinned 0.4.0 image.Testing
make build,make lintandmake testpass.test_mcp_authoringhas 231 checks: it re-runs every guide example against its printed output, and every error code's wrong and right example.test_report_jsoncovers then/acertified line.make downstream: all six suites pass (problems, crosscheck, arch, scheduling, mgtt2writ, vscode) withPROBLEMS_REF=queens-count-from-json. Merge queens: count complete boards from --json writ-problems#15 first. Its queens check counted the complete boards in the text dead-end list, which this PR now cuts off at 20.🤖 Generated with Claude Code