Harden Forge interrupted extraction handling - #27
Merged
Conversation
Require terminal controller state before reporting outcomes, compare SQL as tokens so punctuation formatting is harmless, and deduplicate repeated file edits before pagination. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8cf0691-0fe3-4d67-92ce-ce2a529c400c
There was a problem hiding this comment.
Pull request overview
This PR hardens Repository Skill Forge extraction runs against interrupted/slow processing by adding an explicit terminal-state gate, improving controller payload signaling, and reducing false-positive SQL handoff mismatches and redundant file evidence pagination.
Changes:
- Added an
assert-terminalcontroller command and documented a mandatory “terminal-state gate” before reporting blocked/complete outcomes. - Improved controller output semantics by explicitly marking terminal results as
terminal: trueand parallel action manifests asterminal: false. - Made SQL handoff matching resilient to punctuation-only formatting differences, and updated file evidence queries to deduplicate
session_filesentries before keyset pagination.
Show a summary per file
| File | Description |
|---|---|
| plugins/repo-dreamer/skills/repository-skill-forge/tests/test_materialize_session_query.py | Adds coverage for SQL normalization across punctuation spacing and for preserving string literal contents. |
| plugins/repo-dreamer/skills/repository-skill-forge/tests/test_extraction_controller.py | Adds CLI-level tests for assert-terminal, validates nonterminal action-batch manifests, and verifies file-query dedupe/pagination behavior. |
| plugins/repo-dreamer/skills/repository-skill-forge/SKILL.md | Documents the required assert-terminal gate and clarifies blocked vs. running behavior. |
| plugins/repo-dreamer/skills/repository-skill-forge/scripts/session_queries.py | Updates file evidence SQL to deduplicate before pagination and changes the keyset cursor columns accordingly. |
| plugins/repo-dreamer/skills/repository-skill-forge/scripts/materialize-session-query.py | Replaces whitespace-only SQL normalization with token-based normalization to ignore punctuation spacing while preserving literals. |
| plugins/repo-dreamer/skills/repository-skill-forge/scripts/extraction-controller.py | Adds terminal_summary + assert-terminal, marks terminal/nonterminal outputs explicitly, and aligns file pagination cursor fields with the new query. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Lite
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
assert-terminalso running extraction cannot be reported as blocked or completesession_filesedits by session, path, and tool before paginationRoot cause
Task
5add9972-e910-4f5f-935c-7945b2552686stopped with three valid tool actions still pending. The controller remainedrunning, but the agent reportedBLOCKEDafter processing large repetitive file pages and a formatting-only SQL handoff mismatch.Validation
git diff --checkpasses