Repository navigation
fix(version): print toolchain vcs commit when ldflags are empty - #488
Conversation
axis version omitted commit and built time unless Make injected ldflags. A binary built with plain go build still carries vcs.revision and vcs.time. ResolvedCommit and ResolvedDate keep an ldflags value first and fall back to those settings. Phase tracking no longer calls v0.12.2 the current release, and the agent worklog is labeled as the 2026-06-04 log.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Toolchain metadata currently mislabels revision time as build time and omits dirty-worktree provenance.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Adds Go toolchain VCS metadata fallback for plain builds and clarifies historical documentation.
Changes:
- Resolve commit/date metadata from toolchain build settings.
- Update
axis versionto use resolved metadata. - Clarify stale coordination and release documentation.
| File | Description |
|---|---|
internal/buildinfo/build.go |
Adds VCS metadata resolution. |
internal/buildinfo/build_test.go |
Tests metadata precedence and lookup. |
cmd/axis/main.go |
Prints resolved version metadata. |
docs/README.md |
Marks the worklog historical. |
docs/agent-worklog.md |
Adds historical-state notice. |
docs/phase-tracking.md |
Replaces stale release claim. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
toasterbook88
left a comment
There was a problem hiding this comment.
AXIS Grok gate
Verdict: PASS-WITH-RISK
PR: #488 fix(version): print toolchain vcs commit when ldflags are empty
Head: a129955
URL: #488
Files: cmd/axis/main.go, internal/buildinfo/build.go, internal/buildinfo/build_test.go, docs/README.md, docs/agent-worklog.md, docs/phase-tracking.md (+82/−7).
Invariant hits:
- Fact plane / advisory override: not touched.
axis versionnow prints ldflags Commit/Date first, else toolchainvcs.revision/vcs.time. That is a binary stamp, notaxis facts/ status / place / context. - HITL / dispatch lock: not touched.
- Cache badge / --live: not touched.
- Prohibited actions (secret_read, ssh_bypass, fleet_exec, spawn_subagent, self-authorize, unattended config write): none.
- Agent self-model: docs demote agent-worklog from canonical queue to a 2026-06-04 historical log, and phase-tracking stops calling v0.12.2 the current release. That matches the charter (session YAML is not inventory). Do not treat the PR body VM receipts (cranium-nixos-vm, PR #486 base, 73% coverage) as CI or cluster truth.
Residuals:
mergeable_stateis behind base cb202b8. Rebase before merge.- Empty-ldflags path is untested against
debug.ReadBuildInfo; tests cover ldflags preference andsettingFromonly. vcs.modifiedis not printed, so a dirtygo buildstill showscommit:with no dirty badge. Same label as the ldflags short SHA.
CI at review: govulncheck success, CodeQL success, Analyze (actions) success, auto-merge skipped, copilot-pull-request-reviewer in progress, Test & Build in progress. https://github.com/toasterbook88/Axis/actions/runs/37147102644/job/111273208358
Operator action: wait for Test & Build, rebase onto main, then merge if green. COMMENT only; no APPROVE.
|
Ship with two fixes. |
A toolchain revision with vcs.modified prints a -dirty suffix. ResolvedDate returns only the ldflag build time, never vcs.time.
The runbook now matches ResolvedCommit: the ldflag wins, an empty ldflag prints vcs.revision with -dirty when the tree is modified, and built: stays the ldflag clock. The empty-ldflag tests compare the resolver to the toolchain settings.


Summary
When
axisis built without explicit ldflags (plaingo build), the Go toolchain auto-stampsvcs.revision/vcs.timeinto the binary, butaxis versiondid not surface them. This makes the commit line print toolchain VCS info when ldflags are empty, falling back correctly when ldflags override.Verification (NixOS VM, receipts)
go build ./cmd/axis→axis versionprintscommit: b92b1f8… built: 2026-10-02T03:59:22Z(toolchain stamp)make build(ldflags) → stamp overridden with short commit + formatted timestamp as expectedbuildinfounit tests passmake test— 50 packages, 100% green (inside cranium-nixos-vm, PR fix(facts): suppress helper self-test stdout in remote AFM discovery probe #486 base)verify-doc-facts.sh,verify-repo-truth.sh,verify-public-boundary.shall passagent-collab/findings/reviews/REVIEW-2026-10-01-axis-recent-changes-and-commit-a129955-on-nixos-vm.mdContext
Tracked as ticket O-26. Operator-authorized push/PR on 2026-10-03.