Repository navigation
feat: every public sheet implements an app-published schema contract - #212
Merged
Merged
Conversation
The Zod schemas stay the source of record shape; this repo publishes them as versioned gitsheets contracts and the data repo adopts them, so gitsheets enforces shape on every writer, not just the API. Specifies generation rules, immutability, adoption from a tagged raw URL, boot verification, and the order of a contract change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
…ockstep No structural fallback: the API boots only against the exact contract versions it publishes, and the data repo adopts each version in the same change that publishes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
…ract buildContract() turns each sheet's Zod schema (input side) into a draft-07 gitsheets contract: open, null-free, required sorted. The generated documents are published at contracts/codeforphilly.org/<sheet>/ v<N>.json, and CI's check-contracts fails when a schema change would alter a published version. person-evaluations moves to a generated v2; the hand-authored v1 stays published, unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
Each public sheet must declare exactly the contract version this build publishes (gitsheets declared mode: identity only, no records read, no structural fallback). Also fixes a slug-redirect fixture that minted non-UUID ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
With contracts enforced on every write, the harness's minimal people record and the scrub-data blog posts (publishedAt instead of the schema's postedAt) were rejected. They now write valid records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
apps/api/gitsheets/ now matches codeforphilly-data#empty after it adopted every published contract: each config declares its contract, contracts/ holds the canonical documents and sources.toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj
themightychris
added a commit
that referenced
this pull request
Oct 14, 2026
Every public sheet now implements an app-published contract (#212); this adds `codeforphilly.org/event-series/v1` for the sheet #211 introduces. The pre-contracts JSON-schema file goes with its generator. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WVK3JSficcyHViXj36opqV
themightychris
added a commit
that referenced
this pull request
Oct 14, 2026
Every public sheet now implements an app-published contract (#212); this adds `codeforphilly.org/event-series/v1` for the sheet #211 introduces. The pre-contracts JSON-schema file goes with its generator. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WVK3JSficcyHViXj36opqV
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
plans/sheet-contracts.md. This generalizes #203 to every sheet, with this repo as the publisher.Publishing
buildContract()in@cfp/sharedturns each sheet's Zod schema (the input side) into a draft-07 gitsheets contract that's open for extension and null-free, withrequiredsorted.contracts/codeforphilly.org/<sheet>/v<N>.json.check-contractsstep fails when a schema change would alter a published version; the fix is to bump that sheet's version..gitsheets/schemas/output.person-evaluationsmoves to a generated v2. The hand-authored v1 stays published, unchanged.Adoption (data repo, already pushed in lockstep)
empty,fixtureandlegacy-importadopted every contract from this branch's7fe6b81raw URLs, recorded insources.toml, and every sheet config declaresimplements.gitsheets contracts verifypasses on all three, includinglegacy-import's full laddr import.published(23k+ across 9 sheets) checked clean against these contracts.Verification: at boot the API opens every sheet in gitsheets
declaredmode: identity only, no records read, no structural fallback.Mirror:
apps/api/gitsheets/now matchesempty, includingcontracts/. Tests check that each mirrored contract hashes identically to its published JSON, and that every sheet declares exactly the version this build publishes.Found along the way: contracts rejected three invalid test fixtures: a
publishedAtfield that should bepostedAt, a minimal people record, and non-UUID slug-history ids. All three are fixed.Spec:
storage.md→ "Schema contracts" (generation, immutability, adoption, verification, the lockstep order);spam-exclusion.mdnow points at it.Rollout order: v0.6.0 to production first (the bridge from gitsheets 2.2), then
publishedadopts the contracts together with the release containing this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_013PxDwrzedwQoijkwbqSGKj