feat(validation): add runtime plan authorization - #5
Merged
Conversation
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.
Scope
This PR implements M3 only as
0.2.0-dev.3.It converts an untrusted
CompactionPlanproposal into a distinct, deterministicValidatedPlanand then stops:This PR does not execute plans, transform or mutate context, create artifacts, promote or write memory, change authority/lifecycle, call Qwen or llama.cpp, or alter the frozen deterministic context policy.
What changed
Runtime-owned authorization
src/compaction-validator.jsvalidateCompactionAuthorization({ plan, inventory, pressure })APIKEEPAUTHORIZED,REJECTED, orAUDIT_ONLYPROMOTE_PROPOSALaudit-only with no persistence pathSafety policy
AUTHORIZATION_POLICYisRecoverable()andisDurablyRecoverable()explicitDependency closure
depends_ongraph before authorizationACTIVE_DEPENDENCYToken accounting
requiredReductionTokensonly from Runtime pressurepotentialReductionUpperBoundactualReductionTokens: nullbefore executionCOMPRESSwhentargetTokens >= unit.tokensAUTHORIZED_DEFINITELY_INSUFFICIENTAUTHORIZED_POTENTIALLY_SUFFICIENTREJECTEDDocumentation and fixtures
0.2.0-dev.3Safety boundary
The Validator is deterministic, model-free, and observational. Validation does not mutate plans, inventories, messages, project memory, episodes, artifacts, context, authority, or lifecycle.
The following frozen/runtime files are unchanged:
Validation
npm.cmd test: 96 tests/subtests, 95 passed, 1 Windows file-symlink capability skipnode --checkgit diff --checkis cleanNext milestone
0.2.0-dev.4will add bounded Qwen proposal generation only. Transformation and validated execution remain separate for0.2.0-dev.5.