Resolve evaluate/evaluate_transition ambiguity and unify DecisionRecord#13
Merged
Resolve evaluate/evaluate_transition ambiguity and unify DecisionRecord#13
Conversation
…ition() with no ambiguity Co-authored-by: LalaSkye <228581229+LalaSkye@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Prepare for PR #7 with decision record
Resolve evaluate/evaluate_transition ambiguity and unify DecisionRecord
Mar 1, 2026
Remove import yaml, use import json instead. Replace yaml.safe_load with json.load. Require schema_version top-level key. No new external dependencies.
Replace YAML fixture content with json.dumps equivalents. Point _REAL_REGISTRY to .json file. Remove textwrap import, add json import. Use schema_version key instead of version.
LalaSkye
approved these changes
Mar 2, 2026
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.
Post-PR#6 conflict resolution left
mgtp/evaluate.pywith two evaluation functions and two competingDecisionRecordimplementations acrossmgtp/types.pyandmgtp/decision_record.py. This PR enforces a single canonical path for each.DecisionRecord — one implementation
mgtp/types.pyis the soleDecisionRecorddefinition: unified class with 5 core fields plus optional audit fields (actor_id,tenant_id,context_hash,gate_version,timestamp).mgtp/decision_record.pybecomes a re-export shim only (from mgtp.types import DecisionRecord). No competing class.canonical_bytes,canonical_hash,content_hash,decision_id,reason_code) replace stored duplicates.build()classmethod retained for audit-trail construction.evaluate() / evaluate_transition() — Option A (thin wrapper)
mgtp/evaluate.pyexposes onlyevaluate()(__all__ = ["evaluate"]); the registry-free canonical entrypoint from PR#6.mgtp/evaluate_transition.pyexposes onlyevaluate_transition()(__all__ = ["evaluate_transition"]); a thin wrapper that adds registry pre-check then delegates the gate decision toevaluate():No divergent gate behaviour
tests/test_evaluate_coherence.pyasserts that for every equivalent authority configuration (APPROVED, REFUSED, SUPERVISED), bothevaluate()andevaluate_transition()produce the same outcome. The__all__guard on each module is also tested to prevent a third entrypoint from silently appearing.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.