The private draft software-factory/material-timing entry evaluates explicit slots for one material revision, audience and channel. Install the reviewed tarball in a Node 26.8.1 or later ESM application. There are no runtime npm dependencies or Node/DOM declaration requirements. It imports no storage, scheduler, provider or model. The caller supplies time as a value and authenticates the completeness and attribution of all evidence.
Run a synthetic draft example
Save this as timing.mjs and run it in the installed application. The fixed UTC rule table and digests are deliberately synthetic fixtures. They do not qualify a real zone database or prove publication readiness.
import { evaluateMaterialTiming, materialTimingRuleDigest,
parseMaterialTimingRecommendation } from 'software-factory/material-timing';
const digest = `sha256:${'a'.repeat(64)}`;
const scope = { namespace: 'editor', productId: 'sample', materialId: 'draft',
audienceId: 'readers', channelId: 'news-page' };
const source = { id: 'review', revision: 1, contentDigest: digest };
const material = { id: 'draft', revision: 1, contentDigest: digest };
const asOf = '2026-10-01T00:00:00.000Z';
const horizonEnd = '2026-10-01T01:00:00.000Z';
const coverage = { from: '2026-09-29T20:00:00.000Z', until: '2026-10-02T07:00:00.000Z' };
const rules = { zone: 'UTC', databaseVersion: 'synthetic-v1', provenanceDigest: digest,
source, coverage, segments: [{ ...coverage, offsetMinutes: 0 }] };
const inputs = {
protocol: 'sf-material-timing-inputs/1', scope, horizonEnd,
sources: [{ ...source, scope, observedAt: asOf, checkedAt: asOf,
validUntil: '2026-10-02T00:00:00.000Z', validation: 'validated' }],
hardCoverage: { scope, horizon: { from: asOf, until: horizonEnd },
ruleDigest: materialTimingRuleDigest(rules), source,
coverage: { state: 'exact', reasons: [] } },
material: { ...material, kind: 'draft-reminder',
readiness: { state: 'ready', material, source, reason: null },
reviewedContent: null, availability: null, retirement: null },
rules,
audience: { kind: 'policy-only', source: null, populationId: null, window: null,
preferencesDigest: null, coverage: { state: 'unknown', reasons: ['measurement-missing'] } },
embargoes: [], constraints: [],
candidates: [{ id: 'morning', localDate: '2026-10-01', localTime: '00:15',
elapsedDurationMinutes: 10, preference: 0 }],
};
const policy = { protocol: 'sf-material-timing-policy/1', id: 'editor', revision: 1,
scope, validUntil: '2026-10-02T00:00:00.000Z', maxEvidenceAgeMs: 86400000,
maxResultAgeMs: 3600000, fold: 'reject', gap: 'reject', preference: 'lowest-first-with-ties' };
const recommendation = evaluateMaterialTiming(inputs, policy, asOf);
const reopened = parseMaterialTimingRecommendation(JSON.parse(JSON.stringify(recommendation)));
console.log(JSON.stringify({ result: reopened.result, eligible: reopened.eligible }));
The output is an options result containing morning. It requests audience measurement and carries audienceQualification: "policy-only". Nothing reserves a channel, contacts a publisher or grants authority. Persist the returned immutable value yourself; the library performs no writes.
Contract and limits
evaluateMaterialTiming(inputs, policy, asOf) returns a deeply frozen Recommendation. parseMaterialTimingInputs and parseMaterialTimingPolicy validate and copy caller values. parseMaterialTimingRecommendation verifies its digest and recomputes the fixed-v1 result from embedded inputs, policy, rule snapshot and original time. A newly current time or changed evidence requires a new recommendation. materialTimingRuleDigest and materialTimingPreferencesDigest create the two required value bindings; they establish neither authenticity nor audience causality.
Inputs use exact plain JSON. Every Source and policy has the exact namespace/Product/material/audience/channel scope. Facts and readiness pin material ID, revision and content digest. Source refs must resolve exactly; a missing catalogue ref or contradictory identity/time/scope refuses. A well-formed null required fact or unusable source produces unknown. Source signatures, current withdrawal/supersession and inventory completeness belong to the caller; hashes alone prove none of them.
Hard inventory coverage must be exact for [asOf,horizonEnd) and the canonical rule digest, including deliberately empty exclusions/embargoes. Every allowed interval independently contains the whole slot; every positive forbidden overlap excludes it. Touching is allowed. All embargoes are approved notBefore facts. Retirement preserves every independent approval: notice completion plus its explicit minimum must not exceed effectiveAt, and its original recovery interval stays protected. Confirmed availability cannot start after its supporting observation. A planned date stays conditional even after it passes.
Required uncertainty wins over known exclusion, while both reasons and gap/fold witnesses remain. Only fully supported slots can be eligible/conditional; incomplete scope-wide inventory forces an unknown recommendation. Source expiry is the minimum of explicit validity and observedAt plus policy age, expiring at equality. Mandatory facts and policy cover the whole slot. Optional audience support only needs to be current; missing/stale/rejected/partial support falls back to policy-only with measurement, and cannot waive a hard constraint. Unknown slot/recommendation validity is null; known validity is bounded by policy result age and all required support. Preference values are caller policy, with equal values tied.
Pinned rule segments are ordered, contiguous UTC intervals with integer-minute offsets in ±840. Coverage extends 28 hours before/after the horizon and another 120 minutes after its upper end. Every possible local inverse is checked before gap/fold classification. No implicit DST shift is allowed. Folds require reject/earlier/later; rejection retains both alternatives without a selected instant. A third alternative anywhere in the supplied table refuses. Slot duration is elapsed time; the recorded local end may move backwards at a fold. No ambient Intl or current zone database is used. Existing Calendar's separate compatible resolver is unchanged.
MATERIAL_TIMING_LIMITS publishes: 1 MiB input/result, depth 32, 64 slots, 128 sources, 64 combined constraints/embargoes, 32 retirement obligations and 8 segments; 8 coverage reasons. Revisions are 1–1,000,000, preferences 0–100, duration 1–120 minutes, ages 1 millisecond–31 days and approved notice 0–366 days. The horizon is positive and at most 14 elapsed days. Instants/arithmetic endpoints stay within UTC years 2000–2099. IDs have 1–63 lowercase letters/digits/hyphens and begin with a letter/digit; zone names use a separate 1–64 ASCII UTC/slash-name grammar. Zero notice requires an explicit supplied approval. Negative notice and zero/negative policy ages refuse; no defaults silently replace them.
MaterialTimingError has fixed code (INVALID, LIMIT, CONFLICT, CORRUPT), reason and bounded path. Refusal preserves the exact public class. Malformed/oversized/unsupported or structurally contradictory input throws; well-formed insufficient facts remain typed unknown. A bad stored digest or recomputed derived forgery throws CORRUPT. Results refuse overflow rather than truncate. The runtime closure is material-timing/contract, calendar, canonical-json, strict-input and errors, with buffer/crypto builtins. Strict TypeScript consumers require only ES2024 declarations.
Draft qualification
Current scope and evidence: build review. Controlled UTC/gap/fold tables are synthetic; a real resolver must qualify and authenticate its exact source snapshot. Audience measurement, durable proposals, commitments, delivery, publishing and broader E36 acceptance remain separate work. See the package source and adoption limits.
