refine task questons

This commit is contained in:
Robin Olsen
2026-03-16 12:30:26 +01:00
parent b7e2cc2c63
commit 42f9469189
10 changed files with 160 additions and 68 deletions

View File

@@ -40,27 +40,29 @@ func (t *BacklogRefinementTask) Details(interfaceType InterfaceType) TaskDetails
return BaseDetails(interfaceType).
WithTitle("Backlog Refinement Task").
WithDescription(backlogRefinementDescription).
WithTimeToComplete("12m").
WithDifficulty("Medium")
WithTimeToComplete("2m").
WithDifficulty("Easy")
}
func (t *BacklogRefinementTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType).With(
huh.NewGroup(
huh.NewSelect[int]().
Key("how-many-duplicate-issues").
Title("How many duplicate issues did you close during refinement?").
Key("duplicate-issues-closed").
Title("How many issues did you close during refinement?").
Description("There was only one issue required for the task, if you closed more why?").
Options(
huh.NewOption("1", 1),
huh.NewOption("2", 2),
huh.NewOption("3+", 3),
huh.NewOption("1+ I saw there where more to be closed", 2),
huh.NewOption("1+ I closed more by mistake", 3),
huh.NewOption("0 I didn't close any", 4),
),
),
)
}
func (t *BacklogRefinementTask) QuestionnaireKeys(_ InterfaceType) []string {
return []string{"task_completed", "task_difficulty", "how-many-duplicate-issues"}
return BaseKeys().With("duplicate-issues-closed")
}
func (t *BacklogRefinementTask) Setup(ctx context.Context) error {

View File

@@ -94,27 +94,46 @@ func ClearIssues(app *App) error {
}
func BaseQuestions(interfaceType InterfaceType) Questions {
var taskRating int
return Questions{
huh.NewGroup(
huh.NewConfirm().
Key("task_completed").
Title("Did you complete the task?"),
),
huh.NewConfirm().Key("task_completed").
Title("Where you able to complete the task?").
Description("")),
huh.NewGroup(
huh.NewSelect[int]().Value(&taskRating).
Key("task_difficulty").
huh.NewSelect[int]().Key("interface_difficulty").
Title("How difficult was it to use the interface?").
Description("By interface we mean the method of interaction with the task.").
Options(
huh.NewOption("Very easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Hard", 4),
).
Title("How difficult was the task?"),
),
),
huh.NewGroup(
huh.NewSelect[int]().Key("task_difficulty").
Title("How difficult did you find the task?").
Description("Only rate the difficulty of the task itself. Not the usability of the interface").
Options(
huh.NewOption("Very easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Hard", 4),
),
),
}
}
type Keys []string
func BaseKeys() Keys {
return []string{"task_completed", "interface_difficulty", "task_difficulty"}
}
func (k Keys) With(keys ...string) Keys {
return append(k, keys...)
}
func Question(fields ...huh.Field) *huh.Group {
return huh.NewGroup(fields...)
}

View File

@@ -7,6 +7,7 @@ import (
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/internal/utils/check"
"github.com/charmbracelet/huh"
)
const codingDescription = `You are tasked with doing a chore in the codebase.
@@ -22,11 +23,15 @@ Your task:
- Description: "We need to upgrade the MongoDB Driver dependency to the latest version."
- Status: "In Progress"
- Issue Type: "Chore"
2. A file will appear in the current directory named "code.txt".
2. Assign the issue to yourself as "Me".
3. A file will appear in the current directory named "code.txt".
Open it and follow the instructions inside. And save the file after you are done.
3. When you are done, mark this and the issue you made as "Closed".`
4. When you are done, mark this and the issue you made as "Closed".`
var textFileDescription = `
# Instructions for the coding task
Please upgrade the MongoDB Driver dependency in the go.mod file to the latest version.
It should be v1.17.9. After you are done, save the file and mark the task as completed.
############################################################`
@@ -85,16 +90,33 @@ func (t *CodingTask) Config() Config {
}
func (t *CodingTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType).WithTitle("Coding Task").WithDescription(codingDescription)
return BaseDetails(interfaceType).
WithTitle("Coding Task").
WithDescription(codingDescription).
WithDifficulty("Hard").WithTimeToComplete("5m")
}
func (t *CodingTask) Questions(interfaceType InterfaceType) (questions Questions) {
return BaseQuestions(interfaceType)
return BaseQuestions(interfaceType).
With(
huh.NewGroup(
huh.NewSelect[int]().
Key("coding_interface_friction").
Title("How much friction did you feel switching between editing code and using the interface?").
Description("By friction we mean the difficulty or inconvenience of switching between these two activities.").
Options(
huh.NewOption("Very low", 1),
huh.NewOption("Low", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("High", 4),
huh.NewOption("Very high", 5),
),
),
)
}
func (t *CodingTask) QuestionnaireKeys(interfaceType InterfaceType) []string {
keys := []string{"task_completed", "task_difficulty"}
return keys
return BaseKeys().With("coding_interface_friction")
}
func (t *CodingTask) Setup(ctx context.Context) error {
@@ -144,7 +166,7 @@ func (t *CodingTask) Validate(ctx context.Context) ValidationFeedback {
expect.NotEmptyAndEqual(issue.Title, "Upgrade MongoDB Driver Dependency", "Issue title")
expect.NotEmptyAndEqual(issue.Description,
"We need to upgrade the MongoDB Driver dependency to the latest version.", "Issue description")
"Upgrade the MongoDB Driver dependency to the latest version.", "Issue description")
expect.NotEmptyAndEqual(issue.Assignee, "Me", "Issue Assignee")

View File

@@ -6,6 +6,7 @@ import (
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/internal/utils/check"
"github.com/charmbracelet/huh"
)
const description = `You are tasked with creating a new issue in the project management system.
@@ -35,15 +36,32 @@ func (t *CreateIssueTask) Config() Config {
}
func (t *CreateIssueTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType).WithTitle("Create Issue Task").WithDescription(description)
return BaseDetails(interfaceType).
WithTitle("Create Issue Task").
WithDescription(description).
WithDifficulty("Medium").
WithTimeToComplete("3m")
}
func (t *CreateIssueTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType)
return BaseQuestions(interfaceType).With(
huh.NewGroup(
huh.NewSelect[int]().Key("context_difficulty").
Title("How difficult was it remembering what needed to be done for the task?").
Description("We are interested in how difficult it was keeping track of the task requirements. And if one interface helps you keep context").
Options(
huh.NewOption("Very Easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Difficult", 4),
huh.NewOption("Very Difficult", 5),
),
),
)
}
func (t *CreateIssueTask) QuestionnaireKeys(_ InterfaceType) []string {
return []string{"task_completed", "task_difficulty"}
return BaseKeys().With("context_difficulty")
}
func (t *CreateIssueTask) Setup(ctx context.Context) error {

View File

@@ -40,24 +40,31 @@ func (t *DependencyManagementTask) Details(interfaceType InterfaceType) TaskDeta
return BaseDetails(interfaceType).
WithTitle("Dependency Management Task").
WithDescription(dependencyManagementDescription).
WithTimeToComplete("15m").
WithDifficulty("Hard")
WithTimeToComplete("3m").
WithDifficulty("Medium")
}
func (t *DependencyManagementTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType).With(
huh.NewGroup(
huh.NewSelect[int]().
Title("How many foundational issues did you identify?").
huh.NewSelect[int]().Key("discovery_difficulty").
Title("How difficult was it discovering the dependencies?").
Description("We are interested in how difficult it was to discover the issues that needed to be addressed.").
Options(
huh.NewOption("1", 1),
huh.NewOption("2", 2),
huh.NewOption("3+", 3),
huh.NewOption("Very Easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Difficult", 4),
huh.NewOption("Very Difficult", 5),
),
),
)
}
func (t *DependencyManagementTask) QuestionnaireKeys(_ InterfaceType) []string {
return BaseKeys().With("discovery_difficulty")
}
func (t *DependencyManagementTask) Setup(ctx context.Context) error {
if err := ClearIssues(t.app); err != nil {
return err

View File

@@ -48,26 +48,40 @@ func (t *GitTask) Config() Config {
}
func (t *GitTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType).WithTitle("Git Task").WithDescription(gitTaskDescription)
return BaseDetails(interfaceType).
WithTitle("Git Task").
WithDescription(gitTaskDescription).
WithDifficulty("Hard").WithTimeToComplete("5m")
}
func (t *GitTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType).With(
return BaseQuestions(interfaceType).
With(
huh.NewGroup(
huh.NewSelect[string]().Key("git_interface_used").
Title("What Git Interface did you use for the task?").
Description("If ").
Options(
huh.Option[string]{Value: "cli", Key: "Command Line Interface"},
huh.Option[string]{Value: "tui", Key: "Terminal User Interface"},
huh.Option[string]{Value: "gui", Key: "Graphical User Interface"},
),
),
).With(
huh.NewGroup(
huh.NewSelect[string]().Title("What Git Interface did you use?").
Key("git_interface_used").
huh.NewSelect[string]().Key("git_interface_normaly").
Title("What Git Interface do you normally use?").
Description("If ").
Options(
huh.Option[string]{Value: "cli", Key: "Command Line Interface"},
huh.Option[string]{Value: "tui", Key: "Terminal User Interface"},
huh.Option[string]{Value: "gui", Key: "Graphical User Interface"},
),
),
)
))
}
func (t *GitTask) QuestionnaireKeys(interfaceType InterfaceType) []string {
_ = interfaceType
return []string{"task_completed", "task_difficulty", "git_interface_used"}
func (t *GitTask) QuestionnaireKeys(_ InterfaceType) []string {
return BaseKeys().With("git_interface_used", "git_interface_normaly")
}
func (t *GitTask) Setup(ctx context.Context) error {
@@ -108,12 +122,10 @@ func (t *GitTask) Validate(ctx context.Context) ValidationFeedback {
return expect.ValidationFeedback
}
_ = issues
issue := t.setupIssue
if issue.Status == models.StatusInProgress || gitTaskInProgress {
gitTaskInProgress = true
} else {
@@ -130,7 +142,6 @@ func (t *GitTask) Validate(ctx context.Context) ValidationFeedback {
}
}
headRef, err := t.repo.Head()
if err != nil {
expect.Fail("No commits found in the Git repository. Please commit your changes.")
@@ -145,7 +156,6 @@ func (t *GitTask) Validate(ctx context.Context) ValidationFeedback {
expect.NotEmptyAndEqual(strings.TrimSpace(commit.Message), "updated codebase", "Git commit message")
tree, err := commit.Tree()
if err != nil {
expect.Fail("Failed to read commit tree: " + err.Error())

View File

@@ -34,14 +34,18 @@ func (t *IssueReviewCleanupTask) Details(interfaceType InterfaceType) TaskDetail
return BaseDetails(interfaceType).
WithTitle("Issue Review and Cleanup Task").
WithDescription(issueReviewCleanupDescription).
WithTimeToComplete("8m").
WithDifficulty("Easy")
WithTimeToComplete("3m").
WithDifficulty("Medium")
}
func (t *IssueReviewCleanupTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType)
}
func (t *IssueReviewCleanupTask) QuestionnaireKeys(_ InterfaceType) []string {
return BaseKeys()
}
func (t *IssueReviewCleanupTask) Setup(ctx context.Context) error {
if err := ClearIssues(t.app); err != nil {
return err

View File

@@ -43,23 +43,29 @@ func (t *PriorityManagementTask) Details(interfaceType InterfaceType) TaskDetail
return BaseDetails(interfaceType).
WithTitle("Priority Management Task").
WithDescription(priorityManagementDescription).
WithTimeToComplete("8m").
WithDifficulty("Easy")
WithTimeToComplete("4m").
WithDifficulty("Medium")
}
func (t *PriorityManagementTask) Questions(interfaceType InterfaceType) Questions {
return BaseQuestions(interfaceType).
With(
huh.NewGroup(
huh.NewSelect[int]().
Title("How many issues did you reprioritize or comment on?").
Options(
huh.NewOption("1-2", 1),
huh.NewOption("3-4", 2),
huh.NewOption("5+", 3),
),
),
)
return BaseQuestions(interfaceType).With(
huh.NewGroup(
huh.NewSelect[int]().Key("management_difficulty").
Title("How did it feel managing multiple issues?").
Description("Managing multiple issues would require careful prioritization and coordination.").
Options(
huh.NewOption("Very Easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Difficult", 4),
huh.NewOption("Very Difficult", 5),
),
),
)
}
func (t *PriorityManagementTask) QuestionnaireKeys(_ InterfaceType) []string {
return BaseKeys().With("management_difficulty")
}
func (t *PriorityManagementTask) Setup(ctx context.Context) error {

View File

@@ -40,7 +40,7 @@ func (t *SprintPlanningTask) Details(interfaceType InterfaceType) TaskDetails {
return BaseDetails(interfaceType).
WithTitle("Sprint Planning Task").
WithDescription(sprintPlanningDescription).
WithTimeToComplete("15m").
WithTimeToComplete("3m").
WithDifficulty("Medium")
}
@@ -49,18 +49,21 @@ func (t *SprintPlanningTask) Questions(interfaceType InterfaceType) Questions {
huh.NewGroup(
huh.NewSelect[int]().
Key("sprint-planning-selected-issues").
Title("How many issues did you select for the sprint?").
Title("How difficult was it selecting issues for the sprint?").
Description("We are interested in how intuitive and time-consuming the selection process was.").
Options(
huh.NewOption("2-3 issues", 1),
huh.NewOption("4-5 issues", 2),
huh.NewOption("6+ issues", 3),
huh.NewOption("Very Easy", 1),
huh.NewOption("Easy", 2),
huh.NewOption("Moderate", 3),
huh.NewOption("Difficult", 4),
huh.NewOption("Very Difficult", 5),
),
),
)
}
func (t *SprintPlanningTask) QuestionnaireKeys(_ InterfaceType) []string {
return []string{"task_completed", "task_difficulty", "sprint-planning-selected-issues"}
return BaseKeys().With("sprint-planning-selected-issues")
}
func (t *SprintPlanningTask) Setup(ctx context.Context) error {