Skip to content

Commit aed2538

Browse files
ryan-williamsclaude
andcommitted
Merge upstream waypoint D (kenn-io kenn-io#1224 money -> microdollars)
Waypoint D of the staged upstream catch-up (specs/merge-upstream-waypoints.md). Merges u/main up to 8dc6adc (173 commits) — the money-as-authoritative- microdollars rewrite (new internal/money package; all cost/rate fields become money.Money int64 microdollars) plus a kit-ui bump, embeddings, and machine breakdowns. Pricing (convert the fork's 1h cache-write work to money, contract-preserving): - export.ModelRates.CacheWrite1hPerMTok is now money.Money (still internal: not in canonical_json / EffectiveModelRate, so the export wire stays byte-identical). - catalog.ModelPricing / db.ModelPricing gain a money.Money 1h field; the model_pricing column is cache_creation_1h_microdollars_per_mtok INTEGER alongside upstream's renamed microdollar columns; threaded through the batched upsert/insert/copy SQL, GetModelPricing, loadPricingMap, modelPricingRates, fallbackRateMap, customPricing, and pricingrefresh. - Fill1hCacheRate derives 1h from 5m in money terms as exactly 8/5 (multiply-by-8 then money.Divide by 5), replacing the float 2.0/1.25 ratio. - dailyUsageAmounts and sessionRowCost compute the 5m/1h split cost via money.CostPerMillion (5 RatedTokens) and savings via SignedCostPerMillion (read + 5m + 1h deltas), propagating money errors. - Bundled snapshot re-fetched in money format (SHA-pinned artifact); 1h derived at load. usage projects CLI cost is money.Money. Subagent rollup: rollupProjectExpr re-injected into all four daily-usage templates (upstream added an s.machine column). Artifact ledger: manifestSession gains a private field to stay byte-identical with db.Session (fork's private column); canonical-manifest golden updated. Frontend: adopted upstream's kit-ui CSS-var palette + hashColor + seriesColorMap (its collision-relief supersedes the fork's 24-color golden-angle palette and disambiguateColors), keeping the fork's org-theming (setOrgTheme) on top; AttributionPanel/costs read money via .microdollars; forced a kit-ui refetch to the pinned SHA (Card/Toggle/Checkbox). Deferred (unchanged): 1h-cache parity for the PostgreSQL and DuckDB cost paths. Green: go build/vet, all money/pricing/db/export/service/snapshot/artifact tests, svelte-check, make build. (Environmental: the snapshot test needing a git `origin` remote; one flaky sync concurrency-bound test that passes on re-run.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2 parents e7ca31e + 8dc6adc commit aed2538

1,197 files changed

Lines changed: 275281 additions & 26113 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: Build desktop artifact
2+
description: Build, smoke-test, and upload one desktop bundle
3+
4+
inputs:
5+
bundle:
6+
description: Tauri bundle type
7+
required: true
8+
target_triple:
9+
description: Optional Rust target triple
10+
required: true
11+
artifact_name:
12+
description: Uploaded artifact name
13+
required: true
14+
artifact_dir:
15+
description: Bundle output directory
16+
required: true
17+
runs:
18+
using: composite
19+
steps:
20+
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
21+
with:
22+
go-version-file: go.mod
23+
cache: ${{ inputs.bundle == 'appimage' && inputs.target_triple == '' && github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'false' || 'true' }}
24+
25+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
26+
with:
27+
node-version: "24"
28+
29+
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
30+
31+
- name: Setup MinGW (Windows)
32+
if: runner.os == 'Windows'
33+
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
34+
with:
35+
msystem: MINGW64
36+
update: false
37+
install: mingw-w64-x86_64-gcc
38+
path-type: inherit
39+
40+
- name: Install Linux system dependencies
41+
if: runner.os == 'Linux'
42+
shell: bash
43+
run: |
44+
sudo apt-get update -q
45+
sudo apt-get install -y \
46+
libwebkit2gtk-4.1-dev libgtk-3-dev \
47+
libappindicator3-dev librsvg2-dev \
48+
patchelf squashfs-tools xdg-utils
49+
50+
- name: Install Rust target
51+
shell: bash
52+
env:
53+
AGENTSVIEW_TARGET_TRIPLE: ${{ inputs.target_triple }}
54+
run: |
55+
if [ -n "$AGENTSVIEW_TARGET_TRIPLE" ]; then
56+
rustup target add "$AGENTSVIEW_TARGET_TRIPLE"
57+
fi
58+
59+
- name: Install desktop dependencies
60+
shell: bash
61+
run: npm ci
62+
working-directory: desktop
63+
64+
- name: Desktop sidecar smoke tests
65+
shell: bash
66+
run: bash desktop/scripts/test-prepare-sidecar.sh
67+
68+
- name: Build desktop bundle
69+
shell: bash
70+
env:
71+
AGENTSVIEW_TARGET_TRIPLE: ${{ inputs.target_triple }}
72+
ARTIFACT_DIR: ${{ inputs.artifact_dir }}
73+
BUNDLE: ${{ inputs.bundle }}
74+
run: |
75+
cd desktop
76+
export TAURI_ENV_TARGET_TRIPLE="$AGENTSVIEW_TARGET_TRIPLE"
77+
npm run prepare-sidecar
78+
build_cmd=(npx tauri build --verbose --bundles "$BUNDLE")
79+
if [ -n "$AGENTSVIEW_TARGET_TRIPLE" ]; then
80+
build_cmd+=(--target "$AGENTSVIEW_TARGET_TRIPLE")
81+
fi
82+
build_cmd+=(--config '{"bundle":{"createUpdaterArtifacts":false}}')
83+
"${build_cmd[@]}"
84+
if [ "$BUNDLE" = "appimage" ]; then
85+
bash scripts/repair-appimage-diricon.sh \
86+
"../${ARTIFACT_DIR}"/*.AppImage
87+
fi
88+
89+
- name: Desktop smoke tests (Rust unit tests)
90+
shell: bash
91+
env:
92+
AGENTSVIEW_TARGET_TRIPLE: ${{ inputs.target_triple }}
93+
run: |
94+
test_cmd=(cargo test --manifest-path desktop/src-tauri/Cargo.toml --lib)
95+
if [ -n "$AGENTSVIEW_TARGET_TRIPLE" ]; then
96+
export TAURI_ENV_TARGET_TRIPLE="$AGENTSVIEW_TARGET_TRIPLE"
97+
test_cmd+=(--target "$AGENTSVIEW_TARGET_TRIPLE")
98+
fi
99+
"${test_cmd[@]}"
100+
101+
- name: Smoke check sidecar metadata
102+
shell: bash
103+
env:
104+
AGENTSVIEW_TARGET_TRIPLE: ${{ inputs.target_triple }}
105+
run: |
106+
target_triple="${AGENTSVIEW_TARGET_TRIPLE:-$(rustc -vV | awk '/^host: /{print $2}')}"
107+
if [ -z "$target_triple" ]; then
108+
echo "target triple is empty" >&2
109+
exit 1
110+
fi
111+
112+
ext=""
113+
if [[ "$target_triple" == *"windows"* ]]; then
114+
ext=".exe"
115+
fi
116+
sidecar="desktop/src-tauri/binaries/agentsview-${target_triple}${ext}"
117+
if [ ! -f "$sidecar" ]; then
118+
echo "missing sidecar binary: $sidecar" >&2
119+
exit 1
120+
fi
121+
122+
"$sidecar" version > sidecar-version.txt
123+
if grep -q "agentsview dev" sidecar-version.txt; then
124+
echo "sidecar version should not be dev: $(cat sidecar-version.txt)" >&2
125+
exit 1
126+
fi
127+
if grep -q "commit unknown" sidecar-version.txt; then
128+
echo "sidecar metadata missing commit: $(cat sidecar-version.txt)" >&2
129+
exit 1
130+
fi
131+
if grep -Eq "built[[:space:]]*\)$" sidecar-version.txt; then
132+
echo "sidecar metadata missing build date: $(cat sidecar-version.txt)" >&2
133+
exit 1
134+
fi
135+
136+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
137+
with:
138+
name: ${{ inputs.artifact_name }}
139+
path: ${{ inputs.artifact_dir }}
140+
if-no-files-found: error

.github/workflows/bench-pr.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Bench Gate
2+
3+
# The PR dispatcher always calls the main-pinned workflow. That workflow
4+
# independently routes same-repository Linux jobs to the managed public fleet
5+
# and fork jobs to GitHub-hosted runners.
6+
on:
7+
pull_request:
8+
# Docs/frontend-only PRs cannot change the gated Go paths. If
9+
# this check is ever made required on branch protection, pair it
10+
# with a no-op sibling workflow on the inverse paths.
11+
paths:
12+
- "**.go"
13+
- "go.mod"
14+
- "go.sum"
15+
- "Makefile"
16+
- ".github/workflows/bench.yml"
17+
- ".github/workflows/bench-pr.yml"
18+
permissions: read-all
19+
20+
jobs:
21+
run:
22+
uses: kenn-io/agentsview/.github/workflows/bench.yml@main

.github/workflows/bench.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,7 @@ name: Bench Gate
2828
# produced still gate) rather than silently disabling the whole gate.
2929

3030
on:
31-
pull_request:
32-
# Docs/frontend-only PRs cannot change the gated Go paths. If
33-
# this check is ever made required on branch protection, pair it
34-
# with a no-op sibling workflow on the inverse paths.
35-
paths:
36-
- "**.go"
37-
- "go.mod"
38-
- "go.sum"
39-
- "Makefile"
40-
- ".github/workflows/bench.yml"
41-
31+
workflow_call:
4232
concurrency:
4333
group: bench-${{ github.head_ref || github.ref }}
4434
cancel-in-progress: true
@@ -49,16 +39,17 @@ permissions:
4939
jobs:
5040
bench-gate:
5141
name: Benchmark Gate
52-
runs-on: ubuntu-latest
42+
runs-on: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'kenn-linux-x64-public' || 'ubuntu-latest' }}
5343
steps:
5444
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5545
with:
5646
persist-credentials: false
5747
fetch-depth: 0
5848

59-
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
49+
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
6050
with:
6151
go-version-file: go.mod
52+
cache: ${{ github.repository == 'kenn-io/agentsview' && (github.event_name == 'push' && github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.repo.full_name == github.repository)) && 'false' || 'true' }}
6253

6354
- name: Run benchmarks (PR head)
6455
run: |
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI (macOS)
2+
3+
on:
4+
# Persistent self-hosted runners must never be selectable from a workflow
5+
# definition controlled by a pull request. The ci-runners group must allow
6+
# this exact workflow path only from refs/heads/main.
7+
push:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test-macos-fsevents:
19+
name: Go Test (macOS FSEvents)
20+
runs-on:
21+
group: ci-runners
22+
labels: [self-hosted, macOS, ARM64]
23+
steps:
24+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
25+
with:
26+
fetch-depth: 0
27+
persist-credentials: false
28+
29+
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
30+
with:
31+
go-version-file: go.mod
32+
33+
- name: Restore pricing snapshot
34+
run: go run ./internal/pricing/cmd/litellm-snapshot -restore
35+
36+
- name: Run focused macOS FSEvents tests
37+
run: CGO_ENABLED=1 go test -tags "fts5" ./internal/fsevents ./internal/sync ./internal/db ./cmd/agentsview -count=1 -timeout=20m

.github/workflows/ci-pr.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI
2+
3+
# The PR dispatcher always calls the main-pinned workflow. That workflow
4+
# independently routes same-repository Linux jobs to the managed public fleet
5+
# and fork jobs to GitHub-hosted runners.
6+
on:
7+
pull_request:
8+
9+
permissions: read-all
10+
11+
jobs:
12+
run:
13+
uses: kenn-io/agentsview/.github/workflows/ci.yml@main

0 commit comments

Comments
 (0)