diff --git a/core/CONTRACT.md b/core/CONTRACT.md index 8c3223bc..6390ec10 100644 --- a/core/CONTRACT.md +++ b/core/CONTRACT.md @@ -55,45 +55,30 @@ requester needed). ## Reporting -Write PRs, issues, design docs, reports, requests and status messages for the -reader's next action, readable without the thread they came from. Templates -(handoff, delegation brief) keep their fields; these rules govern the prose -inside them. - -- Lead with the outcome; when the reader must decide or act, put that request - first, before any status. - - **PRs** open with what changes for the owner or users (`Goal`), then what - is wrong (`Problem`) and the newcomer context (`Context`); keep internal - dispatch, rulings and batch names in `Notes`, not the opening. - - **Issues** open with what is broken or wanted and who notices - (consequence), then the evidence connecting it to the cause, then the - observable evidence that closes it. - - **Design docs** open with a plain summary of what changes, what decision - is needed and the recommendation before architecture details or decision - IDs. -- Write owner-facing text in plain words without session labels, batch names, - opaque IDs or unexpanded internal terms. Name things by what they are; link - a plan or issue instead of naming it. Explain each domain term from - something you read (code, docs, issue or glossary), or if nothing explains - it say what it does here instead of naming it. -- Give the observation a conclusion rests on: command and result, number, file - or example. Say which claims behind a decision are inferred or assumed, and - what was skipped or failed. -- To a reader who has seen earlier state, report what changed and what comes - next; give a new reader the state they need to act. Include steps taken only - when they change what to trust. -- For a decision, name who decides, ask the exact question, recommend a course - and say what happens if no answer comes. Give alternatives when the choice is - real. -- **Visuals, infographics and mockups:** include a visual whenever a topic, - change, design or owner update has a structural, quantitative or UI shape - that prose alone makes slower to scan. Follow [visual guidance](VISUALS.md) - for visuals, issues referring to UI functions and UI-changing PRs. - - Every visual must carry structure, comparison or appearance the prose does - not, and the prose must stand without it. Omit visuals for small, - straightforward text- or code-only changes. -- Stop when the reader can act. Apart from the delivery ending above, do not - close by restating the opening. +Write for the reader's next action without assuming thread context. Keep handoff +and delegation templates' fields and apply these rules to their prose. + +- Lead with the outcome. Put a required reader decision or action first. + - **PRs** open with user or owner impact (Goal), the Problem and newcomer + Context. Put dispatch, rulings and batch names in Notes. + - **Issues** open with what is broken or wanted, who notices, evidence of the + cause and observable closure evidence. + - **Design docs** open with what changes, the decision and recommendation + before architecture details or decision IDs. +- Use plain names and links to plans or issues. Omit session and batch labels, + opaque IDs and unexplained terms. Define domain terms from sources you read + or describe what they do here. +- Ground conclusions in a command and result, number, file or example. Identify + inferences, assumptions, skipped checks and failures. +- Give returning readers changes and next steps, and new readers enough state + to act. Include process only when it affects what to trust. +- Name the decision owner, exact question, recommendation and default without + an answer. Give alternatives for real choices. +- Include a [visual](VISUALS.md) when structure, quantities or UI are harder + to scan in prose. Each visual must add information and the prose must stand + alone. Omit visuals for small, straightforward text or code changes. +- Stop when the reader can act. Restate the opening only if the delivery ending + above requires it. ## Merge authority @@ -169,20 +154,17 @@ runner reliability or speed) go to the front of the merge line, ahead of feature work, through the repository's queue priority if it has one. Infra-only fixes may use the infra-only route above. -The builder runs each full local gate once, recording command, exact head SHA, -environment fingerprint (defined by the consumer's AGENTS.md/docs), result, time -and log path. Builders, reviewers and coordinators reuse its green receipt at -the same head and fingerprint. Rerun only if head or gate inputs changed -(including rebase), fingerprint changed or cannot be shown, or receipt is missing, -red, partial or unverifiable. Reviewers still judge whether tests exercise claimed -behavior; reuse does not accept those claims. Hosted required CI and loopzero's -sandboxed check receipt remain unchanged. - -Every gate, script, workflow step and pool-host job runs under the repository's -pinned interpreter and toolchain (for example `uv run` with the pinned Python), -never a host's system interpreter. An error from a missing newer-language API -means the wrong interpreter ran: fix the interpreter, not the code for an older -version. +The builder runs each full local gate once and records its command, exact head SHA, +environment fingerprint (from consumer AGENTS.md/docs), result, time and log path. +Builders, reviewers and coordinators reuse green receipts at the same head and +fingerprint. Rerun only if head or inputs changed (including rebase), the fingerprint +changed or cannot be shown, or the receipt is missing, red, partial or unverifiable. +Reviewers still verify tests prove the claimed behavior. Hosted CI and sandboxed +receipt requirements remain. + +Run every gate, script, workflow step and pool-host job with the repository's +pinned toolchain, never the host interpreter. If a newer API is missing, use the +pinned interpreter rather than altering code for an older version. ## Findings @@ -289,17 +271,15 @@ the failure. Exit 2 covers invalid arguments and sandbox unavailability in Exit 3 means waiting or timeout. Review exits 4 when independent review is unavailable and 5 when changes are requested. Interruption exits 130. -**Never pipe a `loopzero` command, even with `set -o pipefail`: the pipeline -can report the filter's exit code in place of the command's verdict.** Redirect -stdout/stderr to a file, e.g. `loopzero check >check.log 2>&1`; inspect that -file separately. Chain dependent commands with `&&`. Report the exit code -and final output line; earlier progress never proves queue/merge state. +**Never pipe `loopzero`, even with pipefail**, because it can hide the verdict. +Redirect stdout and stderr (e.g. `loopzero check >check.log 2>&1`) and read the +file separately. Chain dependent commands with `&&`. Report the exit code and +final output line. Progress alone cannot prove queue or merge state. Use `loopzero ready --wait` and `loopzero merge --wait`, one waiter per PR. -Never use handwritten `gh` wait loops or `gh pr checks --watch`, which misses -checks not yet created. Other polling requires a deadline, visible progress, -preserved stderr and stopping on errors. Do not poll `gh pr view`, -`gh pr checks` or `gh pr list`: hidden GraphQL shares account quota. Use REST -`gh api` for one-off PR reads/comments. After a quota error, wait for a -verified reset or `Retry-After` before any GitHub-backed command, `loopzero` -waiters included; REST `/rate_limit` does not prove GraphQL capacity. +Never use handwritten `gh` waits or `gh pr checks --watch` (it misses future checks). +Other polling needs a deadline, visible progress, preserved stderr and a stop on errors. +Never poll GraphQL-backed `gh pr view`, `gh pr checks` or `gh pr list` (shared quota). +Use REST `gh api` for one-off PR reads and comments. After a quota error, wait for +a verified reset or `Retry-After` before GitHub-backed commands, including +`loopzero` waiters. REST `/rate_limit` does not prove GraphQL capacity. diff --git a/core/VISUALS.md b/core/VISUALS.md index 6f29bd98..9e199539 100644 --- a/core/VISUALS.md +++ b/core/VISUALS.md @@ -1,22 +1,13 @@ # Visual formats and channels -- **Steps, branches or states** (pipelines, lifecycles, before/after flow) - → flowchart or state diagram. -- **3+ components, ownership or trust/data boundaries** → component or - boundary diagram. -- **2+ options, trade-offs or before/after behaviors** → comparison table - or decision matrix. -- **Trends, proportions, latency/cost or counts over time** (status updates, - briefings, retros, proposals) → chart or compact infographic. -- **UI layout, navigation, visual hierarchy or interactive flow** (design - docs, UI issues, owner product choices) → standalone mockup - ([design-mockup](skills/design-mockup/SKILL.md)) or annotated wireframe - before coding. **Every issue that refers to a UI function** (bug, feature, - change or help text) shows that UI when filed: an annotated screenshot of - the current screen, plus a mockup of any intended change. **UI-changing - PRs** attach before/after (or expected vs. actual) screenshots. -- **Match the channel:** in interactive owner chat (such as T3), render - charts, infographics and HTML mockups inline or embed Mermaid/images; on - GitHub (PRs, issues, checked-in design docs), use Mermaid and Markdown - tables, and embed a static PNG preview whenever linking a checked-in HTML - mockup (GitHub does not render `.html` inline). +- **Steps, branches or states** → flowchart or state diagram. +- **3+ components, ownership or trust/data boundaries** → component or boundary diagram. +- **2+ options, trade-offs or before/after behaviors** → table or decision matrix. +- **Trends, proportions, latency/cost or counts over time** → chart or compact infographic. +- **UI layout, navigation, hierarchy or flow** → standalone [mockup](skills/design-mockup/SKILL.md) + or annotated wireframe before coding. File every issue referring to a UI function with + an annotated screenshot of the current UI and a mockup of any intended change. + UI-changing PRs attach before/after (or expected vs. actual) screenshots. +- **Interactive owner chat** → render charts, infographics or HTML inline, or embed + Mermaid/images. **GitHub** → use Mermaid or Markdown tables and embed a static + PNG preview whenever linking a checked-in HTML mockup. diff --git a/core/skills/implement/SKILL.md b/core/skills/implement/SKILL.md index 45b983de..fd485570 100644 --- a/core/skills/implement/SKILL.md +++ b/core/skills/implement/SKILL.md @@ -20,18 +20,14 @@ implementing the change. For changes touching guards, auth, permissions, sessions, secrets or trust boundaries, record a short design pass in Notes before the first code edit: threats, invariants and chosen approach. -Implement that bounded acceptance with behavior proof; use -[write-tests](../write-tests/SKILL.md) for test design and regression evidence. -For migrations, -authorization, locking/concurrency or policy logic, list edge cases in Acceptance -and map each to a test or recorded evidence. Observe required UI/runtime behavior within actual permissions; include visual -proof for UI changes per [Reporting](../../CONTRACT.md#reporting). Required -acceptance that remains unobserved stays open -with a next-action owner. Record the tested revision, observations, trade-offs -and limits in Notes or human Validation. Start primary review only with a -completed passing `loopzero check` receipt for the exact pushed head. Focused -tests and running checks are intermediate evidence. Reuse a passing same-head -receipt under the [contract's reuse rules](../../CONTRACT.md#gate-execution-and-delivery-priority). +Use [write-tests](../write-tests/SKILL.md) to prove the bounded acceptance. +Map migration, authorization, locking/concurrency and policy edge cases to tests +or evidence in Acceptance. Observe required UI and runtime behavior under actual +permissions, with visual proof for UI changes per [Reporting](../../CONTRACT.md#reporting). +Leave unobserved acceptance open with a next-action owner. Record revision, +observations, trade-offs and limits in Notes or human Validation. +Primary review requires a completed passing `loopzero check` receipt at the pushed head. +Focused or ongoing checks are intermediate. Follow the [receipt reuse rules](../../CONTRACT.md#gate-execution-and-delivery-priority). Run commands expected to take more than about two minutes detached as in [Long-running jobs](../../../docs/DELEGATION.md#long-running-jobs). @@ -66,18 +62,15 @@ Before the check and draft push for primary review, rebase your own commits onto Leave base merges out of a branch awaiting its delta. For base or check-script changes after review, follow the [Review budget](../../CONTRACT.md#review-budget). -Preserve the primary for the delta and the delta for -post-review fixes. Split the PR if resolving conflicts requires rewriting its reviewed history. +Preserve the primary for the delta and the delta for post-review fixes. -Do not bypass the sandbox, change the check list or enable `[checks].network` -to pass checks. Report base failures rather than work around them. If you must -work around a deterministic defect outside your scope, fix it in a follow-up PR -when small and test-only; otherwise file it labelled `urgent`, naming the PR it -blocks. Only you -commit, never checks, hooks or scripts. If acceptance requires unlisted paths, -update task and PR first; request scope decisions for expanded proof seams or -ownership. If interrupted, preserve an adoptable diff and report remaining -acceptance, checks and findings under the contract's handoff rules. +Never bypass the sandbox, change the check list or enable `[checks].network` to pass checks. +Report base failures without working around them. If a deterministic out-of-scope +defect requires a workaround, use a follow-up PR for a small test-only fix or file an `urgent` issue naming the +blocked PR. Commit yourself, never from checks, hooks or scripts. Update task and +PR before adding paths required by acceptance, and get scope decisions before +expanding proof seams or ownership. On interruption, preserve an adoptable diff +and report remaining acceptance, checks and findings per the contract. A host or runner change that alters what jobs see (ports, env vars, paths, services, labels) goes live only after the repository change consuming it is on diff --git a/core/skills/plan/SKILL.md b/core/skills/plan/SKILL.md index 2f8d29d0..d723bde1 100644 --- a/core/skills/plan/SKILL.md +++ b/core/skills/plan/SKILL.md @@ -13,10 +13,10 @@ issue or request. Size each task to one outcome someone can accept, or one failure family, in one PR by default. Every PR pays a fixed check, review and queue cost: keep tests, generated files, docs and related cleanup with their change, and batch queued, non-urgent chores of one risk class and area, never -into a risky change or ahead of an urgent fix. Split or sequence only at a -seam: separate rollout or rollback, a measurement that could change the design, -a higher risk class (a destructive migration, a trust boundary), separate -ownership, or a diff too wide to review reliably. Scale +into a risky change or ahead of an urgent fix. Split an outcome only at a named +seam. The seam must be separate rollout or rollback, a measurement that could +change the design, a higher risk class (a destructive migration, a trust +boundary), separate ownership or a diff too wide to review reliably. Scale planning depth to the cost of reversing a choice later: spend planning on persisted state, CLI or config interfaces, trust boundaries, public APIs and shared abstractions—asking "if this assumption changes after merge, what diff --git a/core/skills/work-issue/SKILL.md b/core/skills/work-issue/SKILL.md index 307db299..73e4ae31 100644 --- a/core/skills/work-issue/SKILL.md +++ b/core/skills/work-issue/SKILL.md @@ -23,20 +23,16 @@ Record observable acceptance and the issue link. Deliver through [seeded browser state or changed prerequisites](reference.md#fresh-stack-proof), and [implementation or repairs without a base merge queue](reference.md#integration-without-a-queue). -Before review, record documentation impact; update docs or give an -evidence-backed reason they need no update. -Before publication, inspect the issue and linked artifacts for its lifecycle -blueprint. Include required completion in the closing delivery. A child issue -does not own its parent's blueprint. -Recheck collisions before publication and again before merge, rereading live -acceptance, prior delivery and ownership. Reconcile changed state before proceeding. -On approval, run readiness at the approved head and defer suggestions and cleanup. -Before making a source edit for the [delta](../../CONTRACT.md#review-budget), name -the unmet acceptance criterion or newly verified defect that requires it. -Review, CI and post-merge acceptance waits remain this task. -Before using [CI or observation-based acceptance](reference.md#acceptance-evidence) -or [resuming after interruption or context loss](reference.md#re-entry), -follow the linked safeguards. +Before review, update docs as needed and record changes or evidence that none are needed. +Before publication, inspect the issue and links for its lifecycle blueprint and +include required completion in the closing delivery. A child does not own its parent's blueprint. +Recheck collisions, live acceptance, prior delivery and ownership before +publication and merge. Reconcile changes before proceeding. +On approval, run readiness at the approved head and defer optional changes. +Before a source edit for [delta](../../CONTRACT.md#review-budget), name the unmet +criterion or verified defect. Own review, CI and post-merge acceptance waits. +Use the [acceptance evidence](reference.md#acceptance-evidence) and +[re-entry](reference.md#re-entry) safeguards when applicable. Partial delivery uses `Refs #N` and never closes the issue, including work needing post-merge observation. Closing keywords belong only to complete acceptance; diff --git a/core/skills/write-design-doc/reference.md b/core/skills/write-design-doc/reference.md index 740da970..20b4a44a 100644 --- a/core/skills/write-design-doc/reference.md +++ b/core/skills/write-design-doc/reference.md @@ -4,14 +4,11 @@ Apply at the depth appropriate to the artifact and next action. ## Grounding -Read the request, complete existing artifact, linked issue or task, upstream -decisions, repository guidance, and enough code to verify current-state claims, -including claimed component capabilities. Separate facts from assumptions. -Requester decisions stay settled unless evidence invalidates their premise; -assumptions remain vetoable; deferred decisions become open questions. - -Repository changes follow [the delivery contract](../../CONTRACT.md) in the -task worktree. +Read the request, complete existing artifact, linked issue or task, upstream decisions, +repository guidance and code needed to verify current claims and capabilities. +Separate facts from assumptions. Keep requester decisions settled unless evidence +invalidates their premise. Keep assumptions vetoable and deferred decisions open. +Follow [the delivery contract](../../CONTRACT.md) in the task worktree. ## Artifact Choice @@ -23,11 +20,10 @@ task worktree. | Specify bounded implementation | Blueprint | | Explain an existing procedure | Guide | -Use repository paths, templates, frontmatter, terminology, and labels. -Without a convention, choose and explain a descriptive Markdown path in the -documentation tree; avoid a new hierarchy for one document. -Link sources of truth instead of copying them. When replacing instructions with -a link, point to the section that carries the same rule for the same actor. +Use repository conventions for paths, templates, frontmatter, terms and labels. +Without a convention, choose and explain a descriptive Markdown path in the docs +tree and avoid a new hierarchy for one document. Replace copies with links to the +section that carries the same rule for the same actor. ## Design Contract