test(contracts): validate howl.* envelopes against vendored schema (Go, no howldream import) - #41
Merged
Conversation
…o, no howldream import) Adds contracts/howl/, a pure-Go package that loads and compiles the vendored howl.* JSON Schema files (copied from howldream commit bd10b18, pinned in SOURCE.md) and validates envelopes against them using github.com/santhosh-tekuri/jsonschema/v5. This is the cross-language contract test referenced in howldream/issues.md item 1: contract_test.go proves a real howl.exploration_result/v1 envelope validates, and that forged authority.executable, an out-of-enum verification_status, an unsupported schema_version, a missing required field, an injected privileged field, and a nested candidate with forged trust all fail validation — with no Python, no howldream import, and no network access at test time. Un-ignores go.sum (previously gitignored when this module had zero dependencies) since this is the module's first external dependency and needs checksum pinning for reproducible builds. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RrPsEcYPRHDjPnZVViLi48
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.
Summary
contracts/howl/, a pure-Go package that loads and compiles the vendoredhowl.*JSON Schema files (copied fromhowldream@bd10b18, pinned incontracts/howl/SOURCE.md) and validates envelopes against them usinggithub.com/santhosh-tekuri/jsonschema/v5.howldream/issues.mditem 1: proof that the schema is useful to a consumer with no Python, nohowldreamimport, and no network access at test time.contract_test.gocovers: a valid envelope validates; missing required field fails; unsupportedschema_versionfails; out-of-enumverification_statusfails; forgedauthority.executable=truefails; injected privileged fields (executor,execution_capability,approved,bypass_review) fail viaadditionalProperties: false; a nested candidate with forgedtrust="VERIFIED"fails; all five vendored schemas compile.go.sum(previously gitignored when this module had zero dependencies) since this introduces the module's first external dependency.Test plan
gofmt -l .— cleango vet ./...— cleango build ./...— cleango test ./...— all packages pass, including the newcontracts/howl(9 test cases) and the existingapps/candidate_evaluator(confirms the recently-merged evaluator still passes onmain)🤖 Generated with Claude Code
https://claude.ai/code/session_01RrPsEcYPRHDjPnZVViLi48