diff --git a/.github/workflows/call-orchestrator.yml b/.github/workflows/call-orchestrator.yml index 418a152d5b..639703c8d6 100644 --- a/.github/workflows/call-orchestrator.yml +++ b/.github/workflows/call-orchestrator.yml @@ -117,6 +117,7 @@ jobs: priority: ${{ inputs.priority }} mode: ${{ inputs.mode }} tor: ${{ inputs.tor }} + vpn: ${{ inputs.vpn }} distros: ${{ inputs.distros }} filesystem: ${{ inputs.filesystem }} architectures: ${{ inputs.architectures }} diff --git a/.github/workflows/call-validation.yml b/.github/workflows/call-validation.yml index 3b35f42785..aa60c6430b 100644 --- a/.github/workflows/call-validation.yml +++ b/.github/workflows/call-validation.yml @@ -42,6 +42,11 @@ on: required: false type: string default: "auto" + vpn: + description: "🕸️ WireGuard axis of the run; decides whether a pinned mesh state is reachable." + required: false + type: string + default: "auto" distros: description: "🐧 Distro pool of the run; narrows what a pinned distro may be." required: false @@ -143,6 +148,7 @@ jobs: INPUT_PRIORITY: ${{ inputs.priority }} INPUT_MODE: ${{ inputs.mode }} INPUT_TOR: ${{ inputs.tor }} + INPUT_VPN: ${{ inputs.vpn }} INPUT_DISTROS: ${{ inputs.distros }} INPUT_FILESYSTEM: ${{ inputs.filesystem }} INPUT_ARCHITECTURES: ${{ inputs.architectures }} diff --git a/cli/administration/deploy/ci/trigger/__main__.py b/cli/administration/deploy/ci/trigger/__main__.py index e8db8d6b83..c598d3135c 100644 --- a/cli/administration/deploy/ci/trigger/__main__.py +++ b/cli/administration/deploy/ci/trigger/__main__.py @@ -82,6 +82,7 @@ def _refused(whitelist: str, priority: str, config: dict[str, str]) -> bool: tokens, modes=query.resolve_modes(config.get("mode") or query.ALL_MODES), tor_mode=tor.resolve_tor_mode(config.get("tor")), + vpn_mode=vpn.resolve_vpn_mode(config.get("vpn")), distros=pools.resolve_distros(config.get("distros")), filesystems=pools.resolve_filesystems(config.get("filesystem")), lifecycles=config.get("lifecycles", ""), diff --git a/cli/meta/ci/validate.py b/cli/meta/ci/validate.py index b714a98d12..4786ca3a91 100644 --- a/cli/meta/ci/validate.py +++ b/cli/meta/ci/validate.py @@ -2,7 +2,8 @@ Usage: python -m cli.meta.ci.validate [--whitelist "..."] [--priority "..."] - [--modes auto] [--tor auto] [--distros "..."] [--filesystem "..."] + [--modes auto] [--tor auto] [--vpn auto] + [--distros "..."] [--filesystem "..."] [--architectures "..."] [--lifecycles "..."] @@ -38,7 +39,7 @@ import sys from cli.meta.ci import query from utils.cache.applications import get_variants -from utils.github.variant import axes, pools, selection, tor +from utils.github.variant import axes, pools, selection, tor, vpn from utils.roles.display import display_names @@ -47,6 +48,7 @@ def problems( *, modes: tuple[str, ...], tor_mode: str, + vpn_mode: str, distros: tuple[str, ...], filesystems: tuple[str, ...], architectures: tuple[str, ...] = pools.ARCHITECTURES, @@ -66,6 +68,7 @@ def problems( tokens: the raw ``whitelist``/``priority`` value. modes: the run's selected deploy modes. tor_mode: the run's tor axis. + vpn_mode: the run's mesh axis. distros: the distro pool the run draws from. filesystems: the filesystem pool the run draws from. architectures: the CPU architecture pool the run draws from; a role @@ -123,8 +126,10 @@ def problems( pin_distro=pin.distro, pin_filesystem=pin.filesystem, pin_architecture=pin.architecture, + pin_vpn=pin.vpn, capable=tor.tor_capable(pin.app, variant, declared), tor_mode=tor_mode, + vpn_mode=vpn_mode, distros=distros, filesystems=filesystems, architectures=axes.row_architectures(pin.app, architectures), @@ -142,6 +147,7 @@ def main(argv: list[str] | None = None) -> int: parser.add_argument("--priority", default="") parser.add_argument("--modes", default=query.ALL_MODES) parser.add_argument("--tor", default=None) + parser.add_argument("--vpn", default=None) parser.add_argument("--distros", default="") parser.add_argument("--filesystem", default="") parser.add_argument("--architectures", default="") @@ -150,6 +156,7 @@ def main(argv: list[str] | None = None) -> int: modes = query.resolve_modes(args.modes) tor_mode = tor.resolve_tor_mode(args.tor) + vpn_mode = vpn.resolve_vpn_mode(args.vpn) distros = pools.resolve_distros(args.distros) filesystems = pools.resolve_filesystems(args.filesystem) architectures = pools.resolve_architectures(args.architectures) @@ -161,6 +168,7 @@ def main(argv: list[str] | None = None) -> int: tokens, modes=modes, tor_mode=tor_mode, + vpn_mode=vpn_mode, distros=distros, filesystems=filesystems, architectures=architectures, diff --git a/docs/agents/action/ci-trigger-priority.md b/docs/agents/action/ci-trigger-priority.md index ff0691d52e..28bfd80cab 100644 --- a/docs/agents/action/ci-trigger-priority.md +++ b/docs/agents/action/ci-trigger-priority.md @@ -14,8 +14,8 @@ is still disputed. It therefore states its axes instead of carrying them over. priority line long enough to fill the whole queue window stops being a priority. - `workspace=false` and `chunk_gate=false`. -- Every selection names every axis: role, variant, mode, onion state, distro - and filesystem. Nothing is left to the rotation. +- Every selection names every axis: role, variant, mode, onion state, distro, + filesystem, architecture and mesh state. Nothing is left to the rotation. ## 1. Collect the candidates @@ -46,8 +46,9 @@ branch, with the sample count behind each one. Measured on this repository, the spread is not marginal: `swarm` costs roughly twice what `compose` costs, and an onion row roughly a third more than a clearnet one. -**Every token pins every axis.** `role#variant@mode+tor|clearnet%distro/filesystem` -carries all six, and none is left to the rotation. A run whose rows the +**Every token pins every axis.** +`role#variant@mode+tor|clearnet%distro/filesystem:architecture&vpn|direct` +carries all eight, and none is left to the rotation. A run whose rows the rotation is still free to move is not a verification run: the combination that comes back is not the one the question was asked about, and a green row then proves nothing about the red one it was supposed to answer. @@ -61,6 +62,8 @@ takes one: | `tor` | the onion is not involved | the failure mentions onion addresses, circuits or the tor proxy | | `distro` | the failure is not package-manager specific | the question names a distro, or the row failed on exactly one | | `filesystem` | the kind is deliverable, see the next step | the question is about the storage driver | +| `architecture` | the failure is not instruction-set specific | the row failed on exactly one, or the question is about a native build | +| `vpn` | the row is not swarm, where `direct` is the only state | the failure is about overlay routing across the mesh | When `timings.fastest` returns `None`, the measurement has too few samples to choose. That is not permission to leave the axis open; it moves the choice one diff --git a/scripts/github/validate/selection.sh b/scripts/github/validate/selection.sh index 59d16e5469..4d4c0301f9 100755 --- a/scripts/github/validate/selection.sh +++ b/scripts/github/validate/selection.sh @@ -8,6 +8,7 @@ # INPUT_PRIORITY priority line of the run ('' = nothing to check) # INPUT_MODE deploy modes the run draws from # INPUT_TOR tor axis of the run +# INPUT_VPN WireGuard mesh axis of the run # INPUT_DISTROS distro pool of the run ('' = every declared distro) # INPUT_FILESYSTEM filesystem pool of the run ('' = every declared kind) # INPUT_ARCHITECTURES architecture pool of the run ('' = amd64 and arm64) @@ -27,6 +28,7 @@ source scripts/meta/env/load.sh --priority "${INPUT_PRIORITY:-}" \ --modes "${INPUT_MODE:-auto}" \ --tor "${INPUT_TOR:-auto}" \ + --vpn "${INPUT_VPN:-auto}" \ --distros "${INPUT_DISTROS:-}" \ --filesystem "${INPUT_FILESYSTEM:-}" \ --architectures "${INPUT_ARCHITECTURES:-}" \ diff --git a/skills/i8-ci-trigger-priority/SKILL.md b/skills/i8-ci-trigger-priority/SKILL.md index 4d6693fe10..de79fe2121 100644 --- a/skills/i8-ci-trigger-priority/SKILL.md +++ b/skills/i8-ci-trigger-priority/SKILL.md @@ -1,10 +1,10 @@ --- name: i8-ci-trigger-priority description: > - Lead a manual CI run with a priority line that verifies the branch's still-open questions: up to 20 selections, every axis pinned in every token (role, variant, mode, onion, distro, filesystem) and its value chosen by measured runtime, workspace and chunk gate off. Infinito.Nexus specific. + Lead a manual CI run with a priority line that verifies the branch's still-open questions: up to 20 selections, every axis pinned in every token (role, variant, mode, onion, distro, filesystem, architecture, mesh) and its value chosen by measured runtime, workspace and chunk gate off. Infinito.Nexus specific. --- Follow the instructions from AGENTS.md, then build and dispatch the priority line by following the procedure in `docs/agents/action/ci-trigger-priority.md` (relative to the Infinito.Nexus repository root) exactly. That document is the source of truth; this skill only routes you -there. Begin by clarifying every open requirement with the `active-listening` skill (escalating any root-cause or design question you are not ~99% sure of to the `dialectic` skill), then work under the `robot` skill. Every token MUST pin all six axes; a token that leaves one to the rotation is not a verification row and MUST NOT be dispatched. Never dispatch a line the validator refuses, and report per candidate what each pin rests on and which question the run will not answer. +there. Begin by clarifying every open requirement with the `active-listening` skill (escalating any root-cause or design question you are not ~99% sure of to the `dialectic` skill), then work under the `robot` skill. Every token MUST pin all eight axes; a token that leaves one to the rotation is not a verification row and MUST NOT be dispatched. Never dispatch a line the validator refuses, and report per candidate what each pin rests on and which question the run will not answer. diff --git a/tests/unit/python/cli/meta/ci/test_validate.py b/tests/unit/python/cli/meta/ci/test_validate.py index d418efec03..0fd5f223f2 100644 --- a/tests/unit/python/cli/meta/ci/test_validate.py +++ b/tests/unit/python/cli/meta/ci/test_validate.py @@ -20,7 +20,9 @@ _VARIANTS = { } -def _problems(tokens: str, *, tor_mode: str = "auto") -> tuple[list[str], list[str]]: +def _problems( + tokens: str, *, tor_mode: str = "auto", vpn_mode: str = "auto" +) -> tuple[list[str], list[str]]: with ( mock.patch.object(validate.query, "discover_rows", return_value=_ROWS), mock.patch.object(validate, "get_variants", return_value=_VARIANTS), @@ -29,6 +31,7 @@ def _problems(tokens: str, *, tor_mode: str = "auto") -> tuple[list[str], list[s tokens, modes=("compose", "swarm", "host"), tor_mode=tor_mode, + vpn_mode=vpn_mode, distros=axes.DISTROS, filesystems=axes.FILESYSTEMS, lifecycles="", @@ -74,6 +77,7 @@ class TestProblems(unittest.TestCase): "web-app-c", modes=("compose",), tor_mode="auto", + vpn_mode="auto", distros=axes.DISTROS, filesystems=axes.FILESYSTEMS, lifecycles="", @@ -100,6 +104,13 @@ class TestProblems(unittest.TestCase): ) self.assertIn("pinned onion state clearnet is impossible", errors[0]) + def test_a_mesh_state_the_mode_rules_out_is_an_error(self) -> None: + errors, _warnings = _problems("web-app-a#0@compose+clearnet&vpn") + self.assertIn("pinned mesh state vpn is impossible", errors[0]) + + def test_a_mesh_state_the_mode_allows_passes(self) -> None: + self.assertEqual(_problems("web-app-a#0@swarm+clearnet&vpn"), ([], [])) + def test_every_offender_is_reported_not_just_the_first(self) -> None: errors, _warnings = _problems( "web-app-a#7@compose+tor web-app-a#1@swarm+tor web-app-b#9@swarm+tor" diff --git a/tests/unit/python/utils/github/variant/test_axes.py b/tests/unit/python/utils/github/variant/test_axes.py index 97774d7f62..ae73096d67 100644 --- a/tests/unit/python/utils/github/variant/test_axes.py +++ b/tests/unit/python/utils/github/variant/test_axes.py @@ -436,6 +436,21 @@ class TestPinnedAxes(unittest.TestCase): with self.assertRaises(SystemExit): _assign([row], sweep=0, tor_mode="disabled", variants_per_app=_VARIANTS) + def test_a_mesh_pin_on_a_mode_that_cannot_mesh_aborts(self) -> None: + """Only swarm meshes, so ``@compose…&vpn`` asks for a combination that + cannot exist. Intersecting it away instead left no state, dropped the + row, and reported a green run for a row that never deployed.""" + row = _row("web-app-b", 0, ("compose",), pin_vpn=True, priority=True) + with self.assertRaises(SystemExit): + self._entries(row) + + def test_an_unpinned_mode_is_refused_only_when_no_mode_can_mesh(self) -> None: + meshable = _row("web-app-b", 0, ("compose", "swarm"), pin_vpn=True) + self.assertNotEqual(self._entries(meshable), []) + hostbound = _row("web-app-b", 0, ("compose", "host"), pin_vpn=True) + with self.assertRaises(SystemExit): + self._entries(hostbound) + class TestResolvePool(unittest.TestCase): def test_an_empty_input_opens_the_whole_declared_set(self) -> None: diff --git a/utils/github/variant/axes.py b/utils/github/variant/axes.py index bc777b22c4..932dbdd8ba 100644 --- a/utils/github/variant/axes.py +++ b/utils/github/variant/axes.py @@ -229,8 +229,10 @@ def assign( pin_distro=pin_distro, pin_filesystem=pin_filesystem, pin_architecture=pin_architecture, + pin_vpn=pin_vpn, capable=capable, tor_mode=tor_mode, + vpn_mode=vpn_mode, distros=distros, filesystems=filesystems, architectures=offered_architectures, diff --git a/utils/github/variant/pins.py b/utils/github/variant/pins.py index b601ba1af0..2079960ae9 100644 --- a/utils/github/variant/pins.py +++ b/utils/github/variant/pins.py @@ -11,6 +11,7 @@ from typing import TYPE_CHECKING from utils.github.variant.pools import ARCHITECTURES from utils.github.variant.tor import tor_states +from utils.github.variant.vpn import VPN_DEPLOY_MODES, pinned_vpn_states from utils.roles.display import VARIANT_SEPARATOR from utils.roles.meta_lookup import get_role_architectures @@ -42,8 +43,10 @@ def check_pins( pin_distro: str | None, pin_filesystem: str | None, pin_architecture: str | None = None, + pin_vpn: bool | None = None, capable: bool, tor_mode: str, + vpn_mode: str = "auto", distros: Sequence[str], filesystems: Sequence[str], architectures: Sequence[str] = ARCHITECTURES, @@ -51,9 +54,10 @@ def check_pins( """Prove the row can take what the selection token pinned on it. The offered modes are already narrowed by the run's ``--modes`` input, the - onion states by its ``--tor`` input and the two pools by ``--distros`` and - ``--filesystem``, so this catches a pin that fights the role, the variant, - or the run's own axes with one check each. + onion states by its ``--tor`` input, the mesh states by its ``--vpn`` input + and the two pools by ``--distros`` and ``--filesystem``, so this catches a + pin that fights the role, the variant, or the run's own axes with one check + each. """ if pin_mode is not None and pin_mode not in offered: _reject( @@ -74,17 +78,27 @@ def check_pins( f"pinned {axis} {value!r} is outside this run's {axis} pool " f"({', '.join(pool) or 'empty'})", ) - if pin_tor is None: - return - for mode in (pin_mode,) if pin_mode else offered: - if pin_tor in tor_states(mode, capable=capable, tor_mode=tor_mode): - return - _reject( - app, - variant, - f"pinned onion state {'tor' if pin_tor else 'clearnet'} is impossible " - f"here (mode, variant or the run's tor axis rules it out)", - ) + modes = (pin_mode,) if pin_mode else offered + if pin_tor is not None and not any( + pin_tor in tor_states(mode, capable=capable, tor_mode=tor_mode) + for mode in modes + ): + _reject( + app, + variant, + f"pinned onion state {'tor' if pin_tor else 'clearnet'} is impossible " + f"here (mode, variant or the run's tor axis rules it out)", + ) + if pin_vpn is not None and not any( + pinned_vpn_states(mode, pin=pin_vpn, vpn_mode=vpn_mode) for mode in modes + ): + _reject( + app, + variant, + f"pinned mesh state {'vpn' if pin_vpn else 'direct'} is impossible " + f"here (only {'/'.join(VPN_DEPLOY_MODES)} meshes). A held vpn axis " + f"overrides the pin instead and is not refused here", + ) def row_architectures(