From 88cbe8ee3c323e8c6f6f2765fd27a20a5c37c7c0 Mon Sep 17 00:00:00 2001 From: josegironn <30703536+josegironn@users.noreply.github.com> Date: Thu, 23 Jul 2026 23:18:04 -0700 Subject: [PATCH] fix(schemas): move schema host to schemas.major.build, base URL to prod api The published JSON Schemas moved from schemas.major.tech to schemas.major.build, and the sync/drift base URL default was a fictional api.major.tech. - schemas.go: compile IDs -> schemas.major.build (match vendored $id) - Makefile sync-schemas default + schemas-drift.yml base URL -> https://api.prod.major.build - re-vendored project/agent schema bytes ($id only) + SCHEMAS.sha256 - testdata $schema refs -> schemas.major.build Re-run `make sync-schemas` against prod once it serves GET /schemas/{project,agent}.json to confirm byte-for-byte; content already matches. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01RXiDMg9GbDAqPFEXPYK1SH --- .github/workflows/schemas-drift.yml | 2 +- Makefile | 2 +- projects/schemas.go | 8 ++++---- projects/schemas/SCHEMAS.sha256 | 8 ++++---- projects/schemas/agent.schema.json | 2 +- projects/schemas/project.schema.json | 2 +- projects/testdata/valid/project.json | 2 +- projects/testdata/valid/src/agents/triage/agent.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/schemas-drift.yml b/.github/workflows/schemas-drift.yml index 57b9586..6162281 100644 --- a/.github/workflows/schemas-drift.yml +++ b/.github/workflows/schemas-drift.yml @@ -18,7 +18,7 @@ jobs: # this job strict once prod serves GET /schemas/{project,agent}.json. - name: Check vendored schemas against the platform API env: - MAJOR_SCHEMAS_BASE_URL: https://api.major.tech + MAJOR_SCHEMAS_BASE_URL: https://api.prod.major.build run: | set -e status=0 diff --git a/Makefile b/Makefile index 35d06de..d62a8ba 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ release: # Override the source with MAJOR_SCHEMAS_BASE_URL, e.g. against a local dev API: # MAJOR_SCHEMAS_BASE_URL=http://localhost:3301 make sync-schemas sync-schemas: - @base="$${MAJOR_SCHEMAS_BASE_URL:-https://api.major.tech}"; \ + @base="$${MAJOR_SCHEMAS_BASE_URL:-https://api.prod.major.build}"; \ echo "Syncing schemas from $$base..."; \ curl -fsSL "$$base/schemas/project.json" -o projects/schemas/project.schema.json; \ curl -fsSL "$$base/schemas/agent.json" -o projects/schemas/agent.schema.json; \ diff --git a/projects/schemas.go b/projects/schemas.go index e4de3ab..5eb2d0b 100644 --- a/projects/schemas.go +++ b/projects/schemas.go @@ -38,8 +38,8 @@ func ensureSchemas() { c := jsonschema.NewCompiler() for name, id := range map[string]string{ - "schemas/project.schema.json": "https://schemas.major.tech/project.json", - "schemas/agent.schema.json": "https://schemas.major.tech/agent.json", + "schemas/project.schema.json": "https://schemas.major.build/project.json", + "schemas/agent.schema.json": "https://schemas.major.build/agent.json", } { raw, err := SchemaFS.ReadFile(name) if err != nil { @@ -58,12 +58,12 @@ func ensureSchemas() { var err error - projectSchema, err = c.Compile("https://schemas.major.tech/project.json") + projectSchema, err = c.Compile("https://schemas.major.build/project.json") if err != nil { panic("projects: project schema failed to compile: " + err.Error()) } - agentSchema, err = c.Compile("https://schemas.major.tech/agent.json") + agentSchema, err = c.Compile("https://schemas.major.build/agent.json") if err != nil { panic("projects: agent schema failed to compile: " + err.Error()) } diff --git a/projects/schemas/SCHEMAS.sha256 b/projects/schemas/SCHEMAS.sha256 index 47e34a4..247b876 100644 --- a/projects/schemas/SCHEMAS.sha256 +++ b/projects/schemas/SCHEMAS.sha256 @@ -1,4 +1,4 @@ -source: http://localhost:3301 -fetched: 2026-07-24T03:28:48Z -47002e01681b41a1030b88e395897008b370c4a42b465b541e77038f8b2509d1 projects/schemas/project.schema.json -cf84e4941f22d1a759594575154b80c1154e10ac685fa5597ffcc2f53eebe5ed projects/schemas/agent.schema.json +source: https://api.prod.major.build +fetched: 2026-07-24T05:46:31Z +2fdca52b431d214f4e54413d069f6d533e5479b58475c4315df2dc3b8c113c29 projects/schemas/project.schema.json +b198a6c144a32dd01baf7745a4d3cc4a50f2f699d731ba84b7b7b1776e4f6b82 projects/schemas/agent.schema.json diff --git a/projects/schemas/agent.schema.json b/projects/schemas/agent.schema.json index 7b4f6d8..c1eaf77 100644 --- a/projects/schemas/agent.schema.json +++ b/projects/schemas/agent.schema.json @@ -1 +1 @@ -{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://schemas.major.tech/agent.json","title":"Major agent definition","type":"object","properties":{"$schema":{"type":"string"},"slug":{"type":"string","maxLength":63,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":1000},"model":{"type":"string","minLength":1},"systemPrompt":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"file":{"type":"string","minLength":1}},"required":["file"],"additionalProperties":false}]},"env":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"required":["slug","name","systemPrompt"],"additionalProperties":false} \ No newline at end of file +{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://schemas.major.build/agent.json","title":"Major agent definition","type":"object","properties":{"$schema":{"type":"string"},"slug":{"type":"string","maxLength":63,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":1000},"model":{"type":"string","minLength":1},"systemPrompt":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"file":{"type":"string","minLength":1}},"required":["file"],"additionalProperties":false}]},"env":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"required":["slug","name","systemPrompt"],"additionalProperties":false} \ No newline at end of file diff --git a/projects/schemas/project.schema.json b/projects/schemas/project.schema.json index d32db5d..1c86a6a 100644 --- a/projects/schemas/project.schema.json +++ b/projects/schemas/project.schema.json @@ -1 +1 @@ -{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://schemas.major.tech/project.json","title":"Major project definition","type":"object","properties":{"$schema":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":100},"srcDir":{"type":"string","minLength":1}},"required":["name"],"additionalProperties":false} \ No newline at end of file +{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://schemas.major.build/project.json","title":"Major project definition","type":"object","properties":{"$schema":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":100},"srcDir":{"type":"string","minLength":1}},"required":["name"],"additionalProperties":false} \ No newline at end of file diff --git a/projects/testdata/valid/project.json b/projects/testdata/valid/project.json index 663d379..a123286 100644 --- a/projects/testdata/valid/project.json +++ b/projects/testdata/valid/project.json @@ -1,5 +1,5 @@ { - "$schema": "https://schemas.major.tech/project.json", + "$schema": "https://schemas.major.build/project.json", "name": "Valid Project", "srcDir": "src/" } diff --git a/projects/testdata/valid/src/agents/triage/agent.json b/projects/testdata/valid/src/agents/triage/agent.json index 5027faf..a368570 100644 --- a/projects/testdata/valid/src/agents/triage/agent.json +++ b/projects/testdata/valid/src/agents/triage/agent.json @@ -1,5 +1,5 @@ { - "$schema": "https://schemas.major.tech/agent.json", + "$schema": "https://schemas.major.build/agent.json", "slug": "triage", "name": "Support Triage", "description": "Triages inbound tickets",