gunk-dev/the-valley

integrator.nix

source6545b7fdec50main's published tip history
1.9 KiB
1# The integrator: its verdict rules, and the controller over real
2# repositories.
3{ pkgs, packages, ... }:
4{
5 # The integrator's verdict, case by case, with no repository in
6 # sight. Every rule of dcr-439b771 is a function of data, so the
7 # unit tests state each one directly; what a repository does to
8 # produce those inputs is integrator-e2e's.
9 integrator-unit = packages.integrator-unwrapped;
10
11 # The integrator itself, driven end to end over scratch bare
12 # repositories and throwaway keys, running the real binaries: the
13 # helper produces the evidence, the deriver composes the policy,
14 # the controller judges and lands. The scenarios are Phase 3's
15 # exit criteria, observed rather than asserted about, and they live
16 # with the integrator (integrator/e2e/) rather than here.
17 #
18 # Only the nix evaluator is stood in for — a nix build has no
19 # daemon in the sandbox, the same wall attest-e2e meets — and the
20 # stand-in models the one property the pure rule rests on: a
21 # check's input closure is the content of the files it reads.
22 # Everything downstream of it is real: attest builds the manifest
23 # and the digest, and the integrator compares them.
24 integrator-e2e = pkgs.runCommand "valley-integrator-e2e" {
25 nativeBuildInputs = [
26 pkgs.bash
27 pkgs.git
28 pkgs.openssh
29 pkgs.coreutils
30 pkgs.findutils
31 pkgs.gnused
32 pkgs.gnugrep
33 pkgs.cue
34 packages.attest
35 packages.valley-script
36 packages.integrator
37 ];
38 e2eDir = ../../integrator/e2e;
39 SCHEMA_ATTESTATION = ../../schema/attestation.cue;
40 SCHEMA_VERIFICATION = ../../schema/verification.cue;
41 SCHEMA_EVENTS = ../../schema/events.cue;
42 # No bus in a sandbox: the payloads are still composed and
43 # vetted against the vocabulary, and printed rather than
44 # published. What publishing does is the post-receive hook's
45 # one `nats pub`, which this shares.
46 } (builtins.readFile ./integrator-e2e.sh);
47}