Skip to content

OKF Conformance Enforced as a Tested CI Invariant

ADR-012: OKF Conformance Enforced as a Tested CI Invariant

Section titled “ADR-012: OKF Conformance Enforced as a Tested CI Invariant”

Accepted

ADR-009 commits MIF to being a strict superset of a conformant OKF v0.1 bundle, and ADR-011 makes Markdown canonical with the JSON-LD form a derived projection. Both claims are only credible if they are mechanically verified: a prose assertion that “every MIF bundle is a valid OKF bundle” or “the projection is lossless” decays the moment an example drifts.

This decision records how those guarantees are enforced — the validation suite and the CI gating that runs it — including the path/branch triggers that determine whether the suite actually runs on a given pull request.

  • A conformance claim that is not executed in CI silently rots as examples, schemas, and ontologies evolve.
  • The validation workflow originally triggered only a narrow set of paths (docs/okf-conformance.md) and base branches (main), so changes to docs, the Astro site, ontologies, or PRs targeting release/development branches could merge without the conformance suite running.
  1. Enforcement: OKF conformance and lossless round-trip must be gating, not advisory.
  2. Coverage: Every bundle that ships (core examples, the AI-memory profile, ontology example memories) must be validated.
  3. Trigger correctness: The suite must actually run on the branches that v1.0.0 work targets.
  1. Schema fidelity: The derived JSON-LD must validate against the published schema.
  2. Site integrity: The documentation site must build.

Option 1: Document conformance, verify manually

Section titled “Option 1: Document conformance, verify manually”

Description: State the conformance rules in prose; rely on contributors to run the validators by hand.

Advantages:

  • No CI cost.

Disadvantages:

  • Conformance drifts undetected; the central claim of ADR-009 becomes unverifiable in practice.

Risk Assessment:

  • Technical Risk: High. Regressions ship unnoticed.

Option 2: Enforce conformance as gating CI checks (chosen)

Section titled “Option 2: Enforce conformance as gating CI checks (chosen)”

Description: Run the conformance test, the lossless round-trip, JSON-LD schema validation, ontology/namespace validation, and the docs build as required CI jobs across all three relevant bundle sets, triggered on the paths and base branches that v1.0.0 work uses.

Advantages:

  • The ADR-009 / ADR-011 invariants become tested properties.
  • Regressions block the merge.

Disadvantages:

  • CI runtime and maintenance of the workflow.

Risk Assessment:

  • Technical Risk: Low. Deterministic Python + ajv checks.
  • Schedule Risk: Low. Seconds of CI per run.

OKF conformance is enforced by .github/workflows/validate.yml as gating jobs:

  1. okf-conformancescripts/okf_validate.py enforces type-present, no reserved-filename concepts, relationship synchronization, broken-links tolerated; followed by the lossless markdown → json-ld → markdown round-trip (scripts/mif_convert.py roundtrip).
  2. schema-validation — emits derived JSON-LD projections and validates each against schema/mif.schema.json with ajv (draft 2020-12, ajv-formats).
  3. docs-build — builds the Astro documentation site.
  4. validate-ontologies — validates ontology files and namespace consistency.

All bundle sets — examples, profiles/ai-memory/examples, and ontologies/examples/memories — are passed to the conformance, round-trip, and schema jobs.

The workflow triggers on the source paths that affect conformance (schema/**, examples/**, profiles/**, ontologies/**, scripts/*.py, docs/**, src/content/docs/**, package.json, astro.config.mjs) and runs on pull requests targeting main, release/**, and develop/** so v1.0.0 integration branches are gated.

  1. Verified invariants: ADR-009’s superset claim and ADR-011’s lossless projection are CI-enforced.
  2. Full bundle coverage: Core, profile, and ontology example bundles are all validated.
  3. Correct gating: PRs to development/release integration branches run the suite.
  1. CI maintenance: The workflow must track new bundle directories and tooling.
  1. Derived artifacts: JSON-LD projections are emitted into a gitignored dist/ during validation, not committed from this job.

Conformance is now a gating property rather than a promise. A regression in any bundle, the schema, an ontology, a namespace, or the docs site fails the merge. Mitigation for trigger gaps: the pull_request.branches list explicitly includes develop/** (in addition to main and release/**) so PRs retargeted onto the v1.0.0 development branch are not silently un-gated.

  • Date: 2026-06-18
  • Source: .github/workflows/validate.yml; docs/okf-conformance.md §3 (the conformance test).
  • Related ADRs: ADR-009, ADR-011, ADR-002

Status: Compliant

Findings:

FindingFilesLinesAssessment
PR trigger includes main, release/**, and develop/**.github/workflows/validate.ymlL18compliant
okf-conformance job runs okf_validate.py (relationship sync) + lossless round-trip over all three bundle sets.github/workflows/validate.ymlL46-L58compliant
schema-validation job emits projections and validates against schema/mif.schema.json via ajv.github/workflows/validate.ymlL82-L99compliant
docs-build job builds the Astro site.github/workflows/validate.ymlL101-L116compliant
validate-ontologies job validates ontology files and namespace consistency.github/workflows/validate.ymlL118-L136compliant
Validator enforces type/reserved-filename/relationship-sync/round-tripscripts/okf_validate.pyL7-L16compliant
Schema $id resolves to the published mif-spec.dev URIschema/mif.schema.jsonL3compliant
Conformance test documented (validator + round-trip, exit 0 = conform)docs/okf-conformance.mdL69-L93compliant

Summary: The conformance, round-trip, schema, ontology/namespace, and docs jobs are present and gating; the PR branch filter covers develop/** so v1.0.0 integration PRs are validated. All cited anchors were opened and confirmed in this session, and the suite was run locally to green.

Action Required: None.