Repository navigation
fix(go): preserve prepared workspaces and adopt authenticated native ownership - #159
antoinetoussaint-byte wants to merge 2 commits into
Conversation
The CLI binds the go.work it detects for a local build (cmd/agents/build.go, compileAgent) and reserves GOWORK=off for standalone CI, so a developer who composes owner checkouts can prove an agent against an unreleased core. This agent discarded that: resolvePackageGoToolchain, resolvePackageSource and packageNativeGoBinary each appended GOWORK=off after inheriting the environment, so the prepared selection lost every time and a local build with `go.work → core checkout` still linked the pinned release. Host-side `go` invocations now run with the GOWORK the CLI prepared and fall back to off only when nothing was prepared. The cross build keeps off: the companion mounts only the source and the destination, so a `use` path on the host does not exist in the container, and a cross build is always the pinned graph. Tests: a go.work whose `use` reaches a sibling go.mod alone cannot resolve — honoured, the executable carries the sibling; unset or off, the same source is refused naming it; goWorkMode's three cases. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
A lazybox agent is working on this. Previous artifacts remain unchanged. No Docker or workload runtime ran. Product10903, Wiki10889, and Root10879 received the handoff; recipients must verify actual selection before any authorized retry. Worked for 3m 38s • 1:33 PM › Ask Codex to do anything GPT-6-Astra · high) started at 2026-10-28 04:38 UTC, last renewed the claim at 2026-10-30 15:39 UTC, and the claim lapses at 2026-10-30 16:24 UTC unless it is renewed again. A claim is an assertion with an expiry, not proof that a process is alive. claim detail |
Independent platform review — CONDITIONALFresh-context review under the The design is sound — the prepared- A-1 — the ownership gate proves nothing about identity
This is the PR's only ownership evidence. The fix already exists downstream: go-grpc#210, adapted from this very file, captures the manager-launched agent's tracked-group handle before any workload RPC, retains the leader identity, re-inspects that original PID before the death effect, and adds a A-2 — the Core pin is wrong, and the consequence is a live process being treated as dead
At v0.19.9 a live owner is reported absent — which is the exact predicate orphan recovery kills on. go-grpc#210 already took v0.19.10; Core is now at v0.19.18. Repin to ≥ v0.19.10. A-3 — material, not blocking: SBOM/provenance seamThe build now picks its graph from ambient What was run
Not exercised: Docker/native-cross CGO packaging, Linux runtime, Nix integration, manifest guard, full CLI composition, published release. Supply chainGO-2026-4883 and GO-2026-4887 are Moby daemon-side; Fleet noteservice-docx#38, service-libreoffice#78 and service-xlsx#44 all correctly state that published Separately, there is no handbook page or decision naming a target Core version, and four are live across the fleet (v0.17.0, v0.19.6, v0.19.10, v0.19.18). Worth settling. |
Native Go agents now link published Core v0.19.9, so Core writes authenticated-v2 ownership records with durable launch-workspace attribution. The original PR 159 fix remains intact: native packaging honors CLI-prepared GOWORK, defaults to the pinned graph when unprepared, and cross packaging keeps GOWORK=off because host workspace siblings are not mounted.
Classification: fix at the owners. Reused Core's native runner, authenticated manager, ownership inspection, identity-bound SignalProcess, strict recovery receipt parser, and the CLI's existing preview/expect recovery commands. No service-go registry, process matcher, recovery implementation, or Linux inspection fix was added. The dependency pin was applied through codefly agent deps --pin v0.19.9, including base/code and regenerated factory templates.
Updated behavior/process documentation: pkg/runtime/runtime.go package documentation, AGENTS.md, and .claude/skills/verify-changes/SKILL.md. A maintained opt-in TestNativeAgentOwnershipLifecycle consumes the actual built agent and SBOM through its normal installation path; real authenticated gRPC Load/Init/Start/Stop, restart, agent-owner death, CLI recovery, and sibling preservation run in a temporary OS HOME. It also checks that ordinary Stop removes its registration.
Validation: go build ./..., go test -json -count=1 ./..., and go vet ./... passed. Builder prepared-workspace/pinned-graph regressions and factory round-trip tests passed in that suite. The final clean-head native agent build and audit passed with CGO_ENABLED=1. The opt-in actual-artifact lifecycle gate passed (1.083s) using selected CLI c16938ef/Core c1376ada, SHA256 d97d5d9726a10102d7e52948bfe0856df636e108888c93249a81f5a15445e791. Actual v2 orphan recovery reported group_dead=true and record_removed=true while the independently launched sibling retained its exact birth and live owner.
Not verified: Docker/native-cross CGO packaging suite (root slot not granted), Linux runtime, Nix integration (two tests skipped because sibling Core fixture checkout absent), manifest guard (opt-in unset; deployment unchanged), full CLI composition/run/stop, published release, or protected incident environments. This qualifies local darwin/arm64 native agent startup/ordinary gRPC stop and explicit CLI orphan recovery only. Audit reported existing unpatched upstream GO-2026-4883 and GO-2026-4887 in Docker v28.5.2+incompatible.
History: origin/main e5455c2 was already an ancestor of original159 4951041; normal git merge returned Already up to date. PR158 head8063ba8 changes only the Docker mirror fallback in refresh-apk-pins.sh, so it is independent and excluded. Original159 production builder files remain byte-identical to 4951041. Prior Go128/Core0.19.8 pin/build/native PASS7.700s artifacts remain unchanged and retain their original attribution.
Delivery: reviewed source
6097059c2ffaeebac0d4a6b98df665976b761dadis published on this existing carrier, held in draft for exact-head CI and remaining release qualification. Independent review found no blocking defect in the bounded native writer and prepared-GOWORK changes. Manifest version remains 0.0.74; the local artifact is not the published release. No manual version/tag or protected-environment adoption has occurred. Core v0.19.9 is the actual selected dependency; the separate Linux inspection correction in Core PR864 is not claimed present.