Skip to content

docs(proposal): project brain, with the brief's assumptions verified - #372

Merged
ako merged 3 commits into
mainfrom
docs/proposal-project-brain
Sep 1, 2026
Merged

docs(proposal): project brain, with the brief's assumptions verified#372
ako merged 3 commits into
mainfrom
docs/proposal-project-brain

Conversation

@ako

@ako ako commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Response to mendixlabs/mxcli#1017, which asks for a proposal in docs/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 and ALTER ENTITY … SET DOCUMENTATION work for domain-model objects, but the surface is uneven — and there is a recorded finding that create … 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 objects view unions 43 document types with a QualifiedName. Measured on a real project (382 objects, 1.6 MB catalog):

resolve one anchor: 0.038 ms   (mean of 1000)

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 check needs a third state — and member-level anchors (@Mod.Entity.Attr) need attributes_data, a second query.

3. Starlark rules generated at runtime? The question doesn't arise. Rules are discovered from .claude/lint-rules/*.star by walking up, so a generated rule is just a generated file — no engine work. The hazard the brief misses is that mxcli init writes 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.yml exists; releases run make release. Skills ship via //go:embed all:skills from cmd/mxcli/skills/, mirrored from .claude/skills/mendix/ with rsync --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:

  • it grew past being readable — 1.05 MB / 630 rows, and the instruction to read it before diagnosing was unfollowable for months, because an unread file has no failure mode;
  • the digest nothing triggered stopped — three pages written on one day in May, none re-synced for three months while the corpus grew 200×;
  • append-only + merge=union produced silent duplicatesmain currently holds 885 records of which 629 are distinct; the executor shard is essentially the same 247 findings twice;
  • claims about the mechanism went stale, including a README and a PR body that both said the check ran in CI when it did not.

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

  1. What does brain check --ci cost on a cold clone? Catalog validity is an .mpr mtime comparison that a fresh checkout always fails.
  2. Is docs/ the right home when a project already has one that isn't ours?
  3. THEORY.md does 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

ako and others added 3 commits September 1, 2026 20:45
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>
@ako
ako merged commit 00da58b into main Sep 1, 2026
13 of 14 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.

1 participant