Skip to content

semantic: add repo ontology starter pack#11

Merged
mdheller merged 4 commits intomainfrom
semantic/repo-ontology-starter-20260409
Apr 9, 2026
Merged

semantic: add repo ontology starter pack#11
mdheller merged 4 commits intomainfrom
semantic/repo-ontology-starter-20260409

Conversation

@mdheller
Copy link
Copy Markdown
Contributor

@mdheller mdheller commented Apr 9, 2026

Summary

Adds the first machine-readable repo-topology starter pack for the SourceOS / AgentOS lane.

This PR introduces:

  • a shared JSON-LD context for repo descriptors
  • a starter role vocabulary / ontology graph
  • a JSON Schema for repo descriptors
  • a guide for downstream repo adoption
  • example descriptors for the current controller / spine / conformance / substrate / commons / public-surface lanes

Why

The README topology work made the role map legible to humans. This PR makes it legible to machines.

The intended next step is for each core repo to publish a semantic/repo.jsonld descriptor that references this shared vocabulary instead of redefining its own ontology.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39665357a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread semantic/context.jsonld
"hydra": "http://www.w3.org/ns/hydra/core#",
"prov": "http://www.w3.org/ns/prov#",
"@version": 1.1,
"srcos": "urn:sourceos:repo-ontology:",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve existing type mappings in semantic context

Repointing srcos to urn:sourceos:repo-ontology: here effectively replaces the prior https://schemas.srcos.ai/v2/ vocabulary for the same semantic/context.jsonld path, so previously valid JSON-LD documents (for example those using @type: "Dataset" with this shared context) no longer expand to their established IRIs. Because consumers reference this file by URL, changing its semantics in place is a breaking compatibility regression for existing tooling.

Useful? React with 👍 / 👎.

"@graph": [
{
"@id": "rolePlatformWorkspaceController",
"@type": "TopologyRole",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Define TopologyRole as an explicit IRI term

Each ontology node uses @type: "TopologyRole", but TopologyRole is not declared in the loaded context and no @vocab is set, so JSON-LD expansion treats this as a relative IRI tied to the document base URL. That makes the class identifier environment-dependent instead of canonical, which undermines cross-repo reasoning over the role class.

Useful? React with 👍 / 👎.

@mdheller
Copy link
Copy Markdown
Contributor Author

mdheller commented Apr 9, 2026

@copilot fix the failed tests

Copilot AI and others added 2 commits April 9, 2026 10:42
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

@copilot fix the failed tests

Fixed in f0391b1. Two issues were addressed:

  1. Validate JSON-LD: repo-ontology.jsonld uses a string @context reference ("./context.jsonld"), which caused 'str' object has no attribute 'items' when the validator tried to iterate it. Added an isinstance(ctx, dict) guard before calling .items().

  2. Validate JSON Schemas: ajv-cli@5 defaults to draft-07 and couldn't load the https://json-schema.org/draft/2020-12/schema meta-schema used by all schemas in the repo. Fixed by adding --spec=draft2020 to the ajv compile command. Also fixed cross-schema $ref resolution (e.g. AgentSession.jsonExecutionSurface.json) by passing all sibling schemas as -r references when compiling each schema — all 54 schemas now compile cleanly.

@mdheller mdheller merged commit d9eddfc into main Apr 9, 2026
4 checks passed
@mdheller mdheller deleted the semantic/repo-ontology-starter-20260409 branch April 9, 2026 12:15
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.

2 participants