Skip to content

feat(compress): 빌드 요약·디렉토리 리스팅 요약·중복 제거 규칙 추가 - #56

Open
pinion05 wants to merge 3 commits into
masterfrom
feat/compress-rules-21
Open

feat(compress): 빌드 요약·디렉토리 리스팅 요약·중복 제거 규칙 추가#56
pinion05 wants to merge 3 commits into
masterfrom
feat/compress-rules-21

Conversation

@pinion05

@pinion05 pinion05 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

변경 요약

이슈 #21 표의 규칙 기반 결과 압축에서 누락됐던 3개 규칙을 구현하고, skipDirListing 데드코드를 제거.

이전까지 구현된 규칙(통과 테스트 요약, __pycache__/.git 제거, 에러/traceback 유지, git status/diff 보존)에 더해:

규칙 이전 이후
빌드 진행 로그 일부 컴파일 행만 제거 [Build succeeded] 또는 [Build failed: 에러만] 요약
디렉토리 리스팅 전혀 처리 안 함 (skipDirListing dead code) [dir listing: N entries] 요약
연속 중복 라인 전혀 처리 안 함 consecutive dedup

근본 원인 (데드코드)

compressResultskipDirListing 플래그가 true로 세팅은 되었으나 한 번도 읽히지 않는 데드코드였음 — 디렉토리 리스팅 처리가 작성되다 만 상태. 이번에 리스팅 감지 + 요약을 완성하고 플래그를 제거.

회귀 방지

초안에서 bare word 한 줄(result-a)이 plain-ls 리스팅으로 오탐지되어 trajectory-retention 테스트가 실패함. plain-ls 매칭을 total 헤더로 좁히고, bare word 오탐 방지 테스트를 추가.

테스트

  • 신규 7개: 통과 테스트 요약, 빌드 성공/실패 요약, 디렉토리 리스팅 요약, bare word 오탐 방지, 연속 중복 제거, 비연속 에러 유지
  • 전체 87개 통과 (기존 80 + 신규 7) — 회귀 없음
  • npm run build 통과
  • tsc --noEmit 타입체크 통과

Closes #21

Summary by CodeRabbit

  • 개선 사항

    • 테스트 및 빌드 결과를 더 간결하고 이해하기 쉽게 요약합니다.
    • 디렉터리 목록을 항목 수로 축약하고, 불필요한 짧은 목록은 제거합니다.
    • 빌드 성공 및 실패 상태를 명확히 표시하며, 실패 시 관련 오류를 보존합니다.
    • 연속으로 반복되는 동일한 오류 메시지를 정리합니다.
    • 기존의 테스트 통과 개수 요약 및 결과 길이 제한 기능을 유지합니다.
  • 테스트

    • 테스트, 빌드 로그, 디렉터리 목록 및 중복 오류 처리에 대한 검증을 추가했습니다.

이슈 #21 표의 규칙 기반 결과 압축에서 누락됐던 3개 규칙을 구현하고
skipDirListing 데드코드를 제거.

- 빌드 진행 로그 → [Build succeeded] 또는 [Build failed: 에러만] 요약
- 디렉토리 리스팅(ls -l 3+ 줄) → [dir listing: N entries] 요약
- 연속 중복 라인 제거 (consecutive dedup)
- skipDirListing 플래그(dead code) 제거 — 작성되었으나 한 번도 읽히지 않음

회귀: bare word 한 줄이 디렉토리 리스팅으로 오탐지되지 않도록
plain-ls 매칭을 total 헤더로 좁힘.

테스트: 87개 통과 (기존 80 + 신규 7). 빌드·tsc 통과.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pinion05, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 81de1237-ce32-4c3b-988b-d223a096f6df

📥 Commits

Reviewing files that changed from the base of the PR and between 239ba79 and f6db8aa.

📒 Files selected for processing (2)
  • src/trajectory.ts
  • test/compress-result.test.ts
📝 Walkthrough

Walkthrough

compressResult가 디렉터리 목록, 빌드 로그, 오류, 통과 테스트 및 연속 중복을 규칙 기반으로 분류·압축하도록 변경되었습니다. 관련 출력 형식을 검증하는 Node.js 테스트가 추가되었습니다.

Changes

트레이토리 결과 압축

Layer / File(s) Summary
결과 분류 및 다단계 압축 처리
src/trajectory.ts, test/compress-result.test.ts
디렉터리 목록을 요약 또는 제거하고, 빌드 성공·실패 로그를 선행 요약하며, 오류 라인의 연속 중복을 제거합니다. 통과 테스트 개수, 빌드 실패 오류 보존, 디렉터리 목록 판별 및 비연속 오류 보존을 테스트합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 빌드·디렉터리 요약과 중복 제거 규칙 추가라는 주요 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed [#21] 빌드/디렉터리 요약, 연속 중복 제거, plain-ls 오탐 방지 등 핵심 규칙을 구현해 요구사항에 부합합니다.
Out of Scope Changes check ✅ Passed 기능 구현과 회귀 테스트 추가에 한정되어 보이며, 요구사항과 무관한 변경은 확인되지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 239ba79dc0

ℹ️ 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".

Comment thread src/trajectory.ts
Comment on lines +319 to +321
const summary = buildFailed
? `[Build failed]\n${buildErrors.join("\n")}`
: "[Build succeeded]";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat non-zero build exits as failures

When build output contains progress lines but fails with only the standard shell marker, e.g. [exit: 1], this summary still reports [Build succeeded] because buildFailed is only set from ERROR_LINE matches while exit markers are merely kept later. That gives the model contradictory and misleading compressed history for failed build commands that don't print an error-looking line, so non-zero [exit: N] should also drive the failed summary.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

수정 완료 — non-zero [exit: N] 감지 추가. buildProgressSeen 상태면 buildFailed=true로 설정하고 마커는 그대로 보존. df7637a

Comment thread src/trajectory.ts
Comment on lines +261 to 264
} else if (dirRun > 0) {
// Too few to be a listing — keep them.
for (let k = 0; k < dirRun; k++) kept.push("__kept_dir__");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve short permission-style output runs

For one or two ls -l-style lines, this path intends to keep them because they are below the directory-listing threshold, but it stores only __kept_dir__; the dedupe pass then drops that sentinel, so outputs like ls -l README.md or a two-file listing disappear entirely instead of being preserved. Store the original pending lines or flush them before replacing longer runs with a summary.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

수정 완료 — __kept_dir__ 센티넬 제거. 짧은 dir run(1-2줄)은 dirPending 버퍼에 원본을 저장 후 그대로 보존. df7637a

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/trajectory.ts`:
- Around line 197-198: Update the BUILD_PROGRESS_LINE handling in the trajectory
parsing flow so progress lines are skipped only when they do not match
ERROR_LINE. Preserve error lines for the later build-error collection branch,
matching the existing BUILD_DONE_LINE guard behavior and ensuring buildFailed is
set for lines such as “webpack compiled with 1 error.”
- Line 199: Update BUILD_DONE_LINE and the related build-output handling in the
surrounding completion and error-collection branches so failure terminal lines
such as “Build failed” are recognized as build completion markers and are not
appended to buildErrors. Preserve actual diagnostic errors when the build fails,
and strengthen the existing “preserves only errors when a build fails” assertion
to verify the terminal failure line is not duplicated.
- Around line 254-265: Update the directory-listing aggregation around dirRun so
short runs preserve their original lines instead of pushing "__kept_dir__";
track those lines in a dirRunLines collection and reuse it in both the normal
flush and trailing flush paths. Exclude LS_TOTAL_LINE header matches from the
listing count so the summarized entry total reflects only actual items. Remove
the obsolete "__kept_dir__" filtering from the dedup stage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 679b227f-7ff5-48b9-a9d2-6e4a0dcb38db

📥 Commits

Reviewing files that changed from the base of the PR and between 9133f48 and 239ba79.

📒 Files selected for processing (2)
  • src/trajectory.ts
  • test/compress-result.test.ts

Comment thread src/trajectory.ts
Comment thread src/trajectory.ts Outdated
Comment thread src/trajectory.ts
CodeRabbit·Codex 리뷰 반영:

1. BUILD_PROGRESS_LINE에 ERROR_LINE 가드 추가 — "webpack compiled with 1 error"
   같은 라인이 progress로 소비되어 [Build succeeded]로 오탐지되던 문제 수정.
2. BUILD_DONE_LINE에 fail(ed) 매칭 추가 — "Build failed" 종료 라인이
   buildErrors에 중복 수집되던 문제 수정 (요약 헤더와 본문 중복 제거).
3. non-zero [exit: N] 감지 — 에러 라인 없이 실패한 빌드도 [Build failed] 처리.
4. 짧은 dir run(1-2줄) 보존 — __kept_dir__ 센티넬이 dedup 패스에서
   소실되어 ls -l README.md 결과가 날아가던 문제 수정. 원본을 pending 버퍼로 보존.

테스트: 91개 통과 (신규 4개 회귀 테스트 포함). 빌드·tsc 통과.
CodeRabbit 추가 지적 반영 — `total 24` 헤더가 dirRun에 포함되어
[dir listing: N entries]의 N이 실제 항목 수보다 1 많았던 문제.
헤더는 listing 감지 트리거로 유지하되 카운트에서 제외.

테스트: 92개 통과 (total 헤더 카운트 회귀 테스트 추가). tsc 통과.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

핵심 기능: 규칙 기반 트레이토리 압축 (과정 토큰 제거)

1 participant