docs(proposal): project brain, with the brief's assumptions verified - #372
Merged
Conversation
Response to mendixlabs#1017, which asks for a proposal and for its four stated assumptions to be checked against the codebase rather than trusted. All four needed amending and one is wrong outright. - Documentation via MDL: available for domain-model objects via doc comments and ALTER … SET DOCUMENTATION, but uneven — `create … comment` was a dead option on seven doctypes and was removed rather than wired. Phase 3 now opens with a per-doctype audit. - The catalog: the objects view unions 43 document types with a QualifiedName, and resolution measured at 0.038 ms on a real 382-object project, so speed should not shape the design. Two caveats do: the view indexes only describable types, so a missing anchor is not proof of staleness, and member-level anchors need attributes_data. - Starlark: rules are discovered from files, so a generated rule is just a generated file and no engine work is needed — but `mxcli init` writes into the same directory, so generated rules need a reserved prefix. - Release mechanics: THERE IS NO GORELEASER. Releases run `make release`; skills ship by go:embed from cmd/mxcli/skills, mirrored with rsync --delete from .claude/skills/mendix. The proposal also brings evidence from mxcli's own store of this shape — the bug findings and their wiki digest — because it has already failed in four ways reachable from the brief as written: it grew past being readable, its digest went three months without a trigger, append-only plus merge=union produced 256 silent duplicates that are on main right now, and claims about the mechanism (including "it runs in CI") went stale. Those failures argue for the brief's caps and human-in-the-loop promote, not against the feature. Three open questions are recorded rather than answered, including that THEORY.md — which the issue says to read and update — does not exist anywhere in the repository. No implementation. The issue asks for review before code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two corrections from review, and a measurement that changes a
conclusion.
**Audience.** The proposal conflated two stores. The bug findings and
their wiki digest are for developing mxcli itself — a Go repo, many
parallel agent sessions, hundreds of entries. This brain is for USERS of
mxcli, in their own Mendix project: one developer and their agent, tens
of lines, reviewed by someone who may never see mxcli's source. Stated
up front now, and §3 is reframed as an analogy with the differences
named rather than as a precedent. Three of its failures transfer
(unbounded growth, an untriggered curation step, stale self-reported
claims); the duplicate-merge one does not, and the earlier draft
over-weighted it.
**Documentation.** `create … comment` was removed BECAUSE javadoc-style
comments exist and reach the .mpr — not because the capability was
missing. Verified: a /** … */ header on a microflow and on an entity
lands in the stored .mxunit and comes back through DESCRIBE. Wired at 28
sites across mdl/visitor. The earlier draft drew the wrong inference
from the removal.
But testing the next question found worse: a rewrite DESTROYS it.
microflow doc entity doc
after create PRESENT PRESENT
after replace mf ABSENT PRESENT <- control holds
after modify entity ABSENT ABSENT
Each rewrite destroys its own object's documentation and leaves the
other alone, and mx check is clean throughout because a document with no
documentation is valid. So a statement that says nothing about
documentation silently deletes whatever was promoted there. Tier 1 —
the strongest idea in the brief — is blocked until mxcli's writers
preserve documentation they do not restate, which is a writer fix and
belongs in its own issue.
The first version of that test chained `&& echo SURVIVED` to `head -1`,
which exits 0 on empty input, and reported success regardless of what
grep found. Recorded in the proposal, because it is the same shape as
the failures §3 catalogues.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Filed as mendixlabs#1018. Also records the second control found while writing the repro: ALTER ENTITY … ADD ATTRIBUTE preserves the doc comment, which localises the defect to the rewrite paths and gives users a workaround today. Co-Authored-By: Claude Opus 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 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.
Response to
mendixlabs/mxcli#1017, which asks for a proposal indocs/11-proposals/, for the brief's assumptions to be checked against the codebase rather than trusted, and for implementation to wait for review. No code here.The four assumptions — all four needed amending, one is wrong
1. Can MDL write
Documentation? Partly. Doc comments andALTER ENTITY … SET DOCUMENTATIONwork for domain-model objects, but the surface is uneven — and there is a recorded finding thatcreate … comment 'text'was accepted and wrote nothing on seven doctypes, and was removed rather than wired. Phase 3 now opens with a per-doctype audit.2. What does the catalog give us, and how fast? Everything needed, for free. The
objectsview unions 43 document types with aQualifiedName. Measured on a real project (382 objects, 1.6 MB catalog):Speed should not shape the design. Two caveats that should: the view indexes only describable types — so a missing anchor is not proof of staleness, and
checkneeds a third state — and member-level anchors (@Mod.Entity.Attr) needattributes_data, a second query.3. Starlark rules generated at runtime? The question doesn't arise. Rules are discovered from
.claude/lint-rules/*.starby walking up, so a generated rule is just a generated file — no engine work. The hazard the brief misses is thatmxcli initwrites bundled rules into that same directory, so generated ones need a reserved filename prefix and ID namespace.4. Release and skill mechanics? There is no goreleaser. No
.goreleaser.ymlexists; releases runmake release. Skills ship via//go:embed all:skillsfromcmd/mxcli/skills/, mirrored from.claude/skills/mendix/withrsync --delete— so the embed directory must never be edited directly.Evidence from mxcli's own store of this shape
The proposal's §3 is the part I'd most want reviewed. mxcli already runs a store of exactly this design — the bug findings and their
docs-wiki/bug-patterns/digest — and it has failed in four ways all reachable from the brief as written:merge=unionproduced silent duplicates —maincurrently holds 885 records of which 629 are distinct; the executor shard is essentially the same 247 findings twice;None of that argues against the feature. It argues that the parts of the brief that look like restraint — the caps, no auto-promotion, promote-only-through-a-human — are the parts carrying the design, and the plumbing is where it will fail. Seven amendments (A1–A7) are each traced back to one of these findings or to §2.
Open questions, recorded not answered
brain check --cicost on a cold clone? Catalog validity is an.mprmtime comparison that a fresh checkout always fails.docs/the right home when a project already has one that isn't ours?THEORY.mddoes not exist anywhere in the repository — the issue says to read it and to update it if the working theory changes.🤖 Generated with Claude Code