@yagni-app/code-staging 1.0.1-staging.1199.1 → 1.0.1-staging.1202.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.
@@ -12,7 +12,7 @@ export interface Citation {
12
12
  * AskStanding — mirrored locally by this extension's no-workspace-imports
13
13
  * convention, see costHud.ts).
14
14
  */
15
- export type AskStanding = "confirmed" | "asserted" | "inferred" | "no_position";
15
+ export type AskStanding = "confirmed" | "asserted" | "inferred" | "no_position" | "contested";
16
16
  /** One line the TUI shows above the answer, per standing. */
17
17
  export declare const STANDING_LINES: Record<AskStanding, string>;
18
18
  /** Options for {@link makeAskYagniTool}. */
@@ -10,6 +10,7 @@ export const STANDING_LINES = {
10
10
  asserted: "Grounded in a recorded assumption, not yet verified",
11
11
  inferred: "Inferred from workspace context, not a recorded decision",
12
12
  no_position: "No recorded position in this workspace",
13
+ contested: "Two recorded decisions conflict — escalate to a human",
13
14
  };
14
15
  function standingLine(value) {
15
16
  return typeof value === "string" && value in STANDING_LINES
@@ -141,11 +142,29 @@ export function makeAskYagniTool(opts) {
141
142
  text = `${text}\n\n${suggestion}`;
142
143
  }
143
144
  }
145
+ // P0 (Run 8 review): a contested answer must reach the MODEL, not just
146
+ // the TUI. The backend composes an ordinary answer and only overrides
147
+ // standing client-side, so without this the coding agent can act on one
148
+ // conflicting side without ever seeing the do-not-proceed instruction.
149
+ // The refusal + both positions are appended VERBATIM to tool content.
150
+ if (data.standing === "contested") {
151
+ const lines = [];
152
+ if (data.contestedInstruction)
153
+ lines.push(data.contestedInstruction);
154
+ for (const p of data.contestedPositions ?? []) {
155
+ lines.push(`- (${p.id}) ${p.question}: ${p.decision}`);
156
+ }
157
+ if (lines.length > 0) {
158
+ text = `${data.answer}\n\n${lines.join("\n")}`;
159
+ }
160
+ }
144
161
  return {
145
162
  content: [{ type: "text", text }],
146
163
  details: {
147
164
  citations: data.citations ?? [],
148
165
  ...(data.standing ? { standing: data.standing } : {}),
166
+ ...(data.contestedInstruction ? { contestedInstruction: data.contestedInstruction } : {}),
167
+ ...(data.contestedPositions ? { contestedPositions: data.contestedPositions } : {}),
149
168
  },
150
169
  };
151
170
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagni-app/code-staging",
3
- "version": "1.0.1-staging.1199.1",
3
+ "version": "1.0.1-staging.1202.1",
4
4
  "description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
@@ -41,5 +41,5 @@
41
41
  "turndown": "^7.2.4",
42
42
  "typebox": "^1.3.15"
43
43
  },
44
- "yagniSourceSha": "b28af96b1b6e11135b4be8a910f3a4b51b069cbe"
44
+ "yagniSourceSha": "2455348d067f7038017822f6d36de33d3058e77a"
45
45
  }