@uniqbit/mate-core 1.0.0 → 1.0.1-canary.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 (46) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/package.json +1 -1
  3. package/src/cli/agent-selector.ts +16 -0
  4. package/src/cli/commands/artifact/finish/command.ts +18 -6
  5. package/src/cli/commands/artifact/finish/engine.ts +3 -1
  6. package/src/cli/commands/artifact/finish/git.ts +4 -2
  7. package/src/cli/commands/artifact/pending/discovery.ts +2 -2
  8. package/src/cli/commands/companion/link.ts +3 -2
  9. package/src/cli/commands/triage.ts +11 -23
  10. package/src/cli/commands/vscode/release-vsix.json +2 -2
  11. package/src/cli/commands/workflow/workflow.ts +3 -2
  12. package/src/cli/companion-selector.ts +26 -0
  13. package/src/cli/main.ts +12 -2
  14. package/src/hooks/validate-artifact-path.ts +79 -17
  15. package/src/lib/components/select-one.tsx +122 -0
  16. package/src/lib/delivery/record-delivery.ts +14 -0
  17. package/src/lib/delivery/staging/apply-chain.ts +60 -30
  18. package/src/lib/delivery/staging/pending.ts +13 -0
  19. package/src/lib/delivery/staging/project.ts +21 -6
  20. package/src/lib/delivery/staging/publish.ts +10 -11
  21. package/src/lib/delivery/staging/submit.ts +2 -8
  22. package/src/lib/orchestrator/companion-git-sync.ts +53 -24
  23. package/src/lib/workflow/handoff.ts +1 -1
  24. package/src/lib/workflow/position.ts +29 -2
  25. package/src/lib/workset/worktree.ts +1 -0
  26. package/src/opencode/companion-hooks.ts +3 -1
  27. package/src/runtime/artifact-refusal.ts +17 -7
  28. package/src/runtime/companion-guidance.ts +2 -2
  29. package/src/runtime/companion-sync.ts +21 -1
  30. package/src/runtime/shell-heredoc.ts +67 -26
  31. package/src/runtime/shell-variables.ts +257 -0
  32. package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +3 -0
  33. package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +4 -0
  34. package/src/templates/capabilities/react-doctor/mate-react-doctor/SKILL.md +20 -2
  35. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +2 -2
  36. package/src/templates/mate-skills/agents/mate-publish-artifact/references/openspec.md +6 -6
  37. package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +4 -4
  38. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +2 -2
  39. package/src/templates/mate-skills/claude/mate-publish-artifact/references/openspec.md +6 -6
  40. package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +4 -4
  41. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +30 -30
  42. package/src/tools/setup/capabilities/openspec.ts +3 -1
  43. package/src/tools/setup/capabilities/tokensave.ts +8 -1
  44. package/src/tools/setup/mate.ts +2 -1
  45. package/src/tools/setup.ts +22 -1
  46. package/src/cli/companion-selector.tsx +0 -139
@@ -1,36 +1,77 @@
1
+ export const HEREDOC_MARKER = /^<<-?\s*(['"]?)([\w.-]+)\1/;
2
+
1
3
  /**
2
- * Where a heredoc starts, matched at a `<<` outside quotes: an optional `-`,
3
- * then the terminator word, optionally quoted. Shared by the secret guard's
4
- * shell tokenizer and the artifact guard's redirect scan, so both agree on
5
- * what is command text and what is a body.
4
+ * Per offset, whether the shell runs it as command text: outside quotes,
5
+ * comments and `$((…))`, or in a `$(…)` or backtick substitution, also one
6
+ * inside double quotes.
6
7
  */
7
- export const HEREDOC_MARKER = /^<<-?\s*(['"]?)([\w.-]+)\1/;
8
+ export function commandTextMask(text: string): boolean[] {
9
+ const mask = Array.from({ length: text.length }, () => false);
10
+ const spans: string[] = [];
11
+ for (let i = 0; i < text.length; i++) {
12
+ const span = spans.at(-1);
13
+ const char = text[i];
14
+ mask[i] = span !== "'" && span !== "$'" && span !== '"' && span !== "((";
15
+ if (span === "'") {
16
+ if (char === "'") spans.pop();
17
+ } else if (span === "$'") {
18
+ if (char === "\\") i++;
19
+ else if (char === "'") spans.pop();
20
+ } else if (char === "\\") {
21
+ i++;
22
+ } else if (
23
+ char === "#" &&
24
+ (span === undefined || span === "(" || span === "`") &&
25
+ (i === 0 || /[\s;&|()`]/.test(text[i - 1]!))
26
+ ) {
27
+ mask[i] = false;
28
+ const end = text.indexOf("\n", i);
29
+ i = end === -1 ? text.length : end - 1;
30
+ } else if (char === "`") {
31
+ if (span === "`") spans.pop();
32
+ else spans.push("`");
33
+ } else if (char === "$" && text[i + 1] === "'" && span !== '"') {
34
+ spans.push("$'");
35
+ i++;
36
+ } else if (char === "$" && text[i + 1] === "(" && text[i + 2] === "(") {
37
+ spans.push("((");
38
+ i += 2;
39
+ } else if (char === "$" && text[i + 1] === "(") {
40
+ spans.push("(");
41
+ i++;
42
+ } else if (span === '"') {
43
+ if (char === '"') spans.pop();
44
+ } else if (span === "((") {
45
+ if (char === "(") spans.push("((");
46
+ else if (char === ")") {
47
+ spans.pop();
48
+ if (spans.at(-1) !== "((" && text[i + 1] === ")") i++;
49
+ }
50
+ } else if (char === "'" || char === '"') {
51
+ spans.push(char);
52
+ } else if (span === "(") {
53
+ if (char === "(") spans.push("(");
54
+ else if (char === ")") spans.pop();
55
+ }
56
+ }
57
+ return mask;
58
+ }
8
59
 
9
- /** The terminators a command line opens, in order; quoted text is skipped. */
10
60
  function heredocTerminators(line: string): string[] {
11
61
  const terminators: string[] = [];
12
- let quote: string | undefined;
62
+ const isCommand = commandTextMask(line);
13
63
  for (let i = 0; i < line.length; i++) {
14
- const char = line[i];
15
- if (quote) {
16
- if (char === quote) quote = undefined;
17
- else if (char === "\\" && quote === '"') i++;
18
- } else if (char === "'" || char === '"') {
19
- quote = char;
20
- } else if (char === "\\") {
64
+ if (!isCommand[i] || line[i] !== "<" || line[i + 1] !== "<") continue;
65
+ if (line[i + 2] === "<") {
66
+ i += 2;
67
+ continue;
68
+ }
69
+ const marker = HEREDOC_MARKER.exec(line.slice(i));
70
+ if (marker) {
71
+ terminators.push(marker[2]);
72
+ i += marker[0].length - 1;
73
+ } else {
21
74
  i++;
22
- } else if (char === "<" && line[i + 1] === "<") {
23
- if (line[i + 2] === "<") {
24
- i += 2;
25
- continue;
26
- }
27
- const marker = HEREDOC_MARKER.exec(line.slice(i));
28
- if (marker) {
29
- terminators.push(marker[2]);
30
- i += marker[0].length - 1;
31
- } else {
32
- i++;
33
- }
34
75
  }
35
76
  }
36
77
  return terminators;
@@ -0,0 +1,257 @@
1
+ const NAME = /^[A-Za-z_]\w*$/;
2
+ const ASSIGNMENT = /^([A-Za-z_]\w*)(\+?)=([\s\S]*)$/;
3
+ const REFERENCE = /^\$(?:\{([A-Za-z_]\w*)\}|([A-Za-z_]\w*))/;
4
+ const DYNAMIC = /^(?:\$\([^)]*\)?|\$\{[^}]*\}?|\$\w*|`[^`]*`?)/;
5
+ const SPLITS_OR_GLOBS = /[\s*?[]/;
6
+ const REWRITES_VALUE = /[~{}*?[]/;
7
+
8
+ const NON_ASSIGNING_COMMANDS = new Set([
9
+ ":",
10
+ "[",
11
+ "cat",
12
+ "chmod",
13
+ "cp",
14
+ "date",
15
+ "echo",
16
+ "false",
17
+ "git",
18
+ "grep",
19
+ "head",
20
+ "ln",
21
+ "ls",
22
+ "mkdir",
23
+ "mv",
24
+ "printf",
25
+ "rm",
26
+ "sed",
27
+ "sleep",
28
+ "sort",
29
+ "tail",
30
+ "tee",
31
+ "test",
32
+ "touch",
33
+ "true",
34
+ "wc",
35
+ ]);
36
+
37
+ export type Expansion =
38
+ | { text: string; unresolved?: undefined }
39
+ | { text?: undefined; unresolved: string };
40
+ type Lookup = (name: string) => string | null | undefined;
41
+
42
+ function expandWord(raw: string, lookup: Lookup, assignment = false): Expansion {
43
+ let text = "";
44
+ let quote: string | undefined;
45
+ for (let i = 0; i < raw.length; i++) {
46
+ const char = raw[i];
47
+ if (quote === "'") {
48
+ if (char === "'") quote = undefined;
49
+ else text += char;
50
+ } else if (char === "\\" && i + 1 < raw.length && (!quote || '$`"\\\n'.includes(raw[i + 1]))) {
51
+ text += raw[++i];
52
+ } else if (char === '"') {
53
+ quote = quote ? undefined : '"';
54
+ } else if (char === "'" && !quote) {
55
+ quote = "'";
56
+ } else if (char === "$" || char === "`") {
57
+ const rest = raw.slice(i);
58
+ const reference = REFERENCE.exec(rest);
59
+ const value = reference ? lookup(reference[1] ?? reference[2]) : undefined;
60
+ const splits = !quote && !assignment;
61
+ // zsh applies `:h`-style modifiers and `[…]` subscripts to an unbraced name.
62
+ const modified =
63
+ reference?.[2] !== undefined && /^[:[]/.test(rest.slice(reference[0].length));
64
+ if (
65
+ !reference ||
66
+ typeof value !== "string" ||
67
+ modified ||
68
+ (splits && SPLITS_OR_GLOBS.test(value))
69
+ ) {
70
+ return { unresolved: (reference ?? DYNAMIC.exec(rest))?.[0] ?? char };
71
+ }
72
+ text += value;
73
+ i += reference[0].length - 1;
74
+ } else if (assignment && !quote && (REWRITES_VALUE.test(char) || (i === 0 && char === "="))) {
75
+ return { unresolved: char };
76
+ } else {
77
+ text += char;
78
+ }
79
+ }
80
+ return { text };
81
+ }
82
+
83
+ type Binding = { at: number; name: string; value: string | null };
84
+ type ScanEvent = { at: number; name?: undefined } | Binding;
85
+
86
+ interface Word {
87
+ raw: string;
88
+ at: number;
89
+ }
90
+
91
+ interface Assignment extends Word {
92
+ name: string;
93
+ append: boolean;
94
+ value: string;
95
+ }
96
+
97
+ function parseAssignment(word: Word): Assignment | null {
98
+ const match = ASSIGNMENT.exec(word.raw);
99
+ return match ? { ...word, name: match[1], append: match[2] === "+", value: match[3] } : null;
100
+ }
101
+
102
+ function lookupIn(events: ScanEvent[]): Lookup {
103
+ return (name) =>
104
+ events.some((event) => event.name === undefined)
105
+ ? undefined
106
+ : events.findLast((event): event is Binding => event.name === name)?.value;
107
+ }
108
+
109
+ function scan(text: string): ScanEvent[] {
110
+ const events: ScanEvent[] = [];
111
+ const poison = (at: number) => events.push({ at });
112
+ const lookup = lookupIn(events);
113
+
114
+ const bind = (assigned: Assignment[], at: number, exported: boolean) => {
115
+ const own = new Set(assigned.map((assignment) => assignment.name));
116
+ for (const { name, append, value: raw } of assigned) {
117
+ // `export A=1 B=$A` expands `$A` before either is assigned.
118
+ const outer = (ref: string) => (exported && own.has(ref) ? undefined : lookup(ref));
119
+ const value = append ? undefined : expandWord(raw, outer, true).text;
120
+ events.push({ at, name, value: value ?? null });
121
+ }
122
+ };
123
+
124
+ const classify = (words: Word[], at: number, listed: boolean) => {
125
+ const parsed = words.map(parseAssignment);
126
+ const leading = parsed.indexOf(null);
127
+ const split = leading === -1 ? words.length : leading;
128
+ const rest = words.slice(split);
129
+ const exported =
130
+ split === 0 &&
131
+ rest[0]?.raw === "export" &&
132
+ rest.slice(1).every((word, k) => parsed[k + 1] !== null || NAME.test(word.raw));
133
+ const assigned = (exported ? parsed.slice(1) : parsed.slice(0, split)).filter(
134
+ (assignment): assignment is Assignment => assignment !== null,
135
+ );
136
+ for (const assignment of assigned) {
137
+ if (assignment.name === "IFS") poison(assignment.at);
138
+ }
139
+ const assignsOnly = exported || rest.length === 0;
140
+ if (assignsOnly && !listed) {
141
+ bind(assigned, at, exported);
142
+ return;
143
+ }
144
+ for (const { at: wordAt, name } of assigned) {
145
+ events.push({ at: wordAt, name, value: null });
146
+ }
147
+ if (assignsOnly) return;
148
+ const command = rest[0];
149
+ const printsToVariable =
150
+ command.raw === "printf" && rest.some((word) => word.raw.includes("-v"));
151
+ if (!NON_ASSIGNING_COMMANDS.has(command.raw) || printsToVariable) poison(command.at);
152
+ };
153
+
154
+ let words: Word[] = [];
155
+ let word = "";
156
+ let wordAt = 0;
157
+ let quote: string | undefined;
158
+ let listed = false;
159
+ let statementStart = -1;
160
+ // Words expand before redirects, so a later expansion in the statement still reaches its target.
161
+ const poisonStatement = () => events.push({ at: statementStart });
162
+ const add = (at: number, chars: string) => {
163
+ if (!word) wordAt = at;
164
+ word += chars;
165
+ };
166
+ const endWord = () => {
167
+ if (word) words.push({ raw: word, at: wordAt });
168
+ word = "";
169
+ };
170
+ const endCommand = (at: number, joinsNext: boolean) => {
171
+ endWord();
172
+ statementStart = at;
173
+ // `a &&` before a newline still joins the next statement to the list.
174
+ if (words.length === 0) {
175
+ listed ||= joinsNext;
176
+ return;
177
+ }
178
+ classify(words, at, listed || joinsNext);
179
+ words = [];
180
+ listed = joinsNext;
181
+ };
182
+ const dollar = (i: number): number => {
183
+ const next = text[i + 1];
184
+ if (next === "(" || next === "'" || next === '"') poisonStatement();
185
+ if (next !== "{") {
186
+ add(i, "$");
187
+ return i;
188
+ }
189
+ const close = text.indexOf("}", i);
190
+ const end = close === -1 ? text.length - 1 : close;
191
+ if (!NAME.test(text.slice(i + 2, end))) poisonStatement();
192
+ add(i, text.slice(i, end + 1));
193
+ return end;
194
+ };
195
+
196
+ for (let i = 0; i < text.length; i++) {
197
+ const char = text[i];
198
+ const next = text[i + 1];
199
+ if (quote === "'") {
200
+ add(i, char);
201
+ if (char === "'") quote = undefined;
202
+ } else if (quote === '"') {
203
+ if (char === "\\" && next !== undefined) add(i, char + text[++i]);
204
+ else if (char === "$") i = dollar(i);
205
+ else {
206
+ if (char === "`") poisonStatement();
207
+ if (char === '"') quote = undefined;
208
+ add(i, char);
209
+ }
210
+ } else if (char === "\\" && next === "\n") {
211
+ i++;
212
+ } else if (char === "\\" && next !== undefined) {
213
+ add(i, char + text[++i]);
214
+ } else if (char === "'" || char === '"') {
215
+ quote = char;
216
+ add(i, char);
217
+ } else if (char === "$") {
218
+ i = dollar(i);
219
+ } else if (char === "#" && !word) {
220
+ const lineEnd = text.indexOf("\n", i);
221
+ i = (lineEnd === -1 ? text.length : lineEnd) - 1;
222
+ } else if (char === " " || char === "\t") {
223
+ endWord();
224
+ } else if (char === ";" || char === "\n") {
225
+ if (char === ";" && next === ";") poison(i);
226
+ endCommand(i, false);
227
+ } else if (char === "&" && next === "&") {
228
+ endCommand(i++, true);
229
+ } else if (char === "|" && text[i - 1] !== ">") {
230
+ endCommand(i, true);
231
+ if (next === "|" || next === "&") i++;
232
+ } else if (char === "&" && text[i - 1] !== ">" && text[i - 1] !== "<" && next !== ">") {
233
+ poison(i);
234
+ endCommand(i, false);
235
+ } else if (char === "<" && next === "<") {
236
+ const herestring = text[i + 2] === "<";
237
+ if (!herestring && !/^<<-?[ \t]*['"\\]/.test(text.slice(i))) poison(i);
238
+ add(i, herestring ? "<<<" : "<<");
239
+ i += herestring ? 2 : 1;
240
+ } else {
241
+ if (char === "`") poisonStatement();
242
+ else if ("(){}".includes(char)) poison(i);
243
+ add(i, char);
244
+ }
245
+ }
246
+ endCommand(text.length, false);
247
+ // Heredoc bodies are stripped by a heuristic: after the first `<<` line the text is no proof.
248
+ const heredoc = text.indexOf("<<");
249
+ const heredocLineEnd = heredoc === -1 ? -1 : text.indexOf("\n", heredoc);
250
+ if (heredocLineEnd !== -1) poison(heredocLineEnd);
251
+ return events;
252
+ }
253
+
254
+ export function wordExpander(commandText: string): (raw: string, offset: number) => Expansion {
255
+ const events = scan(commandText);
256
+ return (raw, offset) => expandWord(raw, lookupIn(events.filter((event) => event.at < offset)));
257
+ }
@@ -125,6 +125,9 @@ artifacts:
125
125
  - Each task MUST be a checkbox: `- [ ] X.Y Task description`
126
126
  - Tasks should be small enough to complete in one session
127
127
  - Order tasks by dependency (what must be done first?)
128
+ - Name only test files that exist and cover the code the task changes.
129
+ - Inline every command a task asks to run; never write "run the tests" without the command.
130
+ - tasks.md holds only work done before submit: steps a maintainer runs after the merge go under an `## After the merge` heading as plain `-` bullets, not checkboxes.
128
131
 
129
132
  Reference specs for what needs to be built, design for how to build it. Each task should be verifiable - you know when it's done.
130
133
 
@@ -53,6 +53,10 @@ artifacts:
53
53
  Read only the `rules`, `skill_tagging`, and `verification` sections of `openspec/mate-conventions.yaml`
54
54
  (same selection rule as above) and preserve its scope rules.
55
55
 
56
+ Name only test files that exist and cover the code the task changes.
57
+ Inline every command a task asks to run; never write "run the tests" without the command.
58
+ tasks.md holds only work done before submit: steps a maintainer runs after the merge go under an `## After the merge` heading as plain `-` bullets, not checkboxes.
59
+
56
60
  **Obsidian**: Start with the template's frontmatter and `## References` section, replacing placeholders with real values.
57
61
  requires:
58
62
  - specs
@@ -18,7 +18,16 @@ metadata:
18
18
  network:
19
19
  allow: []
20
20
  deny: "*"
21
- shell: ["$MATE_REACT_DOCTOR_BIN_PATH", git symbolic-ref, git merge-base, git diff, mate]
21
+ shell:
22
+ [
23
+ "$MATE_REACT_DOCTOR_BIN_PATH",
24
+ grep,
25
+ git rev-parse,
26
+ git symbolic-ref,
27
+ git merge-base,
28
+ git diff,
29
+ mate,
30
+ ]
22
31
  tools: [read_file, write_file, bash]
23
32
  scan_status:
24
33
  scanner: "skill-audit (OWASP Agentic Skills Top 10)"
@@ -52,7 +61,16 @@ Print the path first, then call the absolute path it prints, so the command matc
52
61
  printf '%s\n' "$MATE_REACT_DOCTOR_BIN_PATH"
53
62
  ```
54
63
 
55
- If the variable is empty or the path is not executable, stop. Report "React Doctor skipped: the pinned binary is unavailable (MATE_REACT_DOCTOR_BIN_PATH is not set; is the react-doctor capability enabled?)". A verification task may be checked with that note.
64
+ A session that no Mate launch started lacks the variable. When it prints nothing, read the path from the projection file of this checkout, then, in a linked worktree, of the main checkout:
65
+
66
+ ```bash
67
+ grep -h '^MATE_REACT_DOCTOR_BIN_PATH=' "$(git rev-parse --show-toplevel)/.mate/projection.env"
68
+ grep -h '^MATE_REACT_DOCTOR_BIN_PATH=' "$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")/.mate/projection.env"
69
+ ```
70
+
71
+ The path is the text between the single quotes after `=` on the first line found.
72
+
73
+ If no source gives a path, or the path is not executable, stop. Report "React Doctor skipped: the pinned binary is unavailable (MATE_REACT_DOCTOR_BIN_PATH is not set; is the react-doctor capability enabled?)". A verification task may be checked with that note.
56
74
 
57
75
  ### 2. Choose the base
58
76
 
@@ -164,7 +164,7 @@ A drifted spec is published in its own right. It is never shipped by republishin
164
164
  - `branch-deleted` → the branch is gone on the remote and no default-branch commit contains its head, so it was most likely closed without merging. Ask once per branch whether to drop its changes. Only after the user agrees, drop each submitted change with `mate artifact submit --drop "<name>" --json` (a legacy archive: `--confirm-dropped`, then offer the Git restore below). When the user says it was merged after all, record `--confirm-merged`.
165
165
  - `likely-merged` → local Git found the branch's changes on the default branch only by patch identity (a `squash` or `rebase` merge, on Git before 2.38), or found its head on the default branch's own line (`fast-forward`). That is evidence, not proof. Name `suggestion.style` and the short `suggestion.commit`, then ask the **merge question** with **merged** preselected; record it only after the user confirms.
166
166
  - `empty-branch` → the branch has no commits of its own. Say so; ask the **merge question** with **not yet merged** preselected; never preselect merged.
167
- - `not-on-default` → the branch head is not on the default branch as of the last fetch. With `fetch.branchUnpushed`, say it was never pushed. When the outcome's `fetch.branchDeleted` is true, the branch is deleted on the remote and this machine holds no copy to check (typical after a squash merge someone else delivered): say so and ask the **merge question** directly. When the outcome has no `fetch` field (Mate did not fetch), show `fetchedAt` (or "never fetched") and offer one fetch first; only after the user agrees, re-run `mate artifact link "<anchor>" "<anchor>" --refresh --fetch --json` and use its outcomes. Otherwise, or when the user declines, ask the **merge question**.
167
+ - `not-on-default` → the branch head is not on the default branch as of the last fetch. With `fetch.branchUnpushed`, say it was never pushed. When the outcome's `fetch.branchDeleted` is true, the branch is deleted on the remote and this machine holds no copy to check (typical after a squash merge someone else delivered): say so and ask the **merge question** directly. When the outcome has no `fetch` field (Mate did not fetch), show `fetchedAt` (or "never fetched") and offer one fetch first; only after the user agrees, run `link "<change>" --refresh --fetch --json` for one change of the group, then `publish '<group>' --refresh --json` (a legacy archive: only `link "<anchor>" "<anchor>" --refresh --fetch --json`), and use the new outcomes; never `publish --fetch`. Otherwise, or when the user declines, ask the **merge question**.
168
168
  - `direct` → a direct delivery is never settled automatically: Git cannot tell this change's commits from the user's other pushes. Ask the **direct-delivery question** below.
169
169
 
170
170
  **The merge question** offers exactly three answers, asked once per branch and applied to every change on it (with `mate artifact publish '<group>' …` for a submitted group):
@@ -189,7 +189,7 @@ A drifted spec is published in its own right. It is never shipped by republishin
189
189
 
190
190
  3. **Present both sections as Markdown tables, each under its own headline.** **Scope to the user's own work by default:** list only Delivery Groups holding at least one change whose `origin` is `yours`, every legacy archive (they are this checkout's), and every drifted spec (this checkout's edits). A shown group keeps every change it holds, since a group publishes together. Leave out every other group, and say in one line above the tables how many groups of others are not shown and that asking for all shows them. Show every group only when the user explicitly asks for all, for everyone's, or names a group, change, or person that is not theirs; that scope then holds for the rest of the run. Open with a one-line **To push** summary naming how many pending changes and how many drifted specs are outstanding, then head the tables **Pending changes** and **Drifted specs** so the two publication units are never read as one list. Number both sections in **one continuous sequence**, so every number in the turn is unique and any number is a valid selection.
191
191
 
192
- The pending table has **one row per Delivery Group**, then one row per legacy archive. A row carries a leading `#`, then `Group` (the Delivery Group, or `legacy (this checkout only)` for a legacy archive), `Changes` (every change the group holds, joined with `+`, each marked `(yours)` when `origin` is `yours`, else `(<author>)` with its `author`, or `(others)` without one; the anchor for a legacy archive), a `Ships` column, and a `Delivery` column. `Ships` is the exact payload known: for a submitted change its folder `openspec/changes/<name>/`, archived at publication with the canonical specs its delta specs name; for a legacy archive its `uncommittedPaths` folders first, then every `uncommittedSpecChanges` item rendered as `[kind] path` with `kind` the exact `new` or `modified` value from the JSON. Join several values in one cell with `+` — a Markdown cell is one line, so `+` is the multi-value separator, never a line break.
192
+ The pending table has **one row per Delivery Group**, then one row per legacy archive. A row carries a leading `#`, then `Group` (the Delivery Group, or `legacy (this checkout only)` for a legacy archive), `Changes` (every change the group holds, joined with `+`, each marked `(yours)` when `origin` is `yours`, else `(<author>)` with its `author`, or `(others)` without one; the anchor for a legacy archive), a `Ships` column, and a `Delivery` column. `Ships` is the exact payload known: for a submitted change its folder `openspec/changes/<name>/`, archived at publication with the canonical specs its delta specs name; for a legacy archive its `uncommittedPaths` folders first, then every `uncommittedSpecChanges` item rendered as `[kind] path` with `kind` the exact `new`, `modified` or `deleted` value from the JSON. Join several values in one cell with `+` — a Markdown cell is one line, so `+` is the multi-value separator, never a line break.
193
193
 
194
194
  `Delivery` shows `merged`, `not applicable`, or `legacy — merge not checked` for a selectable row; a group is selectable only when `publishable` is true. A held-back row stays in **Pending changes** — never under a third headline — with `—` instead of a number and `waiting for merge` in `Delivery`, followed by each unsettled branch and its PR link when known (`dropped` instead when the branch was closed without merging), or `held: depends on <heldBy>` for a group held by an unpublished dependency. It is never part of the numbered sequence. For a selectable group whose `merges` hold an entry with `yours: false`, add whose claim the merge is: `merged — answered by <recordedBy>, not checked by Git` for `source: "user"`, `merged — found by Git on <recordedBy>'s machine` for `source: "git"` (`someone else` without `recordedBy`). The inbox takes any teammate's push, so this names the claim the publication rests on; the user decides whether to take it by selecting the group. Number a `needsRefresh` group, `Delivery` reading `merged — found by Git on this machine` if a change has `found`, else `dependency's merge found by Git`. Under the table, say that naming a waiting group checks its merge and publishes it if merged, name `mergeCheck.unchecked` changes as unchecked, and relay its `warning`. When `submitted.stale` is true, say above the table that the submitted groups are as last fetched at `submitted.fetchedAt`. A group with `blocked` true keeps its number and shows `blocked: <change>: <reason>` in `Delivery`; under the table, say that publishing it again shows the conflict to resolve, from any machine.
195
195
 
@@ -21,11 +21,11 @@ A legacy archive owns two paths outright:
21
21
 
22
22
  An archive is pending while either is uncommitted (an active directory that exists again is a new change of that name and does not count), and `uncommittedPaths` names the owned archive or active-change folders that contain the uncommitted content. Canonical specs under `openspec/specs/<capability>/...` are deliberately **not** part of that test: a canonical spec is shared by every change that ever amended it, so treating a dirty spec as a trigger would resurrect long-published changes whose own files are committed. A pending entry still reports the uncommitted canonical specs its deltas applied to, in `uncommittedSpecs`, because they are the rest of its publication scope. A legacy archive is publishable from this checkout only.
23
23
 
24
- `uncommittedSpecChanges` parallels `uncommittedSpecs` with `{ path, kind }` objects. `kind` is `new` for an untracked or newly added spec and `modified` for a tracked spec with working-tree changes. Use this metadata for display; do not infer it from the path.
24
+ `uncommittedSpecChanges` parallels `uncommittedSpecs` with `{ path, kind }` objects. `kind` is `new` for an untracked or newly added spec, `deleted` for a spec deleted in the working tree or index, and `modified` for any other tracked spec with changes. Use this metadata for display; do not infer it from the path.
25
25
 
26
26
  ### Drifted specs
27
27
 
28
- `unattributedSpecs` collects uncommitted canonical specs that no pending change accounts for — the **drifted** specs. Each entry carries its `path`, its own working-tree `kind` (`new` or `modified`), and a `touchedByArchives` list naming every archive whose delta specs include that canonical spec, with that archive's `anchor` and commit `state`, ordered oldest anchor first. `kind` describes the spec and `state` describes the archive; an entry is uncommitted regardless of what `state` says.
28
+ `unattributedSpecs` collects uncommitted canonical specs that no pending change accounts for — the **drifted** specs. Each entry carries its `path`, its own working-tree `kind` (`new`, `modified` or `deleted`), and a `touchedByArchives` list naming every archive whose delta specs include that canonical spec, with that archive's `anchor` and commit `state`, ordered oldest anchor first. `kind` describes the spec and `state` describes the archive; an entry is uncommitted regardless of what `state` says.
29
29
 
30
30
  Every drifted spec is publishable on its own, through `--specs` — see [Spec Publications](#spec-publications). `touchedByArchives` does not gate that: it is provenance, reported so a reader can see which change once touched the spec. An empty list means no archive ever mentioned it, which changes nothing about whether it can ship.
31
31
 
@@ -134,7 +134,7 @@ Always invoke with `--json` and parse the single JSON line the command prints:
134
134
  - `commit` is the published commit: the group's, or the local publication commit.
135
135
  - `group`, `changes` and `anchors` name the Delivery Group a change publication published or held, its submitted changes in publication order, and the archives they became.
136
136
  - `dependencies` lists results of other groups published first in the same run.
137
- - `conflict` (`change`, `capability`, `requirement`, `base`, `ours`, `theirs`) and `blocked` describe a stale requirement; see below.
137
+ - `conflicts` lists every stale requirement of the failing change, each with `change`, `capability`, `requirement`, `base`, `ours` and `theirs`; `conflict` is its first entry. `blocked` says the conflict is recorded; see below.
138
138
  - `resumed` is true when this same publication was already committed or pushed and is being retried.
139
139
 
140
140
  Under `--all` the output is a JSON array of these objects rather than one object. Every other invocation emits a single object.
@@ -190,9 +190,9 @@ If `status` is `conflict`, do **not** rerun `mate artifact publish` for that tar
190
190
 
191
191
  ### A group conflict (`step: "publish"`)
192
192
 
193
- Publication applies each change's delta specs on the current default branch, so requirements other changes added beside it never conflict. When a requirement a change modifies, removes or renames changed on the default branch since its delta was written, publication stops with a conflict instead of merging the two edits: a clean text merge is no proof they agree, and nobody reviews a publication. `message` names the change, the capability and the requirement, and `conflictedPaths` the canonical spec. Nothing was pushed, the submitted folders are unchanged, and this checkout was not touched. The block is recorded in the change's `delivery.yaml` on the pending branch (`blocked: true`), so pending shows it to everyone until it is submitted again, resolved, or published.
193
+ Publication applies each change's delta specs on the current default branch, so requirements other changes added beside it never conflict. When a requirement a change modifies, removes or renames changed on the default branch since its delta was written, publication stops with a conflict instead of merging the two edits: a clean text merge is no proof they agree, and nobody reviews a publication. `message` names the change and every stale requirement with its capability, then the remedy; `conflictedPaths` names the canonical specs. Nothing was pushed, the submitted folders are unchanged, and this checkout was not touched. The block is recorded in the change's `delivery.yaml` on the pending branch (`blocked: true`), so pending shows it to everyone until it is submitted again, resolved, or published.
194
194
 
195
- When the result carries `conflict` (`change`, `capability`, `requirement`, and the texts `base`, `ours`, `theirs`), resolve it from this machine, whichever machine submitted it:
195
+ Follow the remedy `message` gives. Offer submitting the change again unchanged only when the message offers it. When it gives a `mate artifact resolve` command, resolve every requirement it names there, in one call, from this machine, whichever machine submitted it, taking each one's texts from `conflicts`:
196
196
 
197
197
  1. Show the three versions: the requirement as the delta was written against it (`base`), the change's (`ours`) and the default branch's (`theirs`).
198
198
  2. Propose one text that keeps both changes, or say plainly that they contradict and ask which wins. Never drop a sentence or scenario either side added without saying so.
@@ -200,7 +200,7 @@ When the result carries `conflict` (`change`, `capability`, `requirement`, and t
200
200
  4. When `resolve` answers `refused` with `unresolved`, other requirements the change would overwrite changed on the default branch too; the new delta base would hide them, so it resolves all of them in one call or none. Publish the group again to get each one's versions only when the result lacks them, resolve each with the user as above, then pass one `--capability --requirement --file` triple per requirement, in one call, quoted the same way: `mate artifact resolve '<change>' --capability '<c1>' --requirement '<r1>' --file '<f1>' --capability '<c2>' --requirement '<r2>' --file '<f2>' --json`.
201
201
  5. Publish the group again.
202
202
 
203
- When `ours` or `theirs` is null (a removed or renamed requirement), or a delta no longer applies, `resolve` refuses: the fix belongs in that change's delta spec. Update it in the change folder (on the machine that holds it, or after pulling the submitted folder), run `mate-submit-change` for it again, then publish again. Ask the user before editing a delta. To keep a removal or rename as it is, the user confirms it and the change is submitted again unchanged, by name: that accepts the conflict, takes the default tip as delta base and clears the block, unless the change would overwrite another requirement that changed, which `resolve` handles. Never edit a submitted folder on the pending branch by hand; `resolve` and submit are its only writers.
203
+ A requirement the change removes or only renames needs no triple: the `resolve` call accepts it with the rest, as the message says. When the message asks to fix the delta instead, the fix belongs in that change's delta spec. Update it in the change folder (on the machine that holds it, or after pulling the submitted folder), run `mate-submit-change` for it again, then publish again. Ask the user before editing a delta. When the message offers submitting the change again unchanged, the user may confirm that instead: submitted again by name, it accepts the conflict, takes the default tip as delta base and clears the block. Never edit a submitted folder on the pending branch by hand; `resolve` and submit are its only writers.
204
204
 
205
205
  After applying every change, publication validates each canonical spec that changed (`openspec validate <capability> --type spec`, errors only; warnings never block). A failure is also a `conflict`: `message` names the spec and the validation error, and `conflictedPaths` the spec. Nothing was pushed. Fix it the same way, in the delta spec of the change that produced it, then submit again and publish again.
206
206
 
@@ -75,10 +75,10 @@ it with `mate workflow done <skill> "<change-name>"`; otherwise name it above th
75
75
  explicitly confirms a direct delivery;
76
76
  - `--not-applicable "<reason>"` — for a specification-only change;
77
77
  - `--skip-branch` — when the user skips the question; publication will ask again.
78
- - `failed` → no state changed. Report the `message`: a failed check
79
- (`reason` `check-failed`, typically a validation error) or a failed push. For
80
- `secret`, report each finding's path, line and rule, never a value. Re-running
81
- submit retries; an unchanged resubmit adds no commit.
78
+ - `failed` → no state changed. Report the `message` with its remedy as given: a
79
+ failed check (`reason` `check-failed`, typically a validation error) or a failed
80
+ push. For `secret`, report each finding's path, line and rule, never a value.
81
+ Re-running submit retries; an unchanged resubmit adds no commit.
82
82
 
83
83
  A non-zero exit without a result is a refusal; report its message. When it names
84
84
  uncommitted changes, the branch counts or is suggested as merged while its work tree
@@ -164,7 +164,7 @@ A drifted spec is published in its own right. It is never shipped by republishin
164
164
  - `branch-deleted` → the branch is gone on the remote and no default-branch commit contains its head, so it was most likely closed without merging. Ask once per branch whether to drop its changes. Only after the user agrees, drop each submitted change with `mate artifact submit --drop "<name>" --json` (a legacy archive: `--confirm-dropped`, then offer the Git restore below). When the user says it was merged after all, record `--confirm-merged`.
165
165
  - `likely-merged` → local Git found the branch's changes on the default branch only by patch identity (a `squash` or `rebase` merge, on Git before 2.38), or found its head on the default branch's own line (`fast-forward`). That is evidence, not proof. Name `suggestion.style` and the short `suggestion.commit`, then ask the **merge question** with **merged** preselected; record it only after the user confirms.
166
166
  - `empty-branch` → the branch has no commits of its own. Say so; ask the **merge question** with **not yet merged** preselected; never preselect merged.
167
- - `not-on-default` → the branch head is not on the default branch as of the last fetch. With `fetch.branchUnpushed`, say it was never pushed. When the outcome's `fetch.branchDeleted` is true, the branch is deleted on the remote and this machine holds no copy to check (typical after a squash merge someone else delivered): say so and ask the **merge question** directly. When the outcome has no `fetch` field (Mate did not fetch), show `fetchedAt` (or "never fetched") and offer one fetch first; only after the user agrees, re-run `mate artifact link "<anchor>" "<anchor>" --refresh --fetch --json` and use its outcomes. Otherwise, or when the user declines, ask the **merge question**.
167
+ - `not-on-default` → the branch head is not on the default branch as of the last fetch. With `fetch.branchUnpushed`, say it was never pushed. When the outcome's `fetch.branchDeleted` is true, the branch is deleted on the remote and this machine holds no copy to check (typical after a squash merge someone else delivered): say so and ask the **merge question** directly. When the outcome has no `fetch` field (Mate did not fetch), show `fetchedAt` (or "never fetched") and offer one fetch first; only after the user agrees, run `link "<change>" --refresh --fetch --json` for one change of the group, then `publish '<group>' --refresh --json` (a legacy archive: only `link "<anchor>" "<anchor>" --refresh --fetch --json`), and use the new outcomes; never `publish --fetch`. Otherwise, or when the user declines, ask the **merge question**.
168
168
  - `direct` → a direct delivery is never settled automatically: Git cannot tell this change's commits from the user's other pushes. Ask the **direct-delivery question** below.
169
169
 
170
170
  **The merge question** offers exactly three answers, asked once per branch and applied to every change on it (with `mate artifact publish '<group>' …` for a submitted group):
@@ -189,7 +189,7 @@ A drifted spec is published in its own right. It is never shipped by republishin
189
189
 
190
190
  3. **Present both sections as Markdown tables, each under its own headline.** **Scope to the user's own work by default:** list only Delivery Groups holding at least one change whose `origin` is `yours`, every legacy archive (they are this checkout's), and every drifted spec (this checkout's edits). A shown group keeps every change it holds, since a group publishes together. Leave out every other group, and say in one line above the tables how many groups of others are not shown and that asking for all shows them. Show every group only when the user explicitly asks for all, for everyone's, or names a group, change, or person that is not theirs; that scope then holds for the rest of the run. Open with a one-line **To push** summary naming how many pending changes and how many drifted specs are outstanding, then head the tables **Pending changes** and **Drifted specs** so the two publication units are never read as one list. Number both sections in **one continuous sequence**, so every number in the turn is unique and any number is a valid selection.
191
191
 
192
- The pending table has **one row per Delivery Group**, then one row per legacy archive. A row carries a leading `#`, then `Group` (the Delivery Group, or `legacy (this checkout only)` for a legacy archive), `Changes` (every change the group holds, joined with `+`, each marked `(yours)` when `origin` is `yours`, else `(<author>)` with its `author`, or `(others)` without one; the anchor for a legacy archive), a `Ships` column, and a `Delivery` column. `Ships` is the exact payload known: for a submitted change its folder `openspec/changes/<name>/`, archived at publication with the canonical specs its delta specs name; for a legacy archive its `uncommittedPaths` folders first, then every `uncommittedSpecChanges` item rendered as `[kind] path` with `kind` the exact `new` or `modified` value from the JSON. Join several values in one cell with `+` — a Markdown cell is one line, so `+` is the multi-value separator, never a line break.
192
+ The pending table has **one row per Delivery Group**, then one row per legacy archive. A row carries a leading `#`, then `Group` (the Delivery Group, or `legacy (this checkout only)` for a legacy archive), `Changes` (every change the group holds, joined with `+`, each marked `(yours)` when `origin` is `yours`, else `(<author>)` with its `author`, or `(others)` without one; the anchor for a legacy archive), a `Ships` column, and a `Delivery` column. `Ships` is the exact payload known: for a submitted change its folder `openspec/changes/<name>/`, archived at publication with the canonical specs its delta specs name; for a legacy archive its `uncommittedPaths` folders first, then every `uncommittedSpecChanges` item rendered as `[kind] path` with `kind` the exact `new`, `modified` or `deleted` value from the JSON. Join several values in one cell with `+` — a Markdown cell is one line, so `+` is the multi-value separator, never a line break.
193
193
 
194
194
  `Delivery` shows `merged`, `not applicable`, or `legacy — merge not checked` for a selectable row; a group is selectable only when `publishable` is true. A held-back row stays in **Pending changes** — never under a third headline — with `—` instead of a number and `waiting for merge` in `Delivery`, followed by each unsettled branch and its PR link when known (`dropped` instead when the branch was closed without merging), or `held: depends on <heldBy>` for a group held by an unpublished dependency. It is never part of the numbered sequence. For a selectable group whose `merges` hold an entry with `yours: false`, add whose claim the merge is: `merged — answered by <recordedBy>, not checked by Git` for `source: "user"`, `merged — found by Git on <recordedBy>'s machine` for `source: "git"` (`someone else` without `recordedBy`). The inbox takes any teammate's push, so this names the claim the publication rests on; the user decides whether to take it by selecting the group. Number a `needsRefresh` group, `Delivery` reading `merged — found by Git on this machine` if a change has `found`, else `dependency's merge found by Git`. Under the table, say that naming a waiting group checks its merge and publishes it if merged, name `mergeCheck.unchecked` changes as unchecked, and relay its `warning`. When `submitted.stale` is true, say above the table that the submitted groups are as last fetched at `submitted.fetchedAt`. A group with `blocked` true keeps its number and shows `blocked: <change>: <reason>` in `Delivery`; under the table, say that publishing it again shows the conflict to resolve, from any machine.
195
195
 
@@ -21,11 +21,11 @@ A legacy archive owns two paths outright:
21
21
 
22
22
  An archive is pending while either is uncommitted (an active directory that exists again is a new change of that name and does not count), and `uncommittedPaths` names the owned archive or active-change folders that contain the uncommitted content. Canonical specs under `openspec/specs/<capability>/...` are deliberately **not** part of that test: a canonical spec is shared by every change that ever amended it, so treating a dirty spec as a trigger would resurrect long-published changes whose own files are committed. A pending entry still reports the uncommitted canonical specs its deltas applied to, in `uncommittedSpecs`, because they are the rest of its publication scope. A legacy archive is publishable from this checkout only.
23
23
 
24
- `uncommittedSpecChanges` parallels `uncommittedSpecs` with `{ path, kind }` objects. `kind` is `new` for an untracked or newly added spec and `modified` for a tracked spec with working-tree changes. Use this metadata for display; do not infer it from the path.
24
+ `uncommittedSpecChanges` parallels `uncommittedSpecs` with `{ path, kind }` objects. `kind` is `new` for an untracked or newly added spec, `deleted` for a spec deleted in the working tree or index, and `modified` for any other tracked spec with changes. Use this metadata for display; do not infer it from the path.
25
25
 
26
26
  ### Drifted specs
27
27
 
28
- `unattributedSpecs` collects uncommitted canonical specs that no pending change accounts for — the **drifted** specs. Each entry carries its `path`, its own working-tree `kind` (`new` or `modified`), and a `touchedByArchives` list naming every archive whose delta specs include that canonical spec, with that archive's `anchor` and commit `state`, ordered oldest anchor first. `kind` describes the spec and `state` describes the archive; an entry is uncommitted regardless of what `state` says.
28
+ `unattributedSpecs` collects uncommitted canonical specs that no pending change accounts for — the **drifted** specs. Each entry carries its `path`, its own working-tree `kind` (`new`, `modified` or `deleted`), and a `touchedByArchives` list naming every archive whose delta specs include that canonical spec, with that archive's `anchor` and commit `state`, ordered oldest anchor first. `kind` describes the spec and `state` describes the archive; an entry is uncommitted regardless of what `state` says.
29
29
 
30
30
  Every drifted spec is publishable on its own, through `--specs` — see [Spec Publications](#spec-publications). `touchedByArchives` does not gate that: it is provenance, reported so a reader can see which change once touched the spec. An empty list means no archive ever mentioned it, which changes nothing about whether it can ship.
31
31
 
@@ -134,7 +134,7 @@ Always invoke with `--json` and parse the single JSON line the command prints:
134
134
  - `commit` is the published commit: the group's, or the local publication commit.
135
135
  - `group`, `changes` and `anchors` name the Delivery Group a change publication published or held, its submitted changes in publication order, and the archives they became.
136
136
  - `dependencies` lists results of other groups published first in the same run.
137
- - `conflict` (`change`, `capability`, `requirement`, `base`, `ours`, `theirs`) and `blocked` describe a stale requirement; see below.
137
+ - `conflicts` lists every stale requirement of the failing change, each with `change`, `capability`, `requirement`, `base`, `ours` and `theirs`; `conflict` is its first entry. `blocked` says the conflict is recorded; see below.
138
138
  - `resumed` is true when this same publication was already committed or pushed and is being retried.
139
139
 
140
140
  Under `--all` the output is a JSON array of these objects rather than one object. Every other invocation emits a single object.
@@ -190,9 +190,9 @@ If `status` is `conflict`, do **not** rerun `mate artifact publish` for that tar
190
190
 
191
191
  ### A group conflict (`step: "publish"`)
192
192
 
193
- Publication applies each change's delta specs on the current default branch, so requirements other changes added beside it never conflict. When a requirement a change modifies, removes or renames changed on the default branch since its delta was written, publication stops with a conflict instead of merging the two edits: a clean text merge is no proof they agree, and nobody reviews a publication. `message` names the change, the capability and the requirement, and `conflictedPaths` the canonical spec. Nothing was pushed, the submitted folders are unchanged, and this checkout was not touched. The block is recorded in the change's `delivery.yaml` on the pending branch (`blocked: true`), so pending shows it to everyone until it is submitted again, resolved, or published.
193
+ Publication applies each change's delta specs on the current default branch, so requirements other changes added beside it never conflict. When a requirement a change modifies, removes or renames changed on the default branch since its delta was written, publication stops with a conflict instead of merging the two edits: a clean text merge is no proof they agree, and nobody reviews a publication. `message` names the change and every stale requirement with its capability, then the remedy; `conflictedPaths` names the canonical specs. Nothing was pushed, the submitted folders are unchanged, and this checkout was not touched. The block is recorded in the change's `delivery.yaml` on the pending branch (`blocked: true`), so pending shows it to everyone until it is submitted again, resolved, or published.
194
194
 
195
- When the result carries `conflict` (`change`, `capability`, `requirement`, and the texts `base`, `ours`, `theirs`), resolve it from this machine, whichever machine submitted it:
195
+ Follow the remedy `message` gives. Offer submitting the change again unchanged only when the message offers it. When it gives a `mate artifact resolve` command, resolve every requirement it names there, in one call, from this machine, whichever machine submitted it, taking each one's texts from `conflicts`:
196
196
 
197
197
  1. Show the three versions: the requirement as the delta was written against it (`base`), the change's (`ours`) and the default branch's (`theirs`).
198
198
  2. Propose one text that keeps both changes, or say plainly that they contradict and ask which wins. Never drop a sentence or scenario either side added without saying so.
@@ -200,7 +200,7 @@ When the result carries `conflict` (`change`, `capability`, `requirement`, and t
200
200
  4. When `resolve` answers `refused` with `unresolved`, other requirements the change would overwrite changed on the default branch too; the new delta base would hide them, so it resolves all of them in one call or none. Publish the group again to get each one's versions only when the result lacks them, resolve each with the user as above, then pass one `--capability --requirement --file` triple per requirement, in one call, quoted the same way: `mate artifact resolve '<change>' --capability '<c1>' --requirement '<r1>' --file '<f1>' --capability '<c2>' --requirement '<r2>' --file '<f2>' --json`.
201
201
  5. Publish the group again.
202
202
 
203
- When `ours` or `theirs` is null (a removed or renamed requirement), or a delta no longer applies, `resolve` refuses: the fix belongs in that change's delta spec. Update it in the change folder (on the machine that holds it, or after pulling the submitted folder), run `mate-submit-change` for it again, then publish again. Ask the user before editing a delta. To keep a removal or rename as it is, the user confirms it and the change is submitted again unchanged, by name: that accepts the conflict, takes the default tip as delta base and clears the block, unless the change would overwrite another requirement that changed, which `resolve` handles. Never edit a submitted folder on the pending branch by hand; `resolve` and submit are its only writers.
203
+ A requirement the change removes or only renames needs no triple: the `resolve` call accepts it with the rest, as the message says. When the message asks to fix the delta instead, the fix belongs in that change's delta spec. Update it in the change folder (on the machine that holds it, or after pulling the submitted folder), run `mate-submit-change` for it again, then publish again. Ask the user before editing a delta. When the message offers submitting the change again unchanged, the user may confirm that instead: submitted again by name, it accepts the conflict, takes the default tip as delta base and clears the block. Never edit a submitted folder on the pending branch by hand; `resolve` and submit are its only writers.
204
204
 
205
205
  After applying every change, publication validates each canonical spec that changed (`openspec validate <capability> --type spec`, errors only; warnings never block). A failure is also a `conflict`: `message` names the spec and the validation error, and `conflictedPaths` the spec. Nothing was pushed. Fix it the same way, in the delta spec of the change that produced it, then submit again and publish again.
206
206
 
@@ -75,10 +75,10 @@ it with `mate workflow done <skill> "<change-name>"`; otherwise name it above th
75
75
  explicitly confirms a direct delivery;
76
76
  - `--not-applicable "<reason>"` — for a specification-only change;
77
77
  - `--skip-branch` — when the user skips the question; publication will ask again.
78
- - `failed` → no state changed. Report the `message`: a failed check
79
- (`reason` `check-failed`, typically a validation error) or a failed push. For
80
- `secret`, report each finding's path, line and rule, never a value. Re-running
81
- submit retries; an unchanged resubmit adds no commit.
78
+ - `failed` → no state changed. Report the `message` with its remedy as given: a
79
+ failed check (`reason` `check-failed`, typically a validation error) or a failed
80
+ push. For `secret`, report each finding's path, line and rule, never a value.
81
+ Re-running submit retries; an unchanged resubmit adds no commit.
82
82
 
83
83
  A non-zero exit without a result is a refusal; report its message. When it names
84
84
  uncommitted changes, the branch counts or is suggested as merged while its work tree