Skip to content

Phase 7w: compare the deployed re-pull workflow in CI (held) - #1980

Merged
neuromechanist merged 6 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1913-phase7w-workflow-pair
Oct 27, 2026
Merged

neuromechanist merged 6 commits into
feature/issue-1046-epic-upstream-freshnessfrom
feature/issue-1913-phase7w-workflow-pair

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Phase 7w of epic #1046, part of #1913. It changes .github/workflows/test.yml, test/repull-workflow.test.ts (a header comment and new cases) and the workflow's authoring copy .github/dataset-workflows/run-upstream-repull.yml (review fixes, below). The unit-pure-shard job's sparse checkout of nemarDatasets/.github (main) gains .github/workflows/run-upstream-repull.yml, and the test step names the checked-out copy in NEMAR_REPULL_WORKFLOW_LIVE, so test/repull-workflow.test.ts compares the deployed workflow byte for byte with the authoring copy at .github/dataset-workflows/run-upstream-repull.yml. This is the arrangement the onboard, PR review and publication review workflows already have (the last two arrived in #1724 and #1790). With the variable set, a declared path that is missing fails, so a broken checkout cannot quietly turn the check off.

Six commits, one change each: ci: check out the repull workflow in tests adds the checkout line and updates the comment's count to four files, ci: set the repull workflow live flag in tests adds the variable, test: say repull header names the deployed copy rewords a header comment, ci: harden the repull token and mask checks hardens the authoring copy, ci: refuse control characters in the payload closes the control-character gap in it, and test: pin the repull hardening and control check pins both. On the epic head 1abf9286 the sparse-checkout block is at lines 971 to 975 and the three existing variables at lines 1033 to 1035; the new lines land at 976 and 1038.

Hold

Do not merge yet. This is the nemar-cli half of a held pair; the twin is nemarDatasets/.github#148, which adds the byte-identical workflow file to nemarDatasets/.github. Until that file is on the main of nemarDatasets/.github, the Tests run on this PR fails by design in unit-pure-shard, in test/repull-workflow.test.ts, with "NEMAR_REPULL_WORKFLOW_LIVE=... but that file does not exist". It is opened as a draft for that reason.

Merge only after the owner's explicit confirmation, in this order: first the twin, which adds an inert file (it runs only on a repository_dispatch of type run-upstream-repull, and the Worker sends none until the owner turns the switches on after the release); then re-run the Tests workflow on this PR and expect unit-pure-shard green; then merge this PR into the epic branch; then the epic branch to dev and the release. Merging this PR first would turn the epic branch's Tests run red until the twin lands, and the epic-to-dev run is the gate.

The twin carries the authoring copy as of a3dc47c. If the copy changes again, here or on the epic branch, before the twin merges, the twin must be refreshed from the new commit; its body gives the cmp command.

Test plan

  • bun run typecheck: exit 0.
  • bun run lint: exit 0 (Biome checks src/; this change is YAML only).
  • bun test test/repull-workflow.test.ts with no variable set: exit 0, 34 pass, 3 skip (the parity block skips visibly), 0 fail.
  • The same file with NEMAR_REPULL_WORKFLOW_LIVE set to the twin branch's file: exit 0, 37 pass, 0 skip, 0 fail.
  • Inverse paths: with the variable naming an absent file the run fails (exit 1, 3 fail, with the "does not exist" message CI prints until the twin lands); with a one-byte drift in the deployed copy it fails (exit 1, "first difference at line 337").
  • YAML parse of .github/workflows/test.yml and of the twin's new workflow with the yaml package 2.8.4 under Bun: both parse, exit 0.
  • The sparse checkout names the file exactly. Parsed from the committed test.yml, the list holds four anchored lines with the new one exactly once, and the four NEMAR_*_WORKFLOW_LIVE values match the four lines. The checker failed on the unchanged file, on a one-letter typo and on a wrong directory. A real non-cone git sparse-checkout of the twin branch with those four lines materializes exactly four files, and the new one is byte-identical to the authoring copy.
  • actionlint 1.7.12: the same three SC2086 notes in test.yml before and after, none new.
  • CI on the earlier head e696ad07 (run 40463699265), read while it was still running: changes, lint, zarr-python-test, patch-duration-test and unit-pure shards 1 to 5 pass. The real actions/checkout accepted the new sparse line and the test step received the variable. Shard 6 fails only the three deployed-copy tests of test/repull-workflow.test.ts (2027 pass, 18 skip, 3 fail) with "that file does not exist; the checkout step did not produce it", which is the held state described above. Nothing else fails.
  • Only CI can check, after the twin has merged: the checkout of nemarDatasets/.github main producing the file, and unit-pure green on this head.

Review fix (the review had no blocking finding and one suggestion, accepted): the header of test/repull-workflow.test.ts said the unit-pure-shard job "will, once the deploy lands" name the deployed copy. The third commit rewords it, as a comment only, to say what is true now (the job checks the copy out of nemarDatasets/.github main and names it in NEMAR_REPULL_WORKFLOW_LIVE, and stays red until the twin is merged) and what is true after (any difference between the two copies fails it). The test file gives the same counts as before: 34 pass, 3 skip, 0 fail with the variable unset.

Review fix 2 (accepted from the review of the twin, nemarDatasets/.github#148): ci: harden the repull token and mask checks changes the authoring copy, and the twin carried the same bytes then (db1b932). The validation step now checks dispatch_token and repull_id inside its jq -e gate, on the event file. A token of 64 hex characters followed by a newline used to pass, because $(jq -r) strips the newline before the shell sees it, and an empty repull_id passed as if the key were absent; both are refused now. The mask step splits the token at carriage returns as well as line feeds before it masks each line, so a lone carriage return no longer keeps two parts of a value inside one ::add-mask:: line. Comments only: the second step is named as a token reader, "cancelled" is "canceled", and the validation script's comment says the script never echoes a value without claiming the runner's step header, which prints the job's env:, is clean. Not applied: the Deploy to: path form on line 3, because test/repull-workflow.test.ts pins the short form and changing it would churn the pin and both copies for a cosmetic difference. Checked with the review's hostile-event harness (the old file accepts the two holes and masks a lone carriage return inside one line; the new file refuses them and splits; no other case changed, and each guard, mutated alone, is caught), actionlint (no findings), and bun test test/repull-workflow.test.ts (34 pass, 3 skip with the variable unset; 37 pass against the twin's file; a one-byte drift still fails).

Review fix 3 (the last round, accepted from the same review): ci: refuse control characters in the payload adds one condition to the validation gate, and (.client_payload | [.[] | test("[\u0000-\u001f\u007f]")] | any | not), which refuses a control character in any payload field. An environment variable ends at a NUL, so the checks on the variables saw only what preceded it and step 2 passed a payload that the CLI refused later; the gate reads the event file, which holds all of it. The condition also refuses a final newline, so the separate endswith guard on the token and repull_id was redundant and is removed: while both existed, dropping either one changed nothing, so neither could be pinned alone. test: pin the repull hardening and control check adds cases to the mask test and the refusal test (the counts do not change: 34 pass, 3 skip, 37 pass against the twin's file): a token with a carriage return, abc\r::warning::forged, is masked per line, so no line starts with ::warning::; a token with a final newline, an empty repull_id and a repull_id of 1\n are refused; a NUL in each of the nine fields is refused, with the job environment cut at the NUL as the runner cuts it. The refusal cases are collected, so a weakened check lists every case it lets through. Each case fails on its own mutant: dropping tr '\r' '\n' fails the carriage-return mask case; dropping the control check lets through the token and 1\n final-newline cases and the seven NUL cases the shell checks cannot see; accepting an empty repull_id lets through exactly the empty case; and, before the guard was removed, dropping it let through the final-newline cases (token only, repull_id only, both). Against the file as first reviewed the new cases fail too, except 1\n, which that file already refused. The expression gives identical results on jq 1.8.2, Apple's jq 1.7.1 and Ubuntu 24.04's jq 1.7.1 (the runner's package) over the review's hostile-event harness, which still refuses every case it refused before. actionlint and shellcheck report nothing on the run scripts. The twin carries the same bytes (a3dc47c, sha256 ccb8a657ac61bd43dbc3105efede0c5101bc34e484b76471e91d75cd8a66c259, cmp exit 0).

Part of epic #1046.

Adds run-upstream-repull.yml to the sparse checkout of the deployed dataset workflows and updates the comment's count to four. Nothing reads the file yet; the next commit names it for the parity test. YAML parsed; not run in CI.
Names the checked-out copy in NEMAR_REPULL_WORKFLOW_LIVE so test/repull-workflow.test.ts compares it byte for byte; a declared path that is missing fails. The unit-pure job stays red until the twin pull request lands in nemarDatasets/.github, so this is held with it. YAML parsed; not run in CI.
Comment only. The header said the unit-pure-shard job will, once the deploy lands, name the deployed copy. It now says the job does so, stays red until the deploy pull request is merged, and fails on any drift after. bun test test/repull-workflow.test.ts: 34 pass, 3 skip, 0 fail with the variable unset.
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR1980

Version: 0.10.26-PR1980.74a955e
Commit: 74a955e


🤖 Updated on each push.

The validation step now checks the token and repull_id in the jq gate, on the event file, where a token with a trailing newline and an empty repull_id can no longer pass as they did through a shell variable. The mask step splits the token at carriage returns as well as line feeds. Comment fixes: the second step reads the token, canceled, and the script, not the runner header, never echoes a value. Checked with a hostile-event harness (each guard mutated and caught), actionlint, and test/repull-workflow.test.ts: 34 pass, 3 skip. The org copy follows in nemarDatasets/.github#148.
neuromechanist added a commit to nemarDatasets/.github that referenced this pull request Oct 27, 2026
Whole-file copy of the hardened .github/dataset-workflows/run-upstream-repull.yml from nemarOrg/nemar-cli#1980, commit db1b932040f08bfbc045768b3de87897519291ac (sha256 ea9052fe68bc2be207425740515711aa5b3d6df4cbee308c9c0d14f05fc479ea, 343 lines). Verified with cmp. The token and repull_id are checked in the jq gate on the event file, and the mask step splits at carriage returns too. actionlint clean; the workflow was not executed.
The validation gate now refuses a control character in any payload field, read from the event file. An environment variable ends at a NUL, so the checks on the variables saw only what preceded it and step 2 passed a payload the CLI refused later. The test also covers the final newline that a regex dollar lets through, so the separate final-newline guard on the token and repull_id is gone. Checked with the review harness on jq 1.8.2, Apple jq 1.7.1 and Ubuntu 24.04's jq 1.7.1 (identical results), actionlint clean, and the existing tests: 34 pass, 3 skip. The org copy follows in nemarDatasets/.github#148.
Adds cases to the mask test and the refusal test, each caught by its own mutant: a carriage return in the token is masked per line; a token with a final newline, an empty repull_id and a repull_id of 1 plus a newline are refused; a NUL in any field is refused, with the job environment cut at the NUL as a C string is. The refusal cases are collected, so a weakened check shows every case it lets through. 34 pass, 3 skip (37 pass against the org copy).
neuromechanist added a commit to nemarDatasets/.github that referenced this pull request Oct 27, 2026
Whole-file copy of .github/dataset-workflows/run-upstream-repull.yml from nemarOrg/nemar-cli#1980, commit a3dc47cea58d6d1b7dd2f7a4924355737eaa216a (sha256 ccb8a657ac61bd43dbc3105efede0c5101bc34e484b76471e91d75cd8a66c259, 345 lines). The validation gate refuses a control character in any payload field, which closes the gap where a NUL ended an environment variable and step 2 passed a payload the CLI refused later. Verified with cmp. actionlint and shellcheck clean; the workflow was not executed.
neuromechanist added a commit to nemarDatasets/.github that referenced this pull request Oct 27, 2026
* Add the upstream re-pull workflow

Whole-file copy of .github/dataset-workflows/run-upstream-repull.yml from nemarOrg/nemar-cli, branch feature/issue-1046-epic-upstream-freshness at 1abf92868e8216b4d1596d6802dea0c7ab2f7e8c (file last changed in 138386fb650568c56d7abf6dbed34ecf88f917fe; sha256 7335f4cd99b1e1cf6718ab044efe23c0a6856df8968df85804ef176ede81f74b, 336 lines). Verified with cmp. YAML parsed and actionlint clean; the workflow was not executed.

* ci: harden the repull token and mask checks

Whole-file copy of the hardened .github/dataset-workflows/run-upstream-repull.yml from nemarOrg/nemar-cli#1980, commit db1b932040f08bfbc045768b3de87897519291ac (sha256 ea9052fe68bc2be207425740515711aa5b3d6df4cbee308c9c0d14f05fc479ea, 343 lines). Verified with cmp. The token and repull_id are checked in the jq gate on the event file, and the mask step splits at carriage returns too. actionlint clean; the workflow was not executed.

* ci: refuse control characters in the payload

Whole-file copy of .github/dataset-workflows/run-upstream-repull.yml from nemarOrg/nemar-cli#1980, commit a3dc47cea58d6d1b7dd2f7a4924355737eaa216a (sha256 ccb8a657ac61bd43dbc3105efede0c5101bc34e484b76471e91d75cd8a66c259, 345 lines). The validation gate refuses a control character in any payload field, which closes the gap where a NUL ended an environment variable and step 2 passed a payload the CLI refused later. Verified with cmp. actionlint and shellcheck clean; the workflow was not executed.
@neuromechanist
neuromechanist marked this pull request as ready for review October 27, 2026 09:01
@neuromechanist
neuromechanist merged commit 9f7a645 into feature/issue-1046-epic-upstream-freshness Oct 27, 2026
44 of 46 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-1913-phase7w-workflow-pair branch October 27, 2026 09:01

This branch was previously deployed

1 inactive deployment
npm — 74a955e5 Deployed Oct 27, 2026 by neuromechanist via publish #4053
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.

1 participant