fix(slack-gateway): preserve ACP reply whitespace#195
Conversation
Review PromptPlease review this pull request and provide feedback on:
Be constructive and helpful in your feedback. Specific rules for this codebase: General rules
PII in Logs - HIGH PRIORITYFlag any code that logs user PII (Personally Identifiable Information). This is a critical security and compliance issue. Check for and reject:
Require instead:
Example violations to flag: logger.info(f"User {user.email} logged in") # BAD
logging.warning(f"Failed for {body.email}") # BAD
print(f"Contact sent: {data}") # BAD if data contains email
discord_message += f"Email: {user.email}" # BADCorrect patterns: logger.info(f"User auth_id={user.auth_id} logged in") # GOOD
logger.warning("Failed login", {"auth_id": user.auth_id}) # GOODi18n rules
|
Review PromptPlease review this pull request and provide feedback on:
Be constructive and helpful in your feedback. Specific rules for this codebase: General rules
PII in Logs - HIGH PRIORITYFlag any code that logs user PII (Personally Identifiable Information). This is a critical security and compliance issue. Check for and reject:
Require instead:
Example violations to flag: logger.info(f"User {user.email} logged in") # BAD
logging.warning(f"Failed for {body.email}") # BAD
print(f"Contact sent: {data}") # BAD if data contains email
discord_message += f"Email: {user.email}" # BADCorrect patterns: logger.info(f"User auth_id={user.auth_id} logged in") # GOOD
logger.warning("Failed login", {"auth_id": user.auth_id}) # GOODi18n rules
|
|
Final implementation report for #195 Completed:
Validation run locally:
Review / CI status:
|
👍 GitRank PR AnalysisScore: 20 points
Eligibility Checks
Impact SummaryThis PR fixes a bug where the Slack gateway was corrupting ACP assistant replies by trimming whitespace and newlines at chunk boundaries. It extracts shared ACP text processing logic into a new Analysis DetailsComponent Classification: This PR affects multiple components (Slack gateway, API, shared utilities) without a single dominant area. The changes are cross-cutting infrastructure improvements for ACP text handling, making OTHER the appropriate classification. Severity Justification: This is a P2 (Medium) bug fix. The issue causes silent data corruption in Slack replies when ACP returns multiline content with whitespace-sensitive formatting, but it has a workaround (manual message correction) and doesn't cause service outages or complete data loss. Eligibility Notes: Issue: True - PR explicitly fixes a bug (reply corruption from whitespace trimming). Fix Implementation: True - code changes directly address the problem by preserving chunk boundaries and using shared extraction logic. PR Linked: True - detailed description with TL;DR, summary, review focus, and test plan. Tests: True - includes unit tests in acptext_test.go, gateway_test.go, and e2e tests. Tests Required: True - this is a business logic bug fix affecting data integrity that requires regression tests to prevent recurrence. Analyzed by GitRank 🤖 |
TL;DR
This fixes Slack reply corruption caused by trimming and rejoining ACP text chunks at the gateway boundary. The ACP text extraction logic is now shared between the API and Slack gateway, and the build/test wiring was updated so the shared module is exercised in container builds and CI.
Summary
chat.postMessagetext payloadacptextmodule in API and Slack gateway image buildsacptextchanges and add the new module to the Go test matrixReview Focus
acptextsemantics for ACPtext,content, andresourcepayloadsreplacetargets and CI coverage for shared-module changesTest Plan
go test ./...inacptextgo test ./...inapigo test ./...inintegrations/slack-gatewaydocker build -f api/Dockerfile . -t spritz-api-whitespace-checkdocker build -f integrations/slack-gateway/Dockerfile . -t spritz-slack-gateway-whitespace-checkruby -e 'require "yaml"; YAML.load_file(".github/workflows/go-tests.yml"); puts "ok"'\n- [x]git diff --check\n- [x]npx -y @simpledoc/simpledoc check\n