Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ee2712c
feat(agents): migrate APEX to the Copilot SDK harness
jonathan-vella Oct 16, 2026
5e544fd
docs: Preserve harness migration plan and delivery backlog
jonathan-vella Oct 17, 2026
a645d3e
fix: Format SDK smoke acceptance document
jonathan-vella Oct 17, 2026
d7311e8
fix: Align CI Python and repair archived audit link
jonathan-vella Oct 17, 2026
b4211e8
fix: Align historical audit table after link repair
jonathan-vella Oct 17, 2026
8ee1618
fix: Verify current SDK definition routing attribution
jonathan-vella Oct 17, 2026
29706d7
fix(agents): Echo handshake identity in readiness acknowledgments
jonathan-vella Oct 17, 2026
bfcc270
feat(agents): Use operator-selected Auto without model pins
jonathan-vella Oct 17, 2026
bd13e97
fix(agents): Verify inherited readiness telemetry
jonathan-vella Oct 17, 2026
33c9d88
fix(agents): Make worker readiness model-agnostic
jonathan-vella Oct 17, 2026
aa55425
feat(agents): Automate one-shot rubber-duck reviews
jonathan-vella Oct 17, 2026
7e6a9d7
test(agents): Align frozen-input review metadata assertion
jonathan-vella Oct 17, 2026
02fbb1a
fix(agents): Record native synchronous multi-turn reviews
jonathan-vella Oct 17, 2026
0f94724
fix(scripts): Scope execution identities by protocol
jonathan-vella Oct 17, 2026
2baa5f2
fix(agents): Make reviewer draft schema explicit
jonathan-vella Oct 17, 2026
a315279
feat(agents): Streamline Copilot SDK harness for Autopilot execution
jonathan-vella Oct 17, 2026
611a1f3
fix(agents): Preserve truthful migration acceptance and review proven…
jonathan-vella Oct 17, 2026
9e6562c
docs: Format migration recovery evidence table
jonathan-vella Oct 17, 2026
ea8cb38
docs: Record verified owner-initiated test cleanup
jonathan-vella Oct 17, 2026
614286d
docs: Replan VS Code Copilot-only migration
jonathan-vella Oct 18, 2026
62a4d93
docs: Track additional migration review blockers
jonathan-vella Oct 18, 2026
5fb16a8
fix: Retire runtime hooks and reconcile Copilot contracts
jonathan-vella Oct 18, 2026
a57bae4
fix: Preserve manual entry for consequential agent roles
jonathan-vella Oct 18, 2026
69fb23a
refactor(agents): Migrate all bodies to native Copilot execution
jonathan-vella Oct 18, 2026
dd2ee9a
fix(ci): Accept native agents without legacy UI handoff references
jonathan-vella Oct 18, 2026
91a3e52
docs: Record owner-observed native agent retests
jonathan-vella Oct 18, 2026
43ef856
docs: Record direct question probes for every main agent
jonathan-vella Oct 18, 2026
f4094ad
fix(agents): Continue selected Orchestrator into requirements discovery
jonathan-vella Oct 18, 2026
977a90f
fix(agents): Restore guided Requirements discovery
jonathan-vella Oct 18, 2026
98da7c4
fix(agents): Remove shell-based reviewer finalization
jonathan-vella Oct 18, 2026
a96c6a3
fix(instructions)!: Remediate audit and enforce Copilot contracts
jonathan-vella Oct 18, 2026
7487fe4
fix(agents): Preserve negated scenario choices in discovery
jonathan-vella Oct 18, 2026
4b688a5
fix(agents): Preserve native question form wrappers
jonathan-vella Oct 19, 2026
b012d5f
refactor(agents): Share one structured review backend
jonathan-vella Oct 19, 2026
8018a04
fix(scripts): Report structured reviewer execution failures
jonathan-vella Oct 19, 2026
03c1fa9
fix: Resolve workflow contract drift and validator blind spots across…
jonathan-vella Oct 19, 2026
e480c7c
fix: Apply cp-harness-01 lessons learned to subagents, skills, and tr…
jonathan-vella Oct 19, 2026
e0e4651
chore: apply dependabot updates, align governance collector, and arch…
jonathan-vella Oct 19, 2026
51d5962
fix(scripts): Support downstream apex-accelerator repositories in val…
jonathan-vella Oct 19, 2026
84191cd
chore: Merge main into feat/copilot-harness-migration
jonathan-vella Oct 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .archive/pre-cpharness/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Pre-Copilot-Harness Archive

Historical VS Code Local prompt roots, split-harness adapters and superseded
log procedures are retained here for reference, not discovery or execution.
Their metadata, commands and relative links describe the previous layout.

Active entry points are manual skills under `.github/skills/`; workflow routing
uses named SDK workers with independent reviews, human gates and verified readiness.
Do not add this archive to agent, skill, prompt, instruction or validator discovery.
Existing project artifacts and recall state were not migrated or restamped.
510 changes: 510 additions & 0 deletions .archive/pre-cpharness/debug-log-export.md

Large diffs are not rendered by default.

161 changes: 161 additions & 0 deletions .archive/pre-cpharness/migration-plan-2026-10-16.md

Large diffs are not rendered by default.

273 changes: 273 additions & 0 deletions .archive/pre-cpharness/parse-chat-logs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
#!/usr/bin/env python3
"""Archived Local Copilot Chat log parser; not an active SDK entry point."""

from __future__ import annotations

import argparse
import json
import re
import sys
from dataclasses import asdict, dataclass, field
from datetime import datetime
from pathlib import Path

CCREQ_PATTERN = re.compile(
r"(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\s+"
r"\[(?P<level>\w+)\]\s+"
r"ccreq:(?P<request_id>[\w.]+)\s+\|\s+"
r"(?P<status>\w+)\s+\|\s+"
r"(?P<model>[^|]+?)\s+\|\s+"
r"(?P<latency_ms>\d+)ms\s+\|\s+"
r"\[(?P<request_type>[^\]]+)\]"
)

ERROR_PATTERN = re.compile(
r"(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})\s+"
r"\[error\]\s+(?P<message>.+)"
)


@dataclass
class Request:
timestamp: str
request_id: str
status: str
model_requested: str
model_actual: str
latency_ms: int
request_type: str
session_dir: str


@dataclass
class ErrorEntry:
timestamp: str
message: str
session_dir: str


@dataclass
class SessionSummary:
session_dir: str
log_path: str
time_range: str
total_requests: int
total_errors: int
models: dict[str, int]
request_types: dict[str, int]
avg_latency_ms: float
max_latency_ms: int
p95_latency_ms: int
long_turns: int # > 15s
burst_count: int # gaps < 2s between consecutive requests
latency_trend: str # escalating, stable, decreasing
requests: list[dict]
errors: list[dict]


def parse_model_field(raw: str) -> tuple[str, str]:
"""Split 'claude-opus-4.7 -> claude-opus-4-7' into (requested, actual)."""
raw = raw.strip()
if " -> " in raw:
parts = raw.split(" -> ", 1)
return parts[0].strip(), parts[1].strip()
return raw, raw


def parse_log_file(log_path: Path, session_dir: str) -> tuple[list[Request], list[ErrorEntry]]:
"""Extract request completions and errors from a single log file."""
requests: list[Request] = []
errors: list[ErrorEntry] = []

try:
text = log_path.read_text(encoding="utf-8", errors="replace")
except OSError:
return requests, errors

for line in text.splitlines():
m = CCREQ_PATTERN.search(line)
if m:
model_requested, model_actual = parse_model_field(m.group("model"))
requests.append(
Request(
timestamp=m.group("timestamp"),
request_id=m.group("request_id"),
status=m.group("status"),
model_requested=model_requested,
model_actual=model_actual,
latency_ms=int(m.group("latency_ms")),
request_type=m.group("request_type"),
session_dir=session_dir,
)
)
continue

em = ERROR_PATTERN.search(line)
if em:
errors.append(
ErrorEntry(
timestamp=em.group("timestamp"),
message=em.group("message")[:500],
session_dir=session_dir,
)
)

return requests, errors


def percentile(sorted_values: list[int], pct: float) -> int:
"""Return the value at the given percentile from a sorted list."""
if not sorted_values:
return 0
idx = int(len(sorted_values) * pct / 100)
return sorted_values[min(idx, len(sorted_values) - 1)]


def detect_latency_trend(requests: list[Request]) -> str:
"""Determine if latency is escalating, stable, or decreasing over the session."""
agent_reqs = [r for r in requests if r.request_type == "panel/editAgent"]
if len(agent_reqs) < 4:
return "insufficient-data"

half = len(agent_reqs) // 2
first_half_avg = sum(r.latency_ms for r in agent_reqs[:half]) / half
second_half_avg = sum(r.latency_ms for r in agent_reqs[half:]) / (len(agent_reqs) - half)

ratio = second_half_avg / first_half_avg if first_half_avg > 0 else 1.0
if ratio > 1.3:
return "escalating"
if ratio < 0.7:
return "decreasing"
return "stable"


def count_bursts(requests: list[Request]) -> int:
"""Count rapid sequential requests (gap < 2 seconds)."""
bursts = 0
timestamps = []
for r in requests:
try:
ts = datetime.strptime(r.timestamp, "%Y-%m-%d %H:%M:%S.%f")
timestamps.append(ts)
except ValueError:
continue

for i in range(1, len(timestamps)):
gap = (timestamps[i] - timestamps[i - 1]).total_seconds()
if gap < 2.0:
bursts += 1
return bursts


def summarize_session(
session_dir: str, log_path: str, requests: list[Request], errors: list[ErrorEntry]
) -> SessionSummary:
"""Build a session summary from parsed requests."""
models: dict[str, int] = {}
request_types: dict[str, int] = {}
latencies: list[int] = []

for r in requests:
models[r.model_actual] = models.get(r.model_actual, 0) + 1
request_types[r.request_type] = request_types.get(r.request_type, 0) + 1
latencies.append(r.latency_ms)

sorted_lat = sorted(latencies)
time_range = ""
if requests:
time_range = f"{requests[0].timestamp} — {requests[-1].timestamp}"

return SessionSummary(
session_dir=session_dir,
log_path=log_path,
time_range=time_range,
total_requests=len(requests),
total_errors=len(errors),
models=models,
request_types=request_types,
avg_latency_ms=round(sum(latencies) / len(latencies), 1) if latencies else 0,
max_latency_ms=max(latencies) if latencies else 0,
p95_latency_ms=percentile(sorted_lat, 95),
long_turns=sum(1 for lat in latencies if lat > 15000),
burst_count=count_bursts(requests),
latency_trend=detect_latency_trend(requests),
requests=[asdict(r) for r in requests],
errors=[asdict(e) for e in errors],
)


def discover_log_files(log_dir: Path) -> list[tuple[Path, str]]:
"""Find all Copilot Chat log files under the VS Code log directory."""
results = []
pattern = "**/GitHub.copilot-chat/GitHub Copilot Chat.log"
for log_path in sorted(log_dir.glob(pattern)):
session_dir = log_path.parent.parent.parent.name
results.append((log_path, session_dir))
return results


def main() -> None:
parser = argparse.ArgumentParser(
description="Parse Copilot Chat debug logs for context optimization analysis"
)
parser.add_argument(
"--log-dir",
type=Path,
default=Path.home() / ".vscode-server/data/logs",
help="VS Code log directory (default: ~/.vscode-server/data/logs)",
)
parser.add_argument(
"--output",
type=Path,
default=None,
help="Output JSON file path (default: stdout)",
)
parser.add_argument(
"--latest",
type=int,
default=0,
help="Only analyze the N most recent sessions (0 = all)",
)
parser.add_argument(
"--summary-only",
action="store_true",
help="Omit individual request details from output",
)
args = parser.parse_args()

log_files = discover_log_files(args.log_dir)
if not log_files:
print(f"No Copilot Chat logs found under {args.log_dir}", file=sys.stderr)
sys.exit(1)

if args.latest > 0:
log_files = log_files[-args.latest :]

sessions = []
for log_path, session_dir in log_files:
requests, errors = parse_log_file(log_path, session_dir)
if not requests:
continue
summary = summarize_session(session_dir, str(log_path), requests, errors)
if args.summary_only:
summary.requests = []
summary.errors = []
sessions.append(asdict(summary))

output = {
"generated": datetime.now().isoformat(),
"log_directory": str(args.log_dir),
"sessions_analyzed": len(sessions),
"sessions": sessions,
}

text = json.dumps(output, indent=2, default=str)
if args.output:
args.output.write_text(text, encoding="utf-8")
print(f"Wrote {len(sessions)} sessions to {args.output}", file=sys.stderr)
else:
print(text)


if __name__ == "__main__":
main()
Loading
Loading