manna: written by the system's own hand each morning; Friday's double stands on Shabbat

Shemot 16: dvar yom b'yomo, and on the sixth day double, and none on the
seventh. Every night at 00:00Z the day's provision went stale and the
readiness probe failed until someone woke — 13.5 hours on 2026-10-15.
CronJob `manna` (deploy/k8s/manna-cronjob.yaml) runs at 00:01Z Sunday to
Friday in our own korban-processor image, mounts the manna PVC as the
app's uid, and writes today.json from the ConfigMap's MANNA_* amounts —
doubled on Friday, valid to Sunday 00:30Z. The pipeline now accepts
Friday's `double` on Saturday (validate_date/3) and nothing else across a
day boundary; three tests. The kohen sets the amounts, may still write by
hand, and reads a failed job as the Day-4 alarm (KOHEN "The manna, each
morning"; Tamid §1.1). Doorpost re-pinned. Elixir green.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Scott KarpandClaude Fable 5.1 committed 2026-10-15 15:01:57 +00:00
1 parent 1a069cf62d
commit 42024279b9
7 files changed
+189 -10

No files matched your search

+1 -1
View File
@@ -180,7 +180,7 @@ defmodule VavPipeline.Doorpost do
# changes; the update is a deliberate operator commit. A bare
# hash-update commit (without a corresponding spec change in the
# same commit) is itself a drift signal.
@expected_hash "10735ab4e4280bf35d19d6ed79804c31d5ef199a70a289f455e138085e9cba5d"
@expected_hash "65bf08fc3c22307eb10ea6833ddeb475b1f6d87f145901e8d1b426c544c523be"
@doc "Return the list of files that constitute the category-grade specification."
@spec files() :: [String.t()]
+18 -8
View File
@@ -253,7 +253,7 @@ defmodule VavPipeline.Manna do
end
defp validate_manna(data, now) do
with {:ok, date} <- validate_date(data["date"], now),
with {:ok, date} <- validate_date(data["date"], now, parse_type(data["type"])),
{:ok, provision} <- validate_provision(data["provision"]),
{:ok, expires_at} <- parse_expires_at(data["expires_at"]),
:ok <- check_expiry(expires_at, now) do
@@ -269,15 +269,25 @@ defmodule VavPipeline.Manna do
end
end
defp validate_date(nil, _now), do: {:error, "MANNA_INVALID: missing date"}
defp validate_date(nil, _now, _type), do: {:error, "MANNA_INVALID: missing date"}
defp validate_date(date_str, now) do
today = DateTime.to_date(now) |> Date.to_iso8601()
# A provision is for its day — except the double portion: gathered on
# Friday, it is the Shabbat's too (Shemot 16:22–26), so Friday's
# `double` stands on Saturday. Nothing else carries over the boundary.
defp validate_date(date_str, now, type) do
today = DateTime.to_date(now)
today_str = Date.to_iso8601(today)
yesterday = Date.add(today, -1)
if date_str == today do
{:ok, date_str}
else
{:error, "MANNA_STALE: provision is for #{date_str}, today is #{today}"}
cond do
date_str == today_str ->
{:ok, date_str}
type == :double and Date.day_of_week(today) == 6 and date_str == Date.to_iso8601(yesterday) ->
{:ok, date_str}
true ->
{:error, "MANNA_STALE: provision is for #{date_str}, today is #{today_str}"}
end
end