Skip to content

Latest commit

 

History

History
115 lines (59 loc) · 22.7 KB

parallel-work.md

File metadata and controls

115 lines (59 loc) · 22.7 KB

Organize parallel research when it helps

Delegate only when delegation is exposed and permitted in this session. A useful independent assignment has a concrete question and an inspectable output, such as a source survey with hypothesis mapping, a counterexample search, an exact library declaration, or a separately checked candidate. Account for coordination and duplicated work; do not create tasks solely to keep agents busy.

Give an investigator the original statement and enough definitions and environment context to understand the assigned question. For an independent review, avoid supplying the answer it is expected to endorse. Retain disagreements and check the supporting artifacts before deciding what to integrate.

Persistent proof-writing team

When the host exposes theoremos_team, Lead chooses the decomposition, assignments, route changes and adoption decisions. Children have isolated writable worktrees, the same pinned Skill and their own native threads. A later assignment continues that child's thread and saved sources. Runs have no time, turn or token budget by default; explicitly configured host limits apply to all agents together. The host enforces source ownership, process isolation, persistence and independent proof checks.

Collaboration and math tools

Use the exposed native spawn_agent, followup_task, send_message, list_agents, wait_agent and interrupt_agent tools for collaboration. Native tools own canonical agent paths, sender identity, messaging and turn control. Use absolute paths such as /root for Lead and /root/NAME for peers, or native thread IDs. Workspace member IDs in mathematical host operations are shown separately in team observations.

Both Lead and members can use history, inspect, inspect-research and route_summary. Lead can use finish, adopt and retire_route. Members can use yield and submit.

When the owner requires approval, Lead starts by calling publish_plan with goals: [{theoremName, objective}] covering every original target and optional investigations. Return after publishing. Continue proof work after the host confirms approval. If the owner requests a revision, publish the revised plan.

If the host exposes the published mathematics library, both Lead and members can search it and read exact declaration sources. Send Lead the declaration name and intended application when installation is needed. Lead requests installation so the host can prepare a new frozen continuation.

Native followup supplies further instructions to a busy member, resumes a yielded task with its draft, and assigns work to a member whose last task has finished. The host records these instructions and refreshes selected profile knowledge. Use send_message for findings, route updates and questions, and interrupt_agent to stop a turn while retaining membership and saved work. Members can message peers but only Lead dispatches or interrupts members. A child's final answer is automatically delivered to its parent and remains advisory; save and submit for independent mathematical checking. Mailbox acceptance is not a read receipt, and an unloaded member is not proof completion.

Start and reassess

Use the Lead charter to identify complementary work from the statement and definitions. Scouting and review can start while the route and helper types are open. For formal helper proofs, follow the charter's route check and review, then give the exact type. Name the consumer, the first usable output and the work Lead retains. Use spawn_agent with a self-contained assignment.

When no useful assignment is ready, inspect the relevant definitions, run a focused probe or check an already clear direct proof. Reconsider ownership when a finding, failed check, blocker or new gap creates a useful question. An accepted dispatch records delegation; whether the work is complementary depends on its question and intended consumer. Lead chooses the route, timing and team size within host capacity.

While a member owns a gap, work on its consumer or a different gap and assess findings when they affect the next decision. If the next step needs its result, request the first useful finding or use wait_agent to avoid reproducing the assigned work. An empty team does not call for waiting. Source handoffs require confirmed writer shutdown before integration.

When the host reports a finite remaining run allowance or hard turn deadline, plan investigations, save sources and RESEARCH.md, and return for checking or handoff before cutoff. An explicitly configured hard native-turn limit can interrupt an unfinished provider request even when the overall run has time left. Save useful partial work at natural milestones; use a member's yield when a dependency calls for a resumable handoff.

Organize a flat team around complementary gaps in the current proof effort, with one owner per active obligation. Direct discussion between members can clarify interfaces or challenge assumptions without passing every message through Lead. Different tactics or coordinate systems for the same target still overlap. Explore a specific unresolved route question and report the smallest discriminating finding first; a second complete proof is justified when full independent reconstruction is itself the required evidence. When one member owns the original target in full, Lead handles integration and targeted support or review. Lead remains responsible for assignments, shared route changes and formal adoption, while each member chooses its mathematical approach.

Identity and assignments

The durable identities are Lead and mathematical researchers who can write Lean. Lead may research and prove as well as coordinate. A member's agentId, workspace and thread persist; its expertise and work focus come from the current assignment and can change. Match domain knowledge to the actual missing concept, hypothesis or mathematical tool, and work responsibility to the result needed. A broad subject label is not enough reason to load a profile; a Lean interface failure may need a Library Scout or Debugger rather than more domain reading. Read the selected domain section and relevant linked passage. The expert chooses its reasoning and proof approach. Profiles can be combined or reused when each supplies useful knowledge, without adding workers merely to cover roles.

Make the dispatch message self-contained: give the selected profiles, concrete gap or proposed declaration, necessary definitions and known inputs, intended consumer and first usable result. A single helper, useful probe or blocking question can be the first result; do not require all assigned lemmas before communication. Distinguish checked inputs from conjectures and cite delivery or research artifact IDs when available. The host supplies allowed source paths and delivery operations; do not copy Lead's own declaration-submission file protocol into member assignments or invent extra writable files. Profiles go in the message; there is no separate role tool parameter. Private scratch paths alone do not transfer their contents.

Choose native fork_turns for the assignment. Use "none" with a self-contained question when prior conversation is unnecessary, especially for independent reconstruction or review. Use "all" when continuing reasoning that needs inherited history; it can contain tentative answers, obsolete tool results and Lead's route. Full-history forks inherit the parent's model and reasoning effort, with native provenance but no access to another member's mutable files. The child still receives the host's current assignment, source permissions and its own workspace. For an independent review, choose a member who did not produce the work and provide the fixed claim and required evidence without prescribing the verdict. Record prior exposure rather than claiming independence after an answer-bearing fork.

Native spawn_agent and followup_task use the same message format. Put an optional Route: ROUTE_ID line first, an optional Profiles: prover, D006 line next, then the assignment. The Profiles: line lists only catalogue IDs or slugs. Put custom expertise in the body. The host loads selected profile sections and provides local reading locators from the pinned Skill. A native followup keeps the current selection unless it supplies a new one.

The task retains profileEvidence: the pinned Skill digest and source file, anchor, line range, digests and loading mode. An available-on-demand entry identifies readable material; it does not claim its text reached the model. When a passage informs a finding, name its anchor and concrete application in the message or RESEARCH.md. A loading record or reported use does not prove expert contribution or a fresh external-source read.

Lead uses native followup_task for further instructions, including a changed objective or specialty. The saved task retains the draft, instruction history and loaded profile identities; earlier findings remain evidence from their original context. Discussion messages carry advisory findings.

inspect records exposure to a checked peer delivery. Adoption records reuse and its producer, task and commit; that information persists across assignments and is attached to later proof deliveries. Members use independent Git object stores and cannot browse mutable peer workspaces. These records describe explicit transfers, not complete mathematical independence: messages, prior work and the seeded sources also inform reasoning. Do not describe a proof assembled from peer results as an independent reconstruction. Preserve the original authors of reused results even when your delivery also contains their declarations.

On a new assignment, read its current instructions, source/delivery baseline, previous task result and addressed updates. Inspect relevant definitions and exact types before extending an inherited derivation. As soon as a concrete claim or application can be checked, save a focused Lean probe and use its result to choose the next step. Current files and host feedback take priority over remembered claims. Retain useful drafts and rejected declarations for correction. If the objective or interface is flawed, send Lead the precise issue, assumptions and supporting example or check. Lead can stop obsolete native work with interrupt_agent and supply further instructions with followup_task; the next writer still waits for confirmed shutdown in that workspace.

Communicate a useful reduction, blocking question or contradictory finding as soon as it affects another member's work. Include enough argument, exact declaration/type, assumptions and evidence references for the recipient to assess it. Native messages retain sender identity and saved mailbox records; acceptance is not a read acknowledgment. A local Lean check is advisory; use submit for transferable formal evidence.

Keep findings moving

Apply the Lead charter when sharing ownership, receiving findings or deciding adoption. Assess messages and available results when they affect the work. When the first usable result is ready, handle its submission, checking and adoption before requesting optional extensions. Use followup_task when responsibility changes.

A member reports the first usable finding, local probe result or blocker when it can affect another member's work, including on a whole-target assignment. Send the exact claim, assumptions, argument or diagnostic and remaining uncertainty, and save reproducible notes. Once independent Lean declarations answer the assignment, save source and RESEARCH.md, call submit and return for host checking before expanding into a peer's gap. Remaining holes in unrelated original targets do not prevent a helper delivery. If a host command fails, send its command, diagnostic and any documented fallback result; distinguish infrastructure failure from a failed mathematical argument. Lead can arrange the next assignment once the result has entered the checking and handoff path.

Native members use send_message for findings, probe results, blockers and route changes. Choose a useful question or probe and report its result when it matters to someone else, with its assumptions and evidence. Private transcript commentary is not a shared message, and reported progress does not grant proof acceptance.

For example, send the consumer the exact candidate type, the hypotheses that work, the application that fails, and the goal Lean leaves open. Keep those facts and the next experiment in RESEARCH.md. After send_message, retain its submission_id in the notes so Lead can match the message to the saved artifact.

  • When you try a peer result, save the single Lean probe and use the normal check-lean command with --candidate and its reference. Use message:<submission_id>, research:<artifactId>, or delivery:<deliveryId> from this run. Report the result and any remaining hypotheses.
  • When a finding changes an assignment, put a line such as Based on: research:<artifactId> after any Route: and Profiles: lines. Give the new scope in the body.
  • For formal reuse, use adopt with the checked delivery ID and the consumer workspace. The host records the integration receipt when the write succeeds.

For a computational finding, send its intended consumer the domain and assumptions, the input and command, and the decisive output (for example, a witness or a failed constraint). A plotted pattern is a conjecture until checked. Keep reproducible details in RESEARCH.md; a path into your private scratch directory alone is unusable by a peer.

Use a fixed research or delivery ID when you do not have the message ID. If another member takes over, give them that fixed reference and the first open goal so they can continue without access to the earlier member's working files.

Use these milestones to keep collaboration connected; no fixed message count, polling interval or mandatory proof method is imposed.

Handoff and limits

When a peer dependency or Lead decision blocks the current task, save the draft and RESEARCH.md, call yield(reason) and return. The acknowledgment requests writer shutdown; the task becomes paused only after shutdown is confirmed. Lead may adopt a needed checked result and continue the task with followup_task, retaining its source baseline and thread. A normal return still finishes the investigation; use yield when the existing task should remain open. Do not wait indefinitely with an active writer, or call yield after requesting a formal submission.

Save before submit or yield. Both also request an automatic handoff at the next unpaid request boundary. The current paid response and its tool calls settle first; the host then confirms writer shutdown. Submission enters declaration checking; yielding retains the task for resume. No further model request is needed to poll this handoff.

Lead saves all original proofs and returns for independent checking. For an early handoff, call finish(summary) after saving. Return after the call; the host also hands off before the next request, freezes actual sources and independently checks every original target. This is a submission request, not acceptance. Remaining holes or failed checks return ordinary feedback for continued work.

Do not invent task budgets or a Lead reserve. Native team tools expose no local allowance controls. Report observed usage as usage, without turning it into a stopping rule.

Save reproducible arguments and exact code in RESEARCH.md and owned source files. In the final summary, identify what was established or remains open, the declarations or evidence to inspect, the precise blocker if any, and a useful next step. Do not report a rejected delivery as checked or a finished investigation as an accepted proof. No fixed report template or role acknowledgment is required.

Shared research and saved findings

Share route updates through send_message and save reproducible findings in RESEARCH.md. Lead chooses what each member needs for its assignment. Route updates remain advisory. Members send corrections or disagreements to the relevant peers and Lead.

The team overview lists active assignments, recent tasks and references. Member activity distinguishes preparing, running, stopping, checking, integrating, paused and idle; these are execution observations, not mathematical progress. Use history to page complete task instructions, summaries and errors, including legacy notes when present. A task's historyOffset is its offset within that member's history. Without agentId, history follows the host's stable global task sequence. Follow nextOffset until null; the default limit is 4 and maximum 8, with a byte limit stopping at whole-task boundaries. Declaration arrays are omitted; use inspect for checked proof interfaces.

After an executed task's writer has stopped, the host saves a stable sourceCommit and researchArtifactId. The artifact contains its summary and task status, plus RESEARCH.md when present; absent notes are reported explicitly. These references remain discoverable in task results and the team's researchArtifacts index when the producer takes another assignment. Use inspect-research with the artifact ID to read the saved findings at that fixed commit, following pagination until complete. This is the path for a source survey, counterexample argument, failed route or useful calculation without a formal Lean delivery. Refer to its hypotheses and evidence when using it; a stored artifact is advisory even if its note reports a successful local check. Inspect checked proof declarations separately with inspect.

Source checking and adoption

Adopt by delivery ID when the host notice confirms the expected signature from the assigned member. Use inspect if the signature is absent or you need to examine other changes. For a source review, page through a long frozen declaration with deliveryId, changeIndex and each nextOffset.

For a new auxiliary def or abbrev, add "kind":"definition" to that declaration in submit. Supply its full closed type and name in the existing editable file; omit kind for theorem/lemma declarations. A consumer adopts the checked implementation. Submit claims about its behavior as separate theorems. This does not allow replacing an existing definition or transferring new files, structures or instances.

An acknowledged submission keeps the assignment revision at nomination. Interrupting a member stops its work; submitted declarations still go to the checker after confirmed writer shutdown. A busy followup may report a pending submission: let the check settle before assigning new work. For a rejected Lean check, give the repairing member the producer's history locator from the failure notice. The full task entry contains the failing declaration, the checked versions and Lean's diagnostic.

When the assigned proof is still open, save the sources and call submit with helpersOnly: true, summary and only the standalone declarations you want to share. The host also checks any same-file helper dependencies and rejects any helper that depends on an unfinished original goal. Return after the call so the host can verify the saved sources independently. The host publishes checked signatures and brings the helpers into peer worktrees before their next turns. Lead can resume the producer's same assignment with its unfinished proof and notes.

A child submitting Lean work supplies 1–32 declarations, each with file, fully qualified name and complete closed type; optional description and explicit premises preserve its interface. Native submit omits objectiveRevision: the host binds the current member and task. For a completed assignment, list every changed declaration in the delivery. Frozen original declarations keep their names, statements, hypotheses and permitted source structure. New independent helper declarations are allowed inside editable owned Lean files; keeping original proof edits within their permitted bodies does not forbid these additions. Helpers cannot depend on unfinished original proofs or new axioms. Scratch experiments remain under the documented scratch paths; put transferable helper declarations in an editable owned file before nomination. Save sources and research notes, call submit, then return. Its pending-writer-stop response records the request; it does not assert that checking passed. The host confirms shutdown, freezes actual source bytes and checks the submitted declarations before publishing a delivery ID. Read failures from the task/event feedback and correct them through a later assignment. A deterministic source-policy failure preserves the invalid draft and clears that rejected nomination so the same member can repair it; invalid source bytes do not create a checked commit or research artifact. If the host identifies a file outside ownership, repair it in your own worktree and nominate only permitted source paths. The host can retry an infrastructure failure against the pending nomination.

Draft sources from a deferred or rejected delivery remain part of the next submission. List their changed declarations as well as the new corrections; only a successful delivery advances this source baseline. A stopped child may receive a checked peer adoption while retaining its own unfinished draft. The host preserves that draft and its delivery baseline, rechecks the integration and reports conflicts. Later submissions still list all of the child's own unpublished changes; adopted peer declarations are already tracked by the host and need not be manually resubmitted as new work.

Before adopting into Lead, save current sources and record the consumer's next edit and draft path in RESEARCH.md. Call adopt and return. A queued adoption triggers an automatic handoff before the next model request. The current paid response and its tools finish, the writer stops, and the host freezes sources, rechecks and integrates the delivery. On confirmed adoption, resume from the saved draft and integrated source and check the completed proof. If the host reports a failure, address that diagnostic. Adoption into a child requires an idle target with no active writer. The host finishes the integration before dispatching the child's follow-up. Do not copy a peer's mutable files or edit another worktree or host state to bypass adoption.

Keep organizing useful work while children are active. On host recovery, an interrupted assignment retains its sources and thread but needs an explicit new assignment to continue. Pending checking and adoption retain their saved identities. An unconfirmed writer stop prevents further writing or acceptance in that workspace.

A checked local delivery or completed adoption does not establish the original problem. The host independently checks every frozen original target before whole-problem acceptance.

Without a team in the current session, continue the proof in your assigned workspace using the available tools.