%%{init: {"theme": "dark", "themeVariables": {"background": "#0a0912", "primaryColor": "#211e32", "primaryTextColor": "#f6f3ff", "primaryBorderColor": "#aa96ff", "lineColor": "#aa96ff", "secondaryColor": "#2b2134", "tertiaryColor": "#171422", "fontFamily": "Manrope, Arial, sans-serif"}, "flowchart": {"curve": "stepBefore", "nodeSpacing": 36, "rankSpacing": 54}}}%%
flowchart LR
SRC["Primary sources"]
REPO["Current repository code"]
MEMORY["Research memory"]
RESEARCH["Read-only research
Verify dates, versions, limits"]
REPORT["Saved verified digest"]
GATE{"Direct code match?
Bounded and testable?"}
RECORD["Research-only record
WATCH, weak fit, coursework"]
QUEUE["Stable queue
One unfinished draft"]
CHAT["New FuegoWork Apps chat
One chat per selected draft"]
WORKTREE["Target repository worktree
Named local branch"]
CHECKS["Local change and checks
Synthetic data where needed"]
PACKET["Review packet in the same chat
Diff, results, demonstration"]
DECISION{"Your decision"}
APPROVED["Approve the reviewed commit"]
INTEGRATE["Check base and checkout
Guarded local integration"]
RELEASE["Separate explicit decision
for push, PR, or deploy"]
REVISE["Request changes
Same chat and branch"]
DECLINE["Decline
Retain local branch"]
SRC --> RESEARCH
REPO --> RESEARCH
MEMORY --> RESEARCH
RESEARCH --> REPORT --> GATE
GATE -- "No / WATCH" --> RECORD
GATE -- "Eligible" --> QUEUE
QUEUE --> CHAT --> WORKTREE --> CHECKS --> PACKET --> DECISION
DECISION -- "Approve" --> APPROVED --> INTEGRATE --> RELEASE
DECISION -- "Request changes" --> REVISE --> CHAT
DECISION -- "Decline" --> DECLINE
classDef input fill:#211e32,stroke:#8f81bf,color:#f6f3ff,stroke-width:1px;
classDef research fill:#222039,stroke:#aa96ff,color:#f6f3ff,stroke-width:2px;
classDef gate fill:#30273a,stroke:#e3b45c,color:#f6f3ff,stroke-width:2px;
classDef draft fill:#302325,stroke:#ff8462,color:#f6f3ff,stroke-width:2px;
classDef human fill:#29243b,stroke:#aa96ff,color:#f6f3ff,stroke-width:2px;
classDef approved fill:#1d312e,stroke:#43cf95,color:#f6f3ff,stroke-width:2px;
classDef quiet fill:#1b1a25,stroke:#88819d,color:#d6d1e2,stroke-width:1px;
class SRC,REPO,MEMORY input;
class RESEARCH,REPORT research;
class GATE gate;
class QUEUE,CHAT,WORKTREE,CHECKS,PACKET draft;
class DECISION,REVISE human;
class APPROVED,INTEGRATE approved;
class RECORD,DECLINE,RELEASE quiet;