Skip to content

Let the kagent lane build the Go helpers that need third-party modules #5013

Description

@devantler

🤖 Generated by the Agentic Engineer (interactive Claude Code session)

Part of #4866.

Problem

The kagent lane's image now has Go 1.27.4 with GOTOOLCHAIN=local (devantler-tech/platform#6152). The pre-flight guards build there, because they use only the standard library. Five helpers under .claude/scripts/ need third-party modules, and the sandbox cannot download them, since its egress reaches only GitHub, the model, the lane store and the cluster view. Each of them fails closed in the lane:

Helper Modules
memory-backup-go, used by memory-rewrite.sh for whole-file memory rewrites golang.org/x/sys, github.com/yuin/goldmark
issue-body-references-go github.com/yuin/goldmark, golang.org/x/net
cleanup-trap-census-go mvdan.cc/sh/v3
pipefail-grep-guard-go, python-ban-guard-go gopkg.in/yaml.v3, mvdan.cc/sh/v3

So the lane cannot rewrite a memory file through the reviewed path, or run any step that calls one of the others.

Options

  1. Allow the Go module mirror at egress: a Substrate EgressPolicy for proxy.golang.org and sum.golang.org, with no credentials. go.sum and the checksum database protect what is downloaded. It widens the lane's allow-list by one public, read-only mirror.
  2. Vendor the modules in each helper (go mod vendor), so the helpers build offline anywhere. Egress is unchanged, but the repository grows, and every module bump re-vendors.
  3. Warm a module cache in the image at build time. This breaks whenever a helper's go.sum moves ahead of the image, so it is not recommended.

Done when

  • One option is chosen and recorded.
  • All five helpers build in the lane's sandbox, shown by a run's transcript or an in-image smoke check.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions