Skip to content

refactor!: remove sandbox and support engines; simplify the CLI - #304

Merged
Patel230 merged 24 commits into
mainfrom
feat/simplify-cli-remove-sandbox
Sep 14, 2026
Merged

Patel230 merged 24 commits into
mainfrom
feat/simplify-cli-remove-sandbox

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

Removes the sandbox/Docker execution model, the five support engines, and the
committed module proxy that existed only to serve them — then cleans up every
downstream reference, fixes latent bugs the removals exposed, and organizes the
CLI help surface.

23 commits · 340+ files · ~24k deletions. Hawk now depends only on eyrie.

1. Sandbox / isolation / Docker removal

  • Delete internal/sandbox (11k LOC: seatbelt, landlock, seccomp, docker,
    egress proxy, devenv, code verifier, snapshots, approvals)
  • Remove isolation profiles, --sandbox, /autonomy sandbox, /isolation,
    DevEnv, container boot, sandbox.mode events
  • Bash/PowerShell/Terminal now run on the host under the permission engine
  • Kept the diff sandbox (cmd/sandbox.go) and moved env sanitization to
    internal/env

2. Support-engine removal

  • Remove harrier, kestrel, merlin, shrike, swift integrations and
    third_party/modproxy
  • Replace shrike with a self-contained internal/token engine (BPE counting,
    compression, usage tracking, secret detection, chunking, invariants,
    tool-catalog shrink, runtime-graph projection)
  • go.mod now depends only on eyrie

3. Bug fixes surfaced by the audit

  • MCP: hawk_memory_recall/store, hawk_review, hawk_scan,
    hawk_compress delegated to non-existent tools — every call failed. Memory
    and compress now run locally; review/scan removed with their engines
  • CodeSearch: advertised but its backend was removed — wired to
    repomap's local TF-IDF index
  • hawk review run: deleted with kestrel but still invoked by the
    post-commit hook and review refine — restored on Hawk's own pipeline
  • Compression: only hard-truncated (rejected by the compaction path as a
    non-summary) — added cycle + near-duplicate collapsing and head/tail budget
    enforcement
  • SpecLinks: add returned "not yet implemented" — now writes an
    idempotent traceability checklist; check reports citation/test coverage
  • vim: u was a no-op placeholder — added bounded undo history
  • Memory persistence moved .harrier/ → .hawk/; harness evaluator no longer
    assumes removed bridges

4. CLI

  • Group root commands into Core / Workflow / Context / Configure / Diagnose /
    Reference
  • Remove undocumented niche commands (replay, tape, schema,
    swift-report + internal/swift)

5. Docs, CI, config

  • README, architecture, security, and user-guide docs aligned to the new
    runtime; historical docs bannered
  • Drop the sandbox-image Docker job; fix verify-milestone.sh, CODEOWNERS,
    e2e-macos.sh, systemd comment
  • Compatibility matrix and platform-capabilities reduced to hawk + eyrie

Breaking changes

  • Host execution is the only execution path; the fail-closed Docker guarantee
    is gone
  • The harrier/kestrel/merlin/shrike/swift integrations are gone; graph exports
    lose their observations and /harrier, /review run|analyze, site-audit,
    and hawk swift are removed
  • replay, tape, schema, and swift-report commands are removed

Verification

  • go build ./..., go vet ./..., golangci-lint (0 issues)
  • Full go test ./... and -race suite green
  • Cross-compile windows/amd64 + linux/arm64
  • All 7 boundary guards pass; go mod tidy -diff + verify clean
  • markdownlint (0 issues), 0 broken doc links
  • Coverage 68.5% (CI gate 65%)

- tui: clear inherited terminal env in DetectCapability test so a Ghostty/
  Kitty host session cannot leak into the probe
- acp: widen the test server deadline from 5s to 30s; a cold provider
  catalog lookup made the prompt exceed 5s under -race and surface as a
  spurious 'cancelled' stopReason
- docs: fix broken relative links and stale 15-repo/nine-module claims to
  match the current 4-repo ecosystem.yaml manifest
Hawk no longer isolates agent command execution. Bash/PowerShell/Terminal
run directly on the host, and the permission engine, tool layer, TUI, and
CLI no longer carry a sandbox mode, isolation profile, or Docker container
lifecycle.

Removed:
- internal/sandbox (11k LOC: seatbelt, landlock, seccomp, docker, egress
  proxy, devenv, code verifier, snapshots, approvals)
- internal/engine/isolation_profile.go and the /isolation command
- --sandbox flag, /autonomy sandbox, /autonomy isolation, DevEnv tool
- Docker container boot, container-required tool gating, container footer
- sandbox.mode event emission, settings.sandbox, container_network

Kept: the diff sandbox (cmd/sandbox.go, internal/diffsandbox) for staged
file-change review, and env sanitization (moved to internal/env).

BREAKING CHANGE: host execution is now the only execution path; the
fail-closed Docker guarantee is gone.
Hawk now depends only on eyrie. The five support engines whose GitHub
repositories no longer exist are removed, along with the committed
third_party/modproxy that existed solely to serve their unreachable pins.

Removed:
- harrier memory bridge and its graph-backed subsystems (auto-capture,
  proactive context, confidence, code links, session diff, cross-project,
  graph budget, shared mission memory, code index, /harrier, /dream)
- kestrel review bridge and the kestrel-powered review run/analyze commands
- merlin verification bridge and site-audit pipeline
- swift CLI mount and correlation resolver
- internal/token's external shrike dependency, replaced by a self-contained
  local engine (BPE token counting via tiktoken, compression, usage
  tracking, secret detection, code chunking, invariants, tool-catalog
  shrink, runtime-graph projection)
- third_party/modproxy and the go.mod pins for all five engines

The local memory subsystem (core, auto, evolving, zen, retrieval metrics,
continuity, skill distillation, sleeptime) is retained.

BREAKING CHANGE: hawk no longer integrates the support engines; graph
exports lose harrier/kestrel/merlin/shrike observations and the /harrier,
/review run|analyze, site-audit, and swift commands are gone.
The root help listed 64 commands alphabetically with no hierarchy. Cobra
command groups now organize them into Core, Workflow, Context & memory,
Configure, Diagnose, and Reference. Grouping is presentation-only — command
names, flags, and behavior are unchanged, so scripts and tests keep working.

Unknown/new commands fall into Reference so nothing is hidden from help.
Also refresh stale engine references in the ecosystem and graph command
descriptions.
Update the README, architecture docs, security model, and user guide to
reflect that Hawk now depends only on eyrie, embeds its own token engine,
and executes agent commands on the host rather than in a Docker sandbox.

- README: drop Docker-only execution, support-engine mounts, and
  /autonomy sandbox; document host execution and the embedded token engine
- architecture: replace the six-engine runtime graph with eyrie + embedded
  token engine; refresh control-plane, product-architecture, session
  decomposition, and execution-graph docs
- security: replace the container isolation model with the permission engine
- user guide: rewrite memory (local, not harrier), permissions, and
  configuration; rename 18-sandbox.md to 18-execution-and-permissions.md
- mark ECOSYSTEM-CONFIG.md as a historical, unimplemented draft
The shared runServerWith helper used a 5s deadline; a cold provider
catalog lookup makes the prompt exceed it under -race, cancelling the turn
and surfacing as a missing session/update. Match the 30s deadline used by
the other ACP test helper.
Hawk no longer depends on falcon; eyrie is its only external GrayCodeAI
module. Update the advisory drift checker and its tests accordingly.
Restore gofumpt/gofmt cleanliness after the sandbox and engine removals;
CI's format job is zero-tolerance.
Add unit tests for the self-contained token package that replaced shrike:
token estimation, compression, usage tracking and thresholds, secret
detection/redaction/masking, code chunking, JSON/log invariants,
tool-catalog shrink, and runtime-graph projection (82.7% coverage).

Also fix two bugs the tests surfaced:
- ChunkCode reported token counts that disagreed with its budget check,
  letting chunks exceed MaxTokens
- LintToolCatalog measured description size on the JSON-encoded value
  (including quotes) instead of the decoded string
- rename Shrike-named engine methods and comments to token-neutral names
- rename the engine token facade file and drop stale Shrike references
- remove the orphaned internal/bridge/swift package (no importers)
- repoint internal/bench at the embedded token engine instead of the
  removed sibling engines
- remove the dangling /harrier command from help, palette, and tips
- wire the HUD memory section to the local memory manager (recalls, hit
  rate, sessions) instead of the removed harrier bridge
- rename the ecosystem panel's shrike row to the token engine
- add a memory round-trip integration test through MemoryService
Restructure the token-engine compression branch so the ratio is computed
only after the original-token guard, avoiding a divide-by-zero when the
input is empty.
- versioning/OTEL/monitoring/intelligent-cli: drop harrier/kestrel/merlin/
  shrike/swift examples and the sandbox-v2 feature flag
- architecture README: replace the six-engine target shape with eyrie plus
  the embedded token engine
- mark the pre-2026-09 ecosystem docs as historical
- docker.yml: remove the sandbox-image build/scan/publish job and its
  path triggers; internal/sandbox no longer exists
- verify-milestone.sh: drop the deleted internal/sandbox test invocation
- CODEOWNERS: point security-sensitive rules at real paths and drop the
  removed sandbox/container entries
- e2e-macos.sh: clarify the remaining 'sandbox status' is the diff sandbox
- systemd unit: reword the process-hardening comment
…current eco

- compatibility-matrix.json: reduce components to hawk + eyrie
- platform-capabilities.json: drop the sandbox capability and collapse
  ecosystem_compatibility to hawk+eyrie
- mark the Year 0 active track as superseded
The MCP server advertised hawk_memory_recall, hawk_memory_store, hawk_review,
hawk_scan, and hawk_compress, but delegated to tool names that do not exist in
the registry (core_memory, code_review, security_scan, compress), so every
call failed at runtime.

- memory recall/store now use the local memory store directly
- compress now runs the embedded token engine directly and returns stats
- remove hawk_review and hawk_scan: their kestrel/merlin engines are gone
- memory persistence moves from .harrier/ to .hawk/ in retrieval metrics and
  continuity tracking
- update MCP tests to the real 5-tool surface, including a store/recall
  round-trip
- harness evaluator: score the project's own test runners instead of
  hardcoded merlin/kestrel bridge flags; drop the bridge fields and the
  sandbox policy field from the assets contract
- contracts/types: remove the unused FindingFromKestrel/FindingFromMerlin
  constructors and the stale review threshold comment
Replace stale harrier/kestrel/merlin references in doc comments, user-facing
tool descriptions, and context-visualization labels with token-neutral
wording.
The kestrel-powered review run command was removed with the engine, but the
post-commit hook, 'hawk review refine', and the documented workflow still
invoke it. Reimplement it on RunReviewPipeline (Hawk-owned, provider-only):
it resolves the provider through the Eyrie boundary, runs the multi-concern
review, and stores the neutral review contract.
- remove the always-true ShrikeAvailable skip guards now that the token
  engine is embedded
- rename synthetic graph-fixture producers and session IDs away from the
  removed engine names
- testaudit: check boundaries for eyrie only
Compression previously only hard-truncated at the budget, which the
compaction path explicitly rejects as a non-summary. Add two structural
layers and a head/tail budget enforcer:
- collapse repeating line cycles (period 1-8) such as alternating
  user/assistant boilerplate
- collapse near-duplicate line runs by normalized shape
- enforce the budget by eliding the middle while preserving the head
  (goal/context) and tail (recent turns)

SpecLinks was a stub: check listed IDs without verifying coverage and add
returned 'not yet implemented'. check now reports per-requirement citation
and test coverage; add writes an idempotent traceability checklist into
tasks.md. Adds tests for both.
CodeSearch was advertised in the README and help but its backend (the
harrier code index) was removed, so every call failed. Wire CodeSearchFn
and RefreshCodeIndexFn to repomap's self-contained TF-IDF SemanticIndex,
built lazily from the working directory and cached on the ToolService.
Adds a search test.
- vim: 'u' was a no-op placeholder. Add a bounded (100-deep) text-snapshot
  history recorded before every mutating command (x, X, ~, r, p, P, and
  delete/change operators) and restore it on undo.
- mcp: remove the hawk://session resource, which advertised session
  messages the stateless server cannot serve and returned a fake '{}'.
Remove four commands with no documentation or CI usage:
- replay / tape (fxtape terminal-capture tooling)
- schema (settings JSON-schema dump)
- swift-report (private diagnostic report) and its internal/swift package

Regenerate the golden root help. Command grouping drops the removed names.
CI pins gofumpt v0.10.0, which reformats multi-line []byte literals passed
to os.WriteFile. Local gofmt did not flag it.
@Patel230
Patel230 merged commit 9286d94 into main Sep 14, 2026
25 checks passed
@Patel230
Patel230 deleted the feat/simplify-cli-remove-sandbox branch September 14, 2026 13:09
Patel230 added a commit that referenced this pull request Oct 2, 2026
* fix: stabilize flaky tests and repair stale ecosystem docs

- tui: clear inherited terminal env in DetectCapability test so a Ghostty/
  Kitty host session cannot leak into the probe
- acp: widen the test server deadline from 5s to 30s; a cold provider
  catalog lookup made the prompt exceed 5s under -race and surface as a
  spurious 'cancelled' stopReason
- docs: fix broken relative links and stale 15-repo/nine-module claims to
  match the current 4-repo ecosystem.yaml manifest

* refactor!: remove sandbox, isolation, and container execution

Hawk no longer isolates agent command execution. Bash/PowerShell/Terminal
run directly on the host, and the permission engine, tool layer, TUI, and
CLI no longer carry a sandbox mode, isolation profile, or Docker container
lifecycle.

Removed:
- internal/sandbox (11k LOC: seatbelt, landlock, seccomp, docker, egress
  proxy, devenv, code verifier, snapshots, approvals)
- internal/engine/isolation_profile.go and the /isolation command
- --sandbox flag, /autonomy sandbox, /autonomy isolation, DevEnv tool
- Docker container boot, container-required tool gating, container footer
- sandbox.mode event emission, settings.sandbox, container_network

Kept: the diff sandbox (cmd/sandbox.go, internal/diffsandbox) for staged
file-change review, and env sanitization (moved to internal/env).

BREAKING CHANGE: host execution is now the only execution path; the
fail-closed Docker guarantee is gone.

* refactor!: remove harrier, kestrel, merlin, shrike, and swift engines

Hawk now depends only on eyrie. The five support engines whose GitHub
repositories no longer exist are removed, along with the committed
third_party/modproxy that existed solely to serve their unreachable pins.

Removed:
- harrier memory bridge and its graph-backed subsystems (auto-capture,
  proactive context, confidence, code links, session diff, cross-project,
  graph budget, shared mission memory, code index, /harrier, /dream)
- kestrel review bridge and the kestrel-powered review run/analyze commands
- merlin verification bridge and site-audit pipeline
- swift CLI mount and correlation resolver
- internal/token's external shrike dependency, replaced by a self-contained
  local engine (BPE token counting via tiktoken, compression, usage
  tracking, secret detection, code chunking, invariants, tool-catalog
  shrink, runtime-graph projection)
- third_party/modproxy and the go.mod pins for all five engines

The local memory subsystem (core, auto, evolving, zen, retrieval metrics,
continuity, skill distillation, sleeptime) is retained.

BREAKING CHANGE: hawk no longer integrates the support engines; graph
exports lose harrier/kestrel/merlin/shrike observations and the /harrier,
/review run|analyze, site-audit, and swift commands are gone.

* refactor(cli): group root commands into a curated help surface

The root help listed 64 commands alphabetically with no hierarchy. Cobra
command groups now organize them into Core, Workflow, Context & memory,
Configure, Diagnose, and Reference. Grouping is presentation-only — command
names, flags, and behavior are unchanged, so scripts and tests keep working.

Unknown/new commands fall into Reference so nothing is hidden from help.
Also refresh stale engine references in the ecosystem and graph command
descriptions.

* docs: align README and guides with engine and sandbox removal

Update the README, architecture docs, security model, and user guide to
reflect that Hawk now depends only on eyrie, embeds its own token engine,
and executes agent commands on the host rather than in a Docker sandbox.

- README: drop Docker-only execution, support-engine mounts, and
  /autonomy sandbox; document host execution and the embedded token engine
- architecture: replace the six-engine runtime graph with eyrie + embedded
  token engine; refresh control-plane, product-architecture, session
  decomposition, and execution-graph docs
- security: replace the container isolation model with the permission engine
- user guide: rewrite memory (local, not harrier), permissions, and
  configuration; rename 18-sandbox.md to 18-execution-and-permissions.md
- mark ECOSYSTEM-CONFIG.md as a historical, unimplemented draft

* test(acp): widen image-prompt test deadline to avoid -race flake

The shared runServerWith helper used a 5s deadline; a cold provider
catalog lookup makes the prompt exceed it under -race, cancelling the turn
and surfacing as a missing session/update. Match the 30s deadline used by
the other ACP test helper.

* chore(compat): track eyrie (not falcon) for pin-drift checks

Hawk no longer depends on falcon; eyrie is its only external GrayCodeAI
module. Update the advisory drift checker and its tests accordingly.

* style: apply gofumpt across the tree

Restore gofumpt/gofmt cleanliness after the sandbox and engine removals;
CI's format job is zero-tolerance.

* test(token): cover the local token engine

Add unit tests for the self-contained token package that replaced shrike:
token estimation, compression, usage tracking and thresholds, secret
detection/redaction/masking, code chunking, JSON/log invariants,
tool-catalog shrink, and runtime-graph projection (82.7% coverage).

Also fix two bugs the tests surfaced:
- ChunkCode reported token counts that disagreed with its budget check,
  letting chunks exceed MaxTokens
- LintToolCatalog measured description size on the JSON-encoded value
  (including quotes) instead of the decoded string

* refactor: purge stale engine naming and wire the local memory HUD

- rename Shrike-named engine methods and comments to token-neutral names
- rename the engine token facade file and drop stale Shrike references
- remove the orphaned internal/bridge/swift package (no importers)
- repoint internal/bench at the embedded token engine instead of the
  removed sibling engines
- remove the dangling /harrier command from help, palette, and tips
- wire the HUD memory section to the local memory manager (recalls, hit
  rate, sessions) instead of the removed harrier bridge
- rename the ecosystem panel's shrike row to the token engine
- add a memory round-trip integration test through MemoryService

* fix(compact): guard compression reduction ratio against zero tokens

Restructure the token-engine compression branch so the ratio is computed
only after the original-token guard, avoiding a divide-by-zero when the
input is empty.

* docs: retire multi-engine references in current-facing docs

- versioning/OTEL/monitoring/intelligent-cli: drop harrier/kestrel/merlin/
  shrike/swift examples and the sandbox-v2 feature flag
- architecture README: replace the six-engine target shape with eyrie plus
  the embedded token engine
- mark the pre-2026-09 ecosystem docs as historical

* ci: drop the sandbox-image job and fix stale path references

- docker.yml: remove the sandbox-image build/scan/publish job and its
  path triggers; internal/sandbox no longer exists
- verify-milestone.sh: drop the deleted internal/sandbox test invocation
- CODEOWNERS: point security-sensitive rules at real paths and drop the
  removed sandbox/container entries
- e2e-macos.sh: clarify the remaining 'sandbox status' is the diff sandbox
- systemd unit: reword the process-hardening comment

* chore: align compatibility matrix and platform capabilities with the current eco

- compatibility-matrix.json: reduce components to hawk + eyrie
- platform-capabilities.json: drop the sandbox capability and collapse
  ecosystem_compatibility to hawk+eyrie
- mark the Year 0 active track as superseded

* fix(mcp): make memory and compress tools actually work

The MCP server advertised hawk_memory_recall, hawk_memory_store, hawk_review,
hawk_scan, and hawk_compress, but delegated to tool names that do not exist in
the registry (core_memory, code_review, security_scan, compress), so every
call failed at runtime.

- memory recall/store now use the local memory store directly
- compress now runs the embedded token engine directly and returns stats
- remove hawk_review and hawk_scan: their kestrel/merlin engines are gone
- memory persistence moves from .harrier/ to .hawk/ in retrieval metrics and
  continuity tracking
- update MCP tests to the real 5-tool surface, including a store/recall
  round-trip

* refactor(harness,contracts): drop removed-engine assumptions

- harness evaluator: score the project's own test runners instead of
  hardcoded merlin/kestrel bridge flags; drop the bridge fields and the
  sandbox policy field from the assets contract
- contracts/types: remove the unused FindingFromKestrel/FindingFromMerlin
  constructors and the stale review threshold comment

* docs(code): purge remaining engine-name references in comments

Replace stale harrier/kestrel/merlin references in doc comments, user-facing
tool descriptions, and context-visualization labels with token-neutral
wording.

* fix(review): restore 'hawk review run' on Hawk's own review pipeline

The kestrel-powered review run command was removed with the engine, but the
post-commit hook, 'hawk review refine', and the documented workflow still
invoke it. Reimplement it on RunReviewPipeline (Hawk-owned, provider-only):
it resolves the provider through the Eyrie boundary, runs the multi-concern
review, and stores the neutral review contract.

* test: drop stale shrike guards and neutralize engine fixtures

- remove the always-true ShrikeAvailable skip guards now that the token
  engine is embedded
- rename synthetic graph-fixture producers and session IDs away from the
  removed engine names
- testaudit: check boundaries for eyrie only

* feat(token,tool): real structural compression and working SpecLinks

Compression previously only hard-truncated at the budget, which the
compaction path explicitly rejects as a non-summary. Add two structural
layers and a head/tail budget enforcer:
- collapse repeating line cycles (period 1-8) such as alternating
  user/assistant boilerplate
- collapse near-duplicate line runs by normalized shape
- enforce the budget by eliding the middle while preserving the head
  (goal/context) and tail (recent turns)

SpecLinks was a stub: check listed IDs without verifying coverage and add
returned 'not yet implemented'. check now reports per-requirement citation
and test coverage; add writes an idempotent traceability checklist into
tasks.md. Adds tests for both.

* fix(tool): wire CodeSearch to the local semantic index

CodeSearch was advertised in the README and help but its backend (the
harrier code index) was removed, so every call failed. Wire CodeSearchFn
and RefreshCodeIndexFn to repomap's self-contained TF-IDF SemanticIndex,
built lazily from the working directory and cached on the ToolService.
Adds a search test.

* feat(vim,mcp): implement undo and drop the unservable session resource

- vim: 'u' was a no-op placeholder. Add a bounded (100-deep) text-snapshot
  history recorded before every mutating command (x, X, ~, r, p, P, and
  delete/change operators) and restore it on undo.
- mcp: remove the hawk://session resource, which advertised session
  messages the stateless server cannot serve and returned a fake '{}'.

* refactor(cli)!: remove undocumented niche commands

Remove four commands with no documentation or CI usage:
- replay / tape (fxtape terminal-capture tooling)
- schema (settings JSON-schema dump)
- swift-report (private diagnostic report) and its internal/swift package

Regenerate the golden root help. Command grouping drops the removed names.

* style: apply gofumpt v0.10.0 to tool_service_test

CI pins gofumpt v0.10.0, which reformats multi-line []byte literals passed
to os.WriteFile. Local gofmt did not flag it.
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