Commit Graph

138 Commits

Author SHA1 Message Date
babc6e8599 chore: remove .grok/settings.json
Removed the settings file specifying the 'grok-code-fast-1' model to revert to default configuration.
2026-03-07 11:48:40 +00:00
fbf40e2f79 chore(gitignore): add .grok/ and *.patch ignores, remove grokkit
Update .gitignore to ignore new directories and patch files, and remove obsolete grokkit entry.
2026-03-07 11:47:28 +00:00
f36722ad2c feat(recipes): add template recipe and update final summary heading
- Added new template-recipe.md with structure for creating recipes.
- Changed "**Final Summary**" to "### Final Summary" in result-refactor.md for better formatting.
2026-03-07 00:53:38 +00:00
213a9869e6 docs(internal/recipe): update comment on search pattern default to "Go-style"
Changes the comment to describe the default as "Go-style" instead of the specific string for better generality.
2026-03-07 00:41:39 +00:00
757f422765 refactor(recipe): make search pattern configurable in file discovery
- Add SearchPattern field to Recipe struct
- Update discoverFiles to use configurable search pattern, defaulting to "if err != nil"
- Set default search_pattern in result-refactor.md recipe
2026-03-07 00:34:25 +00:00
ae8a199ece refactor(recipe): make file discovery fully generic using recipe metadata
Update discoverFiles to leverage recipe metadata for extensions and apply smart defaults more cleanly. Generalize logic with comments for future improvements, while retaining err != nil check for now.
2026-03-07 00:22:19 +00:00
8c14977ec6 feat(recipe): add smart defaults for package_path in file discovery
Enhance discoverFiles to respect explicit package_path param if provided.
If no param is given, intelligently default to 'src' directory if it exists,
otherwise fall back to project root (.).
2026-03-07 00:13:57 +00:00
f5c73ab291 refactor(recipe): add ResolvedParams for better param handling
Introduce ResolvedParams field to Recipe struct for storing resolved
parameter values from defaults and user overrides. Update loader to
populate and use it for template rendering. Adjust runner to use
ResolvedParams for root path and generalize file discovery.
2026-03-07 00:07:21 +00:00
1c79abce8d fix(recipe): add error handling to unified patch creation
Handle potential errors from file writes in createUnifiedPatch to prevent silent failures.
2026-03-06 23:57:22 +00:00
0e234419f4 feat(recipe): add fields for generic file discovery
Introduce ProjectLanguages and Extensions fields to the Recipe struct
to support option 2 for generic file discovery. Also update comments
for internal fields populated by the loader.
2026-03-06 23:55:54 +00:00
7ffbf352bc refactor(recipe): make file discovery generic using recipe metadata
- Build allowed extensions from recipe languages and extensions map
- Generalize filepath walking to filter by allowed extensions instead of hardcoding .go
- Retain Go-specific content check for now; can generalize later
- Simplify refactor JSON handling and patch creation by removing redundant comments and error checks
- Adjust comments and minor formatting for clarity
2026-03-06 23:51:42 +00:00
019ce1e95a refactor(cmd): improve boolean param handling and refine project root detection
- Enhance boolean parsing in runRecipe to handle variations like "1", "yes", "on" for true, and "0", "no", "off" for false, satisfying staticcheck.
- Reorganize and simplify findProjectRoot by removing checks for pyproject.toml and CMakeLists.txt, and adjusting .grokkit position.
2026-03-06 23:42:56 +00:00
95deb65f06 feat(recipe): add --param flag support and improve project root detection
- Introduce --param/-p flag to pass key=value parameters to recipes, parsed into a map with basic bool handling.
- Expand findProjectRoot to detect more project types (e.g., .gitignore, pyproject.toml, CMakeLists.txt).
- Clean up comments and minor refactoring in recipe resolution logic.
2026-03-06 23:37:00 +00:00
18bbb67789 refactor(recipe): enhance refactor handling with JSON collection and package path
- Introduce refactorJSONs to collect pure JSON from refactor steps for apply.
- Update discoverFiles to respect recipe's package_path parameter.
- Refine handleApplyStep to parse and apply changes more robustly.
- Remove outdated test output files.
2026-03-06 23:22:20 +00:00
405286abd2 refactor(recipes): update default package_path to internal/git
Changed the default value of the package_path parameter in result-refactor.md from "internal" to "internal/git".
2026-03-06 23:09:22 +00:00
a8208da4c1 refactor(recipe): implement one-file-at-a-time refactoring handler
Add refactorFiles to process discovered files individually, generating small JSON responses per file to avoid truncation. Update handleApplyStep to collect and parse multiple single-file JSONs into a unified patch. Switch discoverFiles comment to reflect real scanning. Add fallback default in Run for other steps.
2026-03-06 22:57:07 +00:00
0b5aa5eb57 refactor(recipe): improve error handling and restructure in runner
- Move FileChange struct to top-level for better organization.
- Enhance createUnifiedPatch with proper error handling on writes.
- Remove unused bufio import and update comments.
- Delete obsolete runner_test.go file.
2026-03-06 22:48:15 +00:00
7cb9eb3eb7 refactor(recipe): switch refactor step to strict JSON output
- Update result-refactor.md to output JSON array of file changes instead of code blocks
- Modify runner.go to parse JSON directly, removing regex-based extraction
- Add project_languages and extensions to recipe metadata
- Improve error handling and output consistency in steps
2026-03-06 22:40:29 +00:00
d4f3e3adbc refactor(recipe): update regex for robust Grok output matching
- Blank import bufio to avoid unused warnings.
- Refine regex to handle double-quoted format and fix backtick issues.
- Update comments for clarity on regex changes.
2026-03-06 22:25:39 +00:00
c5bdd44e55 fix(recipe): update regex to match Grok's current output style
Adjust the regex in handleApplyStep to flexibly match both old and new Grok formats for code blocks. Also, remove blank import for bufio as it's now used.
2026-03-06 22:21:58 +00:00
b2b8c1a482 refactor(recipe/runner): improve regex flexibility and simplify patch creation
- Update discoverFiles comment to be more concise.
- Enhance blockRe regex to optionally match leading "// " for filenames, supporting varied Grok output formats.
- Revise handleApplyStep comment to reflect regex changes.
- Simplify createUnifiedPatch by removing unnecessary error checks on fmt.Fprintf and defer closure.
2026-03-06 22:15:33 +00:00
40d40f7669 refactor(recipe): clean up runner implementation
- Adjust bufio import to blank (likely for side effects or pending use)
- Refine comments for clarity and remove unnecessary ones
- Split regex string to avoid backtick collisions in literals
- Add error handling to patch writing in createUnifiedPatch
- Minor formatting and defer close adjustments
2026-03-06 22:07:22 +00:00
7b415f8e26 feat(recipe): add file discovery and special step handling in runner
- Introduce discoverFiles function to scan Go files in 'internal' for error handling patterns.
- Add special case for "discover" or "find" steps to perform filesystem scans.
- Refine LLM prompting to enforce strict output format and shorten system prompt.
- Update apply/patch handling and unified patch creation with simplifications.
- Import bufio for potential future use and adjust regex for code block extraction.
2026-03-06 21:57:35 +00:00
852142730a refactor(recipe): enhance parsing for multi-line step content
Replace regex-based sub-section extraction with label-indexed parsing to
handle multi-line content, blank lines, and ensure reliability without
duplicates. Add clarifying comments for templates and summary extraction.
2026-03-06 21:48:35 +00:00
824bbcb85f refactor(recipe): simplify code block extraction regex
Update the regex in runner.go to use string concatenation for better readability.
Add test output files as fixtures for test verification.
2026-03-06 21:40:03 +00:00
b9de35f48b refactor(recipe): simplify apply step to dry-run only and add extraction tests
- Restrict filesystem interactions to apply/patch steps exclusively.
- Remove real apply logic with user confirmation; default to creating a patch file in dry-run mode.
- Update prompts, comments, and regex for better clarity and precision.
- Add unit tests for the extractCodeBlocks function to ensure reliable parsing.
2026-03-06 21:36:31 +00:00
5d0aec721d refactor(recipes): update result-refactor recipe for broader package path and error handling
- Change default package_path from internal/service to internal for wider applicability.
- Add instruction to output a specific message if no files are found or path does not exist in Step 1.
2026-03-06 21:11:17 +00:00
0ba427aaf6 feat(recipe): add apply/patch step handling with code block extraction and application
- Introduce special case in Runner.Run() for steps containing "apply" or "patch" in title.
- Add handleApplyStep to parse code blocks from previous results, support dry-run patch creation, or real application with user confirmation and backups.
- Implement extractCodeBlocks using regex to identify labelled Go code blocks.
- Add createUnifiedPatch for generating unified diff patches in dry-run mode.
- Remove final summary prompt and streamline recipe completion.
- Adjust system prompt for clarity.
2026-03-06 21:01:01 +00:00
d1ebd2af79 refactor(recipe): improve loading and execution logic
- Enhance recipe parsing in loader.go: extract overview, use split-based step extraction to avoid duplicates, refine final summary handling, and clean up comments/templates.
- Refine runner.go prompts: add Grok system message, simplify user prompts for conciseness, adjust result joining with separators, and remove unnecessary text.
2026-03-06 20:46:30 +00:00
5c67f78c27 feat(recipe): implement LLM-powered recipe execution
Add support for executing recipe steps via Grok API streaming, including parameter defaults from YAML, model selection via flags/config, previous step context, and a final summary prompt. Update runner to handle client and model, and refine loader to apply user params with fallbacks.
2026-03-06 20:32:04 +00:00
ec692b2086 docs(recipe): add feature overview for recipe system
Introduces a new Markdown file in todo/doing that outlines the recipe feature implementation, including key components, parsing logic, CLI integration, and progress checklist.
2026-03-06 19:16:57 +00:00
2cc728eed4 refactor(recipe): clean up comments, error handling, and output formatting
- Simplify import comments and error handling in cmd/recipe.go
- Streamline regex comment in internal/recipe/loader.go
- Enhance console output and add LLM placeholder in internal/recipe/runner.go
2026-03-06 19:00:16 +00:00
dcac119e57 fix(cmd/recipe): correct import path and add error handling for user input
- Updated import path for recipe package to match module name.
- Added error checking for fmt.Scanln to handle potential input errors gracefully.
2026-03-06 18:49:16 +00:00
8e414faa10 feat(cmd): add recipe run command
Implement the `recipe` command with `run` subcommand for executing transactional recipes.

- Resolve recipe paths: explicit, project-local (.grokkit/recipes), or global (~/.local/share/grokkit/recipes) with user prompt.
- Load and parse recipes using internal/recipe package.
- Integrate with root command and project root detection.
2026-03-06 18:45:03 +00:00
6bd72aad25 refactor(recipe): improve subRe regexp and add explanatory comments
Simplify the subRe regular expression by using a non-capturing group for the section labels instead of alternation, and switch the lookahead to a non-capturing group for consistency. Add comments to document the purpose of stepRe and subRe for better maintainability.
2026-03-06 18:39:56 +00:00
aa38e92fb5 feat(recipe): add recipe system for Result[T] refactoring
Implement recipe loading, parsing, and running infrastructure.
Add initial result-refactor recipe for converting Go error handling to monadic Result[T] style.
Includes markdown recipe definition, YAML frontmatter parsing, step extraction, and basic runner.
2026-03-06 18:35:58 +00:00
736fe4fcd6 Merge pull request 'fix(testgen): distinguish between C and C++ based on file extension' (#4) from fix/testgen_for_cpp into master
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 23s
CI / Build (push) Successful in 22s
Reviewed-on: #4
2026-03-06 14:40:00 +00:00
Gregory Gauthier
13b6c88ba3 fix(testgen): distinguish between C and C++ based on file extension
All checks were successful
CI / Test (pull_request) Successful in 55s
CI / Lint (pull_request) Successful in 33s
CI / Build (pull_request) Successful in 22s
Update language detection in testgen to set "C++" for files with .cpp, .cc, .cxx extensions, and "C" otherwise when the language is specified as "C/C++".
2026-03-06 14:36:49 +00:00
6f6596c13f chore(lint): simplify golangci-lint configuration
All checks were successful
CI / Test (push) Successful in 34s
CI / Lint (push) Successful in 27s
CI / Build (push) Successful in 22s
Reduce enabled linters to misspell with standard defaults, add gofmt formatter,
move errcheck settings, and minimize run and issues configurations for brevity.
2026-03-04 20:04:43 +00:00
f0322a84bd chore(lint): enhance golangci configuration and add security annotations
Some checks failed
CI / Test (push) Successful in 33s
CI / Lint (push) Failing after 17s
CI / Build (push) Successful in 21s
- Expand .golangci.yml with more linters (bodyclose, errcheck, etc.), settings for govet, revive, gocritic, gosec
- Add // nolint:gosec comments for intentional file operations and subprocesses
- Change file write permissions from 0644 to 0600 for better security
- Refactor loops, error handling, and test parallelism with t.Parallel()
- Minor fixes: ignore unused args, use errors.Is, adjust mkdir permissions to 0750
2026-03-04 20:00:32 +00:00
0cf0351826 chore(todo): remove priorities from queued items and add admin tool
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 26s
CI / Build (push) Successful in 21s
- Removed priority lines from various TODO markdown files
- Added new admin.md for grokkit admin tool
- Updated README.md with new entry
2026-03-04 19:23:03 +00:00
c35dbffe9b chore(ci): remove auto-complete TODO workflow
All checks were successful
CI / Test (push) Successful in 31s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 21s
Deleted the Gitea Actions workflow responsible for automatically moving TODO files from queued to completed on pull request events.
2026-03-04 18:27:48 +00:00
d92b88e90b Merge pull request 'Add --base Flag to prdescribe Command for Custom Base Branch Comparison' (#3) from fix/add_base_branch_to_prdescribe into master
All checks were successful
CI / Test (push) Successful in 32s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 21s
Reviewed-on: #3
2026-03-04 18:16:54 +00:00
b1d3a445ec feat(prdescribe): add configurable base branch flag
Some checks failed
Auto-complete TODO / move-todo (pull_request) Failing after 1s
CI / Test (pull_request) Successful in 34s
CI / Lint (pull_request) Successful in 24s
CI / Build (pull_request) Successful in 20s
Release / Create Release (push) Successful in 35s
Introduce a new --base flag (default: "master") to specify the base branch for diff comparison in the PR describe command. Update logic to use this base in git diff commands and fallback to origin/base. Adjust no-changes message accordingly. Add tests for custom base and default behavior.
2026-03-04 18:11:28 +00:00
Gregory Gauthier
11faf95573 chore(todo): move completed tasks to completed dir and update README
All checks were successful
CI / Test (push) Successful in 34s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 20s
- Renamed queued/changelog.md and queued/non-interactive-query.md to completed/
- Updated README.md queued list: removed non-interactive-query, renumbered items, set TODO_ITEM to [99]
- Updated README.md completed list: added non-interactive-query, fixed changelog path to completed
2026-03-04 16:13:45 +00:00
Gregory Gauthier
d9b13739b5 docs(changelog): add entry for v0.1.9 release
All checks were successful
CI / Test (push) Successful in 32s
CI / Lint (push) Successful in 26s
CI / Build (push) Successful in 20s
Introduce changelog updates for v0.1.9, including new query command implementation, configuration additions, README updates, and TODO revisions.
2026-03-04 16:02:21 +00:00
a6d52d890b Merge pull request 'feature/grokkit_query' (#2) from feature/grokkit_query into master
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 20s
Release / Create Release (push) Successful in 34s
Reviewed-on: #2
2026-03-04 15:55:14 +00:00
Gregory Gauthier
587be3a046 docs: add grokkit query command documentation to README
Some checks failed
Auto-complete TODO / move-todo (pull_request) Failing after 1s
CI / Test (pull_request) Successful in 35s
CI / Lint (pull_request) Successful in 27s
CI / Build (pull_request) Successful in 21s
- Added entry to commands list
- Created new section with usage examples and features
2026-03-04 15:50:46 +00:00
Gregory Gauthier
cc6a2f642f feat(cmd): add query command for one-shot technical questions
- Implement new `query` command in cmd/query.go for non-interactive Grok queries focused on programming
- Add wordy flag for detailed responses
- Update root.go to include queryCmd
- Set default model for query in config.go
- Add .grok/settings.json with fast model configuration
2026-03-04 15:39:41 +00:00
Gregory Gauthier
5bf6b0c91c docs(todo): reorganize queued tasks and update completed items
All checks were successful
CI / Test (push) Successful in 33s
CI / Lint (push) Successful in 25s
CI / Build (push) Successful in 20s
- Reordered and updated queued task list with new entries like non-interactive-query.md.
- Moved changelog.md to completed with version note.
- Standardized link formats and list markers in README.md.
2026-03-04 09:50:54 +00:00