diff --git a/.agents/skills/claim-work/SKILL.md b/.agents/skills/claim-work/SKILL.md new file mode 100644 index 00000000..584fa36a --- /dev/null +++ b/.agents/skills/claim-work/SKILL.md @@ -0,0 +1,62 @@ +--- +name: claim-work +description: Claim an InferRSI Issue or fix before starting it, state when the next artifact will appear, and release the claim if nothing appears. Use before starting a fix, opening a PR or taking over a delegated slice. +--- + +# Claim work on an InferRSI Issue + +Follow the [identity and authority](../../../docs/agent-collaboration.md#identity-and-authority) +rules and working rules 1, 7 and 8 in +[agent collaboration](../../../docs/agent-collaboration.md#working-rules). + +## Check before claiming + +1. Confirm the governing Issue and its accepted scope before changing code. If + the guide's [stop check](../../../docs/agent-collaboration.md#identity-and-authority) finds a stop on + this work's stop chain, or cannot rule one out, do not claim it. +2. Confirm the Issue has an accountable owner (recorded on the Issue, or else + its only assignee when exactly one is set) and carries `status:accepted`: + + ```bash + gh issue view --repo InferMatrixLab/InferRSI --json assignees,labels + ``` + + With several assignees and no recorded owner, there is no accountable + owner yet. With no accountable owner, propose on the Issue and ask a maintainer to assign it; + at `status:proposed` or `status:deferred`, discuss only. Do not claim + either. +3. Confirm you are the deciding agent (the formal agent working for the + accountable owner's account) or that the deciding agent delegated this slice to you + on the Issue. Otherwise propose on the Issue instead of claiming. +4. Search open Issues and PRs for the same work, for example: + + ```bash + gh search issues --repo InferMatrixLab/InferRSI --state open "" + gh search prs --repo InferMatrixLab/InferRSI --state open "" + ``` + +5. Read the governing Issue's recent comments. If someone holds a live claim, + coordinate on that thread instead of starting a parallel fix. + +## Claim on the Issue + +Post one comment on the governing Issue, not on a PR or in a private channel: + +```text +, acting for @: claiming . +Next artifact: by . +``` + +Keep the claim to the slice you will deliver. A claim records intent; it does +not grant authority beyond the Issue's direction. Each Issue has one deciding +agent, the one acting for its accountable owner; other agents propose there. +Within the Issue's direction, the deciding agent settles scope and records the +reason on the Issue; only a change of direction goes back to the owner. + +## Deliver or release + +- Show the named artifact on the Issue by the stated time. Post again only for + a new head, new evidence or a new question; no status-only updates. +- A claim that states no time allows 24 hours. +- If nothing appears by then, the claim lapses. Post one comment releasing it, + with any partial findings in `
`, and leave the work to others. diff --git a/.agents/skills/merge-pr/SKILL.md b/.agents/skills/merge-pr/SKILL.md new file mode 100644 index 00000000..fe65accc --- /dev/null +++ b/.agents/skills/merge-pr/SKILL.md @@ -0,0 +1,125 @@ +--- +name: merge-pr +description: Decide whether an InferRSI pull request may merge now and, if so, squash-merge it. Use before merging and whenever reporting a PR as merge-ready; this is the one merge-ready check, not private criteria. +--- + +# Merge an InferRSI pull request + +Follow [PR review and merge](../../../docs/agent-collaboration.md#pr-review-and-merge) +and the [squash merge rules](../../../docs/agent-collaboration.md#records). +Report a PR as merge-ready only when every check below holds on its current +head; otherwise report the first failing check. + +## Read the current state + +```bash +gh pr view --repo InferMatrixLab/InferRSI \ + --json state,isDraft,headRefOid,baseRefName,baseRefOid,body,labels,reviews,reviewDecision,statusCheckRollup,files +``` + +Also read the governing Issue's labels, accountable owner and recorded +authorization. Note `headRefOid` and `baseRefOid`: the checks below hold for +that pair only. + +## Check every condition + +1. **Open and ready:** the PR is open and not a draft. +2. **Authorized to integrate:** the governing Issue has an accountable owner + (recorded on the Issue, or else its only assignee when exactly one is set) and carries `status:accepted`, and you are its deciding agent, were delegated + integration on the Issue, or you act for a maintainer account. +3. **No stop:** the guide's + [stop check](../../../docs/agent-collaboration.md#identity-and-authority) finds no stop on the PR's + stop chain; a stop comment holds even after the label exists. If it finds a + stop or cannot rule one out, do not merge, and record on the PR which Issue + you could not check. +4. **Base and dependencies:** the PR's base is its intended target: `main`, + or for a stacked PR its lower PR's branch until that PR merges, after which + the base is changed back to `main` and the checks run again. Every PR it + depends on has merged; until then, do not merge or queue it. +5. **Two approvals on the current head:** at least two formal **Approve** + reviews, each from a different eligible account (repository write access + or higher), none stale. The review body's wording does not count; + comments and **Comment** reviews contribute no approval. + Each account counts once, whether its human votes directly or its one + formal reviewer agent does. +6. **Independence:** the author, material contributors and the accountable + parent supplied none of them, including through another agent under their + account. At least one comes from a different agent or a human. The + author's own approval never counts, nor does one from an account without + write access. +7. **No open blocker:** every binding **Request changes** review (from an + account with write access or higher) is re-reviewed to **Approve** or + dismissed with a recorded reason, by those the + [guide](../../../docs/agent-collaboration.md) allows to dismiss it. An + advisory review, such as one from `cursor[bot]`, does not count as a vote + but has a substantive answer on the PR and a recorded disposition (fixed in + a named commit, or declined with the reason). If GitHub's merge state still + shows the PR blocked by it on the current head, someone the guide allows to + dismiss reviews dismisses it, and the PR records who did and why, before + you merge. An unresolved code or safety + blocker still stops the merge, whoever raised it. +8. **Required checks green** on the head. Windows/macOS `host-compatibility` + results are advisory and never block. +9. **High-risk:** if the diff changes CI workflows or required checks, + releases (release workflow, version, tags, publishing), secrets and + credentials, or permissions (workflow `permissions`, repository access, + rulesets, the high-risk approver list), or you cannot tell, at least one of + the approvals in 5 comes from an account listed in + `.github/high-risk-approvers.json`; that account's agent may give it. Other + approvals count toward the two but not as this one. Read the list from the + protected `main` commit you noted as `baseRefOid` (the base is `main` by + check 4), never from the PR head or a stacked branch, so a PR that changes + the list is judged by the list before it + (`gh api "repos/InferMatrixLab/InferRSI/contents/.github/high-risk-approvers.json?ref=" --jq .content | base64 -d`). + Confirm the approving login is on it, and confirm the account still has + write access: + `gh api repos/InferMatrixLab/InferRSI/collaborators//permission --jq .permission` + must print `admin` or `write`. If you cannot read the list or the + permission, or no approving account passes both, do not merge. The PR that + creates the list is approved once as the + [high-risk rule](../../../docs/agent-collaboration.md#identity-and-authority) + says. + Otherwise follow the normal flow. +10. **Recovery for external effects:** if the merge itself causes an external + effect that a revert cannot undo (publishing a release asset or package, + changing access or credentials), the PR body has a + `recovery: owner=@; containment=` line naming the recovery + owner and the containment steps. If it is missing, do not merge and ask the + author to add it. This adds no approval requirement. + +Right before merging, read the PR and the governing Issue again. Recheck the +stop check from check 3 on the whole stop chain; `headRefOid`, `baseRefName` and `baseRefOid` against the pair you +noted; the Issue's `status:accepted` and your authorization; and, on the +current head, the approvals, any open binding **Request changes** review, any advisory +request without a recorded disposition, GitHub's merge state, and any +unresolved code or safety blocker from check 7, and, on a +high-risk PR, the listed approver and its write access from check 9, against +the list at the same `baseRefOid`; and the PR body's `recovery:` line from +check 10, since the body can change without a new head. If anything changed or +no longer holds, start over. + +## Merge + +Prepare the squash message: subject plus a short summary, no Issue references, +DCO sign-off and material `Agent-assisted-by` attribution kept. Squash-merge +only the head you checked, so GitHub refuses the merge if the head has moved: + +```bash +gh pr merge --repo InferMatrixLab/InferRSI --squash \ + --match-head-commit --subject "" --body "" +``` + +With the REST merge endpoint, pass the same head as `sha`. If the merge is +refused because the head changed, start over from the checks above; never retry +without the expected head. The repository ruleset and merge controls apply +unchanged. There is +no merge queue yet; once one is enabled, the rules for queueing are added here. +Record the merge on the PR yourself, right after merging, with an identity +line; for a high-risk PR the same comment then has one line +`merge-audit: head= approvals=@ , @ approver=@ list= merge= by=@`, +where `approver=` names the approving account you found on the list and +verified in check 9, and `list=` is the `baseRefOid` you read the list from +(`list=bootstrap-570` only for the one-time bootstrap merge in the +[high-risk rule](../../../docs/agent-collaboration.md#identity-and-authority)). +If `main` turns red afterwards, use the +[red-main skill](../red-main/SKILL.md). diff --git a/.agents/skills/open-pr/SKILL.md b/.agents/skills/open-pr/SKILL.md new file mode 100644 index 00000000..a5e0ee37 --- /dev/null +++ b/.agents/skills/open-pr/SKILL.md @@ -0,0 +1,62 @@ +--- +name: open-pr +description: Open an InferRSI pull request from current main with local checks run, DCO and agent attribution on commits, and a complete PR body including the knowledge authorship declaration. Use when turning a claimed slice into a PR or updating its head. +--- + +# Open an InferRSI pull request + +Follow [contributing](../../../docs/contributing.md#development), the +[records rules](../../../docs/agent-collaboration.md#records) and the +[knowledge authorship declaration](../../../docs/knowledge-model-policy.md#one-pr-body-declaration). +Claim the work first with the [claim-work skill](../claim-work/SKILL.md). + +## Branch and commit + +1. Fetch and branch from current `main` in a separate worktree: + + ```bash + git fetch origin main + git worktree add -b ../ origin/main + ``` + +2. Keep the PR one coherent delivery slice with a minimal diff. +3. Commit with `git commit -s` under your real identity. Add + `Agent-assisted-by: / [effort=] ()` for each + material agent contributor. Keep Issue references out of commit subjects, + bodies and trailers. + +## Run the local checks + +Run them on the content you will push and record the actual results: + +```bash +ruff check src tests tools +pytest +``` + +If the skill library changed, also run +`python tools/build_skill_index.py --source-revision --check`. +Check every new or changed artifact against the +[privacy and security rules](../../../docs/privacy-security.md). + +## Write the PR body + +Start from the [PR template](../../../.github/PULL_REQUEST_TEMPLATE.md): + +- The first line of the governing section is `Refs #`. Never write a + closing keyword before an Issue reference, even in a negated sentence. +- Fill the `knowledge-model-policy` block with the current full head SHA and + every material AI author's actual tool, model and effort. Changes to + [protected paths](../../../docs/knowledge-model-policy.md#rollout-and-scope) + fail the required check without it; after every push, update `head_sha`. + #518 stalled because its declaration check stayed red on the final head. +- Report checks actually run, and failed, skipped or not-run ones, separately. + Report PR readiness and Issue completion separately. +- If a revert cannot undo the change's external effect (credentials, + published assets, access), add one line + `recovery: owner=@; containment=`. +- Do not prefill an independent approval or claim an authorized merge. + +Open the PR with `gh pr create --base main` and show it on the Issue as the +claimed artifact. Review goes to an independent reviewer using the +[review-pr skill](../review-pr/SKILL.md). diff --git a/.agents/skills/red-main/SKILL.md b/.agents/skills/red-main/SKILL.md new file mode 100644 index 00000000..157abf96 --- /dev/null +++ b/.agents/skills/red-main/SKILL.md @@ -0,0 +1,45 @@ +--- +name: red-main +description: Restore a red InferRSI main by finding the merge that broke it, reverting that merge first and fixing forward in a new PR. Use when a required check fails on main after a merge. +--- + +# Restore a red main + +Follow the revert-first rule at the end of +[PR review and merge](../../../docs/agent-collaboration.md#pr-review-and-merge): +revert the merge that broke `main` before fixing forward. + +## Find the breaking merge + +1. List recent `main` runs and find the last green and first red run of the + failing workflow: + + ```bash + gh run list --repo InferMatrixLab/InferRSI --branch main --workflow --limit 20 + ``` + +2. List the merges between those two commits with + `git log --first-parent ..`. Read the failing job + log and match the failure to the change that caused it. Two PRs that each + passed can fail together; the breaking merge is the one after which `main` + first failed. +3. Search open Issues and PRs for an existing revert or fix, and claim the + revert with the [claim-work skill](../claim-work/SKILL.md). + +## Revert first + +Branch from current `main` and revert the breaking merge: + +```bash +git revert --signoff --no-edit +``` + +Open the revert PR with the [open-pr skill](../open-pr/SKILL.md), naming the +breaking merge and the failing run. It merges through the +[merge-pr skill](../merge-pr/SKILL.md) like any other PR. Post one comment on +the original PR linking the revert. + +## Fix forward + +After `main` is green again, the original change returns in a new PR that +contains the fix, reviewed and merged under the same rules. diff --git a/.agents/skills/review-pr/SKILL.md b/.agents/skills/review-pr/SKILL.md index 3111781a..feea3e21 100644 --- a/.agents/skills/review-pr/SKILL.md +++ b/.agents/skills/review-pr/SKILL.md @@ -65,6 +65,12 @@ as it stands on protected `main` (not the PR head or a stacked branch; see the [high-risk rule](../../../docs/agent-collaboration.md#identity-and-authority)), including its agent, counts as the required listed approval. Other approvals count toward the two but not as that one. +If a revert cannot undo the change's external effect (credentials, published +assets, access) and the PR body lacks a +`recovery: owner=@; containment=` line, request it. +Post a review or +comment only for a new head, new evidence or a new question. Lead with the +one-line conclusion and put details in a collapsible `
` section. Agents may submit formal reviews without a separate human delegation; see [identity and authority](../../../docs/agent-collaboration.md#identity-and-authority). diff --git a/AGENTS.md b/AGENTS.md index c5a7ac7d..8a7f9a77 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -73,35 +73,21 @@ Parameterized or manual acceptance runs are issue-scoped; they are not the defau - **Emit RunSpec snapshots** — record repo × revision × backend × device × model × scenario (`contracts/runspec.py`, campaign `plan/`). - **Evaluator + evidence win** — never treat agent narrative as `PASS`; verdicts follow frozen gates and `evidence//` artifacts. -## Issues and claims (PM) +## Issues, claims and evidence -- Open or update an **acceptance issue before claiming `PASS`** (or publishing numbers). -- Do **not** invent thresholds in the tree; pins and numeric gates stay **issue-scoped** only. -- Public wording: [evidence and claim rules](docs/contributing.md#evidence-and-claims). - -## Research lock - -- Cite **acceptance issues + pinned SHAs** in downstream text; do not invent gain or quality bars. -- **Public wording only after `PASS`** — follow [evidence and claim rules](docs/contributing.md#evidence-and-claims); until then, label unverified or `INCONCLUSIVE`. +- Open or update an **acceptance issue before claiming `PASS`** (or publishing numbers). Cite **acceptance issues + pinned SHAs** in downstream text. +- Do **not** invent thresholds, gain or quality bars in the tree; pins and numeric gates stay **issue-scoped** only. +- **Public wording only after `PASS`** — follow [evidence and claim rules](docs/contributing.md#evidence-and-claims) (including external demo scope); until then, label unverified or `INCONCLUSIVE`. - Use [cite-check-downstream-pr](src/inferrsi/knowledge/data/skill_library/workflows/governance/cite-check-downstream-pr/SKILL.md) and [competitor-scan](src/inferrsi/knowledge/data/skill_library/workflows/research/competitor-scan/SKILL.md) as **operators**, not campaign scripts (no pins in skill bodies). -## Evidence and clearing the bar - -Verdicts are **`PASS`**, **`FAIL`**, or **`INCONCLUSIVE`** only (`src/inferrsi/contracts/claim.py`). - -A public **`PASS`** requires: +Verdicts are **`PASS`**, **`FAIL`**, or **`INCONCLUSIVE`** only (`src/inferrsi/contracts/claim.py`). A public **`PASS`** requires: 1. Pinned baseline and candidate revisions (in the issue, cited in results) 2. Validators **frozen** before candidate search (`validator/` + gate checklist in `plan/`) -3. A complete evidence tree under `evidence//`: `plan/`, `results/`, `patch/`, `validator/` +3. A complete evidence tree under `evidence//` ([layout](evidence/README.md)): `plan/`, `results/`, `patch/`, `validator/` Agents and human reviewers **clear** work only with artifacts—not vibes. Green draft/ready CI does not imply campaign `PASS`. -| Topic | Doc | -| --- | --- | -| Claim wording and external demo scope | [evidence and claim rules](docs/contributing.md#evidence-and-claims) | -| Evidence layout | [evidence/README.md](evidence/README.md) | - ## Skills For an inference task, first select one of the [seven required primary skills by deliverable](plugins/inferrsi/skills/inferrsi/SKILL.md#load-the-primary-inference-task). Run `inferrsi skills enter ` and read the returned instructions before the first evidence search. For an accuracy regression, use `inferrsi skills enter task-accuracy`. If the required skill cannot load, report the blocker. Frozen evaluations follow their assigned entry and knowledge condition. @@ -110,40 +96,9 @@ Portable operator guidance and candidate procedures live in the [skill library]( ## Optimization requests -For requests to use benchmarks to verify RSI knowledge efficiency, start with -`inferrsi benchmarks compare --help` and follow its returned `next_action`. -The default knowledge comparison runs Qwen denoising and MoE forward, each -on/off in independent sessions. Configuration, native handoff, trace and report -details are in [benchmark comparison](docs/benchmark-comparison.md). - -Ordinary project optimization stays in the current Agent conversation. Follow -the [shared optimization workflow](docs/optimization-workflow-unification.md): -prepare explicit workload, quality/measurement scripts, metric, gates, declared -project inputs and budget, then use `campaign start/diagnose/knowledge/round/status/final`. -Record the measured bottleneck before optional knowledge retrieval or candidate search. -Harness freezes those supplied conditions and assesses the retained results; -it does not infer acceptance from the user's goal. Ordinary optimization does -not depend on Benchmark. Use `up_to` with a recorded stop reason or declare exact rounds. -This and the packaged task path below share one Harness controller. Managed -campaigns generate dashboard views from that control record; do not use legacy -`campaign record/decide` to create a second set of optimization state. - -For a request to run an optimization task through RSI, follow the -[current-Agent benchmark workflow](docs/optimization-benchmarks.md). -Use `benchmarks session` to freeze the budget, record the measured bottleneck, -submit each changed candidate, -read its feedback, and independently retest the selected candidate with `final`. -Report the session summary after the declared rounds and final are complete. -`benchmarks run` is the single-candidate measurement operation inside that workflow. -Benchmark requests default to a fresh conversation on the current host; follow -[native Agent sessions](docs/native-agent-sessions.md). The initiator resolves -the task/configuration, records a prompt through `agents prepare`, then dispatches, -creates and binds one native session. It does not start the optimization campaign. -The execution Agent reads the RSI entry, runs start through independent final, -and returns the summary and artifacts. It must not redelegate. The initiator -observes the native session and records the delivered results without inferring -acceptance from host completion. An explicit current-conversation request uses -the same full optimization lifecycle directly. +Benchmark comparisons, ordinary project optimization and packaged optimization +tasks each have one entry workflow; see +[optimization requests](docs/operations.md#optimization-requests). ## Dev smoke (local) @@ -160,8 +115,16 @@ ruff check src tests 1. Read the contribution guide and validation levels before large code or CI changes. 2. Prefer minimal diffs; match existing layout and naming. 3. Do not reopen closed campaign work or add pins to shared automation without explicit human direction. -4. Work Issue-first: confirm the governing Issue's accepted scope before changing code, keep each change a bounded delegated slice with independent review, and report PR readiness and Issue completion separately — see [agent collaboration](docs/agent-collaboration.md). -5. Agents may carry work end to end; humans set direction through Issues and stop work with `bot:stop`. Identify yourself first on every comment and review, never approve your own PR, merge a high-risk PR (CI, releases, secrets, permissions) only with at least one of its two approvals from an account on the high-risk approver list in `.github/high-risk-approvers.json` (its agent may give it), claim work only on an Issue with an accountable owner (recorded on the Issue, or else its only assignee) labeled `status:accepted` (the agent acting for its accountable owner decides there), keep comments short, and revert a merge that turns `main` red before fixing forward — see [identity and authority](docs/agent-collaboration.md#identity-and-authority) and working rules 7–8 in [agent collaboration](docs/agent-collaboration.md#working-rules). + +## Collaboration + +Rules: [agent collaboration](docs/agent-collaboration.md). Agents may carry work end to end; humans set direction through Issues and stop work with `bot:stop`. One skill per step: + +- Claim before starting: [claim-work](.agents/skills/claim-work/SKILL.md) — confirm the Issue has an accountable owner and `status:accepted` and that you are its deciding agent or work under its delegation, search for duplicates, claim on the Issue with the next artifact time, release if nothing appears. +- Open a PR: [open-pr](.agents/skills/open-pr/SKILL.md) — a bounded slice with independent review, branched from current `main`, local checks run, AI declaration filled; report PR readiness and Issue completion separately. +- Review: [review-pr](.agents/skills/review-pr/SKILL.md) — identify yourself first on every comment and review, keep comments short, never approve your own PR; one formal reviewer agent per account. +- Merge: [merge-pr](.agents/skills/merge-pr/SKILL.md) — open and ready, authorized, expected base and dependencies merged, two independent approvals, required checks green, no `bot:stop` or unlifted stop comment, and on a high-risk PR (CI, releases, secrets, permissions) at least one approval from an account on the high-risk approver list in `.github/high-risk-approvers.json` that still has write access, verified at merge time. +- Red `main`: [red-main](.agents/skills/red-main/SKILL.md) — revert the merge that broke it, then fix forward in a new PR. ## Privacy and security diff --git a/docs/agent-collaboration.md b/docs/agent-collaboration.md index cfe3cff3..185b470f 100644 --- a/docs/agent-collaboration.md +++ b/docs/agent-collaboration.md @@ -29,7 +29,7 @@ Campaign acceptance, DCO, CI lanes and evidence rules stay in | Accountable agent (parent) | Own the Issue outcome, plan and remaining criteria; implement or delegate bounded slices and independent review; report completion for acceptance. | | Implementer | Own a bounded slice; plan, research, coordinate, change, check and report actual results. | | Reviewer | Independently inspect accepted requirements, actual diff, affected consumers and evidence. Use the [PR review skill](../.agents/skills/review-pr/SKILL.md) to give a revision-scoped verdict. | -| Integrator | Verify authorization, current head/base, dependencies and applicable review/check results; integrate or report a blocker. | +| Integrator | Verify authorization, current head/base, dependencies and applicable review/check results; integrate or report a blocker. Use the [merge PR skill](../.agents/skills/merge-pr/SKILL.md). | Assign the accountable agent to the Issue, not only its first PR. One Issue may have several delivery PRs; a delegated subagent stays within its slice and @@ -146,7 +146,8 @@ Until then, the current ruleset and merge controls apply unchanged. Enabling the queue is a repository setting for maintainers, and it cannot be enabled while the required `knowledge-model-policy` check does not run on `merge_group` events. If `main` still turns red after a merge, an agent first -reverts the merge that broke it, then fixes forward in a new PR. +reverts the merge that broke it, then fixes forward in a new PR; see the +[red main skill](../.agents/skills/red-main/SKILL.md). ### Independent-approval check (advisory, to be removed) @@ -182,7 +183,7 @@ sequenceDiagram 4. **Refresh:** reassess affected evidence after relevant head/base/content/environment/check changes. Refresh checks or explain continued applicability. Neither blanket reuse nor full hardware reruns is the default; changed hashes alone prove neither content change nor equivalence. 5. **Handoff:** only for an actual transfer or accepted decision change, record the delta, recipient and next action. Keep acceptance status/link, communication status and application status separate. "Applied" needs artifact/evidence; otherwise retain pending or unknown. No full conversation traces or new ledger. 6. **Completion:** merged PR ≠ accepted goal ≠ campaign `PASS` ≠ release. Use non-closing `Refs #N` until closure is authorized. GitHub treats a closing keyword followed by an Issue reference as closing syntax even inside a negated sentence, so never write one in PR text; for an authorized closure, put `Closes #N` alone on its own line. The ready lane's `pr-references` job reports any other use. Subtasks cannot implicitly close a parent goal. Knowledge proposals to [#17](https://github.com/InferMatrixLab/InferRSI/issues/17) are optional; no automatic promotion. Before an authorized closure, publish a closure summary card ([closure summaries](#closure-summaries)). -7. **Claims:** before starting a fix or opening a PR, search open Issues and PRs for the same work and claim it with a comment on the governing Issue; if someone already holds a live claim, coordinate there instead of starting a parallel fix. An agent's claim states when it will next show an artifact (draft PR, branch or findings). A claim that states no time allows 24 hours. If nothing appears by then, the claim lapses: the agent posts one comment releasing it and leaves the work to others. +7. **Claims:** before starting a fix or opening a PR, search open Issues and PRs for the same work and claim it with a comment on the governing Issue; if someone already holds a live claim, coordinate there instead of starting a parallel fix. An agent's claim states when it will next show an artifact (draft PR, branch or findings). A claim that states no time allows 24 hours. If nothing appears by then, the claim lapses: the agent posts one comment releasing it and leaves the work to others. See the [claim work skill](../.agents/skills/claim-work/SKILL.md). 8. **Comments:** agent comments start with a one-line conclusion; put details in a collapsible `
` section. Post in a thread only for a new head, new evidence or a new question; do not post status-only updates. Do not post, or else minimize, agent comments that only report the agent's own failure or exhausted quota. ## Closure summaries @@ -260,7 +261,7 @@ flowchart LR ## Records - **Issue:** goal/criteria; scope; accountable account and parent agent if assigned; acting contributor if known; acceptance/delegation link; completion/closure owner. Unknown fields may remain TBD while proposed. Ordinary work starts from the [scoped-task template](../.github/ISSUE_TEMPLATE/scoped-task.md); baseline-vs-candidate campaigns use the [campaign acceptance form](../.github/ISSUE_TEMPLATE/campaign-acceptance.yml). -- **PR:** governing Issue; delivered artifacts; checks/results/limitations; dependencies and gaps. Add requirement-to-artifact mapping only when useful, and handoff fields only when applicable. No author-prefilled independent approval. Start from the [PR template](../.github/PULL_REQUEST_TEMPLATE.md). +- **PR:** governing Issue; delivered artifacts; checks/results/limitations; dependencies and gaps. Add requirement-to-artifact mapping only when useful, and handoff fields only when applicable. No author-prefilled independent approval. Start from the [PR template](../.github/PULL_REQUEST_TEMPLATE.md); the [open PR skill](../.agents/skills/open-pr/SKILL.md) covers the steps. - **Commit:** short descriptive subject; why/what when useful. Keep governing Issue references out of commit subjects, bodies and trailers — the PR body carries them. Preserve author identity and the required DCO sign-off (`git commit -s`); never invent a signing identity. Agent-assisted commits identify material agent contributors with `Agent-assisted-by: ()` trailers; repeat for multiple contributors and retain attribution when squashing. Protected knowledge contributions require the [current-head knowledge declaration](knowledge-model-policy.md) and use `Agent-assisted-by: / [effort=] ()` when known. Unknown values stay truthful and do not satisfy admission; model/version remains optional for other work. The trailer is self-reported provenance, not cryptographic signing, independent review or approval; review attribution belongs on the revision-scoped review record. - **Squash merge:** the required integration method. Before an authorized merge, prepare a concise squash message: subject plus a short summary, no governing Issue references, no redundant intermediate-commit messages; preserve the required DCO sign-off and material `Agent-assisted-by` attribution. Never invent identities or sign-offs. diff --git a/docs/operations.md b/docs/operations.md index 58a0c946..747bb791 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -492,3 +492,40 @@ snapshot pinned at startup. The campaign Dashboard remains available through - **Side effects:** writes the requested files; nothing is executed and no network or GPU is touched. - **Failure behavior:** exit code 2 with the offending field name when the specification is incomplete, ambiguous or inconsistent; a report without a paired measurement states why it has no figure. - **Example:** [campaign summary chart](campaign-summary-chart.md) + +## Optimization requests + +For requests to use benchmarks to verify RSI knowledge efficiency, start with +`inferrsi benchmarks compare --help` and follow its returned `next_action`. +The default knowledge comparison runs Qwen denoising and MoE forward, each +on/off in independent sessions. Configuration, native handoff, trace and report +details are in [benchmark comparison](benchmark-comparison.md). + +Ordinary project optimization stays in the current Agent conversation. Follow +the [shared optimization workflow](optimization-workflow-unification.md): +prepare explicit workload, quality/measurement scripts, metric, gates, declared +project inputs and budget, then use `campaign start/diagnose/knowledge/round/status/final`. +Record the measured bottleneck before optional knowledge retrieval or candidate search. +Harness freezes those supplied conditions and assesses the retained results; +it does not infer acceptance from the user's goal. Ordinary optimization does +not depend on Benchmark. Use `up_to` with a recorded stop reason or declare exact rounds. +This and the packaged task path below share one Harness controller. Managed +campaigns generate dashboard views from that control record; do not use legacy +`campaign record/decide` to create a second set of optimization state. + +For a request to run an optimization task through RSI, follow the +[current-Agent benchmark workflow](optimization-benchmarks.md). +Use `benchmarks session` to freeze the budget, record the measured bottleneck, +submit each changed candidate, +read its feedback, and independently retest the selected candidate with `final`. +Report the session summary after the declared rounds and final are complete. +`benchmarks run` is the single-candidate measurement operation inside that workflow. +Benchmark requests default to a fresh conversation on the current host; follow +[native Agent sessions](native-agent-sessions.md). The initiator resolves +the task/configuration, records a prompt through `agents prepare`, then dispatches, +creates and binds one native session. It does not start the optimization campaign. +The execution Agent reads the RSI entry, runs start through independent final, +and returns the summary and artifacts. It must not redelegate. The initiator +observes the native session and records the delivered results without inferring +acceptance from host completion. An explicit current-conversation request uses +the same full optimization lifecycle directly.