@ouro.bot/cli 0.1.0-alpha.1555 → 0.1.0-alpha.1557

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/changelog.json +12 -0
  2. package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
  3. package/deploy/unraid/sanctuary.xml +1 -1
  4. package/desk.lock.json +3 -3
  5. package/dist/mind/diary.js +7 -3
  6. package/dist/repertoire/tools-notes.js +4 -0
  7. package/npm-shrinkwrap.json +2 -2
  8. package/package.json +1 -1
  9. package/vendor/desk/.claude-plugin/plugin.json +1 -1
  10. package/vendor/desk/.ouro-desk.json +3 -3
  11. package/vendor/desk/CHANGELOG.md +600 -0
  12. package/vendor/desk/activation/copilot-root.flattened-bundle.json +2 -2
  13. package/vendor/desk/activation/desk.activation.json +5 -5
  14. package/vendor/desk/agency.json +1 -1
  15. package/vendor/desk/docs/sessions.md +1 -1
  16. package/vendor/desk/hooks/lib/boot-checks.cjs +1 -1
  17. package/vendor/desk/hooks/lib/child-agent.cjs +2 -2
  18. package/vendor/desk/hooks/lib/factory-end.cjs +4 -1
  19. package/vendor/desk/mcp/README.md +6 -0
  20. package/vendor/desk/mcp/bootstrap.cjs +64 -38
  21. package/vendor/desk/mcp/idle-proxy.cjs +14 -6
  22. package/vendor/desk/mcp/scripts/crew.js +3 -3
  23. package/vendor/desk/mcp/scripts/drains-launcher.mjs +6 -5
  24. package/vendor/desk/mcp/scripts/factory.js +15 -6
  25. package/vendor/desk/mcp/scripts/resolve-desk-root.js +1 -2
  26. package/vendor/desk/mcp/src/actions/desk-session.actions.mts +16 -1
  27. package/vendor/desk/mcp/src/actions/desk.actions.mts +2 -2
  28. package/vendor/desk/mcp/src/actions/generated/desk/actions.json +36 -1
  29. package/vendor/desk/mcp/src/actions/generated/desk/mcp.json +34 -1
  30. package/vendor/desk/mcp/src/activation/superpowers-context.js +9 -0
  31. package/vendor/desk/mcp/src/crew/workspace.js +30 -4
  32. package/vendor/desk/mcp/src/desk/card-commit-guard.js +3 -2
  33. package/vendor/desk/mcp/src/desk/content-home.js +16 -0
  34. package/vendor/desk/mcp/src/indexer/discover.js +8 -0
  35. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-claims.ts +2 -1
  36. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-command.ts +20 -0
  37. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/mcp.ts +1 -1
  38. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.ts +40 -2
  39. package/vendor/desk/mcp/src/runtime/boot.js +0 -1
  40. package/vendor/desk/mcp/src/runtime/deliver.js +42 -5
  41. package/vendor/desk/mcp/src/runtime/drains-cli.js +9 -1
  42. package/vendor/desk/mcp/src/runtime/drains.js +7 -4
  43. package/vendor/desk/mcp/src/runtime/hosted.js +5 -3
  44. package/vendor/desk/mcp/src/runtime/pending-migrations.js +5 -1
  45. package/vendor/desk/mcp/src/runtime/pr-publication.js +55 -29
  46. package/vendor/desk/mcp/src/runtime/relays.js +10 -1
  47. package/vendor/desk/mcp/src/runtime/remote-identity.js +22 -0
  48. package/vendor/desk/mcp/src/runtime/sessions-cli.js +6 -6
  49. package/vendor/desk/mcp/src/runtime/sync-worker.js +10 -8
  50. package/vendor/desk/mcp/src/runtime/unmerged-saves.js +29 -3
  51. package/vendor/desk/mcp/src/server.js +3 -2
  52. package/vendor/desk/mcp/src/tool-names.js +0 -2
  53. package/vendor/desk/mcp/src/tool-schemas.js +3 -8
  54. package/vendor/desk/mcp/src/tools/archive-links.js +3 -0
  55. package/vendor/desk/mcp/src/tools/desk-save.js +8 -3
  56. package/vendor/desk/mcp/src/tools/move.js +32 -3
  57. package/vendor/desk/mcp/src/tools/sibling-desk.js +10 -4
  58. package/vendor/desk/mcp/src/tools/status.js +9 -6
  59. package/vendor/desk/mcp/src/tools/task-log.js +6 -2
  60. package/vendor/desk/mcp/src/tools/task.js +17 -5
  61. package/vendor/desk/mcp/src/util/citations.js +54 -0
  62. package/vendor/desk/mcp/web-auth.cjs +17 -0
  63. package/vendor/desk/mcp/web-sso.cjs +52 -0
  64. package/vendor/desk/plugin.json +2 -2
  65. package/vendor/desk/skills/add-workspace-mcp/SKILL.md +2 -2
  66. package/vendor/desk/skills/archive-workflow/SKILL.md +1 -1
  67. package/vendor/desk/skills/coordinating-lanes/SKILL.md +24 -0
  68. package/vendor/desk/skills/evidence-discipline/SKILL.md +8 -12
  69. package/vendor/desk/skills/git-hygiene/SKILL.md +6 -0
  70. package/vendor/desk/skills/interaction-style/SKILL.md +4 -2
  71. package/vendor/desk/skills/live-ui-iteration/SKILL.md +35 -0
  72. package/vendor/desk/skills/operator-voice-comments/SKILL.md +4 -0
  73. package/vendor/desk/skills/outside-approval/SKILL.md +10 -0
  74. package/vendor/desk/skills/pr-feedback-on-own-pr/SKILL.md +5 -1
  75. package/vendor/desk/skills/pr-reviewer-audit/SKILL.md +1 -1
  76. package/vendor/desk/skills/pr-reviewer-audit/helpers/audit.py +19 -1
  77. package/vendor/desk/skills/pr-reviewer-audit/helpers/test_audit.py +37 -1
  78. package/vendor/desk/skills/pr-self-review/SKILL.md +1 -1
  79. package/vendor/desk/skills/pr-surface-hygiene/SKILL.md +28 -4
  80. package/vendor/desk/skills/pr-surface-hygiene/check-visual-proof.cjs +27 -14
  81. package/vendor/desk/skills/prior-art/SKILL.md +14 -0
  82. package/vendor/desk/skills/runtime-symptom-investigation/SKILL.md +5 -1
  83. package/vendor/desk/skills/session-resumption/SKILL.md +3 -1
  84. package/vendor/desk/skills/using-desk/SKILL.md +3 -3
  85. package/vendor/desk/skills/using-superpowers-with-desk/SKILL.md +2 -0
  86. package/vendor/desk/skills/visual-proof/SKILL.md +42 -0
  87. package/vendor/desk/skills/work-orchestration/SKILL.md +17 -2
@@ -480,7 +480,43 @@ def test_module_run_as_main_exits_zero() -> None:
480
480
  runpy.run_path(str(HERE / "audit.py"), run_name="__main__")
481
481
  except SystemExit as exc:
482
482
  exited = True
483
- assert exc.code == 0
483
+ assert exc.code == 3
484
484
  assert exited, "_cli_main should have raised SystemExit"
485
485
  finally:
486
486
  sys.argv = original_argv
487
+
488
+
489
+ def test_cli_main_reports_a_refusal_and_exits_three(capsys) -> None: # type: ignore[no-untyped-def]
490
+ import audit
491
+
492
+ def refuse(org, project, repo_id, pr_id, refusals): # type: ignore[no-untyped-def]
493
+ refusals.append("tenant-mismatch")
494
+ return {"file_to_groups": {}, "approver_ranking": []}
495
+
496
+ with _mock.patch.object(audit, "main", side_effect=refuse):
497
+ rc = audit._cli_main(["org", "proj", "repo", "42"])
498
+
499
+ assert rc == 3
500
+ assert "tenant-mismatch:" in capsys.readouterr().err
501
+
502
+
503
+ def test_cli_main_reports_an_http_error_and_exits_one(capsys) -> None: # type: ignore[no-untyped-def]
504
+ import audit
505
+
506
+ with _mock.patch.object(audit, "main", side_effect=audit.requests.HTTPError("403")):
507
+ rc = audit._cli_main(["org", "proj", "repo", "42"])
508
+
509
+ assert rc == 1
510
+ assert "http-error: 403" in capsys.readouterr().err
511
+
512
+
513
+ def test_main_records_the_token_refusal() -> None:
514
+ import audit
515
+
516
+ refusals: list[str] = []
517
+ with _mock.patch.object(audit, "ensure_tenant", return_value=True), _mock.patch.object(
518
+ audit, "_get_bearer_token", side_effect=RuntimeError("no token")
519
+ ):
520
+ audit.main("o", "p", "r", "1", refusals)
521
+
522
+ assert refusals == ["token-unavailable"]
@@ -33,7 +33,7 @@ Build the context bundle the evaluator reads. Per repository (no cross-repo merg
33
33
  One evaluator pass over the bundle; it may re-read cited files for more context. Each raw finding has `rule_id`, `severity` (`blocking`, `recommended` or `nit`), `resolution_path` (set in Phase 4), `file`, `line`, `title`, `body`, an optional `suggested_fix`, and `grounding_verified: false`.
34
34
 
35
35
  - **Sub-threshold signals.** When the evaluator's reasoning says it considered flagging X and didn't, treat X as a candidate. If a cold reviewer would plausibly flag it, fix it cheaply now or report it as sub-threshold but likely visible. Ignore only the purely hypothetical.
36
- - **Baseline rubric** (`PSR-001` to `PSR-005`, used only when no other source applies): null safety, deliberate error handling, a test for each new public function, unused imports, obvious typos. Nothing about naming, layout or idiom; those are repo conventions.
36
+ - **Baseline rubric** (`PSR-001` to `PSR-005`, used only when no other source applies): null safety, deliberate error handling, a missing test for a regression nothing else would catch (`evidence-discipline`, "A test earns its place"), unused imports, obvious typos. Nothing about naming, layout or idiom; those are repo conventions.
37
37
  - **Names carry contracts.** A C# `Try*` method that throws outside cancellation paths, or a `Get*`, `Find*` or `Parse*` that silently returns `null`, is a `recommended` finding, whether or not the diff introduced it. If the throw tracing is uncertain, ask ("is this a Try-pattern violation?").
38
38
  - **Walk into helpers.** When a catch, log, metric, audit or telemetry block calls a helper with the same exception or argument, read the helper for a double log or double emit; read helpers called within five lines of any candidate. If the helper's source is not available, ask.
39
39
  - **Author comments are hypotheses.** For `// intentional`, `// by design` or `// parallel to X`, ask whether you would flag the code without the comment; if so, flag it with the comment's rationale in the body. Read the code the comment points to; the same pattern there doubles the signal.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pr-surface-hygiene
3
- description: Rules for writing and auditing PR descriptions and comments. Use before drafting, opening or marking a PR ready, and before publishing comments.
3
+ description: Rules for writing and auditing PR descriptions and comments, and the Tim check every PR passes before it reaches GitHub or a reviewer. Use before drafting or opening a PR, changing its body, marking it ready or requesting review, and before publishing comments.
4
4
  ---
5
5
 
6
6
  # PR surface hygiene
@@ -57,7 +57,7 @@ List only items that are in the same repo, could have been part of this diff and
57
57
 
58
58
  ## PSH-008 — use the repo's template and convention
59
59
 
60
- Before opening any PR, look for a template (`.github/PULL_REQUEST_TEMPLATE.md`, `.github/PULL_REQUEST_TEMPLATE/*.md`, a root or `docs/` `pull_request_template.md`, or the host's equivalent) and read the last two or three merged PRs, which show the real convention; if the operator has written PRs in the repo, mirror theirs. Never invent sections (`## Problem`, `## Background`, `## Validation`) where a template or convention exists. Without either, a short `## What` and `## Why` is the safe default.
60
+ Before opening any PR, look for a template (`.github/PULL_REQUEST_TEMPLATE.md`, `.github/PULL_REQUEST_TEMPLATE/*.md`, a root or `docs/` `pull_request_template.md`, or the host's equivalent) and read the last two or three merged PRs, which show the real convention; if the operator has written PRs in the repo, mirror theirs. Never invent sections (`## Problem`, `## Background`, `## Validation`) where a template or convention exists. Without either, a short `## What` and `## Why` is the safe default. Fill every section the template has, with no placeholders; if you can't tell what a section wants, read how recent merged PRs filled it. A demo or screenshot section gets before and after captures from a working build whenever the change is something a person sees ([`visual-proof`](../visual-proof/SKILL.md)); PSH-010 is the gate.
61
61
 
62
62
  ## PSH-009 — one body for human and agent readers
63
63
 
@@ -73,16 +73,40 @@ Run the bundled checker against the exact body to publish, using the actual load
73
73
  node <loaded-desk-plugin>/skills/pr-surface-hygiene/check-visual-proof.cjs --body <pr-body-file> --visual-change yes
74
74
  ```
75
75
 
76
- Use `--visual-change no` only after confirming the full diff is nonvisual. A nonzero exit blocks publication or readiness. The checker accepts HTTPS Markdown images, reference images and quoted HTML `<img src="...">` images; it rejects common comment/code examples and placeholders. It is a conservative presence check, not a Markdown renderer or proof that a URL loads, a capture is genuine or a reason is true. Inspect the rendered body, open the images with the intended reviewer access and check their relevance and privacy. Badges, unrelated images, hidden markup and stale captures do not count even if the checker passes. Replace unsupported markup with a plain inline image; do not skip the check.
76
+ Use `--visual-change no` only after confirming the full diff is nonvisual. A nonzero exit blocks publication or readiness. The checker accepts HTTPS Markdown images, reference images and quoted HTML `<img src="...">` images; it rejects common comment/code examples, placeholders and URLs that need a repository sign-in to load (`github.com/.../blob/` or `/raw/`, `raw.githubusercontent.com`, tokenised or `jwt`-signed `githubusercontent.com`, including `private-user-images`, which are temporary renderer URLs rather than the stored attachment reference; canonical `github.com/user-attachments/assets/...` URLs pass the checker). It cannot tell whether any other URL loads for the reader. It is a conservative presence check, not a Markdown renderer or proof that a URL loads, a capture is genuine or a reason is true. Inspect the rendered body, open the images with the intended reviewer access and check their relevance and privacy. Badges, unrelated images, hidden markup and stale captures do not count even if the checker passes. Replace unsupported markup with a plain inline image; do not skip the check.
77
77
 
78
78
  After authorized creation or a body update, read the saved body back from the PR, rerun the same check and inspect its rendering. Repeat against the current diff and saved body immediately before a ready transition or review announcement; earlier success does not cover later edits. If published proof is missing or invalid, block the readiness claim, report the gap and correct it only within existing authority. This gate never grants permission to create, edit or change a PR's state.
79
79
 
80
- For private captures, use [`evidence-discipline`, "Privacy-safe rendered proof"](../evidence-discipline/SKILL.md#privacy-safe-rendered-proof). If safe proof cannot be produced, keep readiness blocked and state what remains unverified.
80
+ For private captures, use [`visual-proof`, "Privacy-safe rendered proof"](../visual-proof/SKILL.md#privacy-safe-rendered-proof). If safe proof cannot be produced, keep readiness blocked and state what remains unverified.
81
81
 
82
82
  ## PSH-011 — offer repository enforcement; do not install it by default
83
83
 
84
84
  When the repository lacks equivalent enforcement, recommend the [opt-in PR template and CI check](repository-setup.md). Offer setup once in the current task; a PR-writing request does not authorize changing repository workflows, templates, required checks, permissions or user-wide rules. Preserve existing templates and policy. Install only within explicit repository-owner approval, and leave required-check settings to their authorized owner.
85
85
 
86
+ ## PSH-012 — the body says why the diff exists
87
+
88
+ The reviewer learns what changed from the diff. The body tells them what the diff can't: why it exists. Say that in a short paragraph: the problem or constraint, the approach in a sentence, and the one decision a reviewer would otherwise question. When the reason is obvious, one sentence is the whole body; go past a paragraph only for a reason you can name.
89
+
90
+ - **Describe the approach; never recap the diff.** "Moves retries into the client so callers stop retrying twice" is fine. A list of the files, functions or skills changed is not, at any length.
91
+ - **Never narrate how you got here.** No "tried X, then Y", "after review" or history of iterations. State each decision as its current reason ("uses Y because Z").
92
+ - **No process status.** CI results, force-push notes and self-review findings already fixed stay out (PSH-001).
93
+ - **Put nuance where the reviewer meets it.** Why one line reads as it does is a code comment; a point about one hunk is a review comment on that hunk. Only why the whole diff exists belongs in the body.
94
+ - **Link context inline,** on the words it explains, to the thing's own page rather than the PR that made it, instead of writing backstory or a trailing "Related" list.
95
+
96
+ Adapted from Tim Clem's [`pr-author`](https://github.com/tclem/dotfiles/blob/main/copilot/skills/pr-author/SKILL.md).
97
+
98
+ ## PSH-013 — the Tim check before a PR reaches GitHub or a reviewer
99
+
100
+ Before you open a pull request, change its body, mark it ready or ask anyone to review it, ask yourself: would Tim Clem approve the shape of this PR? Tim is the engineer whose [Copilot instructions](https://github.com/tclem/dotfiles/tree/main/copilot) PSH-012 and the rules below adapt. Run the check yourself on the current diff and saved body and fix what fails before going on; it is your gate, so never wait for the operator to run it. It passes when:
101
+
102
+ 1. The body passes PSH-012, fills the repository's template (PSH-008) and carries visual proof where a person sees the change (PSH-010).
103
+ 2. Every new or changed test catches a concrete regression and fails with the fix reverted ([`evidence-discipline`, "A test earns its place"](../evidence-discipline/SKILL.md#a-test-earns-its-place)).
104
+ 3. A fix changes the one place the invariant broke, with no backstop stacked on it ([`runtime-symptom-investigation`, "Fix the one place it broke"](../runtime-symptom-investigation/SKILL.md#fix-the-one-place-it-broke)).
105
+ 4. Every review thread has a reply backed by evidence, and only threads the evidence settles are resolved ([`pr-feedback-on-own-pr`, "Each review item is a hypothesis"](../pr-feedback-on-own-pr/SKILL.md#each-review-item-is-a-hypothesis)).
106
+ 5. Required checks are green on a head that includes the current base branch.
107
+
108
+ Items 1 to 4 hold before the PR is opened or its body changes. Item 5 holds before it is marked ready, sent to a reviewer or merged by hand; auto-merge already waits for it. The check adds no signature or AI credit line: credit stays with the person (`plain-language`).
109
+
86
110
  ## Allowed specifics
87
111
 
88
112
  - A reply inside a reviewer's thread may cite that thread's line or quote its code.
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env node
2
+ // ax: read-only. It reads the PR body from stdin or a file and prints a verdict; it changes nothing.
2
3
  "use strict";
3
-
4
4
  const fs = require("node:fs");
5
5
 
6
+ // An Error carrying the stable `code` printed before its message.
7
+ const coded = (code, message, ErrorType = Error) => Object.assign(new ErrorType(message), { code });
8
+
6
9
  function visibleBody(body) {
7
10
  let fence = null;
8
11
  return body.replace(/<!--[\s\S]*?(?:-->|$)/gu, "").split(/\r?\n/u).filter((line) => {
@@ -16,10 +19,19 @@ function visibleBody(body) {
16
19
  }).join("\n").replace(/(`+)[\s\S]*?\1/gu, "");
17
20
  }
18
21
 
22
+ // Temporary signed renderer URLs (private-user-images, jwt/token) expire in minutes; the canonical github.com/user-attachments/assets URL is the stored reference. GitHub blob/raw and tokenised URLs need the viewer's repository session, which mobile and chat clients often lack.
23
+ function authGatedGitHubUrl(url) {
24
+ const host = url.hostname.toLowerCase();
25
+ return host === "raw.githubusercontent.com" ||
26
+ host.endsWith(".githubusercontent.com") && (url.searchParams.has("token") || url.searchParams.has("jwt")) ||
27
+ host === "private-user-images.githubusercontent.com" ||
28
+ (host === "github.com" || host === "www.github.com") && /^\/[^/]+\/[^/]+\/(?:blob|raw)\//iu.test(url.pathname);
29
+ }
30
+
19
31
  function hostedImage(value) {
20
32
  try {
21
33
  const url = new URL(value);
22
- return url.protocol === "https:" && !url.username && !url.password &&
34
+ return url.protocol === "https:" && !url.username && !url.password && !authGatedGitHubUrl(url) &&
23
35
  !/^(?:www\.)?example\.(?:com|org|net)$/iu.test(url.hostname) &&
24
36
  !/[<>{}]/u.test(value);
25
37
  } catch {
@@ -28,12 +40,12 @@ function hostedImage(value) {
28
40
  }
29
41
 
30
42
  function checkVisualProof(body, visualChange = "unknown") {
31
- if (typeof body !== "string") throw new TypeError("PR body must be a string");
32
- if (!["yes", "no", "unknown"].includes(visualChange)) throw new Error("--visual-change must be yes, no or unknown");
43
+ if (typeof body !== "string") throw coded("usage", "PR body must be a string", TypeError);
44
+ if (!["yes", "no", "unknown"].includes(visualChange)) throw coded("usage", "--visual-change must be yes, no or unknown");
33
45
  const visible = visibleBody(body);
34
46
  const reasons = [...visible.matchAll(/^No visual change:[ \t]*(.+)$/gmu)].map((match) => match[1].trim());
35
47
  if (visualChange === "yes" && reasons.length) {
36
- return { ok: false, message: "A visible change cannot use No visual change; capture the changed surface with safe data." };
48
+ return { ok: false, code: "visual-change-contradicts-reason", message: "A visible change cannot use No visual change; capture the changed surface with safe data." };
37
49
  }
38
50
 
39
51
  const inlineImage = [...visible.matchAll(/(?<!\\)!\[[^\]\n]*\]\(\s*(?:<([^>\n]+)>|([^\s)]+))(?:[ \t]+["'][^"\n]*["'])?\s*\)/gu)]
@@ -52,7 +64,7 @@ function checkVisualProof(body, visualChange = "unknown") {
52
64
  if (reason && visualChange !== "yes") {
53
65
  return { ok: true, message: "No visual change reason present; review its accuracy against the full diff before publication." };
54
66
  }
55
- return { ok: false, message: "Add a real rendered capture as an inline image, or No visual change: <specific accurate reason> for nonvisual work. Links, comments and code examples do not count." };
67
+ return { ok: false, code: "no-visual-proof", message: "Add a real rendered capture as an inline image, or No visual change: <specific accurate reason> for nonvisual work. Links, comments and code examples do not count." };
56
68
  }
57
69
 
58
70
  function main(argv) {
@@ -62,28 +74,29 @@ function main(argv) {
62
74
  for (let index = 0; index < argv.length; index += 1) {
63
75
  const arg = argv[index];
64
76
  if (["--stdin", "--body", "--event"].includes(arg)) {
65
- if (source) throw new Error("Choose exactly one of --stdin, --body <file> or --event <file>");
77
+ if (source) throw coded("usage", "Choose exactly one of --stdin, --body <file> or --event <file>");
66
78
  source = arg;
67
79
  if (arg !== "--stdin") {
68
80
  sourcePath = argv[++index];
69
- if (!sourcePath || sourcePath.startsWith("--")) throw new Error(`${arg} requires a file`);
81
+ if (!sourcePath || sourcePath.startsWith("--")) throw coded("usage", `${arg} requires a file`);
70
82
  }
71
83
  } else if (arg === "--visual-change") {
72
84
  visualChange = argv[++index];
73
- if (!["yes", "no", "unknown"].includes(visualChange)) throw new Error("--visual-change must be yes, no or unknown");
85
+ if (!["yes", "no", "unknown"].includes(visualChange)) throw coded("usage", "--visual-change must be yes, no or unknown");
74
86
  } else {
75
- throw new Error(`Unknown argument: ${arg}`);
87
+ throw coded("usage", `Unknown argument: ${arg}`);
76
88
  }
77
89
  }
78
- if (!source) throw new Error("Usage: node check-visual-proof.cjs (--stdin | --body <file> | --event <file>) [--visual-change yes|no|unknown]");
90
+ if (!source) throw coded("usage", "Usage: node check-visual-proof.cjs (--stdin | --body <file> | --event <file>) [--visual-change yes|no|unknown]");
79
91
  let body = fs.readFileSync(source === "--stdin" ? 0 : sourcePath, "utf8");
80
92
  if (source === "--event") {
81
93
  const event = JSON.parse(body);
82
- if (!event.pull_request || !Object.hasOwn(event.pull_request, "body")) throw new Error("Event must contain pull_request.body");
94
+ if (!event.pull_request || !Object.hasOwn(event.pull_request, "body")) throw coded("bad-event", "Event must contain pull_request.body");
83
95
  body = event.pull_request.body ?? "";
84
96
  }
85
97
  const result = checkVisualProof(body, visualChange);
86
- (result.ok ? console.log : console.error)(result.message);
98
+ if (result.ok) console.log(result.message);
99
+ else console.error(`${result.code}: ${result.message}`);
87
100
  return result.ok ? 0 : 1;
88
101
  }
89
102
 
@@ -91,7 +104,7 @@ if (require.main === module) {
91
104
  try {
92
105
  process.exitCode = main(process.argv.slice(2));
93
106
  } catch (error) {
94
- console.error(`Visual-proof check failed: ${error.message}`);
107
+ console.error(`${/^[a-z-]+$/u.test(error.code) ? error.code : "unreadable-input"}: Visual-proof check failed: ${error.message}`);
95
108
  process.exitCode = 2;
96
109
  }
97
110
  }
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: prior-art
3
+ description: Use when work draws on something that already exists, such as another app, a competitor, a prototype, a Figma or other design file, or a screenshot or example someone shares, before building a method, benchmark, explainer or tool that someone may already have published, and before you create a component, module, helper or file that resembles one the codebase already has.
4
+ ---
5
+
6
+ # Prior art: steal, don't copy
7
+
8
+ Before building a method, benchmark, explainer or tool, find existing published work and cite it; adopt what fits, build only the gap and say how yours differs. Then, for any prior art the work draws on (another app, a prototype, a design file, a competitor, a screenshot someone shares), steal, don't copy. Don't reproduce its surface: its layout, wording or feature list. Work out why it works for the people who use it and make that reason yours, so thoroughly that the result is no longer theirs. Every element you keep earns its place in your design or goes. Name what you took and, piece by piece, why it works for your people, in the design note or pull request and in your reply, so a reviewer can judge the borrowing.
9
+
10
+ For example, someone shares a competitor's dense, borderless list and asks for "ours, the same way". Don't ship that list. Ask what each trait does for its users (density lets a person scan 40 rows at once; icons at the left let the eye run down one column), check whether your people have the same need, keep what does that job for them, drop what doesn't, and say which is which in the design note.
11
+
12
+ ## Extend what exists; don't duplicate it
13
+
14
+ Before you create a component, module, helper or file, search the codebase for one that does the same job or nearly so. If one does, make it more flexible (a prop, slot, variant or option) and use it; a copy is a second thing to keep in step, and copies drift. Ari Mendelow, the owner: "generally, when we can reuse a component, we MUST", and "otherwise, we get crazy drift. always opt for making a component more flexible over making a duplicate component". Build a new one only when no existing one can take the difference without breaking its other users, and say in the pull request what you searched and why nothing fit. For an Ouro UI screen, the same rule is step 13 of the [Ouro design-craft guide](https://ui.ouroboros.bot/docs/design-craft/).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: runtime-symptom-investigation
3
- description: Use when the operator reports a runtime symptom (error, regression, unexpected output, slowdown), to investigate the running system before reading source.
3
+ description: Use when the operator reports a runtime symptom (error, regression, unexpected output, slowdown), to investigate the running system before reading source, and before writing any bug fix, to fix the one place it broke.
4
4
  ---
5
5
 
6
6
  # Runtime-symptom investigation
@@ -44,6 +44,10 @@ Do not change product behavior while the cause remains a hypothesis. A surviving
44
44
 
45
45
  Record every temporary diagnostic change before use. Before handback, reverse only that diagnostic delta and verify its added content and artifacts are absent. Preserve unrelated concurrent changes; a pre-investigation fingerprint is evidence, not ownership. Never restore a fingerprint by undoing a concurrent user or tool change. A diagnosis leaves no logging, probes, injected failures, temporary configuration, or other diagnostic edits in the worktree.
46
46
 
47
+ ## Fix the one place it broke
48
+
49
+ Before writing a fix, name in one sentence the one place where the invariant broke; if you can't, keep investigating. Fix it there, even when that touches more files than a patch where the symptom shows. Don't stack a backstop on a real fix: a fallback, retry, default, extra `try`/`catch`, extra hash input or "just in case" check guarding the same invariant is a second fix that hides the next bug, and needing one means the fix is in the wrong layer. A layer stays only if you can name the separate invariant it enforces, a failure from real use (not an imagined chain of events) that it prevents, and what it costs when it drifts. Separate concerns at separate layers (authentication beside input validation), fallbacks for an unreliable upstream such as the network, and compatibility shims with an end date are not backstops. Pin the regression test on the behavior a person sees, not on a layer, and if a later reader is likely to add the backstop you rejected, leave a one-line comment at the site naming the invariant that makes it unnecessary. Adapted from Tim Clem's [`fixing-root-causes`](https://github.com/tclem/dotfiles/blob/main/copilot/skills/fixing-root-causes/SKILL.md).
50
+
47
51
  ## Asking the operator IS one of the cheapest observations
48
52
 
49
53
  The operator has:
@@ -19,7 +19,9 @@ A successor starts from the focused card's `**Next step:**`, its `log.md` (task_
19
19
 
20
20
  ## Protected evidence
21
21
 
22
- Private or sensitive evidence (raw transcripts, credentials, private measurement, customer data) stays outside Git, in an approved private location. The desk records a pointer and a non-sensitive summary. Customer data means data about other people that a product or employer holds. The operator's own records are context, not customer data: their personal, financial, legal and medical records, their correspondence, case files, drafts and screenshots of their own accounts go in the task's folder and are committed, because the desk is theirs. Only secrets and credentials among them stay out. Everything else (briefs, reports, reviews, plans, small logs, checkpoints) goes in the task's folder in the desk and is committed to `main`. No host memory, plan or task store is a substitute, and neither is a harness's home folder such as `~/.copilot`: it belongs to one machine, unsynced and unshared, so never write instructions, lessons, preferences or context there. Settings there are generated from the desk; when a rule does not load, fix where it loads from.
22
+ Private or sensitive evidence (raw transcripts, credentials, private measurement, customer data) stays outside Git, in an approved private location. The desk records a pointer and a non-sensitive summary. Customer data means data about other people that a product or employer holds. The operator's own records are context, not customer data: their personal, financial, legal and medical records, their correspondence, case files, drafts and screenshots of their own accounts go in the task's folder and are committed, because the desk is theirs. Only secrets and credentials among them stay out.
23
+
24
+ A secret never enters your context, a log, a transcript or Git, and you never type a password into a page. Moving one without reading it is allowed: drive the browser to the prefilled token page, let the human clear only the passkey, then pipe the value from the clipboard into its store (`pbpaste | gh secret set NAME --body-file -`) and clear the clipboard. Record only its name, scope, expiry and location. Everything else (briefs, reports, reviews, plans, small logs, checkpoints) goes in the task's folder in the desk and is committed to `main`. No host memory, plan or task store is a substitute, and neither is a harness's home folder such as `~/.copilot`: it belongs to one machine, unsynced and unshared, so never write instructions, lessons, preferences or context there. Settings there are generated from the desk; when a rule does not load, fix where it loads from.
23
25
 
24
26
  ## Checkpoint before handoff
25
27
 
@@ -13,7 +13,7 @@ The human supplies intent, constraints, authority and endpoint. The agent owns e
13
13
 
14
14
  ## Alignment, then ownership
15
15
 
16
- Before go, state the outcome, assumptions, recommended decisions and completion checks together; get explicit go. A request to start, permission over a target, or a surface nobody can answer is not go: on new work, send that note ending "Say go and I'll start on <outcome>.", then stop without editing files. Use plain chat, no question forms. After go, own routine choices and scoped work to done; return only for blockers, voice (sent as them), their decisions, money, user-only credentials, irreversible acts or unclear authority. Grants lift only named gates. How to ask: `interaction-style` §6.
16
+ Before go, state the outcome, assumptions, recommended decisions and completion checks together; get explicit go. A request to start, permission over a target, or a surface nobody can answer is not go: on new work, send that note ending "Say go and I'll start on <outcome>.", then stop without editing files. Use plain chat, no question forms. Answer a question; don't act on it. After go, own routine choices and scoped work to done; return only for blockers, voice (sent as them), their decisions, money, user-only credentials, irreversible acts or unclear authority. Grants lift only named gates. How to ask: `interaction-style` §6.
17
17
 
18
18
  ## Delivery and sign-off
19
19
 
@@ -27,7 +27,7 @@ Delivered: <result and proof>
27
27
  Accept or send back?
28
28
  ```
29
29
 
30
- Put evidence in Delivered; carry on. Record the answer later with task_signoff, never in this turn. A child agent never asks for acceptance or calls task_signoff.
30
+ Put evidence in Delivered. Record the answer later with task_signoff, never in this turn. A child agent never asks for acceptance or calls task_signoff.
31
31
 
32
32
  ## Authority
33
33
 
@@ -39,7 +39,7 @@ Every factual claim to a human or an agent, drafts included, carries an inline l
39
39
 
40
40
  ## Own the stack
41
41
 
42
- If tooling or instructions get in your way, work around them with ordinary tools, never past a safeguard or permission denial, then file the tool's bug with evidence: `friction_add` (`about` system, `plugin` the tool, evidence in `body`) opens an issue on its repo for its drain. Ari's agents own those tools; others' agents file it and ping Ari. Start no unrequested repair work (`desk-problem`). When instructions are confusing or conflict, say so and record the friction; an agent must not be silently confused.
42
+ If tooling or instructions get in your way, work around them with ordinary tools, never past a safeguard or permission denial, then file the tool's bug with evidence: `friction_add` (`about` system, `plugin` the tool) opens an issue on its repo for its drain. Ari's agents own those tools; others' agents file it and ping Ari. Start no unrequested repair work (`desk-problem`). When instructions are confusing or conflict, say so and record the friction; an agent must not be silently confused.
43
43
 
44
44
  ## Engineering work
45
45
 
@@ -98,6 +98,8 @@ Include the mapper's `briefRules` in **both the implementer brief and every revi
98
98
 
99
99
  > verify or validate in your own worktree; never in a checkout your task does not own
100
100
 
101
+ When you write a brief or a skill (including with `writing-skills`, or from a book or other source), follow `plain-language`: a brief never tells a subagent to add a copyright rule, disclaimer or read-the-original line, and the skill carries none, even when an existing skill's references open with one.
102
+
101
103
  The first `briefRules` entry is a `Desk-Task: <track>/<slug>` line, which must be copied verbatim, on its own line, into every implementer and reviewer brief so the factory can credit each subagent's work to its own task. The second entry, `Never call task_focus; your work is credited through the Desk-Task line.`, comes with it and is copied the same way: the factory ignores a child's `task_focus` call, and because a child shares the session's Desk server, the call could only change the controller's own focus and hint. A child never calls it.
102
104
 
103
105
  The mapper also adds the rule `Never call task_signoff.` to `briefRules`, and it is always there, with or without the `Desk-Task` line. Copy it into every brief the same way: only the main agent records the operator's answer to a delivery, so a child never calls `task_signoff`.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: visual-proof
3
+ description: Use before you send, show, attach or caption any screenshot, capture, image, mockup, recording or rendered page (in chat, a pull request, a report or an update), including one someone else made, before checking or reviewing how output looks (alignment, spacing, clipping, contrast, counts), and whenever work changes something a person sees.
4
+ ---
5
+
6
+ # Visual proof
7
+
8
+ ## Measure what a check can measure
9
+
10
+ Never check by eye what code can measure: alignment, spacing, clipping and overflow, contrast, colours against the design tokens, counts, and text against its source. Write the check as code (a script, a test, a lint, a layout assertion in the renderer), run it, and report its output; agents are unreliable at this by eye, and a script gives the same answer every run. Keep the check where the next change will run it, such as the repository's tests or CI. Look by eye only for what no check can judge: whether the screen makes sense, feels right and matches the intent. The same goes for briefing another agent: never ask it to eyeball what a check can measure.
11
+
12
+ ## Iterating with a person? Don't send pictures
13
+
14
+ When the person is giving feedback on a UI, run it live with them instead of sending captures: load `live-ui-iteration`. Screenshots stay for proof in a pull request, a report or a handoff.
15
+
16
+ ## Look before you show
17
+
18
+ Look at what you show before you show it. Before handing a person a capture, mockup, screenshot or rendered page, open it at full size and inspect it as they will: content cut off or covered, an alarming or wrong status colour, demo-only or placeholder text, a stale label, shortcut or number, anything that contradicts your claim. Run the measurable checks above first. Then write down what is wrong before you write the caption; "nothing" is a finding you reach after those checks and a full look, not before them. Fix what they would catch, capture again, and only then show it. When there is a reference (an approved mockup, a canonical image, the previous capture), compare against it side by side yourself. A capture you have not looked at is not proof, and passing one on unexamined hands the person your review.
19
+
20
+ ## Capture it
21
+
22
+ Capture visual proof by default whenever work touches something a person sees: a screen, a setting before and after a change, an agent's reply, a refusal, an error, a result. The rule follows what the work touches, not what it is called ("spike", "look into", "review"), and a brief's silence never waives it. Capture as you go, at each stage, including working or doing logs and intermediate milestones such as pull request opened, reviewed, or merged states. When a milestone claims a rendered, installed, merged, rollout or other consumer-visible state, capture that real result, not a terminal success line. It supplements rather than replaces tests, logs and system-of-record readback. Capture only the relevant bounded view, never secrets or sensitive/private content; if capture is impossible, record why and use the strongest safe alternative. Nonvisual work gets no artificial screenshots. Put the proof inline where the reader looks (the pull request body, milestone report or delivery message), not only as a link to an artifact; for an agent-side change, the agent's actual reply or the command output showing the changed behaviour is the proof. Run the scenario on synthetic data, never on the human's own real data or account ("Offline evals on synthetic data, online evals from counts") and never on real data that would expose colleagues or customers.
23
+
24
+ Every picture says what to notice. Give each one a short caption: where to look, and what changed or what it proves, in plain words. For example: "Bottom card: a reply in the thread now notifies you; before, only @mentions did." Mark the spot with a box or an arrow when that's easy, and crop to what matters. A picture without a "what to notice" caption isn't proof.
25
+
26
+ ## Privacy-safe rendered proof
27
+
28
+ If a real capture would expose private messages, identities, customer data or secrets, do not upload it. Reproduce the changed surface through the actual product renderer with safe, owned, made-up data in an isolated fixture or test account already authorized for this work, then capture that real render. Prefer a bounded crop that excludes private content when it still proves the claim. Check the pixels and metadata before sharing; do not copy private content into fixtures.
29
+
30
+ Label the inline capture `Synthetic-data capture` and state what it demonstrates and what it does not: for example, “Synthetic-data capture: the changed renderer with made-up entries; does not verify private account integration.” Keep test/log evidence for behavior outside that scope. A drawing, AI-generated mock, reconstructed screenshot or screenshot of a different implementation is not proof of the running product. A synthetic render cannot prove a private live run, installed state, merge or rollout.
31
+
32
+ If neither a safe bounded capture nor a real synthetic-data render is possible, record the reason and the strongest safe alternative, but do not call the visual claim verified. PR creation and readiness remain subject to [`pr-surface-hygiene` PSH-010](../pr-surface-hygiene/SKILL.md#psh-010--visual-proof-blocks-creation-and-readiness); a visible change stays blocked rather than acquiring a false `No visual change` reason.
33
+
34
+ ## Every delivered image must render where the recipient reads it
35
+
36
+ This covers any image you deliver (proof, mockup, report figure, chat attachment), not only proof. Delivery is part of the work. Show it in the client the recipient actually uses (a phone, GitHub Mobile, Teams, a browser signed out of your account), not only the one you wrote it in. A URL that opens for you proves nothing about them.
37
+
38
+ - Preserve the source's confidentiality and intended audience. Never move private bytes onto public or anonymous hosting to make an image render; if no destination keeps the audience right, say so and send nothing.
39
+ - Before upload, inspect the destination's access controls (who can open the link, whether it expires or is signed) and the image's pixels and metadata for private content. Prefer a bounded crop or synthetic data.
40
+ - Private repository `blob` or `raw` URLs, `raw.githubusercontent.com`, tokenised links and signed `private-user-images` URLs (minutes-long renderer URLs, not the stored reference) are a known risk: they depend on the viewer's sign-in, and clients may show a broken image. Do not present them as mobile-safe. `check-visual-proof.cjs` rejects them in pull request bodies; that is URL syntax only, not evidence that any other URL renders.
41
+ - Name the client you checked. If you could not check the recipient's client, say the rendering is unverified.
42
+ - A method (for example `gh` user-attachments) counts as supported only for the clients and repository access someone has tested; do not generalise from one.
@@ -15,6 +15,8 @@ Read the existing task, agreement and plan before choosing the matching Superpow
15
15
 
16
16
  Before new work starts, list every decision in it that needs the human's judgment: voice, relationships, irreversible or hard-to-undo choices, and real ambiguity. Naming and filing are not among them: the agent owns them (`start-task`). Resolve each one you can from the request, the code or a sensible default. Put the rest to the human now, not when you reach the fork, and especially any entangled calls, where one answer changes another or changes work done before the fork. Ask them as one batch, each with your recommendation, so execution then runs without blocking on the human. A fork that could not have been foreseen is raised when it appears; one you did not think about beforehand is not unforeseeable.
17
17
 
18
+ Think it through before you ask for go. Read the actual source material, write the whole plan, and have an independent reviewer (a rubber-duck or critic agent) check it until neither of you finds a gap. Then ask for go once, with that whole plan, and start no implementation until you have it. End the reply on the go request itself ("Say go and I'll start on <outcome>."), after any scope or summary; a reply that ends on scope, or only says implementation has not started, has not asked. Never drip-feed half-plans or surface gaps one message at a time.
19
+
18
20
  ## Authority and dependencies
19
21
 
20
22
  Verify repository authority and the approved contribution path before any branch, worktree or source edit in a code repository. In a desk, work on `main` and commit your own paths. Read-only requests remain read-only. Delegation and worktree creation stay within the recorded mandate.
@@ -35,6 +37,8 @@ Every child brief carries the outcome, scope, authority, source, write set, depe
35
37
 
36
38
  Every child brief carries one line `Desk-Task: <track>/<slug>` naming the task the child's work serves, or `Desk-Task: none` when it serves none: the factory credits a child's work to a task only through that line or the task the parent held when it spawned the child. No hook adds or checks the line on any host: the line in the brief is the whole mechanism, so copy it into every brief. A child that dispatches its own child copies the line from its own brief.
37
39
 
40
+ Every pull request a child opens names its opener: `Desk-Session: <the child's session id>` and `Desk-Parent-Session: <the coordinator's id>` on their own lines in the body, beside the Desk-Task line. The mapper's `briefRules` carries this as a rule, with the coordinator's id filled in, so a drain can read an orphaned pull request's owner off it.
41
+
38
42
  Every brief carries this visual-proof sentence, whatever the work is called ("investigate", "look into", "review", "spike"), because the child follows its brief and the rule keys on what the work touches, not on a label: "Capture visual proof as you go: whenever the work touches something a person sees (a screen, a setting before and after, an agent's reply, a refusal, an error, a result), save bounded screenshots, never secrets or private content, into your own folder `evidence/<brief name>/` beside your brief file, named after the brief file without its extension (or, when the brief is not a file, `evidence/<a short name for your assignment>/` in the task's desk folder), so children whose briefs share a folder never overwrite each other's files, and return an Evidence list beside Resources that names each file and what it shows, or says why nothing was visible. A brief's silence never waives this." Every child return contract asks for that **Evidence** list beside **Resources**. When integrating a return, check Evidence as you check Resources, and send back work that touched a visible surface but came back without visuals.
39
43
 
40
44
  Include `task-lifecycle`'s **Resources** inventory in every child return contract, including reviewers: every created worktree and local/remote branch, exact repository/path/ref, current state, owner and verified disposition, or `none created`. Record ownership and disposition at creation, not from branch-name patterns at cleanup time. At each task, iteration or delegated-assignment boundary, its owner closes out through `git-hygiene`; the Superpowers controller removes completed task worktrees through `using-superpowers-with-desk`'s mapped controller duty before releasing their reservations. A return or root exit alone does not prove that delegated, remote, MCP or command writers are absent.
@@ -96,14 +100,16 @@ This is the default for all work, not only multi-step plans. `superpowers:dispat
96
100
 
97
101
  - **Run independent streams at the same time.** Never hold a stream for one it doesn't depend on.
98
102
  - **Fast-follow downstream.** When an upstream artifact changes, update what depends on it right away, not in a final sweep.
99
- - **Keep the root for coordination.** When delegation is authorized, a subagent tool is available and the human has not chosen inline execution, hand work whose scope warrants a separate context to bounded children so the conversation does not wait on it. Do small, clear work directly when a worker adds no value.
103
+ - **A coordinator delegates.** A lead or coordinator session follows `coordinating-lanes`: it hands the work to lanes and doesn't do it inline.
104
+ - **Keep the root for coordination.** When delegation is authorized, a subagent tool is available and the human has not chosen inline execution, hand work whose scope warrants a separate context to bounded children so the conversation does not wait on it. Do small, clear work directly when a worker adds no value. In a lead or coordinator session, `coordinating-lanes` replaces this small-work exception.
100
105
  - **Ship as you go: usable milestones early and often.** This governs delivery, after alignment: new work still waits for the go its alignment asks for, and the person's limits (local only, no push, one repository) still hold. Within them, each increment goes live once reviewed and green, with every surface it touches (README, docs, site, the page people watch) updated in the same change, and each merge reported with where it's live. Never hold finished work for the end of a pass or for a sibling change; a surface that can't update is a blocker to raise at once ([ship as you go](https://github.com/ourostack/.github/blob/main/agents/ship-the-smallest-unit.md)).
101
106
  - **Work smart, not hard.** Ambitious quality work needs no justification, but do it smartly: don't loop on reruns or rounds of rewording, don't duplicate another lane's work, and stop work whose goal has been superseded.
102
107
  - **Aim every lane at what the human will feel.** A lane's goal is a number the human would feel (frames, milliseconds, a count that must match), measured on synthetic data shaped like theirs, never a release, a gate or a pull-request count. Status to the human leads with those numbers, broken first (`interaction-style`, "Status leads with what the operator would feel").
103
108
  - **Profile before choosing a fix.** For anything that is slow, janky or stalls, measure where the time actually goes with a real profiler or trace before deciding what to change; a cause read from code is a hypothesis until a measurement shows it. Fix that cause. CI is the merge gate, not the workbench: never iterate on a theory by pushing and rerunning CI (`fast-honest-ci`).
104
109
  - **Timebox: watch the number, not the activity.** About every 90 minutes, check each lane's felt number yourself. If it has not moved, change the approach that hour (profile, a different design, a different lane) and say so in the next update. Never answer a flat number with another batch of the same kind of change, more pull requests or more CI runs; simple things should not take days.
105
110
  - **Side quests get their own lanes.** When the human asks for something off the main outcome and delegation is available (the conditions in "Keep the root for coordination"), start a separate lane for it at once instead of doing it in the coordinator or queueing it behind the main work. Without delegation, finish the main work's current step, then do the side quest, and never let it displace the main outcome. The coordinator stays on the main outcome: it judges each lane's results against the bar and redirects, it does not relay messages between lanes and the human, and it does not take a lane's work itself.
106
- - **Place every lane with `shepherd place`.** Before starting a lane, run `shepherd place [--repo <owner/name>] [--local]` and start it where it answers (cloud, mini or laptop), from the mini's swap and load, the laptop's heartbeat and the cloud 403 windows. When it answers laptop, run the start command it prints (`./mac session laptop open <folder> '<prompt>' --agent desk:worker`, through Agency Hub) as the lane start; do not only mention it. A cloud start that returns 403 is recorded with `shepherd place cloud-blocked`. Stagger heavy builds so the human's own work stays responsive.
111
+ - **Place every lane with `shepherd place`.** Before starting a lane, run `shepherd place [--repo <owner/name>] [--local]` and start it where it answers (cloud, mini or laptop), from the mini's swap and load, the laptop's heartbeat and the cloud 403 windows. When it answers laptop, run the start command it prints (`./mac session laptop open <folder> '<prompt>' --agent desk:worker`) as the lane start; do not only mention it. A cloud start that returns 403 is recorded with `shepherd place cloud-blocked`. Stagger heavy builds so the human's own work stays responsive.
112
+ - **Reach the operator's other machines with SSH over their tailnet.** To read or message a session on another of the operator's machines, `ssh` to it over their tailnet and read the session there (`~/.copilot/session-state/<id>/events.jsonl`, or `sessions.js tail`). Send a message the way that session takes input (`sessions.js send`, run there over SSH), or open a GitHub issue its watchdog reads. Never start with Agency Hub: it fails to deliver to sessions that have no Hub inbox. Use Hub only when nothing else reaches the machine.
107
113
  - **Propose from evidence.** When the human asks how you will get there or when, answer only with what has been measured, and say plainly what has not. A lane's cause or date that rests on an unprofiled theory is not a plan: relay neither; get the measurement first and say when you will have it.
108
114
 
109
115
  ### Human waits block only dependent work
@@ -114,8 +120,11 @@ When an independent outcome warrants a separate context, delegation is authorize
114
120
 
115
121
  Existing go is not a repeated permission or design gate. Preserve actual design uncertainty, security, access and consent boundaries, conflict reservations, review and correctness gates. Urgency changes sequencing, not authority or proof; it does not authorize an unbounded fleet.
116
122
 
123
+ Work that waits on approval from someone outside the operator's authority follows `outside-approval`.
124
+
117
125
  ## Where agents live
118
126
 
127
+ - **Every loop has an owner.** A loop, watcher or script that enqueues, re-queues or merges pull requests runs under a named owning session, recorded where others will look (the task card or the loop's own description). An ownerless loop keeps acting after the reason for it has gone; stop it or give it an owner.
119
128
  - **Every agent has a home, and starts there.** A session starts in the workspace that holds its task and context: its desk, or for an agent that several people or agents share, their shared workspace. It never starts homed in a repository it works on. To change code, it makes a worktree of that repository from its home, and the session stays in the desk. When you launch, dispatch or hand off a session, give it its home as the working directory; if all you have is a repository path, find the desk that owns the work.
120
129
  - **A home's name says it is a home.** Wherever sessions are listed by workspace, a person should tell a desk from a repository at a glance. Name a desk or shared workspace for what it is ("work desk", "personal desk", "team shared workspace"), and a repository by its owner and name ("acme/widgets"), not by a bare folder name that a desk and a repository can share. When a tool names workspaces after their folders, rename them, and make the rename part of the machine's setup so a new machine gets it too.
121
130
  - **Always-on work lives on the always-on host.** Work meant to run continuously, such as issue drains, watchers and schedulers, lives on a host that stays up and is not carried around. Create it there, in that host's own session list, and make it easy to find there: pinned or named so the person sees it first. A laptop that sleeps or travels hosts no always-on work, and a leftover copy on another host is retired once the always-on one is verified.
@@ -153,6 +162,12 @@ Spend less per piece of work, never by slowing the work. Pick the cheapest model
153
162
 
154
163
  Finished work merges. Never leave a finished pull request sitting unmerged, in any repository: merge once its required checks pass, and let the default branch's own checks be the safety net. If a repository will let you merge, merge when confident. Being inside the operator's work boundary does not by itself require their approval. Do not ask the human to approve a pull request unless the repository or platform itself enforces a human approval (a required reviewer, a branch policy) or they asked for it on that work. When a platform does enforce one, request it with the exact reviewed head and status and resume after it. You own the whole terminal state either way: prepare the PR, wait for checks, review, merge, deploy, smoke, clean up, and never report completion while the PR remains open.
155
164
 
165
+ Merge on the final head's own checks. Before a merge you trigger yourself, confirm that the required checks ran on the exact commit you are merging and finished green; a green rollup from an earlier head says nothing about the last push. Auto-merge already waits for this.
166
+
167
+ A merge hold on a shared repository (for a release window or a speed streak) names who lifts it and when. Whoever lifts it restores everything the hold changed, such as merge labels, auto-merge and queue entries, in the same step. Never let a hold outlive its reason.
168
+
169
+ Never hold a merge for a nit. A cosmetic issue, or a low-severity review finding that loses no data and has a known fix, doesn't block an otherwise green, reviewed pull request: merge it and open the fix as a fast-follow pull request straight away. Among the agent's own review findings, only correctness, data-loss and security problems block a merge; a human reviewer's open thread follows `pr-feedback-on-own-pr`. Where the repository requires resolved conversations, reply on the nit with the fast-follow pull request's link and leave the thread for the reviewer to close.
170
+
156
171
  ## The factory itself
157
172
 
158
173
  When the work is the factory itself, invoke `factory-work` first. Start from Lean, not as a lens applied on request: before you propose, design or judge anything, name the governing Lean concept (the full improvement cycle, plan, do, check, act, is one of them), and carry a "Lean reading" section in every factory design and plan.