Skip to content

docs: document items catalogues in pattern authoring and user guides - #3114

Draft
YoofiTT96 wants to merge 18 commits into
finos:mainfrom
YoofiTT96:docs/2859-items-documentation
Draft

YoofiTT96 wants to merge 18 commits into
finos:mainfrom
YoofiTT96:docs/2859-items-documentation

Conversation

@YoofiTT96

Copy link
Copy Markdown
Member

Description

A pattern may declare nodes and relationships under items as well as prefixItems. None of the documentation said so. The agent authoring guide described prefixItems in sixteen places and never mentioned items, so an agent following it could only write patterns where every declared element is built. The two user-facing pages taught the positional model alone.

This is the documentation half of #2859, and it lands last so the guidance is never ahead of the tooling.

Part of #2859.

PR sequence

Six stacked PRs, each reviewable alone, in this order:

PR Scope
1 #3059 prefixItems alternatives — the pre-existing gaps that had to be fixed first
2 #3060 items in pattern validation
3 #3103 items in generation
4 #3110 items in the pattern diagram
5 #3112 items in the pattern differ
6 #3113 items in the VS Code pattern picker
7 this documentation

GitHub will not let a cross-fork PR target a branch in my fork, so all of them sit on main and each diff carries the ones below it. The commits to review here are the last two.

What the authoring guide gains

A worked catalogue example, a table that chooses between the two declaration sites by obligation rather than by how many candidates there are, and the four rules items carries — a member must sit inside oneOf/anyOf, maxItems must leave room, two members that can coexist may not share ids the way two alternatives of one entry may, and items cannot cap how many times one member is used. It also states that a decision stays in relationships.prefixItems.

The example is not hand-written prose. I extracted the JSON from the file, wrapped it in a minimal pattern and ran calm validate (no errors) and calm generate (builds the positional node, correctly omits the unselected catalogue members).

What the user documentation gains

A list entry and a bullet in core-concepts/patterns.md, two table rows and a learning objective in the patterns tutorial. Both are deliberately light — the full contract lives in PATTERN-DECISIONS.md.

One correction beyond adding items: the tutorial said an architecture satisfying a pattern "is free to add extra nodes, relationships, interfaces, and metadata". That stops being true once a pattern declares items, which constrains what those extras may be.

Gotcha

docs(calm-ai) triggers a CLI patch releasecli/.releaserc.json carries release rules for the calm-ai scope. Commitlint also warns on that scope, because calm-ai is missing from its scope-enum while the release config has seven rules for it. Both are pre-existing config inconsistencies, not introduced here.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

No code changes.

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Server (calm-server/)
  • CALM Widgets (calm-widgets/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

docs(calm-ai): document items catalogues in the pattern authoring guide
docs: describe items catalogues in the pattern documentation

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

The documented example was validated and generated with the CLI, as above. The Docusaurus site builds clean.

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

🤖 Generated with Claude Code

A catalogue member was invisible to calm diff. Adding or removing one
reported no change at all, and hasChanges stayed false, so
calm diff --exit-code passed. An unchanged member appeared in no bucket,
so the Hub painted it with no diff status.

The catalogue is a choice block, so it is read as one more declaration
source and expandAlternatives flattens it into the existing partition.
Members land in the buckets that already exist. No new buckets, no change
to NodeChange or hasChanges.

An items schema that declares a node directly is not read, matching
validation and the pattern renderer.

The allOf traversal was written for prefixItems only, so it becomes
findField, which takes what the caller is after.

Reporting a change in obligation is out of scope and filed as finos#3111. It
reproduces on main with no items involved.
The guide described prefixItems in sixteen places and never mentioned
items, so an agent following it could only write patterns where every
declared element is built.

Adds a worked catalogue example, a table choosing between the two sites
by obligation, the four rules items carries, and the requirement that a
decision stays in relationships prefixItems.
Both pages taught the positional model only. Neither mentioned that a
pattern can list candidates an architecture may add.
@github-actions github-actions Bot added cli Affects `cli` code shared calm-hub-ui Affects `calm-hub-ui` docs Improvements of additions to documentation labels Sep 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calm-hub-ui Affects `calm-hub-ui` cli Affects `cli` code docs Improvements of additions to documentation shared

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant