Skip to content

ESS Diagnostics: interactive transcript-diagnosis skill (replaces Python tool) - #289

Open
RamananVr wants to merge 8 commits into
mainfrom
feature/ess-diagnostics-skills-v2
Open

RamananVr wants to merge 8 commits into
mainfrom
feature/ess-diagnostics-skills-v2

Conversation

@RamananVr

@RamananVr RamananVr commented Sep 17, 2026

Copy link
Copy Markdown

Summary

Replaces the standalone ESS Diagnostics Python tool with a single self-contained Claude skill (tools/ESS-Diagnostics-Skills/SKILL.md) that walks a Field Engineer (FDE) through a Copilot Studio / PVA transcript interactively and produces evidence-cited outputs. The entire Python pipeline (src/, tests/, pyproject.toml) is removed.

What the skill does

  • Step 0 — hard gate: stops and asks the FDE to confirm the transcript file path and state the specific problem before parsing anything (won't proceed without a problem statement).
  • Per-turn interactive walkthrough: for each turn it shows a structured summary (intent, search query + rewrite, and all search results with their source text) plus a one-line verdict strip, then hard-stops with a section menu. The FDE can drill into any section (full evidence + the check's reasoning), override a verdict (with reason, carried into the report), continue, or run all to finish without pausing.
  • 5 checks: intent recognition, search query issued (+ rewrite), search-result topical relevance, knowledge grounding consistency, final answer vs. retrieved content/guardrails. Divergence = first failing check; a root cause is composed from it.
  • Real-schema parse map: derived from real transcript exports — events are Trace discriminated by p.data.kind (LlmIntentRecognized, PluginStart, PluginResponse, AnalyticsAiMetricsSignalTraceData, KnowledgeTraceData); user turns are SynchronousIncomingActivity; grounding/rewrite come from completionState / rewrittenMessage / verifiedSearchResults[].rankScore. Missing fields degrade to N/A rather than guessing.

Outputs (three files, written to the OS temp dir — never the repo, since transcripts contain employee PII)

  1. <name>-debug-report.md — human-readable diagnosis: per-turn verdicts with evidence, FDE overrides, divergence point, root cause.
  2. <name>-normalized.json — compact diagnostic view (only the fields the checks use; no verdicts).
  3. <name>-transcript.jsonfaithful, lossless full transcript converted to JSON (every event and field preserved, _turn/_index annotated), produced by the bundled helper scripts/transcript_to_json.py.

Transcript helper is Python (ported from Node.js)

The bundled faithful-dump helper is scripts/transcript_to_json.py — a stdlib-only Python script, so the toolkit stays Python-only with no Node.js dependency. It began as a Node.js helper (transcript-to-json.js) and was ported to Python within this PR as an exact behavioral drop-in: identical CLI contract (<transcript.txt> [outFile.json]), same _turn/_index annotation, same temp-dir output path, same Error:/exit-1 failures, and content byte-identical output (ensure_ascii=False preserves raw Unicode). The Node.js version has been removed and SKILL.md now invokes the Python helper.

How to invoke the skill

From a Claude Code session in the repo, either invoke it by name:

/ESS-Diagnostics-Skills:diagnose-transcript

or point Claude at it directly:

Use the ESS diagnostics skill on C:\path\to\Transcript_xxxx.txt

The skill then (1) stops and asks for the file path + the specific problem, (2) parses and walks each turn — pausing so you can drill in, override a verdict, continue, or run all, and (3) writes the three output files to your OS temp dir and reports their absolute paths.

To convert a transcript to faithful JSON directly (also used internally by the skill) — use python on Windows, python3 on POSIX:

python tools/ESS-Diagnostics-Skills/scripts/transcript_to_json.py "<path-to-transcript.txt>"

Validation

Dry-run against a real (redacted) transcript confirmed the Step 0 gate, per-turn hard stops, real-schema extraction, drill-down/override, and temp-dir outputs. The run surfaced a genuine search relevancy/ranking defect — the correct KB was retrieved but under-ranked (all rankScore=0) and not cited — validating that the checks + FDE override mechanism work. No automated test suite (the skill is prose); the Python helper was validated manually (run against a real transcript, output diffed byte-for-byte against the original Node.js helper, and error-path spot-checked).

Notes

  • No PII-bearing artifacts are written to the repo; all diagnosis outputs go to the OS temp directory.
  • Planning docs live under tools/ESS-Diagnostics-Skills/docs/plans/, consolidated into two files that each cover both efforts (the v4 skill and the Node→Python helper port) in a Part 1 / Part 2 split: 2026-09-17-ess-diagnostics-design.md (combined design) and 2026-09-17-ess-diagnostics-implementation.md (combined implementation plan).

🤖 Generated with Claude Code

@RamananVr RamananVr changed the title ESS Diagnostics Skills (v2): real-schema rebuild ESS Diagnostics: interactive transcript-diagnosis skill (replaces Python tool) Sep 17, 2026
@RamananVr
RamananVr force-pushed the feature/ess-diagnostics-skills-v2 branch from 4c5c91c to 345782f Compare September 17, 2026 23:51
Replace the standalone Python diagnostics tool with a single self-contained
Claude skill (tools/ESS-Diagnostics-Skills/SKILL.md) that walks a Field
Engineer through a Copilot Studio / PVA transcript turn-by-turn, runs a
5-check diagnostic with quoted evidence, and writes a Debug Report plus a
normalized-diagnostic JSON and a faithful full-transcript JSON to the OS temp
directory (never the repo — transcripts contain PII).

Highlights:
- Step 0 hard gate: confirm file path + problem statement before parsing.
- Interactive per-turn walkthrough: structured summary, section drill-down,
  verdict override, continue / run all.
- Real-schema parse map (Trace/p.data.kind, SynchronousIncomingActivity,
  AnalyticsAiMetricsSignalTraceData / KnowledgeTraceData).
- 5 checks with divergence + root cause; search results show source text for
  every result.
- scripts/transcript-to-json.js: lossless transcript-to-JSON helper.
- Design + implementation docs under docs/plans/.

Co-Authored-By: Claude <[email protected]>
@RamananVr
RamananVr force-pushed the feature/ess-diagnostics-skills-v2 branch from 345782f to 1b0e8bb Compare September 17, 2026 23:55
RamananVr and others added 6 commits September 17, 2026 18:20
Design doc for converting scripts/transcript-to-json.js to a stdlib-only
Python drop-in (transcript_to_json.py) with exact behavioral parity, plus
SKILL.md invocation updates and removal of the JS file.

Co-Authored-By: Claude <[email protected]>
…entation

Merge the v4-skill and Node->Python-port design docs into a single
design doc, and their two implementation plans into a single
implementation doc (each split into Part 1 / Part 2). No content lost.

Co-Authored-By: Claude <[email protected]>

@AdwaitRaut AdwaitRaut 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.

The per-turn walkthrough is solid. N/A-on-failed-precondition and the FDE override path are the right calls.

One fix before merge: the output contract disagrees with itself across the Rules block, Step 4, and the README (two files vs three). Open question on invocation plus a few nits below — none of those need to hold it up.

Comment thread tools/ESS-Diagnostics-Skills/SKILL.md Outdated
Comment thread tools/ESS-Diagnostics-Skills/SKILL.md
Comment thread tools/ESS-Diagnostics-Skills/scripts/transcript_to_json.py
Comment thread tools/ESS-Diagnostics-Skills/scripts/transcript_to_json.py
Comment thread tools/ESS-Diagnostics-Skills/scripts/transcript_to_json.py
- Make the output contract consistently say three files (Debug Report,
  normalized JSON, faithful transcript JSON) across SKILL.md Rules + Step 4
  and the README; previously the Rules block and README said two, which would
  lead an LLM to skip the faithful dump Step 4 promises.
- transcript_to_json.py: add the Microsoft copyright/license header; refuse to
  overwrite the source transcript when it is passed as the output path; and on
  POSIX restrict the PII-bearing temp dir/file to the owner (0700/0600).
- README: clarify how the skill is invoked (point Claude at the skill dir;
  no wired slash command yet).
- Replace a real user-alias path with a placeholder in the implementation plan.

Co-Authored-By: Claude <[email protected]>
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.

2 participants