Repository navigation
Remove the tree publisher workflow and its script - #319
Merged
Merged
Conversation
The telemetry collector builds and stores calibration trees, so nothing in this repository should run the package's tree publisher or read the GitHub secrets and variable only that publisher used. These tests fail while publish-calibration-tree.yml and the publish:calibration-tree script exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
publish-calibration-tree.yml and the publish:calibration-tree script were kept after the Hugging Face webhook stopped dispatching the workflow, so that a deployment restored by a rollback could still dispatch it. That rollback period ended on 2026-11-21. The telemetry collector builds and stores calibration trees. The @policyengine/calibration-tree dependency stays, because the dashboard's store readers use it. The workflow's own tests and the test of the script go with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both tests passed GITHUB_ACTIONS_DISPATCH_TOKEN and the two former dispatch settings in, because a deployment could still hold them until they were deleted by hand. The token was deleted from Vercel on 2026-11-24 and the other two were never set there. The webhook tests' collector fake still refuses every address other than the releases.json reads and the collector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The calibration tree document no longer says the workflow and script remain for older deployments, and the hosted runtime notes no longer name the workflow's HF_TOKEN secret. A test comment names the collector as what builds trees, and a test value no longer calls a stray HF_TOKEN the publisher's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The setting check misses forms GitHub accepts: a YAML escape, a `.*` filter, a computed index and a quoted `secrets: 'inherit'`. The publisher check reads only workflow files, so a script a workflow runs, or a frontend script naming the package's own publish script, would pass it. The checks move into helpers that keep today's behaviour, and the new sample tests fail on their assertions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The setting check reads the parsed workflow, so YAML quoting and
escapes are decoded, and looks in every `${{ }}` expression and `if:`
value. Any use of the secrets or vars context without a written-out
name (the whole context, a `.*` filter, a computed index) now counts,
as does a job's `secrets: inherit` however it is quoted.
- The publisher check reads every file a checkout contains except its own
module, so workflows, the scripts they run, the frontend manifest and
documents are all covered. It replaces the Bun test, which looked only
at manifest commands with one spelling.
- The install-order test lists `.yaml` workflows too.
- Comments: the collector builds trees with the package's worker and
publication modules, and the settings are deleted only after the merge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setting check ends an expression at the first `}}`, even inside a
quoted string such as format('{{...}}', ...), and never looks at
mapping keys, where GitHub also evaluates expressions. Both samples
fail on the test's assertion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setting check finds each `${{ }}` expression with a scanner that
skips `}}` inside single-quoted string literals, and it looks at
mapping keys as well as values.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #318. Tracker: "1. Collector/Emitter", task 4a · 35.
Merge order: the tracker task this PR waited for, 4a · 34, is done: Anthony deleted the publisher's dispatch token, a fine-grained token on his GitHub account, at about 21:20 UTC on 2026-11-24. After the merge, tasks 4a · 36 to 4a · 39 delete the GitHub settings listed below, one go-ahead each. In the tracker, each of them depends on the one before, so the variable (4a · 39) is deleted last.
What changes
.github/workflows/publish-calibration-tree.ymland thepublish:calibration-treescript infrontend/package.jsonare gone. Stop the Hugging Face webhook dispatching the tree publisher #311 kept them only so that a production deployment from before Stop the Hugging Face webhook dispatching the tree publisher #311, restored by a rollback, could still dispatch the workflow. That rollback period (3 days) ended at 21:19 UTC on 2026-11-21. The telemetry collector builds and stores calibration trees, with the package's worker and publication modules.@policyengine/calibration-treedependency stays, because the dashboard's store readers use it. Nothing in the dashboard imports the package's publisher module.frontend/tests/test_deploy_workflow.py:${{ }}expression and everyif:value, and findssecrets.NAMEandsecrets['NAME']in any letter case. It also counts any use of thesecretsorvarscontext that could read an arbitrary setting: the whole context, a.*filter or a computed index. A job'ssecrets: inheritcounts too.publish:calibration-treeorpublish-calibration-tree), except that test module itself. This covers workflows, the scripts they run, the frontend manifest and documents..yamlworkflow files.hf-webhook-config.test.tsandroute.test.ts, at Anthony's decision on 2026-11-24. They passedGITHUB_ACTIONS_DISPATCH_TOKEN,CALIBRATION_TREE_GITHUB_REPOSITORYandCALIBRATION_TREE_GITHUB_WORKFLOWin, to check that current code ignores them while a deployment still holds them. The lived63156ddeployment still holds its copy of the token, because it was built at 20:32 UTC on 2026-11-24, before the token was deleted from Vercel at 20:44 UTC. That has no effect: no current code reads any of the three names, and GitHub has refused the token since its deletion from Anthony's account (4a · 34). The other two settings were never set in Vercel. No file in the repository names them now.docs/calibration-tree-artifacts.mdno longer says the workflow and script remain. The same section already says the dashboard writes only comparison bundles.frontend/HOSTED_RUNTIME.mdno longer names the workflow'sHF_TOKENsecret.calibration-selection.test.tsandcalibration-tree-package.test.tsname the collector as what builds trees.test_deploy_script.pyno longer calls a strayHF_TOKENthe publisher's.What a rollback does after this merge
Vercel keeps production deployments for 30 days, and always keeps the 10 newest. The dispatch token was deleted (4a · 34) before this PR was opened, so this merge does not change what any deployment answers.
d63156d(#315, live since 20:38 UTC on 2026-11-24) ande8fb376(#311)8117e07and the other deployments from before #311publish-calibration-tree.ymlwithref: "main", using their own copy of the deleted token. GitHub refuses the request, so they answer 502 to that delivery and to each of Hugging Face's retries of it. No rollback to one has been made since the deletion, so this is from the handler's code, not observed.main, and GitHub's documentation says aworkflow_dispatchrun starts only if the workflow file exists on the default branch, so no run could start even with a valid token.What a 502 also costs. In every pre-#311 handler, the 502 answer comes before the Slack release alerts. So a delivery answered 502 posts none of its release alerts, retries included. This was checked at
8117e07,e786af1and earlier merges. Deployments older than8117e07(#306) also send no tree-build request to the collector, so they start no tree build at all. All of this has been true since the token's deletion, independent of this PR.Copies on other branches. The workflow file remains on 16 branches other than
main(of 45 in all). GitHub's documentation gives two rules here: aworkflow_dispatchrun "will only trigger" if the file is on the default branch, and once a workflow has run, it can be dispatched against any branch or tag through the API or CLI. So whether someone with Actions write access could still start a branch's copy withgh workflow run --ref <branch>is unverified. Such a copy can't write to the Blob store at any point of the planned order:CALIBRATION_TREE_BUILD_ENABLED, its job is skipped while the variable isFALSE;BLOB_READ_WRITE_TOKEN, the publisher stops at its first check ("BLOB_READ_WRITE_TOKEN is required."), before reading or writing anything.Pre-#311 deployments are not affected, because they always name
main.Secrets and variables the removed code read
Names listed with
gh secret listandgh variable list(names only) on 2026-11-24. No value was read.HF_TOKENenv, then the publisher module's Hugging Face reads.main. The deployed dashboard'sHF_TOKENis a separate setting: for production,deploy.ymlpasses the repository secretHF_RELEASE_READ_TOKENto.github/scripts/deploy-dashboard.sh, which sets the deployment'sHF_TOKENfrom it; previews use the Vercel project's PreviewHF_TOKEN. Draft #304 addsrelease-history.yml, which readssecrets.HF_TOKEN. Anthony decided for 4a · 36 that #304 moves to a secret of its own before it merges; this PR's setting check would fail on #304 until then. Tracker task 4a · 36 deletes the GitHub secret.POPULACE_UK_STAGING_HF_TOKENenv, then the publisher module's UK staging reads (the registration'stoken_env).BLOB_READ_WRITE_TOKENenv, then the publisher module's Blob reads and writes.main. The Vercel variable of the same name stays, because comparison writes use it (frontend/app/api/microcosm/comparison-tree/route.ts). Draft #304'srelease-history.ymlalso readssecrets.BLOB_READ_WRITE_TOKEN, and this PR's setting check would fail on it the same way. Tracker task 4a · 38 deletes the GitHub secret; unlike 4a · 36, it has no tracker dependency on a decision about #304's read.CALIBRATION_TREE_BUILD_ENABLEDif:.main. The branch copies above still read it. Tracker task 4a · 39 deletes it.GITHUB_TOKENactions/checkout, withcontents: read, andoven-sh/setup-bun, whosetokeninput defaults to it.HUGGINGFACE_TOKEN,CALIBRATION_TREE_MAX_RAW_BYTES,CALIBRATION_TREE_MAX_GZIP_BYTES,MICROCOSM_UK_LOCAL_CALIBRATION_DIR, and the registrations'repo_envandrevision_envnamesGITHUB_ACTIONS_DISPATCH_TOKENHow "no workflow" was confirmed.
ci.yml,deploy.ymlandtelemetry-service.ymlread none of the four settings. None of them usestoJSON(secrets),toJSON(vars),secrets: inheritor a reusable workflow.run:step, and every script or command it starts, gets the environment its workflow, job and step set, plus what earlier steps export through$GITHUB_ENV. Those exports come only from actions:google-github-actions/authexports Google Cloud credential settings, andastral-sh/setup-uvsetsUV_PYTHON. None of those actions receives one of the four settings, and no repository script writes$GITHUB_ENV(they write only$GITHUB_OUTPUT). The repository files those steps run are.github/scripts/deploy-dashboard.sh,telemetry-service/scripts/check-secrets-exist.sh,telemetry-service/scripts/deploy.sh,telemetry-service/scripts/require-collector-push-runs-finished.sh,frontend/scripts/deployment_smoke.py,frontend/scripts/calibration-deployment-smoke.ts,frontend/scripts/verify_hosted_runtime.pyandbackend/modal_app.py. The steps also run the telemetry migrations andalembic check, the telemetry image'sdocker build,bun run lint,bun run buildand the test suites. Of those files, onlydeploy-dashboard.shnames one of the four: it sets the deployment'sHF_TOKENfromHF_RELEASE_READ_TOKEN.test_no_workflow_reads_the_former_tree_publisher_settingsenforces this.Tests
Red-green, for the change and for each review round's fixes:
5c1a4f3. Each check failed on its assertion againstmain's code: the setting check listed the workflow's four reads, the publisher check listed the workflow, and the former Bun check listedpublish:calibration-tree.427b676. Then71e1fb4deletes the dispatch-setting tests, and4c07581updates the documents.6df4705. The sample tests failed on their assertions: the setting check missed the escape,.*, computed-index and quoted-inheritsamples, and the publisher check missed every file outside.github/workflows/. The checks against the repository passed.5d3554e.e386dc8. Two new samples failed on the sample test's assertion: a}}inside a quoted string in aformat()call, and an expression in a mapping key.db96cbd.Run individually at
db96cbd(the first two) or5d3554e(the rest, unchanged since), all passing:frontend/tests/test_deploy_workflow.py, by node ID:test_setting_detection_covers_the_forms_github_acceptstest_no_workflow_reads_the_former_tree_publisher_settingstest_publisher_detection_reads_every_file_except_its_own_guardtest_no_repository_file_names_the_tree_publishertest_every_bun_script_step_runs_after_its_job_installs_locked_frontend_dependenciestest_bun_script_detection_covers_repository_scripts_but_not_package_runners(passing at4c07581, unchanged since)4c07581, unchanged since apart from a comment edit incalibration-selection.test.tsat5d3554e:frontend/tests/test_deploy_script.py::test_missing_release_credential_stops_deployment_without_printing_secretscalibration-selection.test.ts"the fallback note says the dashboard has no local-area build"bun run lintandruff check frontend/tests/test_deploy_workflow.pyCI runs the rest.
Review
Round 1, at
4c07581: 0 high, 2 medium, 3 low. All five are fixed, at5d3554eand in this description.GITHUB_TOKENrow and the optional reads were incomplete, and organization settings were not checked.The cheap code-quality points were applied as well: the comments now say the collector builds trees, the settings are deleted only after the merge, and the install-order test lists
.yamlfiles.Round 2, at
5d3554e: 0 high, 1 medium, 2 low. All three are fixed, atdb96cbdand in this description. Round 2 rated four of round 1's five bugs fixed and the fifth (this description's script list) mostly fixed. It also found a new gap in the setting check that round 1's rewrite introduced.}}, even inside a quoted string, and skipped mapping keys.calibration-selection.test.tsunchanged after its comment edit.Round 3, at
db96cbd(the last round): 0 high, 0 medium, 3 low, all in this description and corrected here. Round 2's three bugs were confirmed fixed.$GITHUB_ENV.Left, not changed: the sample tests have no negative sample showing that the expression scanner stops at
}}or reads GitHub's''escape. Round 3 checked both behaviours by reading the code and found them correct. Adding one would change the reviewed head.🤖 Generated with Claude Code