Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9ed4a5a
docs: make AGENTS.md the shared agent canon and slim CLAUDE.md to an …
zelentsov-dev Sep 23, 2026
e607b50
docs: claim only what the ask list covers and point the build excepti…
zelentsov-dev Sep 23, 2026
67e95c6
chore(contract): re-baseline the operation manifest to Apple API 4.5
zelentsov-dev Sep 23, 2026
261ef52
fix(subscriptions)!: require plan_types for adjusted equalizations
zelentsov-dev Sep 23, 2026
7972e38
test(contract): move Apple 4.4.1 pins in tests and docs to 4.5
zelentsov-dev Sep 23, 2026
44ec237
test(contract): count the three Apple 4.5 inputs in classification in…
zelentsov-dev Sep 23, 2026
5e04643
Merge pull request #31 from zelentsov-dev/chore/apple-spec-4.5
zelentsov-dev Sep 24, 2026
9ee25eb
Merge develop into docs/agents-canon (Apple spec 4.5 baseline from #31)
zelentsov-dev Sep 24, 2026
13abadd
Merge pull request #30 from zelentsov-dev/docs/agents-canon
zelentsov-dev Sep 24, 2026
9f36be5
Add guarded App Asset Library support for Apple API 4.5.1
zelentsov-dev Oct 15, 2026
560bae1
Integrate develop while preserving legacy subscription call compatibi…
zelentsov-dev Oct 15, 2026
2a058ff
Use a scoped Apple response in legacy equalization regression
zelentsov-dev Oct 15, 2026
688f672
Fix nested video poster state after live MCP acceptance
zelentsov-dev Oct 15, 2026
0c2288d
fix(subscriptions): align plan availability paging and adjusted equal…
zelentsov-dev Oct 19, 2026
189e115
docs(release): prepare v4.2.0 changelog and Mint installation pin
zelentsov-dev Oct 19, 2026
d244215
Merge pull request #32 from zelentsov-dev/features/apple-api-4-5-1
zelentsov-dev Oct 19, 2026
0452ad5
chore: merge main v4.1.6 into develop
zelentsov-dev Oct 19, 2026
852d7df
Merge pull request #33 from zelentsov-dev/chore/sync-main-into-develop
zelentsov-dev Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 83 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ jobs:
swift test --disable-automatic-resolution 2>&1 \
| tee "$RUNNER_TEMP/asc_mcp_tests.log"

- name: Test Apple specification drift checks
run: python3 -m unittest discover -s .github/workflows/scripts -p 'test_*.py'

- name: Publish test summary
if: always()
shell: bash
Expand Down Expand Up @@ -229,32 +232,19 @@ jobs:
--generated-at 2026-05-07
test -s "$RUNNER_TEMP/asc_openapi_coverage.md"

- name: App Store Connect operation contract
- name: Pinned App Store Connect operation contract
shell: bash
run: |
set -euo pipefail

contract_directory="$RUNNER_TEMP/asc_openapi_contract"
rm -rf "$contract_directory"
mkdir -p "$contract_directory"
curl --fail --show-error --silent --location \
--proto '=https' --proto-redir '=https' \
--connect-timeout 15 --max-time 120 \
--retry 3 --retry-delay 2 --retry-all-errors \
--output "$contract_directory/spec.zip" \
https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip
shasum -a 256 "$contract_directory/spec.zip" \
cp Tests/ASCMCPTests/Fixtures/OpenAPI/app-store-connect-4.5.1.oas.json \
"$contract_directory/openapi.oas.json"
shasum -a 256 "$contract_directory/openapi.oas.json" \
> "$contract_directory/specification.sha256"

spec_entry="$(
unzip -Z1 "$contract_directory/spec.zip" \
| grep -E '(^|/)openapi\.oas[^/]*\.json$'
)"
test -n "$spec_entry"
test "$(printf '%s\n' "$spec_entry" | grep -c .)" -eq 1
unzip -p "$contract_directory/spec.zip" "$spec_entry" \
> "$contract_directory/openapi.oas.json"

.build/release/asc-mcp openapi-contract-check \
--spec "$contract_directory/openapi.oas.json" \
--json-output "$contract_directory/report.json" \
Expand All @@ -268,6 +258,12 @@ jobs:
--spec "$contract_directory/openapi.oas.json" \
--strict

- name: Controlled Asset Library MCP process
run: |
python3 -B .github/workflows/scripts/assets_mcp_smoke.py \
--binary "$RUNNER_TEMP/asc_openapi_contract/relocated/asc-mcp" \
--expected-version "$(awk -F'\"' '/static let current =/ { print $2 }' Sources/asc-mcp/Core/ServerVersion.swift)"

- name: Verify generated OpenAPI coverage
shell: bash
run: |
Expand Down Expand Up @@ -307,18 +303,77 @@ jobs:
CONTRACT_JOB_STATUS: ${{ job.status }}
run: |
printf '%s\n' \
'## Release & Apple Contract' \
'## Release & Pinned Apple Contract' \
"- Status: $CONTRACT_JOB_STATUS" \
"- Ref: $GITHUB_REF_NAME" \
"- Run attempt: $GITHUB_RUN_ATTEMPT" \
'- Contract mode: strict' \
'- Contract mode: strict, checked-in Apple snapshot' \
'- Artifacts: contract reports and release build log' \
>> "$GITHUB_STEP_SUMMARY"

latest-apple-contract:
name: Latest Apple Contract Drift
needs: promotion-lineage
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
ref: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'refs/heads/main' || github.ref }}

- name: Download current Apple specification
shell: bash
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/asc_latest_openapi"
curl --fail --show-error --silent --location \
--proto '=https' --proto-redir '=https' \
--connect-timeout 15 --max-time 120 --max-filesize 33554432 \
--retry 3 --retry-delay 2 --retry-all-errors \
--output "$RUNNER_TEMP/asc_latest_openapi/spec.zip" \
https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip

- name: Require review of every latest-spec change
shell: bash
run: |
set -euo pipefail
python3 .github/workflows/scripts/apple_spec_drift.py \
--pinned Tests/ASCMCPTests/Fixtures/OpenAPI/app-store-connect-4.5.1.oas.json \
--latest-zip "$RUNNER_TEMP/asc_latest_openapi/spec.zip" \
--output-directory "$RUNNER_TEMP/asc_latest_openapi"

- name: Publish latest-spec summary
if: always()
shell: bash
env:
DRIFT_JOB_STATUS: ${{ job.status }}
run: |
printf '%s\n' \
'## Latest Apple Contract Drift' \
"- Status: $DRIFT_JOB_STATUS" \
'- Release publishing requires this check to pass.' \
>> "$GITHUB_STEP_SUMMARY"
if [[ -f "$RUNNER_TEMP/asc_latest_openapi/latest-report.md" ]]; then
cat "$RUNNER_TEMP/asc_latest_openapi/latest-report.md" >> "$GITHUB_STEP_SUMMARY"
fi

- name: Upload latest-spec drift reports
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: app-store-connect-latest-drift-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/asc_latest_openapi/latest-report.json
${{ runner.temp }}/asc_latest_openapi/latest-report.md
if-no-files-found: warn
retention-days: 30

publish-release:
name: Mint MCP Smoke & Publish Release
if: startsWith(github.ref, 'refs/tags/v')
needs: [promotion-lineage, tests, release-contract]
needs: [promotion-lineage, tests, release-contract, latest-apple-contract]
runs-on: macos-15
timeout-minutes: 30
permissions:
Expand Down Expand Up @@ -347,10 +402,17 @@ jobs:
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
test "$("$HOME/.mint/bin/asc-mcp" --version)" = "asc-mcp $version"
expected_tool_count="$(python3 - <<'PY'
import json
from pathlib import Path
directory = Path('Sources/asc-mcp/Resources/OperationManifest/tools')
print(sum(len(json.loads(path.read_text())['tools']) for path in directory.glob('*.json')))
PY
)"
python3 Scripts/ci/mcp_stdio_smoke.py \
--binary "$HOME/.mint/bin/asc-mcp" \
--expected-version "$version" \
--expected-tool-count 502 \
--expected-tool-count "$expected_tool_count" \
--expected-prefix xcode_cloud_ \
--expected-prefix-count 42 \
--error-tool xcode_cloud_workflows_create \
Expand Down
159 changes: 159 additions & 0 deletions .github/workflows/scripts/apple_spec_drift.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import argparse
import hashlib
import json
import re
import sys
import zipfile
from pathlib import Path


MAX_SPEC_BYTES = 64 * 1024 * 1024
MAX_CHANGED_POINTERS = 5000
HTTP_METHODS = {"get", "put", "post", "delete", "patch", "head", "options", "trace"}


def read_spec(path, zipped=False):
if zipped:
with zipfile.ZipFile(path) as archive:
entries = [
info for info in archive.infolist()
if re.search(r"(^|/)openapi\.oas[^/]*\.json$", info.filename)
]
if len(entries) != 1 or entries[0].file_size > MAX_SPEC_BYTES:
raise ValueError("Apple archive must contain exactly one bounded OpenAPI JSON document.")
with archive.open(entries[0]) as stream:
raw = stream.read(MAX_SPEC_BYTES + 1)
else:
with path.open("rb") as stream:
raw = stream.read(MAX_SPEC_BYTES + 1)
if len(raw) > MAX_SPEC_BYTES:
raise ValueError("OpenAPI document exceeds the size limit.")
document = json.loads(raw)
if not isinstance(document.get("paths"), dict) or not isinstance(document.get("info"), dict):
raise ValueError("OpenAPI document must contain paths and info objects.")
return raw, document


def operation_index(document):
operations = {}
for path, item in document["paths"].items():
for method, operation in item.items():
if method not in HTTP_METHODS or not isinstance(operation, dict):
continue
identifier = operation.get("operationId")
if not isinstance(identifier, str) or identifier in operations:
raise ValueError("OpenAPI operations require unique operation IDs.")
operations[identifier] = {"method": method.upper(), "path": path, "contract": operation}
return operations


def changed_pointers(before, after):
paths = []
count = 0

def record(path):
nonlocal count
count += 1
if len(paths) < MAX_CHANGED_POINTERS:
paths.append(path or "/")

def walk(left, right, path):
if type(left) is not type(right):
record(path)
elif isinstance(left, dict):
for key in sorted(left.keys() | right.keys()):
child = path + "/" + key.replace("~", "~0").replace("/", "~1")
if key not in left or key not in right:
record(child)
else:
walk(left[key], right[key], child)
elif isinstance(left, list):
if len(left) != len(right):
record(path)
else:
for index, (old, new) in enumerate(zip(left, right)):
walk(old, new, path + "/" + str(index))
elif left != right:
record(path)

walk(before, after, "")
return paths, count


def compare_specs(pinned_raw, pinned, latest_raw, latest):
old_operations = operation_index(pinned)
new_operations = operation_index(latest)
old_ids = old_operations.keys()
new_ids = new_operations.keys()
pointers, pointer_count = changed_pointers(pinned, latest)
pinned_sha = hashlib.sha256(pinned_raw).hexdigest()
latest_sha = hashlib.sha256(latest_raw).hexdigest()
return {
"status": "unchanged" if pinned_sha == latest_sha else "review_required",
"pinnedVersion": pinned["info"].get("version"),
"latestVersion": latest["info"].get("version"),
"pinnedSHA256": pinned_sha,
"latestSHA256": latest_sha,
"pinnedPathCount": len(pinned["paths"]),
"latestPathCount": len(latest["paths"]),
"pinnedOperationCount": len(old_operations),
"latestOperationCount": len(new_operations),
"addedOperations": sorted(new_ids - old_ids),
"removedOperations": sorted(old_ids - new_ids),
"changedOperations": sorted(key for key in old_ids & new_ids if old_operations[key] != new_operations[key]),
"changedJSONPointers": pointers,
"changedJSONPointerCount": pointer_count,
"changedJSONPointersTruncated": pointer_count > len(pointers),
"sourceURL": "https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip",
}


def markdown(report):
def safe(value):
return str(value).replace("&", "&amp;").replace("`", "&#96;").replace("<", "&lt;").replace("\n", " ").replace("\r", " ")

lines = [
"# Latest Apple OpenAPI drift",
"",
f"Status: **{report['status']}**",
"",
f"Pinned version: `{safe(report['pinnedVersion'])}`; latest version: `{safe(report['latestVersion'])}`.",
"",
f"Pinned SHA-256: `{report['pinnedSHA256']}`",
"",
f"Latest SHA-256: `{report['latestSHA256']}`",
"",
"A changed hash requires a reviewed snapshot and contract update before release. Updating only the hash is not acceptance.",
"This comparison includes referenced schemas and documentation changes; it does not prove runtime compatibility.",
"",
]
for key in ["addedOperations", "removedOperations", "changedOperations", "changedJSONPointers"]:
values = report[key]
lines.extend([f"## {key} ({len(values)})", ""])
lines.extend("- `" + safe(value) + "`" for value in values[:100])
if len(values) > 100:
lines.append("- Additional entries are available in the JSON report.")
lines.append("")
if report["changedJSONPointersTruncated"]:
lines.append(f"The JSON pointer list is bounded; total changed locations: {report['changedJSONPointerCount']}.")
return "\n".join(lines) + "\n"


def main():
parser = argparse.ArgumentParser()
parser.add_argument("--pinned", type=Path, required=True)
parser.add_argument("--latest-zip", type=Path, required=True)
parser.add_argument("--output-directory", type=Path, required=True)
args = parser.parse_args()
pinned_raw, pinned = read_spec(args.pinned)
latest_raw, latest = read_spec(args.latest_zip, zipped=True)
report = compare_specs(pinned_raw, pinned, latest_raw, latest)
args.output_directory.mkdir(parents=True, exist_ok=True)
(args.output_directory / "latest-report.json").write_text(json.dumps(report, indent=2) + "\n")
(args.output_directory / "latest-report.md").write_text(markdown(report))
print("Latest Apple OpenAPI: " + report["status"])
return 0 if report["status"] == "unchanged" else 1


if __name__ == "__main__":
sys.exit(main())
Loading
Loading