6 Commits

Author SHA1 Message Date
mnovak 175cb5dc60 Merge feature/roads: Day 2, roads, the compiler and proto v1 (PR #1)
QA findings F-01 to F-10 and B-3 fixed; B-1, F-12 and F-13 recorded as gaps. 91 tests on Windows (debug and release), 182 on Linux (Fabrica nixos-vm run rpnb803g4v0t0); fuzz 601 s per target, 0 crashes.
2026-11-26 05:24:37 +01:00
mnovak 88858ef235 docs: HANDOVER for v0.1.0, with the Linux run on Fabrica's runner (QA F-11 closed) and the fuzz rerun 2026-11-26 05:24:21 +01:00
mnovak 63eaed563b ci(linux): the toolchain step starts with nix, with no && inside, for Fabrica's preflight 2026-11-26 04:24:35 +01:00
mnovak 61e1f1da19 ci: the workspace once on Linux, on Fabrica's NixOS runner, before the tag (QA F-11)
Mark, 2026-11-26: the Linux run goes on Fabrica's server runner. The flake gives only the
toolchain (nixos-26.05, locked as Ianitor's); the pipeline runs cargo test --workspace in debug
and release. It builds and switches nothing on the server.
2026-11-26 04:21:10 +01:00
mnovak 3b39ce137d [roads] Mark's decision: person and group grants leave classic devices out
Mark, 2026-11-25, "Leave classic out": a grant to a person or a group covers
only their post-quantum devices. A classic router is reached only through a
device: road of its own, which says classic: true. Before, a person grant
covered their classic devices and so needed classic: true itself, and one
classic device blocked every road of its owner (builder's self-review #5).
New test a_person_grant_never_covers_their_classic_device, which fails with
the old compiler. Docs and HANDOVER updated: 91 tests, debug and release.
2026-11-25 10:58:57 +01:00
mnovak 18e0c50e08 [docs] HANDOVER: via-core after the QA fixes, with counts, fuzz runs and what is left 2026-11-25 09:24:29 +01:00
8 changed files with 221 additions and 12 deletions
+21
View File
@@ -0,0 +1,21 @@
# via-core: the whole workspace once on Linux, on the server's NixOS runner, before the v0.1.0 tag (QA F-11; Mark,
# 2026-11-26: "Fabrica server runner"). By hand (Artifex → via-core → linux, or the hub's POST /api/runs with
# pipeline linux and a ref), or on a push to feature/roads or ci/linux. It builds and switches nothing on the
# server. Every run line starts with `nix` and has no `&&`, `;` or `|` (Fabrica's preflight reads each part's first
# word as a runner tool). The toolchain is the flake's `ci` shell (nixos-26.05).
name: linux
on:
push: [feature/roads, ci/linux]
manual: true
runner: nixos
env:
CARGO_TERM_COLOR: "never"
steps:
- id: toolchain
run: nix --extra-experimental-features "nix-command flakes" develop .#ci -c cargo --version
- id: test-debug
needs: [toolchain]
run: nix --extra-experimental-features "nix-command flakes" develop .#ci -c cargo test --workspace --no-fail-fast
- id: test-release
needs: [test-debug]
run: nix --extra-experimental-features "nix-command flakes" develop .#ci -c cargo test --workspace --release --no-fail-fast
+94
View File
@@ -0,0 +1,94 @@
# Handover — via-core
Newest entry first. Where this file and the code disagree, the code wins and the next entry says so.
## 2026-11-26 — v0.1.0 (owner session)
**Released:** `v0.1.0`, an annotated tag on the `--no-ff` merge of PR #1 into `main`, plus a Gitea release. Mark
chose "Tag + Gitea release now"; Artifex signing comes later. **Not audited.**
**Since the 2026-11-25 entry:**
- `3b39ce1`, Mark's decision: a person or group grant leaves classic devices out. They are reached only by their own
`device:` road; test `a_person_grant_never_covers_their_classic_device`.
- The pipeline `linux` (`.fabrica/artifex/linux.yaml`) and a toolchain-only flake (`nix develop .#ci`, nixos-26.05)
for Fabrica's NixOS runner. The library is unchanged since `3b39ce1`.
**Counts:**
| Run | Where | Result |
|:--|:--|:--|
| `cargo test --workspace` (debug and release) | Windows 10, cargo 1.99.0, at `3b39ce1` | 91 passed / 0 / 0 each |
| `cargo test --workspace` (debug and release) | **Linux**: Fabrica `nixos-vm` runner, run `rpnb803g4v0t0`, at `63eaed5` | 182 passed / 0 / 0 in total (91 each); exit 0, 164 s. This closes QA F-11 |
| fuzz `road_file` | Windows, at `3b39ce1` | 601 s, 228,925 executions, 0 crashes (at 100 % CPU) |
| fuzz `envelope` | Windows, at `3b39ce1` | 601 s, 12,748,163 executions, 0 crashes |
| clippy, fmt, `cargo deny`, `cargo audit` | Windows, at `7342659` | clean |
**Still open (recorded, not fixed):** B-1, a replayable plan; Day 3 wraps every plan in a signed envelope with
`serial` and `expires`, in via's `crates/control`. F-12, case-sensitive ids. F-13, which blocks the Day 5 web view.
## 2026-11-25 — QA findings fixed on `feature/roads` (owner session)
**Who owns this:** the Via owner session. It reviews, merges `--no-ff` and tags `v0.1.0`. Mark's decisions
go through the orchestrator session.
**Where it stands:** PR #1 (`feature/roads`) is open, not merged, not tagged. QA's review (head `635d380`)
found one blocker and five majors in the model; all are fixed on the branch, one commit each, each removing
the `#[ignore]` of its finding's test in `tests/qa_findings.rs`. `main` still holds only the bootstrap.
**Build described:** Windows 10, `cargo 1.99.0` / `rustc 1.99.0` stable MSVC, debug profile, at the branch
head named in the PR.
| Run | Result |
|:--|:--|
| `cargo test --workspace` | **91 passed, 0 failed, 0 ignored** (debug and `--release`) |
| `cargo clippy --workspace --all-targets -- -D warnings` | clean |
| `cargo fmt --all --check` | clean |
| `cargo deny check` | advisories ok, bans ok, licenses ok, sources ok |
| `cargo audit` | 80 crates, 0 vulnerabilities |
| fuzz `road_file` | **631 s, 807,395 executions, 0 crashes, 0 artifacts** (features 7,711 → 9,819; corpus 1,080 → 1,289), built at `7342659`, Windows MSVC, SanitizerCoverage, no sanitizer |
| fuzz `envelope` | **331 s, 17,441,113 executions, 0 crashes** (features 5,096 → 5,256), same build |
Per file: `proto/roundtrip` 6 · `roads` unit 16 · `attacks` 8 · `custom` 6 · `determinism` 4 · `explain` 6 ·
`least_privilege` 6 (P-1 5,000 cases: 1,706 with rules, 4,420 rules and 7,784 allowed IPs checked against the
oracle; P-6v6 1,000) · `qa_findings` 13 · `rename` 4 · `revocation` 10 · `validation` 5 (83 fixture files, 65
rules) · `via-cli/cli` 7.
**What changed after QA** (details in `docs/02_via-core.md`, "QA review of PR #1"):
| # | Change |
|:--|:--|
| F-01 | services may have their own mesh address (`devices.json` `services[].address`); a road to a service that shares its address and a port with another is `service.shared`; plans list the device's service addresses (`services[]`); a `device:` road reaches all of the device's addresses |
| F-02 | `direct.mesh`, `direct.tunnelled`, and `direct[].except` (tunnelled nets that stay in the tunnel) |
| F-03 | a kill-switch road with an error fails closed, through no exit |
| F-04 | a dangling owner or group member is reported and drops only itself (`devices.owner-unknown`, `directory.member-unknown`) |
| F-05 | custom blocks on a classic device are labelled classic |
| F-06 | cross-family roads give nothing to those devices and are reported (`road.family`) |
| F-07 | no `roads/`, or a `roads/` that is a file or a link, is `store.roads` |
| F-08 | mesh addresses are never internet addresses |
| F-09 | `until:` / `ports:` present but empty is `key.empty` |
| F-10 | P-6v6: IPv6 compiles like IPv4, by embedding into `fd00::/96` |
| B-3 | `app:` roads need `on:` (person, group or device) and reach only those devices |
| R-55 | QA's renaming property was flaky (a group renamed to `in`); fixed in the test, seed pinned |
| Mark | "Leave classic out" (2026-11-25): person and group grants cover only post-quantum devices; a classic device needs its own `device:` road with `classic: true`. Test `revocation.rs::a_person_grant_never_covers_their_classic_device`, mutation-checked |
The plan format gained `services` and `direct[].except`. Format 1 has not been released, so it changed in
place; the golden plans and the pinned CBOR digest were regenerated and the diff read by hand.
**Not fixed, recorded** (`docs/02_via-core.md`, Gaps):
- **B-1** proto v1 has no serial: Day 3's signed v2 carries a monotonic serial and `not_after`.
- **F-13** `explain` and `check` answer as an administrator: **blocks the Day 5 web view**.
- **F-12** ids are case-sensitive: decide with the people directory.
- **F-11** never run on Linux (WSL does not start on this PC): wanted before the tag.
- A kill-switch file that does not *parse* applies nothing (only reported).
**Decisions taken here that Mark may want to see:** services get their own mesh address (no Ianitor identity
check needed); `except` makes the tunnel win over going direct; app roads need `on:`.
**Next:** merge `--no-ff` into `main`, push, `git rev-parse HEAD origin/main` twice, tag `v0.1.0`, per
`F:\Akce\Via\handover\MERGE-PLAN.md`, once the Linux question (F-11) and the signed-release question are answered.
## 2026-11-25 — Day 2 built (builder), reviewed (QA)
The road model, validator, compiler, `explain`, the versioned CBOR control messages and the `via` command:
72 tests by the builder; QA added the renaming property, nine finding tests and two fuzz targets
(`road_file` 721 s, 1,116,471 executions; `envelope` 331 s; no crash; Windows, no sanitizer).
+13 -7
View File
@@ -95,8 +95,10 @@ impl Extras {
}
}
/// The devices a subject covers: a person's are the devices they own; a group's, its members'; an app's, those
/// of its `on` (QA B-3: never every device of the mesh).
/// The devices a subject covers: a person's are the post-quantum devices they own; a group's, its members';
/// an app's, those of its `on` (QA B-3: never every device of the mesh). A classic (not post-quantum) device is
/// never covered by a person or a group: it is reached only by a `device:` road of its own, which says
/// `classic: true` (Mark, 2026-11-25: "Leave classic out").
pub fn subject_devices(
subject: &Subject,
on: Option<&Subject>,
@@ -114,11 +116,14 @@ pub fn subject_devices(
devs.devices
.values()
.filter(|d| match subject {
Subject::Person(p) => d.owner.as_ref() == Some(p),
Subject::Group(g) => dir
Subject::Person(p) => !d.classic && d.owner.as_ref() == Some(p),
Subject::Group(g) => {
!d.classic
&& dir
.groups
.get(g)
.is_some_and(|g| d.owner.as_ref().is_some_and(|o| g.members.contains(o))),
.is_some_and(|g| d.owner.as_ref().is_some_and(|o| g.members.contains(o)))
}
Subject::Device(k) => &d.key == k,
Subject::App(_) => false,
})
@@ -126,7 +131,8 @@ pub fn subject_devices(
.collect()
}
/// Devices by owner, built once per compile so resolving a subject does not scan every device.
/// Post-quantum devices by owner, built once per compile so resolving a subject does not scan every device.
/// Classic devices are left out: no person or group grant covers them.
struct Index {
by_owner: BTreeMap<crate::ids::PersonId, BTreeSet<DeviceKey>>,
}
@@ -134,7 +140,7 @@ struct Index {
impl Index {
fn new(devs: &Devices) -> Index {
let mut by_owner: BTreeMap<_, BTreeSet<DeviceKey>> = BTreeMap::new();
for d in devs.devices.values() {
for d in devs.devices.values().filter(|d| !d.classic) {
if let Some(o) = &d.owner {
by_owner.entry(o.clone()).or_default().insert(d.key.clone());
}
+41
View File
@@ -200,3 +200,44 @@ fn a_person_deleted_from_the_directory_leaves_their_roads_reported_and_void() {
"the friend node kept petr-phone as a peer"
);
}
/// Mark, 2026-11-25, "Leave classic out": a grant to a person or a group covers only their post-quantum
/// devices. A classic router that Mark owns is reached by none of Mark's or the household's roads, only by
/// its own `device:` road with `classic: true`, and that road keeps working.
#[test]
fn a_person_grant_never_covers_their_classic_device() {
let parts = Parts::home().edit_devices(|d| {
d.replace(
r#""name": "router", "address""#,
r#""name": "router", "owner": "mark", "address""#,
)
});
let c = parts.compile();
assert_eq!(c.errors().count(), 0, "{:?}", c.problems);
let router = &c.plans[&key(5)];
// h2x8vd (person:mark -> the home LAN) and k3f9q2 (group:household -> home-server) leave it out.
for p in &router.peers {
assert!(
p.roads.iter().all(|r| r.as_str() == "r8m2tg"),
"the router got a peer from a person or group road: {:?}",
p.roads
);
}
assert!(
!router
.peers
.iter()
.flat_map(|p| p.allowed_ips.iter())
.any(|n| n.to_string() == "192.168.100.0/24"),
"mark's LAN road reached his classic router"
);
// Its own classic road still gives it the home server on udp/53 and tcp/22.
assert!(fw_accepts(
&c,
&key(5),
"100.96.0.2".parse().unwrap(),
Some(("tcp", 22))
));
// And mark's post-quantum devices keep their access.
assert!(c.plans[&key(1)].peers.iter().any(|p| p.key == key(2)));
}
+5 -2
View File
@@ -57,8 +57,11 @@ change.
| `never-online-without` | person, group, device | exit | `until` | nothing: the kill switch |
| `custom` | device | — | `until`, `classic` | nothing the compiler checks: the raw block is carried, verbatim and labelled |
- A person's grant covers **every device whose owner is that person** in `devices.json`; a group's covers every
member's devices. Removing a device from a person removes its access on the next compile.
- A person's grant covers **every post-quantum device whose owner is that person** in `devices.json`; a group's
covers every member's post-quantum devices. Removing a device from a person removes its access on the next
compile. **Classic devices are left out** of person and group grants (Mark, 2026-11-25, "Leave classic
out"): a classic router is reached only by a `device:` road of its own, which says `classic: true`. So one
classic device no longer blocks its owner's roads (the builder's self-review #5).
- `classic` must be `true` on any road that would create a peer with a classic (not post-quantum) device. It is
the road saying out loud that this path is not post-quantum. Without it the road grants nothing.
- `until` is exclusive and compared with `now`, which is a parameter. Each plan carries `expires`, the earliest
+1 -1
View File
@@ -75,7 +75,7 @@ never widens a road (QA F-09). `ports: []` is `ports.format`.
| Form | Meaning | Id rules |
|:--|:--|:--|
| `person:<id>` | a person in `directory.json` | opaque: 1–64 of `[A-Za-z0-9_-]` (no people directory exists in Fundamentum yet) |
| `person:<id>` | a person in `directory.json`: their post-quantum devices (classic devices are never covered by a person or group, only by their own `device:` road) | opaque: 1–64 of `[A-Za-z0-9_-]` (no people directory exists in Fundamentum yet) |
| `group:<id>` | a group in `directory.json` | as a person id |
| `device:<key>` | a device in `devices.json` | the Tessera device subkey: 32-byte Ed25519 public key, base64url without padding, 43 characters, canonical |
| `app:<id>` | a Domi app, on the devices its road's `on` names (QA B-3) | the Tessera id: 1–32 of `[a-z0-9-]`, not starting or ending with `-` |
Generated
+27
View File
@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1793865203,
"narHash": "sha256-/cpdPHaySDIyCgZI6EWngiM6jK3YLUNzv1b7lTzy6Bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c56a87d8e41ce69bd2af57eb35dcc117a9dfca33",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+17
View File
@@ -0,0 +1,17 @@
{
description = "The Linux test shell for Fabrica's NixOS runner (.fabrica/artifex/linux.yaml)";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
outputs =
{ self, nixpkgs }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
{
# nix develop .#ci -c cargo test : the toolchain only; the tests fetch crates from crates.io.
devShells.x86_64-linux.ci = pkgs.mkShell {
packages = with pkgs; [ cargo rustc clippy rustfmt git ];
};
};
}