Skip to content

chore(release): 0.6.3#7

Merged
pbean merged 3 commits into
mainfrom
release/0.6.3
Jun 21, 2026
Merged

chore(release): 0.6.3#7
pbean merged 3 commits into
mainfrom
release/0.6.3

Conversation

@pbean

@pbean pbean commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Release prep for 0.6.3. Auto-publish creates the v0.6.3 tag + GitHub release on merge.

Included

  • fix(copilot): correct turn-end event, payload casing, and probe prompt — Finalized the GitHub Copilot CLI adapter against a real probe run (CLI 1.0.63): turn-end is agentStop (PascalCase Stop never fires, so every session read as a timeout), payload keys are camelCase (sessionId/transcriptPath) so the shared relay now reads both casings, and probe mode sends its prompt verbatim so a skill-templating prompt_template no longer stalls the turn. Adds the copilot-events usage_parser and wires the copilot profile to it.
  • chore(release): reseed dev skill forks during release prepare — New scripts/seed_skills.py (+ release.py prepare hook) re-copies the gitignored .claude/skills/.agents/skills forks from canonical after a version bump, so test_module_skills_sync.py stays green without a manual reseed. Dev-only; not in the CHANGELOG.
  • chore(release): 0.6.3 — version stamp + CHANGELOG.

CHANGELOG (0.6.3)

Fixed

  • GitHub Copilot adapter (CLI 1.0.63). Turn-end is agentStop, not PascalCase Stop; remapped events, dropped the non-existent PreCompact, relay reads camelCase keys, probe sends its prompt verbatim.

Added

  • Copilot token accounting. New copilot-events usage_parser reads ~/.copilot/session-state/*/events.jsonl; the copilot profile is wired to it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added token accounting support for Copilot via new copilot-events parser.
  • Bug Fixes

    • Fixed Copilot adapter hook event mapping (turn-end event registration).
    • Improved payload key handling to support both snake_case and camelCase variants.
  • Documentation

    • Updated adapter authoring guide with Copilot profile refinements based on probe-driven fixes.
  • Tests

    • Added comprehensive test coverage for payload key casing, token accounting, and internal tooling.
  • Chores

    • Bumped version to 0.6.3 across all version files and manifests.

pbean and others added 3 commits June 21, 2026 12:40
Finalized the GitHub Copilot CLI adapter against a real probe run (CLI 1.0.63);
the profile that landed in 0.6.2 was wrong in ways no doc would reveal:

- Turn-end is `agentStop`, not PascalCase `Stop` (which never fires) — so every
  session read as a timeout. Remapped events to agentStop/sessionStart/sessionEnd
  and dropped the non-existent PreCompact.
- Payload keys are camelCase (sessionId/transcriptPath) regardless of event-name
  casing, so the shared hook relay now reads both camelCase and snake_case.
- Probe mode sends its prompt verbatim (not via render_prompt): a content-free
  turn has no skill name, so a skill-templating prompt_template rendered a missing
  .../skills//SKILL.md path the agent hunted for until the probe timed out.

Also adds the `copilot-events` usage_parser (reads
~/.copilot/session-state/*/events.jsonl, data.modelMetrics.<model>.usage.*,
cumulative-per-model) and wires the copilot profile to it (was "none").

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The version bump stamps the canonical bmad-auto-setup/assets/module.yaml, which
immediately drifts the gitignored dev-workspace skill forks (.claude/skills,
.agents/skills) and fails tests/test_module_skills_sync.py locally until they are
re-copied by hand. Add scripts/seed_skills.py (reseed, with --check) and call it
from `release.py prepare` right after stamping so the forks track the bump
automatically. The forks are gitignored, so nothing here is staged or committed,
and an absent tree (CI) is skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR releases version 0.6.3 with two functional changes: (1) corrects the Copilot adapter by fixing hook event name casing (StopagentStop), normalizing camelCase payload keys in the hook relay, and wiring a new copilot-events usage parser that reads events.jsonl for token accounting; (2) adds scripts/seed_skills.py to detect and repair drift between canonical skill directories and dev-workspace forks, integrated into the release preparation flow.

Changes

Copilot Adapter Fixes and Token Accounting

Layer / File(s) Summary
Copilot profile config and parser contract
src/automator/adapters/profile.py, src/automator/data/profiles/copilot.toml
Registers "copilot-events" in USAGE_PARSERS; rewrites the Copilot profile's hook events mapping from PascalCase Stop/SessionStart/SessionEnd/PreCompact to native camelCase agentStop/sessionStart/sessionEnd, and switches usage_parser from "none" to "copilot-events".
Hook relay camelCase payload normalization
src/automator/data/bmad_auto_hook.py, tests/test_hook_script.py
Expands session_id extraction to fall back over session_id/conversation_id/sessionId and transcript_path to support both transcript_path and transcriptPath; adds a subprocess test asserting camelCase-to-snake_case normalization.
copilot-events token tallying pipeline
src/automator/probe.py, src/automator/tokens.py, tests/test_tokens.py
Adds events.jsonl glob to TRANSCRIPT_GLOBS, fixes _probe_argv to pass PROBE_PROMPT verbatim, implements tally_copilot_events() reading cumulative modelMetrics from JSONL with reasoningTokens folded into output, wires it into read_usage(), and adds full token tests.
Install and profile shape tests
tests/test_install.py, tests/test_profile.py
Updates install tests to assert agentStop/sessionStart/sessionEnd hook keys; adds test_builtin_profiles_load assertions for the Copilot profile's hook wiring and copilot-events usage_parser.

Skill Fork Sync Script and Release Integration

Layer / File(s) Summary
seed_skills.py: drift detection and reseed logic
scripts/seed_skills.py
New script implementing drift() for recursive byte-level canonical-vs-fork comparison, reseed() to replace a fork tree with a fresh canonical copy, and run() to orchestrate check/reseed across all MODULE_SKILLS and FORK_TREES with appropriate exit codes.
release.py integration of _reseed_skills
scripts/release.py
Adds SEED_SKILLS path constant and _reseed_skills(dry_run) helper; calls it in both the dry-run reporting branch and the mutation branch of the prepare command.
seed_skills.py test suite
tests/test_seed_skills.py
Full test coverage: drift detection, reseed fixes drift and prunes extra files, missing fork tree skipped with success, missing canonical skill is fatal, and bad CLI args raise SystemExit.

0.6.3 Version Bump and Docs

Layer / File(s) Summary
Version bump and changelog/docs update
pyproject.toml, module.yaml, src/automator/__init__.py, .claude-plugin/marketplace.json, src/automator/data/skills/bmad-auto-setup/assets/module.yaml, CHANGELOG.md, docs/adapter-authoring-guide.md
Bumps version to 0.6.3 across all manifests; adds 0.6.3 CHANGELOG entry covering Copilot fixes and copilot-events; updates the adapter authoring guide's Copilot worked example to reflect probe-finalized changes.

Sequence Diagram(s)

sequenceDiagram
    rect rgba(173, 216, 230, 0.5)
        Note over copilot_CLI,bmad_auto_hook.py: Hook relay (camelCase normalization)
    end
    copilot_CLI->>bmad_auto_hook.py: stdin payload {sessionId, transcriptPath}
    bmad_auto_hook.py->>bmad_auto_hook.py: extract session_id from sessionId fallback chain
    bmad_auto_hook.py->>bmad_auto_hook.py: extract transcript_path from transcriptPath fallback chain
    bmad_auto_hook.py->>events_json_file: write normalized {session_id, transcript_path}

    rect rgba(144, 238, 144, 0.5)
        Note over read_usage,events.jsonl: Token accounting (copilot-events)
    end
    read_usage->>tally_copilot_events: parser == "copilot-events", transcript_path
    tally_copilot_events->>events.jsonl: iterate JSONL lines
    events.jsonl-->>tally_copilot_events: last data.modelMetrics per model
    tally_copilot_events-->>read_usage: TokenUsage (reasoningTokens folded into output_tokens)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • bmad-code-org/bmad-auto#6: Directly precedes this PR's work — establishes the Copilot probe-adapter integration that this PR finalizes by correcting hook event names, camelCase payload parsing, and wiring the copilot-events token pipeline.

Poem

🐇 Hoppity-hop through the event log I go,
agentStop replaces Stop — now the hooks flow!
CamelCase keys I decode with a sniff,
sessionIdsession_id, easy as a cliff.
Token metrics tallied, drift seeds firmly sown,
Version 0.6.3 — the garden has grown! 🌱

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a version release from 0.6.2 to 0.6.3 with related updates, which is the primary purpose of this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/0.6.3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@augmentcode

augmentcode Bot commented Jun 21, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Prepares the 0.6.3 release by updating version stamps and shipping fixes to the GitHub Copilot CLI adapter.

Changes:

  • Bumped package/module versions to 0.6.3 across pyproject.toml, module metadata, and marketplace metadata.
  • Documented the 0.6.3 release notes in CHANGELOG.md and refreshed the Copilot worked example in the adapter authoring guide.
  • Finalized the Copilot profile: corrected turn-end event wiring (agentStop), handled camelCase hook payload keys, and removed the non-existent PreCompact event.
  • Added copilot-events token accounting by parsing ~/.copilot/session-state/*/events.jsonl and wired Copilot to use it.
  • Adjusted probe mode to send the probe prompt verbatim (avoids skill-templated prompt templates stalling on an empty skill name).
  • Added a dev-only reseed step (scripts/seed_skills.py) and integrated it into release.py prepare to keep gitignored skill forks in sync after version bumps.
  • Extended/updated tests to cover Copilot hook payload casing, Copilot usage parsing, profile event mappings, and skill reseeding behavior.

Technical Notes: The Copilot usage parser assumes data.modelMetrics.<model>.usage snapshots are cumulative and uses the last snapshot as the session total (summed across models).

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread scripts/seed_skills.py
if not fork.exists():
return [f"fork missing: {fork.relative_to(ROOT)}"]
problems: list[str] = []
stack = [filecmp.dircmp(canonical, fork)]

@augmentcode augmentcode Bot Jun 21, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts/seed_skills.py:52filecmp.dircmp(canonical, fork) will raise if fork exists but isn’t a directory (e.g., a stray file at that path), which prevents the reseed path from recovering. Consider explicitly treating non-directory forks as drift (and ensuring reseed() can remove them safely) so release.py prepare doesn’t crash on that edge case.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_seed_skills.py`:
- Line 64: The variable `canonical` in the tuple unpacking from the
`_build_workspace` call at line 64 is unused and triggers the Ruff RUF059 lint
rule. Rename the unused `canonical` variable to `_canonical` (or simply `_`) to
explicitly indicate that the value is intentionally unused and suppress the lint
warning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 46e419a8-55a2-4e72-89f6-049db5ce3f7b

📥 Commits

Reviewing files that changed from the base of the PR and between 90ed250 and 6df2257.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • .claude-plugin/marketplace.json
  • CHANGELOG.md
  • docs/adapter-authoring-guide.md
  • module.yaml
  • pyproject.toml
  • scripts/release.py
  • scripts/seed_skills.py
  • src/automator/__init__.py
  • src/automator/adapters/profile.py
  • src/automator/data/bmad_auto_hook.py
  • src/automator/data/profiles/copilot.toml
  • src/automator/data/skills/bmad-auto-setup/assets/module.yaml
  • src/automator/probe.py
  • src/automator/tokens.py
  • tests/test_hook_script.py
  • tests/test_install.py
  • tests/test_profile.py
  • tests/test_seed_skills.py
  • tests/test_tokens.py

Comment thread tests/test_seed_skills.py


def test_reseed_prunes_extra_fork_files(monkeypatch, tmp_path):
canonical, forks = _build_workspace(monkeypatch, tmp_path, (".claude/skills",))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix unused tuple binding flagged by Ruff.

canonical is unused at Line 64, which triggers RUF059. Rename it to _canonical (or _) to make intent explicit and keep lint clean.

Suggested patch
-    canonical, forks = _build_workspace(monkeypatch, tmp_path, (".claude/skills",))
+    _canonical, forks = _build_workspace(monkeypatch, tmp_path, (".claude/skills",))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
canonical, forks = _build_workspace(monkeypatch, tmp_path, (".claude/skills",))
_canonical, forks = _build_workspace(monkeypatch, tmp_path, (".claude/skills",))
🧰 Tools
🪛 Ruff (0.15.17)

[warning] 64-64: Unpacked variable canonical is never used

Prefix it with an underscore or any other dummy variable pattern

(RUF059)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_seed_skills.py` at line 64, The variable `canonical` in the tuple
unpacking from the `_build_workspace` call at line 64 is unused and triggers the
Ruff RUF059 lint rule. Rename the unused `canonical` variable to `_canonical`
(or simply `_`) to explicitly indicate that the value is intentionally unused
and suppress the lint warning.

Source: Linters/SAST tools

@pbean pbean merged commit 23fa413 into main Jun 21, 2026
7 checks passed
@pbean pbean deleted the release/0.6.3 branch June 21, 2026 19:54
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.

1 participant