github-agent 2.4.15__py3-none-any.whl → 2.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. github_agent/__init__.py +11 -3
  2. github_agent/api/api_client_dependabot.py +2 -0
  3. github_agent/api/api_client_orgs.py +4 -4
  4. github_agent/api/api_client_pages.py +2 -2
  5. github_agent/api/api_client_pulls.py +2 -0
  6. github_agent/auth.py +0 -10
  7. github_agent/connector_sources.py +5 -5
  8. github_agent/kg_ingest.py +17 -7
  9. github_agent/mcp_server.py +29 -3
  10. github_agent/ontology/__init__.py +1 -1
  11. github_agent/ontology/access_contracts.ttl +40 -0
  12. github_agent/ontology/certification.json +3 -3
  13. github_agent/ontology/github.ttl +60 -61
  14. github_agent/ontology/shapes/connector.shacl.ttl +2 -82
  15. github_agent/skills/github-actions-ci-review/SKILL.md +19 -1
  16. github_agent/skills/github-agent-development/SKILL.md +17 -2
  17. github_agent/skills/github-agent-operations/SKILL.md +19 -1
  18. github_agent/skills/github-backlog-planner/SKILL.md +19 -1
  19. github_agent/skills/github-ci-failure-sweep/SKILL.md +19 -1
  20. github_agent/skills/github-dependabot-review/SKILL.md +19 -1
  21. github_agent/skills/github-issue-tracking/SKILL.md +19 -1
  22. github_agent/skills/github-org-remediation-loop/SKILL.md +19 -1
  23. github_agent/skills/github-pr-review-sweep/SKILL.md +19 -1
  24. github_agent/skills/github-project-provisioner/SKILL.md +16 -0
  25. github_agent/skills/github-pull-request-create/SKILL.md +18 -1
  26. github_agent/skills/github-pull-request-review/SKILL.md +19 -1
  27. github_agent/skills/github-repository-management/SKILL.md +19 -1
  28. github_agent/skills/github-tools/SKILL.md +16 -0
  29. github_agent/skills/github-triage-resolver/SKILL.md +19 -1
  30. {github_agent-2.4.15.dist-info → github_agent-2.5.1.dist-info}/METADATA +116 -121
  31. {github_agent-2.4.15.dist-info → github_agent-2.5.1.dist-info}/RECORD +42 -37
  32. tests/test_access_contracts.py +105 -0
  33. tests/test_cq_paths.py +4 -5
  34. tests/test_destructive_declaration.py +95 -0
  35. tests/test_kg_ingest.py +7 -3
  36. tests/test_ontology_one_schema.py +57 -0
  37. tests/test_ontology_parent_link.py +17 -12
  38. tests/test_scion_sdk_0_10_imports.py +59 -0
  39. {github_agent-2.4.15.dist-info → github_agent-2.5.1.dist-info}/WHEEL +0 -0
  40. {github_agent-2.4.15.dist-info → github_agent-2.5.1.dist-info}/entry_points.txt +0 -0
  41. {github_agent-2.4.15.dist-info → github_agent-2.5.1.dist-info}/licenses/LICENSE +0 -0
  42. {github_agent-2.4.15.dist-info → github_agent-2.5.1.dist-info}/top_level.txt +0 -0
github_agent/__init__.py CHANGED
@@ -3,13 +3,21 @@ from scion_sdk.connector_identity import connector_version
3
3
 
4
4
  from github_agent.api_client import Api
5
5
  from github_agent.auth import get_client
6
- from github_agent.mcp_server import TOOL_REGISTRY
6
+ from github_agent.mcp_server import OWNER_APPROVAL_OPERATIONS, TOOL_REGISTRY
7
7
 
8
8
  __version__ = connector_version("github_agent")
9
9
 
10
10
  connector = Connector(
11
- api=Api,
12
- get_client=get_client,
11
+ verbose_targets=(
12
+ {
13
+ "client_cls": Api,
14
+ "get_client": get_client,
15
+ "manifest": [
16
+ {"method": method, "owner_approval_required": True}
17
+ for method in OWNER_APPROVAL_OPERATIONS
18
+ ],
19
+ },
20
+ ),
13
21
  tool_registry=TOOL_REGISTRY,
14
22
  instructions="Github MCP Server - Manage your repositories, issues, and pull requests.",
15
23
  )
@@ -2,6 +2,7 @@
2
2
  from typing import Any
3
3
 
4
4
  from scion_sdk.exceptions import require_auth
5
+ from scion_sdk.mcp.destructive import destructive_operation
5
6
 
6
7
  from github_agent.api.api_client_base import BaseApiClient
7
8
  from github_agent.github_response_models import Response
@@ -59,6 +60,7 @@ class Api(BaseApiClient):
59
60
  response.raise_for_status()
60
61
  return Response(response=response, data=response.json())
61
62
 
63
+ @destructive_operation
62
64
  @require_auth
63
65
  def update_dependabot_alert(
64
66
  self,
@@ -111,8 +111,8 @@ class Api(BaseApiClient):
111
111
  """Schedule an organization for deletion. IRREVERSIBLE.
112
112
 
113
113
  GitHub responds 202 Accepted and deletes the organization, all of its
114
- repositories, and all of its data asynchronously. The MCP layer gates
115
- this action behind allow_destructive / GITHUB_ALLOW_DESTRUCTIVE.
114
+ repositories, and all of its data asynchronously. The SDK asks
115
+ the caller to confirm this action.
116
116
 
117
117
  DELETE /orgs/{org}
118
118
  https://docs.github.com/en/rest/orgs/orgs#delete-an-organization
@@ -240,8 +240,8 @@ class Api(BaseApiClient):
240
240
  def remove_organization_member(self, org: str, username: str) -> Response:
241
241
  """Remove a user from an organization (repositories access included).
242
242
 
243
- Destructive: the MCP layer gates this action behind
244
- allow_destructive / GITHUB_ALLOW_DESTRUCTIVE. GitHub responds 204.
243
+ Destructive: the SDK asks the caller to confirm this
244
+ action. GitHub responds 204.
245
245
 
246
246
  DELETE /orgs/{org}/members/{username}
247
247
  https://docs.github.com/en/rest/orgs/members#remove-an-organization-member
@@ -150,8 +150,8 @@ class Api(BaseApiClient):
150
150
  def delete_pages(self, owner: str, repo: str) -> Response:
151
151
  """Disable GitHub Pages for a repository and delete the site.
152
152
 
153
- Destructive: the MCP layer gates this action behind
154
- allow_destructive / GITHUB_ALLOW_DESTRUCTIVE. GitHub responds 204.
153
+ Destructive: the SDK asks the caller to confirm this
154
+ action. GitHub responds 204.
155
155
 
156
156
  DELETE /repos/{owner}/{repo}/pages
157
157
  https://docs.github.com/en/rest/pages/pages#delete-a-apiname-pages-site
@@ -5,6 +5,7 @@ from scion_sdk.exceptions import (
5
5
  ParameterError,
6
6
  require_auth,
7
7
  )
8
+ from scion_sdk.mcp.destructive import destructive_operation
8
9
 
9
10
  from github_agent.api.api_client_base import BaseApiClient
10
11
  from github_agent.github_input_models import (
@@ -107,6 +108,7 @@ class Api(BaseApiClient):
107
108
  response.raise_for_status()
108
109
  return Response(response=response, data=response.json())
109
110
 
111
+ @destructive_operation
110
112
  @require_auth
111
113
  def merge_pull_request(
112
114
  self,
github_agent/auth.py CHANGED
@@ -21,16 +21,6 @@ from github_agent.api_client import Api
21
21
  logger = get_logger(__name__)
22
22
 
23
23
 
24
- def allow_destructive_default() -> bool:
25
- """Fleet-wide default for the destructive-action gate.
26
-
27
- Destructive MCP actions (e.g. organization delete, member removal) are
28
- blocked unless the caller passes allow_destructive=true or the
29
- GITHUB_ALLOW_DESTRUCTIVE environment variable is set truthy.
30
- """
31
- return setting("GITHUB_ALLOW_DESTRUCTIVE", False)
32
-
33
-
34
24
  def _exchange_delegated_token(settings: DelegationSettings) -> str:
35
25
  """Exchange the caller's verified MCP token for a downstream GitHub token."""
36
26
  logger.info(
@@ -55,7 +55,7 @@ SCHEMA_MAPPINGS = {
55
55
  "defaultBranch": "xsd:string",
56
56
  "durationSeconds": "xsd:integer",
57
57
  "event": "xsd:string",
58
- "fullName": "xsd:string",
58
+ "repositoryFullName": "xsd:string",
59
59
  "headBranch": "xsd:string",
60
60
  "headSha": "xsd:string",
61
61
  "htmlUrl": "xsd:string",
@@ -80,7 +80,7 @@ SCHEMA_MAPPINGS = {
80
80
  "defaultBranch": "xsd:string",
81
81
  "durationSeconds": "xsd:integer",
82
82
  "event": "xsd:string",
83
- "fullName": "xsd:string",
83
+ "repositoryFullName": "xsd:string",
84
84
  "headBranch": "xsd:string",
85
85
  "headSha": "xsd:string",
86
86
  "htmlUrl": "xsd:string",
@@ -105,7 +105,7 @@ SCHEMA_MAPPINGS = {
105
105
  "defaultBranch": "xsd:string",
106
106
  "durationSeconds": "xsd:integer",
107
107
  "event": "xsd:string",
108
- "fullName": "xsd:string",
108
+ "repositoryFullName": "xsd:string",
109
109
  "headBranch": "xsd:string",
110
110
  "headSha": "xsd:string",
111
111
  "htmlUrl": "xsd:string",
@@ -130,7 +130,7 @@ SCHEMA_MAPPINGS = {
130
130
  "defaultBranch": "xsd:string",
131
131
  "durationSeconds": "xsd:integer",
132
132
  "event": "xsd:string",
133
- "fullName": "xsd:string",
133
+ "repositoryFullName": "xsd:string",
134
134
  "headBranch": "xsd:string",
135
135
  "headSha": "xsd:string",
136
136
  "htmlUrl": "xsd:string",
@@ -155,7 +155,7 @@ SCHEMA_MAPPINGS = {
155
155
  "defaultBranch": "xsd:string",
156
156
  "durationSeconds": "xsd:integer",
157
157
  "event": "xsd:string",
158
- "fullName": "xsd:string",
158
+ "repositoryFullName": "xsd:string",
159
159
  "headBranch": "xsd:string",
160
160
  "headSha": "xsd:string",
161
161
  "htmlUrl": "xsd:string",
github_agent/kg_ingest.py CHANGED
@@ -1,7 +1,7 @@
1
- """Native epistemic-graph ingestion for GitHub records (typed graph nodes + documents).
1
+ """Native medulla ingestion for GitHub records (typed graph nodes + documents).
2
2
 
3
3
  CONCEPT:AU-KG.ingest.enterprise-source-extractor. The github-agent connector natively
4
- pushes its data into the ONE epistemic-graph knowledge graph as **typed OWL nodes**
4
+ pushes its data into the ONE medulla knowledge graph as **typed OWL nodes**
5
5
  (``:Repository``, ``:PullRequest``, ``:Issue``, ``:Release``, ``:Organization``,
6
6
  ``:Person``, ``:PipelineRun``, ``:CheckRun``) plus links, and release notes as
7
7
  **:Document** nodes for semantic search, through the ``scion_sdk.ingest``
@@ -18,14 +18,16 @@ input or when the SDK reports :class:`IngestError`/:class:`IngestUnavailableErro
18
18
 
19
19
  from __future__ import annotations
20
20
 
21
+ import hashlib
21
22
  import logging
22
23
  import time
24
+ from pathlib import Path
23
25
  from typing import Any
24
26
 
25
27
  from scion_sdk.ingest import (
26
28
  ChangeSet,
29
+ ContractSource,
27
30
  Entity,
28
- IngestBinding,
29
31
  IngestError,
30
32
  IngestUnavailableError,
31
33
  KnowledgeIngest,
@@ -35,8 +37,16 @@ from scion_sdk.ingest import (
35
37
 
36
38
  logger = logging.getLogger("github_agent.kg")
37
39
 
38
- _ENTITY_BINDING = IngestBinding(connector="github-mcp", stream="github")
39
- _DOCUMENT_BINDING = IngestBinding(connector="github-mcp", stream="github-documents")
40
+ #: The local declaration the engine must have accepted: the connector's mappings.
41
+ _DECLARATION = Path(__file__).parent / "ontology" / "mappings" / "source.yaml"
42
+
43
+ #: The contract every binding of this connector runs under; its digest is the
44
+ #: SHA-256 of the shipped mapping declaration, so a changed declaration is
45
+ #: refused (``contract_not_accepted``) until the engine accepts the new one.
46
+ CONTRACT = ContractSource(digest=hashlib.sha256(_DECLARATION.read_bytes()).hexdigest())
47
+
48
+ _ENTITY_BINDING = CONTRACT.bind("github-mcp", "github")
49
+ _DOCUMENT_BINDING = CONTRACT.bind("github-mcp", "github-documents")
40
50
 
41
51
 
42
52
  def _to_entity(record: dict[str, Any]) -> Entity:
@@ -65,7 +75,7 @@ async def ingest_entities(
65
75
  *,
66
76
  ingest: KnowledgeIngest | None = None,
67
77
  ) -> dict[str, int] | None:
68
- """Write typed OWL nodes (+ edges) into epistemic-graph. Best-effort, never raises.
78
+ """Write typed OWL nodes (+ edges) into medulla. Best-effort, never raises.
69
79
 
70
80
  ``entities``: ``[{"id":..., "node_type":<owl:Class>, ...props}]``.
71
81
  ``relationships``: ``[{"source":id, "target":id, "relationship":<link>}]``.
@@ -171,7 +181,7 @@ async def ingest_repositories(
171
181
  "id": node_id,
172
182
  "node_type": "Repository",
173
183
  "name": repo.get("name"),
174
- "fullName": repo.get("full_name"),
184
+ "repositoryFullName": repo.get("full_name"),
175
185
  "htmlUrl": _str(repo.get("html_url")),
176
186
  "defaultBranch": repo.get("default_branch"),
177
187
  "isPrivate": repo.get("private"),
@@ -29,6 +29,7 @@ from scion_sdk.config import load_config
29
29
  from scion_sdk.connector_identity import connector_version
30
30
  from scion_sdk.mcp.concurrency import run_blocking
31
31
  from scion_sdk.mcp.content import ConnectorContent
32
+ from scion_sdk.mcp.destructive import guard_destructive
32
33
  from scion_sdk.mcp.server import create_mcp_server
33
34
  from scion_sdk.mcp.tool_surface import register_tool_surface
34
35
 
@@ -114,7 +115,7 @@ def register_ingest_tools(mcp: FastMCP):
114
115
  default=None, description="MCP context for progress reporting"
115
116
  ),
116
117
  ) -> Any:
117
- """Natively ingest GitHub repositories into epistemic-graph as typed :Repository nodes.
118
+ """Natively ingest GitHub repositories into medulla as typed :Repository nodes.
118
119
 
119
120
  Lists the authenticated user's repositories via the GitHub API and pushes them
120
121
  (with their owner :Organization/:Person + :ownedByOrg links) into the knowledge
@@ -170,7 +171,7 @@ def register_ingest_tools(mcp: FastMCP):
170
171
  default=None, description="MCP context for progress reporting"
171
172
  ),
172
173
  ) -> Any:
173
- """Natively ingest GitHub Actions workflow runs into epistemic-graph.
174
+ """Natively ingest GitHub Actions workflow runs into medulla.
174
175
 
175
176
  Lists recent workflow runs for a repository (+ each run's jobs, unless
176
177
  ``include_jobs=false``) via the GitHub API and pushes them as typed
@@ -218,7 +219,9 @@ def register_auto_merge_tools(mcp: FastMCP):
218
219
  """Register the GraphQL-only pull request auto-merge tools."""
219
220
 
220
221
  @mcp.tool(
221
- tags={"pulls"}, annotations={"readOnlyHint": False, "destructiveHint": False}
222
+ tags={"pulls"},
223
+ annotations={"readOnlyHint": False, "destructiveHint": True},
224
+ meta={"owner_approval_required": True},
222
225
  )
223
226
  async def github_pulls_enable_auto_merge(
224
227
  owner: str = Field(description="Repository owner."),
@@ -228,9 +231,21 @@ def register_auto_merge_tools(mcp: FastMCP):
228
231
  default="MERGE", description="MERGE, SQUASH or REBASE."
229
232
  ),
230
233
  client=Depends(get_client),
234
+ confirm: bool = Field(
235
+ default=False,
236
+ description="Confirm this destructive call when the client cannot be asked.",
237
+ ),
231
238
  ctx: Context | None = Field(default=None, description="MCP context"),
232
239
  ) -> Any:
233
240
  """Turn on auto-merge for a pull request: it merges once required checks pass."""
241
+ refused = await guard_destructive(
242
+ ctx,
243
+ "enable_auto_merge",
244
+ {"owner": owner, "repo": repo, "number": number},
245
+ confirm=confirm,
246
+ )
247
+ if refused is not None:
248
+ return refused
234
249
  try:
235
250
  gql_client = await run_blocking(get_graphql_client)
236
251
  except Exception as e:
@@ -366,6 +381,13 @@ def register_graphql_tools(mcp: FastMCP):
366
381
  return {"error": "Failed to discover GitHub GraphQL schema"}
367
382
 
368
383
 
384
+ #: Operations the SDK refuses to serve unless they declare the owner-approval
385
+ #: flag (SCION-SCM-R003.3): every non-read method whose name holds the
386
+ #: ``merge`` token.
387
+ OWNER_APPROVAL_OPERATIONS: tuple[str, ...] = (
388
+ "merge_pull_request",
389
+ )
390
+
369
391
  TOOL_REGISTRY = [
370
392
  ("pulls", "PULLTOOL", register_auto_merge_tools),
371
393
  ("ingest", "INGESTTOOL", register_ingest_tools),
@@ -393,6 +415,10 @@ def get_mcp_instance() -> tuple[Any, Any, Any, Any, Any]:
393
415
  get_client=get_client,
394
416
  service="github-agent",
395
417
  tool_registry=TOOL_REGISTRY,
418
+ manifest=[
419
+ {"method": method, "owner_approval_required": True}
420
+ for method in OWNER_APPROVAL_OPERATIONS
421
+ ],
396
422
  )
397
423
 
398
424
  for mw in middlewares:
@@ -1,7 +1,7 @@
1
1
  """Github ontology contribution (CONCEPT:AU-KG.ontology.federation-provider-leg).
2
2
 
3
3
  Data-only subpackage: it carries ``github.ttl`` (the ``owl:Ontology``
4
- ``http://knuckles.team/kg/github`` module — organizations, repositories, pull requests,
4
+ ``https://knuckles-team.github.io/ontology/connector/github`` module — organizations, repositories, pull requests,
5
5
  issues, releases, branches, commits, workflows and workflow runs with their review and
6
6
  delivery relationships) which the scion-sdk hub federates in via
7
7
  the ``scion_sdk.ontology_providers`` entry-point. It holds no business logic
@@ -0,0 +1,40 @@
1
+ @prefix ac: <https://knuckles-team.github.io/ontology/access#> .
2
+ @prefix core: <https://knuckles-team.github.io/ontology/core#> .
3
+ @prefix : <https://knuckles-team.github.io/ontology/connector/github#> .
4
+ @prefix vg: <https://knuckles-team.github.io/ontology/virtual-graph#> .
5
+
6
+ # Competency reads: github_get_pull_requests and github_get_repositories.
7
+
8
+ :pullRequestAccess a ac:AccessContract ;
9
+ ac:classIri core:PullRequest ;
10
+ ac:sourceId "github-agent" ;
11
+ ac:entity "pull_request" ;
12
+ ac:keyField "node_id" ;
13
+ ac:accessKind "mcp_tool" ;
14
+ ac:operation "github_get_pull_requests" ;
15
+ ac:pagination "none" .
16
+
17
+ :pullRequestUrlBinding a ac:PropertyBinding ;
18
+ ac:contract :pullRequestAccess ; ac:property vg:url ; ac:field "url" .
19
+ :pullRequestStateBinding a ac:PropertyBinding ;
20
+ ac:contract :pullRequestAccess ; ac:property core:state ; ac:field "state" .
21
+ :pullRequestMergedBinding a ac:PropertyBinding ;
22
+ ac:contract :pullRequestAccess ; ac:property :merged ; ac:field "merged" .
23
+ :pullRequestMergedAtBinding a ac:PropertyBinding ;
24
+ ac:contract :pullRequestAccess ; ac:property :mergedAt ; ac:field "mergedAt" .
25
+ :pullRequestChangedPathsBinding a ac:PropertyBinding ;
26
+ ac:contract :pullRequestAccess ; ac:property :changedPaths ; ac:field "changedPaths" .
27
+
28
+ :repositoryAccess a ac:AccessContract ;
29
+ ac:classIri core:Repository ;
30
+ ac:sourceId "github-agent" ;
31
+ ac:entity "repository" ;
32
+ ac:keyField "node_id" ;
33
+ ac:accessKind "mcp_tool" ;
34
+ ac:operation "github_get_repositories" ;
35
+ ac:pagination "none" .
36
+
37
+ :repositoryNameBinding a ac:PropertyBinding ;
38
+ ac:contract :repositoryAccess ; ac:property :name ; ac:field "name" .
39
+ :repositoryPushedAtBinding a ac:PropertyBinding ;
40
+ ac:contract :repositoryAccess ; ac:property :pushedAt ; ac:field "pushedAt" .
@@ -2,10 +2,10 @@
2
2
  "api_version": "graphos.io/v1",
3
3
  "artifacts": {
4
4
  "github_agent/ontology/fixtures/records.json": "12f5b54b0ae98770f279f99e136788d063340042a9d6ff4bac0c22a886d2dc7b",
5
- "github_agent/ontology/github.ttl": "3558c43835211ddcf7d2af622a37c0c370a7e8fe6b40a111b9bc98dd7e91f2ac",
5
+ "github_agent/ontology/github.ttl": "50d61835142ff26056acf2b2b0a47486889747bf903316872e6951893450ed60",
6
6
  "github_agent/ontology/mappings/source.yaml": "5142f75b88634aeac6850fe6de5b176958d63073daab2c573cf9c03daa46021c",
7
7
  "github_agent/ontology/migrations/manifest.json": "adf16022502dd031dd303a52abae7a0677ece1135e1e05c21dba24c9ae51935c",
8
- "github_agent/ontology/shapes/connector.shacl.ttl": "709f555b7b8cc6b1e0adddfeb8e077834f5db548bed4a904afd2a195e49aab1c"
8
+ "github_agent/ontology/shapes/connector.shacl.ttl": "dbf1fe430c834c5b02f851f698799fbc40f127d705e6a9a8361355df1de7edf0"
9
9
  },
10
10
  "checks": {
11
11
  "declared_tool_schema": "passed",
@@ -29,5 +29,5 @@
29
29
  "signer": "UNSIGNED-PREVIEW",
30
30
  "signing_public_key": "",
31
31
  "status": "source-validated",
32
- "validated_at": "2026-11-06T18:41:25Z"
32
+ "validated_at": "2026-12-03T21:52:55Z"
33
33
  }
@@ -1,10 +1,12 @@
1
1
  @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
2
2
  @prefix foaf: <http://xmlns.com/foaf/0.1/> .
3
3
  @prefix dc: <http://purl.org/dc/terms/> .
4
- @prefix : <http://knuckles.team/kg#> .
4
+ @prefix : <https://knuckles-team.github.io/ontology/connector/github#> .
5
+ @prefix core: <https://knuckles-team.github.io/ontology/core#> .
5
6
  @prefix owl: <http://www.w3.org/2002/07/owl#> .
6
7
  @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7
8
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
9
+ @prefix cat: <https://knuckles-team.github.io/ontology/catalog#> .
8
10
 
9
11
  # GitHub source-control ontology — repositories, code review, issue tracking, and
10
12
  # CI/CD via GitHub Actions. All classes and properties live in the shared `:` (kg#)
@@ -15,24 +17,8 @@
15
17
  # Shared concepts owned by the epistemic-graph ontology and referenced here, never redeclared:
16
18
  # Repository, PullRequest, Release, Branch, Commit, PipelineRun. Only the GitHub-specific subclasses and properties are declared in this pack.
17
19
 
18
- :Organization a owl:Class .
19
-
20
-
21
- :Issue a owl:Class ;
22
- rdfs:subClassOf :WorkItem ;
23
- rdfs:label "Issue" ;
24
- rdfs:comment "A tracked work item, bug, or discussion in a repository (github_get_issues)." .
25
-
26
- :Workflow a owl:Class .
27
-
28
-
29
- :WorkflowRun a owl:Class ;
30
- rdfs:subClassOf :PipelineRun ;
31
- rdfs:label "Workflow Run" ;
32
- rdfs:comment "A single execution of a GitHub Actions workflow for a ref/commit (github_get_workflow_runs)." .
33
-
34
20
  :CheckRun a owl:Class ;
35
- rdfs:subClassOf :PipelineRun ;
21
+ rdfs:subClassOf core:PipelineRun ;
36
22
  rdfs:label "Check Run" ;
37
23
  rdfs:comment """A single job/check within a PipelineRun (github_get_workflow_run_jobs workflow-run job or
38
24
  GitHub Checks-API check run). Shares its class name with the twin gitlab-api producer.""" .
@@ -42,68 +28,93 @@
42
28
  :belongsToRepository a owl:ObjectProperty ;
43
29
  rdfs:label "belongs to repository" ;
44
30
  rdfs:comment "Links a PullRequest, Issue, Branch, Commit, Release, Workflow, or WorkflowRun to its Repository." ;
45
- rdfs:range :Repository .
31
+ rdfs:range core:Repository .
46
32
 
47
33
  :ownedByOrg a owl:ObjectProperty ;
48
34
  rdfs:label "owned by organization" ;
49
35
  rdfs:comment "Links a Repository to the Organization (or user) that owns it." ;
50
- rdfs:domain :Repository ;
51
- rdfs:range :Organization .
36
+ rdfs:domain core:Repository ;
37
+ rdfs:range core:Organization .
52
38
 
53
39
  :authoredBy a owl:ObjectProperty ;
54
40
  rdfs:label "authored by" ;
55
41
  rdfs:comment "Links a PullRequest, Issue, or Commit to the Person who created it." ;
56
- rdfs:range :Person .
57
-
58
- :assignedTo a owl:ObjectProperty ;
59
- rdfs:label "assigned to" ;
60
- rdfs:comment "Links an Issue or PullRequest to the Person responsible for it." ;
61
- rdfs:range :Person .
42
+ rdfs:range core:Person .
62
43
 
63
44
  :targetsBranch a owl:ObjectProperty ;
64
45
  rdfs:label "targets branch" ;
65
46
  rdfs:comment "Links a PullRequest to the base Branch it merges into." ;
66
- rdfs:domain :PullRequest ;
67
- rdfs:range :Branch .
47
+ rdfs:domain core:PullRequest ;
48
+ rdfs:range core:Branch .
68
49
 
69
50
  :closesIssue a owl:ObjectProperty ;
70
51
  rdfs:label "closes issue" ;
71
52
  rdfs:comment "Links a PullRequest to an Issue it resolves." ;
72
- rdfs:domain :PullRequest ;
73
- rdfs:range :Issue .
53
+ rdfs:domain core:PullRequest ;
54
+ rdfs:range core:Issue .
74
55
 
75
56
  :hasWorkflowRun a owl:ObjectProperty ;
76
57
  rdfs:label "has workflow run" ;
77
58
  rdfs:comment "Links a Workflow to a WorkflowRun that executed it." ;
78
- rdfs:domain :Workflow ;
79
- rdfs:range :WorkflowRun .
59
+ rdfs:domain core:Workflow ;
60
+ rdfs:range cat:WorkflowRun .
80
61
 
81
62
  :ranFor a owl:ObjectProperty ;
82
63
  rdfs:label "ran for" ;
83
64
  rdfs:comment """Links a PipelineRun to what it ran for — its Repository, the Commit it
84
65
  built, and/or the PullRequest it validated. Same predicate name as the twin gitlab-api
85
66
  producer (Pipeline ranFor Project/Commit/MergeRequest).""" ;
86
- rdfs:domain :PipelineRun .
67
+ rdfs:domain core:PipelineRun .
87
68
 
88
69
  :hasJob a owl:ObjectProperty ;
89
70
  rdfs:label "has job" ;
90
71
  rdfs:comment """Links a PipelineRun to a CheckRun (job/check) it contains. Same predicate
91
72
  name as the twin gitlab-api producer (Pipeline hasJob Job).""" ;
92
- rdfs:domain :PipelineRun ;
73
+ rdfs:domain core:PipelineRun ;
93
74
  rdfs:range :CheckRun .
94
75
 
95
76
  :documentsRelease a owl:ObjectProperty ;
96
77
  rdfs:label "documents release" ;
97
78
  rdfs:comment "Links a Release to the :Document carrying its release-notes body." ;
98
- rdfs:domain :Release ;
99
- rdfs:range :Document .
79
+ rdfs:domain core:Release ;
80
+ rdfs:range core:Document .
100
81
 
101
82
  # --- fields (owl:DatatypeProperty) ---
102
83
 
103
- :fullName a owl:DatatypeProperty ;
104
- rdfs:label "full name" ;
84
+ :merged a owl:DatatypeProperty ;
85
+ rdfs:label "merged" ;
86
+ rdfs:comment "Whether a pull request has been merged." ;
87
+ rdfs:domain core:PullRequest ;
88
+ rdfs:range xsd:boolean .
89
+
90
+ :mergedAt a owl:DatatypeProperty ;
91
+ rdfs:label "merged at" ;
92
+ rdfs:comment "When a pull request was merged." ;
93
+ rdfs:domain core:PullRequest ;
94
+ rdfs:range xsd:dateTime .
95
+
96
+ :changedPaths a owl:DatatypeProperty ;
97
+ rdfs:label "changed paths" ;
98
+ rdfs:comment "File paths a pull request changes." ;
99
+ rdfs:domain core:PullRequest ;
100
+ rdfs:range xsd:string .
101
+
102
+ :name a owl:DatatypeProperty ;
103
+ rdfs:label "name" ;
104
+ rdfs:comment "Short name of a repository." ;
105
+ rdfs:domain core:Repository ;
106
+ rdfs:range xsd:string .
107
+
108
+ :pushedAt a owl:DatatypeProperty ;
109
+ rdfs:label "pushed at" ;
110
+ rdfs:comment "When a repository was last pushed to." ;
111
+ rdfs:domain core:Repository ;
112
+ rdfs:range xsd:dateTime .
113
+
114
+ :repositoryFullName a owl:DatatypeProperty ;
115
+ rdfs:label "repository full name" ;
105
116
  rdfs:comment "Owner-qualified repository name (owner/repo)." ;
106
- rdfs:domain :Repository ;
117
+ rdfs:domain core:Repository ;
107
118
  rdfs:range xsd:string .
108
119
 
109
120
  :htmlUrl a owl:DatatypeProperty ;
@@ -111,12 +122,6 @@
111
122
  rdfs:comment "Canonical GitHub web URL of the object." ;
112
123
  rdfs:range xsd:string .
113
124
 
114
- :state a owl:DatatypeProperty ;
115
- rdfs:label "state" ;
116
- rdfs:comment "Lifecycle state (open, closed, merged)." ;
117
- rdfs:domain [ a owl:Class ; owl:unionOf ( :Issue :PullRequest ) ] ;
118
- rdfs:range xsd:string .
119
-
120
125
  :number a owl:DatatypeProperty ;
121
126
  rdfs:label "number" ;
122
127
  rdfs:comment "Repository-scoped issue or pull-request number (#42)." ;
@@ -135,13 +140,13 @@
135
140
  :defaultBranch a owl:DatatypeProperty ;
136
141
  rdfs:label "default branch" ;
137
142
  rdfs:comment "Name of a repository's default branch." ;
138
- rdfs:domain :Repository ;
143
+ rdfs:domain core:Repository ;
139
144
  rdfs:range xsd:string .
140
145
 
141
146
  :isPrivate a owl:DatatypeProperty ;
142
147
  rdfs:label "is private" ;
143
148
  rdfs:comment "Whether a repository is private." ;
144
- rdfs:domain :Repository ;
149
+ rdfs:domain core:Repository ;
145
150
  rdfs:range xsd:boolean .
146
151
 
147
152
  :isDraft a owl:DatatypeProperty ;
@@ -167,52 +172,46 @@
167
172
  :headSha a owl:DatatypeProperty ;
168
173
  rdfs:label "head sha" ;
169
174
  rdfs:comment "Full git commit SHA a PipelineRun ran against." ;
170
- rdfs:domain :PipelineRun ;
175
+ rdfs:domain core:PipelineRun ;
171
176
  rdfs:range xsd:string .
172
177
 
173
178
  :headBranch a owl:DatatypeProperty ;
174
179
  rdfs:label "head branch" ;
175
180
  rdfs:comment "Branch name a PipelineRun ran against." ;
176
- rdfs:domain :PipelineRun ;
181
+ rdfs:domain core:PipelineRun ;
177
182
  rdfs:range xsd:string .
178
183
 
179
184
  :event a owl:DatatypeProperty ;
180
185
  rdfs:label "event" ;
181
186
  rdfs:comment "Triggering event of a PipelineRun (push, pull_request, schedule, workflow_dispatch)." ;
182
- rdfs:domain :PipelineRun ;
187
+ rdfs:domain core:PipelineRun ;
183
188
  rdfs:range xsd:string .
184
189
 
185
190
  :runStartedAt a owl:DatatypeProperty ;
186
191
  rdfs:label "run started at" ;
187
192
  rdfs:comment "Timestamp a PipelineRun started executing." ;
188
- rdfs:domain :PipelineRun ;
193
+ rdfs:domain core:PipelineRun ;
189
194
  rdfs:range xsd:dateTime .
190
195
 
191
196
  :runUpdatedAt a owl:DatatypeProperty ;
192
197
  rdfs:label "run updated at" ;
193
198
  rdfs:comment "Timestamp a PipelineRun was last updated." ;
194
- rdfs:domain :PipelineRun ;
199
+ rdfs:domain core:PipelineRun ;
195
200
  rdfs:range xsd:dateTime .
196
201
 
197
202
  :durationSeconds a owl:DatatypeProperty ;
198
203
  rdfs:label "duration seconds" ;
199
204
  rdfs:comment "Wall-clock duration in seconds of a PipelineRun (runUpdatedAt - runStartedAt)." ;
200
- rdfs:domain :PipelineRun ;
205
+ rdfs:domain core:PipelineRun ;
201
206
  rdfs:range xsd:integer .
202
207
 
203
- :startedAt a owl:DatatypeProperty ;
204
- rdfs:label "started at" ;
205
- rdfs:comment "Timestamp a CheckRun started executing." ;
206
- rdfs:domain :CheckRun ;
207
- rdfs:range xsd:dateTime .
208
-
209
208
  :completedAt a owl:DatatypeProperty ;
210
209
  rdfs:label "completed at" ;
211
210
  rdfs:comment "Timestamp a CheckRun finished executing." ;
212
211
  rdfs:domain :CheckRun ;
213
212
  rdfs:range xsd:dateTime .
214
213
 
215
- <http://knuckles.team/kg/github> a owl:Ontology ;
214
+ <https://knuckles-team.github.io/ontology/connector/github> a owl:Ontology ;
216
215
  rdfs:label "GitHub Ontology" ;
217
216
  rdfs:comment """GitHub source-control, code-review and CI/CD model — organizations,
218
217
  repositories, pull requests, issues, releases, branches, commits, workflows and