{ "pack_id": "loops-schedules-and-heuristics", "title": "Loops schedules and heuristics", "version": "0.1.0", "summary": "A collection of nouns and verbs for inert window-keyed schedule compilation, fragility half-life urgency ranking, AIMD claim pacing, UCB1 anti-stall bandit loops, seven-tier compute resource cascades and six advice-only swappable learners.", "dependencies": [ "configuration-grids-and-bounds", "freshness-checks", "partner-compute-cascade", "cost-optimization", "decomposition-patterns" ], "boundaries": [ "Schedule nouns remain strictly inert data (auto_enqueued false) and never start competing background daemons.", "Due-window checks perform zero storage I/O outside the active due window or past stop_at deadlines.", "Swappable learners emit advice_only recommendations with keep_baseline_valid true and block contributor-restricted training traces.", "Importing the pack writes nothing, enqueues nothing and installs no code." ], "nouns": [ { "slug": "pack", "category": "noun.skill_pack", "role": "pack", "title": "A collection of nouns and verbs for inert window-keyed schedule compilation, fragility half-life urgency ranking, AIMD claim pacing, UCB1 anti-stall bandit loops, seven-tier compute resource cascades and six advice-only swappable learners", "value": { "lets_workers": "Compile inert Schedule Nouns into deterministic window-keyed idempotency keys with hash-seeded jitter, zero-I/O due-window gates, stop_at deadlines, exponential backoff and systemd --user templates, rank stale work via fragility half-life urgency, pace claims with AIMD fair-share control, prevent search plateaus via UCB1 plus tombstone suppression, route tasks across a 7-tier compute cascade and evaluate six advice-only swappable learners.", "flow": [ { "verb": { "$verb": "loops-schedules-and-heuristics.compile-inert-schedule-and-aimd-pacing" }, "when": "Evaluate inert schedule windows, fragility half-life urgency rankings, AIMD claim concurrency and optional systemd --user unit templates." }, { "verb": { "$verb": "loops-schedules-and-heuristics.step-bandit-anti-stall-and-compute-cascade" }, "when": "Select UCB1 + empirical-Bayes arms with tombstone suppression and plateau query mutation, and pick the minimum-cost valid compute tier." }, { "verb": { "$verb": "loops-schedules-and-heuristics.evaluate-swappable-learner-advisors" }, "when": "Run the six advice_only swappable learners while preserving deterministic baseline validity and family-grouped rights-cleared splits." } ], "guardrails": [ { "$pin": "guardrail.inert-schedules-and-zero-off-window-io" }, { "$pin": "guardrail.advice-only-learners-and-rights-cleared-splits" } ], "tool": { "$pin": "tool.loops-schedules" }, "worked_example": "Synthetic hourly schedule, fragility urgency, AIMD pacing, 3-arm tombstone-filtered UCB1 loop, 7-tier compute cascade and 6-learner bundle recomputed in test_loops_schedules.py: enforces auto_enqueued false and 0 storage I/O outside due windows, halves AIMD concurrency from 6 to 3 on elevated EWMA latency, suppresses tombstoned arm.refuted-regex while detecting a 3-wave plateau, selects 0_code_shim for AST checks and 3_serverless_gpu_credit for 40k-token confidential synthesis, and splits public permissive traces by task_family_id with 0 overlap while blocking contributor-restricted and secret traces." }, "relations": [ [ "requires_noun", "guardrail.inert-schedules-and-zero-off-window-io" ], [ "requires_noun", "guardrail.advice-only-learners-and-rights-cleared-splits" ], [ "requires_noun", "spec.schedules-bandit-and-seven-tier-cascade" ], [ "requires_noun", "rules.six-swappable-learners" ], [ "requires_noun", "tool.loops-schedules" ], [ "requires_noun", "template.loops-schedules-receipt" ] ] }, { "slug": "guardrail.inert-schedules-and-zero-off-window-io", "category": "noun.skill_pack", "role": "guardrail", "title": "Guardrail: schedule nouns stay inert (auto_enqueued false) and perform zero storage I/O outside active due windows", "category_reason": "Prevents runaway background schedulers and eliminates wasted polling I/O.", "value": { "rule": "Schedule nouns claiming auto_enqueued true are rejected, and window checks outside due_start..due_end or at/after stop_at_epoch_seconds return due false with storage_io_ops 0.", "how_it_is_checked": "DeclarativeScheduleAndCadenceCompiler.evaluate_schedule_window raises on auto_enqueued true and returns storage_io_ops 0 off-window." } }, { "slug": "guardrail.advice-only-learners-and-rights-cleared-splits", "category": "noun.skill_pack", "role": "guardrail", "title": "Guardrail: swappable learners remain advice-only with valid baselines and rights-cleared family-disjoint splits", "category_reason": "Ensures disabling any learner leaves deterministic baselines intact and blocks restricted or leaking training traces.", "value": { "rule": "Every learner stamps advice_only true and keep_baseline_valid true, and rights_cleared_training_manifest blocks contributor-restricted, secret-bearing, non-public or unapproved-license traces while grouping splits by task_family_id.", "how_it_is_checked": "SwappableLearnerAdvisors verifies zero family overlap between train_trace_ids and holdout_trace_ids." } }, { "slug": "spec.schedules-bandit-and-seven-tier-cascade", "category": "noun.benchmark_suite", "role": "spec", "title": "Specification: window idempotency keys, fragility half-life decay, AIMD pacing, UCB1 anti-stall and 7-tier compute cascade", "category_reason": "Defines deterministic equations and ordered compute tiers governed by default_grid_spec.json.", "value": { "idempotency_key_format": "schedule::", "fragility_urgency_formula": "freshness = 0.5 ** (age_hours / half_life_hours); urgency = importance * (1 - freshness)", "compute_cascade_tiers": [ "0_code_shim", "1_local_edge_small", "2_free_dual_t4_batch", "3_serverless_gpu_credit", "4_fast_lora_credit", "5_high_tpm_open_weights", "6_frontier_escalate" ] } }, { "slug": "rules.six-swappable-learners", "category": "noun.reflex_procedure", "role": "rules", "title": "Reference rules for the six advice-only swappable learners", "category_reason": "Zero-model reference evaluators advising workers without replacing deterministic gates.", "value": { "learners": [ "phrasing_acceptance_uplift", "searchability_scent_ranker", "shim_injection_matched_uplift", "decomposition_split_breakeven", "pairwise_taste_bradley_terry", "rights_cleared_training_manifest" ], "advice_only": true, "keep_baseline_valid": true, "model_calls": 0 } }, { "slug": "tool.loops-schedules", "category": "noun.code_node", "role": "tool_card", "title": "Tool card: standard-library DeclarativeScheduleAndCadenceCompiler, BanditAntiStallLoopAndResourceHeuristic and SwappableLearnerAdvisors", "category_reason": "Tested Python 3.10+ standard-library package pinned by path and SHA-256.", "value": { "name": "loops schedules and heuristics", "code": { "$code": "loops-schedules-and-heuristics" }, "runtime": "Python 3.10 or later, standard library only.", "commands": [ "python3 -m loops_schedules --bundle BUNDLE.json" ], "does": [ "Compiles inert Schedule Nouns into window-keyed idempotency keys, systemd --user templates, fragility urgency ranks and AIMD claim pacing.", "Runs UCB1 + empirical-Bayes arm selection with tombstone suppression, stall-wave query mutation and 7-tier compute cascade selection.", "Evaluates all six advice-only swappable learners including Bradley-Terry taste ranking and family-grouped rights-cleared manifests." ], "does_not": [ "Spawn background daemons, perform storage I/O outside due windows, admit contributor-restricted traces or embed magic numbers." ], "code_license": "MIT" }, "relations": [ [ "verifies", "spec.schedules-bandit-and-seven-tier-cascade" ] ] }, { "slug": "template.loops-schedules-receipt", "category": "noun.scene_recipe", "role": "template", "title": "Template: inert schedule window, fragility urgency, AIMD pacing, UCB1 anti-stall, 7-tier cascade and 6-learner receipt", "value": { "describes": "a deterministic receipt of schedule window idempotency, off-window I/O count, urgency top item, AIMD concurrency, UCB1 anti-stall arm, 7-tier compute choices and 6 advice-only learner outputs", "schema": { "type": "object", "additionalProperties": false, "required": [ "schedule_auto_enqueued", "due_window_idempotency_key", "due_window_active", "outside_window_storage_io_ops", "top_urgent_item_id", "aimd_next_concurrency", "aimd_action", "selected_arm_id", "suppressed_arm_ids", "plateau_detected", "tier_decisions", "all_learners_advice_only", "learner_headlines", "cleared_train_trace_ids", "cleared_holdout_trace_ids", "blocked_trace_ids", "family_overlap_count" ], "properties": { "schedule_auto_enqueued": { "type": "boolean" }, "due_window_idempotency_key": { "type": "string" }, "due_window_active": { "type": "boolean" }, "outside_window_storage_io_ops": { "type": "integer", "const": 0 }, "top_urgent_item_id": { "type": "string" }, "aimd_next_concurrency": { "type": "integer", "minimum": 1 }, "aimd_action": { "type": "string" }, "selected_arm_id": { "type": "string" }, "suppressed_arm_ids": { "type": "array", "items": { "type": "string" } }, "plateau_detected": { "type": "boolean" }, "tier_decisions": { "type": "object", "additionalProperties": false, "required": [ "ast_conformance_gate", "confidential_synthesis" ], "properties": { "ast_conformance_gate": { "type": "string" }, "confidential_synthesis": { "type": "string" } } }, "all_learners_advice_only": { "type": "boolean", "const": true }, "learner_headlines": { "type": "object", "additionalProperties": false, "required": [ "phrasing", "top_scent", "shim_uplift", "decomposition", "top_bradley_terry" ], "properties": { "phrasing": { "type": "string" }, "top_scent": { "type": "string" }, "shim_uplift": { "type": "string" }, "decomposition": { "type": "string" }, "top_bradley_terry": { "type": "string" } } }, "cleared_train_trace_ids": { "type": "array", "items": { "type": "string" } }, "cleared_holdout_trace_ids": { "type": "array", "items": { "type": "string" } }, "blocked_trace_ids": { "type": "array", "items": { "type": "string" } }, "family_overlap_count": { "type": "integer", "const": 0 } } }, "example": { "schedule_auto_enqueued": false, "due_window_idempotency_key": "schedule:fragility-recheck-hourly:1970-01-01T02:00:00Z", "due_window_active": true, "outside_window_storage_io_ops": 0, "top_urgent_item_id": "item.decaying-benchmark", "aimd_next_concurrency": 3, "aimd_action": "multiplicative_decrease", "selected_arm_id": "arm.structured-ast", "suppressed_arm_ids": [ "arm.refuted-regex" ], "plateau_detected": true, "tier_decisions": { "ast_conformance_gate": "0_code_shim", "confidential_synthesis": "3_serverless_gpu_credit" }, "all_learners_advice_only": true, "learner_headlines": { "phrasing": "adopt_candidate_phrasing", "top_scent": "scent.precise", "shim_uplift": "retain_shim", "decomposition": "split_into_dag", "top_bradley_terry": "template.compact" }, "cleared_train_trace_ids": [ "trace.public-a1", "trace.public-a2" ], "cleared_holdout_trace_ids": [ "trace.public-h1", "trace.public-h2" ], "blocked_trace_ids": [ "trace.contrib-blocked", "trace.secret-blocked" ], "family_overlap_count": 0 } } }, { "slug": "example.loops-schedules-bundle", "category": "noun.eval_run", "role": "example", "synthetic": true, "title": "Worked example input: synthetic inert schedule, fragility items, AIMD probe, bandit arms, compute workloads and 6 learner inputs", "category_reason": "Synthetic fixture recomputed by test_loops_schedules.py.", "value": { "schedule_noun": { "schedule_id": "fragility-recheck-hourly", "auto_enqueued": false, "cadence_seconds": 3600, "max_jitter_seconds": 0, "due_window_width_seconds": 300, "stop_at_epoch_seconds": 86400, "consecutive_low_yield_windows": 0 }, "due_probe_epoch": 7230, "outside_window_epoch": 8500, "fragility_items": [ { "item_id": "item.recent-pin", "age_hours": 2.0, "half_life_hours": 48.0, "importance": 0.9 }, { "item_id": "item.decaying-benchmark", "age_hours": 48.0, "half_life_hours": 24.0, "importance": 0.95 } ], "aimd_probe": { "current_concurrency": 6, "prev_ewma_latency_ms": 950.0, "observed_latency_ms": 1300.0, "total_pool_slots": 24, "active_peer_workers": 3, "had_throttle_error": false }, "bandit_probe": { "arms": [ { "arm_id": "arm.refuted-regex", "pulls": 4, "reward_sum": 3.5, "signature": "tombstone:refuted01" }, { "arm_id": "arm.structured-ast", "pulls": 12, "reward_sum": 10.5 }, { "arm_id": "arm.shallow-grep", "pulls": 12, "reward_sum": 2.0 } ], "consecutive_zero_yield_waves": 3, "base_query": "audit parameter bounds", "negative_tombstones": [ "tombstone:refuted01" ] }, "compute_workloads": [ { "workload_id": "ast_conformance_gate", "deterministic_eligible": true, "required_capability_rank": 1, "required_context_tokens": 4096, "required_tpm": 5000, "estimated_total_tokens": 8000, "remaining_spend_cap_usd": 0.0, "privacy_tier": "confidential" }, { "workload_id": "confidential_synthesis", "deterministic_eligible": false, "required_capability_rank": 4, "required_context_tokens": 40000, "required_tpm": 150000, "estimated_total_tokens": 20000, "remaining_spend_cap_usd": 0.05, "privacy_tier": "confidential" } ], "learners_input": { "phrasing": { "baseline_trials": 12, "baseline_accepts": 6, "candidate_trials": 12, "candidate_accepts": 11 }, "scent_candidates": [ { "candidate_id": "scent.precise", "text": "window idempotency aimd pacing fragility urgency" }, { "candidate_id": "scent.generic", "text": "miscellaneous helper utilities and notes" } ], "scent_queries": [ "idempotency aimd fragility" ], "shim_strata": [ { "pairs": 25, "unshimmed_pass_rate": 0.56, "shimmed_pass_rate": 0.8, "extra_shim_tokens": 120 } ], "decomposition": { "single_pass_prob": 0.42, "subtask_pass_prob": 0.88, "subtask_count": 2 }, "pairwise_comparisons": [ { "winner": "template.compact", "loser": "template.verbose" }, { "winner": "template.compact", "loser": "template.verbose" }, { "winner": "template.verbose", "loser": "template.unstructured" } ], "training_traces": [ { "trace_id": "trace.contrib-blocked", "task_family_id": "fam.01", "contributor_restricted": true, "privacy_tier": "public", "license": "MIT" }, { "trace_id": "trace.secret-blocked", "task_family_id": "fam.02", "contributor_restricted": false, "contains_secrets": true, "privacy_tier": "public", "license": "MIT" }, { "trace_id": "trace.public-a1", "task_family_id": "fam.alpha", "contributor_restricted": false, "privacy_tier": "public", "license": "MIT" }, { "trace_id": "trace.public-a2", "task_family_id": "fam.alpha", "contributor_restricted": false, "privacy_tier": "public", "license": "MIT" }, { "trace_id": "trace.public-h1", "task_family_id": "fam.group-5", "contributor_restricted": false, "privacy_tier": "public", "license": "Apache-2.0" }, { "trace_id": "trace.public-h2", "task_family_id": "fam.group-5", "contributor_restricted": false, "privacy_tier": "public", "license": "Apache-2.0" } ] }, "shows": "Synthetic inert schedule, fragility urgency, AIMD pacing, tombstone-filtered UCB1 loop, 7-tier cascade and 6 advice-only learners.", "source": "Synthetic. Written for this pack." } }, { "slug": "example.loops-schedules-receipt", "category": "noun.eval_run", "role": "example", "synthetic": true, "title": "Worked example output: recomputed schedule window, urgency, AIMD pacing, UCB1 loop, 7-tier cascade and 6-learner receipt", "category_reason": "Synthetic receipt verified by test_loops_schedules.py.", "value": { "conforms_to": { "$pin": "template.loops-schedules-receipt" }, "instance": { "schedule_auto_enqueued": false, "due_window_idempotency_key": "schedule:fragility-recheck-hourly:1970-01-01T02:00:00Z", "due_window_active": true, "outside_window_storage_io_ops": 0, "top_urgent_item_id": "item.decaying-benchmark", "aimd_next_concurrency": 3, "aimd_action": "multiplicative_decrease", "selected_arm_id": "arm.structured-ast", "suppressed_arm_ids": [ "arm.refuted-regex" ], "plateau_detected": true, "tier_decisions": { "ast_conformance_gate": "0_code_shim", "confidential_synthesis": "3_serverless_gpu_credit" }, "all_learners_advice_only": true, "learner_headlines": { "phrasing": "adopt_candidate_phrasing", "top_scent": "scent.precise", "shim_uplift": "retain_shim", "decomposition": "split_into_dag", "top_bradley_terry": "template.compact" }, "cleared_train_trace_ids": [ "trace.public-a1", "trace.public-a2" ], "cleared_holdout_trace_ids": [ "trace.public-h1", "trace.public-h2" ], "blocked_trace_ids": [ "trace.contrib-blocked", "trace.secret-blocked" ], "family_overlap_count": 0 }, "shows": "Recomputes window idempotency, 0 off-window storage I/O, AIMD halving, tombstone suppression, 7-tier selection and 0-overlap family-grouped holdout splits.", "source": "Synthetic. Recomputed directly from example.loops-schedules-bundle." }, "relations": [ [ "derives_from", "example.loops-schedules-bundle" ], [ "verifies", "template.loops-schedules-receipt" ] ] } ], "verbs": [ { "slug": "compile-inert-schedule-and-aimd-pacing", "kind": "verb.recheck_fragility", "title": "Compile inert schedule windows, rank fragility half-life urgency and pace claims via AIMD", "claimant": "agent", "model_use": "none", "summary": "Derive deterministic window-keyed idempotency keys and jitter from inert Schedule Nouns with zero off-window storage I/O, rank fragile artifacts by half-life decay and adjust claim concurrency via AIMD.", "outcome": "Deterministic schedule window check, fragility urgency ranking and AIMD concurrency target.", "ready_outcome": "schedule_and_pacing_compiled", "pinned": [ "spec.schedules-bandit-and-seven-tier-cascade", "guardrail.inert-schedules-and-zero-off-window-io", "tool.loops-schedules" ], "slots": [ { "name": "schedule_and_pacing_bundle", "category": "noun.eval_run", "description": "Pin of inert Schedule Noun, fragility items and AIMD latency observations." } ], "produces": [ { "name": "schedule_pacing_receipt", "template": "template.loops-schedules-receipt" } ], "steps": [ "Reject auto_enqueued true, compute schedule:: and enforce zero storage I/O outside due windows or past stop_at.", "Rank items by importance * (1 - 0.5 ** (age_hours / half_life_hours)) and update AIMD claim concurrency under fair-share caps." ], "acceptance": [ { "id": "inert-schedule-and-zero-off-window-io", "check": "DeclarativeScheduleAndCadenceCompiler enforces auto_enqueued false and returns storage_io_ops 0 outside active due windows.", "method": "deterministic" } ] }, { "slug": "step-bandit-anti-stall-and-compute-cascade", "kind": "verb.situate", "title": "Select UCB1 anti-stall arms with tombstone suppression and route workloads across the 7-tier compute cascade", "claimant": "agent", "model_use": "none", "summary": "Score non-tombstoned exploration arms via empirical-Bayes shrinkage plus UCB1, mutate stalled queries after consecutive zero-yield waves and select the minimum-cost valid compute tier.", "outcome": "Selected bandit arm, anti-stall query mutation and minimum-cost valid compute tier.", "ready_outcome": "loop_and_tier_selected", "pinned": [ "spec.schedules-bandit-and-seven-tier-cascade", "tool.loops-schedules" ], "slots": [ { "name": "bandit_and_compute_bundle", "category": "noun.eval_run", "description": "Pin of arm reward histories, tombstones and workload resource constraints." } ], "produces": [ { "name": "loop_tier_receipt", "template": "template.loops-schedules-receipt" } ], "steps": [ "Filter arms matching negative_tombstones, score empirical-Bayes UCB1 indices and mutate queries when zero-yield waves hit stall_wave_limit.", "Evaluate 0_code_shim through 6_frontier_escalate against spend, TPM, context and privacy caps to pick the lowest-cost valid tier." ], "acceptance": [ { "id": "tombstone-suppression-and-minimum-cost-tier", "check": "BanditAntiStallLoopAndResourceHeuristic suppresses tombstoned arms and chooses the lowest-cost valid compute tier.", "method": "deterministic" } ], "follows": [ "loops-schedules-and-heuristics.compile-inert-schedule-and-aimd-pacing" ] }, { "slug": "evaluate-swappable-learner-advisors", "kind": "verb.verify_gate", "title": "Evaluate the six advice-only swappable learners and enforce family-disjoint rights-cleared training manifests", "claimant": "agent", "model_use": "none", "summary": "Run deterministic reference advisors for phrasing uplift, searchability scent, matched shim uplift, decomposition breakeven, Bradley-Terry taste ranking and rights-cleared family-grouped training splits.", "outcome": "Verified advice-only learner recommendations and family-disjoint rights-cleared manifest.", "ready_outcome": "learners_evaluated", "review": "distinct_reviewer", "pinned": [ "spec.schedules-bandit-and-seven-tier-cascade", "rules.six-swappable-learners", "guardrail.advice-only-learners-and-rights-cleared-splits", "tool.loops-schedules", "template.loops-schedules-receipt" ], "slots": [ { "name": "learner_evaluation_bundle", "category": "noun.eval_run", "description": "Pin of candidate phrasing, scent, shim strata, decomposition, pairwise comparisons and trace manifests." } ], "produces": [ { "name": "learner_advisor_receipt", "template": "template.loops-schedules-receipt" } ], "steps": [ "Evaluate all six swappable learners with advice_only true and keep_baseline_valid true.", "Block contributor-restricted, secret-bearing, non-public or unapproved-license traces and partition cleared traces by task_family_id." ], "acceptance": [ { "id": "advice-only-and-zero-family-leakage", "check": "SwappableLearnerAdvisors sets advice_only true on all six outputs, blocks restricted traces and yields family_overlap_count 0.", "method": "deterministic" } ], "follows": [ "loops-schedules-and-heuristics.step-bandit-anti-stall-and-compute-cascade" ] } ] }