-
Notifications
You must be signed in to change notification settings - Fork 122
FE-1525: Establish the runbook-to-workpiece control and expose the construction gap #9405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d0f7a7b
Keep upcoming-mission drafts at conversational fidelity.
lunelson fcb46f4
housekeeping and new inbox sources
lunelson 6497b02
add brunch-rel'd image assets to the brunch-agent app
lunelson 55718ad
Specify structurally typed elicitation runbooks
lunelson a6ab067
Land Mission 3 pass 1: sdcpn-modelling runbook skill, headless drive,β¦
lunelson 83749d0
Close validated construction side quest
lunelson 088693a
Fold Mission 3 review findings into upcoming-mission clusters
lunelson 18532de
Specify elicitation-to-IR oracle design
lunelson f2801ac
Freeze elicitation-to-IR grader ruler v1
lunelson af91513
Flatten Brunch evaluation topology
lunelson 83015b2
further docs weeding and flattening
lunelson 5237a29
Restore prospective runbook elicitation baseline
lunelson afcb5c0
detailed research reports from research I
lunelson f8c950b
Synthesize elicitation research and reframe successor missions
lunelson b50ea43
Close Mission 3 with prospective baseline evidence
lunelson 8ae05fc
Register Mission 3 substrate test entries
lunelson de3e566
Express Brunch test fixtures in the Turbo graph
lunelson 450994a
Include Brunch app fixtures in CI prune
lunelson f4b995d
Specialize runbook IR fence recovery
lunelson beb21bd
Resolve runbook proof review findings
lunelson 5717c7d
Preserve nested validation issue paths
lunelson 174d74a
Move Brunch architecture checks to app tests
lunelson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,68 @@ | ||
| "use agent"; | ||
| /** | ||
| * One plain Flue chat agent for the Petrinaut panel throughline. | ||
| * One Flue chat agent for the Petrinaut panel throughline. | ||
| * | ||
| * Capture is a harness-side pipe, not an interviewer tool. One stub skill is | ||
| * mounted so activation can appear in Flue history. | ||
| * Capture is a harness-side pipe, not an interviewer tool. One runbook skill | ||
| * carries the modelling lifecycle and its supporting resources. | ||
| */ | ||
|
|
||
| import { defineSkill, useModel, useSkill, useTool } from "@flue/runtime"; | ||
| import { useInitialData, useModel, useSkill, useTool } from "@flue/runtime"; | ||
| import * as v from "valibot"; | ||
|
|
||
| import sdcpnModellingSkill from "../skills/sdcpn-modelling/SKILL.md"; | ||
| import { | ||
| petrinautConstructionTools, | ||
| VALIDATED_CONSTRUCTION_MODE, | ||
| } from "../tools/petrinaut-construction.ts"; | ||
| import { ping } from "../tools/ping.ts"; | ||
| import { readPetrinautDoc } from "../tools/read-petrinaut-doc.ts"; | ||
|
|
||
| export const CHAT_MODEL_ID = | ||
| process.env["BRUNCH_CHAT_MODEL"] || "claude-haiku-4-5"; | ||
|
|
||
| export const STUB_SKILL_NAME = "confirm-path"; | ||
| export const RUNBOOK_SKILL_NAME = sdcpnModellingSkill.name; | ||
|
|
||
| export const ACTIVATE_SKILL_TOOL_NAME = "activate_skill"; | ||
|
|
||
| const confirmPath = defineSkill({ | ||
| name: STUB_SKILL_NAME, | ||
| description: | ||
| "Confirm how this assistant is mounted. Use when checking the server path or tool layout.", | ||
| instructions: | ||
| "Say that ping confirms the server tool path. Then continue helping the user.", | ||
| }); | ||
| export const chatAgentInitialDataSchema = v.optional( | ||
| v.object({ | ||
| mode: v.literal(VALIDATED_CONSTRUCTION_MODE), | ||
| }), | ||
| ); | ||
|
|
||
| export type ChatAgentInitialData = v.InferOutput< | ||
| typeof chatAgentInitialDataSchema | ||
| >; | ||
|
|
||
| export function ChatAgent() { | ||
| const initialData = useInitialData<ChatAgentInitialData>(); | ||
| useModel(`anthropic/${CHAT_MODEL_ID}`); | ||
| useSkill(confirmPath); | ||
| useSkill(sdcpnModellingSkill); | ||
| useTool(ping); | ||
| useTool(readPetrinautDoc); | ||
| return [ | ||
| "You are a concise assistant inside the Petrinaut editor.", | ||
| if (initialData?.mode === VALIDATED_CONSTRUCTION_MODE) { | ||
| for (const constructionTool of petrinautConstructionTools) { | ||
| useTool(constructionTool); | ||
| } | ||
| } | ||
| const instructions = [ | ||
| "You are the Brunch modelling assistant inside the Petrinaut editor.", | ||
| `Activate the \`${RUNBOOK_SKILL_NAME}\` skill before interviewing or constructing a process model.`, | ||
| "The Markdown IR is the shared workpiece of one looping lifecycle.", | ||
| "Call ping when you need to confirm the server tool path.", | ||
| `Activate the \`${STUB_SKILL_NAME}\` skill before calling ping.`, | ||
| "When the user asks how Petrinaut's UI works, call readPetrinautDoc.", | ||
| "A client-tool-result signal is JSON [{ toolCallId, toolName, output }]. Treat output as the browser's result for that call and continue helping the user.", | ||
| ].join("\n"); | ||
| ]; | ||
| if (initialData?.mode === VALIDATED_CONSTRUCTION_MODE) { | ||
| instructions.push( | ||
| "This is a construct-only headless conversation. Use only the supplied runbook IR as modelling input, do not interview, and build the net through the mounted Petrinaut tools instead of emitting net JSON.", | ||
| ); | ||
| } | ||
| return instructions.join("\n"); | ||
| } | ||
|
|
||
| /** | ||
| * Pinned, and never to be edited: conversation storage keys on this literal. | ||
| */ | ||
| ChatAgent.agentName = "brunch-chat-agent"; | ||
| ChatAgent.initialData = chatAgentInitialDataSchema; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.