@yagni-app/code-staging 0.3.1-staging.1107.1 → 0.3.1-staging.1108.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.
@@ -3,9 +3,17 @@
3
3
  * `buildLaunch` (no spawn, no fs).
4
4
  *
5
5
  * `buildStageInvocation` produces the per-stage pi PASSTHROUGH argv exactly as
6
- * the subagent example assembles it (runSingleAgent L294-330):
6
+ * the subagent example assembles it (runSingleAgent L294-330), with an added
7
+ * honesty preamble delivered as the FIRST `--append-system-prompt` so the
8
+ * anti-fabrication rule appears before the persona body in the child's
9
+ * assembled system prompt:
7
10
  * --mode json -p --no-session --model <tier> --tools <csv>
8
- * --append-system-prompt <file> 'Task: <rendered>'
11
+ * --append-system-prompt <honesty> --append-system-prompt <file> 'Task: <rendered>'
12
+ *
13
+ * Pi concatenates multiple `--append-system-prompt` values with `\n\n` in
14
+ * array order, so the child sees: [pi base] + [honesty] + [persona] +
15
+ * [project_context]. The preamble is placed first so open-weight models
16
+ * encounter the anti-fabrication rule before their role identity.
9
17
  *
10
18
  * `groundedChildArgv` prepends the grounding pi-args the yagni-code launcher
11
19
  * would otherwise add (`-e <self> --provider yagni`) because v1 spawns pi
@@ -17,6 +25,20 @@
17
25
  * chain's `step.task.replace(/{previous}/g, …)`.
18
26
  */
19
27
  import type { PipelineStage, ReviewLens } from "./types.js";
28
+ /**
29
+ * Anti-fabrication preamble injected as the first `--append-system-prompt` on
30
+ * every child pi process (both /go stages and subagent tool calls). The
31
+ * driver-only `ENGINEERING_PRACTICE_SECTION` never reaches children (it's a
32
+ * launcher flag, and children build their own argv); this preamble ensures
33
+ * the honesty rule is present in every child regardless.
34
+ *
35
+ * Content constraints (same as the enrichment section — the branding scrub's
36
+ * `scrubOutsideProjectContext` replaces whole-word \bpi\b and the
37
+ * `PI_DOCS_BLOCK_RE` regex consumes consecutive `- ` bullet lines that follow
38
+ * a docs header): must not contain the standalone word "pi", must not open
39
+ * with a `- ` bullet line, no emojis.
40
+ */
41
+ export declare const CHILD_HONESTY_PREAMBLE: string;
20
42
  /** Fill {ticket}/{previous}; an absent var renders as empty string. */
21
43
  export declare function renderTemplate(tmpl: string, vars: {
22
44
  ticket?: string;
@@ -3,9 +3,17 @@
3
3
  * `buildLaunch` (no spawn, no fs).
4
4
  *
5
5
  * `buildStageInvocation` produces the per-stage pi PASSTHROUGH argv exactly as
6
- * the subagent example assembles it (runSingleAgent L294-330):
6
+ * the subagent example assembles it (runSingleAgent L294-330), with an added
7
+ * honesty preamble delivered as the FIRST `--append-system-prompt` so the
8
+ * anti-fabrication rule appears before the persona body in the child's
9
+ * assembled system prompt:
7
10
  * --mode json -p --no-session --model <tier> --tools <csv>
8
- * --append-system-prompt <file> 'Task: <rendered>'
11
+ * --append-system-prompt <honesty> --append-system-prompt <file> 'Task: <rendered>'
12
+ *
13
+ * Pi concatenates multiple `--append-system-prompt` values with `\n\n` in
14
+ * array order, so the child sees: [pi base] + [honesty] + [persona] +
15
+ * [project_context]. The preamble is placed first so open-weight models
16
+ * encounter the anti-fabrication rule before their role identity.
9
17
  *
10
18
  * `groundedChildArgv` prepends the grounding pi-args the yagni-code launcher
11
19
  * would otherwise add (`-e <self> --provider yagni`) because v1 spawns pi
@@ -16,6 +24,24 @@
16
24
  * `renderTemplate` does the {ticket}/{previous} substitution, mirroring the
17
25
  * chain's `step.task.replace(/{previous}/g, …)`.
18
26
  */
27
+ /**
28
+ * Anti-fabrication preamble injected as the first `--append-system-prompt` on
29
+ * every child pi process (both /go stages and subagent tool calls). The
30
+ * driver-only `ENGINEERING_PRACTICE_SECTION` never reaches children (it's a
31
+ * launcher flag, and children build their own argv); this preamble ensures
32
+ * the honesty rule is present in every child regardless.
33
+ *
34
+ * Content constraints (same as the enrichment section — the branding scrub's
35
+ * `scrubOutsideProjectContext` replaces whole-word \bpi\b and the
36
+ * `PI_DOCS_BLOCK_RE` regex consumes consecutive `- ` bullet lines that follow
37
+ * a docs header): must not contain the standalone word "pi", must not open
38
+ * with a `- ` bullet line, no emojis.
39
+ */
40
+ export const CHILD_HONESTY_PREAMBLE = "Never fabricate file paths, file contents, function signatures, enum values, or code. " +
41
+ "If you cannot find something, say so explicitly — an honest \"not found\" is more valuable " +
42
+ "than a plausible-sounding invention. Every file path you cite must be a path you actually " +
43
+ "read with a tool. If you are uncertain whether something exists, say you are uncertain " +
44
+ "rather than presenting a guess as a finding.";
19
45
  /** Fill {ticket}/{previous}; an absent var renders as empty string. */
20
46
  export function renderTemplate(tmpl, vars) {
21
47
  return tmpl
@@ -41,6 +67,8 @@ export function buildStageInvocation(stage, ctx) {
41
67
  "--tools",
42
68
  stage.tools.join(","),
43
69
  "--append-system-prompt",
70
+ CHILD_HONESTY_PREAMBLE,
71
+ "--append-system-prompt",
44
72
  ctx.promptFilePath,
45
73
  `Task: ${task}`,
46
74
  ];
@@ -72,6 +72,8 @@ const GENERAL_BODY = `You are a capable software-engineering subagent with a fre
72
72
 
73
73
  You are grounded in how THIS company works: call ask_yagni before inferring a convention, an ownership rule, or anything organization-specific.
74
74
 
75
+ Never fabricate file paths, contents, or findings. If you cannot find something, say so.
76
+
75
77
  Your final message is your report back to the driving agent, which has NOT seen what you read or did. Make it compressed and complete: what you did, what you found, exact file paths and key excerpts, and anything the driver must know before continuing.`;
76
78
  const GENERAL_AGENT = {
77
79
  name: GENERAL_AGENT_NAME,
@@ -87,6 +89,11 @@ not write code and you do not run commands; you read and report.
87
89
  You are grounded in how THIS company works: call ask_yagni before inferring a
88
90
  convention, an ownership rule, or anything organization-specific.
89
91
 
92
+ Never fabricate file paths, contents, or code. Every path you cite must be
93
+ one you actually read with a tool. If you cannot find something, say "not
94
+ found" — a plausible-sounding invention is worse than no answer because the
95
+ driving agent trusts your report.
96
+
90
97
  Your final message is your report back to the driving agent, which has NOT
91
98
  seen what you read. Make it compressed and complete: exact file paths, the
92
99
  key excerpts, and a one-paragraph map of how the pieces relate. Say what you
@@ -112,6 +119,9 @@ your final message instead of guessing.
112
119
  You are grounded in how THIS company works: call ask_yagni before inferring a
113
120
  convention, an ownership rule, or anything organization-specific.
114
121
 
122
+ Never fabricate file paths or results. Report what you actually did and what
123
+ you actually found.
124
+
115
125
  Your final message is your report back to the driving agent, which has NOT
116
126
  seen what you did. List every file you touched, what changed in each, the
117
127
  commands you ran with their outcomes, and anything you deliberately left
@@ -141,6 +151,9 @@ verifiers.
141
151
  You are grounded in how THIS company works: call ask_yagni before inferring
142
152
  a convention, an ownership rule, or anything organization-specific.
143
153
 
154
+ Never fabricate file paths or findings. If you could not verify something,
155
+ say exactly what you tried and why you could not.
156
+
144
157
  Your final message is your verdict back to the driving agent, which has NOT
145
158
  seen what you read. Format:
146
159
  ## Verdict
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagni-app/code-staging",
3
- "version": "0.3.1-staging.1107.1",
3
+ "version": "0.3.1-staging.1108.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)",
@@ -39,5 +39,5 @@
39
39
  "smol-toml": "^1.8.0",
40
40
  "typebox": "^1.3.11"
41
41
  },
42
- "yagniSourceSha": "7029b03b5a6d5eac5c16a0a25670cc64ea989f82"
42
+ "yagniSourceSha": "4244ba837c0cfc0ad410d02e34df6ad82e32a848"
43
43
  }