feat(preflight): predictive advisory warning from the decision log (BEFLOW-18) - #8
Merged
Conversation
…EFLOW-18) Wire the durable decision-log reader (readDecisionEvents) into the pre-worktree preflight as its intended consumer. On a fresh autonomous implement dispatch, after the authoritative live policy gate decides to proceed, consult recent same-project history: when the issue's declared scope overlaps paths a prior run sent to block/require_approval, log a heads-up and proceed. Purely advisory and bounded — findHistoricalOverlaps is a pure function over the reader's output (exact path match, most-recent MAX_HISTORY_EVENTS only), the live gate stays authoritative, and a missing/torn log degrades to a no-op. Project scoping lives in run.ts to avoid a run.ts→preflight.ts import cycle. No config or schema change.
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.
Wire
readDecisionEvents(its intended consumer) into the pre-worktree preflight. On a fresh autonomous implement dispatch, after the live policy gate decides to proceed, consult recent same-project history and log a heads-up when the declared scope overlaps paths a prior run sent to block/require_approval.Purely advisory —
findHistoricalOverlapsis pure/bounded (exact match, most-recent 1000), the live gate stays authoritative, and a missing/torn log degrades to a no-op. Project scoping lives in run.ts to avoid an import cycle.No config/schema change. Gate green.