Skip to content

feat(m010): harden challenge schemas, fixtures, and verification invariants#31

Open
brawlaphant wants to merge 9 commits intoregen-network:mainfrom
brawlaphant:codex/weekly-02-m010-schema-pack
Open

feat(m010): harden challenge schemas, fixtures, and verification invariants#31
brawlaphant wants to merge 9 commits intoregen-network:mainfrom
brawlaphant:codex/weekly-02-m010-schema-pack

Conversation

@brawlaphant
Copy link

Summary

Hardens m010 so challenge behavior is machine-verified.

What Changed

  • Tightened m010 schemas (IDs/category/lifecycle rules).
  • Expanded challenge fixtures (escalated + edge timing + invalid cases).
  • Hardened verifiers to catch drift fast.
  • Clarified consumer contract docs (score key/range, status contribution, KPI denominator).

Schema Impact

  • mechanisms/m010-reputation-signal/schemas/m010_signal.schema.json
  • mechanisms/m010-reputation-signal/schemas/m010_challenge.schema.json
  • mechanisms/m010-reputation-signal/schemas/m010_kpi.schema.json
  • mechanisms/m010-reputation-signal/datasets/schema.json
    Type: non-breaking for existing key usage; validation is stricter.

Validation

  • npm run verify
  • npm run verify:m010
  • npm run verify:m010:datasets
  • npm run check:index
    All pass.

Risk

Downstream tools relying on permissive legacy fixture/schema shapes may fail.

@brawlaphant
Copy link
Author

Downstream check requested before merge (risk mitigation):

  1. Confirm parser reads score.reputation_score_0_1 (0..1).
  2. Confirm contribution logic uses only active + resolved_valid.
  3. Confirm challenge_rate = challenges_filed / signals_emitted.
  4. Run downstream tests/parsers against this PR branch.
  5. If any break appears, we will immediately follow up with either:
    • a compatibility adapter doc/update, or
    • a targeted relaxation patch.

Rollback path is ready: we can revert only the latest hardening commits if needed.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @brawlaphant, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the robustness and verifiability of the m010-reputation-signal mechanism. It introduces stricter validation rules for data schemas, expands the test fixture coverage to include more complex and edge-case challenge scenarios, and implements new verification scripts to ensure data integrity and consistency. The changes also clarify the consumer contract for scoring and KPI computation, particularly regarding signal statuses and challenge-related metrics. This hardening aims to prevent data drift and improve the reliability of the reputation signal.

Highlights

  • Schema Hardening: Tightened m010 schemas for IDs, category formatting, and lifecycle rules, including stricter validation patterns and minimum lengths for various fields.
  • Expanded Challenge Fixtures: Added new challenge fixtures covering escalated scenarios, edge-timing cases, and intentionally invalid data for negative verification coverage.
  • Enhanced Verifiers: Introduced new reference implementation vector verifiers and dataset integrity verifiers for m010 to machine-verify challenge behavior and catch data drift.
  • Clarified Consumer Contract: Updated documentation to clarify score key/range, signal status contribution rules, and KPI denominator conventions for downstream consumers.
  • Status-Aware Scoring: Modified m010 scoring logic to exclude non-contributing signal states (e.g., 'submitted', 'challenged', 'escalated') when a status is present, ensuring only 'active' and 'resolved_valid' signals contribute.
  • Challenge KPI Integration: Enabled m010 KPI computation to emit challenge_kpis when challenge data is provided, including metrics like challenges_filed, challenge_rate, and avg_resolution_time_hours.
Changelog
  • Added
    • m010 reference implementation vector verifier (scripts/verify-m010-reference-impl.mjs) with challenge replay coverage.
    • m010 dataset integrity verifier (scripts/verify-m010-datasets.mjs) covering challenge linkage, lifecycle consistency, and expected output coherence.
    • Additional m010 challenge fixtures for escalated and edge-timing scenarios, plus an intentionally invalid fixture for negative verification coverage.
    • Additional verifier invariants for m010 (status/outcome consistency, duplicate detection, evidence minimums, and derived KPI coherence checks).
  • Changed
    • m010 scoring now excludes non-contributing signal states when status is present (active/resolved_valid only contribute).
    • m010 KPI computation now emits challenge_kpis when challenge data is provided.
    • m010 replay dataset/schema alignment expanded to cover challenge fixtures and lifecycle statuses (including escalated).
    • m010 schemas are stricter on IDs/category formatting, evidence arrays, and challenge lifecycle guards (statusresolution/outcome consistency).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly hardens the m010 mechanism by introducing stricter schema validations, expanding challenge fixtures, and implementing comprehensive verification invariants. The changes ensure greater data integrity and consistency across the system, particularly for challenge-related logic and KPI computations. The documentation has also been updated to reflect these improvements, providing clearer consumer contracts and lifecycle definitions. Overall, these are excellent changes that enhance the robustness and reliability of the m010 reputation signal.

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