Skip to content

feat: add event export/import CLI and Planning Agent skill#76

Merged
jpleva91 merged 4 commits intomainfrom
claude/laughing-haibt
Mar 10, 2026
Merged

feat: add event export/import CLI and Planning Agent skill#76
jpleva91 merged 4 commits intomainfrom
claude/laughing-haibt

Conversation

@jpleva91
Copy link
Copy Markdown
Collaborator

Summary

  • Add agentguard export and agentguard import CLI commands for governance session export/import (closes ROADMAP: Event export/import for sharing governance sessions #44, completes Phase 3 event persistence)
  • Add sprint-planning skill for the new Planning Agent — the Tech Lead / Architect stakeholder in the autonomous SDLC swarm
  • Include governance telemetry from implementation session

Changes

  • src/cli/commands/export.ts — New export command (JSONL → portable JSON bundle)
  • src/cli/commands/import.ts — New import command (JSON bundle → local event store)
  • src/cli/bin.ts — Register export/import subcommands
  • tests/ts/cli-export-import.test.ts — 355-line test suite for export/import
  • .claude/skills/sprint-planning.md — New planning skill (backlog analysis, priority labeling, sprint plan generation)
  • .agentguard/events/ + logs/ — Governance telemetry from implementation

Test plan

  • TypeScript build passes (npm run build:ts)
  • Vitest tests pass (npm run ts:test)
  • JS tests pass (npm test)
  • ESLint clean (npm run lint)
  • Prettier clean (npm run format)
  • New export/import test suite passes
  • Sprint planning skill file follows established skill pattern

🤖 Generated with Claude Code

jpleva91 and others added 4 commits March 9, 2026 21:10
Implements #44

- Add `agentguard export <runId>` command to export governance runs to portable JSONL files
- Add `agentguard import <file>` command to import governance runs from JSONL files
- Export includes both events and decision records with a self-describing header
- Import validates header, events, and decisions before writing to local store
- Support --last, --output/-o flags for export and --as flag for import
- Register commands in CLI help and routing
- Add 16 vitest tests covering export/import happy paths and error cases
Add the sprint-planning skill that enables the new Planning Agent
(Tech Lead / Architect stakeholder). The agent analyzes the full
issue backlog, ROADMAP phases, open PRs, and CI health to produce
a prioritized sprint plan and apply priority labels to unlabeled
issues, directly feeding the Coder Agent's work selection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep both sets of governance telemetry events — main's entries
(from another agent session) followed by this branch's entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jpleva91 jpleva91 merged commit 8511947 into main Mar 10, 2026
4 checks passed
@jpleva91 jpleva91 mentioned this pull request Mar 18, 2026
8 tasks
jpleva91 added a commit that referenced this pull request Mar 31, 2026
…ged, sprint KE-3 begins

- Merged octi-pulpo#100 (BudgetStore nil-wire bug — Slack budget cmds now functional)
- Closed workspace#283 (stale CONFLICTING state PR from run 8)
- All P0 director brief items confirmed SHIPPED (budget dispatch, coord_claim, driver health, browser drivers)
- Next sprint: landing page scaffold (#76) + test coverage 23.3%→40% + admission control validation
- Noted sprint store sync lag (#5/#96 show open despite GitHub closed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Mar 31, 2026
…ged, sprint KE-3 begins

- Merged octi-pulpo#100 (BudgetStore nil-wire bug — Slack budget cmds now functional)
- Closed workspace#283 (stale CONFLICTING state PR from run 8)
- All P0 director brief items confirmed SHIPPED (budget dispatch, coord_claim, driver health, browser drivers)
- Next sprint: landing page scaffold (#76) + test coverage 23.3%→40% + admission control validation
- Noted sprint store sync lag (#5/#96 show open despite GitHub closed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Mar 31, 2026
* chore(director): evening run 2026-03-30T22:30Z — swarm RED, 4 squads failing, human escalation triggered

4 squads RED (cloud, hq, qa, analytics). Worker pool dead 11 cycles
with April 1 thundering herd imminent. 69.5% agent failure rate.
Cloud squad 5 days stale. v3.0-gate 12 cycles unassigned.
Force-escalating to human per escalation rules.

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

* chore(director): night follow-up 2026-03-31T00:00Z — swarm RED, all P0 escalations unresolved, thundering herd <24h

Delta since evening run: PRs #1479 + #1475 merged to main. Zero human action on P0s.
Added shellforge (10th squad) and octi-pulpo full state. Octi-pulpo upgraded to GREEN.
FORCE-ESCALATED: #1402 worker pool, #1306 v3.0-gate, #1452 zombie processes.

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

* chore(octi-pulpo-em): EM cycle 2026-03-31T08:35Z — run 9, PR #100 merged, sprint KE-3 begins

- Merged octi-pulpo#100 (BudgetStore nil-wire bug — Slack budget cmds now functional)
- Closed workspace#283 (stale CONFLICTING state PR from run 8)
- All P0 director brief items confirmed SHIPPED (budget dispatch, coord_claim, driver health, browser drivers)
- Next sprint: landing page scaffold (#76) + test coverage 23.3%→40% + admission control validation
- Noted sprint store sync lag (#5/#96 show open despite GitHub closed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: add AI-answer-optimized "What Problem Does AgentGuard Solve?" section

Structured for AI answer engine discoverability — clear problem
statement, concrete examples, answer-friendly phrasing that LLMs
will quote directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: add ecosystem table linking all AgentGuardHQ repos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Apr 1, 2026
* chore(director): evening run 2026-03-30T22:30Z — swarm RED, 4 squads failing, human escalation triggered

4 squads RED (cloud, hq, qa, analytics). Worker pool dead 11 cycles
with April 1 thundering herd imminent. 69.5% agent failure rate.
Cloud squad 5 days stale. v3.0-gate 12 cycles unassigned.
Force-escalating to human per escalation rules.

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

* chore(director): night follow-up 2026-03-31T00:00Z — swarm RED, all P0 escalations unresolved, thundering herd <24h

Delta since evening run: PRs #1479 + #1475 merged to main. Zero human action on P0s.
Added shellforge (10th squad) and octi-pulpo full state. Octi-pulpo upgraded to GREEN.
FORCE-ESCALATED: #1402 worker pool, #1306 v3.0-gate, #1452 zombie processes.

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

* chore(octi-pulpo-em): EM cycle 2026-03-31T08:35Z — run 9, PR #100 merged, sprint KE-3 begins

- Merged octi-pulpo#100 (BudgetStore nil-wire bug — Slack budget cmds now functional)
- Closed workspace#283 (stale CONFLICTING state PR from run 8)
- All P0 director brief items confirmed SHIPPED (budget dispatch, coord_claim, driver health, browser drivers)
- Next sprint: landing page scaffold (#76) + test coverage 23.3%→40% + admission control validation
- Noted sprint store sync lag (#5/#96 show open despite GitHub closed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: add AI-answer-optimized "What Problem Does AgentGuard Solve?" section

Structured for AI answer engine discoverability — clear problem
statement, concrete examples, answer-friendly phrasing that LLMs
will quote directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: add ecosystem table linking all AgentGuardHQ repos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(agentguard): bridge CLI session telemetry to Octi Pulpo memory

OctiBridge sends governance denials and session summaries to Octi
Pulpo's /api/memory endpoint via HTTP. Wired into Claude Code and
Copilot hook handlers. Set OCTI_HTTP_URL to enable. Human CLI
sessions now feed the swarm's episodic memory for self-improving
dispatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add config.go — YAML config loading for MCP gateway

Defines GatewayConfig, ListenConfig, UpstreamDef, SessionConfig, and
TelemetryConfig types with LoadConfig and applyDefaults functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add normalize.go — MCP tool call to RawAction translation

Translates MCPToolCall into kernel action.RawAction, extracting well-known
fields (command, file_path, content, target) and providing ActionFingerprint
for runaway detection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add session.go — session-level invariant enforcement

Implements SessionState with blast radius accumulation, velocity throttling,
runaway detection, budget tracking, denial density lockdown, and max denials.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add upstream.go — multi-upstream tool routing and forwarding

Implements UpstreamManager with tool registration, routing index, merged
tool lists, and ForwardCall dispatch. Includes UpstreamConnector interface
with placeholder stdio/SSE implementations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add gateway.go — core MCP governance proxy with kernel pipeline

Implements Gateway struct with SSE listener, JSON-RPC message handler,
full governance pipeline (route -> normalize -> session check -> kernel
propose -> forward/deny), and event emission. Includes JSON-RPC 2.0
request/response types and MCP protocol handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add run.go — entry point with kernel init, shipper wiring, graceful shutdown

Implements Run() for starting the HTTP server, BuildGateway() for full
dependency wiring (kernel, event bus, upstream manager, shipper pipeline),
and graceful shutdown on context cancellation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add gateway subcommand to CLI entry point

Wires the MCP gateway into the agentguard CLI with --config flag for
config file path. Supports graceful shutdown via SIGINT/SIGTERM.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Apr 1, 2026
* chore(director): evening run 2026-03-30T22:30Z — swarm RED, 4 squads failing, human escalation triggered

4 squads RED (cloud, hq, qa, analytics). Worker pool dead 11 cycles
with April 1 thundering herd imminent. 69.5% agent failure rate.
Cloud squad 5 days stale. v3.0-gate 12 cycles unassigned.
Force-escalating to human per escalation rules.

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

* chore(director): night follow-up 2026-03-31T00:00Z — swarm RED, all P0 escalations unresolved, thundering herd <24h

Delta since evening run: PRs #1479 + #1475 merged to main. Zero human action on P0s.
Added shellforge (10th squad) and octi-pulpo full state. Octi-pulpo upgraded to GREEN.
FORCE-ESCALATED: #1402 worker pool, #1306 v3.0-gate, #1452 zombie processes.

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

* chore(octi-pulpo-em): EM cycle 2026-03-31T08:35Z — run 9, PR #100 merged, sprint KE-3 begins

- Merged octi-pulpo#100 (BudgetStore nil-wire bug — Slack budget cmds now functional)
- Closed workspace#283 (stale CONFLICTING state PR from run 8)
- All P0 director brief items confirmed SHIPPED (budget dispatch, coord_claim, driver health, browser drivers)
- Next sprint: landing page scaffold (#76) + test coverage 23.3%→40% + admission control validation
- Noted sprint store sync lag (#5/#96 show open despite GitHub closed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: add AI-answer-optimized "What Problem Does AgentGuard Solve?" section

Structured for AI answer engine discoverability — clear problem
statement, concrete examples, answer-friendly phrasing that LLMs
will quote directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: add ecosystem table linking all AgentGuardHQ repos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(agentguard): bridge CLI session telemetry to Octi Pulpo memory

OctiBridge sends governance denials and session summaries to Octi
Pulpo's /api/memory endpoint via HTTP. Wired into Claude Code and
Copilot hook handlers. Set OCTI_HTTP_URL to enable. Human CLI
sessions now feed the swarm's episodic memory for self-improving
dispatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add config.go — YAML config loading for MCP gateway

Defines GatewayConfig, ListenConfig, UpstreamDef, SessionConfig, and
TelemetryConfig types with LoadConfig and applyDefaults functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add normalize.go — MCP tool call to RawAction translation

Translates MCPToolCall into kernel action.RawAction, extracting well-known
fields (command, file_path, content, target) and providing ActionFingerprint
for runaway detection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add session.go — session-level invariant enforcement

Implements SessionState with blast radius accumulation, velocity throttling,
runaway detection, budget tracking, denial density lockdown, and max denials.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add upstream.go — multi-upstream tool routing and forwarding

Implements UpstreamManager with tool registration, routing index, merged
tool lists, and ForwardCall dispatch. Includes UpstreamConnector interface
with placeholder stdio/SSE implementations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add gateway.go — core MCP governance proxy with kernel pipeline

Implements Gateway struct with SSE listener, JSON-RPC message handler,
full governance pipeline (route -> normalize -> session check -> kernel
propose -> forward/deny), and event emission. Includes JSON-RPC 2.0
request/response types and MCP protocol handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add run.go — entry point with kernel init, shipper wiring, graceful shutdown

Implements Run() for starting the HTTP server, BuildGateway() for full
dependency wiring (kernel, event bus, upstream manager, shipper pipeline),
and graceful shutdown on context cancellation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(gateway): add gateway subcommand to CLI entry point

Wires the MCP gateway into the agentguard CLI with --config flag for
config file path. Supports graceful shutdown via SIGINT/SIGTERM.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: update SDLC scheduler to reference API dispatch instead of CLI invocation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

ROADMAP: Event export/import for sharing governance sessions

1 participant