Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
140fbc3161 Merge pull request 'Static release carry: explicit 0444 under UMask 0027' (#9) from hands/static-carry-mode-0444 into main 2026-11-14 08:44:31 +00:00
d13d98a083 Carry comment: the web server reads the file, no verifier enforces it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 08:44:30 +00:00
6c34758a30 Static release carry: explicit 0444 under UMask 0027
The carry file was created with .mode(0o444), which the service's UMask=0027
masks to 0440; www-data could not read it and the sealed-tree verifier
rejected it. Set the permissions on the open handle before the rename, and
prove it in a child process under umask 0027.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 08:21:12 +00:00
17edea299e Merge pull request 'Routing proof waits out nginx's reload handoff and names who answered' (#8) from hands/routing-proof-handoff into main 2026-11-14 04:28:18 +00:00
506df0a81f Merge pull request 'Liveness gates presence: route challenge and topology refresh only for a running incarnation' (#7) from hands/liveness-gates-presence into main 2026-11-14 04:28:06 +00:00
eace76870a Pin liveness cut: truthful past-due status, dead-topology test reaches its gate, report-once and empty-lease pins
Status says how overdue a route challenge is, not a cause it cannot see.
The dead-generation topology test engages the lifecycle brake so every tick
reaches the gate. New pins: observe/lease/demotion/stale-incarnation/projection
repair said once and cleared; a running target with an empty lease is not
route challenged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 03:38:14 +00:00
c30f89f0df Pin the route handoff window, cadence, signer label and unchanged-route guard
The handoff loop reads its clock through a test-held virtual clock, so the
window and poll cadence are asserted exactly and no host load moves them; the
fails-at-once tests assert through stable_hits and the absence of sleeps.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 03:19:57 +00:00
47a9c3d89e Liveness cut: say lasting observe/lease/demotion faults once, mark a past-due route as waiting on a running incarnation
Applies Soul findings to cut-liveness-gates-presence: report_once+clear_fault
for the remaining per-tick eprintln sites in supervise_one_admitted_generation,
status marks a past-due challenge, tests for the unreadable-fragment and
HostUnobservable paths, F8 marked resolved in route-continuity-cut.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 03:02:47 +00:00
cdf987730e Routing proof waits out nginx's reload handoff and names who answered
systemctl reload only signals nginx's master; old workers keep answering
the stable listener until the new config is parsed and they are told to
quit, so Idunn's first challenge could reach the incumbent and fail the
attempt, rolling the fragment back. An answer naming the preflight's
incumbent instance is now not-yet for 10 s (one challenge per 250 ms,
never admitting, never actuating). Every failed proof now carries a
RouteProofAnswer context: the runtime instance and activation signer ids
the answer claimed (unauthenticated, ids only, 96 bytes each), so the
journal line and abort last_error say who answered.

Tests drive Routing through the stub runtime with incumbent-first,
never-lets-go, foreign-activation and stranger replies.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 02:39:27 +00:00
8dd9f8d503 Liveness gates presence: route challenge and topology refresh run only for an observed-running incarnation
Cut the pre-liveness route and topology supervision and the pre-challenge lease verdict; re-insert both calls after the running-branch incident close, with report_once and clear_fault per target. Rewrite the dead-unit test, add four tests, point the routed fixture's lifecycle brake store into the world.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 02:23:49 +00:00
7eae1c4ee1 Say why the stable route proof failed (#6) 2026-11-14 01:34:34 +00:00
4 changed files with 1128 additions and 79 deletions

View file

@ -390,6 +390,8 @@ read-only command on Yggdrasil on 2026-09-29. Nothing was written to the host.
(`:3670`, `:3715`), and topology refresh (`:3780`). After three refused
continuity restarts, supervision stops restarting (`:3522-3528`) but keeps
supervising the route of a dead incarnation. Read.
Resolved by `cut-liveness-gates-presence`: route challenge and topology
refresh now run only for an incarnation observed running.
- F9. The continuity restart limit counts refused restarts per generation
(`is_refused_restart`, `:3469-3488`). A restart that succeeds admits a new
generation and resets the count. A unit that starts, is admitted, and then

File diff suppressed because it is too large Load diff

View file

@ -762,7 +762,7 @@ impl StaticReleasePort for FilesystemStaticRelease {
binding: &StaticReleaseBinding,
release_id: &str,
) -> Result<StaticFlip> {
use std::os::unix::fs::{OpenOptionsExt, symlink};
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt, symlink};
// Everything up to and including the rename can refuse, and only that
// refuses: the link has not moved when `FlipRefused` is returned.
@ -823,6 +823,10 @@ impl StaticReleasePort for FilesystemStaticRelease {
.create_new(true)
.mode(0o444)
.open(&temporary_carry)?;
// The creation mode is masked by the service's umask
// (UMask=0027 yields 0440), and the web server reads this file
// as "other"; say 0444 on the open handle.
file.set_permissions(fs::Permissions::from_mode(0o444))?;
file.write_all(&bytes)?;
file.sync_all()?;
fs::rename(&temporary_carry, &carried)?;
@ -17045,6 +17049,43 @@ processes 9
Ok(())
}
/// The service runs with UMask=0027, which masks the create mode to 0440
/// and hides the carry from the web user. The umask is process-global, so
/// the proof runs in a child copy of this test binary and no sibling test
/// ever sees it.
#[cfg(unix)]
#[test]
fn static_release_carry_is_0444_under_the_service_umask() -> Result<()> {
use std::os::unix::fs::PermissionsExt;
const CHILD: &str = "IDUNN_TEST_CARRY_UMASK_CHILD";
const NAME: &str = "static_release_carry_is_0444_under_the_service_umask";
if std::env::var_os(CHILD).is_none() {
let path = format!("{}::{NAME}", module_path!().split_once("::").map_or("", |(_, rest)| rest));
let output = std::process::Command::new(std::env::current_exe()?)
.args(["--exact", path.as_str(), "--nocapture", "--test-threads=1"])
.env(CHILD, "1")
.output()?;
assert!(
output.status.success(),
"child under umask 0027 failed:\n{}\n{}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);
assert!(
String::from_utf8_lossy(&output.stdout).contains("1 passed"),
"the child filter matched no test:\n{}",
String::from_utf8_lossy(&output.stdout)
);
return Ok(());
}
unsafe { libc::umask(0o027) };
let site = stand_in_site()?;
FilesystemStaticRelease.carry_and_flip(&site.binding, RELEASE_A)?;
let carried = site.binding.current_link.join("config.json");
assert_eq!(fs::metadata(&carried)?.permissions().mode() & 0o777, 0o444);
Ok(())
}
#[cfg(unix)]
#[test]
fn static_release_missing_site_config_fails_before_the_link_moves() -> Result<()> {

View file

@ -304,7 +304,7 @@ fn lifecycle_brake_status(options: &BTreeMap<String, String>) -> Result<()> {
Ok(())
}
fn replace_lifecycle_brake(path: &Path, record: IdunnLifecycleBrakeRecord) -> Result<()> {
pub(crate) fn replace_lifecycle_brake(path: &Path, record: IdunnLifecycleBrakeRecord) -> Result<()> {
record.validate()?;
let store = SingleFileMessagePackBackingStore::new(path);
let entries = store.pull_all_read_only_snapshot()?;