Skip to content

Commit 55abd7e

Browse files
fix(governance): preserve contracts with concrete typed outputs
Retain advertised legacy input schemas and route-specific validation while using shared modern DTO serialization. Cover governance levels, label mutations, and empty/null custom property writes over the MCP wire. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 94055ff commit 55abd7e

22 files changed

Lines changed: 2098 additions & 3418 deletions

‎README.md‎

Lines changed: 47 additions & 47 deletions
Large diffs are not rendered by default.

‎pkg/github/__toolsnaps__/create_repository_ruleset.snap‎

Lines changed: 275 additions & 542 deletions
Large diffs are not rendered by default.

‎pkg/github/__toolsnaps__/create_repository_ruleset_typed.snap‎

Lines changed: 0 additions & 686 deletions
This file was deleted.

‎pkg/github/__toolsnaps__/custom_properties_read.snap‎

Lines changed: 128 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,23 @@
66
},
77
"description": "Read custom properties at the repository, organization, or enterprise level. At the repository level this returns the property values assigned to a repository; at the organization and enterprise levels it returns the property definitions (schema). Select the level with the 'level' parameter.",
88
"inputSchema": {
9-
"additionalProperties": true,
109
"properties": {
1110
"enterprise": {
12-
"anyOf": [
13-
{
14-
"description": "Enterprise slug. Required when level is 'enterprise'.",
15-
"type": "string"
16-
},
17-
{
18-
"description": "Other JSON values are validated by the legacy handler."
19-
}
20-
],
21-
"description": "Enterprise slug. Required when level is 'enterprise'. Validated by the legacy handler to preserve its error behavior."
11+
"description": "Enterprise slug. Required when level is 'enterprise'.",
12+
"type": "string"
2213
},
2314
"level": {
24-
"anyOf": [
25-
{
26-
"description": "The level at which custom properties are managed:\n- 'repository': The custom property VALUES assigned to a repository (requires 'owner' and 'repo').\n- 'organization': The custom property DEFINITIONS (schema) for an organization (requires 'org').\n- 'enterprise': The custom property DEFINITIONS (schema) for an enterprise (requires 'enterprise').",
27-
"enum": [
28-
"repository",
29-
"organization",
30-
"enterprise"
31-
],
32-
"type": "string"
33-
},
34-
{
35-
"description": "Other JSON values are validated by the legacy handler."
36-
}
15+
"description": "The level at which custom properties are managed:\n- 'repository': The custom property VALUES assigned to a repository (requires 'owner' and 'repo').\n- 'organization': The custom property DEFINITIONS (schema) for an organization (requires 'org').\n- 'enterprise': The custom property DEFINITIONS (schema) for an enterprise (requires 'enterprise').",
16+
"enum": [
17+
"repository",
18+
"organization",
19+
"enterprise"
3720
],
38-
"description": "The level at which custom properties are managed:\n- 'repository': The custom property VALUES assigned to a repository (requires 'owner' and 'repo').\n- 'organization': The custom property DEFINITIONS (schema) for an organization (requires 'org').\n- 'enterprise': The custom property DEFINITIONS (schema) for an enterprise (requires 'enterprise'). Required by the legacy handler. Validated by the legacy handler to preserve its error behavior."
21+
"type": "string"
3922
},
4023
"org": {
41-
"anyOf": [
42-
{
43-
"description": "Organization name. Required when level is 'organization'.",
44-
"type": "string"
45-
},
46-
{
47-
"description": "Other JSON values are validated by the legacy handler."
48-
}
49-
],
50-
"description": "Organization name. Required when level is 'organization'. Validated by the legacy handler to preserve its error behavior."
24+
"description": "Organization name. Required when level is 'organization'.",
25+
"type": "string"
5126
},
5227
"owner": {
5328
"description": "Repository owner. Required when level is 'repository'.",
@@ -58,22 +33,133 @@
5833
"type": "string"
5934
}
6035
},
36+
"required": [
37+
"level"
38+
],
6139
"type": "object"
6240
},
6341
"name": "custom_properties_read",
6442
"outputSchema": {
65-
"anyOf": [
66-
{
43+
"additionalProperties": false,
44+
"properties": {
45+
"definitions": {
6746
"items": {
68-
"additionalProperties": true,
69-
"description": "A custom property value or definition returned by the selected level.",
47+
"additionalProperties": false,
48+
"properties": {
49+
"allowed_values": {
50+
"items": {
51+
"type": "string"
52+
},
53+
"type": "array"
54+
},
55+
"default_value": {
56+
"description": "Repository level only: the value to assign. A string, an array of strings, or null to clear the value.",
57+
"oneOf": [
58+
{
59+
"type": "string"
60+
},
61+
{
62+
"items": {
63+
"type": "string"
64+
},
65+
"type": "array"
66+
},
67+
{
68+
"type": "null"
69+
}
70+
]
71+
},
72+
"description": {
73+
"type": "string"
74+
},
75+
"property_name": {
76+
"type": "string"
77+
},
78+
"require_explicit_values": {
79+
"type": "boolean"
80+
},
81+
"required": {
82+
"type": "boolean"
83+
},
84+
"value_type": {
85+
"enum": [
86+
"",
87+
"string",
88+
"single_select",
89+
"multi_select",
90+
"true_false",
91+
"url"
92+
],
93+
"type": "string"
94+
},
95+
"values_editable_by": {
96+
"enum": [
97+
"org_actors",
98+
"org_and_repo_actors"
99+
],
100+
"type": "string"
101+
}
102+
},
103+
"required": [
104+
"property_name",
105+
"value_type"
106+
],
70107
"type": "object"
71108
},
72109
"type": "array"
73110
},
74-
{
75-
"type": "null"
111+
"level": {
112+
"enum": [
113+
"repository",
114+
"organization",
115+
"enterprise"
116+
],
117+
"type": "string"
118+
},
119+
"method": {
120+
"enum": [
121+
"read"
122+
],
123+
"type": "string"
124+
},
125+
"values": {
126+
"items": {
127+
"additionalProperties": false,
128+
"properties": {
129+
"property_name": {
130+
"type": "string"
131+
},
132+
"value": {
133+
"description": "Repository level only: the value to assign. A string, an array of strings, or null to clear the value.",
134+
"oneOf": [
135+
{
136+
"type": "string"
137+
},
138+
{
139+
"items": {
140+
"type": "string"
141+
},
142+
"type": "array"
143+
},
144+
{
145+
"type": "null"
146+
}
147+
]
148+
}
149+
},
150+
"required": [
151+
"property_name",
152+
"value"
153+
],
154+
"type": "object"
155+
},
156+
"type": "array"
76157
}
77-
]
158+
},
159+
"required": [
160+
"method",
161+
"level"
162+
],
163+
"type": "object"
78164
}
79165
}

‎pkg/github/__toolsnaps__/custom_properties_read_typed.snap‎

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)