From eff0d844ca6e35bfbc2d5fdaa2d2f92177611f2e Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 15 Jan 2026 00:23:44 +0000 Subject: Contract type system --- makima/frontend/src/routes/contracts.tsx | 72 +++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 10 deletions(-) (limited to 'makima/frontend/src/routes/contracts.tsx') diff --git a/makima/frontend/src/routes/contracts.tsx b/makima/frontend/src/routes/contracts.tsx index 8c90804..f09ec5b 100644 --- a/makima/frontend/src/routes/contracts.tsx +++ b/makima/frontend/src/routes/contracts.tsx @@ -11,10 +11,12 @@ import type { ContractWithRelations, ContractPhase, ContractStatus, + ContractType, CreateContractRequest, RepositorySourceType, DaemonDirectory, } from "../lib/api"; +import { getValidPhases, getDefaultPhase } from "../lib/api"; export default function ContractsPage() { const { isAuthenticated, isAuthConfigured, isLoading: authLoading } = useAuth(); @@ -71,7 +73,8 @@ function ContractsPageContent() { const [isCreating, setIsCreating] = useState(false); const [newContractName, setNewContractName] = useState(""); const [newContractDescription, setNewContractDescription] = useState(""); - const [initialPhase, setInitialPhase] = useState("research"); + const [contractType, setContractType] = useState("simple"); + const [initialPhase, setInitialPhase] = useState("plan"); const [repoType, setRepoType] = useState("remote"); const [repoName, setRepoName] = useState(""); const [repoUrl, setRepoUrl] = useState(""); @@ -136,7 +139,8 @@ function ContractsPageContent() { const data: CreateContractRequest = { name: newContractName.trim(), description: newContractDescription.trim() || undefined, - initialPhase: initialPhase !== "research" ? initialPhase : undefined, + contractType: contractType, + initialPhase: initialPhase !== getDefaultPhase(contractType) ? initialPhase : undefined, }; try { @@ -171,7 +175,8 @@ function ContractsPageContent() { setIsCreating(false); setNewContractName(""); setNewContractDescription(""); - setInitialPhase("research"); + setContractType("simple"); + setInitialPhase("plan"); setRepoType("remote"); setRepoName(""); setRepoUrl(""); @@ -184,6 +189,8 @@ function ContractsPageContent() { }, [ newContractName, newContractDescription, + contractType, + initialPhase, repoType, repoName, repoUrl, @@ -200,7 +207,8 @@ function ContractsPageContent() { setIsCreating(false); setNewContractName(""); setNewContractDescription(""); - setInitialPhase("research"); + setContractType("simple"); + setInitialPhase("plan"); setRepoType("remote"); setRepoName(""); setRepoUrl(""); @@ -424,6 +432,48 @@ function ContractsPageContent() { /> + {/* Contract Type */} +
+ +
+ + +
+

+ {contractType === "simple" + ? "Plan → Execute: Simple workflow with a plan document" + : "Research → Specify → Plan → Execute → Review: Full specification-driven development with TDD"} +

+
+ {/* Starting Phase */}
-- cgit v1.2.3