Skip to content

Remove the tree publisher workflow and its script - #319

Merged
anth-volk merged 8 commits into
mainfrom
claude/remove-tree-publisher-workflow
Nov 25, 2026
Merged

anth-volk merged 8 commits into
mainfrom
claude/remove-tree-publisher-workflow

Conversation

@anth-volk

@anth-volk anth-volk commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Deletes the workflow and the script. .github/workflows/publish-calibration-tree.yml and the publish:calibration-tree script in frontend/package.json are 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.
  • Keeps the package. The @policyengine/calibration-tree dependency stays, because the dashboard's store readers use it. Nothing in the dashboard imports the package's publisher module.
  • Replaces the tests.
    • Deleted: the workflow's three tests, and the package test that checked the script ran the publisher module.
    • Added in frontend/tests/test_deploy_workflow.py:
      • No workflow reads the four settings below. The check reads the parsed YAML, so quoting and escapes are decoded first. It looks in every ${{ }} expression and every if: value, and finds secrets.NAME and secrets['NAME'] in any letter case. It also counts any use of the secrets or vars context that could read an arbitrary setting: the whole context, a .* filter or a computed index. A job's secrets: inherit counts too.
      • No file that a checkout contains names the publisher's entry points (publish:calibration-tree or publish-calibration-tree), except that test module itself. This covers workflows, the scripts they run, the frontend manifest and documents.
      • Sample-based tests of both checks.
    • The install-order test now also lists .yaml workflow files.
  • Deletes the two tests of the former dispatch settings in hf-webhook-config.test.ts and route.test.ts, at Anthony's decision on 2026-11-24. They passed GITHUB_ACTIONS_DISPATCH_TOKEN, CALIBRATION_TREE_GITHUB_REPOSITORY and CALIBRATION_TREE_GITHUB_WORKFLOW in, to check that current code ignores them while a deployment still holds them. The live d63156d deployment 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.
  • Updates documents and comments.
    • docs/calibration-tree-artifacts.md no longer says the workflow and script remain. The same section already says the dashboard writes only comparison bundles.
    • frontend/HOSTED_RUNTIME.md no longer names the workflow's HF_TOKEN secret.
    • Comments in calibration-selection.test.ts and calibration-tree-package.test.ts name the collector as what builds trees.
    • A test value in test_deploy_script.py no longer calls a stray HF_TOKEN the 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.

Production deployment Now, since the token's deletion After this merge
d63156d (#315, live since 20:38 UTC on 2026-11-24) and e8fb376 (#311) Never dispatch the workflow. Unchanged.
8117e07 and the other deployments from before #311 For each delivery that starts a build, they dispatch publish-calibration-tree.yml with ref: "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. Unchanged: still 502. The request also names a workflow that is no longer on main, and GitHub's documentation says a workflow_dispatch run 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, e786af1 and earlier merges. Deployments older than 8117e07 (#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: a workflow_dispatch run "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 with gh workflow run --ref <branch> is unverified. Such a copy can't write to the Blob store at any point of the planned order:

  • until 4a · 39 deletes CALIBRATION_TREE_BUILD_ENABLED, its job is skipped while the variable is FALSE;
  • 4a · 39 runs only after 4a · 36 to 4a · 38 have deleted the three secrets;
  • without 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 list and gh variable list (names only) on 2026-11-24. No value was read.

Name Provider Read by the removed code What reads it after this PR Unverified
HF_TOKEN GitHub repository secret The job's env, then the publisher module's Hugging Face reads. No workflow on main. The deployed dashboard's HF_TOKEN is a separate setting: for production, deploy.yml passes the repository secret HF_RELEASE_READ_TOKEN to .github/scripts/deploy-dashboard.sh, which sets the deployment's HF_TOKEN from it; previews use the Vercel project's Preview HF_TOKEN. Draft #304 adds release-history.yml, which reads secrets.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. Whether the same Hugging Face token is also stored elsewhere. GitHub does not show secret values.
POPULACE_UK_STAGING_HF_TOKEN GitHub repository secret The job's env, then the publisher module's UK staging reads (the registration's token_env). No workflow. The Vercel variable of the same name stays until tracker task 6b · 8, and no dashboard code reads it. Tracker task 4a · 37 deletes the GitHub secret. Whether the same Hugging Face token is also stored elsewhere.
BLOB_READ_WRITE_TOKEN GitHub repository secret The job's env, then the publisher module's Blob reads and writes. No workflow on main. The Vercel variable of the same name stays, because comparison writes use it (frontend/app/api/microcosm/comparison-tree/route.ts). Draft #304's release-history.yml also reads secrets.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. Whether the GitHub copy and the Vercel copy are the same token. Deleting the GitHub copy does not change the store's token either way.
CALIBRATION_TREE_BUILD_ENABLED GitHub repository variable The job's if:. Nothing on main. The branch copies above still read it. Tracker task 4a · 39 deletes it. None.
GITHUB_TOKEN The token GitHub Actions creates for each run (not a stored setting) actions/checkout, with contents: read, and oven-sh/setup-bun, whose token input defaults to it. Not applicable. None.
HUGGINGFACE_TOKEN, CALIBRATION_TREE_MAX_RAW_BYTES, CALIBRATION_TREE_MAX_GZIP_BYTES, MICROCOSM_UK_LOCAL_CALIBRATION_DIR, and the registrations' repo_env and revision_env names None: the workflow never set them. Optional reads in the publisher module and the modules it imports, which fall back to defaults when unset. Not applicable. None.
GITHUB_ACTIONS_DISPATCH_TOKEN Vercel Production. Deleted from Vercel on 2026-11-24 (tracker task 4a · 33). Pre-#311 deployments keep their own copies, but the token itself was deleted from Anthony's GitHub account the same day (4a · 34), so GitHub refuses it. Not by this code. Before #311 the webhook sent it to start this workflow; here only the two deleted tests named it. Nothing. None.

How "no workflow" was confirmed.

  • Workflows. ci.yml, deploy.yml and telemetry-service.yml read none of the four settings. None of them uses toJSON(secrets), toJSON(vars), secrets: inherit or a reusable workflow.
  • What the workflows run. Every 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/auth exports Google Cloud credential settings, and astral-sh/setup-uv sets UV_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.py and backend/modal_app.py. The steps also run the telemetry migrations and alembic check, the telemetry image's docker build, bun run lint, bun run build and the test suites. Of those files, only deploy-dashboard.sh names one of the four: it sets the deployment's HF_TOKEN from HF_RELEASE_READ_TOKEN.
  • Other places a setting of the same name could come from. No GitHub environment (Preview, Production, staging) and no organization secret or variable has one of these names, so nothing takes over once the repository settings are deleted.
  • From now on. test_no_workflow_reads_the_former_tree_publisher_settings enforces this.
  • Last run. The publisher's last run was at 15:09 UTC on 2026-11-18.

Tests

Red-green, for the change and for each review round's fixes:

  • Failing tests, 5c1a4f3. Each check failed on its assertion against main's code: the setting check listed the workflow's four reads, the publisher check listed the workflow, and the former Bun check listed publish:calibration-tree.
  • Change, 427b676. Then 71e1fb4 deletes the dispatch-setting tests, and 4c07581 updates the documents.
  • Round 1 failing tests, 6df4705. The sample tests failed on their assertions: the setting check missed the escape, .*, computed-index and quoted-inherit samples, and the publisher check missed every file outside .github/workflows/. The checks against the repository passed.
  • Round 1 fixes, 5d3554e.
  • Round 2 failing tests, e386dc8. Two new samples failed on the sample test's assertion: a }} inside a quoted string in a format() call, and an expression in a mapping key.
  • Round 2 fixes, db96cbd.

Run individually at db96cbd (the first two) or 5d3554e (the rest, unchanged since), all passing:

  • frontend/tests/test_deploy_workflow.py, by node ID:
    • test_setting_detection_covers_the_forms_github_accepts
    • test_no_workflow_reads_the_former_tree_publisher_settings
    • test_publisher_detection_reads_every_file_except_its_own_guard
    • test_no_repository_file_names_the_tree_publisher
    • test_every_bun_script_step_runs_after_its_job_installs_locked_frontend_dependencies
    • test_bun_script_detection_covers_repository_scripts_but_not_package_runners (passing at 4c07581, unchanged since)
  • At 4c07581, unchanged since apart from a comment edit in calibration-selection.test.ts at 5d3554e:
    • frontend/tests/test_deploy_script.py::test_missing_release_credential_stops_deployment_without_printing_secrets
    • calibration-selection.test.ts "the fallback note says the dashboard has no local-area build"
  • bun run lint and ruff check frontend/tests/test_deploy_workflow.py

CI runs the rest.

Review

  • Round 1, at 4c07581: 0 high, 2 medium, 3 low. All five are fixed, at 5d3554e and in this description.

    • Medium: the branch-copy conclusion was stated as certain.
    • Medium: the rollback account left out the skipped Slack alerts.
    • Low: the setting check missed several forms GitHub accepts.
    • Low: the publisher check missed scripts and the colon spelling in manifest commands.
    • Low: the script list, the GITHUB_TOKEN row 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 .yaml files.
  • Round 2, at 5d3554e: 0 high, 1 medium, 2 low. All three are fixed, at db96cbd and 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.

    • Medium: the description still treated the token deletion (4a · 34) as future work, though it was done before this PR was opened.
    • Low: the setting check ended an expression at the first }}, even inside a quoted string, and skipped mapping keys.
    • Low: the description's list of what the workflows run read as complete but left out some commands. The Tests section called calibration-selection.test.ts unchanged 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.

    • The "What the workflows run" bullet left out the environment that actions export through $GITHUB_ENV.
    • The dispatch-setting tests' bullet implied that no deployment holds the token's copy now.
    • The Review and Tests sections misdescribed earlier rounds.

    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

anth-volk and others added 4 commits November 25, 2026 01:34
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>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
calibration-diagnostics Ready Ready Preview Nov 24, 2026 10:29pm UTC

Request Review

anth-volk and others added 2 commits November 25, 2026 02:03
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>
anth-volk and others added 2 commits November 25, 2026 02:28
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>
@anth-volk
anth-volk marked this pull request as ready for review November 25, 2026 14:14
@anth-volk
anth-volk merged commit 102ae77 into main Nov 25, 2026
5 checks passed
@anth-volk
anth-volk deleted the claude/remove-tree-publisher-workflow branch November 25, 2026 14:14

This branch was successfully deployed

1 active deployment
Preview — db96cbd0 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the tree publisher workflow and its script

1 participant