github-agent 2.5.0__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.
- github_agent/__init__.py +11 -3
- github_agent/connector_sources.py +5 -5
- github_agent/kg_ingest.py +17 -7
- github_agent/mcp_server.py +16 -3
- github_agent/ontology/__init__.py +1 -1
- github_agent/ontology/access_contracts.ttl +40 -0
- github_agent/ontology/certification.json +3 -3
- github_agent/ontology/github.ttl +58 -62
- github_agent/ontology/shapes/connector.shacl.ttl +0 -80
- github_agent/skills/github-actions-ci-review/SKILL.md +19 -1
- github_agent/skills/github-agent-development/SKILL.md +16 -0
- github_agent/skills/github-agent-operations/SKILL.md +19 -1
- github_agent/skills/github-backlog-planner/SKILL.md +19 -1
- github_agent/skills/github-ci-failure-sweep/SKILL.md +19 -1
- github_agent/skills/github-dependabot-review/SKILL.md +19 -1
- github_agent/skills/github-issue-tracking/SKILL.md +19 -1
- github_agent/skills/github-org-remediation-loop/SKILL.md +19 -1
- github_agent/skills/github-pr-review-sweep/SKILL.md +19 -1
- github_agent/skills/github-project-provisioner/SKILL.md +16 -0
- github_agent/skills/github-pull-request-create/SKILL.md +18 -1
- github_agent/skills/github-pull-request-review/SKILL.md +19 -1
- github_agent/skills/github-repository-management/SKILL.md +19 -1
- github_agent/skills/github-tools/SKILL.md +16 -0
- github_agent/skills/github-triage-resolver/SKILL.md +19 -1
- {github_agent-2.5.0.dist-info → github_agent-2.5.1.dist-info}/METADATA +116 -117
- {github_agent-2.5.0.dist-info → github_agent-2.5.1.dist-info}/RECORD +37 -33
- tests/test_access_contracts.py +105 -0
- tests/test_cq_paths.py +3 -4
- tests/test_destructive_declaration.py +10 -1
- tests/test_kg_ingest.py +7 -3
- tests/test_ontology_one_schema.py +57 -0
- tests/test_ontology_parent_link.py +12 -12
- tests/test_scion_sdk_0_10_imports.py +59 -0
- {github_agent-2.5.0.dist-info → github_agent-2.5.1.dist-info}/WHEEL +0 -0
- {github_agent-2.5.0.dist-info → github_agent-2.5.1.dist-info}/entry_points.txt +0 -0
- {github_agent-2.5.0.dist-info → github_agent-2.5.1.dist-info}/licenses/LICENSE +0 -0
- {github_agent-2.5.0.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
|
-
|
|
12
|
-
|
|
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
|
)
|
|
@@ -55,7 +55,7 @@ SCHEMA_MAPPINGS = {
|
|
|
55
55
|
"defaultBranch": "xsd:string",
|
|
56
56
|
"durationSeconds": "xsd:integer",
|
|
57
57
|
"event": "xsd:string",
|
|
58
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
|
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
|
|
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
|
-
|
|
39
|
-
|
|
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
|
|
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
|
-
"
|
|
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"),
|
github_agent/mcp_server.py
CHANGED
|
@@ -115,7 +115,7 @@ def register_ingest_tools(mcp: FastMCP):
|
|
|
115
115
|
default=None, description="MCP context for progress reporting"
|
|
116
116
|
),
|
|
117
117
|
) -> Any:
|
|
118
|
-
"""Natively ingest GitHub repositories into
|
|
118
|
+
"""Natively ingest GitHub repositories into medulla as typed :Repository nodes.
|
|
119
119
|
|
|
120
120
|
Lists the authenticated user's repositories via the GitHub API and pushes them
|
|
121
121
|
(with their owner :Organization/:Person + :ownedByOrg links) into the knowledge
|
|
@@ -171,7 +171,7 @@ def register_ingest_tools(mcp: FastMCP):
|
|
|
171
171
|
default=None, description="MCP context for progress reporting"
|
|
172
172
|
),
|
|
173
173
|
) -> Any:
|
|
174
|
-
"""Natively ingest GitHub Actions workflow runs into
|
|
174
|
+
"""Natively ingest GitHub Actions workflow runs into medulla.
|
|
175
175
|
|
|
176
176
|
Lists recent workflow runs for a repository (+ each run's jobs, unless
|
|
177
177
|
``include_jobs=false``) via the GitHub API and pushes them as typed
|
|
@@ -219,7 +219,9 @@ def register_auto_merge_tools(mcp: FastMCP):
|
|
|
219
219
|
"""Register the GraphQL-only pull request auto-merge tools."""
|
|
220
220
|
|
|
221
221
|
@mcp.tool(
|
|
222
|
-
tags={"pulls"},
|
|
222
|
+
tags={"pulls"},
|
|
223
|
+
annotations={"readOnlyHint": False, "destructiveHint": True},
|
|
224
|
+
meta={"owner_approval_required": True},
|
|
223
225
|
)
|
|
224
226
|
async def github_pulls_enable_auto_merge(
|
|
225
227
|
owner: str = Field(description="Repository owner."),
|
|
@@ -379,6 +381,13 @@ def register_graphql_tools(mcp: FastMCP):
|
|
|
379
381
|
return {"error": "Failed to discover GitHub GraphQL schema"}
|
|
380
382
|
|
|
381
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
|
+
|
|
382
391
|
TOOL_REGISTRY = [
|
|
383
392
|
("pulls", "PULLTOOL", register_auto_merge_tools),
|
|
384
393
|
("ingest", "INGESTTOOL", register_ingest_tools),
|
|
@@ -406,6 +415,10 @@ def get_mcp_instance() -> tuple[Any, Any, Any, Any, Any]:
|
|
|
406
415
|
get_client=get_client,
|
|
407
416
|
service="github-agent",
|
|
408
417
|
tool_registry=TOOL_REGISTRY,
|
|
418
|
+
manifest=[
|
|
419
|
+
{"method": method, "owner_approval_required": True}
|
|
420
|
+
for method in OWNER_APPROVAL_OPERATIONS
|
|
421
|
+
],
|
|
409
422
|
)
|
|
410
423
|
|
|
411
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
|
-
``
|
|
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": "
|
|
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": "
|
|
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-
|
|
32
|
+
"validated_at": "2026-12-03T21:52:55Z"
|
|
33
33
|
}
|
github_agent/ontology/github.ttl
CHANGED
|
@@ -1,11 +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 : <
|
|
4
|
+
@prefix : <https://knuckles-team.github.io/ontology/connector/github#> .
|
|
5
5
|
@prefix core: <https://knuckles-team.github.io/ontology/core#> .
|
|
6
6
|
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
7
7
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
8
8
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
9
|
+
@prefix cat: <https://knuckles-team.github.io/ontology/catalog#> .
|
|
9
10
|
|
|
10
11
|
# GitHub source-control ontology — repositories, code review, issue tracking, and
|
|
11
12
|
# CI/CD via GitHub Actions. All classes and properties live in the shared `:` (kg#)
|
|
@@ -16,24 +17,6 @@
|
|
|
16
17
|
# Shared concepts owned by the epistemic-graph ontology and referenced here, never redeclared:
|
|
17
18
|
# Repository, PullRequest, Release, Branch, Commit, PipelineRun. Only the GitHub-specific subclasses and properties are declared in this pack.
|
|
18
19
|
|
|
19
|
-
:Organization a owl:Class ;
|
|
20
|
-
rdfs:subClassOf core:Organization .
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
:Issue a owl:Class ;
|
|
24
|
-
rdfs:subClassOf core:WorkItem ;
|
|
25
|
-
rdfs:label "Issue" ;
|
|
26
|
-
rdfs:comment "A tracked work item, bug, or discussion in a repository (github_get_issues)." .
|
|
27
|
-
|
|
28
|
-
:Workflow a owl:Class ;
|
|
29
|
-
rdfs:subClassOf core:Workflow .
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:WorkflowRun a owl:Class ;
|
|
33
|
-
rdfs:subClassOf core:PipelineRun ;
|
|
34
|
-
rdfs:label "Workflow Run" ;
|
|
35
|
-
rdfs:comment "A single execution of a GitHub Actions workflow for a ref/commit (github_get_workflow_runs)." .
|
|
36
|
-
|
|
37
20
|
:CheckRun a owl:Class ;
|
|
38
21
|
rdfs:subClassOf core:PipelineRun ;
|
|
39
22
|
rdfs:label "Check Run" ;
|
|
@@ -45,68 +28,93 @@
|
|
|
45
28
|
:belongsToRepository a owl:ObjectProperty ;
|
|
46
29
|
rdfs:label "belongs to repository" ;
|
|
47
30
|
rdfs:comment "Links a PullRequest, Issue, Branch, Commit, Release, Workflow, or WorkflowRun to its Repository." ;
|
|
48
|
-
rdfs:range :Repository .
|
|
31
|
+
rdfs:range core:Repository .
|
|
49
32
|
|
|
50
33
|
:ownedByOrg a owl:ObjectProperty ;
|
|
51
34
|
rdfs:label "owned by organization" ;
|
|
52
35
|
rdfs:comment "Links a Repository to the Organization (or user) that owns it." ;
|
|
53
|
-
rdfs:domain :Repository ;
|
|
54
|
-
rdfs:range :Organization .
|
|
36
|
+
rdfs:domain core:Repository ;
|
|
37
|
+
rdfs:range core:Organization .
|
|
55
38
|
|
|
56
39
|
:authoredBy a owl:ObjectProperty ;
|
|
57
40
|
rdfs:label "authored by" ;
|
|
58
41
|
rdfs:comment "Links a PullRequest, Issue, or Commit to the Person who created it." ;
|
|
59
|
-
rdfs:range :Person .
|
|
60
|
-
|
|
61
|
-
:assignedTo a owl:ObjectProperty ;
|
|
62
|
-
rdfs:label "assigned to" ;
|
|
63
|
-
rdfs:comment "Links an Issue or PullRequest to the Person responsible for it." ;
|
|
64
|
-
rdfs:range :Person .
|
|
42
|
+
rdfs:range core:Person .
|
|
65
43
|
|
|
66
44
|
:targetsBranch a owl:ObjectProperty ;
|
|
67
45
|
rdfs:label "targets branch" ;
|
|
68
46
|
rdfs:comment "Links a PullRequest to the base Branch it merges into." ;
|
|
69
|
-
rdfs:domain :PullRequest ;
|
|
70
|
-
rdfs:range :Branch .
|
|
47
|
+
rdfs:domain core:PullRequest ;
|
|
48
|
+
rdfs:range core:Branch .
|
|
71
49
|
|
|
72
50
|
:closesIssue a owl:ObjectProperty ;
|
|
73
51
|
rdfs:label "closes issue" ;
|
|
74
52
|
rdfs:comment "Links a PullRequest to an Issue it resolves." ;
|
|
75
|
-
rdfs:domain :PullRequest ;
|
|
76
|
-
rdfs:range :Issue .
|
|
53
|
+
rdfs:domain core:PullRequest ;
|
|
54
|
+
rdfs:range core:Issue .
|
|
77
55
|
|
|
78
56
|
:hasWorkflowRun a owl:ObjectProperty ;
|
|
79
57
|
rdfs:label "has workflow run" ;
|
|
80
58
|
rdfs:comment "Links a Workflow to a WorkflowRun that executed it." ;
|
|
81
|
-
rdfs:domain :Workflow ;
|
|
82
|
-
rdfs:range :WorkflowRun .
|
|
59
|
+
rdfs:domain core:Workflow ;
|
|
60
|
+
rdfs:range cat:WorkflowRun .
|
|
83
61
|
|
|
84
62
|
:ranFor a owl:ObjectProperty ;
|
|
85
63
|
rdfs:label "ran for" ;
|
|
86
64
|
rdfs:comment """Links a PipelineRun to what it ran for — its Repository, the Commit it
|
|
87
65
|
built, and/or the PullRequest it validated. Same predicate name as the twin gitlab-api
|
|
88
66
|
producer (Pipeline ranFor Project/Commit/MergeRequest).""" ;
|
|
89
|
-
rdfs:domain :PipelineRun .
|
|
67
|
+
rdfs:domain core:PipelineRun .
|
|
90
68
|
|
|
91
69
|
:hasJob a owl:ObjectProperty ;
|
|
92
70
|
rdfs:label "has job" ;
|
|
93
71
|
rdfs:comment """Links a PipelineRun to a CheckRun (job/check) it contains. Same predicate
|
|
94
72
|
name as the twin gitlab-api producer (Pipeline hasJob Job).""" ;
|
|
95
|
-
rdfs:domain :PipelineRun ;
|
|
73
|
+
rdfs:domain core:PipelineRun ;
|
|
96
74
|
rdfs:range :CheckRun .
|
|
97
75
|
|
|
98
76
|
:documentsRelease a owl:ObjectProperty ;
|
|
99
77
|
rdfs:label "documents release" ;
|
|
100
78
|
rdfs:comment "Links a Release to the :Document carrying its release-notes body." ;
|
|
101
|
-
rdfs:domain :Release ;
|
|
102
|
-
rdfs:range :Document .
|
|
79
|
+
rdfs:domain core:Release ;
|
|
80
|
+
rdfs:range core:Document .
|
|
103
81
|
|
|
104
82
|
# --- fields (owl:DatatypeProperty) ---
|
|
105
83
|
|
|
106
|
-
:
|
|
107
|
-
rdfs:label "
|
|
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" ;
|
|
108
116
|
rdfs:comment "Owner-qualified repository name (owner/repo)." ;
|
|
109
|
-
rdfs:domain :Repository ;
|
|
117
|
+
rdfs:domain core:Repository ;
|
|
110
118
|
rdfs:range xsd:string .
|
|
111
119
|
|
|
112
120
|
:htmlUrl a owl:DatatypeProperty ;
|
|
@@ -114,12 +122,6 @@
|
|
|
114
122
|
rdfs:comment "Canonical GitHub web URL of the object." ;
|
|
115
123
|
rdfs:range xsd:string .
|
|
116
124
|
|
|
117
|
-
:state a owl:DatatypeProperty ;
|
|
118
|
-
rdfs:label "state" ;
|
|
119
|
-
rdfs:comment "Lifecycle state (open, closed, merged)." ;
|
|
120
|
-
rdfs:domain [ a owl:Class ; owl:unionOf ( :Issue :PullRequest ) ] ;
|
|
121
|
-
rdfs:range xsd:string .
|
|
122
|
-
|
|
123
125
|
:number a owl:DatatypeProperty ;
|
|
124
126
|
rdfs:label "number" ;
|
|
125
127
|
rdfs:comment "Repository-scoped issue or pull-request number (#42)." ;
|
|
@@ -138,13 +140,13 @@
|
|
|
138
140
|
:defaultBranch a owl:DatatypeProperty ;
|
|
139
141
|
rdfs:label "default branch" ;
|
|
140
142
|
rdfs:comment "Name of a repository's default branch." ;
|
|
141
|
-
rdfs:domain :Repository ;
|
|
143
|
+
rdfs:domain core:Repository ;
|
|
142
144
|
rdfs:range xsd:string .
|
|
143
145
|
|
|
144
146
|
:isPrivate a owl:DatatypeProperty ;
|
|
145
147
|
rdfs:label "is private" ;
|
|
146
148
|
rdfs:comment "Whether a repository is private." ;
|
|
147
|
-
rdfs:domain :Repository ;
|
|
149
|
+
rdfs:domain core:Repository ;
|
|
148
150
|
rdfs:range xsd:boolean .
|
|
149
151
|
|
|
150
152
|
:isDraft a owl:DatatypeProperty ;
|
|
@@ -170,52 +172,46 @@
|
|
|
170
172
|
:headSha a owl:DatatypeProperty ;
|
|
171
173
|
rdfs:label "head sha" ;
|
|
172
174
|
rdfs:comment "Full git commit SHA a PipelineRun ran against." ;
|
|
173
|
-
rdfs:domain :PipelineRun ;
|
|
175
|
+
rdfs:domain core:PipelineRun ;
|
|
174
176
|
rdfs:range xsd:string .
|
|
175
177
|
|
|
176
178
|
:headBranch a owl:DatatypeProperty ;
|
|
177
179
|
rdfs:label "head branch" ;
|
|
178
180
|
rdfs:comment "Branch name a PipelineRun ran against." ;
|
|
179
|
-
rdfs:domain :PipelineRun ;
|
|
181
|
+
rdfs:domain core:PipelineRun ;
|
|
180
182
|
rdfs:range xsd:string .
|
|
181
183
|
|
|
182
184
|
:event a owl:DatatypeProperty ;
|
|
183
185
|
rdfs:label "event" ;
|
|
184
186
|
rdfs:comment "Triggering event of a PipelineRun (push, pull_request, schedule, workflow_dispatch)." ;
|
|
185
|
-
rdfs:domain :PipelineRun ;
|
|
187
|
+
rdfs:domain core:PipelineRun ;
|
|
186
188
|
rdfs:range xsd:string .
|
|
187
189
|
|
|
188
190
|
:runStartedAt a owl:DatatypeProperty ;
|
|
189
191
|
rdfs:label "run started at" ;
|
|
190
192
|
rdfs:comment "Timestamp a PipelineRun started executing." ;
|
|
191
|
-
rdfs:domain :PipelineRun ;
|
|
193
|
+
rdfs:domain core:PipelineRun ;
|
|
192
194
|
rdfs:range xsd:dateTime .
|
|
193
195
|
|
|
194
196
|
:runUpdatedAt a owl:DatatypeProperty ;
|
|
195
197
|
rdfs:label "run updated at" ;
|
|
196
198
|
rdfs:comment "Timestamp a PipelineRun was last updated." ;
|
|
197
|
-
rdfs:domain :PipelineRun ;
|
|
199
|
+
rdfs:domain core:PipelineRun ;
|
|
198
200
|
rdfs:range xsd:dateTime .
|
|
199
201
|
|
|
200
202
|
:durationSeconds a owl:DatatypeProperty ;
|
|
201
203
|
rdfs:label "duration seconds" ;
|
|
202
204
|
rdfs:comment "Wall-clock duration in seconds of a PipelineRun (runUpdatedAt - runStartedAt)." ;
|
|
203
|
-
rdfs:domain :PipelineRun ;
|
|
205
|
+
rdfs:domain core:PipelineRun ;
|
|
204
206
|
rdfs:range xsd:integer .
|
|
205
207
|
|
|
206
|
-
:startedAt a owl:DatatypeProperty ;
|
|
207
|
-
rdfs:label "started at" ;
|
|
208
|
-
rdfs:comment "Timestamp a CheckRun started executing." ;
|
|
209
|
-
rdfs:domain :CheckRun ;
|
|
210
|
-
rdfs:range xsd:dateTime .
|
|
211
|
-
|
|
212
208
|
:completedAt a owl:DatatypeProperty ;
|
|
213
209
|
rdfs:label "completed at" ;
|
|
214
210
|
rdfs:comment "Timestamp a CheckRun finished executing." ;
|
|
215
211
|
rdfs:domain :CheckRun ;
|
|
216
212
|
rdfs:range xsd:dateTime .
|
|
217
213
|
|
|
218
|
-
<
|
|
214
|
+
<https://knuckles-team.github.io/ontology/connector/github> a owl:Ontology ;
|
|
219
215
|
rdfs:label "GitHub Ontology" ;
|
|
220
216
|
rdfs:comment """GitHub source-control, code-review and CI/CD model — organizations,
|
|
221
217
|
repositories, pull requests, issues, releases, branches, commits, workflows and
|
|
@@ -22,83 +22,3 @@ shape:CheckRunGovernanceShape a sh:NodeShape ;
|
|
|
22
22
|
sh:path :provenanceReference ;
|
|
23
23
|
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
24
24
|
] .
|
|
25
|
-
|
|
26
|
-
shape:IssueGovernanceShape a sh:NodeShape ;
|
|
27
|
-
sh:targetClass :Issue ;
|
|
28
|
-
sh:closed false ;
|
|
29
|
-
sh:property [
|
|
30
|
-
sh:path :sourceRecordRef ;
|
|
31
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
32
|
-
] ;
|
|
33
|
-
sh:property [
|
|
34
|
-
sh:path :tenantReference ;
|
|
35
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
36
|
-
] ;
|
|
37
|
-
sh:property [
|
|
38
|
-
sh:path :accessPolicyReference ;
|
|
39
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
40
|
-
] ;
|
|
41
|
-
sh:property [
|
|
42
|
-
sh:path :provenanceReference ;
|
|
43
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
44
|
-
] .
|
|
45
|
-
|
|
46
|
-
shape:OrganizationGovernanceShape a sh:NodeShape ;
|
|
47
|
-
sh:targetClass :Organization ;
|
|
48
|
-
sh:closed false ;
|
|
49
|
-
sh:property [
|
|
50
|
-
sh:path :sourceRecordRef ;
|
|
51
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
52
|
-
] ;
|
|
53
|
-
sh:property [
|
|
54
|
-
sh:path :tenantReference ;
|
|
55
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
56
|
-
] ;
|
|
57
|
-
sh:property [
|
|
58
|
-
sh:path :accessPolicyReference ;
|
|
59
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
60
|
-
] ;
|
|
61
|
-
sh:property [
|
|
62
|
-
sh:path :provenanceReference ;
|
|
63
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
64
|
-
] .
|
|
65
|
-
|
|
66
|
-
shape:WorkflowGovernanceShape a sh:NodeShape ;
|
|
67
|
-
sh:targetClass :Workflow ;
|
|
68
|
-
sh:closed false ;
|
|
69
|
-
sh:property [
|
|
70
|
-
sh:path :sourceRecordRef ;
|
|
71
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
72
|
-
] ;
|
|
73
|
-
sh:property [
|
|
74
|
-
sh:path :tenantReference ;
|
|
75
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
76
|
-
] ;
|
|
77
|
-
sh:property [
|
|
78
|
-
sh:path :accessPolicyReference ;
|
|
79
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
80
|
-
] ;
|
|
81
|
-
sh:property [
|
|
82
|
-
sh:path :provenanceReference ;
|
|
83
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
84
|
-
] .
|
|
85
|
-
|
|
86
|
-
shape:WorkflowRunGovernanceShape a sh:NodeShape ;
|
|
87
|
-
sh:targetClass :WorkflowRun ;
|
|
88
|
-
sh:closed false ;
|
|
89
|
-
sh:property [
|
|
90
|
-
sh:path :sourceRecordRef ;
|
|
91
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
92
|
-
] ;
|
|
93
|
-
sh:property [
|
|
94
|
-
sh:path :tenantReference ;
|
|
95
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
96
|
-
] ;
|
|
97
|
-
sh:property [
|
|
98
|
-
sh:path :accessPolicyReference ;
|
|
99
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
100
|
-
] ;
|
|
101
|
-
sh:property [
|
|
102
|
-
sh:path :provenanceReference ;
|
|
103
|
-
sh:minCount 1 ; sh:maxCount 1 ; sh:datatype xsd:string
|
|
104
|
-
] .
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: github-actions-ci-review
|
|
3
3
|
skill_type: skill
|
|
4
4
|
description: >-
|
|
5
|
-
Review GitHub Actions CI results across an organization, a user, or a single repository via the github-agent MCP server — enumerate repos, list workflow runs (filterable to failures), drill into a run's jobs, and read a job's logs. Use when the agent must check CI health for an org/user/repo, find red pipelines, or read why a run/job failed.
|
|
5
|
+
Review GitHub Actions CI results across an organization, a user, or a single repository via the github-agent MCP server — enumerate repos, list workflow runs (filterable to failures), drill into a run's jobs, and read a job's logs. Use when the agent must check CI health for an org/user/repo, find red pipelines, or read why a run/job failed.
|
|
6
6
|
license: MIT
|
|
7
7
|
tags: []
|
|
8
8
|
metadata:
|
|
@@ -11,6 +11,8 @@ metadata:
|
|
|
11
11
|
---
|
|
12
12
|
# Github Actions Ci Review
|
|
13
13
|
|
|
14
|
+
Scope: Review GitHub Actions CI results across an organization, a user, or a single repository via the github-agent MCP server — enumerate repos, list workflow runs (filterable to failures), drill into a run's jobs, and read a job's logs. Use when the agent must check CI health for an org/user/repo, find red pipelines, or read why a run/job failed. Do NOT use to gate a single PR's merge on CI (github-pull-request-review), to trigger a deploy workflow (github-repository-management), or to manage issues (github-issue-tracking).
|
|
15
|
+
|
|
14
16
|
Typed github_* tools take owner and repo explicitly; resolve both before acting.
|
|
15
17
|
|
|
16
18
|
## Rules
|
|
@@ -19,6 +21,22 @@ Typed github_* tools take owner and repo explicitly; resolve both before acting.
|
|
|
19
21
|
- Read first, then change, then read the object back.
|
|
20
22
|
- Delete, remove and merge-class tools take confirm=true or an explicit request; ask first.
|
|
21
23
|
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. Resolve the target with `github_get_repositories`(owner) for an org or user, or take the given owner and repo. Verify each repository name exists in the result.
|
|
27
|
+
2. List recent runs with `github_get_workflow_runs`(owner, repo, status="failure"). Verify every returned run carries a run_id and a conclusion.
|
|
28
|
+
3. Drill into one failing run with `github_get_workflow_run_jobs`(owner, repo, run_id). Verify the failed job and its job_id are identified.
|
|
29
|
+
4. Read the failure with `github_get_workflow_job_logs`(owner, repo, job_id). Verify the log shows the failing step and its error text.
|
|
30
|
+
5. Report each red workflow with its run_id, failed job and cause. Only on request call `github_rerun_workflow_run`(owner, repo, run_id) and verify the new run appears in `github_get_workflow_runs`(owner, repo).
|
|
31
|
+
|
|
32
|
+
## Failure recovery
|
|
33
|
+
|
|
34
|
+
| Failure | Cause | Recovery |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| HTTP 401 or 403 from a github_* tool | `GITHUB_TOKEN` is missing, expired or lacks the scope for this owner | Set a valid `GITHUB_TOKEN` with the needed scope in the server environment, and call `github_get_repository`(owner, repo) to verify it returns the repository |
|
|
37
|
+
| Empty run list | The status or branch filter excludes everything, or the repository has no workflows | Call `github_get_workflows`(owner, repo) to confirm workflows exist and drop the status or branch filter |
|
|
38
|
+
| Job logs return 404 or empty | The job_id belongs to another run or the logs expired | Re-read the job_id from `github_get_workflow_run_jobs`(owner, repo, run_id) and call `github_get_workflow_job_logs` with that id |
|
|
39
|
+
|
|
22
40
|
## Task workflows
|
|
23
41
|
|
|
24
42
|
### review-ci-results
|
|
@@ -37,6 +37,22 @@ owning spec row in the commit trailer.
|
|
|
37
37
|
- One logical change per commit, with `Spec: <ID>` and the assisting agent
|
|
38
38
|
trailer adjacent in the final paragraph.
|
|
39
39
|
|
|
40
|
+
## Steps
|
|
41
|
+
|
|
42
|
+
1. Find the owning spec row with `git grep -n "<term>" -- specs`. Verify one row owns the change before editing code.
|
|
43
|
+
2. Make the smallest change in `github_agent/` (API mapping, MCP tool or skill content), reusing existing SDK clients. Verify with `git diff --stat` that only connector paths changed.
|
|
44
|
+
3. Run the focused tests, for example `uv run --all-extras pytest tests/test_default_content_surfaces.py -q`. Verify the run reports no failures.
|
|
45
|
+
4. Run the repository gate `uvx pre-commit run --all-files`. Verify every hook reports Passed.
|
|
46
|
+
5. Commit explicit paths with `git add -- <paths>` and a `Spec: <ID>` trailer adjacent to the `Co-Authored-By:` trailer. Verify `git diff --cached --name-status` lists only intended files.
|
|
47
|
+
|
|
48
|
+
## Failure recovery
|
|
49
|
+
|
|
50
|
+
| Failure | Cause | Recovery |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| Gate hook fails | A shared hook found a standard violation in the changed files | Read the hook output, fix the named file, and rerun `uvx pre-commit run --all-files` until it passes; never bypass the hook |
|
|
53
|
+
| Tests need an environment that is missing | The locked environment is not synced | Run `uv sync --locked --all-extras` from the checkout root and rerun the focused pytest command |
|
|
54
|
+
| No owning spec row found | The change is new or the search term is wrong | Search with a broader `git grep -n` term in `specs` and extend the closest row instead of adding new requirement text |
|
|
55
|
+
|
|
40
56
|
## Setup and gates
|
|
41
57
|
|
|
42
58
|
Use the pinned environment from `uv sync --locked --all-extras`. Run the
|