Skip to content

feat(agent-context): teach semantic modelling of custom vocabulary - #654

Merged
dmealing merged 2 commits into
mainfrom
fm/mo-semantic-modelling-guide
Nov 25, 2026
Merged

dmealing merged 2 commits into
mainfrom
fm/mo-semantic-modelling-guide

Conversation

@dmealing

@dmealing dmealing commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Adds docs/features/semantic-modelling.md, which sets the three-tier rule for custom vocabulary: a type holds what a thing is and how it relates, a subtype adds kinds with attributes and constraints but never a relationship, and products, versions, steps and environment values stay in the generators and their configuration. It gives the ordered test for where a fact goes, worked examples and common wrong turns. Links to it from the downstream-decisions, extending-with-providers and docs index pages, and the abstracts-and-inheritance page gains a note on how a child replaces an inherited child of the same type and name.
  • Adds references/semantic-modelling.md to the metaobjects-authoring skill, which opens it when custom vocabulary is added or changed. Each provider reference and the authoring and codegen skills point to it, and the always-on template gains one sentence on the vocabulary rule and the skill's trigger text.
  • Regenerates the shipped agent-context (server/python/src/metaobjects/agent_context/shipped/) and the conformance fixtures so downstream projects get the new text through meta init and meta agent-docs. Adds 12 skill-trigger eval cases for metaobjects-authoring and a changelog fragment.

Notes

  • Known gap, not changed here. The preview systems pack still records @engine and @version on resource.database, which the new page's rule excludes from the model. Pack changes were out of scope for this change; the resource redesign under study will remove them. The page says in its "About the examples" note that packs are preview and that it states the rule new vocabulary is held to.
  • Trigger cases. The 12 new metaobjects-authoring cases were run once each with agent-context/evals/run-skill-triggers.sh <out-dir> --eval-dir evals/metaobjects-authoring --runs 1 on a subscription login: 12 of 12 passed. That run also confirms the --eval-dir flag the Document step could not verify offline. The cases grade skill selection only, so the "LLM behaviour" row below stays untested.
  • Pipeline. One no-mistakes run.
Validation

Risk Assessment

✅ Low: Docs, skill text, eval cases and regenerated shipped copies only; no runtime code changed. Fixture, shipped and Python copies match the source, the child-replacement claim matches the loader, and the guide covers the intent's tiers, layered config, things-not-actions, abstract base and cover-then-improve principles.

Testing

Change is docs and agent-context content, but its runtime surface is meta agent-docs, which downstream projects run to install the skills. Drove that live in a disposable project under DEV_SCRATCH: the guide and its skill routing installed, the always-on vocabulary sentence landed, a deleted guide was restored byte-identical on re-run, and the Python-embedded shipped copy matched the install. All three scenarios pass with live evidence. Not run: the 12 skill-trigger evals under agent-context/evals, which call a model and need the maintainer's spend approval, so whether an agent actually opens the guide on custom-vocabulary tasks is untested. Scratch project removed. Overall: pass.

  • Live validation: ✅ go - 4 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Downstream project gets the semantic-modelling guide and skill routing on meta agent-docs ✅ pass live Ran meta agent-docs --server typescript --client react (cli from source via bun) in a fresh git repo under $DEV_SCRATCH; exit 0, 56 files; references/semantic-modelling.md installed; SKILL.md line 4…
Always-on vocabulary rule reaches an installed project ✅ pass live .metaobjects/AGENTS.md line 83 in the installed project reads 'Vocabulary of your own says what a thing is and relates to, never a product, a version or a step.'
Existing project takes the new guide on re-run of agent-docs (adversarial: guide deleted first) ✅ pass live Deleted installed references/semantic-modelling.md, re-ran agent-docs: output '(1 files)', exit 0; restored file cmp-identical to the first install, sha256 1feef7a3...2169 matching .metaobjects/.agent…
Python-embedded shipped copy matches the TypeScript install ✅ pass live cmp server/python/src/metaobjects/agent_context/shipped/files/1feef7a3029f5727.md against the installed guide: identical.
Agent opens the guide and models a custom type without transcribing a product, version or environment value (LLM behaviour) ⏸️ untested no Needs live model calls through agent-context/evals/run-skill-triggers.sh; that is metered or quota spend and needs the maintainer's approval before running. Deterministic checks cannot prove model behaviour. To…
Evidence: Live install transcript and hash checks
Scenario 1 (downstream install ships the guide + skill pointer):
  bun server/typescript/packages/cli/bin/meta.ts agent-docs --server typescript --client react   (in fresh git repo under $DEV_SCRATCH)
  -> "Scaffolded the MetaObjects agent context (56 files)" exit 0
  -> .claude/skills/metaobjects-authoring/references/semantic-modelling.md present
  -> SKILL.md line 49 routes custom vocabulary to references/semantic-modelling.md ("open first")
  -> .metaobjects/AGENTS.md line 83: "Vocabulary of your own says what a thing is and relates to, never a product, a version or a step."
  -> sha256 1feef7a3029f5727b8e1d59d243e05b8b0e173f547ce32e908433cda80942169 == .metaobjects/.agent-context.json entry

Scenario 2 (existing project takes new text on re-run):
  rm semantic-modelling.md; re-run agent-docs
  -> "(1 files)" exit 0; restored file cmp-identical to first install, same sha256

Scenario 3 (Python-embedded shipped copy matches downstream install):
  cmp server/python/src/metaobjects/agent_context/shipped/files/1feef7a3029f5727.md <installed guide> -> identical

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Downstream project gets the semantic-modelling guide and skill routing on meta agent-docs ✅ pass live Ran meta agent-docs --server typescript --client react (cli from source via bun) in a fresh git repo under $DEV_SCRATCH; exit 0, 56 files; references/semantic-modelling.md installed; SKILL.md line 4…
Always-on vocabulary rule reaches an installed project ✅ pass live .metaobjects/AGENTS.md line 83 in the installed project reads 'Vocabulary of your own says what a thing is and relates to, never a product, a version or a step.'
Existing project takes the new guide on re-run of agent-docs (adversarial: guide deleted first) ✅ pass live Deleted installed references/semantic-modelling.md, re-ran agent-docs: output '(1 files)', exit 0; restored file cmp-identical to the first install, sha256 1feef7a3...2169 matching .metaobjects/.agent…
Python-embedded shipped copy matches the TypeScript install ✅ pass live cmp server/python/src/metaobjects/agent_context/shipped/files/1feef7a3029f5727.md against the installed guide: identical.
Agent opens the guide and models a custom type without transcribing a product, version or environment value (LLM behaviour) ⏸️ untested no Needs live model calls through agent-context/evals/run-skill-triggers.sh; that is metered or quota spend and needs the maintainer's approval before running. Deterministic checks cannot prove model behaviour. To…
  • scripts/ci-local.sh --affected --strict-toolchains
  • Baseline (already passed): scripts/ci-local.sh --affected --strict-toolchains at target commit 3aebf3ca11 (not re-run; no source changes this turn)
  • bun server/typescript/packages/cli/bin/meta.ts agent-docs --server typescript --client react in a fresh git repo under $DEV_SCRATCH (exit 0, 56 files)
  • Grep of installed SKILL.md and .metaobjects/AGENTS.md for the semantic-modelling routing line and the new always-on vocabulary sentence
  • sha256sum of installed references/semantic-modelling.md vs .metaobjects/.agent-context.json entry
  • Delete installed guide, re-run meta agent-docs, cmp against first install (restore, byte-identical)
  • cmp of server/python/src/metaobjects/agent_context/shipped/files/1feef7a3029f5727.md vs installed guide
  • git status in worktree after run: clean
⚠️ **Document** - 2 infos
  • ℹ️ Semantic-modelling guidance exists twice in prose: docs/features/semantic-modelling.md (376 lines, repo docs) and agent-context/skills/metaobjects-authoring/references/semantic-modelling.md (210 lines, shipped to downstream apps). The intent requires both surfaces, since a shipped skill must be self-contained. Follow-up: generate the skill reference from one owner, or cut the repo page to a pointer, so the two cannot drift. Out of scope for this change.
  • ℹ️ Could not verify offline that claude plugin eval accepts --eval-dir evals/&lt;skill&gt;, as agent-context/evals/README.md and the run-skill-triggers.sh comment state. Needs one manual run of agent-context/evals/run-skill-triggers.sh (costs subscription quota) to confirm the flag.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Add docs/features/semantic-modelling.md: how to shape a type, subtype or
attribute of your own. The type says what a thing is and what it relates to,
the subtype says which kind (attributes and constraints, never a new
relationship), and products, versions, steps and environment values belong to
the generators and their layered configuration. The page gives the ordered
test for where one fact goes, things-not-actions, abstract base plus variants,
the coverage rule for generated output, worked before and after examples, and
the wrong turns an AI assistant makes.

The metaobjects-authoring skill carries the same guidance as
references/semantic-modelling.md; its SKILL.md and description send an agent
there whenever custom vocabulary is added or changed, and the always-on file
gains one rule. Twelve trigger cases cover the new part of the skill, and the
evals README now says how to run one skill's cases (--eval-dir; a --case glob
with a path in it matches nothing).

Regenerated: agent-context-shipped, the Python copy, and the
agent-context-conformance fixtures.
- A reused attribute name resolves nothing by itself: the worked example now
  says the provider declares the reference, and the skill reference says so too.
- State the extends rule exactly (a child replaces an inherited child of the
  same type and name) and give it an owner in abstracts-and-inheritance.md.
- Trim the worked example and the wrong-turns table to what each teaches once.
- Fold the always-on rule into the neighbouring vocabulary rule, cut the
  repeated pointers in the authoring SKILL.md, and tie its description to
  putting something into the metadata.
- Point the five per-language provider pages, the codegen skill and the audit
  skill's vocabulary check at the new reference.
- Say in the evals README what the authoring cases grade.
@dmealing
dmealing merged commit 573a652 into main Nov 25, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-semantic-modelling-guide branch November 25, 2026 11:47
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