Miracle: add and harden synthetic Decision/KL and replay-reading mechanisms - #18
Draft
thugongheng wants to merge 11 commits into
Conversation
Add isolated fake-only cores for trusted atomic ActionSupport/KL calculation and canonical synthetic training-replay reading. This does not wire Miracle runtime KL, define a global Boolean action mask, provide a human-authored Replay Skill, validate real replay data, complete the HL checklist, or establish authoritative readiness.
Record the approved Miracle target contract for atomic Judge operations, state-local ActionSupport, and strict D_KL(old||new). Mark new||old, epsilon smoothing, and episode-sum behavior as legacy or generic where applicable. This documentation change does not migrate runtime, Schema, tracking, reports, replay assets, or Checklist completion.
Close the public caller-supplied ActionSupport trust bypass. Use numerically stable strict D_KL(old||new) computation. Reject JSON type drift in regenerated Replay ActionSupport. This remains an isolated synthetic/fake-only mechanism. It does not wire runtime, tracking, reports, Results, or evaluation. It does not approve or validate real replay assets. It does not imply authoritative readiness.
Return structured incomplete results when strict KL is unavailable. Keep probability-mass tolerance from producing invalid negative KL. Bind replay frames to the evaluated actor camp. Percent-encode dynamic timeline fields. This remains an isolated synthetic/fake-only mechanism. It does not wire runtime, tracking, reports, Results, or evaluation. Production replay approvals remain empty. It does not imply real replay validation or authoritative readiness.
Check strict probability mass before KL failure classification. Return stable incomplete results for oversized or invalid probabilities. Read replay artifacts through bounded same-object platform handles. Reject forged contexts, ambiguous paths, and unsafe reader results. This remains an isolated synthetic/fake-only mechanism. It does not wire runtime, tracking, reports, Results, or evaluation. Production replay approvals remain empty. Real POSIX and UNC I/O were not executed. It does not imply real replay validation or authoritative readiness.
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
This Draft PR contains three isolated commits:
b8ec009adds synthetic/fake-only Decision Space/KL and canonical replay-reading mechanisms.12f230arecords the approved Miracle target contract and explicitly marks legacy KL boundaries.504acbbcloses three reviewer-confirmed trust and numerical-validation blockers.Decision Space / KL contract
The isolated core implements:
ActionSupport + support_id;D_KL(old||new)using the natural logarithm;nats / decision;mean <= 0.01;old > 0, new = 0.Each trajectory decision rebuilds ActionSupport from
state_beforeand revalidates support identity and complete old/new distributions. Uploaded or self-reported KL scalars are not accepted as evidence.Replay Reading boundary
Replay Reading remains synthetic/fake-only. It:
The production replay approval set is empty.
Reviewer blocker hardening
The hardening commit closes:
Public caller-supplied ActionSupport trust bypass:
Subnormal probability instability:
old * (log(old) - log(new));new = 5e-324produces a finite value of approximately744.44;new = 0retains structuredold_positive_new_zerofailure.Replay JSON weak-type equality:
0 -> 0.0and0 -> falsemutations are rejected even after replay/manifest SHA rebinding and test-only approval injection.Validation
71 passed98 passed738 passed, 9 skippedThe 9 skips are not counted as passes:
AGENTBENCH_RESULTSwas intentionally unset.On the direct Windows checkout, the full suite reports
647 passed, 91 failed, 9 skippedbecause the unmodifiedminimal_bootstrap_strategy.pycheckout has CRLF bytes while its approved Git blob is LF. A raw LF commit-tree copy matches the approved bootstrap SHA and passes all 738 runnable tests. No bootstrap file, approved SHA or validation logic is changed here.Explicit non-goals
This PR does not:
authoritative readiness = false