From e0a673e9fa75b84744a2fe5abcc9a6391bf9bdd9 Mon Sep 17 00:00:00 2001 From: IntegrationStandards Date: Sun, 10 May 2026 18:37:34 -0400 Subject: [PATCH 1/3] ci: wire compat-test bundle from quantcli/common against crono-export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the build-tag-gated `compat_contract_test.go` and a new CI workflow that: 1. Builds the crono-export binary. 2. Resolves the github.com/quantcli/common/compat dependency via `go mod tidy` (the package itself is stdlib-only and hermetic). 3. Runs `go test -tags=compat -run TestContractDates ./...` against the built binary, with CRONO_EXPORT_BIN pointing at it. A failing test here means crono drifted from CONTRACT §3 or §5. **Stacked on quantcli/common#6** — the require line points at the pseudo-version of that branch's HEAD commit, so the workflow only goes green once #6 merges to main and the proxy reindexes. The require version will be rebased onto a merged-main pseudo-version (or a tagged release if we cut one) before flipping this PR ready. Refs QUA-8. Co-Authored-By: Paperclip --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ compat_contract_test.go | 28 ++++++++++++++++++++++++ go.mod | 1 + 3 files changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 compat_contract_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..988724a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + go: + name: go vet + test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - name: go vet + run: go vet ./... + - name: go test + run: go test ./... + + compat: + name: compat (CONTRACT machine-attestation) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - name: resolve compat dependency + # The compat module lives at github.com/quantcli/common/compat + # under a subpath. `go mod tidy` materializes go.sum for it on + # first run; subsequent runs are cache-served. + run: go mod tidy + - name: build crono-export + run: go build -o /tmp/crono-export . + - name: run compat suite + env: + # Path the compat-tagged test reads from os.Getenv. + CRONO_EXPORT_BIN: /tmp/crono-export + run: go test -tags=compat -run TestContractDates ./... diff --git a/compat_contract_test.go b/compat_contract_test.go new file mode 100644 index 0000000..9c4c66b --- /dev/null +++ b/compat_contract_test.go @@ -0,0 +1,28 @@ +//go:build compat + +// Compat-test entry point for crono-export-cli. +// +// This file is only compiled under the `compat` build tag, so it does +// not affect the default `go test ./...` run. CI invokes it as +// `go test -tags=compat ./...` after building the export binary and +// exposing its path through CRONO_EXPORT_BIN. +// +// The actual assertions live in github.com/quantcli/common/compat. +// Drift between this CLI and CONTRACT.md surfaces as a failure here. +package main_test + +import ( + "os" + "testing" + + "github.com/quantcli/common/compat" + "github.com/quantcli/common/compat/dates" +) + +func TestContractDates(t *testing.T) { + bin := os.Getenv("CRONO_EXPORT_BIN") + if bin == "" { + t.Skip("CRONO_EXPORT_BIN not set; skipping compat suite") + } + dates.RunContract(t, compat.Runner{Binary: bin}) +} diff --git a/go.mod b/go.mod index ac8d23a..9022661 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.25.5 require ( github.com/jrmycanady/gocronometer v1.5.1 + github.com/quantcli/common/compat v0.0.0-20260510223424-1882283f6817 github.com/spf13/cobra v1.10.2 ) From c804beb92a6600d1686a445e69aa12cc8583d7c0 Mon Sep 17 00:00:00 2001 From: IntegrationStandards Date: Sun, 10 May 2026 18:52:20 -0400 Subject: [PATCH 2/3] compat: declare cobra subcommands; bump compat to b07b0d7 `--since`/`--until` on crono live on the data-producing subcommands (biometrics, exercises, nutrition, servings, notes), not the root binary. The compat suite needs the Subcommands affordance landed on quantcli/common#6 (commit b07b0d7) to dispatch per-subcommand instead of red-x'ing against the root --help. Refs QUA-8. Co-Authored-By: Paperclip --- compat_contract_test.go | 15 ++++++++++++++- go.mod | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/compat_contract_test.go b/compat_contract_test.go index 9c4c66b..904afe1 100644 --- a/compat_contract_test.go +++ b/compat_contract_test.go @@ -24,5 +24,18 @@ func TestContractDates(t *testing.T) { if bin == "" { t.Skip("CRONO_EXPORT_BIN not set; skipping compat suite") } - dates.RunContract(t, compat.Runner{Binary: bin}) + // crono is cobra-based: --since/--until live on each data-producing + // subcommand, not the root binary. The compat suite dispatches per + // subcommand under a `subcommand=NAME/...` subtree so any single + // regression surfaces as a named subtest failure. + dates.RunContract(t, compat.Runner{ + Binary: bin, + Subcommands: []string{ + "biometrics", + "exercises", + "nutrition", + "servings", + "notes", + }, + }) } diff --git a/go.mod b/go.mod index 9022661..7374609 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.5 require ( github.com/jrmycanady/gocronometer v1.5.1 - github.com/quantcli/common/compat v0.0.0-20260510223424-1882283f6817 + github.com/quantcli/common/compat v0.0.0-20260510224926-b07b0d70ee59 github.com/spf13/cobra v1.10.2 ) From 5a197ccee0598af4df081a09cc738ef0a6e16690 Mon Sep 17 00:00:00 2001 From: IntegrationStandards Date: Sun, 10 May 2026 18:59:44 -0400 Subject: [PATCH 3/3] compat: repoint require to main-rooted pseudo-version (post-merge 4c588c1) PR quantcli/common#6 merged via 4c588c1. Repoint compat require from the pre-merge feature-branch pseudo-version (b07b0d70ee59) to the main-rooted pseudo-version (4c588c19cd1b) and materialize go.sum entries. Local verification (go 1.25.10): go vet ./... -> clean go test ./... -> ok (no-op; default tags) go build -o /tmp/crono-export . -> ok CRONO_EXPORT_BIN=/tmp/crono-export \ go test -tags=compat -run TestContractDates ./... -> ok Co-Authored-By: Paperclip --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 7374609..e79155d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.5 require ( github.com/jrmycanady/gocronometer v1.5.1 - github.com/quantcli/common/compat v0.0.0-20260510224926-b07b0d70ee59 + github.com/quantcli/common/compat v0.0.0-20260510225630-4c588c19cd1b github.com/spf13/cobra v1.10.2 ) diff --git a/go.sum b/go.sum index c9953fb..fd0f48f 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jrmycanady/gocronometer v1.5.1 h1:m2J31jEuLlL4RRdQLY33IFs4TAwmfevvJYl2SZxBSQ0= github.com/jrmycanady/gocronometer v1.5.1/go.mod h1:swnvYB6twU20LDzNpAz8JOX5mCHktTW06zlSXmmyZWc= +github.com/quantcli/common/compat v0.0.0-20260510225630-4c588c19cd1b h1:fO7EfkEqzLRC8Ev22jIq05fPs+JwAB7bCDy6FA+GA5k= +github.com/quantcli/common/compat v0.0.0-20260510225630-4c588c19cd1b/go.mod h1:VBC/zEphSZgCZS1rhWsR3A8EWYSbTkP/MwqWHL7266s= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=