cachevalue-feed #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: cachevalue-feed | |
| # Publish fak's cache-value P&L roll-up to the #scoreboard Slack channel | |
| # (C0BEF8B8KMW, scoreboard workspace T0BDEJF1HGB) — the fleet's top-level status | |
| # channel, so the P&L rides alongside the scores. The feed folds the dogfooded | |
| # kernel cache-value ledger (docs/nightrun/cache-value.jsonl) and renders the same | |
| # card a live post would send. | |
| # | |
| # This is a SLACK STATUS feeder (cadence -> channel post), not an issue feeder. | |
| # Scheduled ticks are dry-run-first: they always render the card to the step | |
| # summary and upload artifacts; a live Slack post happens only when the shared | |
| # scoreboard bot token secret is configured. | |
| # | |
| # OPERATOR STEP (one-time): add FAK_SCOREBOARD_TOKEN under Settings -> Secrets | |
| # and variables -> Actions. The card defaults to the CI/CD reporting sink (C0BGQ411TCJ); | |
| # override with the FAK_CACHEVALUE_CHANNEL repo variable to split it out (e.g. the | |
| # dedicated #cache-value channel C0BDSB81XDZ). | |
| on: | |
| schedule: | |
| # Daily 09:37 UTC - an off-the-hour minute clear of the other scheduled jobs | |
| # (garden 06:23, dogfood 06:41, dogfood-coverage 07:13, steering-guard 07:33, | |
| # score-signal 07:41, gate-signal 07:53, bench-signal 08:03, | |
| # scoreboard-feed/cadence 08:17, bench-feed 08:27, dojo-feed 08:37, | |
| # capacity-feed 08:47, node-usage-feed 08:57, blockers-feed 09:07). | |
| - cron: "37 9 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: "Render the card but do NOT post" | |
| type: boolean | |
| default: true | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: cachevalue-feed | |
| cancel-in-progress: false | |
| jobs: | |
| cachevalue-feed: | |
| name: cache-value trend -> #scoreboard | |
| if: github.ref_name == 'main' || github.ref_name == 'master' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| env: | |
| GOTOOLCHAIN: auto | |
| FAK_SCOREBOARD_TOKEN: ${{ secrets.FAK_SCOREBOARD_TOKEN }} | |
| FAK_CACHEVALUE_CHANNEL: ${{ vars.FAK_CACHEVALUE_CHANNEL || vars.FAK_CICD_REPORT_CHANNEL || 'C0BGQ411TCJ' }} | |
| FAK_SCOREBOARD_SOURCE: ci | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: false | |
| # Self-test the cachevalue-SPECIFIC packages only. We deliberately do NOT run | |
| # `go test ./cmd/fak` here: that compiles the whole, heavily-developed cmd/fak | |
| # TEST package, so an unrelated in-flight compile break in ANY cmd/fak test file | |
| # would fail this job and SILENTLY drop the daily post. That is exactly what | |
| # lapsed the #cache-value cadence (~58h STALE): the 2026-07-03 scheduled run | |
| # failed only on `undefined: dispatchCodexProcessPIDsExcludingParents` in an | |
| # unrelated dispatch_tick_test.go, never on cachevalue code. The `go run ./cmd/fak | |
| # cachevalue feed --dry-run` render step below is the real end-to-end CLI smoke | |
| # test (go run compiles only non-test files), matching every sibling *-feed.yml, | |
| # none of which gate their post on `go test ./cmd/fak`. | |
| - name: cachevalue feed self-test | |
| run: | | |
| go test ./internal/cachevaluereport ./internal/cachevaluepost | |
| # Always render the card to the step summary (and as the artifact) so the run is | |
| # auditable even when nothing posts (missing secret / manual dry-run / fork). | |
| - name: render card (dry-run) | |
| run: | | |
| go run ./cmd/fak cachevalue feed \ | |
| --channel "$FAK_CACHEVALUE_CHANNEL" \ | |
| --source ci \ | |
| --dry-run | tee cachevalue-card.txt | |
| { | |
| echo "## cachevalue-feed - Track 1 trend" | |
| echo '```' | |
| cat cachevalue-card.txt | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| # POST - only when the token secret is present. A manual dry_run also skips. | |
| - name: post to #scoreboard | |
| if: ${{ env.FAK_SCOREBOARD_TOKEN != '' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') }} | |
| run: | | |
| go run ./cmd/fak cachevalue feed \ | |
| --channel "$FAK_CACHEVALUE_CHANNEL" \ | |
| --source ci | |
| - name: note when posting was skipped | |
| if: ${{ env.FAK_SCOREBOARD_TOKEN == '' }} | |
| run: echo "FAK_SCOREBOARD_TOKEN not set - ran in dry-run; nothing posted. Add the secret to enable posting." >> "$GITHUB_STEP_SUMMARY" | |
| - name: upload card artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cachevalue-card | |
| path: | | |
| cachevalue-card.txt | |
| docs/nightrun/cache-value.jsonl | |
| if-no-files-found: ignore |