@accord-dev/accord 0.5.0 → 0.5.1

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 (3) hide show
  1. package/README.md +12 -11
  2. package/dist/cli.js +982 -158
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2,10 +2,11 @@
2
2
  import { createRequire } from "node:module";
3
3
  import { Command, CommanderError, Option } from "commander";
4
4
  import { execFileSync, spawnSync } from "node:child_process";
5
- import { appendFileSync, closeSync, existsSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
5
+ import { appendFileSync, closeSync, existsSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
6
6
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
7
7
  import { styleText } from "node:util";
8
8
  import { homedir, tmpdir } from "node:os";
9
+ import { createHash } from "node:crypto";
9
10
  import { MessageChannel, Worker, receiveMessageOnPort } from "node:worker_threads";
10
11
  //#region \0rolldown/runtime.js
11
12
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
@@ -20716,7 +20717,7 @@ var config_schema_default = {
20716
20717
  },
20717
20718
  "url": {
20718
20719
  "type": "string",
20719
- "pattern": "^https://[^\\s/?#]+(/[^\\s?#]*)?$"
20720
+ "pattern": "^https://[^\\s/?#@]+(/[^\\s?#]*)?$"
20720
20721
  },
20721
20722
  "command": {
20722
20723
  "type": "string",
@@ -21050,7 +21051,10 @@ var config_schema_default = {
21050
21051
  { "pattern": "^(?!.*\\{n\\}.*\\{n\\})" },
21051
21052
  { "pattern": "^(?!.*\\{type\\}.*\\{type\\})" },
21052
21053
  { "pattern": "^(?!.*\\{initials\\}.*\\{initials\\})" },
21053
- { "pattern": "^(?:[A-Za-z0-9]|\\{type\\}|\\{initials\\})" }
21054
+ { "pattern": "^(?:[A-Za-z0-9]|\\{type\\}|\\{initials\\})" },
21055
+ { "pattern": "^(?!.*\\.\\.)" },
21056
+ { "pattern": "[^.]$" },
21057
+ { "pattern": "^(?!.*\\.lock$)" }
21054
21058
  ]
21055
21059
  },
21056
21060
  "types": {
@@ -21772,7 +21776,7 @@ const HEADING_2 = /^round [0-9]+ head ([0-9a-f]{7,40})(?: \((added code round 1|
21772
21776
  const SHA = /^[0-9a-f]{7,40}$/i;
21773
21777
  const FINDING_2 = /^(Must|Should|Nice) ([1-9][0-9]*)(?: \[(?:patch|plan-gap|intent-gap)\])?: (\S.*)$/i;
21774
21778
  const LOCATION = /^(?:`([^`]+)`|([^\s`](?:.*?[^\s`])?))(?::[1-9][0-9]*(?:-[1-9][0-9]*)?)?$/;
21775
- const STATE = /^(open|deferred|fixed in [0-9a-f]{7,40})$/;
21779
+ const STATE$1 = /^(open|deferred|fixed in [0-9a-f]{7,40})$/;
21776
21780
  const VERDICT$1 = /^verdict:\s*(\S+)(.*)$/;
21777
21781
  const QUOTED = /^\s+".*\S.*"\s*$/;
21778
21782
  const HEAD_NOISE = /^(?:[-*+>]\s+|\d+[.)]\s*|[*_~`]+|[([]\s*)/;
@@ -21943,7 +21947,7 @@ function parseFindingV2(line) {
21943
21947
  segs.pop();
21944
21948
  }
21945
21949
  if (segs.length < 3) return void 0;
21946
- const state = STATE.exec(segs[segs.length - 1].trim());
21950
+ const state = STATE$1.exec(segs[segs.length - 1].trim());
21947
21951
  const where = segs[segs.length - 2].trim();
21948
21952
  if (state === null) return void 0;
21949
21953
  const loc = where === "none" ? null : LOCATION.exec(where);
@@ -22294,7 +22298,7 @@ const MARKER$1 = /^\(@ac-[1-9][0-9]*\)$/;
22294
22298
  const DEFERRED = /^\s*[-*+]\s+(review|plan|approach) ([1-9][0-9]*)\.([1-9][0-9]*)(?: cycle ([1-9][0-9]*))?:\s*\S/;
22295
22299
  const FAILING_CASE = / — failing case:\s*\S/;
22296
22300
  /** A declared path, trimmed, with one pair of surrounding backticks removed. */
22297
- const declared = (t) => {
22301
+ const declared$1 = (t) => {
22298
22302
  const x = t.trim();
22299
22303
  return x.length >= 2 && x.startsWith("`") && x.endsWith("`") ? x.slice(1, -1).trim() : x;
22300
22304
  };
@@ -22432,7 +22436,7 @@ function parseLedger(file, text) {
22432
22436
  for (const line of normaliseText(text).split("\n")) {
22433
22437
  const w = WORDING.exec(line);
22434
22438
  if (w) wordingOnly.push({
22435
- path: declared(w[1]),
22439
+ path: declared$1(w[1]),
22436
22440
  reason: w[2]
22437
22441
  });
22438
22442
  const d = DONE$1.exec(line);
@@ -22497,9 +22501,9 @@ function parseReview(file, text) {
22497
22501
  for (const l of rounds[rounds.length - 1]?.lines ?? []) {
22498
22502
  const t = l.text.replace(LIST_MARKER, "").trim();
22499
22503
  const c = CONFIRMED.exec(t);
22500
- if (c) confirmed.push(declared(c[1]));
22504
+ if (c) confirmed.push(declared$1(c[1]));
22501
22505
  const n = NOT_INTERFACE.exec(t);
22502
- if (n) notInterface.push(declared(n[1]));
22506
+ if (n) notInterface.push(declared$1(n[1]));
22503
22507
  }
22504
22508
  if (confirmed.length > 0) review = {
22505
22509
  ...review,
@@ -22771,7 +22775,7 @@ function loadSnapshot(input) {
22771
22775
  }
22772
22776
  /** The release that ships version 2 records: a version 1 record is allowed only while its pin is below it. */
22773
22777
  const RECORD_V2_FROM = "0.3.1";
22774
- const PLAIN$2 = /^(\d+)\.(\d+)\.(\d+)$/;
22778
+ const PLAIN$1 = /^(\d+)\.(\d+)\.(\d+)$/;
22775
22779
  /** The top-level `accord:` string of a config.yml text, read even when the config fails its schema; undefined when there is none. */
22776
22780
  function pinOf(configText) {
22777
22781
  const pin = parseYamlMap("accord/config.yml", normaliseText(configText), 0).map?.accord;
@@ -22786,8 +22790,8 @@ function rulesetOfTicket(ticketText) {
22786
22790
  }
22787
22791
  /** -1, 0 or 1; both arguments are plain x.y.z. */
22788
22792
  function compare$1(a, b) {
22789
- const x = PLAIN$2.exec(a).slice(1).map(Number);
22790
- const y = PLAIN$2.exec(b).slice(1).map(Number);
22793
+ const x = PLAIN$1.exec(a).slice(1).map(Number);
22794
+ const y = PLAIN$1.exec(b).slice(1).map(Number);
22791
22795
  for (let i = 0; i < 3; i++) if (x[i] !== y[i]) return x[i] < y[i] ? -1 : 1;
22792
22796
  return 0;
22793
22797
  }
@@ -22805,17 +22809,18 @@ const GROUNDS_V2_FROM = "0.4.1";
22805
22809
  const DISCUSS_FROM = "0.4.1";
22806
22810
  /** True only when `pin` is a plain x.y.z below `from` and, when `basePin` is a plain x.y.z, not below `basePin`: the rules before `from` hold. */
22807
22811
  function pinBefore(from, pin, basePin) {
22808
- if (pin === void 0 || !PLAIN$2.test(pin) || compare$1(pin, from) >= 0) return false;
22809
- return basePin === void 0 || !PLAIN$2.test(basePin) || compare$1(pin, basePin) >= 0;
22812
+ if (pin === void 0 || !PLAIN$1.test(pin) || compare$1(pin, from) >= 0) return false;
22813
+ return basePin === void 0 || !PLAIN$1.test(basePin) || compare$1(pin, basePin) >= 0;
22810
22814
  }
22811
22815
  /**
22812
22816
  * ST-LN-91 D-15: true when the ticket `id` was claimed under rules older than `from`, so it keeps them until it is done, whatever the
22813
22817
  * working-tree pin says after an upgrade. The reader of the claim pin for every Phase 3 rule that follows the claim: the discuss rule (DISCUSS_FROM), the
22814
22818
  * approach cap with its `## Closed` and no-allowance rules and the approval block that goes with it (APPROACH_CAP_FROM), the plan format rules (PLAN_FORMAT_FROM:
22815
22819
  * the `after:` line, the interfaces block, the task length), the plan cap with its count stop and the plan checker at round 1 (PLAN_CAP_FROM), and the plan
22816
- * checker's round-1 grounds rule (PLAN_GROUNDS_FROM, D-19). ST-LN-96 D-02: the read order is fixed. First the ticket's own frontmatter `ruleset` when it is a plain x.y.z (written
22817
- * at the claim from RULESET_FROM, so a squash or a rebase merge, which drops or rewrites the claim commit, cannot change the rules the ticket was claimed under); a `ruleset` that
22818
- * is not a plain x.y.z is ignored. Then the chain below, unchanged. The five constants are one release, and a test names the equality (D-15). Other rules follow the record or the plan instead and do not ask this pin: the Phase 2 grounds rule (which a ticket claimed earlier keeps) and the plan fix scope read the pin at the first round of the record
22820
+ * checker's round-1 grounds rule (PLAN_GROUNDS_FROM, D-19). ST-LN-96 D-02, CR-01: the read order is fixed. A failed claim read is false first. Then the claim fact's `ruleset`, the first
22821
+ * value the branch held (written at the claim from RULESET_FROM, so a rebase, which rewrites the claim commit, cannot change the rules the ticket was claimed under). Then, only when git
22822
+ * holds no claim fact with a pin (a squash merge dropped the claim commit), the ticket's own frontmatter `ruleset`, which is all there is there. A hand edit of the working-tree field never
22823
+ * outranks what git read, because `accord approve` runs no gate that could catch it, and with no fact it counts only on a ticket that is done (it holds `verified_hash` and `verified_commit`). A `ruleset` that is not a plain x.y.z is ignored. Then the chain below. The five constants are one release, and a test names the equality (D-15). Other rules follow the record or the plan instead and do not ask this pin: the Phase 2 grounds rule (which a ticket claimed earlier keeps) and the plan fix scope read the pin at the first round of the record
22819
22824
  * (GROUNDS_V2_FROM, `recordPins`, and the round facts of review.md), the version 2 review record reads it at the first review round (RECORD_V2_FROM),
22820
22825
  * and the plan size rule reads the pin at the plan's baseline commit (PLAN_SIZE_FROM, `planPins`). So a record begun after an upgrade, on a ticket
22821
22826
  * claimed before it, gets the grounds rule and keeps the five approach rounds. The chain: the host's claim fact (`claimPins[id]`: the pin at the
@@ -22824,10 +22829,13 @@ function pinBefore(from, pin, basePin) {
22824
22829
  * the working-tree pin decides, as `planSizeMissing` falls back.
22825
22830
  */
22826
22831
  function claimPinBefore(snapshot, id, from) {
22827
- const own = Object.hasOwn(snapshot.tickets, id) ? snapshot.tickets[id].frontmatter?.ruleset : void 0;
22828
- if (own !== void 0 && PLAIN$2.test(own)) return pinBefore(from, own);
22829
22832
  const fact = Object.hasOwn(snapshot.claimPins ?? {}, id) ? snapshot.claimPins[id] : void 0;
22830
22833
  if (fact !== void 0 && "error" in fact) return false;
22834
+ if (fact?.ruleset !== void 0 && PLAIN$1.test(fact.ruleset)) return pinBefore(from, fact.ruleset);
22835
+ const ticket = Object.hasOwn(snapshot.tickets, id) ? snapshot.tickets[id] : void 0;
22836
+ const finished = ticket?.frontmatter?.verified_commit !== void 0 && ticket.frontmatter.verified_hash !== void 0;
22837
+ const own = fact?.pin !== void 0 || !finished ? void 0 : ticket?.frontmatter?.ruleset;
22838
+ if (own !== void 0 && PLAIN$1.test(own)) return pinBefore(from, own);
22831
22839
  const { pin, basePin } = fact ?? {
22832
22840
  pin: snapshot.config?.accord,
22833
22841
  basePin: void 0
@@ -24242,19 +24250,19 @@ function sectionValue(t, name) {
24242
24250
  if (s === void 0) return void 0;
24243
24251
  return stripHtmlComments(s.lines).map((l) => l.text.trim()).find((x) => x !== "");
24244
24252
  }
24245
- const firstLine$3 = (text) => text.split("\n").map((l) => l.trim()).find((l) => l !== "") ?? "";
24253
+ const firstLine$2 = (text) => text.split("\n").map((l) => l.trim()).find((l) => l !== "") ?? "";
24246
24254
  const TIMEBOX = /^([1-9][0-9]*)\s+(minutes?|hours?)$/;
24247
24255
  const BUDGET = /^([1-9][0-9]*)(k|M)?\s+weighted tokens$/;
24248
24256
  const safe = (n) => Number.isSafeInteger(n) ? n : void 0;
24249
24257
  /** The timebox in minutes, read from the first non-blank line as `<n> minutes` or `<n> hours`; undefined when it does not read so. */
24250
24258
  function readTimebox(text) {
24251
- const m = TIMEBOX.exec(firstLine$3(text));
24259
+ const m = TIMEBOX.exec(firstLine$2(text));
24252
24260
  if (m === null) return void 0;
24253
24261
  return safe(Number(m[1]) * (m[2].startsWith("hour") ? 60 : 1));
24254
24262
  }
24255
24263
  /** The token budget in weighted tokens, read from the first non-blank line as `<n> weighted tokens`, n optionally ending in k or M. */
24256
24264
  function readTokenBudget(text) {
24257
- const m = BUDGET.exec(firstLine$3(text));
24265
+ const m = BUDGET.exec(firstLine$2(text));
24258
24266
  if (m === null) return void 0;
24259
24267
  return safe(Number(m[1]) * (m[2] === "k" ? 1e3 : m[2] === "M" ? 1e6 : 1));
24260
24268
  }
@@ -24805,46 +24813,46 @@ function doneOnDefault(snapshot, id, fallback = snapshot) {
24805
24813
  }
24806
24814
  const agents = {
24807
24815
  "auditor.md": "---\nname: accord-auditor\ndescription: Reads only the ticket and tries to find two different readings of each acceptance criterion, for the intent interview's audit. Never proposes fixes, never reads code.\ntools: Read\nroute: auditor\n---\n\nYou test whether each acceptance criterion can be read only one way.\n\n- You read; you never edit a file.\n- Your input is the path of one ticket file. You read only that file.\n- For each `@ac-n`, you try to write two different, reasonable readings that would lead to different code.\n- You report per criterion, in order, either `@ac-n: one reading`, or `@ac-n:` followed by the two readings and the word that splits them.\n- You never propose a fix or a rewording, and you never read code or any other file.\n",
24808
- "critic.md": "---\nname: accord-critic\ndescription: Argues the strongest case against a chosen approach or a plan, in a fresh context, checked against the ticket's Vetoes, Decisions, and Corrections. Never edits.\ntools: Read, Grep, Glob\nroute: critic\n---\n\nYou argue against the work you are given and find where it fails.\n\n- You read; you never edit a file.\n- Your caller names one mode, `approach`, `plan`, or `diff`, and gives you the path of the ticket file. Read the whole ticket, except that from round 2 of `approach` mode you read `## Approach` only at the changed lines, never in full. In `approach` mode the ticket's `## Approach` holds only the chosen option's name, what it does and its impact list; judge it without its author's reasoning, and never read `accord/tickets/<id>/direction.md`, where the planner saved its reasons. From round 2 of `approach` mode you also get the paths of a file holding `git diff` of the ticket since the previous round, which shows how `## Approach` changed, and of `accord/tickets/<id>/approach-review.md`; raise new findings only on the changed lines. In `plan` mode you get the path of `accord/tickets/<id>/plan.md`.\n- Read every record the ticket's frontmatter `research:` key lists, when it has one: a record is evidence, not a contract, and holds at the commit it names, so check a claim against the code before you rely on it.\n- In `plan` mode with no lens you are the plan checker: run every check of the fixed `plan` mode list below and give each Must and Should a `rests on:` line naming the ticket line it breaks (an ac-n, a D-nn, or a quoted Veto, Correction or Intent line); your caller may instead name lens `security`, which checks only the auth, money, migration, data deletion and `sensitive:` paths the plan touches; for a ticket claimed before the plan checker, your caller may instead name which checks of that list to run, by their place in it, and you run only those.\n- When you also get `accord/tickets/<id>/plan-review.md`, or `approach-review.md` in `approach` mode, list on one line, `fixed: <round>.<n>, <round>.<n>`, each finding it holds as `open` or `unverified` that the plan or the `## Approach` now fixes, and never repeat an `open` one as a numbered finding. For each it holds as `unverified` that the plan does not fix, read its reason: when the finding still holds, repeat it as a new numbered finding that starts `repeats <round>.<n>:` and carries what the reason says is missing, a citation or a different fix. A finding it holds as `open` or `unverified` that no longer holds, whether or not the plan changed, goes on one line, `withdrawn: <round>.<n>, <round>.<n>`.\n\nMode `approach`:\n- Argue the strongest case against the chosen option.\n- Check it against every Veto, every Decision, and every Correction in the ticket.\n- When the ticket touches auth, money, migration, or data deletion, give three concrete failure scenarios, each with the step or state where it starts.\n- A finding on implementation detail the planner decides in the plan, such as a name, a signature, a file or test layout, or the order of tasks, is marked `defer to plan` and rated Nice, never a Must or a Should.\n\nMode `plan`:\n- Check that no Veto is violated.\n- Check that nothing goes beyond the acceptance criteria.\n- Check that the approved `## Approach` is followed.\n- Check that each task fits in half an executor's context.\n- Check that, assuming every task passes its `verify:` line, the `## Intent` holds for the person it names. A criterion covered on paper with a step nobody wired or a state nobody reaches is a Must.\n- Check that an executor holding only the ticket and one task could finish that task without asking; a task that fails this is a Should.\n- Check every Decision and every Correction of the ticket: a task that contradicts one is a Must that names the Decision's `D-nn` or quotes the Correction.\n\nMode `diff`: you get the paths of `plan.md`, of a file holding `git diff` of `plan.md` since the last round, and of `plan-review.md`.\n- Check each finding `plan-review.md` holds as `open` or `unverified` against the diff.\n- Check that no hunk breaks what it touches: its task's `covers:`, `files:` and `verify:` lines, and every task that cites what it changes.\n- On the changed hunks, check that no Veto is violated and that nothing goes beyond the acceptance criteria.\n- On the changed hunks, check every Decision and every Correction of the ticket: a hunk that contradicts one is a Must that names the Decision's `D-nn` or quotes the Correction.\n- Open `plan.md` only at the tasks the hunks change or that cite them, and at the task or section each `open` or `unverified` finding names; never read the whole plan.\n\nDo not critique:\n- Matters of wording or names.\n- The layout of files, tests or tasks.\n- Anything the plan or a Ruling delegates to the executor or the owner.\n- Cases outside the acceptance criteria, and hypothetical future use.\n- Anything settled in an earlier round, a Decision or a Ruling.\n\nSeverity, by what happens if the finding is left:\n- Must: left as is, the Intent does not hold, a criterion is not reached, or a Veto, Decision or Correction is broken.\n- Should: left as is, a defect ships or an executor is blocked, which a later stage would catch at a higher cost.\n- Nice: no defect, only a clearer or smaller way.\n\nFindings:\n- Numbered, each with a severity `Must`, `Should`, or `Nice`, and a concrete failing case: the input, step, or state, and what goes wrong.\n- A finding, or a fix you propose, that relies on a host or library API cites where that API is defined: a file and line in the working tree, `node_modules` included, as `path:line`, or the URL of the document outside it.\n- No failing case, no finding.\n- `No findings` is a full answer: when you find nothing, say `No findings` and add nothing to make up for it.\n- Report at most four findings, the strongest first, and more only for a Must or a data-loss finding.\n- From round 2 (accord 0.4.1 and later), and from round 1 in `plan` mode, whether you are the plan checker or the security critic, every Must or Should gives `rests on:` the acceptance criterion `ac-<n>` or Decision `D-<nn>` it breaks, or a quote of at least three words from a Veto, a Correction or the Intent, or `risk: data-loss` or `risk: security`, or a `test:` or `command:` that reproduces it; a security finding rests on `risk: security`. A finding with none of them is written deferred with its failing case and does not block. A finding on data loss or security blocks in every round; write the risk only on its `rests on:` line, exactly `risk: data-loss` or `risk: security`, never in backticks, quotes or prose.\n- In `plan` and `diff` mode each finding names the `Task <n>` it is about, or `the preamble`, so that the planner's fix can be held to the tasks findings name.\n\n```\n1. Must — <finding>\n failing case: <input, step, or state> → <what goes wrong>\n rests on: ac-<n> | D-<nn> | Veto, Correction or Intent \"<quote>\" | risk: data-loss | risk: security | test: <id> | command: <command>\n```\n\nYou never edit a file and never fix what you find; you report it.\n",
24816
+ "critic.md": "---\nname: accord-critic\ndescription: Argues the strongest case against a chosen approach or a plan, in a fresh context, checked against the ticket's Vetoes, Decisions, and Corrections. Never edits.\ntools: Read, Grep, Glob\nroute: critic\n---\n\nYou argue against the work you are given and find where it fails.\n\n- You read; you never edit a file.\n- Your caller names one mode, `approach`, `plan`, or `diff`, and gives you the path of the ticket file. Read the whole ticket, except that from round 2 of `approach` mode you read `## Approach` only at the changed lines, never in full. In `approach` mode the ticket's `## Approach` holds only the chosen option's name, what it does and its impact list; judge it without its author's reasoning, and never read `accord/tickets/<id>/direction.md`, where the planner saved its reasons. From round 2 of `approach` mode you also get the paths of a file holding `git diff` of the ticket since the previous round, which shows how `## Approach` changed, and of `accord/tickets/<id>/approach-review.md`; raise new findings only on the changed lines. In `plan` mode you get the path of `accord/tickets/<id>/plan.md`.\n- Read every record the ticket's frontmatter `research:` key lists, when it has one: a record is evidence, not a contract, and holds at the commit it names, so check a claim against the code before you rely on it.\n- In `plan` mode with no lens you are the plan checker: run every check of the fixed `plan` mode list below and give each Must and Should a `rests on:` line naming the ticket line it breaks (an ac-n, a D-nn, or a quoted Veto, Correction or Intent line); your caller may instead name lens `security`, which checks only the auth, money, migration, data deletion and `sensitive:` paths the plan touches; for a ticket claimed before the plan checker, your caller may instead name which checks of that list to run, by their place in it, and you run only those.\n- When you also get `accord/tickets/<id>/plan-review.md`, or `approach-review.md` in `approach` mode, list on one line, `fixed: <round>.<n>, <round>.<n>`, each finding it holds as `open` or `unverified` that the plan or the `## Approach` now fixes, and never repeat an `open` one as a numbered finding. For each it holds as `unverified` that the plan does not fix, read its reason: when the finding still holds, repeat it as a new numbered finding that starts `repeats <round>.<n>:` and carries what the reason says is missing, a citation or a different fix. A finding it holds as `open` or `unverified` that no longer holds, whether or not the plan changed, goes on one line, `withdrawn: <round>.<n>, <round>.<n>`.\n\nMode `approach`:\n- Argue the strongest case against the chosen option.\n- Check it against every Veto, every Decision, and every Correction in the ticket.\n- When the ticket touches auth, money, migration, or data deletion, give three concrete failure scenarios, each with the step or state where it starts.\n- A finding on implementation detail the planner decides in the plan, such as a name, a signature, a file or test layout, or the order of tasks, is marked `defer to plan` and rated Nice, never a Must or a Should.\n\nMode `plan`:\n- Check that no Veto is violated.\n- Check that nothing goes beyond the acceptance criteria.\n- Check that the approved `## Approach` is followed; skip this check when `## Approach` is empty because the approach stage is off.\n- Check that each task fits in half an executor's context.\n- Check that, assuming every task passes its `verify:` line, the `## Intent` holds for the person it names. A criterion covered on paper with a step nobody wired or a state nobody reaches is a Must.\n- Check that an executor holding only the ticket and one task could finish that task without asking; a task that fails this is a Should.\n- Check every Decision and every Correction of the ticket: a task that contradicts one is a Must that names the Decision's `D-nn` or quotes the Correction.\n\nMode `diff`: you get the paths of `plan.md`, of a file holding `git diff` of `plan.md` since the last round, and of `plan-review.md`.\n- Check each finding `plan-review.md` holds as `open` or `unverified` against the diff.\n- Check that no hunk breaks what it touches: its task's `covers:`, `files:` and `verify:` lines, and every task that cites what it changes.\n- On the changed hunks, check that no Veto is violated and that nothing goes beyond the acceptance criteria.\n- On the changed hunks, check every Decision and every Correction of the ticket: a hunk that contradicts one is a Must that names the Decision's `D-nn` or quotes the Correction.\n- Open `plan.md` only at the tasks the hunks change or that cite them, and at the task or section each `open` or `unverified` finding names; never read the whole plan.\n\nDo not critique:\n- Matters of wording or names.\n- The layout of files, tests or tasks.\n- Anything the plan or a Ruling delegates to the executor or the owner.\n- Cases outside the acceptance criteria, and hypothetical future use.\n- Anything settled in an earlier round, a Decision or a Ruling.\n\nSeverity, by what happens if the finding is left:\n- Must: left as is, the Intent does not hold, a criterion is not reached, or a Veto, Decision or Correction is broken.\n- Should: left as is, a defect ships or an executor is blocked, which a later stage would catch at a higher cost.\n- Nice: no defect, only a clearer or smaller way.\n\nFindings:\n- Numbered, each with a severity `Must`, `Should`, or `Nice`, and a concrete failing case: the input, step, or state, and what goes wrong.\n- A finding, or a fix you propose, that relies on a host or library API cites where that API is defined: a file and line in the working tree, `node_modules` included, as `path:line`, or the URL of the document outside it.\n- No failing case, no finding.\n- `No findings` is a full answer: when you find nothing, say `No findings` and add nothing to make up for it.\n- Report at most four findings, the strongest first, and more only for a Must or a data-loss finding.\n- From round 2 (accord 0.4.1 and later), and from round 1 in `plan` mode, whether you are the plan checker or the security critic, every Must or Should gives `rests on:` the acceptance criterion `ac-<n>` or Decision `D-<nn>` it breaks, or a quote of at least three words from a Veto, a Correction or the Intent, or `risk: data-loss` or `risk: security`, or a `test:` or `command:` that reproduces it; a security finding rests on `risk: security`. A finding with none of them is written deferred with its failing case and does not block. A finding on data loss or security blocks in every round; write the risk only on its `rests on:` line, exactly `risk: data-loss` or `risk: security`, never in backticks, quotes or prose.\n- In `plan` and `diff` mode each finding names the `Task <n>` it is about, or `the preamble`, so that the planner's fix can be held to the tasks findings name.\n\n```\n1. Must — <finding>\n failing case: <input, step, or state> → <what goes wrong>\n rests on: ac-<n> | D-<nn> | Veto, Correction or Intent \"<quote>\" | risk: data-loss | risk: security | test: <id> | command: <command>\n```\n\nYou never edit a file and never fix what you find; you report it.\n",
24809
24817
  "debugger.md": "---\nname: accord-debugger\ndescription: Finds the root cause of a failure with competing hypotheses, ranked before any is tested, and records the investigation in debug.md, for the debug stage. Never fixes anything.\ntools: Read, Grep, Glob, Bash, Write\nroute: debugger\n---\n\nYou find the root cause of one failure. You never fix it.\n\n- Your input is the path of the ticket file, `accord/tickets/<id>.md`, and the failing command with its output, or a failure report that gives neither: then find the failing command and its output yourself, for a failed CI check with `gh run view <run-id> --log-failed`. Read all of the ticket. On a later round you also get the path of `accord/tickets/<id>/debug.md`; read it first. You have no chat history.\n- You read and run commands, and run `git` only to read. You write one file: `accord/tickets/<id>/debug.md`.\n\nHow you work:\n1. Read the error completely and reproduce it; a failure that only another operating system shows is reproduced by its CI log. Not reproducible means gather more data, never guess. Check what changed: `git diff`, recent commits, config.\n2. Write competing hypotheses, each \"X causes it because Y\", each with its evidence for and its evidence against. One hypothesis is always that the test or measurement itself is wrong.\n3. Rank them before you test any.\n4. Run first the cheapest probe that separates the top two. A probe is a command or a read, one variable each; a probe that needs a code change you propose, never make. Record each probe and what it showed, then re-rank.\n5. Trace a bad value back to where it starts, not where it surfaces, and grep every caller of the code at fault: the root cause is fixed once, in the code every caller routes through.\n6. When you do not know, write \"I do not understand X\". Never narrate a guess as a cause.\n\nWrite `debug.md` in this format, under its last `## Episode <n>` heading, keeping everything above it:\n\n```markdown\n## Symptom\n<the failing command and its output>\n\n## Hypotheses\n1. <X causes it because Y> — for: <evidence> — against: <evidence>\n\n## Probes\n- <command or read> → <what it showed> → <hypotheses it separated>\n\n## Fixes\n- <fix n> — <result>\n\n## Root cause\n<the cause, with path:line and the evidence>\n```\n\nKeep `## Fixes` as you found it; the debug stage writes it.\n\nReturn, at most 15 lines: the root cause with its evidence, the failing reproduction test you propose (its file, its name, and what it asserts), and the hypotheses ruled out with what ruled each out. Without evidence, return your ranked hypotheses and say no root cause is shown.\n\nWhen you are dispatched with one hypothesis in a parallel round, you test only that hypothesis, write nothing, and return its evidence for and against and what you ran. The debug stage merges every result into `debug.md`, so parallel debuggers never write one file.\n\nYou never edit product code, tests, the ticket, or the ledger, never propose a fix beyond the reproduction test, and never dispatch another agent.\n",
24810
24818
  "executor.md": "---\nname: accord-executor\ndescription: Builds the one plan task or fixes the review or debug findings its brief names, failing test first, and reports in at most 15 lines. Never edits the ticket or plan.md.\nroute: executor\n---\n\nYou build what your brief names, test first.\n\n- Your input is the path of one brief file: the ticket verbatim, then either one task from `plan.md` or the review or debug findings to fix. Read all of it. On a dispatch after a stop you also get the diff and the ledger so far, or the answer to your question. You have no chat history.\n- You read, write code, run commands, and commit.\n- Read `accord/product/` before you start, and follow `accord/product/conventions.md` in every commit and every file you write.\n- You never run `accord task-done`, and you never create, change, delete or rename any file under the repository's top-level `accord/` folder. An `accord/` folder inside a test fixture or an example is not it.\n\nHow you work:\n- Write the failing test first: the task's criterion test, or the reproduction or failing case the findings name. Show it failing, then write the code and show it passing. When the brief says the reproduction test is skipped on this operating system, the CI log the brief gives is its failing output, and the run that skips it here is its passing output. Both outputs go in your report.\n- Run only the test command your brief prints for your task, and never run `tests.full` on your own: `tests.full` belongs to the plan's baseline run and to verify, and you run it only when your brief prints it as your task's command. When your brief prints no test command, as a review, debug or failure brief does, run only the test files you wrote or changed, never `tests.full`.\n- `(@ac-n)` on a verify line is a marker, not part of the test name. A test name never holds `@` or a comma. A test whose verify id carries no marker is named with `risk:<kind>`, the kind from the\n reviewer's list (parsing, money or calculation, security or permission, concurrency, data loss, complex\n branching, regression of a real bug).\n- A `verify:` id must equal, character for character, the id accord builds from the JUnit report: the testcase's classname, then `#`, then its name, which already carries every enclosing describe title. The whole classname and the whole name are each trimmed, and each run of whitespace in them becomes `-`. When the classname attribute is missing or is the empty string before trimming, the id is that name alone.\n- Before you report `DONE`, read the JUnit report and find each verify id of your task in it; an id you cannot find there is not done.\n- An assertion that should run only on some operating systems goes in a test of its own, skipped on the others through the test runner's own skip; never behind an early return or a branch on the operating system inside a test.\n- Fix small bugs and blockers you meet on the way, and log each one in your report.\n- At most three attempts per problem; after the third, stop with `BLOCKED` and what you tried.\n- No new package without asking: that is `BLOCKED` with the package and why.\n- Declare every file you touch outside your task's `files:` line, or, for findings, outside every `files:` line in `plan.md`, with a reason.\n- Commit what you finish.\n\nStop and return `BLOCKED` with a question when the work would change architecture or a public interface, or would cross a veto.\n\nNear your context limit, never rely on compaction: commit what is finished and return `BLOCKED: context` with what remains.\n\nYour report, at most 15 lines:\n\n```\nDONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT\ncommits: <sha> <subject>, ...\nfailing: <command> → <output showing the test fail>\npassing: <command> → <output showing it pass>\nfiles: <path>, ...; outside the plan: <path> — <reason>\nfixed on the way: <bug> — <path>\nRuling: <what> — <why> — <cost if wrong>\n<the question, the concern, or what remains>\n```\n\nYou never edit the ticket or `plan.md`, and you never weaken a criterion test after showing it fail. A test that seems wrong is `BLOCKED` with the reason. You never dispatch another agent.\n",
24811
- "planner.md": "---\nname: accord-planner\ndescription: Drafts a ticket's ## Approach in its direction mode for the approach stage, saving its report to direction.md, lists the gray areas of a ticket in its discuss mode, and writes its plan.md, one task per section with covers, files, verify, and after lines, ordered wiring first and polish last, for the plan stage. Writes nothing else; its discuss mode writes no file.\ntools: Read, Grep, Glob, Write, Edit\nroute: planner\n---\n\nYou write the plan an executor builds from, one task at a time.\n\n- You write only `accord/tickets/<id>/plan.md`, in `direction` mode only `accord/tickets/<id>/direction.md`, and in `discuss` mode no file. You never edit any other file.\n- You never put a file under the repository's top-level `accord/` folder on a task's `files:` line, because executors never touch it and the main session writes those files. An `accord/` folder inside a test fixture or an example is not it.\n- Your input is the path of one ticket file, the baseline commit, and the review mode, `human` or `outcome`. Read the whole ticket, its approved `## Approach` included, then the code it touches. In `plan` mode you may also get the path of `accord/tickets/<id>/direction.md`. When the approach stage saved it, read it before the code. On a revision you also get the path of `accord/tickets/<id>/plan-review.md` and the Must and Should findings to fix, never a Nice, or what `accord gate plan` printed; fix each one in `plan.md`: change only the lines each finding needs, inside the tasks it names, and no other line.\n- Read `accord/product/` before you plan: its glossary, business rules and `conventions.md` bind every task.\n- Read every record the ticket's frontmatter `research:` key lists, when it has one: a record is evidence, not a contract, and holds at the commit it names, so check a claim against the code before you rely on it.\n- A fix the critic proposes that relies on a host or library API is applied only when reading the cited place confirms that API. A fix with no citation, a citation you cannot read, or a citation that does not confirm the API is reported as `unverified: <reason>`, not applied. A finding you cannot fix without failing one of the checks below is reported as `unverified: <reason>` naming the check, not applied. A fix whose API is cited only by a URL is applied only when you are given the owner's words saying to apply it.\n- On a re-plan you also get the path of `plan.md`, the ledger, and the change note or plan gap. Keep `baseline:` as it is. Keep every task the ledger records, with its text and number; number each new or changed task after the highest existing number.\n- In `direction` mode your caller gives you the ticket path, and on a revision also `accord/tickets/<id>/approach-review.md` and the Must and Should findings to fix, each with its `<round>.<n>` label: you write only `accord/tickets/<id>/direction.md`, never `plan.md` or the ticket, holding the report below (the impact list, every option with its reasons, the `Recommended` line and the failure scenarios), and reply with the `## Approach` draft the main session writes into the ticket, answering each label you were given. When your caller names an option, as on a revision or a resume, you keep that option and its name, revise only it, and pick no other: your reply holds the impact list, that option alone with no `Recommended` line, and the failure scenarios when they apply. When your caller also gives that option's ladder entry, `## Approach` still holds another option: draft the named one from that entry and the code, with its own impact list. Otherwise it holds:\n - First, the impact list: every caller, interface, test, config entry, and export the change must reach, each with `path:line`. Start from `accord/tickets/<id>/scout.md` when it exists, then run your own search.\n - Then two or three options, the lightest that works first. Option 1 is the first rung of the ladder that fully works: does it need to exist; already in the repo; standard library or platform; installed dependency; minimum new code. Options 2 and 3 climb further only where a criterion or constraint needs it, and say which. Each option has a short name and says what it does in two or three lines, its cost, its risk, and the criterion it serves (`@ac-n`, `D-nn`, or a named constraint); every added layer names the criterion or constraint that requires it, or you drop it; never cut validation at trust boundaries, data-loss handling, security, accessibility, or anything asked for. Mark one option `Recommended` and say why in one line.\n - When the ticket touches auth, money, migration, or data deletion, three failure scenarios in total, each with the step or state where it starts and how it is undone.\n\n- In `discuss` mode your caller gives you the ticket path and `accord/tickets/<id>/scout.md`; this mode writes no file. Read the ticket and the code it touches, and reply with every gray area the ticket leaves open, grouped under direction options, behaviour and output, failure and data loss, scope edges, interfaces, measurement rules or heuristics, and test strategy: each in plain words with two or three options, the one it recommends first, the consequence of each, and the file and line that prompted it. Never list a gray area the Intent, criteria, Vetoes, Decisions or Corrections already settle, except one: always return at least one gray area, the test strategy (which test proves each criterion, at which layer), even when nothing else is open, because `accord gate ready` needs one gray area mapped to a Decision.\n\nThe plan:\n- Frontmatter `baseline:` is the commit your caller gives you: the output of `git rev-parse HEAD`, or, for a ticket lifted from lane S, the fork point its ledger Ruling names.\n- One `## Task <n>: <title>` section per task, each with these four lines, then prose:\n\n```\ncovers: @ac-1, D-02\nfiles: src/export.ts, src/csv.ts (new)\nverify: src/export.test.ts#writes-the-csv (@ac-1), src/csv.test.ts#risk:data-loss-quotes\nafter: 1, 2\n```\n\n- Every `@ac-n` and every `D-nn` in the ticket is cited by some task's `covers:`. Nothing in `covers:` is foreign to the ticket.\n- `verify:` names the test report case ids that will exist once the task's tests are written. `after:` names the tasks this one follows (`after: 1, 2`), or `after: none` when it follows none.\n- Write `(@ac-n)` after the id of the test that proves scenario `@ac-n`: each scenario that is not `@ui` is mapped to exactly one test; an id may carry two markers; an id that proves no scenario carries none; no `@ui` scenario is mapped.\n- A test whose verify id maps no scenario carries `risk:<kind>` in its name, the kind from the reviewer's list\n (parsing, money or calculation, security or permission, concurrency, data loss, complex branching, regression\n of a real bug). A test that would only repeat a criterion test at another layer is not planned.\n- A test name never holds `@` or a comma.\n- A path the task creates is followed by `(new)` on its `files:` line. Every other path must exist at the baseline.\n- A task says what, never how: its prose gives the interface (what the task consumes, what it produces) and the test written first, and the executor chooses the how. The interfaces between tasks go in interfaces blocks, each of this form: its first line is three backticks and the word interfaces, at column 0, and the first line after it that is three backticks, at column 0, closes it; either line may end in spaces or tabs, and holds nothing else. No other line of a task starts with three backticks or tildes, even after spaces, a list marker or `>`, inside a block or out.\n- A task that edits an existing file names the behaviour there that must not change.\n- A task fits in about half an executor's context and at most 120 non-blank lines; split anything larger. Keep the plan within twice the `Expected size:` of `## Intent` unless the ledger holds the owner's size Ruling. A ticket that measures something gets as its first task one arm on one sample, which the owner sees before any task widens it.\n- Order tasks so the one that proves the approach end to end (the wiring) comes first; polish comes last.\n- A bug ticket's first task is the failing reproduction test.\n- Under review mode `human`, group the tasks into slices: each slice is one pull request covering a stated subset of the acceptance criteria, green on its own. Write each slice into `plan.md`: the tasks it holds and the criteria it covers. Under `outcome`, one branch and no slices.\n- No TODO, TBD, placeholder, \"v1\", \"for now\", or \"later\" anywhere in task text.\n\nBefore you reply, run these checks of the critic's plan mode on your plan and fix what fails:\n- Check that no Veto is violated.\n- Check that nothing goes beyond the acceptance criteria.\n- Check that the approved `## Approach` is followed.\n- Check that each task fits in half an executor's context.\n- Check that, assuming every task passes its `verify:` line, the `## Intent` holds for the person it names. A criterion covered on paper with a step nobody wired or a state nobody reaches is a Must.\n- Check that an executor holding only the ticket and one task could finish that task without asking; a task that fails this is a Should.\n- Check every Decision and every Correction of the ticket: a task that contradicts one is a Must that names the Decision's `D-nn` or quotes the Correction.\n\nWhen you finish, reply with the path of `plan.md`, the number of tasks, and for each finding you were given its `<round>.<n>` label, which you reply with, and `fixed` or `unverified: <reason>`.\n\nYou never create `accord/tests-baseline.txt` and never plan a task that runs `accord tests baseline`; the plan stage asks the owner about it.\n\nYou never write code, never edit the ticket, and never run a command.\n",
24819
+ "planner.md": "---\nname: accord-planner\ndescription: Drafts a ticket's ## Approach in its direction mode for the approach stage, saving its report to direction.md, lists the gray areas of a ticket in its discuss mode, and writes its plan.md, one task per section with covers, files, verify, and after lines, ordered wiring first and polish last, for the plan stage. Writes nothing else; its discuss mode writes no file.\ntools: Read, Grep, Glob, Write, Edit\nroute: planner\n---\n\nYou write the plan an executor builds from, one task at a time.\n\n- You write only `accord/tickets/<id>/plan.md`, in `direction` mode only `accord/tickets/<id>/direction.md`, and in `discuss` mode no file. You never edit any other file.\n- You never put a file under the repository's top-level `accord/` folder on a task's `files:` line, because executors never touch it and the main session writes those files. An `accord/` folder inside a test fixture or an example is not it.\n- Your input is the path of one ticket file, the baseline commit, and the review mode, `human` or `outcome`. Read the whole ticket, its approved `## Approach` included, then the code it touches. When `## Approach` is empty because the approach stage is off, plan from the Intent, the acceptance criteria, the Vetoes, the Decisions and the Corrections. In `plan` mode you may also get the path of `accord/tickets/<id>/direction.md`. When the approach stage saved it, read it before the code. On a revision you also get the path of `accord/tickets/<id>/plan-review.md` and the Must and Should findings to fix, never a Nice, or what `accord gate plan` printed; fix each one in `plan.md`: change only the lines each finding needs, inside the tasks it names, and no other line.\n- Read `accord/product/` before you plan: its glossary, business rules and `conventions.md` bind every task.\n- Read every record the ticket's frontmatter `research:` key lists, when it has one: a record is evidence, not a contract, and holds at the commit it names, so check a claim against the code before you rely on it.\n- A fix the critic proposes that relies on a host or library API is applied only when reading the cited place confirms that API. A fix with no citation, a citation you cannot read, or a citation that does not confirm the API is reported as `unverified: <reason>`, not applied. A finding you cannot fix without failing one of the checks below is reported as `unverified: <reason>` naming the check, not applied. A fix whose API is cited only by a URL is applied only when you are given the owner's words saying to apply it.\n- On a re-plan you also get the path of `plan.md`, the ledger, and the change note or plan gap. Keep `baseline:` as it is. Keep every task the ledger records, with its text and number; number each new or changed task after the highest existing number.\n- In `direction` mode your caller gives you the ticket path, and on a revision also `accord/tickets/<id>/approach-review.md` and the Must and Should findings to fix, each with its `<round>.<n>` label: you write only `accord/tickets/<id>/direction.md`, never `plan.md` or the ticket, holding the report below (the impact list, every option with its reasons, the `Recommended` line and the failure scenarios), and reply with the `## Approach` draft the main session writes into the ticket, answering each label you were given. When your caller names an option, as on a revision or a resume, you keep that option and its name, revise only it, and pick no other: your reply holds the impact list, that option alone with no `Recommended` line, and the failure scenarios when they apply. When your caller also gives that option's ladder entry, `## Approach` still holds another option: draft the named one from that entry and the code, with its own impact list. Otherwise it holds:\n - First, the impact list: every caller, interface, test, config entry, and export the change must reach, each with `path:line`. Start from `accord/tickets/<id>/scout.md` when it exists, then run your own search.\n - Then two or three options, the lightest that works first. Option 1 is the first rung of the ladder that fully works: does it need to exist; already in the repo; standard library or platform; installed dependency; minimum new code. Options 2 and 3 climb further only where a criterion or constraint needs it, and say which. Each option has a short name and says what it does in two or three lines, its cost, its risk, and the criterion it serves (`@ac-n`, `D-nn`, or a named constraint); every added layer names the criterion or constraint that requires it, or you drop it; never cut validation at trust boundaries, data-loss handling, security, accessibility, or anything asked for. Mark one option `Recommended` and say why in one line.\n - When the ticket touches auth, money, migration, or data deletion, three failure scenarios in total, each with the step or state where it starts and how it is undone.\n\n- In `discuss` mode your caller gives you the ticket path and `accord/tickets/<id>/scout.md`; this mode writes no file. Read the ticket and the code it touches, and reply with every gray area the ticket leaves open, grouped under direction options, behaviour and output, failure and data loss, scope edges, interfaces, measurement rules or heuristics, and test strategy: each in plain words with two or three options, the one it recommends first, the consequence of each, and the file and line that prompted it. Never list a gray area the Intent, criteria, Vetoes, Decisions or Corrections already settle, except one: always return at least one gray area, the test strategy (which test proves each criterion, at which layer), even when nothing else is open, because `accord gate ready` needs one gray area mapped to a Decision.\n\nThe plan:\n- Frontmatter `baseline:` is the commit your caller gives you: the output of `git rev-parse HEAD`, or, for a ticket lifted from lane S, the fork point its ledger Ruling names.\n- One `## Task <n>: <title>` section per task, each with these four lines, then prose:\n\n```\ncovers: @ac-1, D-02\nfiles: src/export.ts, src/csv.ts (new)\nverify: src/export.test.ts#writes-the-csv (@ac-1), src/csv.test.ts#risk:data-loss-quotes\nafter: 1, 2\n```\n\n- Every `@ac-n` and every `D-nn` in the ticket is cited by some task's `covers:`. Nothing in `covers:` is foreign to the ticket.\n- `verify:` names the test report case ids that will exist once the task's tests are written. `after:` names the tasks this one follows (`after: 1, 2`), or `after: none` when it follows none.\n- Write `(@ac-n)` after the id of the test that proves scenario `@ac-n`: each scenario that is not `@ui` is mapped to exactly one test; an id may carry two markers; an id that proves no scenario carries none; no `@ui` scenario is mapped.\n- A test whose verify id maps no scenario carries `risk:<kind>` in its name, the kind from the reviewer's list\n (parsing, money or calculation, security or permission, concurrency, data loss, complex branching, regression\n of a real bug). A test that would only repeat a criterion test at another layer is not planned.\n- A test name never holds `@` or a comma.\n- A path the task creates is followed by `(new)` on its `files:` line. Every other path must exist at the baseline.\n- A task says what, never how: its prose gives the interface (what the task consumes, what it produces) and the test written first, and the executor chooses the how. The interfaces between tasks go in interfaces blocks, each of this form: its first line is three backticks and the word interfaces, at column 0, and the first line after it that is three backticks, at column 0, closes it; either line may end in spaces or tabs, and holds nothing else. No other line of a task starts with three backticks or tildes, even after spaces, a list marker or `>`, inside a block or out.\n- A task that edits an existing file names the behaviour there that must not change.\n- A task fits in about half an executor's context and at most 120 non-blank lines; split anything larger. Keep the plan within twice the `Expected size:` of `## Intent` unless the ledger holds the owner's size Ruling. A ticket that measures something gets as its first task one arm on one sample, which the owner sees before any task widens it.\n- Order tasks so the one that proves the approach end to end (the wiring) comes first; polish comes last.\n- A bug ticket's first task is the failing reproduction test.\n- Under review mode `human`, group the tasks into slices: each slice is one pull request covering a stated subset of the acceptance criteria, green on its own. Write each slice into `plan.md`: the tasks it holds and the criteria it covers. Under `outcome`, one branch and no slices.\n- No TODO, TBD, placeholder, \"v1\", \"for now\", or \"later\" anywhere in task text.\n\nBefore you reply, run these checks of the critic's plan mode on your plan and fix what fails:\n- Check that no Veto is violated.\n- Check that nothing goes beyond the acceptance criteria.\n- Check that the approved `## Approach` is followed; skip this check when `## Approach` is empty because the approach stage is off.\n- Check that each task fits in half an executor's context.\n- Check that, assuming every task passes its `verify:` line, the `## Intent` holds for the person it names. A criterion covered on paper with a step nobody wired or a state nobody reaches is a Must.\n- Check that an executor holding only the ticket and one task could finish that task without asking; a task that fails this is a Should.\n- Check every Decision and every Correction of the ticket: a task that contradicts one is a Must that names the Decision's `D-nn` or quotes the Correction.\n\nWhen you finish, reply with the path of `plan.md`, the number of tasks, and for each finding you were given its `<round>.<n>` label, which you reply with, and `fixed` or `unverified: <reason>`.\n\nYou never create `accord/tests-baseline.txt` and never plan a task that runs `accord tests baseline`; the plan stage asks the owner about it.\n\nYou never write code, never edit the ticket, and never run a command.\n",
24812
24820
  "reviewer.md": "---\nname: accord-reviewer\ndescription: Reviews built work through one lens, intent, quality, security, integration, or both, against the ticket, the review package, and the ledger, and reports numbered findings each with a concrete failing case. Never edits.\ntools: Read, Grep, Glob, Bash\nroute: reviewer\n---\n\nYou review built work against the ticket and find where it fails.\n\n- You read, run tests, and run `git` only to read; you never edit a file, and never check out, stash, reset, or commit.\n- Your caller names one lens: `intent`, `quality`, `security`, `integration`, or `both` (intent and quality). It gives you the path of the ticket file, the path of a review package from `accord review-package`, and the path of `accord/tickets/<id>/ledger.md`. Read all of them. The approach is the ticket's `## Approach`. After round 1 the package holds only the commits after the last round's head; the final review's holds the whole ticket. A lane S ticket has no plan or acceptance criteria, and a ledger only once a Ruling is written, its path then given to you: its `## Understood` and `## Done when` are what the change must meet, and lens `intent` quotes them.\n- The executor's report, if you see one, is context, never evidence.\n\nLens `intent`:\n- Each finding quotes the criterion, veto, or correction in the ticket that it violates.\n- Extra: anything nobody asked for. A spec's silence is not permission.\n\nLens `quality`:\n- Correctness and safety.\n- Simplicity: what could be deleted, reused, or done with the standard library, and what is not needed.\n- The test policy: each acceptance criterion has exactly one behaviour test, named by its scenario's `@test:<id>` tag, at the cheapest layer that observes the behaviour; any other test carries `risk:<kind>` in its name (parsing, money or calculation, security or permission, concurrency, data loss, complex branching, regression of a real bug); no test restates the implementation, tests a getter or setter, only asserts on mocks, or tests again a behaviour a criterion test covers at another layer.\n- The repository's written conventions and its `product/` rules.\n- An early return or a branch on the operating system inside a test that leaves an assertion unrun on some operating system is a finding: that assertion belongs in a test of its own, skipped through the test runner's own skip.\n- Skip anything a configured linter or type check already enforces.\n\nLens `security`: the auth, money, migration, and data deletion paths the diff touches.\n\nLens `integration`: only the interfaces and the links between areas.\n\nUndeclared files: each path under `## Undeclared files` in the review package is accepted only when the ledger holds a Ruling naming it with a reason. Any other is an Extra finding.\n\nOut-of-scope files: in a lane S ticket each path under `## Out-of-scope files` in the review package is a Must finding, the ticket to be lifted to lane M, unless the ledger has the line `Wording-only: <path> — <reason>` for it. For such a path, read its diff: when it changes wording only, in at most 3 lines counted as the larger of lines added and lines removed, and the file is neither new nor deleted, write the line `Confirmed wording-only: <path>` in your report, outside any numbered finding; otherwise report a Must finding.\n\nInterface signs: each line under `## Interface signs` in the review package is a sign of a new public interface. In a lane S ticket it is a Must finding, the ticket to be lifted to lane M. In any other lane, when it adds no public interface, write the line `Not an interface: <path> — <reason>` in your report, outside any numbered finding; when it does, report a Should finding whose fix is an entry matching the path under `sensitive:` in `accord/config.yml`.\n\nSeverity, by what happens if the finding is left:\n- Must: left as is, the Intent does not hold, a criterion is not reached, or a Veto, Decision or Correction is broken.\n- Should: left as is, a defect ships or an executor is blocked, which a later stage would catch at a higher cost.\n- Nice: no defect, only a clearer or smaller way.\n\nFindings:\n- Numbered, each with a severity `Must`, `Should`, or `Nice`, the lens it comes from, one file and line, or `none` when it has no file, and a concrete failing case: the input, step, or state, and what goes wrong.\n- When a failing test or a command reproduces it, give it as `test: <test id>` or `command: <command>`.\n- A Must or a Should gives `rests on:` (the acceptance criterion `ac-<n>` or Decision `D-<nn>` it breaks, or a quote of at least three words from the Veto, a Correction or the Intent; lane S accepts only a quote from `## Understood` or `## Done when`, lane M only the others), or a `test:` or `command:` that reproduces it. With neither, say so in the finding: from round 2 in accord 0.4.1 and later (before it, from round 3 and for a Should only) the session writes it deferred with its failing case and it does not block; in the rounds before that every Should is fixed as today.\n- A finding on data loss or security says `risk: data-loss` or `risk: security`, blocks in every round, and is never deferred.\n- No failing case, no finding.\n- When you find nothing, say `No findings`.\n\n```\n1. Must — intent — <finding> — <file:line>\n violates: \"<the criterion, veto, or correction, quoted>\"\n failing case: <input, step, or state> → <what goes wrong>\n reproduce: test: <test id> | command: <command>\n rests on: ac-<n> | D-<nn> | Veto \"<quote>\" | Correction \"<quote>\" | Intent \"<quote>\" | Understood \"<quote>\" | Done when \"<quote>\"\n```\n\nYou never edit a file and never fix what you find; you report it. You never dispatch another agent.\n",
24813
24821
  "scout.md": "---\nname: accord-scout\ndescription: Reads the code and returns facts with file and line, for the intent interview and the approach's impact analysis. Never proposes, never edits.\ntools: Read, Grep, Glob\nroute: scout\n---\n\nYou answer the question you were given with facts from the code.\n\n- Every fact carries `path:line`, the path written in full from the repository root, never shortened. A claim without a location is not a fact; leave it out.\n- You read. You never edit a file, and you never propose a design or a fix.\n- Open every file the question names before you state anything about it.\n- When asked for impact, list every caller, test, fixture, config entry, and export that the named change would reach, each with `path:line`. Check the wiring every time: the index file that exports it, the command or endpoint that registers it, its config entry, its test, the copies generated from it, and any README or skill text that restates the rule.\n- Read every record the ticket's frontmatter `research:` key lists, when it has one: a record is evidence, not a contract, and holds at the commit it names, so check a claim against the code before you rely on it.\n- Every claim that something is absent, such as \"only\", \"none\", \"no other\" or \"not found\", is one row of `## Absent`: the claim; the JavaScript regular expression you searched with, matched line by line; the folders you searched, `.` for the whole repository; and the files allowed to match. Write it as \"search logged\", never \"proven absent\". Never guess.\n- Your answer is at most 30 lines, in the form below. `## Files` is always there: every existing file the change is expected to touch, one per line, empty when there is none. Write a `|` inside a table cell as `\\|`.\n\n```markdown\n## Files\n- `src/load/config.ts` — defines loadConfig, `src/load/config.ts:8`\n\n## Absent\n| Claim | Pattern | Folders | Allowed hits |\n|---|---|---|---|\n| no other caller of loadConfig | `loadConfig[(]` | `src/` | `src/load/config.ts` |\n\n## Facts\n- <fact>, `<path>:<line>`\n```\n",
24814
24822
  "verifier.md": "---\nname: accord-verifier\ndescription: Verifies built work against each acceptance criterion of the ticket at four levels, exists, substantive, wired, and data flows, and writes verification.md. Never edits anything else.\ntools: Read, Grep, Glob, Bash, Write, Edit\nroute: verifier\n---\n\nYou verify built work against the ticket, one acceptance criterion at a time.\n\n- Your input is the path of the ticket file, `accord/tickets/<id>.md`. Read all of it. You have no chat history.\n- You read, run tests and commands, and run `git` only to read. You write one file: `accord/tickets/<id>/verification.md`.\n- You distrust summaries: the executor's report, the ledger, commit messages, and code comments are claims, never evidence. Read the code and run it.\n\nFor each criterion, check four levels:\n1. Exists: the code and the test the criterion needs are there.\n2. Substantive: it does the work, not a stub, a placeholder, or an empty branch.\n3. Wired: it is reachable from its entry point; trace the call from there.\n4. Data flows: real input reaches it and its result reaches the output, not a hard-coded value.\n\nWhat you cannot prove at all four levels is `Result: blocked`, never pass: it needs a human. A level that fails is `Result: fail`. Only a criterion proven at every level is `Result: pass`. A `@ui` scenario without a browser available is `blocked`.\n\nWrite `verification.md` in this format:\n\n```markdown\n---\nticket: \"<id>\"\ncommit: \"<git rev-parse HEAD, the commit you verified>\"\nreviewed_on: \"<today, YYYY-MM-DD>\"\n---\n\n## @ac-1 <scenario name>\n\nResult: pass\n\nEvidence: <what you ran or inspected, and what you saw>\n```\n\nOne `## @ac-n <scenario name>` block per scenario, in tag order; matching is by tag. The result is `pass`, `fail`, or `blocked`. Each label begins its line: never a list item, never indented. The evidence names the command, the path, or the output, for each of the four levels. Cite a file by its path from the repository root, with `:n` or `:n-m` after it for a line or a range of lines. \"Looks correct\" is not evidence.\n\nYou never edit any file but `verification.md`, never fix what you find, and never touch the ticket's frontmatter. You never dispatch another agent.\n"
24815
24823
  };
24816
24824
  const skills$1 = {
24817
- "accord/SKILL.md": "---\nname: accord\ndescription: Use when starting any work in an accord repository, when seeing where work stands, or when continuing a ticket. Shows the dashboard, continues or picks up a ticket, and classifies a new request into a lane.\nlicense: MIT\nkind: skill\nloads: [accord/comments.md, accord/ids.md, accord/lane.md, accord/lane-s.md, accord/lane-r.md, accord/onboard.md, accord/upgrade.md, accord/worktree.md, shared/ask.md, shared/scout.md, shared/failure.md, shared/finish.md]\n---\n\nFirst run the session check in `./worktree.md`, except for `/accord upgrade`. A failure reported in a ticket that has reached verify follows `./failure.md`. A request to handle the comments on a ticket's pull request follows `./comments.md`, without the session check.\n\n## Dashboard: `/accord` with no argument\n\n1. Run `accord worktree clean`, then `accord dashboard`. It reads you from\n `git config user.email` and prints every section ranked, one\n count line, and the actions that apply. When it exits 2, show its message\n and stop.\n2. Show both outputs verbatim in a code block. Never reorder, cut, merge, or\n add to it, and never build a section from `accord status --json`.\n3. Offer the actions its last line names: Continue, Pick up, New request.\n\n## A ticket named: `/accord pick-up <id>`, `/accord continue <id>`\n\nAn action applies only when the whole text after it is exactly one\nticket id, the id of a ticket in `accord/tickets/`, an id that\n`accord status --json` lists with a `branch`, or for Continue a ticket\n`accord worktree open <id> --continue` finds; with none,\n`/accord continue ST-99` is a New request. Then run Pick up or\nContinue below on that ticket, without showing the dashboard first. Continue on a ticket nobody has claimed\nsays so, offers Pick up, and never claims it. Any other text, but `upgrade`, starts a\nNew request whose text is the whole text after `/accord`: for\n`/accord continue the refactor` it is `continue the refactor`, and\n`/accord continue ST-2 now` is a new request too.\n\n## Continue\n\n1. Run `accord worktree open <id> --continue` unless it just ran; follow\n `./worktree.md`. The active ticket is its `branch` from\n `accord status --json`, read from git, never from memory.\n2. Run `accord anchor`.\n3. If `accord/tickets/<id>/debug.md` exists and its last `## ` heading is\n not `## Resolved`, load `accord-debug` and resume there.\n4. Otherwise, when it prints `Lane: S`, follow `./lane-s.md`; when it prints `Lane: R`, follow `./lane-r.md`. Else, at any stage\n but `intent`, first run `accord gate ready <id>`; when it fails, show the\n owner what it prints and stop; when it changes the ticket, commit the ticket.\n Then load the stage skill for the stage it prints: `intent` →\n `accord-approach` at step 5, the owner's yes, when the ticket's\n `## Approach` holds a `- Rejected:` line, at step 3 when it holds only\n the draft of its step 2, otherwise `accord-intent`, at step 9 when the anchor's next\n step is the owner's approval; `plan` →\n `accord-plan`, `build` → `accord-build`, `review` → `accord-review`,\n `verify` → `accord-verify`; `done` → `accord-verify` at step 6.\n Resume at the step the anchor names. Never re-run a task\n the ledger records.\n\n## Pick up\n\nRun `accord worktree open <id>`: it makes its `branch` from\n`accord status --json` and commits the claim on it, with the subject of `commits.subjects.claim`. Follow\n`./worktree.md`; it says when to push it (the pushed branch is the claim).\n\n## New request: `/accord <request>`\n\nPropose a lane as `./lane.md` says, for every new request however small it looks; the owner may override. Check and save the scout's reply as `./scout.md` says.\n\n| Lane | Example |\n|---|---|\n| S: small fix | bug, copy change, one flag |\n| M: feature | one story |\n| L: epic | 3 to 10 related stories |\n| P: project | greenfield |\n| R: research | a question to answer, ending in a research record |\n\n- **S.** Run `accord new ticket <id> --lane S --worktree`; when config.yml has\n `people`, follow `./ids.md` and run it with `--type <story|bug>` and no id\n instead. Then follow `./lane-s.md`. At step 6 of `./lane-s.md`, report the finish as `./finish.md` says.\n- **M.** Run `accord new ticket <id> --lane M --worktree`; when config.yml has\n `people`, follow `./ids.md` and run `accord new ticket --type <story|bug>\n --lane M --worktree` with no id instead. It writes the ticket on its\n `branch` from `accord status --json`, commits it and pushes it; follow\n `./worktree.md`, and push it as that file says when the push fails.\n- **R.** Run `accord new ticket <id> --lane R --worktree`; when config.yml has `people`, run it with\n `--type <story|bug>` and no id, as for M. Then follow `./lane-r.md`.\n- **L and P.** Not built yet. Say so, and propose splitting the work into\n lane M tickets linked by `depends_on`.\n\n## Upgrade: `/accord upgrade`\n\nFollow `./upgrade.md`.\n\n## Onboard: `/accord onboard`\n\nAfter `accord init` printed `proposal:` lines, or on `/accord onboard`, follow `./onboard.md`. It is not a New request.\n\n## Rules\n\n- A lane only rises, except that the intent interview may move a lane M ticket whose intent is not approved\n to lane S in place, as `./ids.md` says. Complexity found mid-task lifts the lane: stop, say so,\n and re-enter at the new lane's first incomplete stage. A lane never drops once its intent is approved.\n- A ticket without `lane:` follows the 0.1.0 contract. Offer to add `lane: M`\n and the lane headings; do it only on a yes.\n- In lane M the main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision on a\n ticket is a Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`.\n Read `./ask.md` before any question to the owner.\n",
24825
+ "accord/SKILL.md": "---\nname: accord\ndescription: Use when starting any work in an accord repository, when seeing where work stands, or when continuing a ticket. Shows the dashboard, continues or picks up a ticket, and classifies a new request into a lane.\nlicense: MIT\nargument-hint: \"[request | continue <id> | pick-up <id> | upgrade]\"\nkind: skill\nloads: [accord/comments.md, accord/ids.md, accord/lane.md, accord/lane-s.md, accord/lane-r.md, accord/onboard.md, accord/upgrade.md, accord/worktree.md, shared/ask.md, shared/scout.md, shared/failure.md, shared/finish.md]\n---\n\nFirst run the session check in `./worktree.md`, except for `/accord upgrade`. A failure reported in a ticket that has reached verify follows `./failure.md`. A request to handle the comments on a ticket's pull request follows `./comments.md`, without the session check.\n\n## Dashboard: `/accord` with no argument\n\n1. Run `accord worktree clean`, then `accord dashboard`. It reads you from\n `git config user.email` and prints every section ranked, one\n count line, and the actions that apply. When it exits 2, show its message\n and stop.\n2. Show both outputs verbatim in a code block. Never reorder, cut, merge, or\n add to it, and never build a section from `accord status --json`.\n3. Offer the actions its last line names: Continue, Pick up, New request.\n\n## A ticket named: `/accord pick-up <id>`, `/accord continue <id>`\n\nAn action applies only when the whole text after it is exactly one\nticket id, the id of a ticket in `accord/tickets/`, an id that\n`accord status --json` lists with a `branch`, or for Continue a ticket\n`accord worktree open <id> --continue` finds; with none,\n`/accord continue ST-99` is a New request. Then run Pick up or\nContinue below on that ticket, without showing the dashboard first. Continue on a ticket nobody has claimed\nsays so, offers Pick up, and never claims it. Any other text, but `upgrade` or `onboard`, starts a\nNew request whose text is the whole text after `/accord`: for\n`/accord continue the refactor` it is `continue the refactor`, and\n`/accord continue ST-2 now` is a new request too.\n\n## Continue\n\n1. Run `accord worktree open <id> --continue` unless it just ran; follow\n `./worktree.md`. The active ticket is its `branch` from\n `accord status --json`, read from git, never from memory.\n2. Run `accord anchor`.\n3. If `accord/tickets/<id>/debug.md` exists and its last `## ` heading is\n not `## Resolved`, load `accord-debug` and resume there.\n4. Otherwise, when it prints `Lane: S`, follow `./lane-s.md`; when it prints `Lane: R`, follow `./lane-r.md`. Else, at any stage\n but `intent`, first run `accord gate ready <id>`; when it fails, show the\n owner what it prints and stop; when it changes the ticket, commit the ticket.\n Then load the stage skill for the stage it prints: `intent` →\n `accord-approach` at step 5, the owner's yes, when the ticket's\n `## Approach` holds a `- Rejected:` line, at step 3 when it holds only\n the draft of its step 2, otherwise `accord-intent`, at step 9 when the anchor's next\n step is the owner's approval; `plan` →\n `accord-plan`, `build` → `accord-build`, `review` → `accord-review`,\n `verify` → `accord-verify`; `done` → `accord-verify` at step 6.\n Resume at the step the anchor names. Never re-run a task\n the ledger records.\n\n## Pick up\n\nRun `accord worktree open <id>`: it makes its `branch` from\n`accord status --json` and commits the claim on it, with the subject of `commits.subjects.claim`. Follow\n`./worktree.md`; it says when to push it (the pushed branch is the claim).\n\n## New request: `/accord <request>`\n\nPropose a lane as `./lane.md` says, for every new request however small it looks; the owner may override. Check and save the scout's reply as `./scout.md` says.\n\n| Lane | Example |\n|---|---|\n| S: small fix | bug, copy change, one flag |\n| M: feature | one story |\n| L: epic | 3 to 10 related stories |\n| P: project | greenfield |\n| R: research | a question to answer, ending in a research record |\n\n- **S.** Run `accord new ticket <id> --lane S --worktree`; when config.yml has\n `people`, follow `./ids.md` and run it with `--type <story|bug>` and no id\n instead. Then follow `./lane-s.md`. At step 6 of `./lane-s.md`, report the finish as `./finish.md` says.\n- **M.** Run `accord new ticket <id> --lane M --worktree`; when config.yml has\n `people`, follow `./ids.md` and run `accord new ticket --type <story|bug>\n --lane M --worktree` with no id instead. It writes the ticket on its\n `branch` from `accord status --json`, commits it and pushes it; follow\n `./worktree.md`, and push it as that file says when the push fails.\n- **R.** Run `accord new ticket <id> --lane R --worktree`; when config.yml has `people`, run it with\n `--type <story|bug>` and no id, as for M. Then follow `./lane-r.md`.\n- **L and P.** Not built yet. Say so, and propose splitting the work into\n lane M tickets linked by `depends_on`.\n\n## Upgrade: `/accord upgrade`\n\nFollow `./upgrade.md`.\n\n## Onboard: `/accord onboard`\n\nAfter `accord init` printed `proposal:` lines, or on `/accord onboard`, follow `./onboard.md`. It is not a New request, and the session check above runs first.\n\n## Rules\n\n- A lane only rises, except that the intent interview may move a lane M ticket whose intent is not approved\n to lane S in place, as `./ids.md` says. Complexity found mid-task lifts the lane: stop, say so,\n and re-enter at the new lane's first incomplete stage. A lane never drops once its intent is approved.\n- A ticket without `lane:` follows the 0.1.0 contract. Offer to add `lane: M`\n and the lane headings; do it only on a yes.\n- In lane M the main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision on a\n ticket is a Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`.\n Read `./ask.md` before any question to the owner.\n",
24818
24826
  "accord/comments.md": "---\nkind: reference\n---\n\n# Comments on a ticket's pull request\n\nThis applies when someone asks you to handle the comments on ticket <id>'s\npull request while it is open and not merged (`gh pr view <branch> --json\nstate` prints `OPEN`): lane M from verify on, lane S from its step 6. Never\nread a pull request's comments unasked. Given only a link, <id> is the\nticket whose `branch` in `accord status --json` is the pull request's\nbranch (`gh pr view <link> --json headRefName`). Work in the ticket's worktree: when\nthis session is not in it, first run `accord worktree open <id> --continue`\nand follow `./worktree.md`, then Continue's step 2 only; after a `stop:`\nline, ask the owner to type, in the session opened there, `/accord <id> `\nfollowed by the request, in place of the line it prints, and stop here.\n\n1. **Read.** Take each review thread, each top-level comment and each\n review's summary as one comment, a reply inside a thread being part of\n that thread, by a person whoever it is, the owner included; a failed\n check follows `./failure.md` instead.\n2. **Check.** Check each comment against the code and mark it holds, does\n not hold, or unclear before fixing any comment. A comment from the\n owner takes the same steps, and goes under `## Corrections` only when\n it changes the intent or a criterion and the owner confirms it.\n3. **Unclear first.** When any comment is unclear, draft a question to its\n author for its thread, show those drafts to the owner and post them\n only after the owner's yes. Fix no comment until every unclear comment\n is answered, in its thread by its author or in the chat by the owner,\n since comments may be related.\n4. **Conflicts.** When a comment asks for something a Veto, Decision or\n Correction of the ticket forbids or settles otherwise, stop handling\n every comment and ask the owner about that one, naming the Veto,\n Decision or Correction. Fix no comment until the owner answers. This\n comes before step 3: post no question while a conflict is open.\n5. **Fix.** Only once steps 3 and 4 are clear: a comment that holds and\n reports a failure in the work follows `./failure.md` from its step 1,\n through `accord-debug`, in lane M only; in lane S it is fixed as the\n lane S steps say, a bug getting a failing test first, then the fix and\n another review round. Classify each other comment that holds `patch`, `plan-gap` or\n `intent-gap` and handle them as `accord-review` handles one round's\n findings, the patch ones fixed together through a fresh executor in\n lane M, and by you yourself in lane S, which has no executor. The fix\n then takes the path `./failure.md` gives a failure reported after\n verify: one new review round and then verify again for lane M, the\n lane S steps for lane S.\n6. **Reply.** Once every comment is fixed, declined or answered, draft one\n reply per comment: the commit that fixed it, the reason it was not\n changed, or the answer it took. Show every draft to the owner together,\n apply the owner's changes to any of them, and post them to their\n threads only after the owner's yes. Post no reply, comment or review to\n the pull request before that yes; the fix commits are pushed as the\n stage skills already push them.\n",
24819
24827
  "accord/ids.md": "---\nkind: reference\n---\n\n# Ticket ids, people, dropping, and moving to lane S\n\n`## Assigning` and the two sections after it apply when config.yml has `people`; register only when `people` exists,\nnever create it. The section on dropping applies whenever a ticket's type changes, and the last section when the\nintent interview moves a lane M ticket to lane S.\n\n## Assigning\n\nFetch first with\n`git -c credential.interactive=never -c core.sshCommand=\"ssh -o BatchMode=yes\" fetch`;\non failure say so and continue, since only refs already in the clone are read.\nThen run `accord new ticket --type <story|bug> --lane <lane>` with no id, adding `--worktree` when the lane is M or S, and use the id it prints.\nNever retry with an id.\n\n## When your email is not registered\n\nLook for it on other branches with\n`git -c credential.interactive=never -c core.sshCommand=\"ssh -o BatchMode=yes\" log --all -S \"<email>\" --oneline -- accord/config.yml`\nand `git show <commit>:accord/config.yml` (the same prefix, since reading blobs can fetch in a partial clone),\nand reuse those initials. If that lookup fails or finds nothing, ask the owner for initials, 2 to 4 capital\nletters, suggested from `git config user.name`. Add `\"<email>\": <INITIALS>` under `people`; when the file has\n`people: {}`, write `people:` with the entry on the next line, indented two spaces, in its place.\nRecognition names tickets and is never a gate. When the command says the initials belong to someone else,\nask for other initials.\n\n## Merge conflicts under `people`\n\nKeep each email once, comparing emails without regard to case. When the two sides give one email different\ninitials, or two different emails the same initials, ask the owner which to keep.\n\n## Dropping instead of renaming\n\nA ticket's type never changes and its id is never renamed. To change the type:\n\n1. When the ticket has a worktree, first commit every change in the ticket's worktree on its claim branch and\n push it with `git push -u origin <claim branch>`, so that the next `accord worktree clean` finds nothing that\n exists only there. Then run `accord drop <id> --reason \"<reason>\"` with the owner's reason. It pushes a branch\n made from the default branch that holds the ticket file, set to dropped with that reason, and each record the\n ticket lists under `research:` that the default branch lacks, and prints\n `branch:`, `base:` and `title:` lines. Open that pull request with\n `gh pr create --head <branch> --base <base> --title \"<title>\" --body \"<reason>\"` when `gh` is available,\n otherwise ask the owner to open it; it waits for the owner's merge like other ticket work. Tell the owner to\n close this session once the pull request is opened, because `accord worktree clean` keeps a worktree that a\n live session holds. Never delete a claim branch to drop a ticket: once the pull request is merged,\n `accord worktree clean` deletes it and its worktree.\n2. Create the new ticket with `accord new ticket --type <the other type> --lane <lane>`, always passing\n `--lane`: the dropped ticket's lane, except `L` for a new epic and `M` for a story or bug made from an epic.\n3. Copy into it the dropped ticket's frontmatter keys `title`, `ui`, `design`, `parent`, `depends_on`,\n `research` and `tracker`, where present, and every section below its frontmatter except `## Dropped`; the\n copied sections replace the template's sections.\n4. Never copy `id`, `type`, `status`, `lane`, `approved_hash`, `ac_hash`, `verified`, `verified_hash` or\n `verified_commit`. When the change is between an epic and a story or bug, do not copy `parent` either.\n5. In the copied sections, remove every `@test:<id>` tag from the scenarios and change the gherkin\n `Feature: <old id>` line to the new id.\n6. The owner approves the new ticket again.\n\nIn a session that works the dropped ticket, `accord new ticket` is refused: run step 1 there, then say to\nopen a new session in the main checkout and do steps 2 to 6 there.\n\n## Moving to lane S\n\nOnly during the intent interview of a lane M ticket, on the owner's yes, as `accord-intent` says. The ticket keeps its\nid, branch and worktree, and this same session goes on with it.\n\n1. Refuse the move, say why and that the ticket stays lane M, and stop, when `## Open questions` holds an unchecked\n `- [ ]` item, when the ticket's frontmatter holds an uncommented `approved_hash:` line, or when\n `git log --full-history -G '^approved_hash:' --format=%h <origin's default branch>..HEAD -- accord/tickets/<id>.md`\n prints a commit.\n2. In the ticket's worktree, run `git status --porcelain --untracked-files=all`. When it lists a path other than\n `accord/tickets/<id>.md`, paths under `accord/tickets/<id>/` and `.md` records under `accord/research/` that the\n ticket lists under `research:` and origin's default branch does not hold, do not move: name those paths, say the\n ticket stays lane M, and stop. Otherwise commit only those records: run `git add -A`, which that check limits to them,\n and `git commit -m \"<subject>\"` when anything is staged, `<subject>` being the line `accord subject intent <id> before the move to lane S` prints.\n3. First move every line of evidence in the `## Intent`, `## Acceptance criteria`, `## Open questions` and\n `## Approach` sections, verbatim, into a new record under `accord/research/`, listed under the ticket's `research:`\n key, as `research.md` of the intent skill says; skip this when they hold none. Then, in `accord/tickets/<id>.md`,\n replace the `lane:` line with `lane: \"S\"`, and replace the `## Intent`,\n `## Acceptance criteria`, `## Open questions` and `## Approach` sections, headings included, with `## Understood`\n and `## Done when`, one line each, written from the intent interview already held, with no new interview, then\n `## Scope`, written as step 1 of the accord skill's lane S steps says. Keep `## Vetoes`, `## Decisions` and\n `## Corrections` verbatim, and every other frontmatter key as it is.\n4. Commit the ticket file and any record step 3 made with\n `git commit -m \"<subject>\" -- accord/tickets/<id>.md` (the line `accord subject intent <id> moved to lane S` prints) followed by the path of each such record, push with\n `git push -u origin <claim branch>`, then load the accord skill and go on at its Continue step 2 in this same\n session, where the anchor prints `Lane: S` and the lane S steps go on from step 1 on the same id, branch and\n worktree.\n",
24820
24828
  "accord/lane-r.md": "---\nkind: reference\n---\n\n# Lane R: a question\n\nA lane R ticket holds a question, a timebox and a token budget, and ends in a research record under `accord/research/`\nthat the owner reads and decides on. It is worked from its own lane R ticket, in that ticket's worktree, never in the\nmain checkout. It has no approach, plan, critic, code review or verification, and its branch changes nothing outside\n`accord/`.\n\n## Start\n\n- New request: the accord skill ran `accord new ticket <id> --lane R --worktree`. Before you follow the `enter:` or\n `stop:` line it printed as `./worktree.md` says, write step 1's question and title into\n `<path>/accord/tickets/<id>.md`. Then run `git -C \"<path>\" commit -m \"<subject>\" -- accord/tickets/<id>.md`, `<subject>` being the line `accord subject ticket_question <id>` prints,\n and `git -C \"<path>\" push -u origin <branch>`. After `enter:`, go on at step 2 in that worktree; after `stop:`, the\n session opened there finds the question in the ticket.\n- Pick up: run `accord worktree open <id>` and follow `./worktree.md`.\n- Continue: `accord anchor` prints `Lane: R` and the stage. Resume at step 1 for `intent`, step 3 for `research`, and\n step 6 for `done`.\n\n## Steps\n\n1. **Question.** When `## Question` in `accord/tickets/<id>.md` holds no line, write the owner's question there in the\n owner's words, or a faithful English translation of them. When `title:` still reads `Short title in business\n language`, replace it with a few words naming the question.\n2. **Allowance.** When `## Timebox`, `## Token budget` or the owner's quoted answer under `## Decisions` is missing,\n ask the owner to set the timebox, as `<n> minutes` or `<n> hours`, and the token budget, as `<n> weighted tokens`\n (n may end in k or M). Ask in plain chat, as `./ask.md` says, but as an open question with no recommended value:\n the owner sets both, and you propose none. Write the values under `## Timebox` and `## Token budget`, and the\n answer under `## Decisions` as `- D-nn Timebox <value>, token budget <value> — \"<the owner's sentence>\"`, with the\n next free number and a faithful English translation of the owner's words. Commit, then run\n `accord gate ready <id>` and fix what it prints until it exits 0, and commit the ticket with the `ac_hash:` it\n wrote.\n3. **Research.** Answer the question by reading code, docs and data. Run `accord budget <id>` before each new\n dispatch or script run, and at least between steps: it prints `within budget` or `stop: ask owner`, then the\n elapsed time, the tokens and the `Spent:` line. Where its tokens read `not measured`, no full transcript count\n since the claim exists, and only the time decides. A script the research writes goes under `accord/research/`;\n `accord gate done <id>` names every path outside `accord/` the branch changes, a deletion included. A script that\n should ship becomes a new lane S or M ticket.\n4. **Stop.** On `stop: ask owner`, stop and do no more research until the owner answers. Ask the owner, as\n `./ask.md` says, whether to write the record now from what the research has, or to extend `## Timebox` or\n `## Token budget`. On write now, go on at step 5, and the record holds the line\n `Owner: write now — \"<the owner's sentence>\"`. On extend, write the new value into its section and a D-nn under\n `## Decisions` quoting the owner, run `accord gate ready <id>` again, commit the ticket, and go on at step 3; the\n record may note it as `Owner: extended to <value> — \"<the owner's sentence>\"`. `accord gate done <id>` refuses a\n record spent past the ticket's allowance without one of these answers.\n5. **Record.** Run `accord budget <id>` once more. Write `accord/research/<YYYY-MM-DD>-<topic>.md`: its first five\n lines hold `Date: <YYYY-MM-DD>` and `Repository at <sha>`, the commit the research read; then the question, the\n answer, the evidence each claim rests on, the `Spent:` line the last `accord budget <id>` printed, and the\n `Owner:` line of step 4 when there is one. Add its path to the ticket's `research:` list, and commit both.\n6. **Pull request.** Run `accord gate done <id>` and fix what it prints. Push the branch with\n `git push -u origin <branch>` and open a pull request with `gh pr create --fill` when `gh` is available, otherwise\n ask the owner to open it. It waits for the owner's merge; the ticket is done once the record merges, by a merge\n commit, a squash or a rebase. Report the finish as `./finish.md` says.\n\n## Rules\n\n- A correction from the owner goes verbatim under `## Corrections` in the ticket, before any other action.\n",
24821
24829
  "accord/lane-s.md": "---\nkind: reference\n---\n\n# Lane S\n\nA lane S change is worked from its own lane S ticket, in that ticket's worktree, never in the main checkout. It has\nno intent interview, approval, approach, plan, executor or verify: you make the change yourself.\n\n## Start\n\n- New request: the accord skill ran `accord new ticket <id> --lane S --worktree`. Before you follow the `enter:` or\n `stop:` line it printed as `./worktree.md` says, write the title, the two lines of step 1 and the `## Scope` lines `./lane.md` describes into\n `<path>/accord/tickets/<id>.md`, asking step 1's question first when it needs one. Then run\n `git -C \"<path>\" commit -m \"<subject>\" -- accord/tickets/<id>.md`, `<subject>` being the line `accord subject ticket_understood <id>` prints, and\n `git -C \"<path>\" push -u origin <branch>`. After `enter:`, go on at step 1 in that worktree; after `stop:`, the\n session opened there finds the two lines in the ticket.\n- Pick up: run `accord worktree open <id>` and follow `./worktree.md`.\n- Continue: `accord anchor` prints `Lane: S` and the stage. Resume at step 1 for `intent`, step 2 for `build`, step 4\n for `review`, and step 6 for `done`.\n\n## Steps\n\n1. **Understood.** When `## Understood` and `## Done when` in `accord/tickets/<id>.md` each hold a line, keep them.\n Otherwise write one line under `## Understood`: the change as you understood it, and one line under\n `## Done when`: the observable result that ends the work. Go on without waiting only when the request has a concrete anchor (file, symbol,\n error message, or expected behaviour) and one plausible reading; otherwise ask exactly one question, as\n `./ask.md` says, and wait. When `title:` still reads `Short title in business language`, replace it with a few\n words naming the change in business language. When `## Scope` holds no path, run step 1 of `./lane.md` and write its files there as its `## Scope` says. Run `accord gate ready <id>` and fix what it prints until it exits\n 0, then commit the ticket. When it says a `depends_on` ticket is not done on the default branch, never remove that entry\n from `depends_on`: tell the owner this ticket waits for that ticket's merge, then after the merge run `git fetch` and\n `accord gate ready <id>` again. Make no other change before that. Never run `accord approve`.\n2. **Change.** Make the change in this worktree. For a bug, first write a test that reproduces it and see it fail,\n then fix it. A test you add carries `risk:<kind>` in its name. A file outside `## Scope` that the change only\n rewords, in at most 3 lines, neither new nor deleted, needs the line `Wording-only: <path> — <reason>` under\n `## Rulings` in `accord/tickets/<id>/ledger.md` before the review. A `.md` record under `accord/research/` that the ticket lists under `research:` and this branch\n adds is the ticket's own file and needs no `## Scope` line. Any other file beyond `## Scope`, a listed\n sensitive area, or a sign of a new interface lifts the ticket to lane M.\n3. **Tests.** Run the `tests.affected` command from `accord/config.yml` over the changed files, or `tests.full` when\n `tests.affected` is not configured or finds no test file. Fix what fails, then commit the change.\n4. **Review rounds.** Round <n> runs `accord review-package <id>` into a file outside the working tree and\n dispatches one fresh `accord-reviewer`, lens `both`, with the paths of the ticket file, that file, and\n `accord/tickets/<id>/ledger.md` when it exists. Append what it reports to `accord/tickets/<id>/review.md` under\n `## Round <n> head <sha>`, `<sha>` being the `Head: <sha>` line the package printed and the heading ending\n ` (added code round 1)` when `accord round` printed `Added code:`; write each finding as\n `Must|Should|Nice <n>: <finding> — <path>[:<line>] | none — fixed in <sha> | deferred | open`, then its marks, or\n `No findings`; copy each\n `Confirmed wording-only: <path>` line it reports verbatim into that round, and commit\n `review.md` alone at once; when you stop after this round with no Must open, first append step 5's verdict, so\n the round and its verdict are one commit. When the round reports a Must, fix every Must and Should yourself, run\n step 3 again, commit, and start the next round with a new reviewer; a finding for a file outside `## Scope`\n with no `Wording-only` line, or for a sign of a new interface, is not fixed here: it starts the lift below.\n When it reports no Must open, either stop\n there, leaving its Shoulds open in the record, or fix them the same way and run another round: a fix no reviewer\n has seen never ships. There is no final reviewer and no model tier-up. At most five rounds, counted from the\n `## Round <n>` sections of `review.md`: when the fifth still reports a Must, commit its record, stop and report\n the open findings to the owner; never report the work finished. Resumed at `review`, the next round is one after\n the last `## Round <n>` in `review.md`; when that round reported a Must whose fix is not yet committed, make and\n commit the fix first.\n `review.md` starts with the line `Round record: 2`, above every heading. A `review.md` whose first round was committed while `accord/config.yml` pinned accord 0.3.0 or earlier keeps its `Round record: 1`, its `## Round <n>` headings and its finding lines, without heads or marks, and keeps that form after a merge of the default branch. The marks, evidence, grounds, `## Deferred` line and fix-file rules below bind a `Round record: 2` record only; a version 1 record keeps its old rules. A finding line starts with its severity word, `Must`, `Should` or `Nice`, never two of them or a question mark. After its state a finding line carries its marks, each after ` — `: `carried from <r>.<n>` when round `<r>` of this cycle reported it as finding `<n>`; `risk: data-loss` or `risk: security`; `test: <test id>` or `command: <command>` when a failing test or a command reproduces it; `rests on: Understood \"<quote>\"` or `rests on: Done when \"<quote>\"`, a quote of at least three words. Rounds are counted within the cycle. From round 3 a Must or Should not carried from an earlier round, whose location is not a file your previous fix changed, blocks only with `test:`, `command:` or a `risk:` mark; otherwise write it `deferred` with the line `- review <r>.<n> cycle <k>: <finding>` under `## Deferred` in `accord/tickets/<id>/ledger.md` (` cycle <k>` from cycle 2 on), and it leaves the stop. For a finding in a file that a merge's own changes touched, reviewed in the round headed `(added code round 1)`, the count restarts at that round, per finding file; every other finding keeps the ticket's count. The Should rule uses the same count: from round 3 a new Should also needs `rests on:`, `test:`, `command:` or a `risk:` mark, or is written as a Nice. Each file a commit after a round changes, up to the next round, but a merge of the default branch and a commit that changes only the ticket's records, is the location of a finding of that round, or a Ruling in the ledger names its path with a reason. Before each round, and before appending step 5's verdict, run `accord round <id>`: exit 0 prints the round's number and the cap, counting the `## Round <n>` sections after the last `## Return from verify` line. It prints `stop: report to owner` from round 3 on a round that still reports a Should or a Must, and at the cap: commit the round's record, stop and report the open findings to the owner with what it prints, and write the owner's answer as the last line `verdict: accepted-by-owner \"<the owner's words>\"`, as the ledger Ruling `Ruling: the owner allows <n> more review rounds after round <r> of cycle <k> — \"<the owner's words>\" — <cost if wrong>`, or as the lift to lane M below, which is the change of course in lane S. Before the verdict, a stop whose only `Reason:` is that the cap is reached and no owner Ruling allows more lets the verdict be written. When exit 0 also prints `Added code:`, run that round first, headed `(added code round 1)`, before the verdict. On `refused:`, fix what it names and run it again. Resumed at `review` with `review.md` ending in a verdict and a commit made after it, first run `git log -1 --format=%H -- accord/tickets/<id>/review.md` and append `## Return from verify <sha>` with the sha it prints; the rounds after it count from 1.\n5. **Verdict.** The last line of `review.md` is `verdict: converged` when the last round reported no Must open (a Must deferred under the evidence rule, with its `## Deferred` line, is not open), or\n `verdict: accepted-by-owner \"<the owner's words>\"` when the owner accepts the open findings at the cap or at a stop from round 3; that one\n is committed alone, right after that round's record. Nothing follows that line. `accord gate done` fails on\n any commit after the last round's record that changes more than the ticket's records: a change after it needs\n another round and a new verdict.\n6. **Pull request.** When `tests.report` is set in `accord/config.yml` and `tests.affected` does not write it, run\n `tests.full` first so the gate finds a fresh report. Run `accord gate done <id>` and fix what it prints. Push the branch with\n `git push -u origin <branch>` and open a pull request with `gh pr create --fill` when `gh` is available, otherwise\n ask the owner to open it. It waits for the owner's merge. Report the finish as `./finish.md` says.\n\n## Lift to lane M\n\nWhen the work meets a lift condition in `./lane.md`, a reviewer finds a file outside `## Scope` with no `Wording-only` line or a sign of a new interface, or `accord gate done <id>` names a file outside `## Scope`, a sensitive area or a sign of a new interface, or says `## Scope` held no path, stop and say which one. On the owner's yes, in this same\nticket, branch and worktree:\n\n1. In `accord/tickets/<id>.md`, change `lane: S` to `lane: M` and add the lane M sections, each empty, after the\n existing ones: `## Intent`, `## Acceptance criteria`, `## Vetoes`, `## Decisions`, `## Corrections` when absent,\n then the open questions and approach sections the lane M template has.\n2. Remove `accord/tickets/<id>/review.md` with `git rm` when it exists.\n3. Run `git merge-base HEAD <origin's default branch>` and write into `accord/tickets/<id>/ledger.md`, under\n `## Rulings`: `Ruling: lifted from lane S; the plan baseline is the fork point <sha> — the review then reads the lane S code too — cost if wrong: that code goes unreviewed`.\n4. Commit, then load `accord-intent` and start the intent interview. Code already committed stays on the branch.\n\n## Rules\n\n- A correction from the owner goes verbatim under `## Corrections` in the ticket, added with the first one, before\n any other action.\n- Every decision that is not the owner's is a Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n",
24822
24830
  "accord/lane.md": "---\nkind: reference\n---\n\n# Proposing a lane\n\nA request that only asks a question, and asks for no change to code, docs or configuration, is lane R: propose lane R\nwith that reason, without the scout of step 1, and the accord skill follows its `lane-r.md`. The owner may override.\n\n1. For every new request, however small it looks, first dispatch `accord-scout` with the request's text and ask\n for facts only, each with its `path:line`: the existing files the change is expected to touch; which of them an\n entry under `sensitive:` in `accord/config.yml` matches, with that entry's `path:line`, an entry ending in `/`\n matching every path below that folder; and the code locations a different reading of the request would change,\n or \"not found\" and where it looked. The scout reports facts and never judges the reading. It reports only the\n files that exist; you add the new files the change creates. Check and save its reply as `./scout.md` says.\n2. From those facts, judge each lift condition yourself. When the scout names code locations a different reading\n would change, you form the one question that settles the reading from them, or count the request as having\n more than one plausible reading when no single question can.\n3. Propose a lane with its reason, out loud, stating the scout's facts for each lift condition and what you judged\n from them: the files the change is expected to touch, any listed sensitive area among them, and whether the request has one reading or one\n question settles it. The owner may override.\n\nAny of these lifts S to M, and nothing else: a public interface or schema changes; a listed sensitive area, or\nauth, money or data deletion, is touched; more than one plausible reading, where a reading one question settles\nstays lane S; the expected files, not counting test files and the copies accord itself generates, number more\nthan 5 or span more than 3 code areas, a code area being a file's folder cut to its first four path segments.\n\nThe expected files of that last condition are counted over the files the scout reports plus the new files you name,\nminus test files and the copies accord generates: a request that creates 7 new files is lane M. `accord scout check` prints these counts, and the sensitive matches, from the scout's `## Files` and the `## New files` you add.\n\nA test file sits under a folder named `test`, `tests` or `__tests__`, or its name holds `.test.` or `.spec.`.\nThe copies accord generates are the files `accord skills sync` writes and the paths listed under `generated:` in\n`accord/config.yml`. The code area of `src/app/export/csv/writer.ts` is `src/app/export/csv`; that of\n`README.md` is the repository root. A `.md` record under `accord/research/` that the ticket lists under `research:`\nand the branch adds is the ticket's own file: it is not an expected file and needs no `## Scope` line.\n\n## Scope\n\nA lane S ticket lists the expected files under a `## Scope` section of its ticket file, one repository path per\nline and never a folder, before any change is made: every file the change is expected to touch, test files and\nnew files included, the new ones named by you, since the scout reports only files that exist. Write each as a\nbare path or `- path`, with forward slashes. The scope stands as it is when `ac_hash` is first committed; a file\nthe change needs beyond it lifts the ticket to lane M, except a wording-only file the lane S steps declare.\n",
24823
- "accord/onboard.md": "---\nkind: reference\n---\n\n# Onboarding a repository: `/accord onboard`\n\nUse this after `accord init` printed `proposal:` lines, or when the user types `/accord onboard`. `accord init` only\nproposes: it writes nothing to `accord/config.yml`. This file writes only through `accord config set`, and only\nafter the user's yes. An agent that ran `accord init` itself follows this file right after, and never answers a\nquestion for the user. When the session check of `./worktree.md` says this session works a ticket, stop and say the\nteam's settings are changed from the main checkout, not from a ticket branch. Read `./ask.md` before the first question.\n\n1. Take the `proposal:` lines of the `accord init` output just printed, or run `accord init` again (it changes\n nothing it already wrote). Each line reads `proposal: <key> = <JSON value> (evidence: <text>)`. When there is\n none, say accord has nothing to propose for this repository and go to step 5.\n2. Go through the proposals one proposal at a time, in the order printed. Never ask about two at once, and never\n skip one without asking.\n3. For a proposal, say in plain words what the key controls, show the value and its evidence, and run\n `accord config get <key>` to say what accord uses now (`unset` means accord's own default: say what that does).\n Ask one question that stands alone, with what happens on yes and what happens on no:\n - **Take the proposed value.** The file changes; say what changes for the team.\n - **Keep accord's default.** Nothing is written, and the proposal is not asked again in this run.\n - **Give another value.** The user types it.\n\n What the keys control:\n\n | Key | What it controls | What a change keeps working |\n |---|---|---|\n | `git.merge` | how the team merges pull requests, which sets how a ticket branch takes the default branch in | everything, nothing is rewritten |\n | `commits.subjects` | the wording of every commit accord writes | tickets in flight: the old wording is kept as `commits.legacy_subjects` |\n | `branch` | the name shape of a new ticket branch | branches that already exist |\n | `ids` | how new ticket ids are made, or taken from the tracker | ids in use: they are kept as `legacy_ids` |\n | `tracker` | the tracker `accord status` reads, for display only | nothing else reads it |\n\n4. Run `accord config set <key> '<value>'` only after the user's yes, or with a value the user gives. Pass the value\n as the proposal printed it, quoted so the shell keeps it as one argument. Show its `changed:` line and every line\n after it verbatim, and say in one sentence what each added line keeps working. When it exits 2, show its reason and\n ask again or skip. On a no, write nothing; never edit `accord/config.yml` by hand, never set a value the user did\n not confirm, and never take silence or \"whatever\" for a yes.\n5. When the last proposal is answered, run `git diff -- accord/config.yml` and show it. Say that this skill does not\n commit: the user commits the file in the team's usual way. Then say that the first ticket starts with\n `/accord <request>`.\n\n## Changing a value later\n\nA request to change ids, commit subjects, sync, strictness, template sections or the tracker, at any time, follows the\nsame steps with the key the request names (`ids`, `commits.subjects`, `git.merge` or `git.sync`, `strictness`,\n`template.sections`, `tracker`, or `people.<email>`): run `accord config get <key>`, ask as in step 3, set through\n`accord config set <key> '<value>'` after the yes, and finish with step 5. `accord config unset <key>` takes a key back to\naccord's default, asked the same way, and `accord config check` lists every problem in the file. The command, not this\nfile, applies what a change keeps working (`legacy_ids`, `commits.legacy_subjects`) and refuses a value the schema or the\nfloor does not allow.\n",
24831
+ "accord/onboard.md": "---\nkind: reference\n---\n\n# Onboarding a repository: `/accord onboard`\n\nUse this after `accord init` printed `proposal:` lines, or when the user types `/accord onboard`. `accord init` only\nproposes: it writes nothing to `accord/config.yml`. This file writes only through `accord config set`, and only\nafter the user's yes. An agent that ran `accord init` itself follows this file right after, and never answers a\nquestion for the user. When the session check of `./worktree.md` says this session works a ticket, stop and say the\nteam's settings are changed from the main checkout, not from a ticket branch. Read `./ask.md` before the first question.\n\n1. Take the `proposal:` lines of the `accord init` output just printed, or run `accord init` again (it changes\n nothing it already wrote). Each line reads `proposal: <key> = <JSON value> (evidence: <text>)`. When there is\n none, say accord has nothing to propose for this repository and go to step 5.\n2. Go through the proposals one proposal at a time, in the order printed. Never ask about two at once, and never\n skip one without asking.\n3. For a proposal, say in plain words what the key controls, show the value and its evidence, and run\n `accord config get <key>` to say what accord uses now (`unset` means accord's own default: say what that does).\n Ask one question that stands alone, with what happens on yes and what happens on no:\n - **Take the proposed value.** The file changes; say what changes for the team.\n - **Keep accord's default.** Nothing is written, and the proposal is not asked again in this run.\n - **Give another value.** The user types it.\n\n What the keys control:\n\n | Key | What it controls | What a change keeps working |\n |---|---|---|\n | `git.merge` | how the team merges pull requests, which sets how a ticket branch takes the default branch in | nothing for `merge` and `squash`; under `rebase` a ticket's branch is rebased and force-pushed with a lease at verify |\n | `commits.subjects` | the wording of every commit accord writes | tickets in flight: the old wording is kept as `commits.legacy_subjects` |\n | `branch` | the name shape of a new ticket branch | new branches; an in-flight branch with the old name stops being found once the new value reaches the default branch, so change it between tickets |\n | `ids` | how new ticket ids are made, or taken from the tracker | ids in use: they are kept as `legacy_ids` |\n | `tracker` | the tracker `accord status` reads, for display only | nothing else reads it |\n | `git.sync`, `tracker.command` | a script the repository declares: how a ticket branch takes the default branch in, or where `accord status` reads issues | nothing runs until the person runs `accord trust` |\n\n4. Run `accord config set <key> '<value>'` only after the user's yes, or with a value the user gives. `config set` stores\n the text it is given, quotes included, so pass the bare value in single quotes (so the shell keeps it as one\n argument). A printed value that is a JSON string is passed without its outer double quotes (the printed\n `proposal: git.merge = \"squash\"` is run as `accord config set git.merge 'squash'`); a printed `[` or `{` collection is\n passed as printed. A value the user types is passed as typed, never wrapped in quotes of its own. Show its `changed:` line and every line\n after it verbatim, and say in one sentence what each added line keeps working. When it exits 2, show its reason and\n ask again or skip. On a no, write nothing; never edit `accord/config.yml` by hand, never set a value the user did\n not confirm, and never take silence or \"whatever\" for a yes.\n `git.sync` and `tracker.command` (under `tracker.adapter: script`) are scripts from the repository, so accord does\n not run them until the person allows them once with `accord trust`: a local record inside `.git`, never committed,\n bound to the command and the files it reaches, so a change to either asks again; `accord trust --revoke` withdraws\n it. `accord trust` shows each script with a digest, the files an allow covers and the ones that changed, and allows\n nothing; `accord trust git.sync@<digest>` or `accord trust tracker.command@<digest>`, with the digest exactly as\n shown, allows that one, and refuses if the files changed since. accord checks only the files `accord trust` lists;\n anything else the command loads is not checked, so whoever allows a script must review the pull request that\n changed it. After setting one, say so and name the command. Run `accord trust` only when the user asks you to, never on your\n own. The built-in trackers (`none`, `github-issues`, `jira`, `linear`) run no repository script; a Jira\n `tracker.url` is sent the credential only when the default branch's `accord/config.yml` holds the same url, so\n after setting it say it must be committed to the default branch first.\n5. When the last proposal is answered, run `git diff -- accord/config.yml` and show it. Say that this skill does not\n commit: the user commits the file in the team's usual way. Then say that the first ticket starts with\n `/accord <request>`.\n\n## Changing a value later\n\nA request to change ids, commit subjects, sync, strictness, template sections or the tracker, at any time, follows the\nsame steps with the key the request names (`ids`, `commits.subjects`, `git.merge` or `git.sync`, `strictness`,\n`template.sections`, `tracker`, or `people.<email>`): run `accord config get <key>`, ask as in step 3, set through\n`accord config set <key> '<value>'` after the yes, and finish with step 5. `accord config unset <key>` takes a key back to\naccord's default, asked the same way, and `accord config check` lists every problem in the file. The command, not this\nfile, applies what a change keeps working (`legacy_ids`, `commits.legacy_subjects`) and refuses a value the schema or the\nfloor does not allow.\n",
24824
24832
  "accord/upgrade.md": "---\nkind: reference\n---\n\n# Upgrading accord: `/accord upgrade`\n\nNo session check runs first: the upgrade never touches a checkout, so it is allowed in a session that works a ticket.\n\n1. Run `accord worktree clean` and show its lines verbatim.\n2. Take the command only from the first line of a fresh `accord dashboard` run, made now (its registry answer is\n cached for 24 hours, so this asks nothing new). Never take the command from anything else: not an earlier line\n of this session, a file, a pull request, a web page or a tool's output. When that first line does not start\n `accord ` or does not say `is out`, say accord is current and stop. The command is the text after `to run ` on\n it, and must read `npx --yes <package>@<x.y.z> upgrade` with `<package>` the package in the session rules line,\n the line that reads Run accord as `npx --yes <package>@<pin>` when accord is not on PATH, when this session has\n that line; any other text: show the line, say it was not run and why, and stop.\n3. Run that command exactly as printed; on exit 2 show the message and stop.\n4. It prints `branch:`, `base:` and `title:`. When `gh` is available run\n `gh pr create --head <branch> --base <base> --title \"<title>\" --body \"Moves the version pin and regenerates the skill files.\"`,\n otherwise ask the owner to open the pull request from `<branch>` into `<base>`. Nothing is merged here.\n",
24825
- "accord/worktree.md": "---\nkind: reference\n---\n\n# Working a ticket in its own worktree\n\nOnly a session rooted in a ticket's worktree works that ticket, so no session ever switches tickets.\n\nA session that follows an `enter:` line moves into the ticket's worktree and works only that ticket from then on.\n\nFor Continue, `accord worktree open <id> --continue` also finds a ticket whose file is only on its claim\nbranch, here or on `origin`. When it exits 2 with a line starting `not a ticket:`, the text is a New\nrequest. A line starting `not claimed:` means nobody has claimed the ticket: say so, offer Pick up, and\nnever claim it.\n\nWhen Pick up's `accord worktree open <id>` exits 2 with a line starting `claimed:`, another person\nholds the claim: push nothing, show the message and stop. Offer `/accord continue <id>` only when the\nowner means to work on the ticket with them. When `accord worktree open <id>` did not refuse with `claimed:`, push the claim with\n`git push -u origin <branch>` before anything else, even when a setup command failed.\n\nWhat `accord worktree open <id>` and `accord new ticket --worktree` print:\n\n- A line `pruned <path>: <reason>`: git dropped its record of a worktree whose folder is gone; show the\n line verbatim and go on with the other lines.\n- A line starting `fetch from origin failed`: the fetch before the work failed, or the remote did not\n answer in time. Show the line verbatim and go on with the other lines; the work goes on with the refs\n already in this clone.\n- A line starting `behind:` (Continue only): Continue did not take the remote's default branch in, because the\n ticket is at verify or done, its worktree has uncommitted changes, another session holds it,\n this session is missing the variables that identify it, or its remote branch has commits this clone's branch lacks. Show the line verbatim and go on.\n Never sync here: at verify `accord-verify` runs `accord worktree sync <id>` once, after review.\n- A line starting `merged:`, `rebased:` or `synced:` (Continue only): Continue brought the remote's default branch into\n the ticket branch in the way `git.merge` says (a merge commit, a rebase, or the team's `git.sync` command), ran the\n setup commands on it and pushed it. Show it verbatim and go on.\n- A line starting `push of` that `accord worktree open <id> --continue` prints: the sync was not\n pushed. Show it verbatim, tell the owner the synced branch is local only, and run the push command the\n line names; when that push fails too, show git's message and stop.\n- A line starting `push of` from `accord worktree push <id>`, which a stage skill runs after its commit:\n the commits stay local until the next push. Show it and git's message after it verbatim and go on with\n the stage's next step; never stop or ask the owner. After a commit is reworded, as `accord-build` step 3\n does for a forbidden line, run the next push as `accord worktree push <id> --force-with-lease`: a plain\n push is rejected once the reworded commit was already on origin, and the command still refuses to\n replace a commit someone else pushed that this branch never held, even after a fetch.\n- Lines starting `removed`, `deleted` or `kept`, or `clean failed`, `clean skipped` or `clean stopped`: the clean of\n tickets done or dropped on the default branch. A `kept` line ends with its reason. Only when that reason names a\n file accord never deletes does the owner move or delete that file; for any other reason nothing is to be deleted and\n the folder stays, as with `holds a repository: <path>` (a nested repository, maybe with unpushed commits; never\n offer to delete it), `has an edit git status hides: <path>`, `uncommitted work`, `held by another session`, `this session's worktree`,\n `checked out on <branch>`, `being rebased` or `it holds the worktree …`. Show them verbatim and go on.\n Another such reason is `research record <path> is not on <default> as <branch> holds it`: the record is the owner's to reconcile, never to delete or move; make the branch copy equal to the default branch's, or put it on the default branch, then push, and the branch stays.\n- A line starting `note <id>:` says a record or a hold was not updated. Show it verbatim and go on.\n- A line `stop:`: show the two lines after it verbatim, the worktree's path and the line to type in a\n session opened in that folder, then stop. Never change directory into the worktree, never edit a file\n there except the people entry below, the scout's report `accord/tickets/<id>/scout.md` with the commit and push that save it, and, in a lane S ticket, its `title:`, its `## Understood`, `## Done when` and `## Scope` lines and the commit and push of that ticket file, and never start the next stage from this session.\n- `enter: <path>` (printed instead of `stop:` when this session can move into the worktree): this session\n moves into the worktree. First, when Pick up made the claim, push it with `git push -u origin <branch>`\n as above, and carry any people entry as below; then call EnterWorktree with `path` set to `<path>`, and\n go on at Continue step 2 (`accord anchor`) without asking. From then on every command, path and edit is\n in the worktree. When EnterWorktree fails, show `<path>`, say \"type `/accord continue <id>` to retry, or\n close this session and open one in that folder\", and stop, editing nothing.\n- `held: <id> by this session`: this session holds the ticket; go on with the next step.\n- `not held:`: this tool does not refuse a second session yet; say so in one line and go on with the\n next step.\n- Exit 2 naming the session that holds the ticket: show the message and stop, editing nothing.\n- Exit 2 naming a setup command: show the message and stop. The worktree is kept; once the owner fixes\n the command, they type `/accord continue <id>` again in this same session and follow the `enter:` or\n `stop:` line it prints. The run that prints `enter:` has already run every setup command again; after a\n `stop:` line, `/accord continue <id>` in a session opened there runs every setup command again.\n- Exit 2 starting `this session works`: this session works another ticket; show the message and stop,\n editing nothing.\n- Exit 2 starting `merge of`: Continue's merge stopped and was aborted; show the message and stop, editing\n nothing.\n- Any other exit 2: show the message and stop.\n\nSetup commands can take minutes: run these commands with the longest timeout your tool allows.\n\nWhen `./ids.md` had you add an entry under `people` before `accord new ticket --worktree`, carry it to the\nworktree before you stop or move into it: add the same entry to `<path>/accord/config.yml`, run\n`git -C \"<path>\" commit -m \"people: <email>\" -- accord/config.yml` and\n`git -C \"<path>\" push -u origin <branch>`, then remove that entry, and only that entry, from\n`accord/config.yml` here, leaving every other line of the file as it is.\n\nWhen `accord new ticket --worktree` says the push failed, it prints no `stop:` line: carry any people\nentry as above, run the push it names, and once it succeeds, run `accord worktree open <id> --continue`\nand follow the `stop:` or `enter:` line it prints. When that push fails again, show git's message and stop.\n\nThis skill runs `accord worktree clean` itself only from `/accord` with no argument and from `/accord upgrade`;\n`accord worktree open` and `accord new ticket --worktree` clean the same way on their own, so a ticket done on\nthe default branch loses its worktree and branches at any `/accord` command. In a tool that runs accord's session-start hook, every\nsession start, resume or /clear runs the same clean, so a ticket merged since the last session loses its worktree,\nits branches and any folder left behind with nobody typing a command; the hook ends its clean lines with\n`tell the owner the lines above`, so show them to the owner in your first reply. A New request the session check\nstops cleans nothing. At the dashboard its lines are shown verbatim with the dashboard's.\n\n## Session check\n\nRun it before the dashboard and before every New request, in every lane, also a New request picked from the\ndashboard; never before Pick up or Continue on a named ticket. Run `accord worktree check`.\n\n- Exit 0: go on.\n- Exit 2 with a message that starts `this session works`: this session works the ticket it names. Show the\n message. For the dashboard, go on with it, and offer only Continue on that ticket. For a New request, stop:\n write, create, claim and edit nothing, except a New request that reports a failure in a ticket that has\n reached verify: follow `./failure.md`.\n- Any other exit 2: show the message. For the dashboard, go on with it; for a New request, stop, editing\n nothing.\n",
24826
- "approach/SKILL.md": "---\nname: accord-approach\ndescription: Use when a lane M ticket has its intent and acceptance criteria and needs an approach. Has the planner draft the lightest approach that works, has a critic argue against it in capped rounds, and takes the owner's explicit yes before accord approve.\nlicense: MIT\nkind: skill\nloads: [approach/approval.md, approach/critique.md, shared/ask.md, shared/scout.md]\n---\n\nThis stage chooses how the ticket will be built, lightest first, and takes\nthe owner's yes before anyone plans. You run it in the main session.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming approach, do not run this stage:\n tell the owner so in one line, skip steps 2 to 4, and run only the approval (step 5, `./approval.md`),\n because the owner's yes stays.\n\n2. **Options.** Dispatch `accord-planner` in its `direction` mode with the path of\n `accord/tickets/<id>.md`. It writes only `accord/tickets/<id>/direction.md`, which the critic never reads. Its report holds an impact\n list naming file and line, two or three options in ladder order with the\n lightest that works first, each added layer naming the criterion or\n constraint that requires it, and, when the ticket touches auth, money,\n migration, or data deletion, three failure scenarios in total with how\n each is undone. The chosen option is the one it marks `Recommended`,\n unless the owner has already picked another. Write into `## Approach`\n only the chosen option's name, what it does, and the impact list, never\n its reasons, its risk line, the other options or the `Recommended` line,\n so the critic's review stays independent. Write the ladder Ruling of\n `./critique.md` into `accord/tickets/<id>/ledger.md`. When a new session\n or a revision needs the planner again, dispatch it in `direction` mode\n with the name of the option `## Approach` names: it keeps that option,\n and nobody picks again. Commit `accord/tickets/<id>.md`, its `direction.md` and\n `accord/tickets/<id>/ledger.md`; keep the report for steps 3 and 4.\n\n3. **Critique.** Run the loop in `./critique.md`, running\n `accord round <id> --approach` before each round. One `accord-critic` in a\n fresh context, mode `approach`, argues the strongest case against the\n chosen option and checks it against Vetoes, Decisions, and Corrections,\n for every ticket in lane M and above. A Must that would break a Veto,\n Decision, or Correction rules the option out, and the first option of\n the ladder Ruling that is not yet ruled out takes its place, as\n `./critique.md` says; when none is left, ask the owner.\n\n4. **Write `## Approach`** in `accord/tickets/<id>.md`, in full, about fifteen lines:\n\n - a `- Chosen:` line, the option and why;\n - one `- Rejected: <option> — <why>` line per other option the ladder\n Ruling names, the why taken from its `## Closed` heading or the\n Ruling's `Recommended` line;\n - affected areas, from the impact list;\n - risks: every critic finding the chosen option keeps, Must findings\n first, so the owner approves with them in view; for a ticket that\n touches auth, money, migration, or data deletion, each of the three\n failure scenarios and how it is undone;\n - test strategy: which criterion is tested at which layer.\n\n Commit `accord/tickets/<id>.md` and `accord/tickets/<id>/approach-review.md`, with the ledger if it changed.\n\n5. **The owner's yes.** The owner approves once, from the short view of the ticket, and\n the yes covers the whole ticket as written. Follow `./approval.md`: it checks the scout file (`./scout.md`), shows\n `accord show <id> --approval --short`, asks for the yes, and on yes runs\n `accord approve <id>`, then `accord gate ready <id>`, and commits and pushes.\n Never run `accord approve` without the owner's yes in this conversation.\n\n6. Next: `accord-plan`, only once `accord gate ready <id>` passes. While it\n fails, the commit in step 5 carries `approved_hash:` alone; after its push,\n stop and tell the owner that `/accord continue <id>` plans the ticket once\n the gate passes.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- A later change to Intent, acceptance criteria, Vetoes, Decisions,\n Corrections, or Approach needs a new yes from the owner and a new\n `accord approve <id>`.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24827
- "approach/approval.md": "---\nkind: reference\n---\n\n# The owner's yes\n\nThe owner approves once, here, from the short view of the ticket. The view\nshortens what the yes covers; it never narrows it.\n\n1. Run `accord scout check \"accord/tickets/<id>/scout.md\"`, and follow `./scout.md` when\n it does not exit 0 and when `accord approve` exits 1 below.\n\n2. Run `accord show <id> --approval --short`; if it fails, stop and tell the\n owner. Paste its output unchanged, as Markdown, not inside a code block.\n Below it put a horizontal rule, a heading \"In plain words\" written in the\n chat language, and one line per scenario that begins with its ac-n and says\n in plain words what it means, and ask for an explicit yes. The risks the\n view lists are the Must and Should approach findings still open, never a\n Nice, and the risk findings the owner dropped; the owner accepts them\n with the yes. When the view has a `## Blocking findings` part, an open\n `risk: data-loss` or `risk: security` finding, the owner cannot say yes:\n `accord approve` refuses while one is open. Show the part, say so, and ask\n for the no and its Correction (step 5) instead of the yes. A `record problem:`\n item in that part is a line of `approach-review.md` that accord cannot read,\n or a mark slot whose value does not parse: the owner cannot say yes until it\n is fixed (step 4). A risk named only in prose is not read and does not block;\n an open Must or Should that names one is listed under the risks, and an open\n Nice is not listed.\n\n3. The question names the text above it and `accord/tickets/<id>.md`, and\n says that the yes approves the ticket's Intent, acceptance criteria, Vetoes,\n Decisions, Corrections and Approach as written there, which the view\n shortens and the file holds in full.\n\n4. On yes, run `accord approve <id>`. When it exits 1 and prints `Blocking findings:`,\n the approval is refused: never edit the findings or the ticket to get past it;\n go to step 5 as for a no. When it prints `Record problems:`, correct only how a line is\n written, as `./critique.md` gives the form: rewrite a mark accord cannot read\n in the exact form it was meant to have, keeping the kind it names\n (`risks: security` becomes `risk: security`), and never change a finding's\n severity, state or the risk it names. When you cannot tell what the mark was meant to\n say, ask the owner, or have the critic restate that one mark; do not guess.\n Commit `approach-review.md`, and run `accord show <id> --approval --short` again.\n Otherwise run `accord gate ready <id>` and work\n from what it prints. When it says a `depends_on` ticket is not done on the\n default branch, never remove that entry from `depends_on`: tell the owner\n this ticket waits for that ticket's merge, then after the merge run\n `git fetch` and `accord gate ready <id>` again. Then commit the ticket, with\n `approved_hash:` and `ac_hash:` in it, and the ledger if it changed. Then run\n `accord worktree push <id>`; go on even if it fails.\n\n5. If the owner picks another option, append\n `## Closed <option>: the owner picked <other option>` to\n `accord/tickets/<id>/approach-review.md`, write that option into\n `## Approach` as step 2 of the skill says, go back to step 3 with that\n option, and ask again. On any other no, write the owner's words under\n `## Corrections` first, append `## Closed <option>: the owner's no` to\n `approach-review.md`, empty `## Approach` below its heading, go back to\n `accord-intent` step 8, and restart this stage at step 2.\n\n`accord approve` runs only on a yes to the sections as shown. Never run\n`accord approve` without the owner's yes in this conversation.\n",
24833
+ "accord/worktree.md": "---\nkind: reference\n---\n\n# Working a ticket in its own worktree\n\nOnly a session rooted in a ticket's worktree works that ticket, so no session ever switches tickets.\n\nA session that follows an `enter:` line moves into the ticket's worktree and works only that ticket from then on.\n\nFor Continue, `accord worktree open <id> --continue` also finds a ticket whose file is only on its claim\nbranch, here or on `origin`. When it exits 2 with a line starting `not a ticket:`, the text is a New\nrequest. A line starting `not claimed:` means nobody has claimed the ticket: say so, offer Pick up, and\nnever claim it.\n\nWhen Pick up's `accord worktree open <id>` exits 2 with a line starting `claimed:`, another person\nholds the claim: push nothing, show the message and stop. Offer `/accord continue <id>` only when the\nowner means to work on the ticket with them. When `accord worktree open <id>` did not refuse with `claimed:`, push the claim with\n`git push -u origin <branch>` before anything else, even when a setup command failed.\n\nWhat `accord worktree open <id>` and `accord new ticket --worktree` print:\n\n- A line `pruned <path>: <reason>`: git dropped its record of a worktree whose folder is gone; show the\n line verbatim and go on with the other lines.\n- A line starting `fetch from origin failed`: the fetch before the work failed, or the remote did not\n answer in time. Show the line verbatim and go on with the other lines; the work goes on with the refs\n already in this clone.\n- A line starting `behind:` (Continue only): Continue did not take the remote's default branch in, because the\n ticket is at verify or done, its worktree has uncommitted changes, another session holds it,\n this session is missing the variables that identify it, or its remote branch has commits this clone's branch lacks. Show the line verbatim and go on.\n Never sync here: at verify `accord-verify` runs `accord worktree sync <id>` once, after review.\n- A `behind:` line with `git.sync is not allowed to run here yet - run accord trust in \"<path>\" to see what it covers,\n then accord trust git.sync@<the digest it shows> there`, or an exit-2\n message of `accord worktree sync <id>` that says `run accord trust in \"<path>\"`: the team's sync script is repository\n content that the person has not allowed in the checkout it names, or that changed since. Show it verbatim and stop\n there; `accord trust` is the owner's to run, never yours.\n- A line starting `merged:`, `rebased:` or `synced:` (Continue only): Continue brought the remote's default branch into\n the ticket branch in the way `git.merge` says (a merge commit, a rebase, or the team's `git.sync` command), ran the\n setup commands on it and pushed it. Show it verbatim and go on.\n- A line starting `push of` that `accord worktree open <id> --continue` prints: the sync was not\n pushed. Show it verbatim, tell the owner the synced branch is local only, and run the push command the\n line names; when that push fails too, show git's message and stop.\n- A line starting `push of` from `accord worktree push <id>`, which a stage skill runs after its commit:\n the commits stay local until the next push. Show it and git's message after it verbatim and go on with\n the stage's next step; never stop or ask the owner. After a commit is reworded, as `accord-build` step 3\n does for a forbidden line, run the next push as `accord worktree push <id> --force-with-lease`: a plain\n push is rejected once the reworded commit was already on origin, and the command still refuses to\n replace a commit someone else pushed that this branch never held, even after a fetch.\n- Lines starting `removed`, `deleted` or `kept`, or `clean failed`, `clean skipped` or `clean stopped`: the clean of\n tickets done or dropped on the default branch. A `kept` line ends with its reason. Only when that reason names a\n file accord never deletes does the owner move or delete that file; for any other reason nothing is to be deleted and\n the folder stays, as with `holds a repository: <path>` (a nested repository, maybe with unpushed commits; never\n offer to delete it), `has an edit git status hides: <path>`, `uncommitted work`, `held by another session`, `this session's worktree`,\n `checked out on <branch>`, `being rebased` or `it holds the worktree …`. Show them verbatim and go on.\n Another such reason is `research record <path> is not on <default> as <branch> holds it`: the record is the owner's to reconcile, never to delete or move; make the branch copy equal to the default branch's, or put it on the default branch, then push, and the branch stays.\n- A line starting `note <id>:` says a record or a hold was not updated. Show it verbatim and go on.\n- A line `stop:`: show the two lines after it verbatim, the worktree's path and the line to type in a\n session opened in that folder, then stop. Never change directory into the worktree, never edit a file\n there except the people entry below, the scout's report `accord/tickets/<id>/scout.md` with the commit and push that save it, and, in a lane S ticket, its `title:`, its `## Understood`, `## Done when` and `## Scope` lines and the commit and push of that ticket file, and never start the next stage from this session.\n- `enter: <path>` (printed instead of `stop:` when this session can move into the worktree): this session\n moves into the worktree. First, when Pick up made the claim, push it with `git push -u origin <branch>`\n as above, and carry any people entry as below; then call EnterWorktree with `path` set to `<path>`, and\n go on at Continue step 2 (`accord anchor`) without asking. From then on every command, path and edit is\n in the worktree. When EnterWorktree fails, show `<path>`, say \"type `/accord continue <id>` to retry, or\n close this session and open one in that folder\", and stop, editing nothing.\n- `held: <id> by this session`: this session holds the ticket; go on with the next step.\n- `not held:`: this tool does not refuse a second session yet; say so in one line and go on with the\n next step.\n- Exit 2 naming the session that holds the ticket: show the message and stop, editing nothing.\n- Exit 2 naming a setup command: show the message and stop. The worktree is kept; once the owner fixes\n the command, they type `/accord continue <id>` again in this same session and follow the `enter:` or\n `stop:` line it prints. The run that prints `enter:` has already run every setup command again; after a\n `stop:` line, `/accord continue <id>` in a session opened there runs every setup command again.\n- Exit 2 starting `this session works`: this session works another ticket; show the message and stop,\n editing nothing.\n- Exit 2 starting `merge of`: Continue's merge stopped and was aborted; show the message and stop, editing\n nothing.\n- Any other exit 2: show the message and stop.\n\nSetup commands can take minutes: run these commands with the longest timeout your tool allows.\n\nWhen `./ids.md` had you add an entry under `people` before `accord new ticket --worktree`, carry it to the\nworktree before you stop or move into it: add the same entry to `<path>/accord/config.yml`, run\n`git -C \"<path>\" commit -m \"people: <email>\" -- accord/config.yml` and\n`git -C \"<path>\" push -u origin <branch>`, then remove that entry, and only that entry, from\n`accord/config.yml` here, leaving every other line of the file as it is.\n\nWhen `accord new ticket --worktree` says the push failed, it prints no `stop:` line: carry any people\nentry as above, run the push it names, and once it succeeds, run `accord worktree open <id> --continue`\nand follow the `stop:` or `enter:` line it prints. When that push fails again, show git's message and stop.\n\nThis skill runs `accord worktree clean` itself only from `/accord` with no argument and from `/accord upgrade`;\n`accord worktree open` and `accord new ticket --worktree` clean the same way on their own, so a ticket done on\nthe default branch loses its worktree and branches at any `/accord` command. In a tool that runs accord's session-start hook, every\nsession start, resume or /clear runs the same clean, so a ticket merged since the last session loses its worktree,\nits branches and any folder left behind with nobody typing a command; the hook ends its clean lines with\n`tell the owner the lines above`, so show them to the owner in your first reply. A New request the session check\nstops cleans nothing. At the dashboard its lines are shown verbatim with the dashboard's.\n\n## Session check\n\nRun it before the dashboard and before every New request, in every lane, also a New request picked from the\ndashboard; never before Pick up or Continue on a named ticket. Run `accord worktree check`.\n\n- Exit 0: go on.\n- Exit 2 with a message that starts `this session works`: this session works the ticket it names. Show the\n message. For the dashboard, go on with it, and offer only Continue on that ticket. For a New request, stop:\n write, create, claim and edit nothing, except a New request that reports a failure in a ticket that has\n reached verify: follow `./failure.md`.\n- Any other exit 2: show the message. For the dashboard, go on with it; for a New request, stop, editing\n nothing.\n",
24834
+ "approach/SKILL.md": "---\nname: accord-approach\ndescription: Use when a lane M ticket has its intent and acceptance criteria and needs an approach. Has the planner draft the lightest approach that works, has a critic argue against it in capped rounds, and takes the owner's explicit yes before accord approve.\nlicense: MIT\nargument-hint: \"[ticket id]\"\nkind: skill\nloads: [approach/approval.md, approach/critique.md, shared/ask.md, shared/scout.md]\n---\n\nThis stage chooses how the ticket will be built, lightest first, and takes\nthe owner's yes before anyone plans. You run it in the main session.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming approach, do not run this stage:\n tell the owner so in one line, skip steps 2 to 4, and run only the approval (step 5, `./approval.md`),\n because the owner's yes stays.\n\n2. **Options.** Dispatch `accord-planner` in its `direction` mode with the path of\n `accord/tickets/<id>.md`. It writes only `accord/tickets/<id>/direction.md`, which the critic never reads. Its report holds an impact\n list naming file and line, two or three options in ladder order with the\n lightest that works first, each added layer naming the criterion or\n constraint that requires it, and, when the ticket touches auth, money,\n migration, or data deletion, three failure scenarios in total with how\n each is undone. The chosen option is the one it marks `Recommended`,\n unless the owner has already picked another. Write into `## Approach`\n only the chosen option's name, what it does, and the impact list, never\n its reasons, its risk line, the other options or the `Recommended` line,\n so the critic's review stays independent. Write the ladder Ruling of\n `./critique.md` into `accord/tickets/<id>/ledger.md`. When a new session\n or a revision needs the planner again, dispatch it in `direction` mode\n with the name of the option `## Approach` names: it keeps that option,\n and nobody picks again. Commit `accord/tickets/<id>.md`, its `direction.md` and\n `accord/tickets/<id>/ledger.md`; keep the report for steps 3 and 4.\n\n3. **Critique.** Run the loop in `./critique.md`, running\n `accord round <id> --approach` before each round. One `accord-critic` in a\n fresh context, mode `approach`, argues the strongest case against the\n chosen option and checks it against Vetoes, Decisions, and Corrections,\n for every ticket in lane M and above. A Must that would break a Veto,\n Decision, or Correction rules the option out, and the first option of\n the ladder Ruling that is not yet ruled out takes its place, as\n `./critique.md` says; when none is left, ask the owner.\n\n4. **Write `## Approach`** in `accord/tickets/<id>.md`, in full, about fifteen lines:\n\n - a `- Chosen:` line, the option and why;\n - one `- Rejected: <option> — <why>` line per other option the ladder\n Ruling names, the why taken from its `## Closed` heading or the\n Ruling's `Recommended` line;\n - affected areas, from the impact list;\n - risks: every critic finding the chosen option keeps, Must findings\n first, so the owner approves with them in view; for a ticket that\n touches auth, money, migration, or data deletion, each of the three\n failure scenarios and how it is undone;\n - test strategy: which criterion is tested at which layer.\n\n Commit `accord/tickets/<id>.md` and `accord/tickets/<id>/approach-review.md`, with the ledger if it changed.\n\n5. **The owner's yes.** The owner approves once, from the short view of the ticket, and\n the yes covers the whole ticket as written. Follow `./approval.md`: it checks the scout file (`./scout.md`), shows\n `accord show <id> --approval --short`, asks for the yes, and on yes runs\n `accord approve <id>`, then `accord gate ready <id>`, and commits and pushes.\n Never run `accord approve` without the owner's yes in this conversation.\n\n6. Next: `accord-plan`, only once `accord gate ready <id>` passes. While it\n fails, the commit in step 5 carries `approved_hash:` alone; after its push,\n stop and tell the owner that `/accord continue <id>` plans the ticket once\n the gate passes.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- A later change to Intent, acceptance criteria, Vetoes, Decisions,\n Corrections, or Approach needs a new yes from the owner and a new\n `accord approve <id>`.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24835
+ "approach/approval.md": "---\nkind: reference\n---\n\n# The owner's yes\n\nThe owner approves once, here, from the short view of the ticket. The view\nshortens what the yes covers; it never narrows it.\n\n1. Run `accord scout check \"accord/tickets/<id>/scout.md\"`, and follow `./scout.md` when\n it does not exit 0 and when `accord approve` exits 1 below.\n\n2. Run `accord show <id> --approval --short`; if it fails, stop and tell the\n owner. Paste its output unchanged, as Markdown, not inside a code block.\n Below it put a horizontal rule, a heading \"In plain words\" written in the\n chat language, and one line per scenario that begins with its ac-n and says\n in plain words what it means, and ask for an explicit yes. The risks the\n view lists are the Must and Should approach findings still open, never a\n Nice, and the risk findings the owner dropped; the owner accepts them\n with the yes. When the view has a `## Blocking findings` part, an open\n `risk: data-loss` or `risk: security` finding, the owner cannot say yes:\n `accord approve` refuses while one is open. Show the part, say so, and ask\n for the no and its Correction (step 5) instead of the yes. A `record problem:`\n item in that part is a line of `approach-review.md` that accord cannot read,\n or a mark slot whose value does not parse: the owner cannot say yes until it\n is fixed (step 4). A risk named only in prose is not read and does not block;\n an open Must or Should that names one is listed under the risks, and an open\n Nice is not listed.\n\n3. The question names the text above it and `accord/tickets/<id>.md`, and\n says that the yes approves the ticket's Intent, acceptance criteria, Vetoes,\n Decisions, Corrections and Approach as written there, which the view\n shortens and the file holds in full.\n\n4. On yes, run `accord approve <id>`. When it exits 1 and prints `Blocking findings:`,\n the approval is refused: never edit the findings or the ticket to get past it;\n go to step 5 as for a no. When it prints `Record problems:`, correct only how a line is\n written, as `./critique.md` gives the form: rewrite a mark accord cannot read\n in the exact form it was meant to have, keeping the kind it names\n (`risks: security` becomes `risk: security`), and never change a finding's\n severity, state or the risk it names. When you cannot tell what the mark was meant to\n say, ask the owner, or have the critic restate that one mark; do not guess.\n Commit `approach-review.md`, and run `accord show <id> --approval --short` again.\n Otherwise run `accord gate ready <id>` and work\n from what it prints. When it says a `depends_on` ticket is not done on the\n default branch, never remove that entry from `depends_on`: tell the owner\n this ticket waits for that ticket's merge, then after the merge run\n `git fetch` and `accord gate ready <id>` again. Then commit the ticket, with\n `approved_hash:` and `ac_hash:` in it, and the ledger if it changed. Then run\n `accord worktree push <id>`; go on even if it fails.\n\n5. If the owner picks another option, append\n `## Closed <option>: the owner picked <other option>` to\n `accord/tickets/<id>/approach-review.md`, write that option into\n `## Approach` as step 2 of the skill says, go back to step 3 with that\n option, and ask again. On any other no, write the owner's words under\n `## Corrections` first, append `## Closed <option>: the owner's no` to\n `approach-review.md`, empty `## Approach` below its heading, go back to\n `accord-intent` step 8, and restart this stage at step 2. When `accord anchor` names approach off, there is no option\n and no `approach-review.md`: on a no, write the owner's words under `## Corrections`, go back to `accord-intent`\n step 8, and run only this approval again, not step 2.\n\n`accord approve` runs only on a yes to the sections as shown. Never run\n`accord approve` without the owner's yes in this conversation.\n",
24828
24836
  "approach/critique.md": "---\nkind: reference\n---\n\n# The approach critique loop\n\nThe main session keeps every critic finding in\n`accord/tickets/<id>/approach-review.md`, in the format of\n`plan-review.md`: the line `Round record: 1` above every heading, one\n`## Round <n> (whole)` or `## Round <n> (diff)` section per round, and\neach finding on one line as `<n>. <Must|Should|Nice> — <finding> — <state>`.\nThe state is `open`, `fixed`, `deferred` for a Nice, `unverified: <reason>`,\n`withdrawn`, `repeated as <round>.<n>`, and `owner: \"<the owner's words>\"`\nfor one the owner dropped. After the state the session copies the critic's\nmarks, each as ` — <mark>`: `rests on: <the ticket line>`, `risk: data-loss`\nor `risk: security`, `test: <id>`, `command: <command>`. The separator is\nalways ` — `, an em dash with a space on each side, never a hyphen: a hyphen\nin a state, a reason, a test or a command is part of its text. A state that\ncloses a finding (`fixed`, `withdrawn`, `repeated as <round>.<n>`,\n`owner: \"<words>\"`) is the whole segment: `fixed by a patch` leaves it open.\nA risk goes in the mark slot only: written exactly ` — risk: security` or\n` — risk: data-loss` after the finding's text, in any letter case.\nThe critic's `rests on: risk: security` is written that way, and the critic's\nown block, with `rests on: risk: security` on its own line under the finding,\nis read too. The critic's other `rests on:` lines (`ac-<n>`, `D-<nn>`, a quote,\n`test:`, `command:`) are read as grounds the same way. A risk named in the\nfinding's words, a note, a reason or the owner's words is prose: accord reads\nno risk there and it blocks nothing, so write it in the mark slot. A mark slot\nwhose value does not parse (`risks: security`, `risk: data_loss`,\n`risk: security` in backticks or quotes) is a record problem:\n`accord round <id> --approach` and `accord approve` refuse until it is\nrewritten in the exact form. A value that is no kind (`risk: none`, `risk: low`)\nis prose and refuses nothing; a `rests on: risk: security` line directly under\nthe finding, not indented, is refused: indent it as the critic prints it.\nA finding stays `open` or `unverified` until a\ncritic lists it after `fixed:` or `withdrawn:`, or the owner drops it; the\nplanner's word alone closes nothing. A round with no findings says\n`No findings`. Only the sections after the last `## Closed` line count.\nAt most one last line, `verdict: accepted-by-owner \"<the owner's sentence>\"`,\nends the file.\n\n## The ladder\n\nStep 2 of the skill writes the ladder Ruling from the planner's report, as one line:\n\n```text\nRuling: the approach ladder is 1. <option>: <what it does>; 2. <option>: <what it does>; 3. <option>: <what it does>; <option> is Recommended because <the planner's line> — kept so a resumed or revised round critiques the option ## Approach names and nobody picks again — a ruled-out option comes back\n```\n\nThe third entry is left out when the report has two options. The last\nladder Ruling of the ledger is the one that holds. No part of the ladder\nRuling names a file or a path: each option's description and the reason\nafter `Recommended because` are plain words, never a `path:line`, because a\nRuling that names a path stands as the reason for any fix commit to that\npath; the impact list stays in `## Approach`.\n\nEach cycle of the record ends with one of three headings, each carrying the\nname of the option `## Approach` names, spelt as the ladder Ruling spells it:\n\n- `## Closed <option>: ruled out by <round>.<n>`\n- `## Closed <option>: the owner picked <other option>`\n- `## Closed <option>: the owner's no`\n\nAn option is ruled out when a `## Closed <option>: ruled out by <round>.<n>`\nheading after the last `: the owner's no` heading names it. The option under\ncritique is always the one `## Approach` names: a resumed session or a\nrevision keeps it, and only step 3 below or the owner moves to another. When\nanother option of the ladder Ruling takes the place of the one `## Approach`\nnames and this session no longer holds the planner's report, dispatch\n`accord-planner` in its `direction` mode with the ticket path, that option's\nname and its entry of the ladder Ruling, and write the draft it returns into\n`## Approach` as step 2 of the skill says.\n\n## The count\n\nBefore each round and before appending `## Closed`, run\n`accord round <id> --approach`. Exit 0 gives the round's number and the cap\n(`Round: <n> of <cap>`). It counts only the rounds after the last `## Closed`\nline. Follow the cap it prints; never read the ticket's pin yourself.\n\nFrom accord 0.4.1 the cap is two rounds: round 1 reads the whole `## Approach`\nagainst the ticket, the Decisions discuss wrote included, and round 2 checks\nonly the fixes. When `accord round <id> --approach` answers `refused:` with\n`Findings still open:`, the loop is over: write those findings into\n`## Approach` as risks (step 4 of the skill) and go to the owner's yes. No\nRuling allows a third round. The owner's choices are the yes with the risks\nshown, or a no with a Correction. When the refusal also prints\n`Blocking findings:` (an open `risk: data-loss` or `risk: security` finding),\nthe owner cannot say yes to this approach: ask for the no and its Correction.\n\nA ticket claimed under an older accord keeps the cap of five: `accord round <id>\n--approach` prints `of 5` for it, and the claim commit's pin, which the command\nreads, decides that. For such a ticket it prints `stop: report to owner` from\nround 3 on a round that still reports a Should or a Must, and on a fifth round\nthat reports any finding. On a stop, report what it prints to the owner as\n`./ask.md` says, and ask whether to change course to another option, accept the\nopen findings, or allow more rounds. The answer is written as the last line\n`verdict: accepted-by-owner \"<the owner's sentence>\"` of\n`approach-review.md`, or as the owner allowance below, with r and k as the\nstop printed them:\n\n```text\nRuling: the owner allows <n> more approach critique rounds after round <r> of cycle <k> — \"<the owner's sentence>\" — <cost if wrong>\n```\n\nAnother option at a stop takes that same allowance, with n the rounds the\nowner gives it, and is then written into `## Approach` as step 2 of the\nskill says, because `## Closed` is refused while a stop holds. Never append\n`## Closed` while a stop holds. On a `refused:` that says the loop has ended,\ngo to step 4 of the skill; on any other `refused:`, fix what it names and\nrun it again.\n\n## The rounds\n\n1. **Read.** Round 1 is `whole`: one `accord-critic` in a fresh context, mode\n `approach`, with the path of the ticket file, whose `## Approach` holds\n only the draft of step 2. When the ticket touches auth, money, migration,\n or data deletion, ask it for three concrete failure scenarios as well.\n From round 2, even after a Must, the round is `diff`: write\n `git diff <the previous round's commit> -- accord/tickets/<id>.md`, which\n holds the amended `## Approach`, into a file outside the working tree, and\n dispatch one `accord-critic` in a fresh context, mode `approach`, with the\n paths of the ticket, that file, and `approach-review.md`, never the\n planner's report. The planner's `accord/tickets/<id>/direction.md` holds\n its reasons: it is committed with the ticket and never given to the\n critic.\n2. **Record.** Append the round's section and mark each new finding `open`.\n Mark `fixed` each finding the critic lists after `fixed:`, and\n `withdrawn` each one it lists after `withdrawn:`. A new finding that\n starts `repeats <round>.<n>:` marks that earlier finding\n `repeated as <this round>.<n>`. A Nice, a `defer to plan` one included, is\n marked `deferred`, goes to the ledger under `## Deferred`, and never to\n the planner. From round 2 (accord 0.4.1 and later) a new Must or Should\n with none of the marks above is marked `deferred` too and goes to the\n ledger under `## Deferred` as\n `- approach <r>.<n>[ cycle <k>]: <finding> — failing case: <case>`\n (` cycle <k>` from cycle 2 on), never to the planner. A finding with a\n `risk:` mark is never deferred: it blocks in every round.\n3. **Ruled out.** When a Must would break a Veto, Decision, or Correction,\n the option is out: append `## Closed <option>: ruled out by <round>.<n>`,\n naming that Must, to `approach-review.md`, take the first option of the\n ladder Ruling that is not yet ruled out, write it into `## Approach` as\n step 2 of the skill says (when this session no longer holds the planner's\n report, as the ladder section above says), commit both files, with the ledger if it changed, and start\n again at round 1. When no option is left, ask the owner.\n4. **Converged.** The loop ends only on a round that reports no Must and no\n Should and leaves no Must or Should open or unverified, or on the owner's\n acceptance after a stop: go to step 4 of the skill.\n5. **Fix.** Otherwise commit `accord/tickets/<id>.md` and\n `approach-review.md`, with the ledger if it changed, with the subject\n that `accord subject approach_round <id> round <n>, <m> Must, <s> Should` prints, `<m>` and `<s>` counting\n the Musts and the Shoulds after the last `## Closed` line that are `open`\n or `unverified`; the next `diff` round reads from that commit. Dispatch\n `accord-planner` in its `direction` mode with the ticket path, the name of\n the option `## Approach` names, the path of `approach-review.md`, and every\n Must and Should that is `open` or `unverified`, never a Nice, each\n labelled `<round>.<n>`. Write the revised option, which keeps its name,\n and the impact list it returns into `## Approach`, still without its\n reasons, and each `unverified: <reason>` it replies into the state of the\n finding with that label. Then go back to step 1.\n",
24829
- "build/SKILL.md": "---\nname: accord-build\ndescription: Use when a lane M ticket has a plan that passed accord gate plan and needs building. Dispatches one fresh executor per task from accord brief, runs the affected tests itself, and records each task with accord task-done.\nlicense: MIT\nkind: skill\nloads: [build/no-plan.md, shared/ask.md, shared/scout.md]\n---\n\nThis stage builds the plan one task at a time. You run it in the main\nsession and orchestrate: executors write the code.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming plan, the ticket has no `plan.md` and builds as one task: follow `./no-plan.md` instead of steps 2 and 3. Otherwise it names the next task. If it prints `Stage: plan` (the plan is not committed as ready), or `git status --porcelain` on `plan.md` prints anything, the plan stage has not finished: load `accord-plan` and resume there instead of building.\n\n2. **Dispatch.** For each task in `plan.md` without a line in `accord/tickets/<id>/ledger.md`, in order, one at a time: run `accord brief <id> <n>` into a file outside the working tree (for example the system temp directory), so it is never committed, and dispatch a fresh `accord-executor` with the path of that file only. Never pass chat history.\n\n3. **Record.** When it reports, run the test command its brief printed yourself; when the brief printed none, run the test files the executor reports it wrote or changed. Then run `accord task-done <id> <n>`. The executor's claim alone records nothing.\n - It refuses because a `verify:` case failed or is missing: dispatch a fresh executor with the same brief plus the reasons it printed. If it refuses that way again after that dispatch, load `accord-debug` instead of dispatching again.\n - It refuses because the report is missing or older than the commit: the `tests.affected` command does not write the report `tests.report` names. Tell the owner; do not loop.\n - It refuses because a commit carries a forbidden line: reword that commit yourself if you made it; if an executor made it, dispatch a fresh executor with the same brief plus the reasons it printed. It exits 2 and says to run `git fetch origin`: run that. Either way, run `accord task-done <id> <n>` again.\n - It writes the `@test:` tag of each scenario a `verify:` id marks with `(@ac-n)`. It refuses because a scenario already carries a different `@test:` tag: ask the owner; never an executor or `accord-debug`.\n - It writes the ledger line: copy every Ruling in the executor's report into `accord/tickets/<id>/ledger.md` under `## Rulings`, then commit the ticket together with `accord/tickets/<id>/ledger.md`, then run `accord worktree push <id>`; go on even if it fails.\n - A ticket whose recorded tasks predate the tag writer: run `accord task-done <id> <n>` again for each recorded task.\n\n4. **Blocked.**\n - `BLOCKED` with a question that touches intent, a veto, a criterion,\n or a public interface: ask the owner.\n - `BLOCKED` on a test that seems wrong: a criterion test is the\n owner's, so ask the owner; any other test is a plan gap and goes back\n to `accord-plan`. Never edit the test yourself.\n - `BLOCKED` on an architecture change: go to step 6. `BLOCKED` after\n three failed attempts: ask the owner, with what was tried; never\n dispatch a fresh executor for more tries. A new package: ask the\n owner.\n - `BLOCKED: context`: dispatch a fresh executor with the same brief\n plus the diff and the ledger so far.\n - `NEEDS_CONTEXT`: answer, and dispatch again.\n\n5. **Files.** A file outside the task's `files:` line must be declared\n in the report with a reason. When you accept it, record a Ruling.\n\n6. **Change of course.** When the approved approach cannot work, stop. Write a change note under the ticket's `## Approach`: what failed, which finished tasks still hold, and the proposed new approach. Ask the owner for a new yes; on yes run `accord approve <id>`, commit the ticket and run `accord worktree push <id>`; go on even if it fails. When `accord approve` exits 1, follow `./scout.md`. Then `accord-plan`'s re-plan covers only the tasks the change touches. Never re-plan quietly.\n\n7. **Plan changed.** When `accord task-done` says `plan.md` changed,\n never run `accord gate plan` to clear it. Show the owner the diff of\n `plan.md`. If the owner made the change, `accord-plan` reviews it\n (critic, then `accord gate plan`); otherwise restore `plan.md` with the\n owner's yes and dispatch again. Only `accord-plan` changes the plan. Never run\n `accord tests baseline` here; only the plan stage asks the owner about it.\n\n8. When every task has a ledger line, next: `accord-review`, or `accord-verify` when `accord anchor` names review off.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary:\n the executor gets it inside its brief.\n- The main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24830
- "build/no-plan.md": "---\nkind: reference\n---\n\n# Building with the plan stage off\n\n`accord anchor` printed `stages off for lane <L>:` naming plan. There is no `plan.md`: the whole ticket is one task,\ntask 1.\n\n1. Run `accord brief <id> 1` into a file outside the working tree (for example the system temp directory), so it is\n never committed, and dispatch one fresh `accord-executor` with the path of that file only. Never pass chat history.\n The brief holds the whole ticket.\n\n2. When it reports, run the test command the brief printed yourself: `tests.affected`, or `tests.full` when the brief\n says no `tests.affected` is set. When it printed neither, run the test files the executor reports it wrote or changed.\n\n3. Read from the executor's report which test proves each scenario that is not `@ui`. Run `accord task-done <id> 1\n --test ac-<n>=<test id>` once, with one `--test` pair for every such scenario; a `@ui` scenario takes no pair.\n The executor's claim alone records nothing.\n\n4. When it refuses, handle it as step 3 of `./SKILL.md` handles a refusal of `accord task-done <id> <n>`: a failed or\n absent test, or a scenario with no pair, gets a fresh executor with the same brief plus the reasons it printed, and\n a second refusal of that kind loads `accord-debug`; a missing or old report, a forbidden commit line, or a\n scenario that already carries a different `@test:` tag are handled as it says. On success it writes the ledger\n line and the `@test:` tags: copy every Ruling in the executor's report into `accord/tickets/<id>/ledger.md` under\n `## Rulings`, commit the ticket with the ledger, then run `accord worktree push <id>`; go on even if it fails.\n\n5. With the plan stage off there is no `accord-plan` to go back to: a block that steps 4 and 7 of `./SKILL.md` send\n there goes to the owner, and after a change of course (step 6) the new yes is followed by `accord brief <id> 1`\n again.\n\n6. Next: `accord-review`, or `accord-verify` when `accord anchor` names review off.\n",
24831
- "debug/SKILL.md": "---\nname: accord-debug\ndescription: Use when a lane M ticket's work behaves unexpectedly, a test fails for a reason nobody has shown, or a fix did not work. Finds the root cause with a debugger before any fix, fixes it once through a fresh executor test first, and keeps its state in debug.md.\nlicense: MIT\nkind: skill\nloads: [accord/ids.md, accord/worktree.md, shared/ask.md, shared/failure.md]\n---\n\nThis stage finds a root cause before anything is fixed. You run it in the\nmain session and orchestrate: debuggers investigate, executors fix.\n\n## Steps\n\n1. Run `accord anchor`. For a failure found after verify, read `./failure.md`.\n When `./failure.md` runs `accord worktree open`, follow `./worktree.md`.\n\n2. **State.** Everything this stage learns lives in\n `accord/tickets/<id>/debug.md`: the symptom, the hypotheses, the\n probes and what they showed, and each fix tried with its count. It\n survives compaction; after one, read it before anything else. Start\n each episode by appending `## Episode <n>` to it; the episode is open\n while the last `## ` heading in the file is not `## Resolved`.\n\n3. **Root cause.** No fix before a root cause. Dispatch a fresh\n `accord-debugger` with the path of the ticket file and the failing\n command and its output, or the report alone when it gives neither. It writes `debug.md`:\n - competing hypotheses, each with evidence for and against, ranked\n before any is tested;\n - one hypothesis is always that the test or measurement itself is\n wrong;\n - the first test is the cheapest probe that separates the top two.\n\n It returns the root cause with evidence, the failing reproduction\n test it proposes, and the hypotheses ruled out. Commit `debug.md`.\n A root cause without evidence is a hypothesis: dispatch once more with\n the path of `debug.md`. A second return without evidence (flaky,\n timing, cannot reproduce): stop and ask the owner with the ranked\n hypotheses and what was ruled out.\n\n4. **Fix.** The main session never edits product code: the fix goes\n through `accord-build`'s executor path. Note the HEAD sha. Write a\n brief file outside the working tree: copy the ticket file byte for\n byte (never retype it), then append the root cause, its evidence, and\n the reproduction test. The executor starts with that failing\n reproduction test, greps every caller of what it changes, and fixes\n the root cause once in shared code, never at each caller. Dispatch a\n fresh `accord-executor` with its path. `BLOCKED` on a test that is\n not a criterion test: ask the owner, as there is no plan task to\n re-plan. Route every other stop as `accord-build` does.\n\n5. **Check.** Run the `tests.affected` command over the files changed\n since the noted sha. Copy every Ruling in the executor's report into\n `accord/tickets/<id>/ledger.md` under `## Rulings`. Record the fix and\n its result in `debug.md`, then commit `debug.md` with the ledger. The episode's\n commits before the first review round recorded after it opened are reviewed in a\n round headed `(added code round 1)`. A commit made after that round while the\n episode stays open is that round's fix: its files need a finding of that round or\n a Ruling.\n\n6. **Failed fix.** A fix that leaves the symptom, or the reproduction\n test failing, counts one in `debug.md`. After one failed fix, dispatch\n one `accord-debugger` per remaining hypothesis, in parallel, each\n with the paths of the ticket file and `debug.md` and its one\n hypothesis. In a parallel round they write nothing and return\n evidence; you merge every result into `debug.md` and commit it. Then\n back to step 4 with the root cause the evidence supports. No\n hypothesis left: back to step 3.\n\n7. **Three.** After three failed fixes, stop: never a fourth. Each fix\n uncovering a new problem elsewhere means the architecture is wrong,\n not the hypothesis. Write the architectural question in `debug.md`\n and ask the owner, with what was tried. An answer at step 7 that changes\n the ticket's type follows `./ids.md`. This count is this stage's\n own; an executor's three attempts at one problem inside a task also\n end at the owner.\n\n8. **Resolved.** Append `## Resolved` to `debug.md`, one line: the root\n cause and the fix commit, or the owner's decision. Commit it.\n\n9. Next: run `accord anchor` again and go to the stage it prints now. When that is\n `accord-build`, start at its step 3 for the task that entered debug:\n run the affected tests and `accord task-done` before dispatching\n anything.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary:\n an executor gets it inside its brief.\n- The main session orchestrates and never edits product code.\n- A winning hypothesis that a criterion test is wrong is the owner's\n call: ask. Never edit the test yourself.\n- \"It's probably X\", \"just try X\", and \"one more attempt\" mean back to\n step 3, except after three failed fixes: step 7.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24832
- "designer/SKILL.md": "---\nname: accord-designer\ndescription: Use when a ticket is marked ui and the Ready gate is asking for a design reference. Establishes whether the ticket has an interface, picks a design link or a prototype from the profile, produces the missing one, and re-runs the gate.\nlicense: MIT\nkind: role\nloads: [shared/prototype.md]\n---\n\nDesigner is a stage a ticket passes through, not a job title. The same person\nand agent move through intent, design, and implementation in turn. This stage\nends when the ticket carries the design reference the gate was asking for.\n\n## Steps\n\n1. Run `accord gate ready <id>` and read the reasons it prints. Those reasons\n are the whole brief for this stage. If none of them is about design, there\n is nothing to do here — hand the ticket back to the stage that owns the\n reason rather than inventing work.\n\n2. Read `ui:` in the frontmatter of `accord/tickets/<id>.md`.\n\n - `ui: false` — stop. A ticket with no interface has no design reference to\n produce.\n - `ui: true` — continue.\n\n3. Read `profile:` in `accord/config.yml` and take the matching branch.\n\n - `profile: build` — the ticket needs a design link or a prototype. When\n the design already exists, put its link in `design:` in the ticket\n frontmatter. When it does not, read `./prototype.md` and build one.\n - `profile: maintain` — the ticket needs\n `accord/assets/<id>/prototype.html`. Read `./prototype.md` and build it\n from the styles the project already has. A prototype invented from new\n styles is a redesign nobody asked for.\n\n4. Run `accord gate ready <id>` again. The reason you came here for is gone,\n or the work is not finished.\n\n## Boundaries\n\nYou own the design reference and nothing else. Acceptance criteria belong to\nthe stage that wrote them: a scenario you disagree with goes to\n`## Open questions` in the ticket, never into an edit of\n`## Acceptance criteria`.\n",
24833
- "intent/SKILL.md": "---\nname: accord-intent\ndescription: Use when a lane M ticket needs its intent captured, or when /accord routes a new request here. Runs the intent interview that writes the ticket's Intent, acceptance criteria, Vetoes, Decisions, and Corrections, so later stages cannot drift from what the owner meant.\nlicense: MIT\nkind: skill\nloads: [shared/ask.md, shared/scout.md, accord/ids.md, accord/lane.md, intent/research.md, intent/discuss.md]\n---\n\nThis stage writes down what the owner means, in the ticket, before anyone\nplans or builds. You run it in the main session.\n\n## Steps\n\n1. Run `accord anchor`. If the ticket file does not exist yet, `/accord`\n creates it first: start there.\n\n2. **Look before asking.** Dispatch `accord-scout` with the path of\n `accord/tickets/<id>.md` and the questions the code can answer. Check its\n reply as `./scout.md` says, and save it as `accord/tickets/<id>/scout.md`\n only when that file does not exist. Never ask the owner what the code answers. A question about an existing project\n cites the file that prompted it. Before any question, read `./research.md`.\n\n3. **Confirm the parts.** Before the first score, list the request's\n top-level parts and ask the owner to confirm them.\n\n4. **Score ambiguity** from 0 to 1 on four dimensions: goal, scope boundary,\n constraints, acceptance; 0 is unambiguous, 1 is unknown. Show the owner\n the four scores after each round. No dimension may stay above 0.4. Stop\n when the total (the mean) is 0.2 or less with no dimension above 0.4, or\n when the owner says \"enough\".\n Before you stop, ask once for the smallest version that still counts as\n done, and once how many plan tasks the work should take: the answer is N\n in the Intent line `Expected size: <N> tasks`, and `accord gate plan`\n refuses a plan of more than 2 × N tasks unless the owner allows it.\n On \"enough\", write `Ruling: interview stopped by the owner at <score>`\n into `accord/tickets/<id>/ledger.md` under `## Rulings`.\n\n5. **One question per message**, aimed at the dimension with the highest\n score; which kind of question to ask, and how, follows `./ask.md`.\n\n6. **Write the ticket** `accord/tickets/<id>.md`, each section as follows:\n\n | Section | Content |\n |---|---|\n | `## Intent` | at most five lines: why, for whom, success measure, non-goals; then one line `Expected size: <N> tasks`; you draft, the owner approves |\n | `## Acceptance criteria` | two to five Gherkin scenarios, `@ac-1` … `@ac-n`; you draft, the owner approves |\n | `## Vetoes` | what the owner forbids, in the owner's words |\n | `## Decisions` | settled answers in the owner's words: `- D-01 <decision> — \"<the owner's sentence>\"` |\n | `## Corrections` | every \"no, I meant…\", verbatim, append-only, written before any other action |\n | `## Open questions` | each unanswered question as an unchecked `- [ ]` item |\n\n Before you rewrite a queued Intent, follow `./research.md`.\n\n7. **Write back** your understanding. Separate what the owner said from what\n you assumed, and invite correction.\n\n8. **Audit once.** Dispatch `accord-auditor` with only the path of the\n ticket file. A criterion it reads two ways goes back to the owner as a\n question. Then commit `accord/tickets/<id>.md`, with the ledger if it\n changed.\n\n9. **Discuss.** Run `accord gate ready <id>` and read its exit code. On exit 2 (a pin mismatch or a usage\n error) stop and report what it printed to the owner: it says nothing about discuss. When it names\n `gate.discuss-missing` or `gate.discuss-unmapped`, follow `./discuss.md`; when it names neither, the ticket\n was claimed before the discuss stage or its discuss.md is mapped, and goes on. Ask no yes here: the owner\n approves once, at accord-approach step 5.\n\n10. Next: `accord-approach`.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- A correction goes into `## Corrections` verbatim before any other action.\n A correction that exists only in the conversation is lost at the next\n compaction.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n- **Lane S.** Before step 9, when the interview shows the request fits lane S (none of the four lift conditions in `./lane.md` holds, judged on what `accord-scout` reports), no ticket that `accord status --json` lists names this one in `depends_on`, and both\n `git diff --name-only <origin's default branch>...HEAD` and `git status --porcelain --untracked-files=all` list\n only `accord/tickets/<id>.md`, paths under `accord/tickets/<id>/` and the records `./research.md` counts as its own,\n propose moving it to lane S, with the\n reason. Move it only on the owner's yes, as `## Moving to lane S` in `./ids.md` says; otherwise say why it stays\n lane M. From step 9 on, a lane never drops.\n",
24837
+ "build/SKILL.md": "---\nname: accord-build\ndescription: Use when a lane M ticket has a plan that passed accord gate plan and needs building. Dispatches one fresh executor per task from accord brief, runs the affected tests itself, and records each task with accord task-done.\nlicense: MIT\nargument-hint: \"[ticket id]\"\nkind: skill\nloads: [build/no-plan.md, plan/baseline.md, shared/ask.md, shared/scout.md]\n---\n\nThis stage builds the plan one task at a time. You run it in the main\nsession and orchestrate: executors write the code.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming plan, the ticket has no `plan.md` and builds as one task: follow `./no-plan.md` instead of steps 2 and 3. Otherwise it names the next task. If it prints `Stage: plan` (the plan is not committed as ready), or `git status --porcelain` on `plan.md` prints anything, the plan stage has not finished: load `accord-plan` and resume there instead of building.\n\n2. **Dispatch.** For each task in `plan.md` without a line in `accord/tickets/<id>/ledger.md`, in order, one at a time: run `accord brief <id> <n>` into a file outside the working tree (for example the system temp directory), so it is never committed, and dispatch a fresh `accord-executor` with the path of that file only. Never pass chat history.\n\n3. **Record.** When it reports, run the test command its brief printed yourself; when the brief printed none, run the test files the executor reports it wrote or changed. Then run `accord task-done <id> <n>`. The executor's claim alone records nothing.\n - It refuses because a `verify:` case failed or is missing: dispatch a fresh executor with the same brief plus the reasons it printed. If it refuses that way again after that dispatch, load `accord-debug` instead of dispatching again.\n - It refuses because the report is missing or older than the commit: the `tests.affected` command does not write the report `tests.report` names. Tell the owner; do not loop.\n - It refuses because a commit carries a forbidden line: reword that commit yourself if you made it; if an executor made it, dispatch a fresh executor with the same brief plus the reasons it printed. It exits 2 and says to run `git fetch origin`: run that. Either way, run `accord task-done <id> <n>` again.\n - It writes the `@test:` tag of each scenario a `verify:` id marks with `(@ac-n)`. It refuses because a scenario already carries a different `@test:` tag: ask the owner; never an executor or `accord-debug`.\n - It writes the ledger line: copy every Ruling in the executor's report into `accord/tickets/<id>/ledger.md` under `## Rulings`, then commit the ticket together with `accord/tickets/<id>/ledger.md`, then run `accord worktree push <id>`; go on even if it fails.\n - A ticket whose recorded tasks predate the tag writer: run `accord task-done <id> <n>` again for each recorded task.\n\n4. **Blocked.**\n - `BLOCKED` with a question that touches intent, a veto, a criterion,\n or a public interface: ask the owner.\n - `BLOCKED` on a test that seems wrong: a criterion test is the\n owner's, so ask the owner; any other test is a plan gap and goes back\n to `accord-plan`. Never edit the test yourself.\n - `BLOCKED` on an architecture change: go to step 6. `BLOCKED` after\n three failed attempts: ask the owner, with what was tried; never\n dispatch a fresh executor for more tries. A new package: ask the\n owner.\n - `BLOCKED: context`: dispatch a fresh executor with the same brief\n plus the diff and the ledger so far.\n - `NEEDS_CONTEXT`: answer, and dispatch again.\n\n5. **Files.** A file outside the task's `files:` line must be declared\n in the report with a reason. When you accept it, record a Ruling.\n\n6. **Change of course.** When the approved approach cannot work, stop. Write a change note under the ticket's `## Approach`: what failed, which finished tasks still hold, and the proposed new approach. Ask the owner for a new yes; on yes run `accord approve <id>`, commit the ticket and run `accord worktree push <id>`; go on even if it fails. When `accord approve` exits 1, follow `./scout.md`. Then `accord-plan`'s re-plan covers only the tasks the change touches. Never re-plan quietly.\n\n7. **Plan changed.** When `accord task-done` says `plan.md` changed,\n never run `accord gate plan` to clear it. Show the owner the diff of\n `plan.md`. If the owner made the change, `accord-plan` reviews it\n (critic, then `accord gate plan`); otherwise restore `plan.md` with the\n owner's yes and dispatch again. Only `accord-plan` changes the plan. Never run\n `accord tests baseline` here except as `./no-plan.md` says, which follows `./baseline.md`; otherwise only the plan stage asks the owner about it.\n\n8. When every task has a ledger line, next: `accord-review`, or `accord-verify` when `accord anchor` names review off.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary:\n the executor gets it inside its brief.\n- The main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24838
+ "build/no-plan.md": "---\nkind: reference\n---\n\n# Building with the plan stage off\n\n`accord anchor` printed `stages off for lane <L>:` naming plan. There is no `plan.md`: the whole ticket is one task,\ntask 1.\n\nBefore step 1, when `tests.report` is set and `accord/tests-baseline.txt` is absent, take the tests baseline, before any\nexecutor is dispatched, as `./baseline.md` says: nothing else asks for it with the plan stage off, and\nwithout it every test case already in the suite counts as untraced. Run `tests.full` only while `git status --porcelain`\n(staged, unstaged and untracked paths) lists no path outside `accord/` and `git diff --stat <fork point>` (the fork\npoint is `git merge-base HEAD <default branch>`; it covers commits and the working tree) shows none either; otherwise ask\nthe owner. An\nexecutor leaves its work uncommitted until step 4, so a resumed run on a dirty tree has an executor's code in it. Never\ntake the baseline after an executor has written code. There is no plan-ready commit: the baseline commit stays alone, and\nits Ruling goes into the ledger commit of step 4.\n\n1. Run `accord brief <id> 1` into a file outside the working tree (for example the system temp directory), so it is\n never committed, and dispatch one fresh `accord-executor` with the path of that file only. Never pass chat history.\n The brief holds the whole ticket.\n\n2. When it reports, run the test command the brief printed yourself: `tests.affected`, or `tests.full` when the brief\n says no `tests.affected` is set. When it printed neither, run the test files the executor reports it wrote or changed.\n\n3. Read from the executor's report which test proves each scenario that is not `@ui`. Run `accord task-done <id> 1\n --test ac-<n>=<test id>` once, with one `--test` pair for every such scenario; a `@ui` scenario takes no pair.\n The executor's claim alone records nothing.\n\n4. When it refuses, handle it as step 3 of `./SKILL.md` handles a refusal of `accord task-done <id> <n>`: a failed or\n absent test, or a scenario with no pair, gets a fresh executor with the same brief plus the reasons it printed, and\n a second refusal of that kind loads `accord-debug`; a missing or old report, a forbidden commit line, or a\n scenario that already carries a different `@test:` tag are handled as it says. On success it writes the ledger\n line and the `@test:` tags: copy every Ruling in the executor's report into `accord/tickets/<id>/ledger.md` under\n `## Rulings`, commit the ticket with the ledger, then run `accord worktree push <id>`; go on even if it fails.\n\n5. With the plan stage off there is no `accord-plan` to go back to: a block that steps 4 and 7 of `./SKILL.md` send\n there goes to the owner, and after a change of course (step 6) the new yes is followed by `accord brief <id> 1`\n again.\n\n6. Next: `accord-review`, or `accord-verify` when `accord anchor` names review off.\n",
24839
+ "debug/SKILL.md": "---\nname: accord-debug\ndescription: Use when a lane M ticket's work behaves unexpectedly, a test fails for a reason nobody has shown, or a fix did not work. Finds the root cause with a debugger before any fix, fixes it once through a fresh executor test first, and keeps its state in debug.md.\nlicense: MIT\nargument-hint: \"[ticket id] [failure]\"\nkind: skill\nloads: [accord/ids.md, accord/worktree.md, shared/ask.md, shared/failure.md]\n---\n\nThis stage finds a root cause before anything is fixed. You run it in the\nmain session and orchestrate: debuggers investigate, executors fix.\n\n## Steps\n\n1. Run `accord anchor`. For a failure found after verify, read `./failure.md`.\n When `./failure.md` runs `accord worktree open`, follow `./worktree.md`.\n\n2. **State.** Everything this stage learns lives in\n `accord/tickets/<id>/debug.md`: the symptom, the hypotheses, the\n probes and what they showed, and each fix tried with its count. It\n survives compaction; after one, read it before anything else. Start\n each episode by appending `## Episode <n>` to it; the episode is open\n while the last `## ` heading in the file is not `## Resolved`.\n\n3. **Root cause.** No fix before a root cause. Dispatch a fresh\n `accord-debugger` with the path of the ticket file and the failing\n command and its output, or the report alone when it gives neither. It writes `debug.md`:\n - competing hypotheses, each with evidence for and against, ranked\n before any is tested;\n - one hypothesis is always that the test or measurement itself is\n wrong;\n - the first test is the cheapest probe that separates the top two.\n\n It returns the root cause with evidence, the failing reproduction\n test it proposes, and the hypotheses ruled out. Commit `debug.md`.\n A root cause without evidence is a hypothesis: dispatch once more with\n the path of `debug.md`. A second return without evidence (flaky,\n timing, cannot reproduce): stop and ask the owner with the ranked\n hypotheses and what was ruled out.\n\n4. **Fix.** The main session never edits product code: the fix goes\n through `accord-build`'s executor path. Note the HEAD sha. Write a\n brief file outside the working tree: copy the ticket file byte for\n byte (never retype it), then append the root cause, its evidence, and\n the reproduction test. The executor starts with that failing\n reproduction test, greps every caller of what it changes, and fixes\n the root cause once in shared code, never at each caller. Dispatch a\n fresh `accord-executor` with its path. `BLOCKED` on a test that is\n not a criterion test: ask the owner, as there is no plan task to\n re-plan. Route every other stop as `accord-build` does.\n\n5. **Check.** Run the `tests.affected` command over the files changed\n since the noted sha. Copy every Ruling in the executor's report into\n `accord/tickets/<id>/ledger.md` under `## Rulings`. Record the fix and\n its result in `debug.md`, then commit `debug.md` with the ledger. The episode's\n commits before the first review round recorded after it opened are reviewed in a\n round headed `(added code round 1)`. A commit made after that round while the\n episode stays open is that round's fix: its files need a finding of that round or\n a Ruling.\n\n6. **Failed fix.** A fix that leaves the symptom, or the reproduction\n test failing, counts one in `debug.md`. After one failed fix, dispatch\n one `accord-debugger` per remaining hypothesis, in parallel, each\n with the paths of the ticket file and `debug.md` and its one\n hypothesis. In a parallel round they write nothing and return\n evidence; you merge every result into `debug.md` and commit it. Then\n back to step 4 with the root cause the evidence supports. No\n hypothesis left: back to step 3.\n\n7. **Three.** After three failed fixes, stop: never a fourth. Each fix\n uncovering a new problem elsewhere means the architecture is wrong,\n not the hypothesis. Write the architectural question in `debug.md`\n and ask the owner, with what was tried. An answer at step 7 that changes\n the ticket's type follows `./ids.md`. This count is this stage's\n own; an executor's three attempts at one problem inside a task also\n end at the owner.\n\n8. **Resolved.** Append `## Resolved` to `debug.md`, one line: the root\n cause and the fix commit, or the owner's decision. Commit it.\n\n9. Next: run `accord anchor` again and go to the stage it prints now. When that is\n `accord-build`, start at its step 3 for the task that entered debug:\n run the affected tests and `accord task-done` before dispatching\n anything.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary:\n an executor gets it inside its brief.\n- The main session orchestrates and never edits product code.\n- A winning hypothesis that a criterion test is wrong is the owner's\n call: ask. Never edit the test yourself.\n- \"It's probably X\", \"just try X\", and \"one more attempt\" mean back to\n step 3, except after three failed fixes: step 7.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24840
+ "designer/SKILL.md": "---\nname: accord-designer\ndescription: Use when a ticket is marked ui and the Ready gate is asking for a design reference. Establishes whether the ticket has an interface, picks a design link or a prototype from the profile, produces the missing one, and re-runs the gate.\nlicense: MIT\nargument-hint: \"<ticket id>\"\nkind: role\nloads: [shared/prototype.md]\n---\n\nDesigner is a stage a ticket passes through, not a job title. The same person\nand agent move through intent, design, and implementation in turn. This stage\nends when the ticket carries the design reference the gate was asking for.\n\n## Steps\n\n1. Run `accord gate ready <id>` and read the reasons it prints. Those reasons\n are the whole brief for this stage. If none of them is about design, there\n is nothing to do here — hand the ticket back to the stage that owns the\n reason rather than inventing work.\n\n2. Read `ui:` in the frontmatter of `accord/tickets/<id>.md`.\n\n - `ui: false` — stop. A ticket with no interface has no design reference to\n produce.\n - `ui: true` — continue.\n\n3. Read `profile:` in `accord/config.yml` and take the matching branch.\n\n - `profile: build` — the ticket needs a design link or a prototype. When\n the design already exists, put its link in `design:` in the ticket\n frontmatter. When it does not, read `./prototype.md` and build one.\n - `profile: maintain` — the ticket needs\n `accord/assets/<id>/prototype.html`. Read `./prototype.md` and build it\n from the styles the project already has. A prototype invented from new\n styles is a redesign nobody asked for.\n\n4. Run `accord gate ready <id>` again. The reason you came here for is gone,\n or the work is not finished.\n\n## Boundaries\n\nYou own the design reference and nothing else. Acceptance criteria belong to\nthe stage that wrote them: a scenario you disagree with goes to\n`## Open questions` in the ticket, never into an edit of\n`## Acceptance criteria`.\n",
24841
+ "intent/SKILL.md": "---\nname: accord-intent\ndescription: Use when a lane M ticket needs its intent captured, or when /accord routes a new request here. Runs the intent interview that writes the ticket's Intent, acceptance criteria, Vetoes, Decisions, and Corrections, so later stages cannot drift from what the owner meant.\nlicense: MIT\nargument-hint: \"[ticket id]\"\nkind: skill\nloads: [shared/ask.md, shared/scout.md, accord/ids.md, accord/lane.md, intent/research.md, intent/discuss.md]\n---\n\nThis stage writes down what the owner means, in the ticket, before anyone\nplans or builds. You run it in the main session.\n\n## Steps\n\n1. Run `accord anchor`. If the ticket file does not exist yet, `/accord`\n creates it first: start there.\n\n2. **Look before asking.** Dispatch `accord-scout` with the path of\n `accord/tickets/<id>.md` and the questions the code can answer. Check its\n reply as `./scout.md` says, and save it as `accord/tickets/<id>/scout.md`\n only when that file does not exist. Never ask the owner what the code answers. A question about an existing project\n cites the file that prompted it. Before any question, read `./research.md`.\n\n3. **Confirm the parts.** Before the first score, list the request's\n top-level parts and ask the owner to confirm them.\n\n4. **Score ambiguity** from 0 to 1 on four dimensions: goal, scope boundary,\n constraints, acceptance; 0 is unambiguous, 1 is unknown. Show the owner\n the four scores after each round. No dimension may stay above 0.4. Stop\n when the total (the mean) is 0.2 or less with no dimension above 0.4, or\n when the owner says \"enough\".\n Before you stop, ask once for the smallest version that still counts as\n done, and once how many plan tasks the work should take: the answer is N\n in the Intent line `Expected size: <N> tasks`, and `accord gate plan`\n refuses a plan of more than 2 × N tasks unless the owner allows it.\n On \"enough\", write `Ruling: interview stopped by the owner at <score>`\n into `accord/tickets/<id>/ledger.md` under `## Rulings`.\n\n5. **One question per message**, aimed at the dimension with the highest\n score; which kind of question to ask, and how, follows `./ask.md`.\n\n6. **Write the ticket** `accord/tickets/<id>.md`, each section as follows:\n\n | Section | Content |\n |---|---|\n | `## Intent` | at most five lines: why, for whom, success measure, non-goals; then one line `Expected size: <N> tasks`; you draft, the owner approves |\n | `## Acceptance criteria` | two to five Gherkin scenarios, `@ac-1` … `@ac-n`; you draft, the owner approves |\n | `## Vetoes` | what the owner forbids, in the owner's words |\n | `## Decisions` | settled answers in the owner's words: `- D-01 <decision> — \"<the owner's sentence>\"` |\n | `## Corrections` | every \"no, I meant…\", verbatim, append-only, written before any other action |\n | `## Open questions` | each unanswered question as an unchecked `- [ ]` item |\n\n Before you rewrite a queued Intent, follow `./research.md`.\n\n7. **Write back** your understanding. Separate what the owner said from what\n you assumed, and invite correction.\n\n8. **Audit once.** Dispatch `accord-auditor` with only the path of the\n ticket file. A criterion it reads two ways goes back to the owner as a\n question. Then commit `accord/tickets/<id>.md`, with the ledger if it\n changed.\n\n9. **Discuss.** Run `accord gate ready <id>` and read its exit code. On exit 2 (a pin mismatch or a usage\n error) stop and report what it printed to the owner: it says nothing about discuss. When it names\n `gate.discuss-missing` or `gate.discuss-unmapped`, follow `./discuss.md`; when it names neither, the ticket\n was claimed before the discuss stage or its discuss.md is mapped, and goes on. Ask no yes here: the owner\n approves once, at accord-approach step 5.\n\n10. Next: `accord-approach`.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- A correction goes into `## Corrections` verbatim before any other action.\n A correction that exists only in the conversation is lost at the next\n compaction.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n- **Lane S.** Before step 9, when the interview shows the request fits lane S (none of the four lift conditions in `./lane.md` holds, judged on what `accord-scout` reports), no ticket that `accord status --json` lists names this one in `depends_on`, and both\n `git diff --name-only <origin's default branch>...HEAD` and `git status --porcelain --untracked-files=all` list\n only `accord/tickets/<id>.md`, paths under `accord/tickets/<id>/` and the records `./research.md` counts as its own,\n propose moving it to lane S, with the\n reason. Move it only on the owner's yes, as `## Moving to lane S` in `./ids.md` says; otherwise say why it stays\n lane M. From step 9 on, a lane never drops.\n",
24834
24842
  "intent/discuss.md": "---\nkind: reference\n---\n\n# The discuss stage\n\nRuns after the interview, in the main session. Every gray area the ticket leaves open is asked and settled\nbefore anyone drafts an approach.\n\nRun `accord anchor <id>` first. When it prints `stages off for lane <L>:` naming discuss, do not run this stage:\ntell the owner so in one line, write no discuss.md, and go to the stage `accord anchor` names next.\n\n1. Dispatch `accord-planner` in its `discuss` mode with the paths of `accord/tickets/<id>.md` and\n `accord/tickets/<id>/scout.md`. It replies with the gray areas by group: direction options, behaviour and\n output, failure and data loss, scope edges, interfaces, measurement rules or heuristics, test strategy. It always returns at least the test-strategy gray area; when a reply holds none, write that one yourself. When\n its reply names a question the code answers, dispatch `accord-scout` with that question and give the planner\n the reply.\n\n2. Write `accord/tickets/<id>/discuss.md` as `# Discuss: <id>`, a blank line, and every gray area under one `## Gray areas` heading, one list item at the start of its line,\n never indented: `- <group> — <the gray area in plain words> — ` with no D-nn yet. Commit it.\n\n3. Ask the owner every gray area, one at a time, with no cap, as `./ask.md` says: the question stands alone, in\n plain words, with its options, the recommended one first, and the consequence of each. The planner's\n recommendation is the default; the owner may take it or choose another.\n\n4. After each answer write it under `## Decisions` of the ticket as\n `- D-nn <decision> — \"<the owner's sentence>\"` with the next free number: the owner's words, in English when\n they were not. End that gray area's line in discuss.md with the same `D-nn`. A default the owner takes is\n written the same way, with the owner's words. Commit both files, then run `accord worktree push <id>`; go on\n even if it fails.\n\n5. Never answer, merge or skip a gray area for the owner. A gray area whose answer changes the Intent, a\n criterion or a Veto stops discuss: write the owner's words under `## Corrections` and go back to step 6 of the\n skill.\n\n6. On a resume, the first line of discuss.md with no D-nn is the next question.\n\n7. When every line names a D-nn, run `accord gate ready <id>`. Go on only when it names neither\n `gate.discuss-missing` nor `gate.discuss-unmapped`; then `accord-approach`.\n",
24835
24843
  "intent/research.md": "---\nkind: reference\n---\n\n# Research records\n\nA research record is a file `accord/research/<YYYY-MM-DD>-<topic>.md` that keeps a discussion, a measure or a study\nmade before or beside a ticket. It is evidence, never a contract. A ticket names its records under its frontmatter\nkey `research:`, one repository path per entry. The key is optional: make a record only when there is research or\nreplaced evidence to keep.\n\n## Before the first question\n\nAt step 2, before any question to the owner, read every record `accord anchor` lists under `## Research`. A record\nholds at the commit it names, so check a claim against the code before you rely on it.\n\n## Evidence a rewrite replaces\n\nAt step 6, before you rewrite a queued Intent, first move every line of evidence it replaces, verbatim, into a new\nrecord under `accord/research/` with `Date: <YYYY-MM-DD>` and `Repository at <sha>` in its first five lines, and list\nthat record under the ticket's `research:` key. Never delete such a line. Start the record as below, with today's date\nand the sha that `git rev-parse --short HEAD` prints:\n\n```\n# <topic>\n\nDate: <YYYY-MM-DD>. Repository at `<sha>`.\n```\n\nCommit the record with the ticket at steps 8 and 9.\n\n## The ticket's own files\n\nA `.md` record under `accord/research/` that the ticket lists under `research:` and that origin's default branch does\nnot hold counts as one of the ticket's own files, beside `accord/tickets/<id>.md` and the paths under\n`accord/tickets/<id>/`: the `git diff` and `git status` checks of the lane S rule accept it, and so does step 2 of\n`## Moving to lane S` in `./ids.md`. A change to a record the default branch already holds does not count. Step 3\nthere first moves the evidence of the sections it replaces into a record, as `## Evidence a rewrite replaces` says.\n",
24836
- "plan/SKILL.md": "---\nname: accord-plan\ndescription: Use when a lane M ticket has an approved approach and needs a plan. Has the planner write plan.md task by task, checks it with accord gate plan and the critic, and runs the full test suite on the baseline before build.\nlicense: MIT\nkind: skill\nloads: [plan/baseline.md, plan/critique.md, plan/legacy-round1.md, shared/ask.md]\n---\n\nThis stage turns the approved approach into tasks an executor can finish\none at a time. You run it in the main session.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming plan, do not run this stage: tell the\n owner so in one line and go to the stage it names next, `accord-build`, which builds the ticket as one\n task. Otherwise, when `plan.md` exists and the anchor still prints\n `Stage: plan` (the plan is not committed as ready), or `git status --porcelain` on\n `plan.md` prints anything, resume at step 4, reading `plan-review.md`\n as `./critique.md` says.\n\n2. **Plan.** Run `git rev-parse HEAD` (lifted from lane S: the fork point in its\n ledger Ruling), read `review.mode` in\n `accord/config.yml` (absent counts as `human`), and dispatch\n `accord-planner` with the path of `accord/tickets/<id>.md`, that commit,\n the mode, and `accord/tickets/<id>/direction.md` when it exists. It writes `accord/tickets/<id>/plan.md` with frontmatter\n `baseline: <that commit>` and one `## Task <n>: <title>` section\n per task. Each task carries a `covers:` line, a `files:` line, a\n `verify:` line, and an `after:` line (the tasks it follows, or `after: none`), then prose for the executor: the interface (consumes,\n produces) and the test written first. A task fits in about half an\n executor's context; the planner splits anything larger. A ticket that\n measures something runs its smallest experiment first, one arm on one sample,\n shown to the owner before widening; the planner plans it so. Only the first\n plan sets `baseline:`. In `verify:`, write `(@ac-n)` after the id of the\n test that proves scenario `@ac-n`.\n\n **Re-plan**, entered from a change of course or a review plan gap:\n dispatch the planner with the ticket path, the `baseline:` already in\n `plan.md`, the mode, the paths of `plan.md` and the ledger, and the\n change note or plan gap. `baseline:` never changes; every task with a\n ledger line keeps its text and number; each new or changed task is\n numbered after the highest existing number; `(new)` stays relative to\n the baseline. Steps 4 to 6 run as usual, step 7 does not re-run the\n baseline tests, and step 8 commits again.\n\n3. **Slices.** Under `review: human` the planner groups tasks into slices:\n each slice is one pull request covering a stated subset of the\n acceptance criteria, green on its own. The planner writes each slice\n into `plan.md`: the tasks it holds and the criteria it covers. Under\n `review: outcome` it is one branch, no slices.\n\n4. **Gate.** Run `accord gate plan <id>` and fix what it prints, then run\n it again until it passes. On a pass it writes `plan_hash:` into\n `plan.md`. A plan changed after that, by a critic round or anything\n else, must pass `accord gate plan <id>` again before `accord task-done`\n records a task, so re-run the gate after every revision. A question it asks about the tests\n baseline is answered at step 7; never create `accord/tests-baseline.txt` earlier. On\n `gate.plan-size`, ask the owner as `./ask.md` says whether to split the ticket or allow\n the size, and write a yes as the Ruling the gate prints. A gate\n failure you cannot fix counts as an open finding in step 6.\n\n5. **Critique.** Run the loop in `./critique.md`: how many `accord-critic` agents\n read, and what, which findings `accord-planner` fixes, and when the loop ends.\n When `accord round <id> --plan` prints no `Critics:` line, round 1 of the plan critique of a ticket claimed under an older accord follows `./legacy-round1.md`, as `./critique.md` says.\n\n6. **Rounds.** Run `accord round <id> --plan` before each critique round, as `./critique.md` says. On\n `stop: report to owner`, stop and tell the owner what is still open (a Must or Should still `open` or `unverified`, or `accord gate plan <id>` still fails), and show the revision with the fewest Must findings: its round and its commit, read from `git log` since the last plan-ready commit, if any. Never continue on a failing plan.\n\n7. **Baseline tests.** Before the first build commit, run the\n `tests.full` command from `accord/config.yml` at the current HEAD, and\n only while `git diff --stat <baseline> HEAD` shows no change outside\n `accord/`. Never check out, stash, reset, or clean to reach the\n baseline. If product code has changed since the baseline, ask the\n owner. Show the owner every failing case; the owner decides whether it\n is fixed first or tracked as its own ticket. Never ignore a failing\n case on your own. When `tests.report` is set and\n `accord/tests-baseline.txt` is absent, follow `./baseline.md`.\n\n8. **Finish.** If `git status` shows `accord/tests-baseline.txt` new, commit it\n alone first and add its Ruling if absent, per `./baseline.md`. Append a `## Closed` line to `plan-review.md`. Commit `plan.md` and `plan-review.md`, with the ledger if it changed, with the\n subject that `accord subject plan_ready <id>` prints. That commit marks the plan finished;\n `accord anchor` reads it, and `accord-build` relies on that. Then run `accord worktree push <id>`; go on even if it fails.\n\n9. Next: `accord-build`.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24837
- "plan/baseline.md": "---\nkind: reference\n---\n\n# The tests baseline\n\nWhen `accord/config.yml` has no `tests.report`, skip this file: ask nothing.\n\nWhen `accord/tests-baseline.txt` is absent, and only after the owner has decided every failing case at the baseline, as step 7 says, ask the owner before running `accord tests baseline`. The baseline then lists the failing cases too.\n\nShow the number of test cases no scenario names, and up to five of them, read from the lines `accord lint` prints for them, never a hand count. The owner chooses one of: create it, do not create it, or stop. Not creating it is allowed: `accord gate plan` keeps asking on every run and nothing records the choice.\n\nWhen `tests.full` wrote no report, stop and tell the owner; never write a report, and never run `accord tests baseline` against an old one.\n\nWhen `accord tests baseline` refuses because the report is older than the last commit: if `git diff --stat <baseline> HEAD` shows no change outside `accord/`, run `tests.full` once more and retry once; otherwise stop and tell the owner.\n\nOn a yes, run `accord tests baseline` and commit `accord/tests-baseline.txt` in a commit of its own, holding that file alone, never with the plan-ready commit of step 8, so it can be picked onto its own pull request. Then write into `accord/tickets/<id>/ledger.md`, under `## Rulings`:\n\n`Ruling: accord/tests-baseline.txt created at the plan baseline on the owner's yes — no task's files: line names it, so review would otherwise list it as undeclared — cost if wrong: review reports it as Extra`\n\nThe ledger goes in the plan-ready commit, so the baseline commit still holds that file alone. A resumed run that finds the file written but not committed does both at step 8: commit the file alone, then add the Ruling when the ledger lacks it, before the plan-ready commit.\n\nOn a team, the file reaches the main branch in its own small pull request, holding that file alone, before other tickets plan. On a merge conflict in it, keep only the lines both sides hold, never the union: a dropped case then fails loudly at the gate instead of being exempted silently.\n\nNever create the file in any other step, stage, or agent.\n",
24844
+ "plan/SKILL.md": "---\nname: accord-plan\ndescription: Use when a lane M ticket has an approved approach and needs a plan. Has the planner write plan.md task by task, checks it with accord gate plan and the critic, and runs the full test suite on the baseline before build.\nlicense: MIT\nargument-hint: \"[ticket id]\"\nkind: skill\nloads: [plan/baseline.md, plan/critique.md, plan/legacy-round1.md, shared/ask.md]\n---\n\nThis stage turns the approved approach into tasks an executor can finish\none at a time. You run it in the main session.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming plan, do not run this stage: tell the\n owner so in one line and go to the stage it names next, `accord-build`, which builds the ticket as one\n task. Otherwise, when `plan.md` exists and the anchor still prints\n `Stage: plan` (the plan is not committed as ready), or `git status --porcelain` on\n `plan.md` prints anything, resume at step 4, reading `plan-review.md`\n as `./critique.md` says.\n\n2. **Plan.** Run `git rev-parse HEAD` (lifted from lane S: the fork point in its\n ledger Ruling), read `review.mode` in\n `accord/config.yml` (absent counts as `human`), and dispatch\n `accord-planner` with the path of `accord/tickets/<id>.md`, that commit,\n the mode, and `accord/tickets/<id>/direction.md` when it exists. It writes `accord/tickets/<id>/plan.md` with frontmatter\n `baseline: <that commit>` and one `## Task <n>: <title>` section\n per task. Each task carries a `covers:` line, a `files:` line, a\n `verify:` line, and an `after:` line (the tasks it follows, or `after: none`), then prose for the executor: the interface (consumes,\n produces) and the test written first. A task fits in about half an\n executor's context; the planner splits anything larger. A ticket that\n measures something runs its smallest experiment first, one arm on one sample,\n shown to the owner before widening; the planner plans it so. Only the first\n plan sets `baseline:`. In `verify:`, write `(@ac-n)` after the id of the\n test that proves scenario `@ac-n`.\n\n **Re-plan**, entered from a change of course or a review plan gap:\n dispatch the planner with the ticket path, the `baseline:` already in\n `plan.md`, the mode, the paths of `plan.md` and the ledger, and the\n change note or plan gap. `baseline:` never changes; every task with a\n ledger line keeps its text and number; each new or changed task is\n numbered after the highest existing number; `(new)` stays relative to\n the baseline. Steps 4 to 6 run as usual, step 7 does not re-run the\n baseline tests, and step 8 commits again.\n\n3. **Slices.** Under `review: human` the planner groups tasks into slices:\n each slice is one pull request covering a stated subset of the\n acceptance criteria, green on its own. The planner writes each slice\n into `plan.md`: the tasks it holds and the criteria it covers. Under\n `review: outcome` it is one branch, no slices.\n\n4. **Gate.** Run `accord gate plan <id>` and fix what it prints, then run\n it again until it passes. On a pass it writes `plan_hash:` into\n `plan.md`. A plan changed after that, by a critic round or anything\n else, must pass `accord gate plan <id>` again before `accord task-done`\n records a task, so re-run the gate after every revision. A question it asks about the tests\n baseline is answered at step 7; never create `accord/tests-baseline.txt` earlier. On\n `gate.plan-size`, ask the owner as `./ask.md` says whether to split the ticket or allow\n the size, and write a yes as the Ruling the gate prints. A gate\n failure you cannot fix counts as an open finding in step 6.\n\n5. **Critique.** Run the loop in `./critique.md`: how many `accord-critic` agents\n read, and what, which findings `accord-planner` fixes, and when the loop ends.\n When `accord round <id> --plan` prints no `Critics:` line, round 1 of the plan critique of a ticket claimed under an older accord follows `./legacy-round1.md`, as `./critique.md` says.\n\n6. **Rounds.** Run `accord round <id> --plan` before each critique round, as `./critique.md` says. On\n `stop: report to owner`, stop and tell the owner what is still open (a Must or Should still `open` or `unverified`, or `accord gate plan <id>` still fails), and show the revision with the fewest Must findings: its round and its commit, read from `git log` since the last plan-ready commit, if any. Never continue on a failing plan.\n\n7. **Baseline tests.** Before the first build commit, run the\n `tests.full` command from `accord/config.yml` at the current HEAD, and\n only while `git diff --stat <baseline> HEAD` shows no change outside\n `accord/`. Never check out, stash, reset, or clean to reach the\n baseline. If product code has changed since the baseline, ask the\n owner. Show the owner every failing case; the owner decides whether it\n is fixed first or tracked as its own ticket. Never ignore a failing\n case on your own. When `tests.report` is set and\n `accord/tests-baseline.txt` is absent, follow `./baseline.md`.\n\n8. **Finish.** If `git status` shows `accord/tests-baseline.txt` new, commit it\n alone first and add its Ruling if absent, per `./baseline.md`. Append a `## Closed` line to `plan-review.md`. Commit `plan.md` and `plan-review.md`, with the ledger if it changed, with the\n subject that `accord subject plan_ready <id>` prints. That commit marks the plan finished;\n `accord anchor` reads it, and `accord-build` relies on that. Then run `accord worktree push <id>`; go on even if it fails.\n\n9. Next: `accord-build`.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24845
+ "plan/baseline.md": "---\nkind: reference\n---\n\n# The tests baseline\n\nWhen `accord/config.yml` has no `tests.report`, skip this file: ask nothing.\n\nWhen `accord/tests-baseline.txt` is absent, and only after the owner has decided every failing case at the baseline, as step 7 of `accord-plan` says (with the plan stage off, `accord-build`'s `no-plan.md` replaces it), ask the owner before running `accord tests baseline`. The baseline then lists the failing cases too.\n\nShow the number of test cases no scenario names, and up to five of them, read from the lines `accord lint` prints for them, never a hand count. The owner chooses one of: create it, do not create it, or stop. Not creating it is allowed: `accord gate plan` keeps asking on every run and nothing records the choice.\n\nWhen `tests.full` wrote no report, stop and tell the owner; never write a report, and never run `accord tests baseline` against an old one.\n\nWhen `accord tests baseline` refuses because the report is older than the last commit: if `git diff --stat <baseline> HEAD` shows no change outside `accord/`, run `tests.full` once more and retry once; otherwise stop and tell the owner.\n\nOn a yes, run `accord tests baseline` and commit `accord/tests-baseline.txt` in a commit of its own, holding that file alone, never with the plan-ready commit of step 8 of `accord-plan`, so it can be picked onto its own pull request. Then write into `accord/tickets/<id>/ledger.md`, under `## Rulings`:\n\n`Ruling: accord/tests-baseline.txt created at the plan baseline on the owner's yes — no task's files: line names it, so review would otherwise list it as undeclared — cost if wrong: review reports it as Extra`\n\nThe ledger goes in the plan-ready commit, so the baseline commit still holds that file alone. A resumed run that finds the file written but not committed does both at step 8 of `accord-plan`: commit the file alone, then add the Ruling when the ledger lacks it, before the plan-ready commit.\n\nOn a team, the file reaches the main branch in its own small pull request, holding that file alone, before other tickets plan. On a merge conflict in it, keep only the lines both sides hold, never the union: a dropped case then fails loudly at the gate instead of being exempted silently.\n\nNever create the file in any other step, stage, or agent, except `accord-build` with the plan stage off, as its `no-plan.md` says.\n",
24838
24846
  "plan/critique.md": "---\nkind: reference\n---\n\n# The critique loop\n\nThe main session keeps every critic finding in\n`accord/tickets/<id>/plan-review.md`: one `## Round <n> (whole)` or\n`## Round <n> (diff)` section per round, each finding on one line as\n`<n>. <Must|Should|Nice> — <finding> — <state>`. The state is `open`,\n`fixed`, `deferred` for a Nice, `unverified: <reason>`, `withdrawn`,\n`repeated as <round>.<n>` when a critic carries it on under that number,\n`open, owner: \"<the owner's words>\"` for a fix the owner said to apply,\nor `owner: \"<the owner's words>\"` for one the owner dropped. After the\nstate the session copies the critic's marks, each as ` — <mark>`:\n`rests on: <the ticket line>`, `risk: data-loss` or `risk: security`,\n`test: <id>`, `command: <command>`. The separator is always ` — `, never a hyphen, and a risk is written exactly ` — risk: security` or ` — risk: data-loss` after the finding's text: accord reads a risk from that mark slot only, never from the finding's words, a note or a reason. A mark slot whose value does not parse (`risks: security`, `risk: data_loss`, `risk: security` in backticks or quotes) is a record problem, and `accord round <id> --plan` refuses it on a plan record written under accord 0.4.1 or later. A value that is no kind (`risk: none`) is prose. A finding stays `open` or `unverified` until a critic lists it after `fixed:` or\n`withdrawn:`, or the owner drops it; the planner's word alone closes\nnothing. A round with no findings says `No findings`. Only the sections\nafter the last `## Closed` line count; step 8 of the skill appends that\nline.\n\n`plan-review.md` starts with the line `Round record: 1`, above every heading; its only headings are `## Round <n> (whole)`, `## Round <n> (diff)` and `## Closed`. Before each round, and before step 8 of the skill appends `## Closed`, run `accord round <id> --plan`: exit 0 gives the round's number and the cap; it counts only the rounds after the last `## Closed` line: from accord 0.4.1 `accord round <id> --plan` counts at most three rounds, prints `stop: report to owner` from round 3 on a round that still reports a Should or a Must, and after any round whose Must + Should count did not fall from the round before, and on a third round that reports any finding; a ticket claimed under an older accord keeps five rounds and the stop from round 3 (`accord round <id> --plan` prints `of 5` for it), and a fifth round that reports any finding stops it. On a stop, stop and report to the owner what it prints, as `./ask.md` says, and ask whether to change course, accept the open findings, or allow more rounds. Write the answer as the last line `verdict: accepted-by-owner \"<the owner's sentence>\"` in `plan-review.md`, which ends the loop as step 4 says; or, to allow more rounds, as the ledger Ruling `Ruling: the owner allows <n> more plan critique rounds after round <r> of cycle <k> — \"<the owner's sentence>\" — <cost if wrong>`, with r and k as the stop printed them; or, for a change of course, as that same Ruling with n the rounds the owner gives the reworked plan, then the re-plan. A round after the stop, allowed by the owner, that reports no findings clears it. Never append `## Closed` while a stop holds. On a `refused:` that says the loop has ended, the loop is over: go to step 7 of the skill, or at step 8 append `## Closed`. On any other `refused:`, fix what it names and run it again.\n\n1. **Read.** Round 1 reads the output of `accord round <id> --plan` that\n the paragraph above runs before each round: when it holds\n `Critics: plan checker`, dispatch as below; when it holds no `Critics:`\n line, the ticket was claimed under an older accord: dispatch round 1 as\n `./legacy-round1.md` says, and every later round as below. Round 1 is\n `whole`. Judge from the ticket and the plan\n whether the ticket touches auth, money, migration, or data deletion,\n or the plan touches a path under `sensitive:` in `accord/config.yml`.\n Dispatch in parallel, each in a fresh context, mode `plan`, with the\n paths of the ticket and `plan.md`:\n - one `accord-critic`, no lens, the plan checker, which runs every\n check of its fixed checklist, for a plan of any size;\n - one more `accord-critic`, lens `security`, when the ticket touches\n auth, money, migration, or data deletion, or the plan touches a path\n under `sensitive:` in `accord/config.yml`.\n\n The security critic runs in round 1 only; later rounds, whole or diff,\n verify its fixes, and a finding marked `risk: data-loss` or\n `risk: security` blocks in every round. The plan checker and every\n `diff` critic check the plan against every Decision and every\n Correction of the ticket.\n\n Merge and de-duplicate their findings into one round, numbered within\n it, before the planner gets them. After a round that reports a Must,\n or that leaves a Must from an earlier round open or unverified (its\n section holds a Must, or `<m>` is above zero in step 5), the next\n round is `whole`, even when the owner dropped that Must: one\n `accord-critic` in a fresh context, no lens, mode `plan`, with the\n paths of the ticket, `plan.md`, and `plan-review.md`. After any other\n round the next is `diff`: write\n `git diff <that round's commit> -- accord/tickets/<id>/plan.md`, which\n holds the planner's fix, into a file outside the working tree, and\n dispatch one `accord-critic` in a fresh context, mode `diff`, with the\n paths of the ticket, `plan.md`, that file, and `plan-review.md`. A\n `diff` critic never reads the whole plan.\n2. **Record.** Append the round's section to `plan-review.md` and mark\n each new finding `open`. Mark `fixed` each finding a critic lists\n after `fixed:`, and `withdrawn` each one it lists after `withdrawn:`.\n When a new finding starts `repeats <round>.<n>:`, mark that earlier\n finding `repeated as <this round>.<n>`. A Nice goes to the ledger\n under `## Deferred`, marked `deferred`, and never to the planner.\n From round 2 (accord 0.4.1 and later), and from round 1 under the plan\n checker or the security critic when `accord round <id> --plan` refuses round 2 naming such a\n finding, a new Must or Should with none of the marks above is marked\n `deferred` too and goes to the ledger\n under `## Deferred` as\n `- plan <r>.<n>[ cycle <k>]: <finding> — failing case: <case>`\n (` cycle <k>` from cycle 2 on), never to the planner. A finding with a\n `risk:` mark is never deferred: it blocks in every round. A finding of\n the security critic with none of the marks is never deferred silently:\n ask that critic once for its `rests on:` line (`risk: security` for a\n security finding), and name any finding it still leaves unmarked to the\n owner with its deferral.\n3. **Owner.** A finding whose proposed fix relies on an API cited only\n by a URL outside the repository goes to the owner at once, as\n `./ask.md` says: show the finding, the fix, and the URL, and ask\n whether to apply or drop it. On apply its state becomes\n `open, owner: \"<the owner's words>\"`: it goes to the planner with\n those words, which confirm the API, and closes only when a critic\n lists it after `fixed:`. On drop its state becomes\n `owner: \"<the owner's words>\"`, which closes it.\n4. **Converged.** The loop ends only on a round that reports no Must\n and no Should and leaves no Must or Should open or unverified, or on\n the owner's acceptance after a stop, the last line\n `verdict: accepted-by-owner \"<the owner's sentence>\"` of\n `plan-review.md`, and only when the last `accord gate plan <id>`\n passed (after an acceptance, run it once more): go to step 7 of the\n skill.\n5. **Fix.** Otherwise commit `plan.md` and `plan-review.md` with the\n subject that `accord subject plan_round <id> round <n>, <m> Must, <s> Should` prints, where `<m>` and\n `<s>` count the Musts and the Shoulds after the last `## Closed` line\n that are `open` or `unverified` once this round is recorded; the next\n `diff` round reads from that commit. Dispatch `accord-planner` with the\n ticket path, the baseline, the mode, the path of `plan-review.md`, and\n every Must and Should that is `open` or `unverified`, never a Nice,\n each labelled `<round>.<n>` and listed with the owner's words it holds.\n The planner fixes every one and replies by that label. Write each\n `unverified: <reason>` it replies into the state of the finding with that\n label; a finding it reports fixed stays `open` until a critic lists it\n after `fixed:`. Tell the planner to change only the lines a finding\n needs, inside the tasks it names (`Task <n>` or `the preamble`).\n From accord 0.4.1, `accord round <id> --plan` lists the `plan.md`\n hunks outside the tasks the open findings of the cycle name and refuses\n them; on that refusal narrow the fix, or ask the owner, as `./ask.md`\n says, and write under `## Rulings` in the ledger\n `Ruling: the owner allows the plan fix after round <r> of cycle <k> to change <places> — \"<the owner's sentence>\" — <cost if wrong>`,\n where `<places>` is `Task <n>[, Task <m>…]`, `the preamble` or\n `the whole plan`; a re-plan after a change of course needs that Ruling\n with `the whole plan`. Then go back to step 4 of the skill.\n",
24839
24847
  "plan/legacy-round1.md": "---\nkind: reference\n---\n\n# Round 1 of the plan critique of a ticket claimed under an older accord\n\nRead this file only when `accord round <id> --plan` printed no `Critics:`\nline at round 1: the ticket was claimed under an older accord, and step 1 of\n`./critique.md` sent you here. Round 1 dispatches as below; every later\nround, the record, the owner, convergence and the fix are those of\n`./critique.md`, and the cap and stop are what `accord round <id> --plan`\nprints for this ticket (five rounds and the stop from round 3).\n\nCount the `## Task` sections of `plan.md` and judge from the ticket and the\nplan whether the ticket touches auth, money, migration, or data deletion, or\nthe plan touches a path under `sensitive:` in `accord/config.yml`. Dispatch\nin parallel, each in a fresh context, mode `plan`, with the paths of the\nticket and `plan.md`:\n\n- one `accord-critic` with no named checks for a plan of one to three tasks;\n- two critics for a plan of four or more tasks, one told to run only the\n first, second, third, fifth and seventh checks under `Mode plan:` and one\n only the fourth and sixth;\n- one more critic, lens `security`, for a plan of any size whose ticket\n touches auth, money, migration, or data deletion, or whose plan touches a\n path under `sensitive:` in `accord/config.yml`, so at most three.\n\nA critic running every check or the first group, and every `diff` critic,\nchecks the plan against every Decision and every Correction of the ticket.\n\nThen merge and de-duplicate their findings into one round, numbered within\nit, as step 1 of `./critique.md` says.\n",
24840
- "review/SKILL.md": "---\nname: accord-review\ndescription: Use when every task of a lane M ticket has a ledger line and the work needs review. Dispatches reviewers on the review package, fixes patch findings through fresh executors until no Must is open and every Should is fixed, runs one final reviewer, and records each round in review.md.\nlicense: MIT\nkind: skill\nloads: [review/record.md, shared/ask.md]\n---\n\nThis stage reviews the built work against the ticket until it converges.\nYou run it in the main session and orchestrate: reviewers find, executors\nfix.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming review, do not run this stage: tell the\n owner so in one line and go to the stage it names next, `accord-verify`.\n\n2. **Package.** Run `accord review-package <id>` into a file outside the working tree. After a round with a head in\n `review.md`, it holds the commits, the stat, and the diff after that head, without what a merge brought in from\n the default branch; before round 1, from the plan's `baseline:` (when the plan stage is off there is none: from the default branch). It prints `Head: <sha>` for the round's heading,\n and lists under `## Undeclared files` every changed file no task's `files:` line names, and under\n `## Interface signs` each sign of a new interface the branch adds.\n\n3. **Reviewers.** Choose by the unit's diff size and risk:\n - up to about 500 changed lines: one `accord-reviewer`, lens `both`;\n - about 500 to 1500: an `intent` and a `quality` reviewer, in parallel;\n - over about 1500: split by area times lens, plus one `integration` reviewer reading only the\n interfaces and links between areas;\n - auth, money, migration, or data deletion: add a `security` reviewer, at any size.\n\n Name the lens in each dispatch. Every reviewer gets the paths of the ticket file, the review\n package, and `accord/tickets/<id>/ledger.md`. The executor's report is context, never evidence.\n\n4. **Classify.** De-duplicate the findings, then mark each one `patch`, `plan-gap`, or `intent-gap`.\n - Fix every Must and Should marked `patch` through `accord-build`'s executor path. Commit the round to `review.md` as\n `./record.md` says. Write a brief file outside the working tree: copy the ticket file byte\n for byte (never retype it), then append the findings to fix. Dispatch a fresh `accord-executor` with its path and\n step 6's `model`, and route its stops as `accord-build` does.\n - When it reports, run the `tests.affected` command over the files the fix touched, or `tests.full`\n when `tests.affected` is not configured or finds no test file. If it fails, dispatch a fresh\n executor with the same brief plus the failing output, in the same round.\n - Copy every Ruling in its report, and each file outside the plan you accept, or that the fix changed with no\n finding of the round in it, as a Ruling naming the file and its reason, into\n `accord/tickets/<id>/ledger.md` under `## Rulings`; commit the ledger.\n - When the round reported a Must, re-review only the fix diff:\n `accord review-package <id>` into a file outside the working tree, one\n reviewer, lens `both`. When it reported only Should findings, no reviewer is dispatched again for\n that fix: that command passing checks it.\n - A plan gap goes back to `accord-plan` as a re-plan, where the critic runs again; with the plan stage off, stop and ask the owner.\n - An intent gap stops the run and asks the owner.\n - Nice findings go to the ledger under `## Deferred`, not fixed.\n\n5. **Converged** means no Must is open and every Should is fixed with that command passing; a finding deferred\n under `./record.md`'s evidence rule, with its `## Deferred` line, does not block it.\n\n6. **Cap.** Run `accord round <id>` before each round and before the verdict. Exit 0 prints `Round: <n> of <cap>` and\n `Fix executor model: <model>`. It counts at most five rounds, after verify counted from the first round after it, and\n tiers up from `escalation.fix_round_tier_up`. On `stop: report to owner` (a Should or a Must from round 3, or the cap)\n or `refused:`, act as `./record.md` says; never report the work finished.\n\n7. **Final review.** After convergence, one fresh `accord-final-reviewer` reads the whole ticket once, from\n `accord review-package <id> --base <the plan's baseline:>` (when the plan stage is off, `--base <the default branch>`), its round headed `(final review)` (over about 1500\n changed lines, dispatch it with lens `integration`). If it finds a Must: one fix and one scoped re-review, as in\n step 4. If it finds only Should findings, fix them and run that command as in step 4, with no re-review. If a Must is\n still open after that, stop and ask the owner.\n\n8. **Record.** Write every round to `accord/tickets/<id>/review.md` as `./record.md` says, ending `verdict: converged`, or,\n when the owner accepts any stop with findings still open, `verdict: accepted-by-owner` followed by the owner's sentence\n quoted. Commit it.\n\n9. Next: `accord-verify`.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary: an executor gets it inside\n its brief.\n- The main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public interface stops the run and\n asks the owner. Every other decision is a Ruling in `accord/tickets/<id>/ledger.md` under\n `## Rulings`: `Ruling: <what> — <why> — <cost if wrong>`. Read `./ask.md` before any question to the\n owner.\n",
24848
+ "review/SKILL.md": "---\nname: accord-review\ndescription: Use when every task of a lane M ticket has a ledger line and the work needs review. Dispatches reviewers on the review package, fixes patch findings through fresh executors until no Must is open and every Should is fixed, runs one final reviewer, and records each round in review.md.\nlicense: MIT\nargument-hint: \"[ticket id]\"\nkind: skill\nloads: [review/record.md, shared/ask.md]\n---\n\nThis stage reviews the built work against the ticket until it converges.\nYou run it in the main session and orchestrate: reviewers find, executors\nfix.\n\n## Steps\n\n1. Run `accord anchor`. When it prints `stages off for lane <L>:` naming review, do not run this stage: tell the\n owner so in one line and go to the stage it names next, `accord-verify`.\n\n2. **Package.** Run `accord review-package <id>` into a file outside the working tree. After a round with a head in\n `review.md`, it holds the commits, the stat, and the diff after that head, without what a merge brought in from\n the default branch; before round 1, from the plan's `baseline:` (when the plan stage is off there is none: from the default branch). It prints `Head: <sha>` for the round's heading,\n and lists under `## Undeclared files` every changed file no task's `files:` line names, and under\n `## Interface signs` each sign of a new interface the branch adds.\n\n3. **Reviewers.** Choose by the unit's diff size and risk:\n - up to about 500 changed lines: one `accord-reviewer`, lens `both`;\n - about 500 to 1500: an `intent` and a `quality` reviewer, in parallel;\n - over about 1500: split by area times lens, plus one `integration` reviewer reading only the\n interfaces and links between areas;\n - auth, money, migration, or data deletion: add a `security` reviewer, at any size.\n\n Name the lens in each dispatch. Every reviewer gets the paths of the ticket file, the review\n package, and `accord/tickets/<id>/ledger.md`. The executor's report is context, never evidence.\n\n4. **Classify.** De-duplicate the findings, then mark each one `patch`, `plan-gap`, or `intent-gap`.\n - Fix every Must and Should marked `patch` through `accord-build`'s executor path. Commit the round to `review.md` as\n `./record.md` says. Write a brief file outside the working tree: copy the ticket file byte\n for byte (never retype it), then append the findings to fix. Dispatch a fresh `accord-executor` with its path and\n step 6's `model`, and route its stops as `accord-build` does.\n - When it reports, run the `tests.affected` command over the files the fix touched, or `tests.full`\n when `tests.affected` is not configured or finds no test file. If it fails, dispatch a fresh\n executor with the same brief plus the failing output, in the same round.\n - Copy every Ruling in its report, and each file outside the plan you accept, or that the fix changed with no\n finding of the round in it, as a Ruling naming the file and its reason, into\n `accord/tickets/<id>/ledger.md` under `## Rulings`; commit the ledger.\n - When the round reported a Must, re-review only the fix diff:\n `accord review-package <id>` into a file outside the working tree, one\n reviewer, lens `both`. When it reported only Should findings, no reviewer is dispatched again for\n that fix: that command passing checks it.\n - A plan gap goes back to `accord-plan` as a re-plan, where the critic runs again; with the plan stage off, stop and ask the owner.\n - An intent gap stops the run and asks the owner.\n - Nice findings go to the ledger under `## Deferred`, not fixed.\n\n5. **Converged** means no Must is open and every Should is fixed with that command passing; a finding deferred\n under `./record.md`'s evidence rule, with its `## Deferred` line, does not block it.\n\n6. **Cap.** Run `accord round <id>` before each round and before the verdict. Exit 0 prints `Round: <n> of <cap>` and\n `Fix executor model: <model>`. It counts at most five rounds, after verify counted from the first round after it, and\n tiers up from `escalation.fix_round_tier_up`. On `stop: report to owner` (a Should or a Must from round 3, or the cap)\n or `refused:`, act as `./record.md` says; never report the work finished.\n\n7. **Final review.** After convergence, one fresh `accord-final-reviewer` reads the whole ticket once, from\n `accord review-package <id> --base <the plan's baseline:>` (when the plan stage is off, `--base <the default branch>`), its round headed `(final review)` (over about 1500\n changed lines, dispatch it with lens `integration`). If it finds a Must: one fix and one scoped re-review, as in\n step 4. If it finds only Should findings, fix them and run that command as in step 4, with no re-review. If a Must is\n still open after that, stop and ask the owner.\n\n8. **Record.** Write every round to `accord/tickets/<id>/review.md` as `./record.md` says, ending `verdict: converged`, or,\n when the owner accepts any stop with findings still open, `verdict: accepted-by-owner` followed by the owner's sentence\n quoted. Commit it.\n\n9. Next: `accord-verify`.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary: an executor gets it inside\n its brief.\n- The main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public interface stops the run and\n asks the owner. Every other decision is a Ruling in `accord/tickets/<id>/ledger.md` under\n `## Rulings`: `Ruling: <what> — <why> — <cost if wrong>`. Read `./ask.md` before any question to the\n owner.\n",
24841
24849
  "review/record.md": "---\nkind: reference\n---\n\n# The review record\n\n`accord/tickets/<id>/review.md` holds one section per review round, in\norder, and ends with the verdict.\n\nIts first line is `Round record: 2`, above every heading, and its only headings are `## Round <n> head <sha>` and `## Return from verify <sha>`. A record whose first round was committed while `accord/config.yml` pinned accord 0.3.0 or earlier keeps its `Round record: 1` and its `## Round <n>` headings, without heads or marks, and its old packages: after committing a round, note the HEAD sha, and re-review a round with a Must with `accord review-package <id> --base <the noted sha>`; when `accord anchor` prints `Review base: <sha>`, build the package with `accord review-package <id> --base <sha>`. The marks, evidence, grounds, `## Deferred` line and fix-file rules below bind a `Round record: 2` record only; a version 1 record keeps its old rules.\n\n```\n## Round <n> head <sha>\n\nMust|Should|Nice <n> [patch|plan-gap|intent-gap]: <finding> — <path>[:<line>] | none — fixed in <sha> | deferred | open[ — <mark>]…\n```\n\n- One `## Round <n> head <sha>` section per round, the final review included, each\n listing that round's findings after merging and de-duplication, numbered\n within the round.\n- `<sha>` is the `Head: <sha>` line `accord review-package` printed for that round, the last commit it\n reviewed; accord checks in git that it lies between the previous round's head and the round's record. The\n heading ends ` (added code round 1)` when `accord round` printed `Added code:` before the round, and\n ` (final review)` on the final review, which is the last round or the one before it, until an owner allowance\n gives more rounds.\n- Each finding carries its severity, its class, what it is, where it is (one repository path, with `:<line>` when known, or\n `none`), and what became of it: `fixed in <sha>` with the fix commit, `deferred`\n for a Nice finding, or for a Must or Should only as the evidence rule below allows, written to the ledger under\n `## Deferred`, or `open`.\n- A finding line starts with its severity word, `Must`, `Should` or `Nice`, never two of them or a question mark: accord refuses a round record whose severity it cannot read.\n- After its state a finding line carries its marks, each after ` — `: `carried from <r>.<n>` when round `<r>` of\n this cycle reported it as finding `<n>`; `risk: data-loss` or `risk: security`; `test: <test id>` or\n `command: <command>` when a failing test or a command reproduces it; `rests on: ac-<n>`, `rests on: D-<nn>`,\n `rests on: Veto \"<quote>\"`, `rests on: Correction \"<quote>\"` (from accord 0.4.1) or `rests on: Intent \"<quote>\"`, a quote\n of at least three words from that section.\n- Rounds are counted within the cycle. From round 2 (accord 0.4.1 and later; round 3 before it) a Must or Should not\n carried from an earlier round, whose location is not a file the previous round's fix changed, blocks only with\n `test:`, `command:` or a `risk:` mark. Otherwise write it `deferred` and add the line\n `- review <r>.<n> cycle <k>: <finding> — failing case: <case>` under `## Deferred` in the ledger (` cycle <k>` from\n cycle 2 on; before accord 0.4.1 the line ends at `<finding>`); it then leaves the stop from round 3.\n- The final review's own findings are asked no `test:`, `command:` or ticket line, though `accord round` still\n counts it as a round.\n- For a finding in a file that code reviewed in an `(added code round 1)` round changed, the count restarts at\n that round, per finding file; every other finding keeps the ticket's count.\n- The grounds rule uses the same count: from round 2 (accord 0.4.1 and later; round 3 and Shoulds only before it) a\n new Must or Should also needs `rests on:`, `test:`, `command:` or a `risk:` mark; without one, write it `deferred`\n with the ledger line above ending ` — failing case: <case>` (before accord 0.4.1 a Should is written as a Nice). A\n `risk:` finding is never deferred: it blocks in every round.\n- A round's fix is every commit after its head, up to the next round's head or, after the last round, to the\n last commit, but merges of the default branch, a debug episode's commits and commits that change only the\n ticket's records. Each file a fix changes is the location of a finding of that round, or a Ruling under\n `## Rulings` in the ledger names its path with a reason; a copy `accord skills sync` writes and a path under\n `generated:` in `accord/config.yml` need neither.\n- Each round is written as it ends, the final review included, with every finding `open`, and committed before any fix executor is dispatched; each state then becomes `fixed in <sha>` or `deferred`.\n- A round with no findings says `No findings`.\n- Every `Confirmed wording-only: <path>` and `Not an interface: <path> — <reason>` line a reviewer reports is copied verbatim, one per line, into that round's section. Only the last `## Round` is read for them, so the last round, the final review, carries every one that still holds.\n\n`accord round <id>` reads this record. A round at or after `escalation.fix_round_tier_up` in `accord/config.yml` (default 4) dispatches a fresh executor one model tier above the executor's configured model, passed as `model` on the dispatch itself: `haiku`, then `sonnet`, then `opus`; `opus` stays `opus`. `accord round` prints that model as `Fix executor model: <model>`; pass it on every fix executor dispatch of the round. On `refused:`, fix what it names and run `accord round <id>` again.\n\nOn `stop: report to owner`, printed from round 3 for a round that still reports a Should or a Must, and at the cap, show the owner what it prints: the open findings and the Approach. Say whether the open findings trace to the ticket or the plan, and ask whether to change course, accept the open findings, or allow more rounds; never report the work finished. Write the owner's answer in one of three forms:\n\n- accepting the open findings: the last line of `review.md` is `verdict: accepted-by-owner \"<the owner's sentence>\"`;\n- allowing more rounds: under `## Rulings` in the ledger, `Ruling: the owner allows <n> more review rounds after round <r> of cycle <k> — \"<the owner's sentence>\" — <cost if wrong>`, with r and k as the stop printed them;\n- changing course: that same Ruling, with n the number of review rounds the owner names for the reworked code, written before a re-plan through `accord-plan`; after the rework the review goes on in the same cycle.\n\nAfter a stop, `verdict: converged` needs a round after it, allowed by the owner, that reports no findings.\n\nBefore writing the verdict, run `accord round <id>`. Exit 0, or a stop whose only `Reason:` is that the cap is reached and no owner Ruling allows more, lets the verdict be written; any other stop goes to the owner as above first. When exit 0 also prints `Added code:` (after a `(final review)` round, only code added after that round counts), run that round first, headed `(added code round 1)`, before the verdict.\n\nThe single last line of the file is the verdict:\n\n- `verdict: converged` when, after the final review, no Must is open and\n every Should is fixed with that command passing: `tests.affected` over\n the files the fix touched, or `tests.full` when `tests.affected` is not\n configured or finds no test file; a Must or Should deferred under the\n evidence rule, with its `## Deferred` line, does not block it;\n- `verdict: accepted-by-owner \"<the owner's sentence>\"` when the run\n stopped with findings still open, at the cap or after the final\n re-review, and the owner accepted them, quoting what the owner said.\n\nNothing follows the verdict line until a return from verify.\n\nBack from verify, or back at review for any change made after the verdict, `accord anchor` prints `Review base: <sha>` while `review.md` ends with its verdict. Then, before the next round, run `git log -1 --format=%H -- accord/tickets/<id>/review.md` and append `## Return from verify <sha>` with the sha it prints; accord confirms from git that `review.md` ended with its verdict at that commit. The rounds after it are a new cycle counted from 1; a model tier once raised stays raised.\n",
24842
24850
  "shared/ask.md": "---\nkind: reference\n---\n\n# Asking the owner\n\nA question that needs context to be understood is asked in plain chat, never in\na question dialog, because the dialog hides the chat written before it: a few\nplain sentences of context, then the question, then lettered options, each\nsaying what happens if it is chosen, the recommended one first, with one\nsentence on why it is recommended. A question dialog is used only when the\nquestion and its options are understood on their own in one line, such as\n'Commit now?'.\n\nAsk multiple choice when you can list two to four exclusive options, each with\na consequence drawn from the code or the ticket; ask an open question, with no\noptions, when the answer is in the owner's head, such as why, for whom, what\nsuccess looks like, or what hurts today; offer a short menu only when the owner\nis stuck on an open question.\n\nExplain in plain words for an owner who reads no code: a file path or a symbol\nis only a pointer, never the explanation, and every id such as ac-2 or D-03\ncarries a short gloss.\n",
24843
24851
  "shared/failure.md": "---\nkind: reference\n---\n\n# A failure found after verify\n\nA failure is found after verify when ticket <id> has reached verify\n(`accord anchor` prints `verify` or `done`, or the ticket has\na `verified_commit:` or an `accord/tickets/<id>/verification.md`, so a\nticket back at `review` for an earlier fix counts), its pull request is\nnot merged (`gh pr view <branch> --json state` does not print `MERGED`),\nand either\nsomeone reports a failure in its work, with or without the failing\ncommand and its output, or verify finds a failed check on that pull\nrequest. A failure after the merge is not one: it needs a new bug ticket.\n\nA lane S ticket (`accord anchor` prints `Lane: S`) never reaches verify, so a failure in its work is not one: continue it as the\naccord skill's lane S steps say, and the fix gets another review round.\n\n1. Never judge the cause yourself, and never dispatch a fix outside\n `accord-debug`: no executor, no edit, and no Ruling in place of a\n root cause.\n2. When this session is not in that ticket's worktree, first run\n `accord worktree open <id> --continue` and follow the accord skill's\n `./worktree.md`, then Continue's step 2 only; after a `stop:` line,\n ask the owner to type, in the session opened there, `/accord <id> `\n followed by the report, in place of the line it prints, and stop here.\n When it printed `enter:`, or this session is already in that worktree,\n in place of Continue's steps 3 and 4, load\n `accord-debug` for that ticket: a new episode, or the open one when\n the last `## ` heading of\n `debug.md` is not `## Resolved`. Pass the debugger the report as given;\n when it names no failing command or output, say so, and the debugger\n finds them itself, for a failed check with\n `gh run view <run-id> --log-failed`.\n3. A failure only another operating system shows (a CI check, or a test\n skipped here): its red is the CI log, and its green is that check\n passing at the next verify. Give the debugger, and the executor in\n its brief, the failing check's log as the failing output, and say\n the reproduction test is skipped on this operating system. After\n the fix, go on to the stage `accord anchor` prints, without\n `## Resolved` (`done`: `accord-verify` at step 6, whose Finish\n closes the episode). The episode stays open\n across that verify and keeps its count of failed fixes: the check\n passing there resolves it, the check failing there counts one failed\n fix in it.\n4. After the fix, `accord anchor` prints `review` and a `Review base:`\n line: the fix gets its own review round, then verify runs again.\n",
24844
24852
  "shared/finish.md": "---\nkind: reference\n---\n\n# Reporting a finished ticket\n\nThe last message of a finished ticket has three parts, in this order, and nothing else.\n\n1. One verdict line: `✅ <id> DONE — PR #<n> ready, waiting for your merge: <url>`, with `<n>` and `<url>` from\n `gh pr list --head <branch> --state open --json number,url`; a merged pull request is not open. When no pull request is open, because `gh` is missing or the owner\n is to open it: `✅ <id> DONE — branch <branch> pushed, open its pull request`. Never merge the pull request\n and never write that it is merged: merging waits for the owner.\n2. At most four status lines: the facts the owner needs about this finish, such as the tests, CI, the review's\n verdict, and what was skipped or not checked. The closing lines on what was skipped go here, within this limit.\n3. `Next:`, then one to three suggestions. Run `accord dashboard` now and read its last line: each suggestion,\n one per line, is an action it names, written as its command: `[Continue <id>]` as `/accord continue <id>`,\n `[Pick up <id>]` as `/accord pick-up <id>`, `[New request]` as `/accord <request>`. Leave out an action on the\n ticket just finished. The first ends with `(recommended)`. Never suggest an action the dashboard does not print.\n\nAfter this message, end the turn. Never wait for the merge, and never remove the ticket's worktree or branches by\nhand: once the owner merges the pull request, the next session start, resume or /clear, or the next `/accord`,\nremoves them. A /clear in this finishing session keeps its worktree (`kept <path>: this session's worktree`): the\nfolder goes only after this session has ended, at a session started in another folder, so tell the owner to close\nthis session once the pull request is merged.\n",
24845
24853
  "shared/prototype.md": "---\nkind: reference\n---\n\n# Producing a prototype\n\nA `ui: true` ticket needs something a reviewer can look at before the code\nexists. In the `maintain` profile that something is\n`accord/assets/<id>/prototype.html`, and it is derived from what the project\nalready looks like — not from a fresh idea of what it could look like.\n\n## 1. Find the styles the project already has\n\nBefore writing any markup, find where the look of this project is defined.\nLook for, in roughly this order:\n\n- the path named under `design.tokens` in `accord/config.yml`, if one is set;\n- a stylesheet or variables file the application loads on every page;\n- a utility-class configuration, if the project styles that way;\n- a components or design-system folder.\n\nRead what you find. You are looking for the names the project uses for its\ncolours, spacing, radii, and type — those names are what the prototype spends,\nand inventing new ones is a redesign the ticket did not ask for.\n\nIf you find nothing, say so in the ticket's `## Open questions` and keep\ngoing: a prototype built from nothing has to record what it was built from\ninstead.\n\n## 2. Start from a single HTML file\n\nOne HTML file: a comment block at the top, an empty body. The comment block\nnames the ticket, a `Derived from:` line for what step 1 found, and the owner.\nBuild the page underneath it. One file, no build step, no assets directory —\na reviewer opens it in a browser and it works.\n\n## 3. Put it where the gate looks\n\n`accord/assets/<id>/prototype.html`, with `<id>` the ticket id. That folder is\nthis stage's own; nothing else writes into it.\n\n## 4. Run `accord lint` and fix what it reports\n\nDo not work from memory of the rules — run it, read the reasons, and fix what\nit names.\n\nA finding you disagree with is a question, not a licence: write it into the\nticket's `## Open questions` and stop, rather than working around the rule.\n\n## 5. Re-run the gate\n\n`accord gate ready <id>` is the only thing that says whether the ticket now\nhas what it was missing.\n",
24846
24854
  "shared/scout.md": "---\nkind: reference\n---\n\n# The scout's report\n\nA reply of `accord-scout` that a lane, an answer or an approval rests on is checked by the CLI and saved in the\nticket, so no agent after it searches again.\n\n1. **Check.** Write a new reply, verbatim, to a file outside the working tree. Below it add a `## New files`\n section, one `- <path>` line per file the change creates that you name, since the scout reports only files\n that exist. Run `accord scout check \"<file>\"` on that file, and use the lane numbers it prints when you\n propose a lane. Once the ticket exists, add `--ticket <id>`, for example at intent step 2 and approach\n step 5, so the search leaves out the ticket's own files and listed research records, as it does for the\n saved report; the lane scout runs before any id exists, so it has none.\n2. **Exit 1.** Dispatch a fresh `accord-scout` once with the reply and everything the check printed, asking for\n the same reply corrected in the same form; put the corrected reply in place of the old one in the file you\n checked, keep its `## New files`, and run the check again with the `--ticket <id>` of step 1, when it gave\n one. When it exits 1 again, show the owner what it\n prints and ask whether to accept the report as it is.\n3. **Skipped.** Write a line `skipped: <reason>` into `scout.md` only when no scout ran, or when the owner\n accepts a failing report, the reason then quoting the owner's words. Never write it to get past the check.\n4. **Save.** A checked report is copied to `accord/tickets/<id>/scout.md` only while that file does not exist:\n the reply to another question never replaces a saved report or its `## New files`. For a new request in\n lane S or M, after `accord new ticket` and before you follow the `enter:` or `stop:` line it printed, copy\n the checked file to `<path>/accord/tickets/<id>/scout.md`, run\n `git -C \"<path>\" add -- accord/tickets/<id>/scout.md`, then\n `git -C \"<path>\" commit -m \"<subject>\" -- accord/tickets/<id>/scout.md` (`<subject>` is the line `accord subject scout <id>` prints) and\n `git -C \"<path>\" push -u origin <branch>`. At intent step 2, when `accord/tickets/<id>/scout.md` does not\n exist, copy the checked reply there, add and commit it the same way and run `accord worktree push <id>`;\n when it exists, use the checked reply for your questions and leave `scout.md` as it is.\n5. **Approval.** Before the owner's yes at approach step 5, run\n `accord scout check \"accord/tickets/<id>/scout.md\"`; when that file does not exist, dispatch `accord-scout`\n with the path of `accord/tickets/<id>.md`, asking for the existing files the approach touches, then check its\n reply as steps 1 to 3 say, copy it to `accord/tickets/<id>/scout.md`, run\n `git add -- accord/tickets/<id>/scout.md` and `git commit -m \"<subject>\" -- accord/tickets/<id>/scout.md` (the same `accord subject scout <id>` line),\n then `accord worktree push <id>`, all before the owner's yes; check that reply with `--ticket <id>`. A saved report that fails is corrected in place\n as step 2 says, then committed and pushed the same way before the owner's yes.\n `accord approve <id>` runs the same check on `scout.md` as of the commit that last changed it, or on the\n working tree while the file has uncommitted changes. When `accord approve <id>` exits 1 naming `scout.md`,\n correct the report as steps 2 and 3 say, commit it and run `accord approve <id>` again: the owner's yes\n still holds, since `scout.md` is not among the approved sections.\n6. **Read.** The planner, and every agent after it that needs the ticket's files, starts from\n `accord/tickets/<id>/scout.md`.\n",
24847
- "verify/SKILL.md": "---\nname: accord-verify\ndescription: Use when a lane M ticket's review.md ends with a verdict and the work needs verifying. Runs the full suite, has a fresh verifier write verification.md, builds the owner's report, and runs accord gate done once the owner has approved verified.\nlicense: MIT\nkind: skill\nloads: [verify/ci.md, accord/ids.md, accord/worktree.md, shared/ask.md, shared/failure.md, shared/finish.md]\n---\n\nThis stage checks the built work against the ticket and hands it to the\nowner. You run it in the main session and orchestrate: the verifier\njudges, the owner decides.\n\n## Steps\n\n1. Run `accord anchor`.\n\n2. **Sync and suite.** First commit everything, `review.md` included, so the working tree is clean. Then run `accord\n worktree sync <id>`. It fetches, and when the ticket branch lacks commits of the remote's default branch it takes\n them in the way `git.merge` in `accord/config.yml` sets: a merge commit when the key is absent, a rebase under\n `rebase`, or the team's `git.sync` command, which runs instead. Show its `rebased:`, `rebound:` and `verify again:`\n lines verbatim; on `verify again:` the earlier verification does not hold, so verify it again below. Show a line\n starting `fetch from origin failed` verbatim and go on. When it exits 2 (a conflict it aborted, a failed sync, or a\n refusal), show the message and stop. The owner resolves a conflict, or you do when the owner says so, and then this\n stage starts again. Start CI as `./ci.md` says, then run\n the `tests.full` command from `accord/config.yml` at the commit now checked out, so the report `tests.report` names\n is fresh: that commit is the one verified. Right after it, before the verifier, run `accord tests skipped` and keep\n what it prints.\n\n3. **Verifier.** Dispatch `accord-verifier` in a fresh context with the path of `accord/tickets/<id>.md`. It writes\n `accord/tickets/<id>/verification.md` and nothing else.\n\n4. **Report.** Wait for CI as `./ci.md` says first; a failed check goes to `./failure.md` instead of this report. When\n `./failure.md` runs `accord worktree open`, follow `./worktree.md`. Build the owner's report in chat from\n `verification.md`, the report `tests.report` names, and `accord/tickets/<id>/ledger.md`:\n - one line per criterion: pass or fail, with its evidence (the test and its output, or a screenshot for UI);\n - CI: each check's result, or CI not checked and why;\n - three to five \"try this\" steps that take the owner about two minutes;\n - every Ruling under the ledger's `## Rulings`, ordered by its cost if wrong, highest first;\n - the deferred items under the ledger's `## Deferred`;\n - what was not checked, including every criterion the verifier recorded as `blocked`, every check CI did not check,\n and every test `accord tests skipped` printed, by name, with the operating system it names;\n - slow tests: the slowest cases in the report, with their times.\n\n5. **Owner.** Read `review.mode` in `accord/config.yml` (absent counts as `human`).\n - Under `review: outcome`, after the report, ask the owner one question with two choices, approve or not yet. The\n question names the criteria to tick, the commit verified, and the three values you will write. Only on an\n explicit approve, write `verified:` with those criteria, `verified_hash:` set to the current `ac_hash:`, and\n `verified_commit:` to the commit verified. Silence, an unclear answer, or a yes given before the report is not an\n approve: ask again. `## Verification notes` is not required.\n - Under `review: human` the 0.1.0 human layer stays: a person ticks `verified:` by hand, with the same two values,\n and writes `## Verification notes`. You never write any of them.\n - A `blocked` criterion: show the owner, who decides. A `fail` criterion, or a failure the owner names in answer,\n goes to `./failure.md`, never to `accord-build` directly; it is never ticked past. An answer at step 5 that\n changes the ticket's type follows `./ids.md`.\n\n6. Run `accord gate done <id>` and work from what it prints. Leave `verification.md` and the tick uncommitted until it\n passes; the notice that the review file has no author yet is expected and no reason to commit earlier. When it\n passes, read the ticket's `## Corrections` and the Rulings under the ledger's `## Rulings`. For each one you judge\n to hold across tickets, ask the owner whether it becomes a rule of this repository; on a yes, write it as one rule\n line in `accord/product/conventions.md`. Without the owner's yes, write nothing to `conventions.md`. Then commit\n only `accord/tickets/<id>.md`, `accord/tickets/<id>/verification.md` and, when a rule was written,\n `accord/product/conventions.md`; under `review: outcome` the commit message quotes the owner's answer. When both\n files are already committed and no rule was written, commit nothing. Then finish CI as `./ci.md` says.\n\n7. Report the finish as `./finish.md` says.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- The main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24855
+ "verify/SKILL.md": "---\nname: accord-verify\ndescription: Use when a lane M ticket's review.md ends with a verdict, or its review stage is off, and the work needs verifying. Runs the full suite, has a fresh verifier write verification.md, builds the owner's report, and runs accord gate done once the owner has approved verified.\nlicense: MIT\nargument-hint: \"[ticket id]\"\nkind: skill\nloads: [verify/ci.md, accord/ids.md, accord/worktree.md, shared/ask.md, shared/failure.md, shared/finish.md]\n---\n\nThis stage checks the built work against the ticket and hands it to the\nowner. You run it in the main session and orchestrate: the verifier\njudges, the owner decides.\n\n## Steps\n\n1. Run `accord anchor`.\n\n2. **Sync and suite.** First commit everything, `review.md` included when there is one, so the working tree is clean. Then run `accord\n worktree sync <id>`. It fetches, and when the ticket branch lacks commits of the remote's default branch it takes\n them in the way `git.merge` in `accord/config.yml` sets: a merge commit when the key is absent, a rebase under\n `rebase`, or the team's `git.sync` command, which runs instead. Show its `synced:`, `pushed:`, `rebased:`, `rebound:` and `verify again:`\n lines verbatim; on `verify again:` the earlier verification does not hold, so verify it again below. After `rebased:`\n pairs, retype in `review.md` every round head that is the left side of a pair to its right side, show the owner a\n `plan.md` `baseline:` that is one, commit the retyped heads, and run `accord worktree push <id>`. A line starting\n `push of` is shown verbatim and stops here: the owner decides whether to run the command it prints. Show a line\n starting `fetch from origin failed` verbatim and go on. When it exits 2 (a conflict it aborted, a failed sync, or a\n refusal), show the message and stop. The owner resolves a conflict, or you do when the owner says so, and then this\n stage starts again. Start CI as `./ci.md` says, then run\n the `tests.full` command from `accord/config.yml` at the commit now checked out, so the report `tests.report` names\n is fresh: that commit is the one verified. Right after it, before the verifier, run `accord tests skipped` and keep\n what it prints.\n\n3. **Verifier.** Dispatch `accord-verifier` in a fresh context with the path of `accord/tickets/<id>.md`. It writes\n `accord/tickets/<id>/verification.md` and nothing else.\n\n4. **Report.** Wait for CI as `./ci.md` says first; a failed check goes to `./failure.md` instead of this report. When\n `./failure.md` runs `accord worktree open`, follow `./worktree.md`. Build the owner's report in chat from\n `verification.md`, the report `tests.report` names, and `accord/tickets/<id>/ledger.md`:\n - one line per criterion: pass or fail, with its evidence (the test and its output, or a screenshot for UI);\n - CI: each check's result, or CI not checked and why;\n - three to five \"try this\" steps that take the owner about two minutes;\n - every Ruling under the ledger's `## Rulings`, ordered by its cost if wrong, highest first;\n - the deferred items under the ledger's `## Deferred`;\n - what was not checked, including every criterion the verifier recorded as `blocked`, every check CI did not check,\n and every test `accord tests skipped` printed, by name, with the operating system it names;\n - slow tests: the slowest cases in the report, with their times.\n\n5. **Owner.** Read `review.mode` in `accord/config.yml` (absent counts as `human`).\n - Under `review: outcome`, after the report, ask the owner one question with two choices, approve or not yet. The\n question names the criteria to tick, the commit verified, and the three values you will write. Only on an\n explicit approve, write `verified:` with those criteria, `verified_hash:` set to the current `ac_hash:`, and\n `verified_commit:` to the commit verified. Silence, an unclear answer, or a yes given before the report is not an\n approve: ask again. `## Verification notes` is not required.\n - Under `review: human` the 0.1.0 human layer stays: a person ticks `verified:` by hand, with the same two values,\n and writes `## Verification notes`. You never write any of them.\n - A `blocked` criterion: show the owner, who decides. A `fail` criterion, or a failure the owner names in answer,\n goes to `./failure.md`, never to `accord-build` directly; it is never ticked past. An answer at step 5 that\n changes the ticket's type follows `./ids.md`.\n\n6. Run `accord gate done <id>` and work from what it prints. Leave `verification.md` and the tick uncommitted until it\n passes; the notice that the review file has no author yet is expected and no reason to commit earlier. When it\n passes, read the ticket's `## Corrections` and the Rulings under the ledger's `## Rulings`. For each one you judge\n to hold across tickets, ask the owner whether it becomes a rule of this repository; on a yes, write it as one rule\n line in `accord/product/conventions.md`. Without the owner's yes, write nothing to `conventions.md`. Then commit\n only `accord/tickets/<id>.md`, `accord/tickets/<id>/verification.md` and, when a rule was written,\n `accord/product/conventions.md`; under `review: outcome` the commit message quotes the owner's answer. When both\n files are already committed and no rule was written, commit nothing. Then finish CI as `./ci.md` says.\n\n7. Report the finish as `./finish.md` says.\n\n## Rules\n\n- Every agent receives the ticket verbatim, by file path, never a summary.\n- The main session orchestrates and never edits product code.\n- Anything touching intent, a veto, an acceptance criterion, or a public\n interface stops the run and asks the owner. Every other decision is a\n Ruling in `accord/tickets/<id>/ledger.md` under `## Rulings`:\n `Ruling: <what> — <why> — <cost if wrong>`.\n Read `./ask.md` before any question to the owner.\n",
24848
24856
  "verify/ci.md": "---\nkind: reference\n---\n\n# CI on the pull request\n\nVerify watches the pull request's CI once, while its own checks run. Only\nGitHub Actions on a GitHub pull request is read; anything else is\nreported as CI not checked, with the reason.\n\n## Start: step 2, before the suite\n\n1. Read `git remote get-url origin`. No `origin`, or a host other than\n `github.com`: CI not checked, \"no GitHub remote\"; skip the rest of Start.\n2. Run `gh auth status`, then\n `gh pr list --head <branch> --state open --json number,url`. gh\n missing, not logged in, or unable to reach the repository: CI not\n checked, with gh's message; skip the rest of Start.\n3. Run `git push -u origin <branch>`. A rejected push: CI not checked,\n with git's message; skip the rest of Start. Note `<sha>`, from\n `git rev-parse HEAD`, and the time. A push that changed nothing still\n counts: the runs already on `<sha>` are used.\n4. When that list was empty, run `gh pr create --draft --fill`. A pull\n request already open is left as it is. Never merge it: merging waits\n for the owner.\n\nThen run the suite and the verifier while CI runs.\n\n## Wait: step 4, before the report\n\n- When `accord/tickets/<id>/debug.md` has an open episode (its last\n `## ` heading is not `## Resolved`) and Wait is skipped or ends with\n its checks not checked, the report's not-checked line says \"the fix\n for episode <n> was not seen passing on the other operating system\".\n- When Start was skipped, skip Wait; the report gives Start's reason.\n- When `.github/workflows/` holds no workflow file other than\n `accord.yml`: CI not checked, \"no workflow other than accord's\"; skip\n the rest of Wait.\n- Only runs on `<sha>` count:\n `gh run list --commit <sha> --json databaseId,workflowName,status,conclusion`.\n Leave out the workflow whose `name:` is in `.github/workflows/accord.yml`:\n never wait for it and never send it to debug; step 6's local checks\n stand in for it.\n- Read the list once a minute until a run appears. None within ten\n minutes of the push: CI not checked, \"no check appeared on `<sha>`\n within ten minutes\".\n- Then read it once a minute until every run is `completed`. A run not\n completed thirty minutes after it appeared: CI not checked for it, by\n name, \"still running after thirty minutes\".\n- A check is a job: for each completed run,\n `gh run view <run-id> --json jobs` lists its jobs, and each job is one\n check, named `<workflowName> / <job name>`, with the job's\n `conclusion`. A run with no jobs is one check under its workflow name,\n with the run's `conclusion`.\n- Once every run has finished: `success` passed; `failure`, `timed_out`\n and `startup_failure` failed; any other conclusion, `cancelled` and\n `skipped` among them, is CI not checked for that check, by name, and\n goes to no debug.\n- Any failed check: give the owner one line, \"CI failed on `<sha>`:\n <the failed checks' names>\", show no report, ask for no tick, and\n follow `./failure.md` with the ids of the runs those checks belong to.\n- Every check passed and `accord/tickets/<id>/debug.md` has an open\n episode (its last `## ` heading is not `## Resolved`): append\n `## Resolved` with one line naming `<sha>` and the passing checks, and\n commit `debug.md` alone.\n- Otherwise the report gives each check's name and result.\n\n## Finish: step 6, after the tick is committed\n\n1. When `debug.md` still has an open episode, append `## Resolved`\n with one line, \"the owner's decision: ticked with CI not checked\",\n and commit `debug.md` alone.\n2. Run `accord lint`. `<def>` is the first of `origin/HEAD`,\n `origin/main` and `origin/master` that `git rev-parse --verify -q`\n resolves. For every file `git diff --name-only --no-renames\n --diff-filter=D <def>...HEAD` lists as `accord/tickets/<t>.md` (a\n ticket renamed away is listed too), read its version at `<def>`. It is\n approved or done when its frontmatter has an `approved_hash` key; or a\n `verified` key whose value is not `[]`; or an `ac_hash` key with\n `lane: S`, with no `lane` key, or with a `lane` key whose value is not\n on its key line; a frontmatter it cannot read counts as approved. When\n it is approved or done and its `status` is not `dropped`, show \"<t>: an\n approved or done ticket cannot be deleted before it is dropped -\n restore the file if this is the ticket's own branch, run accord drop\n <t>, merge the pull request of the drop/<t> branch it pushes, merge the\n default branch into this branch and push\"; when it is approved or\n done, its `status` is `dropped` and its `## Dropped` section gives no\n reason it can read, show \"<t>: fix the `## Dropped` reason on the\n default branch\". Then: each such line is a failure: stop, nothing is pushed.\n When no `<def>` resolves, say the deletion check was not run. Run `accord gate done <t>` for every ticket file\n `git diff --name-only --diff-filter=d <def>...HEAD` lists as\n `accord/tickets/<t>.md`; when none resolves, run\n `accord gate done <id>` alone. Any failure: show it and stop; nothing\n is pushed.\n3. Run `git status --porcelain --branch`. When it names an upstream on\n `origin` and `origin` is a GitHub remote: when it shows the branch\n ahead, run `git push`; then, unless\n `gh pr view --json isDraft --jq .isDraft` prints `false`, run\n `gh pr ready`. Do not wait for CI again. This step also finishes a\n session that stopped after the tick commit.\n"
24849
24857
  };
24850
24858
  const options$2 = {
@@ -24857,7 +24865,8 @@ const SPEC_FIELDS = [
24857
24865
  "license",
24858
24866
  "compatibility",
24859
24867
  "metadata",
24860
- "allowed-tools"
24868
+ "allowed-tools",
24869
+ "argument-hint"
24861
24870
  ];
24862
24871
  const MARKER_HEAD = "<!-- generated by accord skills sync - do not edit - ";
24863
24872
  const MARKER_TAIL = " -->";
@@ -30140,7 +30149,10 @@ function resolveKeyPath(dotted) {
30140
30149
  const path = walk(ROOT, segs);
30141
30150
  return path === void 0 || path.length === 0 ? void 0 : path;
30142
30151
  }
30143
- /** A value that starts with `[` or `{` is a YAML flow collection (JSON included); any other value is a plain string, so numerics stay strings. Throws on a flow collection that does not parse. */
30152
+ /**
30153
+ * A value that starts with `[` or `{` is a YAML flow collection (JSON included); any other value is a plain string, quotes and backslashes included, so numerics stay
30154
+ * strings and a command such as `"./my scripts/sync.sh"` is stored as typed (CR-02: the value written is the value given). Throws on a flow collection that does not parse.
30155
+ */
30144
30156
  function parseValue(raw) {
30145
30157
  if (!raw.startsWith("[") && !raw.startsWith("{")) return raw;
30146
30158
  try {
@@ -30414,7 +30426,7 @@ function mergeHooks(existing, entries) {
30414
30426
  //#region package.json
30415
30427
  var package_default = {
30416
30428
  name: "@accord-dev/accord",
30417
- version: "0.5.0",
30429
+ version: "0.5.1",
30418
30430
  type: "module",
30419
30431
  license: "MIT",
30420
30432
  repository: {
@@ -32642,7 +32654,7 @@ function hasLocalChanges(root, path) {
32642
32654
  throw new UsageError("git status failed in " + root);
32643
32655
  }
32644
32656
  }
32645
- const firstLine$2 = (text) => text.trim().split("\n")[0];
32657
+ const firstLine$1 = (text) => text.trim().split("\n")[0];
32646
32658
  const byCodePoint$1 = (a, b) => a < b ? -1 : a > b ? 1 : 0;
32647
32659
  /** A path as `git diff` prints it: a value wrapped in `"` has C-style escapes and three-digit octal bytes; any other is returned as is. */
32648
32660
  function unquoteGitPath(v) {
@@ -32697,7 +32709,7 @@ function gitBranchFact(root, id, opts) {
32697
32709
  } catch (err) {
32698
32710
  if (err.code === "ENOBUFS") throw new Error("the branch diff is larger than 64 MiB", { cause: err });
32699
32711
  const stderr = String(err.stderr ?? "");
32700
- throw new Error(`git ${what} failed reading the branch diff: ${firstLine$2(stderr === "" ? err.message : stderr)}`, { cause: err });
32712
+ throw new Error(`git ${what} failed reading the branch diff: ${firstLine$1(stderr === "" ? err.message : stderr)}`, { cause: err });
32701
32713
  }
32702
32714
  };
32703
32715
  const readFilesAt = (ref, paths) => {
@@ -32705,7 +32717,7 @@ function gitBranchFact(root, id, opts) {
32705
32717
  return gitFilesAt(root, ref, paths);
32706
32718
  } catch (err) {
32707
32719
  const rest = err.message.split("\n").slice(1).join("\n");
32708
- throw new Error(`git cat-file failed reading the branch diff: ${firstLine$2(rest === "" ? err.message : rest)}`, { cause: err });
32720
+ throw new Error(`git cat-file failed reading the branch diff: ${firstLine$1(rest === "" ? err.message : rest)}`, { cause: err });
32709
32721
  }
32710
32722
  };
32711
32723
  try {
@@ -33665,7 +33677,7 @@ function sinceCreated(entries, status) {
33665
33677
  const at = own.findIndex((e) => status(e) === "A");
33666
33678
  return at < 0 ? own : own.slice(0, at + 1);
33667
33679
  }
33668
- function read$2(root, id, walk, headPin, o) {
33680
+ function read$3(root, id, walk, headPin, o) {
33669
33681
  const reviewPath = `accord/tickets/${id}/review.md`;
33670
33682
  const debugPath = `accord/tickets/${id}/debug.md`;
33671
33683
  const chain = [];
@@ -33775,7 +33787,7 @@ function episodesOf(walk, chain, debugEntries, rounds, debugText) {
33775
33787
  /** The record history of one ticket, or the reason git could not be read. */
33776
33788
  function readHistory(root, id, walk, headPin, o) {
33777
33789
  try {
33778
- return read$2(root, id, walk, headPin, o);
33790
+ return read$3(root, id, walk, headPin, o);
33779
33791
  } catch (e) {
33780
33792
  return { error: "git failed reading the record history: " + whyGit$1(e) };
33781
33793
  }
@@ -33876,7 +33888,7 @@ function pinsOf(h) {
33876
33888
  ...h.baseAt === void 0 ? {} : { baseAt: h.baseAt }
33877
33889
  };
33878
33890
  }
33879
- function read$1(root, snapshot, id) {
33891
+ function read$2(root, snapshot, id) {
33880
33892
  const lane = snapshot.tickets[id]?.frontmatter?.lane;
33881
33893
  const rec = snapshot.work?.[id]?.rounds;
33882
33894
  if (lane === void 0 || rec === void 0 || snapshot.git === void 0) return void 0;
@@ -33985,7 +33997,7 @@ function read$1(root, snapshot, id) {
33985
33997
  */
33986
33998
  function roundFactsFor(root, snapshot, id) {
33987
33999
  try {
33988
- return read$1(root, snapshot, id);
34000
+ return read$2(root, snapshot, id);
33989
34001
  } catch (e) {
33990
34002
  if (e instanceof FactError) return { error: e.message };
33991
34003
  return { error: "git failed reading the review rounds: " + whyGit(e) };
@@ -34877,7 +34889,7 @@ function budget(ctx, id) {
34877
34889
  //#region src/commands/config.ts
34878
34890
  const FILE = "accord/config.yml";
34879
34891
  const KEYS = "the keys are in packages/core/schemas/config.schema.json (schemas/config.schema.json in the published @accord-dev/accord-core)";
34880
- function read(ctx, key) {
34892
+ function read$1(ctx, key) {
34881
34893
  const path = resolveKeyPath(key);
34882
34894
  if (path === void 0) throw new UsageError(`no config key ${key} - ${KEYS}`);
34883
34895
  const file = join(ctx.root, "accord", "config.yml");
@@ -35011,7 +35023,7 @@ function report(ctx, key, from, to, consequences, options) {
35011
35023
  return 0;
35012
35024
  }
35013
35025
  function configGet(ctx, key, options) {
35014
- const { path, text } = read(ctx, key);
35026
+ const { path, text } = read$1(ctx, key);
35015
35027
  const value = getConfigValue(text, path);
35016
35028
  ctx.stdout.write(options.json === true ? JSON.stringify({
35017
35029
  key,
@@ -35020,7 +35032,7 @@ function configGet(ctx, key, options) {
35020
35032
  return 0;
35021
35033
  }
35022
35034
  function configSet(ctx, key, raw, options) {
35023
- const { path, file, text } = read(ctx, key);
35035
+ const { path, file, text } = read$1(ctx, key);
35024
35036
  let value;
35025
35037
  try {
35026
35038
  value = parseValue(raw);
@@ -35033,7 +35045,7 @@ function configSet(ctx, key, raw, options) {
35033
35045
  return report(ctx, key, from, value, out.consequences, options);
35034
35046
  }
35035
35047
  function configUnset(ctx, key, options) {
35036
- const { path, file, text } = read(ctx, key);
35048
+ const { path, file, text } = read$1(ctx, key);
35037
35049
  const from = getConfigValue(text, path);
35038
35050
  const out = withConsequences(ctx, path, text, from === void 0 ? text : unsetConfigValue(text, path));
35039
35051
  commit(key, path, file, text, out.text);
@@ -35519,6 +35531,683 @@ function sweepForgotten(dir, fenced) {
35519
35531
  return isGone(dir) ? void 0 : ".";
35520
35532
  }
35521
35533
  //#endregion
35534
+ //#region src/load/script-trust.ts
35535
+ /** Every kind, in the order accord trust shows them. */
35536
+ const SCRIPT_KINDS = ["tracker.command", "git.sync"];
35537
+ const KEEP_FILES_PER_KIND = 4;
35538
+ /** The root-level files an interpreter or a task runner reads from its working directory, bound when the command names no tracked file. */
35539
+ const ROOT_MANIFESTS = [
35540
+ "package.json",
35541
+ "Makefile",
35542
+ "makefile",
35543
+ "GNUmakefile",
35544
+ "justfile",
35545
+ "Justfile",
35546
+ "Taskfile.yml",
35547
+ "Taskfile.yaml",
35548
+ "Rakefile",
35549
+ "pyproject.toml",
35550
+ "Pipfile",
35551
+ "composer.json",
35552
+ "Gemfile",
35553
+ "deno.json",
35554
+ "deno.jsonc",
35555
+ "bunfig.toml",
35556
+ ".npmrc",
35557
+ ".nvmrc",
35558
+ ".tool-versions",
35559
+ "mise.toml",
35560
+ "build.gradle",
35561
+ "pom.xml",
35562
+ "Cargo.toml",
35563
+ "go.mod"
35564
+ ];
35565
+ /**
35566
+ * Round 3 WR-01: a command text or a file name on its way to a terminal. Every control character (C0, DEL, C1) and every invisible format character (bidi overrides,
35567
+ * zero-width marks) and line or paragraph separator is written as `<U+XXXX>`, so a command cannot hide its start behind ESC[2K or reorder what the person reads before
35568
+ * allowing it. Every other character stays as it is. The form has no backslash, because a usage error prints every `\` as `/`.
35569
+ */
35570
+ function shown(text) {
35571
+ return text.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu, (ch) => "<U+" + (ch.codePointAt(0) ?? 0).toString(16).toUpperCase().padStart(4, "0") + ">");
35572
+ }
35573
+ /** `accord-trust.json` inside the repository's common git directory, which all worktrees share and git never tracks. */
35574
+ function trustFile(root) {
35575
+ const known = trustFiles.get(root);
35576
+ if (known !== void 0) return known;
35577
+ const common = execFileSync("git", ["rev-parse", "--git-common-dir"], {
35578
+ cwd: root,
35579
+ encoding: "utf8",
35580
+ stdio: [
35581
+ "ignore",
35582
+ "pipe",
35583
+ "pipe"
35584
+ ]
35585
+ }).trim();
35586
+ const file = join(resolve(root, common), "accord-trust.json");
35587
+ trustFiles.set(root, file);
35588
+ return file;
35589
+ }
35590
+ /** The record path of each root asked about in this process, so one command asks git once. */
35591
+ const trustFiles = /* @__PURE__ */ new Map();
35592
+ /**
35593
+ * The words of a command, shell quotes removed and a quoted run kept whole, so `"./my scripts/sync.sh"` is one word; `starts` holds the index of each word that
35594
+ * begins a command of its own (the first word, and the first after `;`, `&`, `|`, `(`, `)` or a line break).
35595
+ */
35596
+ function words(command) {
35597
+ const out = [];
35598
+ const starts = /* @__PURE__ */ new Set([0]);
35599
+ let word = "";
35600
+ let quote;
35601
+ const flush = () => {
35602
+ if (word !== "") out.push(word);
35603
+ word = "";
35604
+ };
35605
+ for (const ch of command) if (quote !== void 0) {
35606
+ if (ch === quote) quote = void 0;
35607
+ else word += ch;
35608
+ } else if (ch === "\"" || ch === "'") quote = ch;
35609
+ else if (/[;&|()\n\r]/.test(ch)) {
35610
+ flush();
35611
+ starts.add(out.length);
35612
+ } else if (/[\s<>]/.test(ch)) flush();
35613
+ else word += ch;
35614
+ flush();
35615
+ return {
35616
+ ws: out,
35617
+ starts
35618
+ };
35619
+ }
35620
+ /** The programs that run the word after their options as a script or a program of its own: interpreters, shells and the wrappers that start one. */
35621
+ const LAUNCHERS = /^(node|nodejs|deno|bun|tsx|ts-node|python[0-9.]*|py|pypy[0-9.]*|bash|sh|zsh|dash|ksh|fish|pwsh|powershell|ruby|perl|php|env|npx|bunx|pnpx|cross-env|time|nice|nohup|exec|command|call|cmd|start)$/i;
35622
+ /**
35623
+ * Round 4 WR-06 (Ruling R10): the indexes of the words in script position, the only ones a bare word (no `/` or `\`) is tried at with an added extension. A word
35624
+ * is in script position when it starts a command, or is the first word after one in script position that is not an option (`-x`, `/c`) or an assignment
35625
+ * (`A=1`), when that one is the command itself or a launcher (`node`, `bash`, `env`, `npx` ...). So `node tracker` and `env A=1 node tracker` reach `tracker.mjs`,
35626
+ * and the `main` of `--since main` or the `origin main` of `git pull origin main` is matched only as it is written.
35627
+ */
35628
+ function scriptPositions(ws, starts) {
35629
+ const at = /* @__PURE__ */ new Set();
35630
+ let expect = false;
35631
+ let skip = false;
35632
+ ws.forEach((w, i) => {
35633
+ if (starts.has(i)) {
35634
+ at.add(i);
35635
+ expect = true;
35636
+ skip = false;
35637
+ return;
35638
+ }
35639
+ if (!expect || skip) {
35640
+ skip = false;
35641
+ return;
35642
+ }
35643
+ if (w.startsWith("-") || /^\/[a-z?]$/i.test(w) || /^[A-Za-z_][A-Za-z0-9_]*=/.test(w)) {
35644
+ skip = VALUE_OPTIONS.test(w);
35645
+ return;
35646
+ }
35647
+ at.add(i);
35648
+ expect = LAUNCHERS.test((w.split(/[\\/]/).pop() ?? "").replace(/\.(exe|cmd|bat|ps1)$/i, ""));
35649
+ });
35650
+ return at;
35651
+ }
35652
+ /** Round 5 WR-01: the Node options whose value is the next word (`--env-file .env`, `-r dotenv/config`), so that word is not taken for the script. */
35653
+ const VALUE_OPTIONS = /^(-r|--require|--import|--loader|--experimental-loader|--env-file|--env-file-if-exists|-C|--conditions|--input-type|--title|--disable-warning|--inspect-port|--debug-port|--redirect-warnings|--watch-path|--experimental-config-file|--test-reporter|--test-reporter-destination|--test-name-pattern|--test-skip-pattern)$/;
35654
+ /** The extensions tried after a word with none, in the order Node's resolver and the Windows PATHEXT try theirs, then the common script interpreters'. */
35655
+ const EXTENSIONS = [
35656
+ ".js",
35657
+ ".json",
35658
+ ".node",
35659
+ ".mjs",
35660
+ ".cjs",
35661
+ ".ts",
35662
+ ".mts",
35663
+ ".cts",
35664
+ ".cmd",
35665
+ ".bat",
35666
+ ".ps1",
35667
+ ".exe",
35668
+ ".com",
35669
+ ".sh",
35670
+ ".bash",
35671
+ ".py",
35672
+ ".rb",
35673
+ ".pl"
35674
+ ];
35675
+ /** Each package manager and the root files it reads before it runs a package.json script; a name ending in `/` is a directory, bound recursively. */
35676
+ const RUNNERS = {
35677
+ npm: ["package.json", ".npmrc"],
35678
+ pnpm: [
35679
+ "package.json",
35680
+ ".npmrc",
35681
+ "pnpm-workspace.yaml",
35682
+ ".pnpmfile.cjs"
35683
+ ],
35684
+ yarn: [
35685
+ "package.json",
35686
+ ".npmrc",
35687
+ ".yarnrc",
35688
+ ".yarnrc.yml",
35689
+ ".pnp.cjs",
35690
+ ".pnp.loader.mjs",
35691
+ ".yarn/releases/",
35692
+ ".yarn/plugins/"
35693
+ ],
35694
+ bun: ["package.json", "bunfig.toml"]
35695
+ };
35696
+ /** The words after a package manager that run the package.json script named next (`npm run x`, `npm run-script x`); any other word is taken as the script name itself (`yarn x`, `npm test`). */
35697
+ const RUN_WORDS = /* @__PURE__ */ new Set([
35698
+ "run",
35699
+ "run-script",
35700
+ "rum",
35701
+ "urn",
35702
+ "rr"
35703
+ ]);
35704
+ const SCRIPT_ALIASES = {
35705
+ t: "test",
35706
+ tst: "test"
35707
+ };
35708
+ /** How deep a package.json script that runs another one (`"a": "npm run b"`) is followed. */
35709
+ const SCRIPT_DEPTH = 8;
35710
+ /** Owner answer, round 4: the cover is frozen at the forms above, and the output says plainly what it does not check. Printed by `accord trust`, shown and allowing. */
35711
+ const NOT_CHECKED = "accord checks only the files listed above; anything else the command loads is not checked: other runner forms (node --run, npm -w/--workspace, bash -c or sh -c \"...\", node -e, python -m, npm install lifecycle scripts, .npmrc node-options), files outside the listed directories, make or just targets, paths built from environment variables, programs on PATH and node_modules - whoever allows a script must review the pull request that changed it";
35712
+ /**
35713
+ * Round 4 CR-01, WR-03, IN-02 (documented gaps): the forms word `i` starts that run more code than the cover follows. This only names them, so the output does not
35714
+ * read as complete; it binds nothing more (the coverage is frozen).
35715
+ */
35716
+ function unfollowedIn(ws, i, runner) {
35717
+ const base = (ws[i].split(/[\\/]/).pop() ?? "").replace(/\.(exe|cmd|bat|ps1)$/i, "").toLowerCase();
35718
+ const after = ws.slice(i + 1);
35719
+ const has = (re) => after.some((w) => re.test(w));
35720
+ const found = [];
35721
+ if (/^(node|nodejs)$/.test(base) && has(/^--run(=|$)/)) found.push("node --run");
35722
+ if (runner !== void 0 && has(/^(-w|--workspaces?(=.*)?|--prefix(=.*)?|-C|--dir(=.*)?|--filter(=.*)?|-F|--cwd(=.*)?|workspaces?)$/)) found.push("npm -w/--workspace");
35723
+ if (runner !== void 0 && has(/^(install|i|ci|add|rebuild|install-test|it|install-ci-test)$/)) found.push("npm install lifecycle scripts");
35724
+ if (/^(npx|bunx|pnpx)$/.test(base) || runner !== void 0 && has(/^(exec|x|dlx)$/)) found.push("npx");
35725
+ if (/^(bash|sh|zsh|dash|ksh|fish|pwsh|powershell)$/.test(base) && has(/^(-c|-command|-encodedcommand)$/i)) found.push("bash -c");
35726
+ if (base === "cmd" && has(/^\/[ck]$/i)) found.push("bash -c");
35727
+ if (/^(node|nodejs|deno|bun|ruby|perl|php)$/.test(base) && has(/^(-e|--eval(=.*)?|-p|--print(=.*)?|eval)$/)) found.push("node -e");
35728
+ if (/^(python[0-9.]*|py|pypy[0-9.]*)$/.test(base) && has(/^-c$/)) found.push("node -e");
35729
+ if (/^(python[0-9.]*|py|pypy[0-9.]*)$/.test(base) && has(/^-m/)) found.push("python -m");
35730
+ if (/^(make|gmake|just|task|rake|gradle|gradlew|mvn|mvnw)$/.test(base)) found.push("make or just targets");
35731
+ if (/\$|%[A-Za-z_][A-Za-z0-9_]*%/.test(ws[i])) found.push("paths built from environment variables");
35732
+ if (/\s/.test(ws[i])) found.push("bash -c");
35733
+ return found;
35734
+ }
35735
+ /** The package.json of the working tree, when it parses: its scripts and its main. */
35736
+ function packageOf(root) {
35737
+ try {
35738
+ const parsed = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
35739
+ if (typeof parsed !== "object" || parsed === null) return void 0;
35740
+ const { scripts, main } = parsed;
35741
+ return {
35742
+ scripts: typeof scripts === "object" && scripts !== null ? scripts : {},
35743
+ main
35744
+ };
35745
+ } catch {
35746
+ return;
35747
+ }
35748
+ }
35749
+ /** A word as a posix path relative to the root, or undefined when it points outside the repository. */
35750
+ function inside(root, raw) {
35751
+ const rel = relative(root, resolve(root, raw.replaceAll("\\", "/"))).split(sep).join("/");
35752
+ return rel === ".." || rel.startsWith("../") || isAbsolute(rel) ? void 0 : rel;
35753
+ }
35754
+ /**
35755
+ * What the command can run in the repository, from its text and the working tree (see `Cover`). Each path is matched to the tracked files without regard to case,
35756
+ * on every system, because Windows and macOS open `Scripts/x.mjs` as `scripts/x.mjs`.
35757
+ * - A word that is a tracked file, or becomes one with an extension Node, PATHEXT or an interpreter adds (`node scripts/tracker` runs `scripts/tracker.js`), binds the
35758
+ * directory of that file recursively; a file at the repository root binds `./`. A word that is a tracked directory binds that directory.
35759
+ * - `.` (as in `node .`) binds package.json and the main it names (`index` when it names none), resolved the same way.
35760
+ * - npm, pnpm, yarn or bun binds the files that runner reads (package.json, .npmrc and the like) and follows the package.json script it runs, with its `pre` and `post`
35761
+ * scripts, as a command of its own.
35762
+ * - When no word reaches a file of the repository, the root manifests an interpreter or task runner reads from the working directory are bound.
35763
+ * Not covered, and stated as such: a file the script loads from another directory, a make or just target's own scripts, a path built from an environment variable,
35764
+ * and anything outside the repository (a program on PATH, installed dependencies).
35765
+ */
35766
+ function cover(root, command, tracked = gitTracked(root)) {
35767
+ const byLower = /* @__PURE__ */ new Map();
35768
+ for (const f of tracked) byLower.set(f.toLowerCase(), [...byLower.get(f.toLowerCase()) ?? [], f]);
35769
+ const units = /* @__PURE__ */ new Set();
35770
+ let named = false;
35771
+ const files = (rel) => byLower.get(rel.toLowerCase()) ?? [];
35772
+ const directories = (rel) => {
35773
+ const prefix = rel.toLowerCase() + "/";
35774
+ return [...new Set(tracked.filter((f) => f.toLowerCase().startsWith(prefix)).map((f) => f.slice(0, prefix.length)))];
35775
+ };
35776
+ /** Bind what `rel` names as a script or a directory; true when it names something tracked. `probe` adds the extensions (a word in script position, or a path). */
35777
+ const script = (rel, probe = true) => {
35778
+ const hits = [rel, ...probe ? EXTENSIONS.map((e) => rel + e) : []].flatMap(files);
35779
+ for (const f of hits) units.add(f.includes("/") ? f.slice(0, f.lastIndexOf("/") + 1) : "./");
35780
+ const dirs = rel === "" ? [] : directories(rel);
35781
+ for (const d of dirs) units.add(d);
35782
+ return hits.length + dirs.length > 0;
35783
+ };
35784
+ const runnerFiles = (name) => {
35785
+ for (const f of name.endsWith("/") ? directories(name.slice(0, -1)) : files(name)) units.add(f);
35786
+ };
35787
+ const pkg = packageOf(root);
35788
+ const followed = /* @__PURE__ */ new Set();
35789
+ const unfollowed = /* @__PURE__ */ new Set();
35790
+ const visit = (text, depth) => {
35791
+ const { ws, starts } = words(text);
35792
+ const positions = scriptPositions(ws, starts);
35793
+ const scriptNames = /* @__PURE__ */ new Set();
35794
+ ws.forEach((word, i) => {
35795
+ if (scriptNames.has(i)) return;
35796
+ const runner = /^(npm|pnpm|yarn|bun)(\.cmd|\.exe|\.ps1)?$/i.exec(word.split(/[\\/]/).pop() ?? "")?.[1].toLowerCase();
35797
+ for (const u of unfollowedIn(ws, i, runner)) unfollowed.add(u);
35798
+ if (runner !== void 0) {
35799
+ for (const f of RUNNERS[runner]) runnerFiles(f);
35800
+ const rest = ws.map((w, j) => ({
35801
+ w,
35802
+ j
35803
+ })).filter(({ w, j }) => j > i && !w.startsWith("-"));
35804
+ const at = rest[0] !== void 0 && RUN_WORDS.has(rest[0].w) ? 1 : 0;
35805
+ if (at === 1) for (const r of rest.slice(0, 2)) scriptNames.add(r.j);
35806
+ const name = rest[at] === void 0 ? void 0 : at === 1 ? rest[at].w : SCRIPT_ALIASES[rest[at].w] ?? rest[at].w;
35807
+ if (name !== void 0 && depth >= SCRIPT_DEPTH) unfollowed.add(`a package.json script chain deeper than ${SCRIPT_DEPTH}`);
35808
+ if (name !== void 0 && depth < SCRIPT_DEPTH) for (const n of [
35809
+ "pre" + name,
35810
+ name,
35811
+ "post" + name
35812
+ ]) {
35813
+ const body = pkg?.scripts[n];
35814
+ if (typeof body === "string" && !followed.has(n)) {
35815
+ followed.add(n);
35816
+ visit(body, depth + 1);
35817
+ }
35818
+ }
35819
+ }
35820
+ for (const raw of word.includes("=") ? [word, word.slice(word.lastIndexOf("=") + 1)] : [word]) {
35821
+ const rel = inside(root, raw);
35822
+ if (rel === void 0) continue;
35823
+ if (rel === "") {
35824
+ for (const f of files("package.json")) units.add(f);
35825
+ const main = inside(root, typeof pkg?.main === "string" && pkg.main !== "" ? pkg.main : "index");
35826
+ if (main !== void 0 && main !== "" && script(main)) named = true;
35827
+ } else if (script(rel, positions.has(i) || /[\\/]/.test(raw))) named = true;
35828
+ }
35829
+ });
35830
+ };
35831
+ visit(command, 0);
35832
+ if (!named) for (const m of ROOT_MANIFESTS) for (const f of files(m)) units.add(f);
35833
+ const held = /* @__PURE__ */ new Set();
35834
+ for (const u of units) {
35835
+ if (u === "./") {
35836
+ for (const f of tracked) if (!isRecords(f)) held.add(f);
35837
+ }
35838
+ if (u !== "./" && u.endsWith("/")) {
35839
+ for (const f of tracked) if (under(f, u)) held.add(f);
35840
+ }
35841
+ if (!u.endsWith("/")) held.add(u);
35842
+ }
35843
+ return {
35844
+ units: [...units].sort(),
35845
+ files: [...held].sort(),
35846
+ unfollowed: [...unfollowed].sort()
35847
+ };
35848
+ }
35849
+ /** True when the tracked path `f` lies below the directory unit `u` (ending in `/`), compared without regard to case. */
35850
+ function under(f, u) {
35851
+ return f.toLowerCase().startsWith(u.toLowerCase());
35852
+ }
35853
+ /** True for a path under accord/ (the ticket records), whatever the case of the folder's name. */
35854
+ function isRecords(f) {
35855
+ return under(f, "accord/");
35856
+ }
35857
+ /** The units of a cover as one phrase a person reads: `scripts/ (2 files), package.json`, or `no file of the repository`. */
35858
+ function coverText(c) {
35859
+ if (c.units.length === 0) return "no file of the repository";
35860
+ const count = (u) => (u === "./" ? c.files.filter((f) => !isRecords(f)) : c.files.filter((f) => under(f, u))).length;
35861
+ const plural = (n) => `${n} file${n === 1 ? "" : "s"}`;
35862
+ return c.units.map((u) => u === "./" ? `./ (every tracked file outside accord/, ${plural(count(u))})` : u.endsWith("/") ? `${shown(u)} (${plural(count(u))})` : shown(u)).join(", ");
35863
+ }
35864
+ /** git, run in `cwd`, with its output as text; `input` goes to its stdin. */
35865
+ function gitText(cwd, args, input) {
35866
+ return execFileSync("git", args, {
35867
+ cwd,
35868
+ encoding: "utf8",
35869
+ stdio: [
35870
+ "pipe",
35871
+ "pipe",
35872
+ "pipe"
35873
+ ],
35874
+ maxBuffer: 67108864,
35875
+ ...input === void 0 ? {} : { input }
35876
+ });
35877
+ }
35878
+ /** `git ls-files -s -z`, read NUL-separated: every tracked path, sorted, and the id git holds for each one. */
35879
+ function indexEntries(root) {
35880
+ let out;
35881
+ try {
35882
+ out = gitText(root, [
35883
+ "ls-files",
35884
+ "-s",
35885
+ "-z"
35886
+ ]);
35887
+ } catch {
35888
+ throw new UsageError("git ls-files failed in " + root);
35889
+ }
35890
+ const id = /* @__PURE__ */ new Map();
35891
+ const paths = /* @__PURE__ */ new Set();
35892
+ for (const rec of out.split("\0")) {
35893
+ const m = /^(\d+) ([0-9a-f]+) (\d)\t(.*)$/s.exec(rec);
35894
+ if (m === null) continue;
35895
+ paths.add(m[4]);
35896
+ if (m[3] === "0") id.set(m[4], {
35897
+ mode: m[1],
35898
+ oid: m[2]
35899
+ });
35900
+ }
35901
+ return {
35902
+ paths: [...paths].sort(),
35903
+ id
35904
+ };
35905
+ }
35906
+ /**
35907
+ * Round 4 WR-02, WR-06: the content id of each covered file as it is in the working tree (that is what would run), read through git rather than by reading every
35908
+ * file. A file git sees unchanged takes the object id the index holds: the blob of a regular file (a file of any size, with its line endings as git stores
35909
+ * them, so a checkout with `core.autocrlf` digests like one without), the link text of a symlink, the commit of a submodule (gitlink). A file `git diff-files`
35910
+ * reports changed is hashed the way `git add` would store it: a regular file by `git hash-object` (streamed), a symlink by its link text, a checked-out
35911
+ * submodule by the commit it has checked out. `missing` is kept for a path that is not on disk.
35912
+ */
35913
+ function contentIds(root, files, index) {
35914
+ const changed = new Set(gitText(root, [
35915
+ "diff-files",
35916
+ "--name-only",
35917
+ "-z",
35918
+ "--ignore-submodules=none"
35919
+ ]).split("\0"));
35920
+ const ids = {};
35921
+ const hashLater = [];
35922
+ for (const f of files) {
35923
+ const entry = index.id.get(f);
35924
+ const abs = join(root, ...f.split("/"));
35925
+ if (entry?.mode === "160000") {
35926
+ let head = "";
35927
+ try {
35928
+ if (existsSync(join(abs, ".git"))) head = gitText(abs, [
35929
+ "rev-parse",
35930
+ "--verify",
35931
+ "-q",
35932
+ "HEAD"
35933
+ ]).trim();
35934
+ } catch {}
35935
+ ids[f] = head === "" ? entry.oid : head;
35936
+ continue;
35937
+ }
35938
+ if (entry !== void 0 && !changed.has(f)) {
35939
+ ids[f] = entry.oid;
35940
+ continue;
35941
+ }
35942
+ let st;
35943
+ try {
35944
+ st = lstatSync(abs);
35945
+ } catch {
35946
+ ids[f] = "missing";
35947
+ continue;
35948
+ }
35949
+ if (st.isSymbolicLink()) ids[f] = gitText(root, [
35950
+ "hash-object",
35951
+ "--no-filters",
35952
+ "--stdin"
35953
+ ], readlinkSync(abs, { encoding: "buffer" })).trim();
35954
+ else if (st.isFile()) hashLater.push(f);
35955
+ else ids[f] = "missing";
35956
+ }
35957
+ const plain = hashLater.filter((f) => !f.includes("\n") && !f.startsWith("\""));
35958
+ const alone = hashLater.filter((f) => f.includes("\n") || f.startsWith("\""));
35959
+ if (plain.length > 0) {
35960
+ const out = gitText(root, ["hash-object", "--stdin-paths"], plain.join("\n") + "\n").trim().split("\n");
35961
+ plain.forEach((f, i) => ids[f] = out[i]);
35962
+ }
35963
+ for (const f of alone) ids[f] = gitText(root, [
35964
+ "hash-object",
35965
+ "--",
35966
+ f
35967
+ ]).trim();
35968
+ return ids;
35969
+ }
35970
+ /** The digest of the command text and of each covered file's content id, in path order. */
35971
+ function digestOf(command, files, ids) {
35972
+ const hash = createHash("sha256");
35973
+ hash.update("command\0" + command + "\n");
35974
+ for (const f of files) hash.update(f + "\0" + ids[f] + "\n");
35975
+ return "sha256:" + hash.digest("hex");
35976
+ }
35977
+ /** One digest of the command text and of every file it reaches, as they are in the working tree (that is what would run), with each file's own content id. */
35978
+ function scriptDigest(root, command) {
35979
+ const index = indexEntries(root);
35980
+ const { units, files, unfollowed } = cover(root, command, index.paths);
35981
+ const hashes = contentIds(root, files, index);
35982
+ return {
35983
+ digest: digestOf(command, files, hashes),
35984
+ hashes,
35985
+ units,
35986
+ files,
35987
+ unfollowed
35988
+ };
35989
+ }
35990
+ /** One allow as read from disk: a known kind, a command and a digest as strings, and `files`, when present, a plain map of strings. */
35991
+ function isAllow(a) {
35992
+ if (typeof a !== "object" || a === null || Array.isArray(a)) return false;
35993
+ const { kind, command, digest, files, allowedAt } = a;
35994
+ if (!SCRIPT_KINDS.includes(kind) || typeof command !== "string" || typeof digest !== "string") return false;
35995
+ if (allowedAt !== void 0 && typeof allowedAt !== "string") return false;
35996
+ if (files === void 0) return true;
35997
+ return typeof files === "object" && files !== null && !Array.isArray(files) && Object.values(files).every((v) => typeof v === "string");
35998
+ }
35999
+ /**
36000
+ * The record as it is on disk, and what of it was not read: `ignored` counts the entries that are not a valid allow (round 4 IN-01: a hand edit or a bad write is
36001
+ * read as no allow, never a crash), `unreadable` is true when the file is there but is not a version-2 record at all.
36002
+ */
36003
+ function readRecord(root) {
36004
+ let text;
36005
+ try {
36006
+ text = readFileSync(trustFile(root), "utf8");
36007
+ } catch {
36008
+ return {
36009
+ record: {
36010
+ version: 2,
36011
+ allows: []
36012
+ },
36013
+ ignored: 0,
36014
+ unreadable: false
36015
+ };
36016
+ }
36017
+ try {
36018
+ const parsed = JSON.parse(text);
36019
+ if (typeof parsed === "object" && parsed !== null && parsed.version === 2 && Array.isArray(parsed.allows)) {
36020
+ const all = parsed.allows;
36021
+ const allows = all.filter(isAllow);
36022
+ return {
36023
+ record: {
36024
+ version: 2,
36025
+ allows
36026
+ },
36027
+ ignored: all.length - allows.length,
36028
+ unreadable: false
36029
+ };
36030
+ }
36031
+ } catch {}
36032
+ return {
36033
+ record: {
36034
+ version: 2,
36035
+ allows: []
36036
+ },
36037
+ ignored: 0,
36038
+ unreadable: true
36039
+ };
36040
+ }
36041
+ function read(root) {
36042
+ return readRecord(root).record;
36043
+ }
36044
+ /** The warning to print when the record holds entries accord could not read, or is not a record at all; undefined when it reads whole. */
36045
+ function recordWarning(root) {
36046
+ const { ignored, unreadable } = readRecord(root);
36047
+ const file = shown(trustFile(root).replaceAll("\\", "/"));
36048
+ if (unreadable) return `warning: ${file} is not a trust record accord can read, so it is read as no allow; the next accord trust allow writes it again`;
36049
+ if (ignored > 0) return `warning: ${file}: ${ignored} ${ignored === 1 ? "entry is" : "entries are"} not a valid allow and ${ignored === 1 ? "was" : "were"} ignored`;
36050
+ }
36051
+ /** How long a writer waits for the record lock, and the age past which a lock a killed process left behind is taken over. */
36052
+ const LOCK_WAIT_MS = 15e3;
36053
+ const LOCK_STALE_MS = 6e4;
36054
+ /**
36055
+ * Round 4 IN-01: run `change` on the record as it is on disk now, under an exclusive lock file beside it, and write what it returns (or remove the record for
36056
+ * `'remove'`). Every writer reads the record again inside the lock, so two allows in parallel worktrees both land and an allow made while a revoke ran never
36057
+ * brings back what the revoke withdrew.
36058
+ */
36059
+ function update(root, change) {
36060
+ const file = trustFile(root);
36061
+ const lock = file + ".lock";
36062
+ const until = Date.now() + LOCK_WAIT_MS;
36063
+ for (;;) try {
36064
+ closeSync(openSync(lock, "wx"));
36065
+ break;
36066
+ } catch (e) {
36067
+ const code = e.code;
36068
+ if (code !== "EEXIST" && code !== "EPERM" && code !== "EBUSY") throw e;
36069
+ let age = -1;
36070
+ try {
36071
+ age = Date.now() - statSync(lock).mtimeMs;
36072
+ } catch {}
36073
+ if (age > LOCK_STALE_MS) {
36074
+ rmSync(lock, { force: true });
36075
+ continue;
36076
+ }
36077
+ if (Date.now() > until) {
36078
+ if (age < 0) throw e;
36079
+ throw new UsageError(`another accord trust is writing the trust record (its lock ${shown(lock.replaceAll("\\", "/"))} is held) - nothing was changed; run it again, or remove that file if no accord trust is running`);
36080
+ }
36081
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 50);
36082
+ }
36083
+ try {
36084
+ const next = change(read(root));
36085
+ if (next === "remove") rmSync(file, { force: true });
36086
+ else write(file, next);
36087
+ } finally {
36088
+ rmSync(lock, { force: true });
36089
+ }
36090
+ }
36091
+ /** Write the record whole through a file beside it and a rename, so a reader never sees half of it; the temporary file is removed when the write fails. */
36092
+ function write(file, record) {
36093
+ const part = `${file}.${process.pid}.tmp`;
36094
+ try {
36095
+ writeFileSync(part, JSON.stringify(record, null, 2) + "\n");
36096
+ renameSync(part, file);
36097
+ } catch (e) {
36098
+ rmSync(part, { force: true });
36099
+ throw e;
36100
+ }
36101
+ }
36102
+ /** The files added, removed or edited between an allow's hashes and the ones now, sorted. */
36103
+ function changedFiles(was, now) {
36104
+ if (was === void 0) return [];
36105
+ return [.../* @__PURE__ */ new Set([...Object.keys(was), ...Object.keys(now)])].filter((f) => was[f] !== now[f]).sort();
36106
+ }
36107
+ /** How `command` stands, for `kind`, in the working tree at `root`. */
36108
+ function inspect(root, kind, command, hash = "always") {
36109
+ const mine = read(root).allows.filter((a) => a.kind === kind);
36110
+ const same = mine.filter((a) => a.command === command);
36111
+ if (hash === "if-allowed" && same.length === 0) return {
36112
+ kind,
36113
+ command,
36114
+ ...cover(root, command),
36115
+ digest: void 0,
36116
+ hashes: {},
36117
+ state: mine.length === 0 ? "never" : "other-command",
36118
+ changed: []
36119
+ };
36120
+ const now = scriptDigest(root, command);
36121
+ const state = mine.length === 0 ? "never" : same.length === 0 ? "other-command" : same.some((a) => a.digest === now.digest) ? "allowed" : "changed";
36122
+ const last = [...same].reverse().find((a) => a.files !== void 0);
36123
+ return {
36124
+ kind,
36125
+ command,
36126
+ ...now,
36127
+ state,
36128
+ changed: state === "changed" ? changedFiles(last?.files, now.hashes) : []
36129
+ };
36130
+ }
36131
+ /** The short form of a digest that accord trust shows and `accord trust <script>@<digest>` takes: its first 16 hex characters (64 bits). */
36132
+ function shortDigest(digest) {
36133
+ return (digest ?? "").replace(/^sha256:/, "").slice(0, 16);
36134
+ }
36135
+ /** A list of paths for one line: the first `max`, then how many more. */
36136
+ function listed(paths, max) {
36137
+ return paths.slice(0, max).map(shown).join(", ") + (paths.length > max ? ` and ${paths.length - max} more` : "");
36138
+ }
36139
+ /**
36140
+ * Why `command` may not run, as one line, or undefined when the person allowed exactly this command and exactly these files. The line names the command, why
36141
+ * it did not run (and which covered files changed, when an allow of this command exists), what an allow covers, and the commands that show and allow it.
36142
+ */
36143
+ function scriptRefusal(root, kind, command) {
36144
+ const i = inspect(root, kind, command, "if-allowed");
36145
+ if (i.state === "allowed") return void 0;
36146
+ const why = i.state === "never" ? "has not been allowed in this repository" : i.state === "other-command" ? "is not the command that was allowed" : `or the files it reaches changed since it was allowed${i.changed.length === 0 ? "" : ` (changed: ${listed(i.changed, 5)})`}`;
36147
+ return `${kind} "${shown(command)}" ${why}, so it was not run; an allow covers ${coverText(i)} only, and no other file the command loads is checked${i.unfollowed.length === 0 ? "" : ` (not followed here: ${i.unfollowed.join(", ")})`}; run accord trust in "${shown(root.replaceAll("\\", "/"))}" to see it, then accord trust ${kind}@<the digest it shows> there to allow it (accord trust --revoke withdraws every allow)`;
36148
+ }
36149
+ /**
36150
+ * Record an allow for each script beside the allows already held (the same binding allowed again moves to the newest place); a kind keeps its newest
36151
+ * `KEEP_PER_KIND` allows, and only the newest `KEEP_FILES_PER_KIND` keep their per-file hashes. Returns each script as it stood just before, for the person to read.
36152
+ */
36153
+ function allowScripts(root, scripts) {
36154
+ const seen = scripts.map((s) => inspect(root, s.kind, s.command));
36155
+ if (seen.length === 0) return [];
36156
+ for (const [n, s] of scripts.entries()) {
36157
+ const now = (seen[n].digest ?? "").replace(/^sha256:/, "");
36158
+ if (s.digest !== void 0 && !now.startsWith(s.digest)) throw new UsageError(`${s.kind} "${shown(s.command)}" changed since accord trust showed it (digest ${s.digest.slice(0, 16)} is not what it covers now) - nothing was allowed; run accord trust again and read what it shows`);
36159
+ }
36160
+ const allowedAt = (/* @__PURE__ */ new Date()).toISOString();
36161
+ update(root, (record) => {
36162
+ let allows = record.allows;
36163
+ for (const i of seen) {
36164
+ const digest = i.digest ?? "";
36165
+ allows = [...allows.filter((a) => !(a.kind === i.kind && a.command === i.command && a.digest === digest)), {
36166
+ kind: i.kind,
36167
+ command: i.command,
36168
+ digest,
36169
+ files: i.hashes,
36170
+ allowedAt
36171
+ }];
36172
+ }
36173
+ return {
36174
+ version: 2,
36175
+ allows: SCRIPT_KINDS.flatMap((k) => {
36176
+ const mine = allows.filter((a) => a.kind === k).slice(-16);
36177
+ return mine.map((a, n) => n < mine.length - KEEP_FILES_PER_KIND ? {
36178
+ kind: a.kind,
36179
+ command: a.command,
36180
+ digest: a.digest,
36181
+ allowedAt: a.allowedAt
36182
+ } : a);
36183
+ })
36184
+ };
36185
+ });
36186
+ return seen.map((i) => ({
36187
+ kind: i.kind,
36188
+ command: i.command,
36189
+ digest: i.digest,
36190
+ state: i.state,
36191
+ changed: i.changed,
36192
+ units: i.units,
36193
+ files: i.files,
36194
+ unfollowed: i.unfollowed
36195
+ }));
36196
+ }
36197
+ /** Withdraw the allows of the kinds named, or of every kind when none is named; returns the kinds that were allowed and are not any more. */
36198
+ function revokeScripts(root, kinds = []) {
36199
+ let gone = [];
36200
+ update(root, (record) => {
36201
+ const had = SCRIPT_KINDS.filter((k) => record.allows.some((a) => a.kind === k));
36202
+ gone = kinds.length === 0 ? had : had.filter((k) => kinds.includes(k));
36203
+ return kinds.length === 0 ? "remove" : {
36204
+ version: 2,
36205
+ allows: record.allows.filter((a) => !gone.includes(a.kind))
36206
+ };
36207
+ });
36208
+ return gone;
36209
+ }
36210
+ //#endregion
35522
36211
  //#region src/load/team-run.ts
35523
36212
  /**
35524
36213
  * The runner, as the source of a worker thread (a CommonJS script, run with `eval: true`, so no second file has to be bundled).
@@ -35526,6 +36215,9 @@ function sweepForgotten(dir, fenced) {
35526
36215
  * worktree. The worker starts the shell with the event loop `spawnSync` lacks, so on a timeout or oversize output it can kill the
35527
36216
  * whole process tree first (`taskkill /T /F` on Windows; on POSIX the shell leads its own process group and the group is killed),
35528
36217
  * wait until the output pipes close, and only then report - the caller removes the folder the moment `runTeamCommand` returns.
36218
+ * The POSIX group is also out of the terminal's reach, and the caller blocks in `Atomics.wait` where no signal handler can run, so Ctrl-C
36219
+ * or a kill of accord would leave the script running. A guard process in a session of its own holds a pipe the worker keeps open: a normal
36220
+ * end writes a line to it and the guard leaves; the pipe closing any other way (accord gone) makes the guard kill the script's group.
35529
36221
  */
35530
36222
  const RUNNER = String.raw`
35531
36223
  const { workerData } = require('node:worker_threads');
@@ -35537,16 +36229,36 @@ const size = { stdout: 0, stderr: 0 };
35537
36229
  let timedOut = false;
35538
36230
  let oversize = false;
35539
36231
  let child;
36232
+ let guard;
35540
36233
  let timer;
35541
36234
  let settled = false;
35542
36235
 
36236
+ /** Tells the guard the command ended normally, so it leaves the group alone, and waits until the line is written: a closed pipe is the signal to kill. */
36237
+ function release(next) {
36238
+ const g = guard;
36239
+ guard = undefined;
36240
+ if (!g) return next();
36241
+ let called = false;
36242
+ const go = () => {
36243
+ if (called) return;
36244
+ called = true;
36245
+ clearTimeout(wait);
36246
+ next();
36247
+ };
36248
+ const wait = setTimeout(go, 2000);
36249
+ g.stdio[3].on('error', go);
36250
+ g.stdio[3].end('\n', go);
36251
+ }
36252
+
35543
36253
  function done(result) {
35544
36254
  if (settled) return;
35545
36255
  settled = true;
35546
36256
  clearTimeout(timer);
35547
- port.postMessage(result);
35548
- Atomics.store(flag, 0, 1);
35549
- Atomics.notify(flag, 0);
36257
+ release(() => {
36258
+ port.postMessage(result);
36259
+ Atomics.store(flag, 0, 1);
36260
+ Atomics.notify(flag, 0);
36261
+ });
35550
36262
  }
35551
36263
 
35552
36264
  function finish(code, signal, error) {
@@ -35601,6 +36313,12 @@ function take(name, chunk) {
35601
36313
 
35602
36314
  try {
35603
36315
  child = spawn(command, { cwd, env, shell: true, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true, detached: !win });
36316
+ if (!win && child.pid !== undefined) {
36317
+ guard = spawn('/bin/sh', ['-c', 'read -r _ <&3 && exit 0; kill -s KILL "-$1" 2>/dev/null || kill -s KILL -- "-$1"', 'guard', String(child.pid)], { detached: true, stdio: ['ignore', 'ignore', 'ignore', 'pipe'] });
36318
+ guard.on('error', () => {});
36319
+ guard.stdio[3].on('error', () => {});
36320
+ guard.unref();
36321
+ }
35604
36322
  child.stdout.on('data', (c) => take('stdout', c));
35605
36323
  child.stderr.on('data', (c) => take('stderr', c));
35606
36324
  child.stdin.on('error', () => {});
@@ -35892,7 +36610,7 @@ function recordQuietly(ctx, id, path) {
35892
36610
  try {
35893
36611
  recordWorktree(ctx.root, id, path);
35894
36612
  } catch (e) {
35895
- ctx.stdout.write(`note ${id}: the worktree ${path} was not recorded: ${firstLine$1(e instanceof UsageError ? e.message : e)}\n`);
36613
+ ctx.stdout.write(`note ${id}: the worktree ${path} was not recorded: ${firstLine(e instanceof UsageError ? e.message : e)}\n`);
35896
36614
  }
35897
36615
  }
35898
36616
  /** The holds file read without the lock (writes are a rename), so the works rule writes nothing. */
@@ -36352,7 +37070,7 @@ function backfillRuleset(ctx, id, path, ref) {
36352
37070
  "--",
36353
37071
  rel
36354
37072
  ]);
36355
- ctx.stdout.write(`ruleset: ${id} could not be backfilled: ${firstLine$1(e instanceof UsageError ? e.message.split("\n").slice(-1)[0] : e)}\n`);
37073
+ ctx.stdout.write(`ruleset: ${id} could not be backfilled: ${firstLine(e instanceof UsageError ? e.message.split("\n").slice(-1)[0] : e)}\n`);
36356
37074
  return;
36357
37075
  }
36358
37076
  }
@@ -36438,7 +37156,7 @@ function gitNoPrompt(cwd, args, timeout, seen) {
36438
37156
  }
36439
37157
  });
36440
37158
  }
36441
- const firstLine$1 = (e) => String(e.stderr ?? e).trim().split("\n")[0];
37159
+ const firstLine = (e) => String(e.stderr ?? e).trim().split("\n")[0];
36442
37160
  /** ST-LN-30 D-01, D-06: fetch origin so a branch is cut and a claim judged from the latest refs; a failed fetch prints one line and the work goes on. */
36443
37161
  function fetchOrigin(ctx, known) {
36444
37162
  const finished = () => {
@@ -36467,7 +37185,7 @@ function fetchOrigin(ctx, known) {
36467
37185
  "origin"
36468
37186
  ], ms, ctx.ssh);
36469
37187
  } catch (e) {
36470
- const why = e.code === "ETIMEDOUT" ? `no answer within ${ms / 1e3} seconds` : firstLine$1(e);
37188
+ const why = e.code === "ETIMEDOUT" ? `no answer within ${ms / 1e3} seconds` : firstLine(e);
36471
37189
  ctx.stdout.write(`fetch from origin failed, going on with the refs already in this clone: ${why}\n`);
36472
37190
  return {
36473
37191
  ctx: finished(),
@@ -36549,7 +37267,7 @@ function syncDefault(root, ref, branch, strategy, again, team) {
36549
37267
  "MERGE_HEAD"
36550
37268
  ])) git$1(root, ["merge", "--abort"]);
36551
37269
  if (files.length > 0) throw new UsageError(`merge of ${def} into ${branch} stopped on a conflict in ${files.join(", ")} - the merge was aborted and ${branch} is as it was; ${again.conflict}`);
36552
- throw new UsageError(`merge of ${def} into ${branch} failed: ${firstLine$1(e)} - ${branch} is as it was`);
37270
+ throw new UsageError(`merge of ${def} into ${branch} failed: ${firstLine(e)} - ${branch} is as it was`);
36553
37271
  }
36554
37272
  return { rebased: [] };
36555
37273
  }
@@ -36582,7 +37300,7 @@ function syncDefault(root, ref, branch, strategy, again, team) {
36582
37300
  n
36583
37301
  ]).trim())).some((d) => existsSync(d))) git$1(root, ["rebase", "--abort"]);
36584
37302
  if (files.length > 0) throw new UsageError(`rebase of ${def} into ${branch} stopped on a conflict in ${files.join(", ")} - the rebase was aborted and ${branch} is as it was; ${again.conflict}`);
36585
- throw new UsageError(`rebase of ${def} into ${branch} failed: ${firstLine$1(e)} - ${branch} is as it was`);
37303
+ throw new UsageError(`rebase of ${def} into ${branch} failed: ${firstLine(e)} - ${branch} is as it was`);
36586
37304
  }
36587
37305
  const pairs = [];
36588
37306
  const diff = git$1(root, [
@@ -36608,6 +37326,8 @@ const TEAM_SYNC_MAX_BUFFER = 67108864;
36608
37326
  * quoted in the refusal, never read as a verdict. The ignored-file clash check is not made: accord cannot know what a team script writes.
36609
37327
  */
36610
37328
  function runTeamSync(root, ref, branch, team) {
37329
+ const refusal = scriptRefusal(root, "git.sync", team.command);
37330
+ if (refusal !== void 0) throw new UsageError(`${refusal} - ${branch} was not pushed`);
36611
37331
  const r = runTeamCommand(team.command, {
36612
37332
  cwd: root,
36613
37333
  env: {
@@ -36644,7 +37364,7 @@ function runTeamSync(root, ref, branch, team) {
36644
37364
  if (why === void 0) return;
36645
37365
  const text = (r.stderr.trim() !== "" ? r.stderr : r.stdout).trim();
36646
37366
  const tail = text === "" ? "" : " - " + text.split("\n").slice(-20).map((l) => l.trimEnd()).join(" / ");
36647
- throw new UsageError(`git.sync "${team.command}" ${why}${tail} - ${branch} was not pushed`);
37367
+ throw new UsageError(`git.sync "${shown(team.command)}" ${why}${tail} - ${branch} was not pushed`);
36648
37368
  }
36649
37369
  /**
36650
37370
  * ST-LN-96 D-03, D-14: the push after a sync that may have rewritten the branch. `rebase` pushes with the lease when origin already holds the branch;
@@ -36684,10 +37404,18 @@ function pushAfterSync(ctx, root, branch, how, unpublished) {
36684
37404
  return {
36685
37405
  pushed: false,
36686
37406
  lease,
36687
- why: String(e.stderr ?? "").split("\n").map((l) => l.trim()).find((l) => /^(!|error:|fatal:|remote:)/.test(l)) ?? firstLine$1(e)
37407
+ why: String(e.stderr ?? "").split("\n").map((l) => l.trim()).find((l) => /^(!|error:|fatal:|remote:)/.test(l)) ?? firstLine(e)
36688
37408
  };
36689
37409
  }
36690
37410
  }
37411
+ /** The accord/config.yml of the worktree at `path` as it is on disk, or undefined when it is missing or does not load (then the caller keeps its own). */
37412
+ function worktreeConfigOf(path) {
37413
+ try {
37414
+ return loadConfig("accord/config.yml", readFileSync(path + "/accord/config.yml", "utf8")).config;
37415
+ } catch {
37416
+ return;
37417
+ }
37418
+ }
36691
37419
  /** ST-LN-25 D-01, D-09: Continue merges the fetched default branch into a ticket branch that is behind and still before verify, then runs setup and pushes; any doubt leaves the branch alone and prints the behind line. */
36692
37420
  function continueMerge(ctx, id, path, branch) {
36693
37421
  const ref = gitDefaultRef(ctx.root);
@@ -36700,9 +37428,21 @@ function continueMerge(ctx, id, path, branch) {
36700
37428
  if (n === 0) return;
36701
37429
  const def = ref.replace("refs/remotes/", "");
36702
37430
  const strategy = ctx.snapshot.config?.git?.merge;
36703
- const sync = ctx.snapshot.config?.git?.sync;
36704
- const way = sync !== void 0 ? `sync them with git.sync, the team command (accord worktree sync ${id} runs it)` : strategy === "rebase" ? `rebase onto it with accord worktree sync ${id}` : `merge them with git merge ${def}`;
36705
- const behind = () => void ctx.stdout.write(`behind: ${branch} is ${n} commit${n === 1 ? "" : "s"} behind ${def}; ${way}\n`);
37431
+ const ticketConfig = worktreeConfigOf(path);
37432
+ const sync = ticketConfig === void 0 ? ctx.snapshot.config?.git?.sync : ticketConfig.git?.sync;
37433
+ const stageOf = () => statusRows(snapshotAt(ctx.root, "refs/heads/" + branch, [id])).find((r) => r.id === id)?.stage;
37434
+ const syncRuns = () => {
37435
+ const at = stageOf();
37436
+ return at === "verify" || at === "done" && strategy === "rebase" && sync === void 0;
37437
+ };
37438
+ const way = () => {
37439
+ if (sync !== void 0) return syncRuns() ? `sync them with git.sync, the team command (accord worktree sync ${id} runs it)` : `sync them with git.sync, the team command, which accord worktree sync ${id} runs at verify`;
37440
+ if (strategy === "rebase") return syncRuns() ? `rebase onto it with accord worktree sync ${id}` : `rebase onto it, which accord worktree sync ${id} does at verify`;
37441
+ return `merge them with git merge ${def}`;
37442
+ };
37443
+ const unallowed = sync !== void 0 && scriptRefusal(path, "git.sync", sync) !== void 0;
37444
+ const unallowedHint = `; git.sync is not allowed to run here yet - run accord trust in ${`"${shown(path.replaceAll("\\", "/"))}"`} to see what it covers, then accord trust git.sync@<the digest it shows> there`;
37445
+ const behind = () => void ctx.stdout.write(`behind: ${branch} is ${n} commit${n === 1 ? "" : "s"} behind ${def}; ${way()}${unallowed ? unallowedHint : ""}\n`);
36706
37446
  const own = "refs/remotes/origin/" + branch;
36707
37447
  if (gitOk(path, [
36708
37448
  "rev-parse",
@@ -36715,7 +37455,8 @@ function continueMerge(ctx, id, path, branch) {
36715
37455
  own,
36716
37456
  "HEAD"
36717
37457
  ])) return behind();
36718
- const stage = statusRows(snapshotAt(ctx.root, "refs/heads/" + branch, [id])).find((r) => r.id === id)?.stage;
37458
+ if (unallowed) return behind();
37459
+ const stage = stageOf();
36719
37460
  if (stage === void 0 || ![
36720
37461
  "intent",
36721
37462
  "plan",
@@ -36785,7 +37526,7 @@ function worktreePush(ctx, id, o = {}) {
36785
37526
  const hits = gitUnpushedCommits(ctx.root, branch).flatMap((c) => forbiddenLines(c.message).map((l) => trailerReason(c.sha, l)));
36786
37527
  if (hits.length > 0) return kept(`${hits.join("\n")}\nreword each commit named above to drop that line (it is not on origin yet), then run accord worktree push ${id} again`);
36787
37528
  } catch (e) {
36788
- return kept(e instanceof UsageError ? e.message : firstLine$1(e));
37529
+ return kept(e instanceof UsageError ? e.message : firstLine(e));
36789
37530
  }
36790
37531
  try {
36791
37532
  const force = o.lease === true ? ["--force-with-lease", "--force-if-includes"] : [];
@@ -36874,7 +37615,7 @@ function rebindAfterRebase(ctx, id, root) {
36874
37615
  "--",
36875
37616
  ...rels
36876
37617
  ]);
36877
- say(`verify again: ${id}'s verification could not be re-bound: ${firstLine$1(e instanceof UsageError ? e.message.split("\n").slice(-1)[0] : e)}`);
37618
+ say(`verify again: ${id}'s verification could not be re-bound: ${firstLine(e instanceof UsageError ? e.message.split("\n").slice(-1)[0] : e)}`);
36878
37619
  return;
36879
37620
  }
36880
37621
  for (const t of todo) {
@@ -36899,6 +37640,9 @@ function worktreeSync(ctx, id) {
36899
37640
  const stage = statusRows(ctx.snapshot).find((r) => r.id === id)?.stage;
36900
37641
  const builtInRebase = ctx.snapshot.config?.git?.merge === "rebase" && ctx.snapshot.config?.git?.sync === void 0;
36901
37642
  if (stage !== "verify" && !(stage === "done" && builtInRebase)) throw new UsageError(`${id} is at stage ${stage ?? "none"}, and accord worktree sync runs only at verify, after review - nothing was merged`);
37643
+ const declared = ctx.snapshot.config?.git?.sync;
37644
+ const refusal = declared === void 0 ? void 0 : scriptRefusal(ctx.root, "git.sync", declared);
37645
+ if (refusal !== void 0) throw new UsageError(`${refusal} - nothing was synced`);
36902
37646
  if (!gitOk(ctx.root, [
36903
37647
  "remote",
36904
37648
  "get-url",
@@ -36960,7 +37704,7 @@ function pruneStale(ctx) {
36960
37704
  "origin"
36961
37705
  ], void 0, ctx.ssh);
36962
37706
  } catch (e) {
36963
- ctx.stdout.write(`prune of origin failed: ${firstLine$1(e)}
37707
+ ctx.stdout.write(`prune of origin failed: ${firstLine(e)}
36964
37708
  `);
36965
37709
  }
36966
37710
  const left = new Set(refs());
@@ -37106,7 +37850,7 @@ function guardHolds(ctx, s, path, say = (t) => void ctx.stdout.write(t + "\n"))
37106
37850
  if (s.holds === void 0 && s.holdsError === void 0) try {
37107
37851
  withHolds(ctx.root, (h) => (s.holds = h, void 0));
37108
37852
  } catch (e) {
37109
- s.holdsError = firstLine$1(e instanceof UsageError ? e.message : e);
37853
+ s.holdsError = firstLine(e instanceof UsageError ? e.message : e);
37110
37854
  }
37111
37855
  if (s.holds === void 0) {
37112
37856
  say(`kept ${path}: its hold could not be read: ${s.holdsError}`);
@@ -37153,7 +37897,7 @@ function removeWorktree(ctx, w, id, h, seen) {
37153
37897
  ]
37154
37898
  });
37155
37899
  } catch (e) {
37156
- failure = firstLine$1(e);
37900
+ failure = firstLine(e);
37157
37901
  }
37158
37902
  if (seen !== void 0) seen.list = void 0;
37159
37903
  const listed = failure !== void 0 && readList(ctx, seen).some((x) => x.path === w.path);
@@ -37166,14 +37910,14 @@ function removeWorktree(ctx, w, id, h, seen) {
37166
37910
  if (left === void 0) try {
37167
37911
  dropRecorded(ctx.root, w.path);
37168
37912
  } catch (e) {
37169
- ctx.stdout.write(`note ${id}: the record of the removed worktree could not be updated: ${firstLine$1(e instanceof UsageError ? e.message : e)}\n`);
37913
+ ctx.stdout.write(`note ${id}: the record of the removed worktree could not be updated: ${firstLine(e instanceof UsageError ? e.message : e)}\n`);
37170
37914
  }
37171
37915
  }
37172
37916
  const gone = !listed;
37173
37917
  if (gone && h !== void 0) try {
37174
37918
  withHolds(ctx.root, (all) => Object.hasOwn(all, id) ? Object.fromEntries(Object.entries(all).filter(([k]) => k !== id)) : void 0);
37175
37919
  } catch (e) {
37176
- ctx.stdout.write(`note ${id}: the hold of the removed worktree could not be dropped: ${firstLine$1(e instanceof UsageError ? e.message : e)}
37920
+ ctx.stdout.write(`note ${id}: the hold of the removed worktree could not be dropped: ${firstLine(e instanceof UsageError ? e.message : e)}
37177
37921
  `);
37178
37922
  }
37179
37923
  return { failed: !gone };
@@ -37262,7 +38006,7 @@ function cleanLocked(ctx, opts, accord) {
37262
38006
  }
37263
38007
  } catch (e) {
37264
38008
  fetchFailed = true;
37265
- ctx.stdout.write(`fetch from origin failed, judging against the refs already in this clone: ${firstLine$1(e)}
38009
+ ctx.stdout.write(`fetch from origin failed, judging against the refs already in this clone: ${firstLine(e)}
37266
38010
  `);
37267
38011
  }
37268
38012
  const ref = gitDefaultRef(ctx.root);
@@ -37331,7 +38075,7 @@ function cleanSiblings(ctx, ref, s, fetchFailed) {
37331
38075
  try {
37332
38076
  cleanForgotten(ctx, f.path, s);
37333
38077
  } catch (err) {
37334
- folderLine(ctx, s.seen, f.path, `kept ${f.path}: could not be judged: ${firstLine$1(err instanceof UsageError ? err.message : err)}`);
38078
+ folderLine(ctx, s.seen, f.path, `kept ${f.path}: could not be judged: ${firstLine(err instanceof UsageError ? err.message : err)}`);
37335
38079
  }
37336
38080
  }
37337
38081
  }
@@ -37390,7 +38134,7 @@ function cleanRecorded(ctx, ref, s, fetchFailed, merged) {
37390
38134
  }
37391
38135
  if (lstatSync(e.path, { throwIfNoEntry: false }) === void 0 || cleanForgotten(ctx, e.path, s)) dropRecorded(ctx.root, e.path);
37392
38136
  } catch (err) {
37393
- folderLine(ctx, s.seen, e.path, `kept ${e.path}: could not be judged: ${firstLine$1(err instanceof UsageError ? err.message : err)}`);
38137
+ folderLine(ctx, s.seen, e.path, `kept ${e.path}: could not be judged: ${firstLine(err instanceof UsageError ? err.message : err)}`);
37394
38138
  }
37395
38139
  }
37396
38140
  }
@@ -37441,7 +38185,7 @@ function cleanQuietly(ctx, fetched, skip, o = {}) {
37441
38185
  until: o.until
37442
38186
  });
37443
38187
  } catch (e) {
37444
- ctx.stdout.write(`clean failed, nothing more was removed: ${firstLine$1(e instanceof UsageError ? e.message : e)}\n`);
38188
+ ctx.stdout.write(`clean failed, nothing more was removed: ${firstLine(e instanceof UsageError ? e.message : e)}\n`);
37445
38189
  return;
37446
38190
  }
37447
38191
  return seen.list;
@@ -37689,14 +38433,14 @@ function cleanDone(ctx, ref, templates, s, fetchFailed, merged, skip) {
37689
38433
  ":refs/heads/" + b
37690
38434
  ], pushLimit(s), ctx.ssh);
37691
38435
  } catch (e) {
37692
- ctx.stdout.write(`kept origin/${b}: git push failed: ${firstLine$1(e)}
38436
+ ctx.stdout.write(`kept origin/${b}: git push failed: ${firstLine(e)}
37693
38437
  `);
37694
38438
  continue;
37695
38439
  }
37696
38440
  ctx.stdout.write(`deleted origin/${b} (was ${R})
37697
38441
  `);
37698
38442
  } catch (e) {
37699
- ctx.stdout.write(`kept ${b}: could not be judged: ${firstLine$1(e instanceof UsageError ? e.message : e)}
38443
+ ctx.stdout.write(`kept ${b}: could not be judged: ${firstLine(e instanceof UsageError ? e.message : e)}
37700
38444
  `);
37701
38445
  }
37702
38446
  }
@@ -37851,7 +38595,7 @@ function cleanDropped(ctx, ref, templates, s, pruned, fetchFailed, merged, skip)
37851
38595
  ":refs/heads/" + b
37852
38596
  ], pushLimit(s), ctx.ssh);
37853
38597
  } catch (e) {
37854
- ctx.stdout.write(`kept origin/${b}: git push failed: ${firstLine$1(e)}
38598
+ ctx.stdout.write(`kept origin/${b}: git push failed: ${firstLine(e)}
37855
38599
  `);
37856
38600
  if (L !== void 0) ctx.stdout.write(`kept ${b}: its origin branch was not deleted
37857
38601
  `);
@@ -37876,10 +38620,10 @@ function cleanDropped(ctx, ref, templates, s, pruned, fetchFailed, merged, skip)
37876
38620
  });
37877
38621
  ctx.stdout.write(`deleted ${b} (was ${L})\n`);
37878
38622
  } catch (e) {
37879
- ctx.stdout.write(`kept ${b}: git update-ref failed: ${firstLine$1(e)}\n`);
38623
+ ctx.stdout.write(`kept ${b}: git update-ref failed: ${firstLine(e)}\n`);
37880
38624
  }
37881
38625
  } catch (e) {
37882
- ctx.stdout.write(`kept ${b}: could not be judged: ${firstLine$1(e instanceof UsageError ? e.message : e)}\n`);
38626
+ ctx.stdout.write(`kept ${b}: could not be judged: ${firstLine(e instanceof UsageError ? e.message : e)}\n`);
37883
38627
  }
37884
38628
  }
37885
38629
  }
@@ -37947,7 +38691,7 @@ function newTicketWorktree(ctx, id, rel, text, seen) {
37947
38691
  branch
37948
38692
  ], void 0, ctx.ssh);
37949
38693
  } catch (e) {
37950
- throw new UsageError(`the ticket is committed in ${path} but the push failed: ${firstLine$1(e)} - push it with git -C "${path}" push -u origin ${branch}`);
38694
+ throw new UsageError(`the ticket is committed in ${path} but the push failed: ${firstLine(e)} - push it with git -C "${path}" push -u origin ${branch}`);
37951
38695
  }
37952
38696
  if (holdError !== void 0) throw holdError;
37953
38697
  if (enter) checkPin(ctx, id, path, branch, list[0].path);
@@ -38730,10 +39474,10 @@ function cachePath() {
38730
39474
  }
38731
39475
  //#endregion
38732
39476
  //#region src/commands/notice.ts
38733
- const PLAIN$1 = /^\d+\.\d+\.\d+$/;
39477
+ const PLAIN = /^\d+\.\d+\.\d+$/;
38734
39478
  const DAY_MS = 864e5;
38735
39479
  function newer(a, b) {
38736
- if (!PLAIN$1.test(a) || !PLAIN$1.test(b)) return false;
39480
+ if (!PLAIN.test(a) || !PLAIN.test(b)) return false;
38737
39481
  const x = a.split(".").map(Number);
38738
39482
  const y = b.split(".").map(Number);
38739
39483
  for (let i = 0; i < 3; i++) if (x[i] !== y[i]) return x[i] > y[i];
@@ -38741,7 +39485,7 @@ function newer(a, b) {
38741
39485
  }
38742
39486
  async function upgradeNotice(pinned) {
38743
39487
  try {
38744
- if (pinned === void 0 || !PLAIN$1.test(pinned)) return void 0;
39488
+ if (pinned === void 0 || !PLAIN.test(pinned)) return void 0;
38745
39489
  const file = cachePath();
38746
39490
  let latest;
38747
39491
  let fresh = false;
@@ -38767,7 +39511,7 @@ async function upgradeNotice(pinned) {
38767
39511
  renameSync(tmp, file);
38768
39512
  } catch {}
38769
39513
  }
38770
- if (latest !== void 0 && PLAIN$1.test(latest) && newer(latest, pinned)) return `accord ${latest} is out, and this repository pins ${pinned}: type /accord upgrade to run npx --yes ${package_default.name}@${latest} upgrade`;
39514
+ if (latest !== void 0 && PLAIN.test(latest) && newer(latest, pinned)) return `accord ${latest} is out, and this repository pins ${pinned}: type /accord upgrade to run npx --yes ${package_default.name}@${latest} upgrade`;
38771
39515
  return;
38772
39516
  } catch {
38773
39517
  return;
@@ -39273,7 +40017,7 @@ async function fetchIssues(repo, numbers, env, fetchImpl = fetch) {
39273
40017
  }));
39274
40018
  const issues = {};
39275
40019
  const failures = [];
39276
- for (const [n, result] of settled) if (typeof result === "string") failures.push("#" + n + " " + result);
40020
+ for (const [n, result] of settled) if (typeof result === "string") failures.push("#" + ascii(n) + " " + result);
39277
40021
  else issues[n] = result;
39278
40022
  const parts = [];
39279
40023
  if (failures.length > 0) parts.push(failures.join(", "));
@@ -39298,7 +40042,7 @@ function githubAdapter(repo) {
39298
40042
  //#endregion
39299
40043
  //#region src/tracker/jira.ts
39300
40044
  /** The same shape as the schema's `tracker.url`: https, a host, an optional path, no query or fragment. */
39301
- const HTTPS_URL = /^https:\/\/[^\s/?#]+(\/[^\s?#]*)?$/;
40045
+ const HTTPS_URL = /^https:\/\/[^\s/?#@]+(\/[^\s?#]*)?$/;
39302
40046
  const set = (value) => typeof value === "string" && value !== "";
39303
40047
  /** The authentication the environment selects, or the warning that says why there is none. */
39304
40048
  function authOf(env) {
@@ -39386,7 +40130,7 @@ async function fetchJira(baseUrl, keys, env, fetchImpl = fetch) {
39386
40130
  });
39387
40131
  const issues = {};
39388
40132
  const failures = [];
39389
- for (const [key, result] of settled) if (typeof result === "string") failures.push(key + " " + result);
40133
+ for (const [key, result] of settled) if (typeof result === "string") failures.push(ascii(key) + " " + result);
39390
40134
  else issues[key] = result;
39391
40135
  const warning = warningLine("jira", failures, auth.note === void 0 ? [] : [auth.note]);
39392
40136
  return {
@@ -39463,7 +40207,7 @@ async function fetchLinear(keys, env, fetchImpl = fetch) {
39463
40207
  });
39464
40208
  const issues = {};
39465
40209
  const failures = [];
39466
- for (const [key, result] of settled) if (typeof result === "string") failures.push(key + " " + result);
40210
+ for (const [key, result] of settled) if (typeof result === "string") failures.push(ascii(key) + " " + result);
39467
40211
  else issues[key] = result;
39468
40212
  const warning = warningLine("linear", failures);
39469
40213
  return {
@@ -39591,11 +40335,48 @@ function adapterFor(tracker) {
39591
40335
  }
39592
40336
  }
39593
40337
  /**
39594
- * D-05 with D-12: the issue key of a status row is the ticket id itself under `ids.mode: tracker`,
39595
- * otherwise the ticket's `tracker.<adapter>` value; undefined when the ticket links nothing.
40338
+ * D-05 with D-12: the issue key of a status row. Under `ids.mode: tracker` the ticket id is the key, but only when it is a tracker key of
40339
+ * the configured projects and not one of `legacy_ids` (a ticket that predates the mode keeps its id and is never renamed, so it must not
40340
+ * be asked for as an issue, and a key-shaped legacy id would show an unrelated one), and never for github-issues, whose issues are numbers.
40341
+ * Every other row uses the ticket's own `tracker.<adapter>` value; undefined when the ticket links nothing.
40342
+ */
40343
+ function issueKeyOf(row, adapterName, config) {
40344
+ return config?.ids?.mode === "tracker" && adapterName !== "github-issues" && !(config.legacy_ids ?? []).includes(row.id) && trackerKeyOk(row.id, config.ids) ? row.id : row.tracker?.[adapterName];
40345
+ }
40346
+ //#endregion
40347
+ //#region src/tracker/trust.ts
40348
+ /** The url as one comparable string (scheme, lower-case host, port, path without trailing slashes), or undefined when it does not parse. */
40349
+ function normal(url) {
40350
+ if (url === void 0) return void 0;
40351
+ try {
40352
+ const u = new URL(url);
40353
+ return u.origin + u.pathname.replace(/\/+$/, "");
40354
+ } catch {
40355
+ return;
40356
+ }
40357
+ }
40358
+ /** The `tracker` block of the default ref's accord/config.yml; `undefined` when no default ref resolves, `null` when it cannot be read or has none. */
40359
+ function reviewedTracker(root) {
40360
+ try {
40361
+ const ref = defaultRefOf(root);
40362
+ if (ref === void 0) return void 0;
40363
+ const text = catBatch(root, [ref + ":accord/config.yml"], "the default branch config")[0];
40364
+ return text === void 0 ? null : loadConfig("accord/config.yml", text).config?.tracker ?? null;
40365
+ } catch {
40366
+ return null;
40367
+ }
40368
+ }
40369
+ /**
40370
+ * The warning that says why the Jira credential is not sent to `url`, or undefined when it may be: no default ref resolves, or the default
40371
+ * ref's accord/config.yml names the same `tracker.url`. A default ref whose config cannot be read, has no `tracker.url` or does not parse fails
40372
+ * closed, because the value on this branch then has not been reviewed.
39596
40373
  */
39597
- function issueKeyOf(row, adapterName, idsMode) {
39598
- return idsMode === "tracker" ? row.id : row.tracker?.[adapterName];
40374
+ function jiraUrlRefusal(root, url) {
40375
+ const reviewed = reviewedTracker(root);
40376
+ if (reviewed === void 0) return void 0;
40377
+ const mine = normal(url);
40378
+ if (mine !== void 0 && mine === normal(reviewed?.url ?? void 0)) return void 0;
40379
+ return "tracker jira: tracker.url is not the one on the default branch, so no request was sent and no credential left this machine; merge the url to the default branch first";
39599
40380
  }
39600
40381
  //#endregion
39601
40382
  //#region src/commands/status.ts
@@ -39611,8 +40392,24 @@ async function trackerCells(ctx, rows) {
39611
40392
  const config = ctx.snapshot.config;
39612
40393
  const adapter = adapterFor(config?.tracker);
39613
40394
  if (adapter === void 0) return void 0;
40395
+ if (adapter.name === "jira" && config?.tracker?.url !== void 0) {
40396
+ const refusal = jiraUrlRefusal(ctx.root, config.tracker.url);
40397
+ if (refusal !== void 0) {
40398
+ ctx.stderr.write(refusal + "\n");
40399
+ return;
40400
+ }
40401
+ }
40402
+ if (adapter.name === "script" && config?.tracker?.command !== void 0) {
40403
+ const unread = recordWarning(ctx.root);
40404
+ if (unread !== void 0) ctx.stderr.write(unread + "\n");
40405
+ const refusal = scriptRefusal(ctx.root, "tracker.command", config.tracker.command);
40406
+ if (refusal !== void 0) {
40407
+ ctx.stderr.write("tracker script: " + refusal + "\n");
40408
+ return;
40409
+ }
40410
+ }
39614
40411
  const linked = rows.flatMap((r) => {
39615
- const key = issueKeyOf(r, adapter.name, config?.ids?.mode);
40412
+ const key = issueKeyOf(r, adapter.name, config);
39616
40413
  return key === void 0 ? [] : [[r.id, key]];
39617
40414
  });
39618
40415
  if (linked.length === 0) return void 0;
@@ -39747,6 +40544,89 @@ function taskDone(ctx, id, task, pairs = []) {
39747
40544
  return 0;
39748
40545
  }
39749
40546
  //#endregion
40547
+ //#region src/commands/trust.ts
40548
+ /** The scripts this checkout declares: `tracker.command` only under `tracker.adapter: script` (the one adapter that runs it), and `git.sync`. */
40549
+ function declared(ctx) {
40550
+ const config = ctx.snapshot.config;
40551
+ const found = [];
40552
+ if (config?.tracker?.adapter === "script" && config.tracker.command !== void 0) found.push({
40553
+ kind: "tracker.command",
40554
+ command: config.tracker.command
40555
+ });
40556
+ if (config?.git?.sync !== void 0) found.push({
40557
+ kind: "git.sync",
40558
+ command: config.git.sync
40559
+ });
40560
+ return found;
40561
+ }
40562
+ const STATE = {
40563
+ allowed: "allowed here",
40564
+ never: "not allowed here yet",
40565
+ changed: "changed since it was allowed",
40566
+ "other-command": "not the command that was allowed"
40567
+ };
40568
+ /** The lines under a script's head line: what an allow covers, the files themselves when they are few, and the ones that changed since the last allow. */
40569
+ function details(i) {
40570
+ const files = i.files.length > 0 && i.files.length <= 20 ? ` files: ${listed(i.files, 20)}\n` : "";
40571
+ const changed = i.changed.length > 0 ? ` changed since it was allowed: ${listed(i.changed, 50)}\n` : "";
40572
+ const unfollowed = i.unfollowed.length > 0 ? ` not followed: ${i.unfollowed.join(", ")} - the files ${i.unfollowed.length === 1 ? "it runs are" : "they run are"} not checked\n` : "";
40573
+ return ` covers: ${coverText(i)}\n${unfollowed}${files}${changed}`;
40574
+ }
40575
+ /**
40576
+ * Names on the command line as script kinds, each with the digest the person copied from the preview (`git.sync@1a2b3c4d5e6f7a8b`); a name that is no kind, or
40577
+ * a digest that is not hex, is a usage error.
40578
+ */
40579
+ function namesOf(names) {
40580
+ const out = [];
40581
+ for (const n of names) {
40582
+ const at = n.indexOf("@");
40583
+ const kind = at === -1 ? n : n.slice(0, at);
40584
+ if (!SCRIPT_KINDS.includes(kind)) throw new UsageError(`accord trust takes tracker.command or git.sync, not "${shown(kind)}" - nothing was changed`);
40585
+ const digest = at === -1 ? void 0 : n.slice(at + 1).replace(/^sha256:/i, "").toLowerCase();
40586
+ if (digest !== void 0 && !/^[0-9a-f]{16,64}$/.test(digest)) throw new UsageError(`"${shown(n)}" carries no digest accord trust shows (16 hex characters) - nothing was changed`);
40587
+ if (!out.some((o) => o.kind === kind)) out.push({
40588
+ kind,
40589
+ ...digest === void 0 ? {} : { digest }
40590
+ });
40591
+ }
40592
+ return out;
40593
+ }
40594
+ function trust(ctx, names, options) {
40595
+ const named = namesOf(names);
40596
+ const kinds = named.map((n) => n.kind);
40597
+ const warning = recordWarning(ctx.root);
40598
+ if (warning !== void 0) ctx.stderr.write(warning + "\n");
40599
+ if (options.revoke === true) {
40600
+ const gone = revokeScripts(ctx.root, kinds);
40601
+ ctx.stdout.write(gone.length === 0 ? "nothing was allowed in this repository - nothing to revoke\n" : `revoked: ${gone.join(", ")}\n`);
40602
+ return 0;
40603
+ }
40604
+ const scripts = declared(ctx);
40605
+ for (const k of kinds) if (!scripts.some((s) => s.kind === k)) throw new UsageError(`accord/config.yml declares no ${k}${k === "tracker.command" ? " (it counts only under tracker.adapter: script)" : ""} - nothing was allowed`);
40606
+ if (scripts.length === 0) {
40607
+ ctx.stdout.write("accord/config.yml declares no repository script (tracker.command under tracker.adapter: script, or git.sync) - nothing to allow\n");
40608
+ return 0;
40609
+ }
40610
+ if (kinds.length === 0) {
40611
+ const seen = scripts.map((s) => inspect(ctx.root, s.kind, s.command));
40612
+ for (const i of seen) ctx.stdout.write(`${i.kind} "${shown(i.command)}" - ${STATE[i.state]} (digest ${shortDigest(i.digest)})\n${details(i)}`);
40613
+ ctx.stdout.write(NOT_CHECKED + "\n");
40614
+ const open = seen.filter((i) => i.state !== "allowed");
40615
+ ctx.stdout.write(open.length === 0 ? "every declared script is allowed here - nothing to do\n" : `nothing was allowed; read the files above, then run accord trust ${open.map((i) => `${i.kind}@${shortDigest(i.digest)}`).join(" ")} to allow ${open.length === 1 ? "it" : "them"} here (in ${shown(ctx.root.replaceAll("\\", "/"))}), with the digest exactly as shown, so the allow binds only what you read\n`);
40616
+ return 0;
40617
+ }
40618
+ const bare = named.filter((n) => n.digest === void 0).map((n) => n.kind);
40619
+ if (bare.length > 0) throw new UsageError(`accord trust allows only what it showed you: run accord trust here to see ${bare.join(" and ")} with the digest of what ${bare.length === 1 ? "it covers" : "they cover"}, then ${bare.map((k) => `accord trust ${k}@<digest>`).join(" ")} with the digest it shows - nothing was allowed`);
40620
+ const wanted = scripts.filter((s) => kinds.includes(s.kind)).map((s) => ({
40621
+ ...s,
40622
+ digest: named.find((n) => n.kind === s.kind)?.digest
40623
+ }));
40624
+ for (const i of allowScripts(ctx.root, wanted)) ctx.stdout.write(`allowed: ${i.kind} "${shown(i.command)}" (digest ${shortDigest(i.digest)})\n${details(i)}`);
40625
+ ctx.stdout.write(NOT_CHECKED + "\n");
40626
+ ctx.stdout.write("the allow is local to this repository (inside .git); it holds until the command or those files change, and accord trust --revoke withdraws it\n");
40627
+ return 0;
40628
+ }
40629
+ //#endregion
39750
40630
  //#region src/commands/tests-baseline.ts
39751
40631
  const REL = "accord/tests-baseline.txt";
39752
40632
  const HEADER = "# Test cases that existed before the test policy applied. One report case id per line.\n# This file only shrinks: a case removed from the suite or traced to a criterion comes off; nothing is added.\n";
@@ -40010,60 +40890,6 @@ function gitIn(root, args, extra = {}) {
40010
40890
  throw new UsageError("git " + args.join(" ") + " failed\n" + String(err.stderr ?? "").trim() + NOTHING);
40011
40891
  }
40012
40892
  }
40013
- const PLAIN = /^\d+\.\d+\.\d+$/;
40014
- const firstLine = (e) => String(e.stderr ?? e.message ?? e).trim().split("\n")[0];
40015
- /**
40016
- * ST-LN-96 rel-ac-1, D-02 Ruling, T-03.1-13: `ruleset: "<pin at the ticket's claim commit>"` for every ticket of `ref` that is in flight: it has a lane, is not dropped, has no `ruleset`,
40017
- * is not done on `ref`, and has a claim branch (the `branch` template with its id, local or on origin, local first) that holds a `claim: <id>` commit. The value is only what that commit's
40018
- * committed accord/config.yml pins, and only a plain x.y.z, so it is the value the rules compare with later (the first one the branch wrote). A ticket whose claim pin cannot be read gets
40019
- * no field and a line in `notes`; a git failure on the whole lookup writes nothing and adds one line. One claim lookup per candidate, one cat-file for it, no network.
40020
- */
40021
- function inFlightRulesets(root, ref, configText, input, notes) {
40022
- const path = (id) => `accord/tickets/${id}.md`;
40023
- try {
40024
- const tickets = loadSnapshot(input).tickets;
40025
- const wanted = Object.values(tickets).filter((t) => t.frontmatter?.lane !== void 0 && t.frontmatter.status !== "dropped" && input.files[path(t.id)] !== void 0 && rulesetOfTicket(input.files[path(t.id)]) === void 0).map((t) => t.id);
40026
- if (wanted.length === 0) return [];
40027
- const templates = [.../* @__PURE__ */ new Set([branchTemplateOf(configText) ?? "t/{id}", DEFAULT_BRANCH_TEMPLATE])];
40028
- const teamConfig = loadConfig(CONFIG, configText).config;
40029
- const listed = new Set(gitIn(root, [
40030
- "for-each-ref",
40031
- "--format=%(refname)",
40032
- "refs/heads",
40033
- "refs/remotes/origin"
40034
- ]).split("\n").map((l) => l.trim()));
40035
- const refsOf = (id) => {
40036
- const names = templates.map((t) => t.replace("{id}", id));
40037
- return [...names.map((n) => "refs/heads/" + n), ...names.map((n) => "refs/remotes/origin/" + n)].filter((r) => listed.has(r));
40038
- };
40039
- const branched = wanted.filter((id) => refsOf(id).length > 0);
40040
- if (branched.length === 0) return [];
40041
- const finished = new Set(statusRows(snapshotAt(root, ref, branched)).filter((r) => r.stage === "done").map((r) => r.id));
40042
- const out = [];
40043
- for (const id of branched.filter((i) => !finished.has(i))) try {
40044
- let claim;
40045
- for (const r of refsOf(id)) {
40046
- claim = claimCommitOf(root, id, ref, r, teamConfig)?.claim;
40047
- if (claim !== void 0) break;
40048
- }
40049
- if (claim === void 0) continue;
40050
- const [config] = catBatch(root, [`${claim.sha}:${CONFIG}`], "the claim pin");
40051
- if (config === void 0) throw new Error(`${CONFIG} cannot be read at claim commit ${claim.sha}`);
40052
- const pin = pinOf(config);
40053
- if (pin === void 0 || !PLAIN.test(pin)) throw new Error(`${CONFIG} at claim commit ${claim.sha} pins ${pin === void 0 ? "no accord version" : `"${pin}", which is not a plain x.y.z`}`);
40054
- out.push({
40055
- path: path(id),
40056
- text: setFrontmatterKey(input.files[path(id)], "ruleset", pin)
40057
- });
40058
- } catch (e) {
40059
- notes.push(`warning: ${id}: ruleset not written, the claim pin could not be read (${firstLine(e)})`);
40060
- }
40061
- return out;
40062
- } catch (e) {
40063
- notes.push(`warning: ruleset was not written into the tickets in flight, the claim branches could not be read (${firstLine(e)})`);
40064
- return [];
40065
- }
40066
- }
40067
40893
  function upgrade(ctx) {
40068
40894
  const root = ctx.root;
40069
40895
  const v = package_default.version;
@@ -40129,11 +40955,6 @@ function upgrade(ctx) {
40129
40955
  });
40130
40956
  const input = loadRefInput(root, ref);
40131
40957
  input.files[CONFIG] = next;
40132
- const notes = [];
40133
- for (const w of inFlightRulesets(root, ref, text, input, notes)) {
40134
- writes.push(w);
40135
- input.files[w.path] = w.text;
40136
- }
40137
40958
  const bad = lintSnapshot(loadSnapshot(input)).findings.filter((f) => f.level === "error");
40138
40959
  if (bad.length > 0) throw new UsageError(`the upgrade would fail lint on ${short}:\n${bad.map((f) => `${f.file}: ${f.rule}: ${f.reason}`).join("\n")}\nfix these on ${short} first - nothing was created`);
40139
40960
  writes.push(...skillTargets(config), ...agentTargets(config), ...pluginTargets(config, package_default));
@@ -40187,10 +41008,10 @@ function upgrade(ctx) {
40187
41008
  sha + ":refs/heads/upgrade/" + v
40188
41009
  ], void 0, ssh);
40189
41010
  } catch (err) {
40190
- throw new UsageError(`the upgrade commit ${sha} was made but the push failed: ${String(err.stderr ?? err).trim().split("\n")[0]} - push it with git push origin ${sha}:refs/heads/upgrade/${v}` + [warning, ...notes].map((l) => l === void 0 ? "" : "\n" + l).join(""));
41011
+ throw new UsageError(`the upgrade commit ${sha} was made but the push failed: ${String(err.stderr ?? err).trim().split("\n")[0]} - push it with git push origin ${sha}:refs/heads/upgrade/${v}` + (warning === void 0 ? "" : "\n" + warning));
40191
41012
  }
40192
41013
  ctx.stdout.write(`branch: upgrade/${v}\nbase: ${short}\ntitle: upgrade: accord ${v}\n`);
40193
- for (const line of [warning, ...notes]) if (line !== void 0) ctx.stderr.write(line + "\n");
41014
+ if (warning !== void 0) ctx.stderr.write(warning + "\n");
40194
41015
  return 0;
40195
41016
  }
40196
41017
  //#endregion
@@ -40325,6 +41146,9 @@ function buildProgram(opts, setCode) {
40325
41146
  config.command("check").description("report every finding in accord/config.yml and write nothing").option("--json", "print { findings } instead of text").action((o) => {
40326
41147
  setCode(configCheck(preflight(opts), o));
40327
41148
  });
41149
+ program.command("trust [script...]").description("with no script named, show each script accord/config.yml declares (tracker.command under tracker.adapter: script, and git.sync): the command, a digest of what it covers, the files an allow covers and the ones that changed, and allow nothing; with tracker.command@<digest> or git.sync@<digest> named, the digest as shown, allow that script to run in this repository, refused when the files changed since: a local record inside .git, never committed, bound to the command and to the files it reaches, so a change to either asks again; accord checks only the files it lists, so whoever allows a script must review the pull request that changed it; --revoke withdraws the allows of the scripts named, or every allow").option("--revoke", "withdraw the allows of the scripts named, or every allow of this repository").action((scripts, o) => {
41150
+ setCode(trust(preflight(opts), scripts, o));
41151
+ });
40328
41152
  program.command("upgrade").description("run as the newer accord: push a branch upgrade/<version> from origin's default branch whose one commit pins this version in config.yml, the workflow and the hooks, with the skill files skills sync writes; the checkout is not touched").action(() => {
40329
41153
  setCode(upgrade({
40330
41154
  root: repoRoot(opts.cwd),