Compete Cron Builder
Turn one local question into a bounded proposal competition.
Competition Contract
n workers
m proposals, optional or auto
choose k, optional or auto
or union all valid findings
Inputs:
| Field |
Values or meaning |
task |
Question or work request. |
budget_workers |
Human-provided worker/resource budget. |
proposal_count |
Explicit count or auto. |
choose_count |
Explicit count, auto, or all_valid. |
question_type |
auto, precision, coverage, audit, blueprint, seo, execution_choice, or repair. |
competition_shape |
auto, three_way_challenge, parallel_proposals, coverage_sweep, repair_search, or top_k_synthesis. |
selection_mode |
auto, best_one, top_k, coverage_union, risk_union, vote_then_tiebreak, or repair_queue. |
artifact_layout |
native or old_three_way. |
Possible outputs are candidates, selected plans, repair assignments, coverage
findings, validation hints, and handoff metadata. Candidate outputs are [_]
evidence only; they never write [x]. The execution or looper master lane alone
accepts final completion as [x].
Output Discipline And Anti-Slop Contract
- Start with the requested artifact, finding set, selection, decision, or fact.
- Give each sentence one concrete requirement, observation, decision, action,
result, evidence item, or consequence. Omit process narration, opening
meta-commentary, generic disclaimers, filler, restatements, and closing recaps.
- Report verification only through its result, evidence, and consequence.
- Omit unsupported relationship or causal claims. Handle material uncertainty
under the next rule; leave no speculative transition or placeholder.
- When unresolved uncertainty changes correctness, safety, legality, selection,
or the available action, state the exact unknown, condition, and consequence.
- Include a boundary only when it changes correctness, safety, legality, or the
available action; name the exact constraint and permitted path.
- Use direct, positive statements when truth conditions permit. Preserve
technical negation for exclusions, permissions, safety gates, failure
behavior, and acceptance rules.
- Keep the body within 10% above or below an explicit target length. Without a
target, use the shortest complete form that preserves the artifacts,
evidence, decisions, and consequences.
- Before delivery, silently inspect the text character by character for filler,
duplicated safeguards, unsupported claims, vague predicates, stale
placeholders, fabricated evidence, missing sections, and length. Preserve
the exact spelling of state marks, schema keys, commands, paths, enums,
thresholds, stage names, and validator-dependent strings.
Shared b3ehive Contract
Follow ../looper-cron-builder/references/b3ehive-bridge-contract.md for nested
calls, route selection, auto m/k decisions, evidence handoff, looper_log
capture, ROI, and self-evolution.
Local obligations:
- Every nontrivial automatic
proposal_count, choose_count, shape, selection,
or route choice should leave an EstimatorPolicy or RouteDecision record.
- Coverage and audit runs use all-valid/risk union unless a stronger local
route decision selects another policy.
- Route cost, a missing validator, mis-sized m/k, candidate overlap, scaffold
friction, or tool integration friction produces a
looper_log at skill,
composition, scaffold, tool, or task grain.
- Each
looper_log must identify the decided or covered TargetObject and the
InstrumentObject that produced the signal: competition shape, route,
validator, scaffold, tool, or skill composition.
- A looper-log-derived compete policy change requires EvidenceLint, ROI,
ParetoGate, rollback, and master
[x].
Commands
Run the fully covered old three-agent workflow with compete terminology:
python3 scripts/compete_cron_builder.py \
--task "Improve this module and test the result" \
--output ./competition-runs/manual-test \
--budget-workers 3 \
--competition-shape three_way_challenge \
--artifact-layout old_three_way \
--runner mock \
--max-output-mb 20 \
--min-free-gb 0
Run a coverage competition:
python3 scripts/compete_cron_builder.py \
--task "Find security and validation risks in this API surface" \
--output ./competition-runs/security-sweep \
--budget-workers 6 \
--question-type coverage \
--selection-mode coverage_union \
--choose-count all-valid \
--runner mock
Use --runner command --command '<agent command template>' for a live agent
runner. Template variables available to --command:
{agent_id}: candidate id, such as run_a or proposal_001
{run_id}: the same stable candidate id
{candidate_id}: the same stable candidate id
{stage}: workflow stage
{prompt_file}: generated prompt file
{output_file}: stdout capture path
{competition_id}: manifest run id
{question_type}: resolved question type
{selection_mode}: resolved selection mode
Three-Way Challenge
competition_shape=three_way_challenge resolves to:
candidate_ids = run_a, run_b, run_c
selected_count = 1
selection_mode = vote_then_tiebreak
tie_break = stable_candidate_id
Stages:
proposal: three candidates produce first results.
initial_verification: the verifier checks candidate outputs.
peer_review_round_1: each candidate critiques the other two.
revision_round_1: each candidate revises its own result.
peer_review_round_2: each candidate critiques revised peers and votes.
repair_synthesis: each candidate writes final repair assignments.
artifact_layout=old_three_way preserves:
<output>/
run_a/implementation/
run_b/implementation/
run_c/implementation/
verification.md
best_run.txt
final_repairs.md
summary.md
Each candidate directory contains:
result.md
verification.md
critique_round_1.md
update_round_1.md
critique_round_2.md
final_repair.md
Native manifests and JSON summaries may supplement these artifacts. Under
old_three_way, they do not replace them.
m/k Policy
When the user supplies only worker budget n, resolve proposal and selection
counts from question type:
precision: m=min(n,4), k=1 or 2; choose the best candidate or a
fallback pair.
coverage: bound m by budget, set k=all_valid, and merge valid findings.
audit: bound m by budget, set k=all_valid, and rank risks by severity.
blueprint: m=min(n,5), k=2 or 3; synthesize a blueprint patch.
seo: synthesis for strategy, union for coverage, and repair for execution.
execution_choice: m=min(n,3), k=1; choose one local implementation path.
repair: m=min(n,4); choose a primary repair and fallback.
three_way_challenge: m=3, k=1; vote, then apply the stable tie-break.
Execution Handoff
When embedded in execution-cron-builder, compete preserves the single
authoritative blueprint source and an acyclic DAG. Workers and compete
candidates may produce only proposals or [_] evidence. Compete must never
write [x]; the master alone promotes [_] -> [x]. After master deduplication,
repair and coverage outputs enter the
blueprint as [ ] child items.
Valid handoff actions:
create_child_items
enqueue_integration_hint
write_blueprint_patch_proposal
write_validation_hint
write_repair_assignment
request_master_review
Looper Handoff
When embedded in looper-cron-builder, compete may run only inside an active
ResourceLease with a ParentLeaseRef. Token, wall-clock, human-review, disk,
and diff costs count against the parent lease. Candidate output remains
provisional until the master accepts it in DAG order.
Record a compete-heavy loop with no primary or secondary reward in the
no-reward accumulator. A paused loop requires an explicit resource refund and a
strategy change before resuming.
Nested compete runs cannot write [x], escape the parent lease budget, or
classify final reward. They produce reward candidates only; the parent looper
attempt owns reward classification and ROI accounting.
Nested competition emits looper_log refs for reusable instrument signals,
including excessive proposal overlap, question-type mismatch, unnecessary
model route, missing validator, and inefficient repair-queue shape. Separate
target feedback from instrument feedback so review can distinguish task
difficulty from competition configuration.
Runtime Rules
- Run parallel candidates with all-settled behavior.
- The competition continues when at least one candidate succeeds.
- Zero valid candidates stops the run and writes a failure summary.
- Bound captured output with
--max-output-mb.
- Run the cron space guard before cron-launched competitions.
- Do not let parallel candidates mutate the same authoritative source tree.
- Prefer patches, plans, diffs, findings, or artifacts under candidate output
directories.
- Resolve ties deterministically by stable candidate id.
Reference
Read references/competition-pattern.md when adapting compete to another
runtime, embedding it in execution cron, or wiring it to looper attempts.
1---2name: compete-cron-builder3description: Run or embed a bounded proposal competition for coding, research, planning, coverage, repair, blueprint, SEO, audit, or execution-choice tasks. Use when a task needs n workers, m proposals, choose k, all-valid coverage union, three-way challenge output under run_a/run_b/run_c, verifier checks, peer review, revision, vote selection, repair synthesis, or execution/looper handoff.4---56# Compete Cron Builder78Turn one local question into a bounded proposal competition.910## Competition Contract1112```text13n workers14m proposals, optional or auto15choose k, optional or auto16or union all valid findings17```1819Inputs:2021| Field | Values or meaning |22|---|---|23| `task` | Question or work request. |24| `budget_workers` | Human-provided worker/resource budget. |25| `proposal_count` | Explicit count or `auto`. |26| `choose_count` | Explicit count, `auto`, or `all_valid`. |27| `question_type` | `auto`, `precision`, `coverage`, `audit`, `blueprint`, `seo`, `execution_choice`, or `repair`. |28| `competition_shape` | `auto`, `three_way_challenge`, `parallel_proposals`, `coverage_sweep`, `repair_search`, or `top_k_synthesis`. |29| `selection_mode` | `auto`, `best_one`, `top_k`, `coverage_union`, `risk_union`, `vote_then_tiebreak`, or `repair_queue`. |30| `artifact_layout` | `native` or `old_three_way`. |3132Possible outputs are candidates, selected plans, repair assignments, coverage33findings, validation hints, and handoff metadata. Candidate outputs are `[_]`34evidence only; they never write `[x]`. The execution or looper master lane alone35accepts final completion as `[x]`.3637## Output Discipline And Anti-Slop Contract3839- Start with the requested artifact, finding set, selection, decision, or fact.40- Give each sentence one concrete requirement, observation, decision, action,41 result, evidence item, or consequence. Omit process narration, opening42 meta-commentary, generic disclaimers, filler, restatements, and closing recaps.43- Report verification only through its result, evidence, and consequence.44- Omit unsupported relationship or causal claims. Handle material uncertainty45 under the next rule; leave no speculative transition or placeholder.46- When unresolved uncertainty changes correctness, safety, legality, selection,47 or the available action, state the exact unknown, condition, and consequence.48- Include a boundary only when it changes correctness, safety, legality, or the49 available action; name the exact constraint and permitted path.50- Use direct, positive statements when truth conditions permit. Preserve51 technical negation for exclusions, permissions, safety gates, failure52 behavior, and acceptance rules.53- Keep the body within 10% above or below an explicit target length. Without a54 target, use the shortest complete form that preserves the artifacts,55 evidence, decisions, and consequences.56- Before delivery, silently inspect the text character by character for filler,57 duplicated safeguards, unsupported claims, vague predicates, stale58 placeholders, fabricated evidence, missing sections, and length. Preserve59 the exact spelling of state marks, schema keys, commands, paths, enums,60 thresholds, stage names, and validator-dependent strings.6162## Shared b3ehive Contract6364Follow `../looper-cron-builder/references/b3ehive-bridge-contract.md` for nested65calls, route selection, auto m/k decisions, evidence handoff, `looper_log`66capture, ROI, and self-evolution.6768Local obligations:6970- Every nontrivial automatic `proposal_count`, `choose_count`, shape, selection,71 or route choice should leave an `EstimatorPolicy` or `RouteDecision` record.72- Coverage and audit runs use all-valid/risk union unless a stronger local73 route decision selects another policy.74- Route cost, a missing validator, mis-sized m/k, candidate overlap, scaffold75 friction, or tool integration friction produces a `looper_log` at `skill`,76 `composition`, `scaffold`, `tool`, or `task` grain.77- Each `looper_log` must identify the decided or covered `TargetObject` and the78 `InstrumentObject` that produced the signal: competition shape, route,79 validator, scaffold, tool, or skill composition.80- A looper-log-derived compete policy change requires EvidenceLint, ROI,81 ParetoGate, rollback, and master `[x]`.8283## Commands8485Run the fully covered old three-agent workflow with compete terminology:8687```bash88python3 scripts/compete_cron_builder.py \89 --task "Improve this module and test the result" \90 --output ./competition-runs/manual-test \91 --budget-workers 3 \92 --competition-shape three_way_challenge \93 --artifact-layout old_three_way \94 --runner mock \95 --max-output-mb 20 \96 --min-free-gb 097```9899Run a coverage competition:100101```bash102python3 scripts/compete_cron_builder.py \103 --task "Find security and validation risks in this API surface" \104 --output ./competition-runs/security-sweep \105 --budget-workers 6 \106 --question-type coverage \107 --selection-mode coverage_union \108 --choose-count all-valid \109 --runner mock110```111112Use `--runner command --command '<agent command template>'` for a live agent113runner. Template variables available to `--command`:114115- `{agent_id}`: candidate id, such as `run_a` or `proposal_001`116- `{run_id}`: the same stable candidate id117- `{candidate_id}`: the same stable candidate id118- `{stage}`: workflow stage119- `{prompt_file}`: generated prompt file120- `{output_file}`: stdout capture path121- `{competition_id}`: manifest run id122- `{question_type}`: resolved question type123- `{selection_mode}`: resolved selection mode124125## Three-Way Challenge126127`competition_shape=three_way_challenge` resolves to:128129```text130candidate_ids = run_a, run_b, run_c131selected_count = 1132selection_mode = vote_then_tiebreak133tie_break = stable_candidate_id134```135136Stages:1371381. `proposal`: three candidates produce first results.1392. `initial_verification`: the verifier checks candidate outputs.1403. `peer_review_round_1`: each candidate critiques the other two.1414. `revision_round_1`: each candidate revises its own result.1425. `peer_review_round_2`: each candidate critiques revised peers and votes.1436. `repair_synthesis`: each candidate writes final repair assignments.144145`artifact_layout=old_three_way` preserves:146147```text148<output>/149 run_a/implementation/150 run_b/implementation/151 run_c/implementation/152 verification.md153 best_run.txt154 final_repairs.md155 summary.md156```157158Each candidate directory contains:159160- `result.md`161- `verification.md`162- `critique_round_1.md`163- `update_round_1.md`164- `critique_round_2.md`165- `final_repair.md`166167Native manifests and JSON summaries may supplement these artifacts. Under168`old_three_way`, they do not replace them.169170## m/k Policy171172When the user supplies only worker budget `n`, resolve proposal and selection173counts from question type:174175- `precision`: `m=min(n,4)`, `k=1` or `2`; choose the best candidate or a176 fallback pair.177- `coverage`: bound `m` by budget, set `k=all_valid`, and merge valid findings.178- `audit`: bound `m` by budget, set `k=all_valid`, and rank risks by severity.179- `blueprint`: `m=min(n,5)`, `k=2` or `3`; synthesize a blueprint patch.180- `seo`: synthesis for strategy, union for coverage, and repair for execution.181- `execution_choice`: `m=min(n,3)`, `k=1`; choose one local implementation path.182- `repair`: `m=min(n,4)`; choose a primary repair and fallback.183- `three_way_challenge`: `m=3`, `k=1`; vote, then apply the stable tie-break.184185## Execution Handoff186187When embedded in `execution-cron-builder`, compete preserves the single188authoritative blueprint source and an acyclic DAG. Workers and compete189candidates may produce only proposals or `[_]` evidence. Compete must never190write `[x]`; the master alone promotes `[_] -> [x]`. After master deduplication,191repair and coverage outputs enter the192blueprint as `[ ]` child items.193194Valid handoff actions:195196- `create_child_items`197- `enqueue_integration_hint`198- `write_blueprint_patch_proposal`199- `write_validation_hint`200- `write_repair_assignment`201- `request_master_review`202203## Looper Handoff204205When embedded in `looper-cron-builder`, compete may run only inside an active206`ResourceLease` with a `ParentLeaseRef`. Token, wall-clock, human-review, disk,207and diff costs count against the parent lease. Candidate output remains208provisional until the master accepts it in DAG order.209210Record a compete-heavy loop with no primary or secondary reward in the211no-reward accumulator. A paused loop requires an explicit resource refund and a212strategy change before resuming.213214Nested compete runs cannot write `[x]`, escape the parent lease budget, or215classify final reward. They produce reward candidates only; the parent looper216attempt owns reward classification and ROI accounting.217218Nested competition emits `looper_log` refs for reusable instrument signals,219including excessive proposal overlap, question-type mismatch, unnecessary220model route, missing validator, and inefficient repair-queue shape. Separate221target feedback from instrument feedback so review can distinguish task222difficulty from competition configuration.223224## Runtime Rules225226- Run parallel candidates with all-settled behavior.227- The competition continues when at least one candidate succeeds.228- Zero valid candidates stops the run and writes a failure summary.229- Bound captured output with `--max-output-mb`.230- Run the cron space guard before cron-launched competitions.231- Do not let parallel candidates mutate the same authoritative source tree.232- Prefer patches, plans, diffs, findings, or artifacts under candidate output233 directories.234- Resolve ties deterministically by stable candidate id.235236## Reference237238Read `references/competition-pattern.md` when adapting compete to another239runtime, embedding it in execution cron, or wiring it to looper attempts.