fix: pass nerveRoot to tester prompts for correct path resolution
Hermes agent cwd is not necessarily the nerve workspace root. Inject nerveRoot into tester prompts so all file paths and commands use absolute paths to the workspace directory.
This commit is contained in:
parent
ef7d83ad0a
commit
e8765abac6
@ -21,7 +21,7 @@ export function buildSenseGenerator({
|
|||||||
roles: {
|
roles: {
|
||||||
planner: buildPlannerRole({ provider, cwd }),
|
planner: buildPlannerRole({ provider, cwd }),
|
||||||
coder: buildCoderRole({ provider, cwd }),
|
coder: buildCoderRole({ provider, cwd }),
|
||||||
tester: buildTesterRole({ provider }),
|
tester: buildTesterRole({ provider, nerveRoot: cwd }),
|
||||||
committer: buildCommitterRole({ nerveRoot: cwd }),
|
committer: buildCommitterRole({ nerveRoot: cwd }),
|
||||||
},
|
},
|
||||||
moderator,
|
moderator,
|
||||||
|
|||||||
@ -10,11 +10,12 @@ export type TesterMeta = z.infer<typeof testerMetaSchema>;
|
|||||||
|
|
||||||
export type BuildTesterDeps = {
|
export type BuildTesterDeps = {
|
||||||
provider: LlmProvider;
|
provider: LlmProvider;
|
||||||
|
nerveRoot: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function buildTesterRole({ provider }: BuildTesterDeps) {
|
export function buildTesterRole({ provider, nerveRoot }: BuildTesterDeps) {
|
||||||
return createHermesRole<TesterMeta>({
|
return createHermesRole<TesterMeta>({
|
||||||
prompt: async (threadId) => testerPrompt({ threadId }),
|
prompt: async (threadId) => testerPrompt({ threadId, nerveRoot }),
|
||||||
extract: { provider, schema: testerMetaSchema },
|
extract: { provider, schema: testerMetaSchema },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
export function testerPrompt({ threadId }: { threadId: string }): string {
|
export function testerPrompt({ threadId, nerveRoot }: { threadId: string; nerveRoot: string }): string {
|
||||||
return `You are testing a newly created Nerve sense end-to-end.
|
return `You are testing a newly created Nerve sense end-to-end.
|
||||||
|
|
||||||
|
**IMPORTANT: The Nerve workspace is at \`${nerveRoot}\`. All paths below are relative to this directory. Always \`cd ${nerveRoot}\` first.**
|
||||||
|
|
||||||
Read the workflow thread for context: \`nerve thread ${threadId}\`
|
Read the workflow thread for context: \`nerve thread ${threadId}\`
|
||||||
Read the nerve-dev skill for expected file structure: \`cat node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\`
|
Read the nerve-dev skill for expected file structure: \`cat ${nerveRoot}/node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\`
|
||||||
|
|
||||||
Verify the full lifecycle in this order:
|
Verify the full lifecycle in this order:
|
||||||
|
|
||||||
@ -14,7 +16,7 @@ Verify the full lifecycle in this order:
|
|||||||
|
|
||||||
2. **Build** — run inside the sense directory:
|
2. **Build** — run inside the sense directory:
|
||||||
\`\`\`
|
\`\`\`
|
||||||
cd senses/<name> && pnpm install --no-cache && pnpm build
|
cd ${nerveRoot}/senses/<name> && pnpm install --no-cache && pnpm build
|
||||||
\`\`\`
|
\`\`\`
|
||||||
Must produce \`index.js\` at sense root without errors.
|
Must produce \`index.js\` at sense root without errors.
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export function buildWorkflowGenerator({
|
|||||||
roles: {
|
roles: {
|
||||||
planner: buildPlannerRole({ provider, cwd: nerveRoot }),
|
planner: buildPlannerRole({ provider, cwd: nerveRoot }),
|
||||||
coder: buildCoderRole({ provider, cwd: nerveRoot }),
|
coder: buildCoderRole({ provider, cwd: nerveRoot }),
|
||||||
tester: buildTesterRole({ provider }),
|
tester: buildTesterRole({ provider, nerveRoot }),
|
||||||
committer: buildCommitterRole({ nerveRoot }),
|
committer: buildCommitterRole({ nerveRoot }),
|
||||||
},
|
},
|
||||||
moderator,
|
moderator,
|
||||||
|
|||||||
@ -10,11 +10,12 @@ export type TesterMeta = z.infer<typeof testerMetaSchema>;
|
|||||||
|
|
||||||
export type BuildTesterDeps = {
|
export type BuildTesterDeps = {
|
||||||
provider: LlmProvider;
|
provider: LlmProvider;
|
||||||
|
nerveRoot: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function buildTesterRole({ provider }: BuildTesterDeps) {
|
export function buildTesterRole({ provider, nerveRoot }: BuildTesterDeps) {
|
||||||
return createHermesRole<TesterMeta>({
|
return createHermesRole<TesterMeta>({
|
||||||
prompt: async (threadId) => testerPrompt({ threadId }),
|
prompt: async (threadId) => testerPrompt({ threadId, nerveRoot }),
|
||||||
extract: { provider, schema: testerMetaSchema },
|
extract: { provider, schema: testerMetaSchema },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user