Skip to content

Fix/example schema contract tests - #2

Merged
oddtitoreal merged 2 commits into
mainfrom
fix/example-schema-contract-tests
Aug 13, 2026
Merged

oddtitoreal merged 2 commits into
mainfrom
fix/example-schema-contract-tests

Conversation

@oddtitoreal

Copy link
Copy Markdown
Owner

No description provided.

…ples

Adds tests/test_examples.py which validates every examples/basic-case/*.json
against its phase schema, plus a guard that fails on unmapped examples.
Currently fails 9/9, exposing the examples<->schema drift.
Regenerates all 9 examples/basic-case/*.json to conform to schemas/:
- meta.validated_by_human -> false (draft state)
- canonical meta.mode per phase (convergence, brand_archaeology,
  refusal_register, narrative_synthesis, community_cocreation, ...)
- payload restructured to schema shape (brand_dna, competitive_map/
  white_spaces, prototypes, refusals, narrative_system, co_creation,
  guardian_report), removing fields barred by additionalProperties:false

All 9 now pass tests/test_examples.py; full suite 30 passed.
@oddtitoreal
oddtitoreal merged commit cc990eb into main Aug 13, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d872f5009f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"how_tested": "6-month pilot with voting mechanism for 20 contested titles",
"expected_insight": "What level of community participation can we sustain without overwhelm?",
"governance_question": "Does participatory curation strengthen community ownership or create conflict?"
"prototype_id": "proto-civic-hub",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the walkthrough to match the rewritten examples

When readers follow the companion examples/basic-case/README.md, its Phase 3 section still describes three delegated/participatory/algorithmic governance prototypes, while this artifact now contains two civic-hub/federated-network service prototypes; the Phase 2 and 4–6 descriptions are similarly based on the removed payloads. Because the README presents these files as a complete worked example and template, it now teaches content and structures that users will not find in the JSON, so it should be updated alongside the rewrite.

Useful? React with 👍 / 👎.

Comment thread tests/test_examples.py
assert example_path.exists(), f"missing example: {example_path}"
assert schema_path.exists(), f"missing schema: {schema_path}"

validator = Draft202012Validator(_load(schema_path))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce schema formats in the contract test

When an example contains a malformed generated_at or refusal date, this test still passes because jsonschema treats format as annotation unless a format checker is supplied. The runtime validator in src/specula_agent/schemas.py uses FormatChecker(), so the new contract test does not actually enforce the same schema contract and can allow an example that production validation rejects.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant