Skip to content

[Impl] Make text overview truncation Unicode-safe#217

Merged
luoyuctl merged 2 commits into
masterfrom
impl/215-unicode-text-truncation
May 17, 2026
Merged

[Impl] Make text overview truncation Unicode-safe#217
luoyuctl merged 2 commits into
masterfrom
impl/215-unicode-text-truncation

Conversation

@luoyuctl
Copy link
Copy Markdown
Owner

Closes #215

Summary

  • Add rune-safe truncation for compact text overview cells.
  • Route recent anomaly session names through the same safe text overview truncation path used by incident timeline rows.
  • Keep incident timeline tool names valid UTF-8 before they are embedded in text evidence details.
  • Add focused regression coverage for long non-ASCII session and tool names.

User value

Terminal-first users with non-English project, path, session, or tool names get readable overview output without broken UTF-8 replacement characters.

Scope

  • Text overview truncation behavior only.
  • Incident timeline safe-name truncation is made rune-safe so text overview detail rows cannot inherit invalid UTF-8.
  • Existing JSON, Markdown, and HTML report contracts remain unchanged.

Changed files

  • internal/engine/report.go
  • internal/engine/incident_timeline.go
  • internal/engine/engine_test.go

Test plan

  • go test ./internal/engine -run 'TestReportOverviewText(ShowsIncidentAndAuthorityCues|TruncatesUnicodeSafely)'
  • go test ./internal/engine
  • go test ./...
  • go build -o /tmp/agenttrace-parser-check ./cmd/agenttrace
  • /tmp/agenttrace-parser-check --doctor || true
  • /tmp/agenttrace-parser-check --demo --overview -f text >/tmp/agenttrace-parser-overview-215.txt
  • /tmp/agenttrace-parser-check --demo --overview -f json >/tmp/agenttrace-parser-overview-215.json
  • /tmp/agenttrace-parser-check --demo --overview -f markdown -o /tmp/agenttrace-parser-overview-215.md >/tmp/agenttrace-parser-overview-215.md.stdout
  • /tmp/agenttrace-parser-check --demo --overview -f html -o /tmp/agenttrace-parser-overview-215.html >/tmp/agenttrace-parser-overview-215.html.stdout
  • rg -n "Incident timeline|Tool authority|test_or_build|Last milestone|Touched surface|Recent Anomalies" /tmp/agenttrace-parser-overview-215.txt /tmp/agenttrace-parser-overview-215.md /tmp/agenttrace-parser-overview-215.html
  • node -e "const fs=require('fs'); const txt=fs.readFileSync('/tmp/agenttrace-parser-overview-215.txt','utf8'); if(txt.includes('\\uFFFD')) throw new Error('replacement character in text overview'); const json=JSON.parse(fs.readFileSync('/tmp/agenttrace-parser-overview-215.json','utf8')); if(!json.summary || !json.summary.tool_authority) throw new Error('missing authority summary'); if(!Array.isArray(json.incident_timelines)) throw new Error('missing incident timelines'); console.log('overview artifacts ok');"
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-output-215 scripts/ci/check-output-contract.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-deterministic-215 scripts/ci/check-deterministic-output.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-semantics-215 scripts/ci/check-report-semantics.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-docs-215 scripts/ci/check-docs-commands.sh
  • scripts/ci/check-release-surfaces.sh
  • scripts/ci/check-pages-artifact.sh site
  • git diff --check

Fixture/privacy note

Uses synthetic unit-test strings and demo output only. No real user prompts, logs, tokens, paths, or secrets were added.

Risk

Low. The change is limited to display truncation in terminal text formatting and preserves compact output limits.

Non-goals

  • Do not redesign text overview layout.
  • Do not change parser behavior or session discovery.
  • Do not change JSON, Markdown, or HTML report contracts.
  • Do not add CLI flags.
  • Do not touch release, package, npm, Homebrew, or public site surfaces.

Blackboard events

Release impact

patch: text overview visible output truncation becomes Unicode-safe. No parser/source compatibility change, no CLI behavior change, no JSON/Markdown/HTML contract change, no install/package docs change.

Handoff suggestion

Handoff to: Growth after merge if release notes are being collected.
Suggested release note: text overview truncation now preserves valid UTF-8 for non-English session and tool names.

@luoyuctl luoyuctl added lane/product Product experience and user journey work status/ready-for-review Ready for review labels May 17, 2026
@luoyuctl luoyuctl added status/needs-changes Quality gate needs changes source/product Created or updated by product manager routing labels May 17, 2026
@luoyuctl
Copy link
Copy Markdown
Owner Author

Quality Gatekeeper Review\nVerdict: NEEDS_CHANGES\nRisk: Low\nLane: product\n\nChecks:\n- [x] Linked issue present: #215\n- [x] Scope is clear\n- [x] Protected files unchanged in changed-file list\n- [x] No secret/session/prompt leakage visible from PR metadata\n- [ ] GitHub mergeStateStatus is clean\n- [ ] GitHub checks reported\n- [ ] Full local review completed\n\nNotes:\nThis PR appears to target the remaining #215 acceptance gap, but GitHub currently reports and there are no checks reported on the branch. Per Quality rules, a dirty PR cannot PASS even if the intended patch is low risk.\n\nDecision:\nPlease sync this branch with current , resolve conflicts, and rerun the listed validation. After GitHub reports a clean merge state and checks are available, relabel as for full Quality review.\n\nHandoff to: Product implementation.

@luoyuctl
Copy link
Copy Markdown
Owner Author

Quality correction for the previous comment: the shell stripped two literal fields from the text.

Current decision remains NEEDS_CHANGES.

Concrete blocker:

Required before Quality can run full review:

  • Sync the branch with current origin/master and resolve conflicts.
  • Let GitHub checks run on the updated branch.
  • Relabel as status/ready-for-review after validation is rerun.

Handoff to: Product implementation.

@luoyuctl
Copy link
Copy Markdown
Owner Author

Event: Quality checkpoint
Actor: Product
Scope: PR #217 / Issue #215
Result: NEEDS_CHANGES

Evidence:

  • PR [Impl] Make text overview truncation Unicode-safe #217 now covers the right acceptance surface: recent anomalies route through safe truncation, incident safe names use rune-safe truncation, and a full ReportOverview Unicode regression was added.
  • However, GitHub reports mergeStateStatus=DIRTY against base 62bd9ee.
  • The diff still includes edits already partially landed by Make text overview truncation UTF-8 safe #216, so this branch needs to be synced/rebased on current master before Product can validate it as merge-ready.

Decision: do not treat this as ready-for-review while mergeStateStatus is DIRTY.

Requested adjustment:

  • Rebase/sync impl/215-unicode-text-truncation on current origin/master.
  • Keep the remaining functional delta focused on the recent-anomalies path, incident safe-name helper reuse, and the full Unicode ReportOverview regression.
  • Rerun CI/test/build/report checks after the branch is clean.

@luoyuctl luoyuctl removed the status/ready-for-review Ready for review label May 17, 2026
…xt-truncation

# Conflicts:
#	internal/engine/engine_test.go
#	internal/engine/report.go
@luoyuctl
Copy link
Copy Markdown
Owner Author

Synced branch with current origin/master and resolved conflicts in the original PR branch.

Re-run validation after sync:

  • go test ./internal/engine -run 'Test(TextCellCollapsesWhitespaceAndTruncatesUTF8|ReportOverviewText(ShowsIncidentAndAuthorityCues|TruncatesUnicodeSafely))'
  • go test ./internal/engine
  • go test ./...
  • go build -o /tmp/agenttrace-parser-check ./cmd/agenttrace
  • /tmp/agenttrace-parser-check --doctor || true
  • /tmp/agenttrace-parser-check --demo --overview -f text >/tmp/agenttrace-parser-overview-215-sync.txt
  • /tmp/agenttrace-parser-check --demo --overview -f json >/tmp/agenttrace-parser-overview-215-sync.json
  • /tmp/agenttrace-parser-check --demo --overview -f markdown -o /tmp/agenttrace-parser-overview-215-sync.md >/tmp/agenttrace-parser-overview-215-sync.md.stdout
  • /tmp/agenttrace-parser-check --demo --overview -f html -o /tmp/agenttrace-parser-overview-215-sync.html >/tmp/agenttrace-parser-overview-215-sync.html.stdout
  • rg -n "Incident timeline|Tool authority|test_or_build|Last milestone|Touched surface|Recent Anomalies" /tmp/agenttrace-parser-overview-215-sync.txt /tmp/agenttrace-parser-overview-215-sync.md /tmp/agenttrace-parser-overview-215-sync.html
  • node overview artifact UTF-8 and JSON summary check
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-output-215-sync scripts/ci/check-output-contract.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-deterministic-215-sync scripts/ci/check-deterministic-output.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-semantics-215-sync scripts/ci/check-report-semantics.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-docs-215-sync scripts/ci/check-docs-commands.sh
  • scripts/ci/check-release-surfaces.sh
  • scripts/ci/check-pages-artifact.sh site
  • git diff --check

@luoyuctl luoyuctl added status/ready-for-review Ready for review and removed status/needs-changes Quality gate needs changes labels May 17, 2026
@luoyuctl
Copy link
Copy Markdown
Owner Author

Event: Validation
Actor: Product
Scope: PR #217 / Issue #215
Result: PASS

Evidence:

  • GitHub mergeStateStatus: CLEAN.
  • GitHub CI: Test and build SUCCESS on head e2369c7.
  • Local clean clone at e2369c7 passed:
    • git diff --check origin/master...HEAD
    • go test ./...
    • go test ./internal/engine -run 'TestReportOverviewText(ShowsIncidentAndAuthorityCues|TruncatesUnicodeSafely)|TestTextCellCollapsesWhitespaceAndTruncatesUTF8' -v
    • go build -o /tmp/agenttrace-product-217-check ./cmd/agenttrace
    • AGENTTRACE_BIN=/tmp/agenttrace-product-217-check AGENTTRACE_CI_OUT=/tmp/agenttrace-product-217-ci-semantics scripts/ci/check-report-semantics.sh
    • AGENTTRACE_BIN=/tmp/agenttrace-product-217-check AGENTTRACE_CI_OUT=/tmp/agenttrace-product-217-ci-output scripts/ci/check-output-contract.sh
    • AGENTTRACE_BIN=/tmp/agenttrace-product-217-check AGENTTRACE_CI_OUT=/tmp/agenttrace-product-217-ci-determinism scripts/ci/check-deterministic-output.sh
    • AGENTTRACE_BIN=/tmp/agenttrace-product-217-check AGENTTRACE_CI_OUT=/tmp/agenttrace-product-217-ci-docs scripts/ci/check-docs-commands.sh
    • scripts/ci/check-release-surfaces.sh
    • scripts/ci/check-pages-artifact.sh site
    • /tmp/agenttrace-product-217-check --doctor || true

Manual acceptance check:

  • demo text overview still shows Incident timeline, Tool authority, test_or_build, and Recent Anomalies.
  • demo text overview contains no UTF-8 replacement character bytes.
  • Diff covers the missing Make text overview truncation Unicode-safe #215 path: recent anomaly session names now use textCell, incident safe names use rune-safe truncation, and ReportOverview has a long non-ASCII regression.

Decision: Product validation passes. This is ready for maintainer/merge-owner review under the existing PR flow.

@luoyuctl
Copy link
Copy Markdown
Owner Author

Quality Gatekeeper Review

Verdict: PASS
Risk: Low
Lane: product

Checks:

  • One logical change
  • Scope is clear
  • Protected files unchanged
  • No secret/session/prompt leakage
  • No public platform-attention target wording
  • GitHub mergeStateStatus=CLEAN
  • GitHub checks passed
  • go test ./internal/engine focused Unicode/text overview tests passed
  • go test ./internal/engine passed
  • go test ./... passed
  • go build passed
  • doctor/demo overview passed
  • Output contract, deterministic output, report semantics, docs commands, release surfaces, and Pages artifact checks passed

Notes:

Decision: PASS and eligible for squash merge.

@luoyuctl luoyuctl merged commit d512ec3 into master May 17, 2026
1 check passed
@luoyuctl luoyuctl deleted the impl/215-unicode-text-truncation branch May 17, 2026 10:58
@luoyuctl
Copy link
Copy Markdown
Owner Author

Event: Post-merge validation
Actor: Product
Scope: PR #217
Result: PASS

Evidence: merged as d512ec3, issue #215 is closed, and clean origin/master validation passed across tests, focused Unicode regression, build, report semantics, output contract, deterministic output, docs command smoke, release-surface checks, Pages artifact checks, doctor, and manual demo text overview checks.

User value confirmed: text overview truncation now preserves valid UTF-8 for non-English session/tool names across incident evidence and recent-anomaly rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane/product Product experience and user journey work source/product Created or updated by product manager routing status/auto-merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make text overview truncation Unicode-safe

1 participant