Repository navigation
Description
Problem
pkgs/id/src/world_manifest.rs — WorldManifest::validate() (lines 216–256) refuses:
- a schedule with
at_ms == 0("must fire in the future", line 236), - more than
MAX_PENDING_SCHEDULES(64) schedules (lines 229–233), - a
module_hashthat is not 1..=64 hex digits (lines 244–255), - a profile whose bounds fail
WorldExecutionProfile::validate()(line 227:wasm_fuel == Some(0), memory below the floors, etc.).
apply() (lines 373–424) is documented as the defensive re-check ("A step that names an unknown capability (a manifest should be validated first; this is a defensive re-check)"), and it does re-check two step kinds — SetGrants/SetCeiling re-run validate_grant_names/validate_ceiling_names (lines 386, 394) and ScheduleAt re-runs validate_schedule_id (line 405). But the other step kinds get no re-check at all:
ScheduleAtacceptsat_ms == 0and folds any number of schedules into state, past the 64 cap.SetProfileaccepts a profile thatprofile.validate()refuses (e.g.wasm_fuel: Some(0)).InstallModuleaccepts a non-hex, over-long, or emptyhashand stores it as the live module hash.
So a step list that did not come from a validated manifest (programmatic construction, a future caller, a deserialized plan) can fold a state that parse/validate would never let a manifest describe — and apply's own changed-count then reports it as a successful reconciliation. The re-check is inconsistent: either it is load-bearing (then it should cover every invariant validate() enforces) or it is decoration on exactly the fields that happen to have a helper handy.
Evidence (verified this run, origin/main a8aa52d)
Laptop probe (worktree ~/git/fleet/probe-2026-11-02-laneA-scan7, pkgs/id/tests/probe_manifest_apply.rs against the real id crate, cargo test, probe removed after the run):
apply([ScheduleAt { id: "wake", at_ms: 0 }])→ Ok(1), schedule stored with fire time 0.apply([SetProfile { wasm_fuel: Some(0), .. }])→ Ok(1), profile stored.apply([InstallModule { hash: Some("zz!" × 40), source: None, seed: 1 }])→ Ok(1), 120-char non-hex hash stored asmodule_hash.apply(65 distinct ScheduleAt steps)→ Ok, 65 schedules in state (cap is 64).- Control:
apply([SetGrants { grants: ["no.such.cap"] }])→ Err — the re-check exists for grants, confirming the gap is the missing coverage on the sibling steps, not a design of "apply never validates".
Dedup: searches (all states) for world_manifest apply, ApplyStep, and open manifest issues found #2876 (closed; unknown TOML keys), #2882 (closed; check_schedule_replacing cap), #3015/#1519 (cited in the code; parse-time profile validation and seed/ceiling plan semantics). No open or closed issue covers apply()'s partial re-check.
Why it matters
apply is the pure fold the manifest tests and the server-side reconciliation model are checked against; a fold that accepts states the manifest layer forbids makes the model lie about what a live world can look like, and any future caller that builds steps without going through parse inherits the hole silently. The inconsistency is the bug: two of five step kinds re-validate, three do not.
Acceptance criteria
-
applyrefuses aScheduleAtstep withat_ms == 0, naming the schedule id, in the style ofvalidate()line 236. -
applyrefuses a step list that would leave the state with more thanMAX_PENDING_SCHEDULESschedules. -
applyrefuses aSetProfilestep whose profile failsWorldExecutionProfile::validate(). -
applyrefuses anInstallModulestep whosehashis not 1..=64 hex digits (thevalidate()rule at lines 244–255). - Regression tests sit alongside the existing
world_manifesttests covering each refusal above, plus the already-working grant/ceiling/id refusals; valid step lists fold exactly as before (existing tests green, changed-count semantics unchanged for valid input). - No change to
plan()output or toWorldManifest::validate()itself.
Activity
dezren39 commentedon Nov 3, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
Merge pull request #4774 from developing-today/queue/6773-4769-manife…
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
cargo test --lib world_manifest29/29 on the laptop; production-line guard green on PR id(world_manifest): apply() re-checks schedule time/cap, profile, module hash (#4769) #4774. Codex review run failed on the Codex side (usage limits) with zero inline findings — disposition noted on PR id(world_manifest): apply() re-checks schedule time/cap, profile, module hash (#4769) #4774.