feat(ke-2): wire Go kernel into claude-hook + TS pre-resolves packs/YAML#1303
feat(ke-2): wire Go kernel into claude-hook + TS pre-resolves packs/YAML#1303
Conversation
Thin wrapper package that depends on @red-codes/agentguard. Allows `npx agentguard` to work without the scoped name. Both `npx agentguard` and `npx @red-codes/agentguard` work identically. Closes #848 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace mutable tag references with immutable SHA-pinned digests across all 6 workflow files to prevent supply chain attacks via compromised upstream actions. Original tags preserved as inline comments. Actions pinned: - actions/checkout@v6 - actions/setup-node@v6 - pnpm/action-setup@v5 - actions/upload-artifact@v7 - github/codeql-action/init@v4 - github/codeql-action/analyze@v4 - actions/upload-pages-artifact@v4 - actions/deploy-pages@v4 - dtolnay/rust-toolchain@stable - Swatinem/rust-cache@v2 Closes #829 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Version bump: 2.5.0 → 2.6.0 Supply chain hardening: all 10 GitHub Actions pinned to verified SHA digests across 6 workflow files. Closes #829. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The agentguard-unscoped package depends on @red-codes/agentguard which doesn't exist in the lockfile (it's the published package). Moving to npm-wrapper/ excludes it from the pnpm workspace glob. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v2.6.0 — Go kernel, SHA pinning, unscoped npm, performance docs
Publishes both @red-codes/agentguard and the unscoped agentguard wrapper package on GitHub release. Tolerates "already published" for the wrapper since its version tracks the CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v2.7.0 — automated unscoped npm publish + CI fix
npm rejects "agentguard" as too similar to existing "agent-guard" package. Canonical install path is `npx @red-codes/agentguard`. Removes npm-wrapper/ and the publish step. Closes #848 as won't-fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(ci): remove blocked unscoped npm wrapper
npx aiguard → delegates to @red-codes/agentguard. Added to publish workflow for automated releases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
npx aguard → delegates to @red-codes/agentguard. Replaces aiguard attempt. Added to publish workflow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat(npm): add aiguard convenience package
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v2.7.1 — aguard npm package
Replaces npx agentguard → npx aguard in docs, README, site, CLI help, templates, CLAUDE.md, ROADMAP.md, and source code user-facing strings. Keeps @red-codes/agentguard as the scoped package name in imports and package.json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # npm-wrapper/agentguard/README.md
…HQ/agentguard into feat/squad-swarm-spec
58 files updated: npx agentguard → npx aguard across docs, README, site, CLI help, templates, and user-facing strings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v2.7.2 — aguard docs + CLI references
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(cli): add missing subpath exports for bin and postinstall
- Health: green — all loop guards pass, no escalations - PR #969 (fix claude-init binary path, closes #964 priority:critical): CI 5/5 green, flagged for architect review - Closed stale EM report PR #966 (superseded) - Sprint: #955 (Go kernel hook delegation) + #957 (Go pack resolution) in-progress, senior assigned - PR budget: 1 open / 3 max - Tests: 4129/4129 passing https://claude.ai/code/session_016dXuQwappMAvdGYJaix7C9
…0000 Auto-merged: low-risk chore/docs PR, CI green.
Establishes Tier C governance rules, coding standards, branch naming, PR rules, and autonomy directives for the GitHub Copilot coding agent. Modeled after agentguard-cloud instructions, tailored for the OSS TypeScript/pnpm monorepo stack. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds governance hooks for OpenAI Codex CLI and Google Gemini CLI, bringing total supported CLI agents to 4. New commands: agentguard codex-hook, codex-init, gemini-hook, gemini-init New adapters: codex-cli.ts, gemini-cli.ts Version: 2.7.2 → 2.8.0 Tests: 759+ passing, coverage above thresholds Closes part of multi-model orchestration initiative.
* feat: init Codex, Copilot, and Gemini hook configs Adds governance hook configurations for all 3 new CLI drivers introduced in v2.8.0. Claude hooks already existed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: agent identity in local telemetry + init all driver hooks - Migration v5: add agent_id column + index to sessions table - All 4 hooks (claude, codex, copilot, gemini) now pass resolved agent identity into session tracking via SessionStartData.agentId - Resolve agent identity once before cloud telemetry (DRY) - Re-init hook configs via agentguard *-init CLI commands - Update migration tests for new schema version Closes #1029 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Jared <jared@agentguard.dev> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: bump version to 2.8.1 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: add ecosystem section + update framework list in README Adds ecosystem table (ShellForge, RTK, TurboQuant, DefenseClaw, OpenShell, DeepAgents, OpenCode) and updates "Works with" to list all 6 frameworks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Jared <jared@agentguard.dev> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The governance hook blocked ALL tool calls when the AgentGuard kernel binary was not yet available, creating a catch-22: agents could not run `pnpm install` to build the kernel because the hook blocked it first. This had been blocking the marketing squad for 5 EM cycles. Fix: detect bootstrap mode at two layers: - Shell wrapper: read stdin payload and allow install/build commands and read-only tools through when the binary is missing - TypeScript hook: catch module-not-found errors from unbuilt kernel packages and allow bootstrap-safe actions through Non-bootstrap actions remain fail-closed (blocked) for security. Closes #995 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract bootstrap.ts as single source of truth for allowlists (fixes broken import from 5b7bb9f that referenced missing module) - Add containsChainingOperators() — blocks "pnpm install && curl evil" - Cross-driver payload normalization (tool_name vs toolName, tool_input vs toolArgs) - Shell wrapper chaining protection via grep after case match - 65 tests: Claude/Copilot/Codex/Gemini payloads, chaining bypass, read-only tools Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: bootstrap exemption for governance hooks
Go kernel now handles all Claude Code hook events with full feature parity: - PreToolUse: policy eval, invariant checking, enforcement mode routing (enforce/guide/educate/monitor), read-only tool fail-open, session state, identity wizard, retry tracking, cloud telemetry, lesson capture - PostToolUse: bash error reporting, format/test pass tracking, PR detection - Stop: session viewer generation, root session cleanup - Notification: live session viewer spawn New files: env.go, session.go, identity.go, lesson.go, telemetry.go Key fix: FromStdin() fallback — Claude Code sends payloads via stdin, not env vars. This was the root cause of Go fast-path never executing. Performance: 2ms Go vs 290ms TS — 145x faster hook evaluation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat(go): complete Go kernel — full TS hook parity, 145x faster
…AML (closes #955, closes #957) - Add go-kernel.ts: binary detection (AGENTGUARD_GO_BIN > dist/go-bin > go/bin), policy serialization (merges multiple LoadedPolicys into flat JSON for Go), and delegateToGoHook (writes temp policy, spawns agentguard claude-hook, returns decision) - Restructure handlePreToolUse: load policy first (both paths need it for pack resolution), try Go delegation before heavy TS module imports, fall back to TS kernel on failure - Add AGENTGUARD_FORCE_TS_KERNEL=1 escape hatch for tests that stub the TS kernel - 19 new unit/integration tests for go-kernel.ts; 900 existing CLI tests still pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
[workspace-pr-review-agent] Workspace Config ReviewVerdict: PASS Summary: Wires the Go kernel binary into Findings
Swarm Impact Assessment
Config Consistency Check
Automated review by workspace-pr-review-agent (claude-code:opus:reviewer) — AgentGuard workspace swarm |
|
AgentGuard CI Triage Bot — no CI runs detected (merge conflicts) Diagnosis
Suggested Manual Fix
Note: The conflict is likely related to PR #1315 ( Automated diagnosis by triage-failing-ci skill on 2026-03-29T05:14:07Z |
|
AgentGuard CI Triage Bot — merge conflicts + CI never triggered Diagnosis
Findings
Suggested Manual Fix
Automated diagnosis by triage-failing-ci skill on 2026-03-29T06:10:31Z |
- Health: yellow — PR #1303 (sprint #955/#957) CONFLICTING after PR #1300 merged - PR #1300 MERGED: complete Go kernel (145x faster, 2ms vs 290ms) — major milestone - PR #1295 MERGED: bootstrap catch-22 fix (#995) - PR #1296 MERGED: site-only PR CI skip fix (#1267) - PR #969 MERGED: fix claude-init binary path (closes #964) - PR #1303: sprint work CONFLICTING — senior must assess rebase vs close - No P0/P1 issues open - PR #1317 (Gemini tests, 4/4 CI green, copilot squad): ready for human review - Dogfood #1323 filed: pnpm install --frozen-lockfile bootstrap hang in non-TTY Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Health: YELLOW — PR #1303 merge conflict persists 2nd EM cycle. Escalating blocker B1 to director per escalation rule. Senior must rebase feat/go-kernel-delegation-955-957 against main to resolve Go module rename conflicts from #1315. https://claude.ai/code/session_015B3fZ87gqrkQ4XJTPi3F9W
🤖 Merge Conflict Diagnostic — resolve-merge-conflicts agentAgent identity: `claude-code:opus:developer` (task: `resolve-merge-conflicts`) Conflict SummaryAttempted rebase of `feat/go-kernel-delegation-955-957` onto `main` — aborted due to complex conflict. Conflicting file: `apps/cli/src/commands/claude-hook.ts` Root Cause: Competing Go Kernel ImplementationsThis PR introduced the Go kernel fast-path via a separate `go-kernel.ts` module: But `main` already has a different implementation inlined directly in `claude-hook.ts`: Key Differences
Action RequiredThis PR's feature appears to have been independently implemented in main via a different path. A human needs to decide:
🤖 Generated with Claude Code — resolve-merge-conflicts agent |
EM Review — 2026-03-29T12:00ZThis PR is CONFLICTING (cannot be merged as-is) and the sprint issues it closes (#955, #957) are already CLOSED. Status: The KE-2 sprint goal is complete. Issues were closed externally. This PR needs a rebase against Action required:
Blocker: Merge conflict. CI has not run (no status checks). Until rebased, this cannot be merged. — Kernel EM, cycle 2026-03-29T12:00Z |
- KE-2 sprint COMPLETE: #955, #957, #964 all closed - Transitioned sprint to KE-3: v2.10.3 Go binary patch + bootstrap hardening - Merged #1340 (gitignore) and #1334 (bootstrap pnpm --force) — CI green - Closed stale EM reports #1324 and #1336 - Flagged PR #1303 as CONFLICTING — needs rebase before CI can run - New blockers: #1316 (Go binaries missing from v2.10.2 npm package) - Health: yellow — Go path not live in released package Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Health: YELLOW — PR #1303 (closes #955+#957) has merge conflict (dirty), CI blocked; human rebase required on feat/go-kernel-delegation-955-957 - Confirmed PR #969 merged 2026-03-26 (closes #964); state.json updated - PR budget: 1/3 — PASS; no stuck agents; no governance denials - Noted swarm P0 alerts #1319 and #1289 (credit exhaustion, not kernel-caused) - Flagged #920 (KE-2 ActionContext, v3.0 gate) for post-sprint planning https://claude.ai/code/session_01SEvmqiv8xhwA5Xnc6U6Uqs
- KE-2 sprint COMPLETE: #955, #957, #964 all closed - Transitioned sprint to KE-3: v2.10.3 Go binary patch + bootstrap hardening - Merged #1340 (gitignore) and #1334 (bootstrap pnpm --force) — CI green - Closed stale EM reports #1324 and #1336 - Flagged PR #1303 as CONFLICTING — needs rebase before CI can run - New blockers: #1316 (Go binaries missing from v2.10.2 npm package) - Health: yellow — Go path not live in released package Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Health: RED - Wins: #1344 merged, workspace PR #236 closes cron collisions #1327 - P0: Swarm #1186 5th+ cycle (human: git worktree prune + PID cleanup) - P0: Bootstrap invariant cascade — 5 dogfood issues (#1254/#1325/#1332/#1341/#1347), KE-3 - P1: v2.10.2 missing Go kernel binaries (#1316) — cut v2.10.3 - P1: Codex+Copilot CBs OPEN (#1335), 52% swarm blocked, auto-resolves 2026-04-01 - P1: Copilot events 0 in API (#1342) — conference demo May 6 at risk - Sprint: KE-3 active, KE-2 PR #1303 needs rebase, cloud hold on 2.10.2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Go kernel not invoked by claude-hook in v2.7.3 — binary ships but hooks evaluate through TS #955 — Go kernel not invoked:
handlePreToolUsenow detects the Go binary (dist/go-bin/agentguard-go→go/bin/agentguard→AGENTGUARD_GO_BIN) and delegates evaluation to it before loading any heavy TS modules. Falls back to TS kernel if Go is unavailable or errors.Go kernel evaluate does not resolve pack: or YAML — needs flattened JSON #957 — Go returns false deny for pack/YAML policies: TS
loadPolicyDefsalready resolvespack:references, YAML files, andextends:chains. The newgo-kernel.tsserializes the pre-resolvedLoadedPolicy[]to a temp JSON file and setsAGENTGUARD_POLICYso Go'sFindPolicyFilepicks up flat rules instead of the rawagentguard.yaml.Escape hatch:
AGENTGUARD_FORCE_TS_KERNEL=1bypasses Go delegation — used by all existing tests.Architecture
Test plan
apps/cli/tests/go-kernel.test.ts— binary detection, serialization, delegationAGENTGUARD_FORCE_TS_KERNEL=1Closes #955
Closes #957
🤖 Generated with Claude Code