Skip to content

Add developer experience polish: demo, default policy, examples#5

Merged
jpleva91 merged 1 commit intomainfrom
claude/dx-polish
Mar 9, 2026
Merged

Add developer experience polish: demo, default policy, examples#5
jpleva91 merged 1 commit intomainfrom
claude/dx-polish

Conversation

@jpleva91
Copy link
Copy Markdown
Collaborator

@jpleva91 jpleva91 commented Mar 9, 2026

Summary

  • Merge governed-action-kernel into main (kernel, 5 adapters, YAML policy loader, TUI renderer, JSONL sink, guard/inspect CLI commands, 38 new tests)
  • Add agentguard.yaml default policy in repo root — auto-discovered by findDefaultPolicy() in the guard command. Demonstrates all rule features (deny branches, deny targets, allow defaults)
  • Add scripts/demo.js and npm run demo:guard — self-contained governance demo that simulates 5 agent actions (3 allowed, 2 denied) with full TUI output and action graph
  • Add examples/ directory with governance examples: annotated policy YAML, minimal evaluate-action script, and Claude Code PreToolUse hook wiring
  • Update README with "30 seconds to see it work" quick start section showing clone → install → demo flow with expected output
  • Add .agentguard/ to .gitignore (prevents accidental commit of JSONL event logs)

Test plan

  • npm run build:ts — TypeScript compiles cleanly
  • npm run demo:guard — Shows 3 allowed + 2 denied actions with TUI output
  • echo '{"tool":"Bash","command":"git push origin main"}' | node dist/cli/bin.js guard --dry-run — Correctly denied by default policy
  • node examples/evaluate-action.js — Prints DENIED with correct reason
  • npm test — All 1085 JS tests pass
  • npm run ts:test — All 345 TS tests pass

🤖 Generated with Claude Code

- Merge governed-action-kernel (kernel, adapters, CLI, 38 tests)
- Add agentguard.yaml default policy (auto-discovered by guard command)
- Add scripts/demo.js governance demo (5 actions, TUI output)
- Add npm run demo:guard script (chains build:ts)
- Add examples/: annotated policy, minimal evaluate, Claude Code hook
- Update README with "30 seconds" quick start and expected output
- Add .agentguard/ to .gitignore (JSONL sink runtime output)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jpleva91 jpleva91 merged commit dc35794 into main Mar 9, 2026
2 of 4 checks passed
jpleva91 added a commit that referenced this pull request Mar 12, 2026
…hold

Add two tests to computeFailureRateTrends that verify the strict inequality
thresholds (> 20 and < -20) in determineRateTrend. A rateChange of exactly
±20% returns 'stable' even though changePercent rounds to ±20 in reports —
documenting this intentional behavior for regression prevention.

Addresses code review finding #5 from automated review on PR #281.

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
…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.

1 participant