Repository navigation
Fix Patrol finding: extend-the-internal-brainstorm-parser-with-a-sou-9d5375776123 - #1513
Closed
ivankuznetsov wants to merge 1 commit into
Closed
ivankuznetsov wants to merge 1 commit into
ivankuznetsov wants to merge 1 commit into
Conversation
ivankuznetsov
force-pushed
the
hive/patrol-fix/extend-the-internal-brainstorm-parser-with-a-sou-9d5375776123/g1
branch
3 times, most recently
from
October 3, 2026 20:03
2c3de9d to
99cf198
Compare
The shared brainstorm parser returned only logical question data
(round, number, text, answer), so BrainstormAnswerWriter had to
reconstruct physical identity from raw lines: target_question_line_index
re-scanned raw lines to map the parser's "first unanswered Q{n}" back to
a line index, question_line_index_for_ordinal re-scanned for the
ordinal-position Q header, and block_boundary? re-derived the
Q/Round/marker boundary rule the parser also encodes. Three parallel
location rules meant every future format change was a synchronized
cross-boundary edit, and the raw-line re-scan indexed a different line
array than the parser used (a lone-CR file yields more parser lines than
content.lines).
Centralize document location in Hive::BrainstormParser:
- Question now carries question_line_index, block_end_index (first
Q/Round/marker boundary at-or-after the header, or EOF), and
answer_line_index - all indexed against the parser's
newline-normalized line array, now exposed as document_lines.
- The writer anchors directly on those fields: it selects the
parser-identified unanswered target, fills the empty A-slot at
answer_line_index before block_end_index, or inserts a new slot at
block_end_index - no re-scan, no separate boundary rule.
- Writer line surgery runs on the parser's own line array (re-terminated
with \n), so parser indices and raw lines can never disagree; the
written document keeps the pre-write line-ending style (CRLF stays
CRLF). The lone-CR write path now normalizes the whole document the
same way the parser does.
The removed re-scan (target_question_line_index) was the last place a
writer-side positional guess could diverge from the parser, which is what
previously let a round boundary be crossed when routing an answer.
EOF-final questions (no trailing newline) keep their terminator, and
lone-CR documents now land answers instead of dead-ending in
:answer_slot_missing.
ivankuznetsov
force-pushed
the
hive/patrol-fix/extend-the-internal-brainstorm-parser-with-a-sou-9d5375776123/g1
branch
from
October 4, 2026 00:41
99cf198 to
01aa23d
Compare
2 of 3 tasks
Owner
Author
|
Merged as part of #1535, which batched the remaining ready PRs (including this PR's head) into one CI run. |
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.
Patrol Fix
This pull request repairs one finding tracked by Hive's Patrol Fix workflow.
Sources
Finding evidence
find_empty_answer_slothas a\n # matching lenient fallback so the answer lands in the\n # actual slot on disk.","claim":"the current parser explicitly depends on a matching writer-side structural rule, making future format changes a synchronized cross-boundary edit"}Independent review
The patch correctly centralizes question and answer locations in Hive::BrainstormParser and makes both writer paths consume the parser's normalized line-index space. No patch-related defect was found. The controller's only red validation is an unrelated AgentCliRuntime timeout test; that exact test passed independently, while every focused and adjacent parser/writer check remained green.
Validation
Verdict: passed
01aa23d389e0080e5b54365489e04dc67e9be9df.