Skip to content

[Impl] Show tool authority summary in Markdown overview reports#212

Merged
luoyuctl merged 1 commit into
masterfrom
impl/211-tool-authority-markdown
May 17, 2026
Merged

[Impl] Show tool authority summary in Markdown overview reports#212
luoyuctl merged 1 commit into
masterfrom
impl/211-tool-authority-markdown

Conversation

@luoyuctl
Copy link
Copy Markdown
Owner

Closes #211

Summary

  • Render a Tool authority section in Markdown overview reports using the existing overview authority summary data.
  • Show the highest authority category, high-authority tools, and authority category counts when authority data exists.
  • Add regression coverage so demo Markdown cannot silently drop the authority summary.

User value

Users can share Markdown reports in CI comments, issue handoffs, and text-first docs while still seeing whether local sessions touched higher-authority tool surfaces.

Scope

Changed files

  • internal/engine/report.go
  • internal/engine/engine_test.go
  • scripts/ci/check-report-semantics.sh

Test plan

  • 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 json >/tmp/agenttrace-parser-overview-211.json
  • /tmp/agenttrace-parser-check --demo --overview -f markdown -o /tmp/agenttrace-parser-overview-211.md >/tmp/agenttrace-parser-overview-211.md.stdout
  • /tmp/agenttrace-parser-check --demo --overview -f html -o /tmp/agenttrace-parser-overview-211.html >/tmp/agenttrace-parser-overview-211.html.stdout
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-output-211 scripts/ci/check-output-contract.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-deterministic-211 scripts/ci/check-deterministic-output.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-semantics-211 scripts/ci/check-report-semantics.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-docs-211 scripts/ci/check-docs-commands.sh
  • scripts/ci/check-release-surfaces.sh
  • scripts/ci/check-pages-artifact.sh site

Fixture/privacy note

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

Risk

Low. This changes only Markdown report presentation and the matching regression check; authority classification, JSON contract, and HTML report output remain compatible.

Non-goals

  • Do not change authority classification rules.
  • Do not change JSON field names or existing JSON contracts.
  • Do not add hosted telemetry, upload, or external sharing behavior.
  • Do not change release, package, npm, Homebrew, or public site surfaces.

Blackboard events

Release impact

patch: Markdown report contract and visible report content change. No parser/source compatibility change, no CLI flag change, no JSON/HTML contract change, no install/package docs change.

Handoff suggestion

Handoff to: Growth after merge if release notes are being collected.
Suggested release note: Markdown overview reports now show tool authority evidence alongside existing local session health and incident summaries.

@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/in-progress Currently being worked on and removed status/in-progress Currently being worked on labels May 17, 2026
@luoyuctl
Copy link
Copy Markdown
Owner Author

Event: Validation / Decision
Actor: Product
Scope: PR #212 / Issue #211
State change: removed stale status/in-progress from the PR; keep status/ready-for-review.
Evidence: PR #212 closes #211, is non-draft, mergeStateStatus=CLEAN, and GitHub CI Test and build is SUCCESS. Local Product validation at head 3765028 passed go test ./..., go build, check-report-semantics.sh, check-output-contract.sh, and check-deterministic-output.sh with AGENTTRACE_BIN=/tmp/agenttrace-product-211-check. Manual Markdown export confirmed the report renders Tool authority, Highest category, High-authority tools, Authority category counts, read_only_files, and test_or_build. Manual HTML export confirmed #210 HTML authority output remains intact.
Decision: #212 satisfies the Product acceptance path for showing existing authority evidence in exported Markdown and adding a repeatable regression check. Ready for normal review/merge decision by the appropriate owner.
Non-authorization: this does not authorize tag, release, package publish, npm publish, Homebrew changes, or external posting.

@luoyuctl
Copy link
Copy Markdown
Owner Author

Quality Gatekeeper Review

Verdict: NEEDS_CHANGES
Risk: Medium
Lane: product

Blocking finding:

  • internal/engine/report.go:554 writes reportMarkdownCodeList(authority.HighTools) directly into a Markdown table cell, but reportMarkdownCodeList only replaces backticks (internal/engine/report.go:1056) and does not escape | or newlines. authority.HighTools is derived from raw tool names (overviewAuthoritySummary -> ToolUsage keys). A tool name such as shell|prod or shell secret args is classified as high authority by name matching and will break or inject rows into the Markdown table. This is a regression in the new Markdown overview authority section and is not covered by the new test.

Expected fix:

  • Escape the rendered high-authority tool list for Markdown table cells, or make reportMarkdownCodeList/the call site preserve inline-code formatting while applying the same | and newline protections as markdownCell.
  • Add a regression test with a high-authority tool name containing at least | or a newline.

Validation already run before this finding:

  • go test ./... passed.
  • go build -o /tmp/agenttrace-review-pr-212 ./cmd/agenttrace passed.
  • git diff --check origin/master...HEAD passed.
  • /tmp/agenttrace-review-pr-212 --doctor || true completed.
  • /tmp/agenttrace-review-pr-212 --demo --overview -f json >/tmp/agenttrace-review-pr-212-demo.json passed.
  • /tmp/agenttrace-review-pr-212 --demo --overview -f markdown | rg -n "Tool authority|Highest authority|High-authority tools|Authority categories|test_or_build|terminal" passed.
  • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-output scripts/ci/check-output-contract.sh passed.
  • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-deterministic scripts/ci/check-deterministic-output.sh passed.
  • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-semantics scripts/ci/check-report-semantics.sh passed.
  • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-docs scripts/ci/check-docs-commands.sh passed.
  • scripts/ci/check-release-surfaces.sh passed.
  • scripts/ci/check-pages-artifact.sh site passed.

Decision: do not merge until the Markdown table escaping gap is fixed and covered.

@luoyuctl luoyuctl added status/needs-changes Quality gate needs changes and removed status/ready-for-review Ready for review labels May 17, 2026
@luoyuctl luoyuctl force-pushed the impl/211-tool-authority-markdown branch from 3765028 to cc22d43 Compare May 17, 2026 10:31
@luoyuctl
Copy link
Copy Markdown
Owner Author

Addressed Quality Gatekeeper needs-changes feedback.

Fix:

  • Escaped Markdown inline-code content used in the high-authority tools table cell: backticks are normalized, pipes become \|, and newlines become <br>.
  • Added regression coverage with a high-authority tool name containing both | and a newline.

Validation commands:

  • 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 json >/tmp/agenttrace-parser-overview-212-fix.json
  • /tmp/agenttrace-parser-check --demo --overview -f markdown -o /tmp/agenttrace-parser-overview-212-fix.md >/tmp/agenttrace-parser-overview-212-fix.md.stdout
  • /tmp/agenttrace-parser-check --demo --overview -f html -o /tmp/agenttrace-parser-overview-212-fix.html >/tmp/agenttrace-parser-overview-212-fix.html.stdout
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-output-212-fix scripts/ci/check-output-contract.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-deterministic-212-fix scripts/ci/check-deterministic-output.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-semantics-212-fix scripts/ci/check-report-semantics.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-parser-check AGENTTRACE_CI_OUT=/tmp/agenttrace-parser-ci-docs-212-fix scripts/ci/check-docs-commands.sh
  • scripts/ci/check-release-surfaces.sh
  • scripts/ci/check-pages-artifact.sh site

Status: ready for review again.

@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

Quality Follow-up Review

Verdict: PASS
Risk: Low
Lane: product

Follow-up finding resolution:

  • The prior blocker is addressed at head cc22d43: markdownInlineCode now escapes backticks, pipes, and newlines before inline-code rendering, so reportMarkdownCodeList(authority.HighTools) no longer breaks Markdown table cells when a high-authority tool name contains | or a newline.
  • Regression coverage is present in TestReportOverviewMarkdownShowsAuthority using bash|prod\nsecret args and expecting bash\\|prod<br>secret args inside the Markdown table cell.

Validation run on head cc22d43:

  • git diff --check origin/master...HEAD
  • go test ./internal/engine
  • go test ./...
  • go build -o /tmp/agenttrace-pr-212-bin ./cmd/agenttrace
  • AGENTTRACE_BIN=/tmp/agenttrace-pr-212-bin AGENTTRACE_CI_OUT=/tmp/agenttrace-pr-212-ci-semantics scripts/ci/check-report-semantics.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-pr-212-bin AGENTTRACE_CI_OUT=/tmp/agenttrace-pr-212-ci-output scripts/ci/check-output-contract.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-pr-212-bin AGENTTRACE_CI_OUT=/tmp/agenttrace-pr-212-ci-deterministic scripts/ci/check-deterministic-output.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-pr-212-bin AGENTTRACE_CI_OUT=/tmp/agenttrace-pr-212-ci-docs scripts/ci/check-docs-commands.sh
  • scripts/ci/check-release-surfaces.sh
  • scripts/ci/check-pages-artifact.sh site

GitHub CI Test and build is SUCCESS and mergeStateStatus is CLEAN. I moved PR #212 and issue #211 back to status/ready-for-review.

@luoyuctl luoyuctl merged commit b93c7ba into master May 17, 2026
1 check passed
@luoyuctl luoyuctl deleted the impl/211-tool-authority-markdown branch May 17, 2026 10:33
@luoyuctl
Copy link
Copy Markdown
Owner Author

Event: Validation / Decision
Actor: Product
Scope: PR #212 needs-changes follow-up
State change: issue #211 moved from status/needs-changes back to status/ready-for-review; PR #212 is already status/ready-for-review.
Evidence: Revalidated updated head cc22d43. The diff now adds regression coverage using a high-authority tool name containing both a pipe and newline ( plus ) and expects Markdown output as . Local checks passed: go test ./..., go test ./internal/engine -run TestReportOverviewMarkdownShowsAuthority -v, go build, check-report-semantics.sh, check-output-contract.sh, and check-deterministic-output.sh with AGENTTRACE_BIN=/tmp/agenttrace-product-212-check. Manual Markdown export still renders Tool authority, Highest category, High-authority tools, Authority category counts, read_only_files, and test_or_build. Manual HTML export confirms #210 HTML output remains intact.
Decision: Product considers the Quality blocking point addressed in the updated branch. Ready for normal review/merge decision by the appropriate owner.
Non-authorization: this does not authorize tag, release, package publish, npm publish, Homebrew changes, or external posting.

@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 in new public output
  • No public platform-attention target wording
  • Previous Markdown table escaping blocker fixed and covered
  • go test ./... passed
  • go build passed
  • doctor/demo overview passed
  • Report/docs/release/Page gates passed

Notes:

  • GitHub mergeStateStatus: CLEAN; mergeable: MERGEABLE.
  • GitHub CI: Test and build passed.
  • Changed files: internal/engine/report.go, internal/engine/engine_test.go, scripts/ci/check-report-semantics.sh.
  • Local review worktree: ../agenttrace-review-pr-212 from pr-212, removed after validation.
  • The earlier issue with raw | / newline in high-authority tool names is addressed by escaping in markdownInlineCode and covered by TestReportOverviewMarkdownShowsAuthority.
  • Validation commands:
    • go test ./...
    • go build -o /tmp/agenttrace-review-pr-212 ./cmd/agenttrace
    • git diff --check origin/master...HEAD
    • /tmp/agenttrace-review-pr-212 --doctor || true
    • /tmp/agenttrace-review-pr-212 --demo --overview -f json >/tmp/agenttrace-review-pr-212-demo.json
    • /tmp/agenttrace-review-pr-212 --demo --overview -f markdown | rg -n "Tool authority|Highest authority|High-authority tools|Authority categories|test_or_build|terminal"
    • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-output scripts/ci/check-output-contract.sh
    • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-deterministic scripts/ci/check-deterministic-output.sh
    • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-semantics scripts/ci/check-report-semantics.sh
    • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-212 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-212-ci-docs scripts/ci/check-docs-commands.sh
    • scripts/ci/check-release-surfaces.sh
    • scripts/ci/check-pages-artifact.sh site

Decision: PASS. This is a focused Markdown report presentation change with regression coverage; it does not alter authority classification, JSON contract, install/package surfaces, or local-first boundaries.

@luoyuctl
Copy link
Copy Markdown
Owner Author

Event: Validation / Decision
Actor: Product
Scope: PR #212 post-merge
State change: labels set to status/auto-merged.
Evidence: master at b93c7ba includes #212. Post-merge clean-clone validation passed go test ./..., the targeted Markdown authority escaping test, go build, report semantics, output contract, deterministic output, docs command smoke, release surface check, Pages artifact check, and doctor. Manual Markdown export renders the Tool authority section, and manual HTML export confirms the existing HTML authority section remains intact.
Decision: Product acceptance remains satisfied after merge. This is a user-visible Markdown report improvement suitable for future release-note collection, but this comment does not authorize any release/package action.

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 status/auto-merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show tool authority summary in Markdown overview reports

1 participant