[SGS-005] Add production/oracle/hard-authority projections with invariance tests - #1492
[SGS-005] Add production/oracle/hard-authority projections with invariance tests#1492Tyler-R-Kendrick wants to merge 1 commit into
Conversation
…S-005)
Implements SGS-005 (SLM-443): make authority transitions explicit when
semantic requirements/plans are consumed by production, oracle-diagnostic,
evaluator-only, or compiler-certified paths -- reusing existing owners
instead of a second restriction system.
- PromptSemanticRequirementsV1.to_production_dict (new -- SemanticPlanV1
already had one, prompt_requirements.py had no analog): drops
oracle_override facts from a production manifest, recording each as a
dropped_facts entry with a downgrade_reason instead of silently losing it;
drops any ambiguity group left with a dangling member reference; never
rewrites a kept fact's authority.
- compiler.py: AuthorityProjectionV1/project_authority, a pure re-labeling
of an already-decided RestrictionResult's evidence into the ownership
map's authority-tier vocabulary (compiler-hard/oracle-diagnostic/
advisory-learned/evaluation-only):
- COMPILER_AUTHORED_CERTIFIED evidence that produced no certified hard
removal (missing/rejected certificate) never earns compiler-hard.
- A certified hard removal whose depends_on cites oracle or unresolved
evidence is tainted and downgraded (nested provenance smuggling).
- Any hard removal from non-certified evidence (only reachable through
allow_unsafe_predicted_hard_control) is forced to evaluation-only --
visibly non-promotable regardless of declared kind.
- ORACLE_GOLD evidence is excluded from a production-mode manifest.
Never recomputes hard/soft removal decisions, so the exact candidate
domain is unchanged by projecting it.
- Invariance test coverage for both: idempotence (P(P(x)) == P(x)),
monotonic downgrade (final tier is always the declared tier or
evaluation-only, never upgraded), nested provenance smuggling, serialized
round trips, and exact legal-domain parity.
- Registers data.progspec.semantic_contracts (semantic_plan.py,
prompt_requirements.py were untracked by the version-stamp registry) and
bumps harness.experiments.slm146_plan_compiler (already owns compiler.py).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVBfEGVKu7u2G8dcMaZMsP
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 27 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Implements SGS-005 / SLM-443: make authority transitions explicit when semantic requirements/plans are consumed by production, oracle-diagnostic, evaluator-only, or compiler-certified paths — reusing
SemanticPlanV1.to_production_dict,EvidenceKind, andOpenUISemanticPlanCompiler.certified_restrictionsinstead of introducing a second restriction system (per the SGS-001 ownership map'snew_owner_justified: falseverdict for this issue).PromptSemanticRequirementsV1.to_production_dict(new —SemanticPlanV1already had one,prompt_requirements.pyhad no analog): dropsoracle_overridefacts from a production manifest, recording each as adropped_factsentry with adowngrade_reasoninstead of silently losing it; drops any ambiguity group left with a dangling member reference (a group can't survive with one member removed); never rewrites a kept fact'sauthority.compiler.py:AuthorityProjectionV1/project_authority— a pure re-labeling of an already-decidedRestrictionResult's evidence into the ownership map's authority-tier vocabulary (compiler-hard/oracle-diagnostic/advisory-learned/evaluation-only):COMPILER_AUTHORED_CERTIFIEDevidence that produced no certified hard removal (missing/rejected certificate) never earnscompiler-hard.depends_oncites oracle or unresolved evidence is tainted and downgraded — nested provenance smuggling can't launder an oracle fact into compiler-hard authority.allow_unsafe_predicted_hard_control) is forced toevaluation-only— visibly non-promotable regardless of its declared kind.ORACLE_GOLDevidence is excluded from aproduction-mode manifest.data.progspec.semantic_contracts(semantic_plan.py/prompt_requirements.pywere untracked by the version-stamp registry — a real gap this closes) and bumpsharness.experiments.slm146_plan_compiler(already ownscompiler.py).Acceptance criteria (from the issue)
certified_restrictionsinvariant; the projection never contradicts it).P(P(x)) == P(x)tested on both contracts.RestrictionResultis byte-identical before/after projecting.allow_unsafe_predicted_hard_controlescape hatch.Test plan
tests/test_data/test_progspec/test_prompt_requirements.py(+10 tests): oracle-fact dropping, authority never rewritten, ambiguity-group smuggling, round trip, idempotence.tests/test_data/test_semantic_plan_extraction/test_compiler.py(+12 tests): tier assignment, uncertified-claim downgrade, unsafe-control downgrade, oracle exclusion/inclusion by mode, tainted-dependency smuggling, domain-parity, bucket disjointness, idempotence, round trip, plan integration.tests/test_data/test_progspec/test_semantic_plan.py(+3 tests): non-oracle production path, idempotence, no-reintroduction-of-stripped-fields.tests/test_data/test_progspec/,tests/test_data/test_semantic_plan_extraction/, and related consumer suites (385 tests) pass.python -m scripts.verify_version_stamps --checkpython -m scripts.verify_ownership_mappython -m scripts.refresh_test_cases --check --changed(no test-case resources touched)ruff checkon all changed filesGenerated by Claude Code