Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ echo " (skip in an emergency with: git push --no-verify)" >&2

# typecheck resolves cross-package types through each dep's dist/, so build first —
# exactly what scripts/ci-local.sh's ts-fast lane does before `typecheck`.
if ! ( cd "$ROOT" && bun run --filter '*' build ) >/tmp/metaobjects-prepush-build.log 2>&1; then
if ! ( cd "$ROOT" && bun run build ) >/tmp/metaobjects-prepush-build.log 2>&1; then
echo "" >&2
echo " ✖ pre-push BLOCKED: workspace build failed. Last lines:" >&2
tail -20 /tmp/metaobjects-prepush-build.log | sed 's/^/ /' >&2
echo " full log: /tmp/metaobjects-prepush-build.log" >&2
exit 1
fi

if ! ( cd "$ROOT" && bun run --filter '*' typecheck ) >/tmp/metaobjects-prepush-tsc.log 2>&1; then
if ! ( cd "$ROOT" && bun run typecheck ) >/tmp/metaobjects-prepush-tsc.log 2>&1; then
echo "" >&2
echo " ✖ pre-push BLOCKED: tsc typecheck is RED. This is the gate CI enforces; do not push red." >&2
echo "" >&2
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/local-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,27 @@ jobs:
export PATH="$HOME/.cargo/bin:$PATH"
scripts/ci-local.sh --only rust --strict-toolchains

# PACKS lane — the independent packs under packs/ (ADR-0069), against main's core.
# Blocking for a pack this push touched; a named non-failing SKIP (the canary) for a
# pack a core change broke. MO_CI_AFFECTED_BASE is the push's `before`, so "touched"
# means this push; on the nightly and on dispatch it is empty and every pack is a
# canary. With no pack under packs/ the lane passes with a note.
packs:
needs: detect
if: contains(needs.detect.outputs.ports, 'ts')
runs-on: [self-hosted, linux]
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # the blocking/canary decision diffs against the push's base
persist-credentials: false
- env:
MO_CI_AFFECTED_BASE: ${{ github.event.before }}
run: scripts/ci-local.sh --only packs --strict-toolchains

notify:
needs: [detect, gates, ts-fast, ts-unit, ts-slow, java-slow, python, csharp, rust]
needs: [detect, gates, ts-fast, ts-unit, ts-slow, java-slow, python, csharp, rust, packs]
if: always() && contains(needs.*.result, 'failure')
runs-on: [self-hosted, linux]
steps:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ name: pr-ci
# WHAT RUNS PER PORT: unit tests plus the conformance corpora, not the docker
# integration suites (integration-tests.yml owns those, on tags and on demand):
# ts — ts-fast (build + typecheck, conformance, completeness) and ts-unit
# (the per-package suites)
# (the per-package suites), plus packs: the independent packs under
# packs/ (ADR-0069), blocking for a pack the PR touches and a canary that
# reports without failing for every other
# java — java-slow: the full reactor build with tests on, which already holds the
# java and kotlin conformance classes
# python / csharp — the port's full test suite and conformance
Expand Down Expand Up @@ -97,7 +99,7 @@ jobs:
strategy:
fail-fast: false
matrix:
lane: [ts-fast, ts-unit]
lane: [ts-fast, ts-unit, packs]
steps:
- uses: actions/checkout@v4
with:
Expand Down
9 changes: 5 additions & 4 deletions .no-mistakes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
# THE SPLIT. `lint` is `--only gates`, the one lane every change runs. `test` is
# `--affected`: it lists what the branch changed against its merge base, maps the paths to
# lanes with scripts/ci-lane-map.txt, prints which lanes it selected, skipped and why, and
# runs only those (ts-fast + ts-unit for a TypeScript or web-client change; java-slow,
# python or csharp for a change confined to that port; every selectable lane for a change
# runs only those (ts-fast + ts-unit, plus the packs lane as a canary, for a TypeScript or
# web-client change; java-slow, python or csharp for a change confined to that port; only
# packs for a change under packs/ (ADR-0069); every selectable lane for a change
# to fixtures, spec, scripts, workflows, agent-context, docs or any path the map does not
# claim; none for a change to only the root README, CHANGELOG, CONTRIBUTING, AGENTS or CLAUDE
# files, which the gates lane covers). Selected lanes run exactly as
Expand All @@ -37,9 +38,9 @@
# reports a false red.
#
# --strict-toolchains closes a SKIP hole, and only that. These selections run two kinds of
# step. The `step_if bun` ones — every step in `ts-fast` and `ts-unit`, and 17 of the 32 in
# step. The `step_if bun` ones — every step in `ts-fast` and `ts-unit`, and 19 of the 36 in
# `gates` — are the hazard: without the flag, a host with no bun on PATH SKIPS them and the
# step still reports GREEN. Strict turns that false green into a loud failure. The other 15
# step still reports GREEN. Strict turns that false green into a loud failure. The other 17
# `gates` steps run under plain `step`, so they were never at risk either way: a missing
# binary just makes the command fail. Most are shell-only (grep/sed — `check-pom-versions.sh`
# and `check-uv-lock-version.sh` are deliberately toolchain-free so they need no lane), but
Expand Down
17 changes: 9 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ It blocks commits whose added lines match (`git commit --no-verify` bypasses, di

**Pre-push typecheck gate** (`.githooks/pre-push`, same `core.hooksPath`): `bun test`
transpiles per-file and does NOT typecheck, so type-broken code can ship green on the
test suite while `bun run --filter '*' typecheck` — the same check `scripts/ci-local.sh`
test suite while `bun run typecheck` — the same check `scripts/ci-local.sh`
runs — goes red, and a direct admin push to `main` bypasses branch protection. This hook closes that hole locally: when a push touches
`server/typescript/` or `client/web/`, it runs that same `bun run --filter '*' build &&
… typecheck` pair and **blocks the push when it is red** (~6s on a clean tree;
`server/typescript/` or `client/web/`, it runs that same `bun run build && bun run
typecheck` pair (the root scripts, which name core's workspace directories so a pack under
`packs/` is never in them — ADR-0069) and **blocks the push when it is red** (~6s on a clean tree;
skipped entirely for non-TS pushes). Bypass in an emergency with `git push --no-verify`
or `SKIP_TS_TYPECHECK=1 git push`.

Expand All @@ -128,8 +129,8 @@ for a TYPED boolean, since `-f` sends the string `"true"` and 422s.)
hosted checks — every check workflow in `.github/workflows/` is a thin wrapper that calls it.
`--quick` covers `hygiene.yml` in full plus the TypeScript half of `conformance.yml`, and the
flagless full run
adds the C#/Java/Kotlin/Python conformance lanes, the Java reactor and `integration-tests.yml`'s
Testcontainers matrix. Run `--quick` before opening a PR and the full script before a tag;
adds the C#/Java/Kotlin/Python conformance lanes, the Java reactor, the `packs` lane (ADR-0069) and
`integration-tests.yml`'s Testcontainers matrix. Run `--quick` before opening a PR and the full script before a tag;
`MO_CI_LIST_ONLY=1 scripts/ci-local.sh [flags]` prints what a selection would run without
running it. The no-mistakes validation gate runs the script for you — see `.no-mistakes.yaml`,
whose `test` command runs `--affected` (only the lanes the change touches, per
Expand Down Expand Up @@ -450,14 +451,14 @@ its own canonical serializer already, so `fmt` runs locally everywhere:

## Running tests

The Bun workspace root is the **repository root** (`/package.json`), which globs `server/typescript/packages/*`, `client/web/packages/*` and the `examples/dynamic-grid` example. Java/Python/C# live outside the JS workspace (not globbed). Run `bun install` **once at the repo root**. Run `bun test` **scoped** — `cd server/typescript && bun test` for the server suite (this also picks up `server/typescript/bunfig.toml`'s test preload), and per-package for `client/web`. **Never run a bare `bun test` at the repo root**: it walks `java/`, `python/`, `csharp/`, and `fixtures/` looking for test files, turning a fast per-package run into many minutes.
The Bun workspace root is the **repository root** (`/package.json`), which globs `server/typescript/packages/*`, `client/web/packages/*`, the `examples/dynamic-grid` example and `packs/*/typescript` (the independent packs, ADR-0069). Java/Python/C# live outside the JS workspace (not globbed). Run `bun install` **once at the repo root**. Run `bun test` **scoped** — `cd server/typescript && bun test` for the server suite (this also picks up `server/typescript/bunfig.toml`'s test preload), and per-package for `client/web`. **Never run a bare `bun test` at the repo root**: it walks `java/`, `python/`, `csharp/`, `packs/`, and `fixtures/` looking for test files, turning a fast per-package run into many minutes.

```
bun install # once, at the repo root
cd server/typescript && bun test # server suite (per-package; a bare run over the whole server suite now exceeds 5 min — scope it)
cd client/web/packages/<pkg> && bun test # a single client package
bun run --filter '*' typecheck # whole workspace, from repo root
bun run --filter '*' build # whole workspace, from repo root
bun run typecheck # core's workspace (not packs/), from repo root
bun run build # core's workspace (not packs/), from repo root
```

## How to contribute
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ four `rules.*` and `verify.lifecycle.unreachable` settings, held to `fixtures/ru
## [1.3.0] — unreleased


_npm `1.3.0` (full lockstep across all 14 `@metaobjectsdev/*` publish candidates)._
_npm `1.3.0` (full lockstep across all 13 `@metaobjectsdev/*` publish candidates)._

**New metamodel vocabulary, experimental: `api.*`, `operation.*`, `binding.*` and `transition.*`
(ADR-0066).** It is additive: nothing that loaded before stops loading. This vocabulary ships in
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ merge base with the base branch (committed, uncommitted and untracked), maps eac
with the table in [`scripts/ci-lane-map.txt`](scripts/ci-lane-map.txt), and prints the lanes it
selected, the lanes it skipped and the rule each path matched, so a reviewer can see what was
not run. A change confined to one port runs that port (`ts-fast` and `ts-unit` for TypeScript
and the web client, `java-slow`, `python`, `csharp`); a change to `fixtures/`, `spec/`,
and the web client, plus the `packs` lane as a canary, `java-slow`, `python`, `csharp`); a change
to an independent pack under `packs/` runs only `packs` (ADR-0069); a change to `fixtures/`, `spec/`,
`scripts/` (the map included), `.github/`, `agent-context/`, anything under `docs/` (port
tests read those pages) or any path no rule claims runs every lane, because unknown means
full; a change to only the root `README.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, `AGENTS.md`
Expand Down
13 changes: 13 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ MetaObjects, in the way the [`library/`](library/) entries do (see
which provider registers the attribute. It does not rename it or change what it does, so a
model that used the attribute under the pack loads and behaves the same once core owns it.

A pack in this repository is one of two kinds
([ADR-0069](spec/decisions/ADR-0069-independent-packs.md)). A **bundled pack** (`db`, `rules`,
`reporting`, `requirements` and the others) ships inside each port's core package, is in the
default bundle and in `expected-registry.json`, and moves with core's version. An **independent
pack** lives in [`packs/<name>/`](packs/README.md), is outside the default bundle, has its own
version and changelog, and is carried only by the ports its `pack.json` lists. Metamodel N.M
names the default bundle only. A pack may depend on core; core never depends on a pack, and the
`gates` lane fails a change that makes it. A new independent pack starts at `0.1.0` `preview` and
stays unpublished until an estate project runs it with the drift gate enforced. Because they are
the rulings this rests on, changing the kinds, the one-way dependency or the naming rule is a
model-format and compatibility change, and so needs a core maintainer. Building a pack inside
those rules does not.

### Releases

The core maintainers decide when a release happens, what version it carries, and what goes in
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ maintainer. Every area is open.
| Metamodel spec and conformance corpora (core-maintainer approval always applies) | `spec/`, `fixtures/` | Maintainer wanted |
| Documentation and the docs-site generator | `docs/`, `server/typescript/packages/docs-site/` | Maintainer wanted |
| Libraries (`ai`, `iam`) | `library/` | Maintainer wanted |
| Independent packs (each pack its own area once it has a maintainer; [ADR-0069](spec/decisions/ADR-0069-independent-packs.md)) | `packs/` | Maintainer wanted |
| Agent context (skills, `AGENTS.md` sources, `llms.txt`) | `agent-context/` | Maintainer wanted |
| CI and release tooling | `scripts/`, `.github/` | Maintainer wanted |

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ metaobjects/
├── library/ # shipped libraries, opt-in per project via `libraries: [...]`
│ ├── ai/ # the LLM-call trace envelope (stable)
│ └── iam/ # users, groups, roles, grants (preview)
├── packs/ # independent packs, outside the default bundle, each with its
│ # own version (ADR-0069; none shipped yet)
├── templates/ # canonical api/docs Mustache templates (the SSOT the
│ # ports embed; byte-gated so copies cannot drift)
├── agent-context/ # the shared source the per-port AI-assistant context
Expand Down
13 changes: 13 additions & 0 deletions changelog.d/independent-packs-skeleton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- **Independent packs: the `packs/` directory, its gates and its lane (ADR-0069).** A capability
that is not core vocabulary can now be built in `packs/<name>/` with its own version, changelog
and port list, outside the default bundle and outside `metamodelVersion`. No pack exists yet,
and nothing published changes. `scripts/check-pack-boundary.ts` fails a change that makes core
depend on a pack, puts a pack in the bundle, or lets core's release tooling see `packs/`.
`scripts/check-pack-manifests.ts` holds each `pack.json` to its ports' native manifests.
`scripts/pack-vocabulary.ts` pins the rows a pack adds and fails one that changes the bundle's,
and `scripts/pack-conformance.ts` runs a pack's load fixtures through the new corpus-root entry
point `runCorpus` in `@metaobjectsdev/conformance`. A new `packs` lane in `ci-local.sh` blocks
for a pack's own change and reports, without failing, a pack that a core change breaks. The
root `build` and `typecheck` scripts now name core's workspace directories instead of
`--filter '*'`. The provider contract is now named as covered by core's package version
(`docs/compatibility-policy.md`).
13 changes: 13 additions & 0 deletions docs/CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,19 @@ unit-test runners (`bun test`, `dotnet test`, `pytest`, `mvn test`) pull Docker.
`scripts/integration-test.sh` is the entry point and is wired into
[`docs/RELEASING.md`](RELEASING.md) §2b as the pre-`latest` gate.

### Independent packs: their own corpora, outside these counts

An independent pack ([ADR-0069](../spec/decisions/ADR-0069-independent-packs.md)) keeps its tests
in `packs/<name>/fixtures/`, never in `fixtures/`, so pack work moves none of the totals, rows or
matrix cells on this page. Each pack has a pinned vocabulary
(`packs/<name>/fixtures/expected-vocabulary.json`, the rows it adds to the default bundle, which
every port that carries the pack byte-matches) and load fixtures in the shared format
(`packs/<name>/fixtures/conformance/`), run in TypeScript through the corpus-root entry point
`runCorpus` of `@metaobjectsdev/conformance`. The `packs` lane runs them, blocking for the
pack's own change and as a canary on core changes. The port rule differs from the bundle's here,
and only here: a port either carries the pack's provider and passes its whole corpus, or does not
carry it, and a model that uses it fails there by name. There is no row per pack on this page.

## Fixture-to-doc mapping

### `fixtures/conformance/` — metamodel loader + canonical serializer (584)
Expand Down
Loading
Loading