Skip to content

Improve panics and tests#91

Merged
Vladyslav-Kuksiuk merged 7 commits into
masterfrom
improve-tests
Jul 6, 2026
Merged

Improve panics and tests#91
Vladyslav-Kuksiuk merged 7 commits into
masterfrom
improve-tests

Conversation

@Vladyslav-Kuksiuk

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

This PR:

  • Replaces panic-based partition bounds checks. Resolves issue.
  • Guards IsContentChanged against short generated results. Resolves issue.
  • Replaces legacy x/net/context in logging. Resolves issue.
  • Adds direct tests for main-mode aggregation and output. Resolves issue.

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk self-assigned this Jul 6, 2026
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk marked this pull request as ready for review July 6, 2026 11:22
@Oleg-Melnik

Copy link
Copy Markdown
Collaborator

@claude review

@Oleg-Melnik

Copy link
Copy Markdown
Collaborator

@codex[agent] review

@SpineEventEngine SpineEventEngine deleted a comment from Codex AI Jul 6, 2026
@SpineEventEngine SpineEventEngine deleted a comment from Codex AI Jul 6, 2026
@SpineEventEngine SpineEventEngine deleted a comment from Codex AI Jul 6, 2026
@SpineEventEngine SpineEventEngine deleted a comment from Codex AI Jul 6, 2026
@SpineEventEngine SpineEventEngine deleted a comment from Codex AI Jul 6, 2026
@SpineEventEngine SpineEventEngine deleted a comment from Codex AI Jul 6, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 01427e0656

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Oleg-Melnik

Oleg-Melnik commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Review by Claude

LGTM — nothing blocking found.

Checked and confirmed clean:

  • IsContentChanged guard: len(c.Result) < c.lineIndex is exactly the panic condition from Guard IsContentChanged against short generated results #86; the loop bounds on c.source stay safe since lineIndex ≤ len(source) by construction.
  • Partition.Select: check order is right (start → end < 0 sentinel → inverted → end bounds). The endPosition < startPosition-1 boundary deliberately preserves the old behavior of allowing empty partitions (end == start-1 → empty slice), matching adjacent #docfragment/#enddocfragment markers. The old code genuinely panicked on inverted bounds; now it's a proper error.
  • hasLineIndex replacing the recover()-based safeAccess is strictly better — the old version also handled negative indexes inconsistently.
  • No remaining x/net imports anywhere in the repo; the go.mod // indirect demotion is correct.
  • captureStdout: pipe lifecycle, reader goroutine, and the closed flag handle both the success and Ginkgo-failure (panic) paths without leaking or double-closing; the 128 KiB test covers the pipe-buffer case.
  • New main tests match actual main.go behavior (singular/plural headings, errors.Join aggregation, empty output on the embed error path).

Two non-blocking notes:

  1. The closed-flag dance in captureStdout could be simplified by doing all cleanup only in the deferred function.
  2. IsContentChanged still can't detect a pure-append divergence (Result strictly longer with an identical prefix) — pre-existing and likely unreachable through the parser, so informational only.

@Oleg-Melnik Oleg-Melnik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vladyslav-Kuksiuk LGTM with minor comments from Claude.

Base automatically changed from improve-js-comment-filtering to master July 6, 2026 14:32
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk merged commit ae1d213 into master Jul 6, 2026
3 checks passed
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk deleted the improve-tests branch July 6, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants