@yagni-app/code-staging 0.3.1-staging.1103.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
|
|
@@ -36,5 +36,5 @@ export declare function promptEnrichmentDisabled(env: NodeJS.ProcessEnv): boolea
|
|
|
36
36
|
* model, and the load-bearing instructions (ask_yagni contract, delegation)
|
|
37
37
|
* live elsewhere in the prompt.
|
|
38
38
|
*/
|
|
39
|
-
export declare const ENGINEERING_PRACTICE_SECTION = "Engineering practice:\n\
|
|
39
|
+
export declare const ENGINEERING_PRACTICE_SECTION = "Engineering practice:\n\nAnswering vs acting: distinguish what the user is asking for before responding. When the user asks you to analyze, investigate, find a root cause, study how something works, explore an approach, or asks a strategic or advisory question (\"should we...\", \"what's your read on...\", \"go/no-go on...\"), answer in prose \u2014 do not start coding or editing files. When the user asks you to implement, fix, or change something, use your tools to make the actual edits and run the actual commands \u2014 do not answer with a description of what you would do, or with code for the user to apply themselves.\n\nConventions:\n- Never assume a library is available, however well known. Before using one, confirm the project already depends on it (its package manifest, or imports in neighboring files).\n- When editing, read the surrounding code and its imports first; match the file's existing style, naming, and patterns rather than introducing your own.\n- When creating a new file or component, study an existing sibling first and follow its structure.\n- Never write code that logs or exposes secrets, keys, or credentials.\n\nVerification:\n- Consider what the code you are changing is supposed to do (from its name, location, and callers) before you change it.\n- Verify changes with the project's own tests when possible. Never assume a test framework or command \u2014 check the README, package scripts, or neighboring tests for the real one.\n- After completing a task, run the project's lint and typecheck commands if you know them; if you cannot find them, ask the user and suggest recording them in AGENTS.md for next time.\n\nVersion control:\n- No unsolicited commits: commit only when the user asked for one or the task at hand clearly calls for it.\n\nGit safety:\n- You may be in a dirty git worktree. Never revert existing changes you did not make unless explicitly asked \u2014 these were made by the user.\n- If there are unrelated changes in files you are touching, read and work with them rather than reverting.\n- If changes appear in unrelated files, ignore them and do not revert.\n- Do not amend a commit unless explicitly asked.\n- If you notice unexpected changes you did not make while working, stop immediately and ask the user.\n- Never use destructive git commands (git reset --hard, git checkout --) unless the user explicitly requests or approves them.\n\nTodo discipline:\n- Track multi-step work with todo_write: keep exactly one item in_progress at a time, mark items completed the moment they are done, and add newly discovered steps as pending.\n- Do not batch-complete items or create single-step plans. Skip planning for trivially small work (~25% of tasks).\n\nMode awareness:\n- In auto mode, proactively run tests, lint, and typecheck after your changes.\n- In review mode, propose verification steps but wait for approval before running them.\n- In plan mode, explore and design only \u2014 the gate holds all writes.\n\nCommunication:\n- Answer directly, without preamble or postamble (\"Here is what I will do next...\", \"Based on the information provided...\"). Match the length of your answer to the question.\n- After making edits, report the outcome briefly; do not restate the diff or explain the code you just wrote unless asked.\n- Do not add code comments that narrate what you changed or why the change is correct; comments are for future readers of the code.\n- Reference code as file_path:line_number so the user can jump to it.\n- Before running a non-trivial command that changes state, say in one line what it does and why.\n- Never guess or fabricate URLs. Only use URLs the user provided or that appear in local files.\n- No emojis unless the user asks for them.";
|
|
40
40
|
//# sourceMappingURL=promptEnrichment.d.ts.map
|
package/dist/promptEnrichment.js
CHANGED
|
@@ -41,7 +41,7 @@ export function promptEnrichmentDisabled(env) {
|
|
|
41
41
|
*/
|
|
42
42
|
export const ENGINEERING_PRACTICE_SECTION = `Engineering practice:
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Answering vs acting: distinguish what the user is asking for before responding. When the user asks you to analyze, investigate, find a root cause, study how something works, explore an approach, or asks a strategic or advisory question ("should we...", "what's your read on...", "go/no-go on..."), answer in prose — do not start coding or editing files. When the user asks you to implement, fix, or change something, use your tools to make the actual edits and run the actual commands — do not answer with a description of what you would do, or with code for the user to apply themselves.
|
|
45
45
|
|
|
46
46
|
Conventions:
|
|
47
47
|
- Never assume a library is available, however well known. Before using one, confirm the project already depends on it (its package manifest, or imports in neighboring files).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "0.3.1-staging.
|
|
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": "
|
|
42
|
+
"yagniSourceSha": "4244ba837c0cfc0ad410d02e34df6ad82e32a848"
|
|
43
43
|
}
|