diff --git a/.trunk/configs/cspell.yaml b/.trunk/configs/cspell.yaml new file mode 100644 index 000000000..594e0214a --- /dev/null +++ b/.trunk/configs/cspell.yaml @@ -0,0 +1,32 @@ +# - Install +# https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker +# +# - Add this to your settings.json +# ``` +# "cSpell.customDictionaries": { +# "custom-words": { +# "name": "custom-words", +# "path": "./.trunk/configs/custom-words.txt", +# "addWords": true, +# } +# }, +# "cSpell.enabled": true, +# ``` +# +# - Misspelled words will have a blue underline. Access the quick fix menu (Ctrl +# + .) and add the word to the `custom-words` dictionary. + +version: "0.2" +# Suggestions can sometimes take longer on CI machines, +# leading to inconsistent results. +suggestionsTimeout: 5000 # ms +dictionaries: + - python + - typescript + - go + - java + - custom-words + +dictionaryDefinitions: + - name: custom-words + path: ./.trunk/configs/custom-words.txt diff --git a/.trunk/configs/custom-words.txt b/.trunk/configs/custom-words.txt new file mode 100644 index 000000000..7f033b25f --- /dev/null +++ b/.trunk/configs/custom-words.txt @@ -0,0 +1,42 @@ +caikit +codeplan +codeplanner +coolstore +coolstuff +deepseek +diffable +djzager +flywaydb +frobinate +genai +initialcontextfactory +jakartaee +javaee +javax +jaxrs +jdbc +jdtls +jndi +kantra +konveyor +langchain +levelname +LOGLEVEL +mistralai +mixtral +moderations +OBJC +Ollama +pgaikwad +picketlink +pydantic +PYTHONPATH +quarkus +resteasy +smallrye +springboot +sussman +templ +tgis +tiiuae +webmvc diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 4468b2675..40d0a491e 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -24,6 +24,7 @@ lint: - name: lint run: bandit --exit-zero -c bandit.yaml --format json --output ${tmpfile} ${target} enabled: + - cspell@8.17.2 - gofmt@1.20.4 - golangci-lint@1.61.0 - actionlint@1.7.3 @@ -65,6 +66,8 @@ lint: - notebooks/** # Complaining about intentionally empty values - .github/workflows/** + # Weird recursive cspell thing doesn't check this file properly + - .trunk/configs/custom-words.txt actions: enabled: - trunk-announce diff --git a/kai/reactive_codeplanner/agent/analyzer_fix/agent.py b/kai/reactive_codeplanner/agent/analyzer_fix/agent.py index e5804ac08..4560da142 100644 --- a/kai/reactive_codeplanner/agent/analyzer_fix/agent.py +++ b/kai/reactive_codeplanner/agent/analyzer_fix/agent.py @@ -24,7 +24,7 @@ class _llm_response: reasoning: str | None source_file: str | None - addional_information: str | None + additional_information: str | None class AnalyzerAgent(Agent): @@ -135,16 +135,16 @@ def execute(self, ask: AgentRequest) -> AnalyzerFixResponse: incidents=ask.incidents, ) - aimessage = self._model_provider.invoke( + ai_message = self._model_provider.invoke( [system_message, HumanMessage(content=content)] ) - resp = self.parse_llm_response(aimessage, language) + resp = self.parse_llm_response(ai_message, language) return AnalyzerFixResponse( encountered_errors=[], file_to_modify=Path(os.path.abspath(ask.file_path)), reasoning=resp.reasoning, - additional_information=resp.addional_information, + additional_information=resp.additional_information, updated_file_content=resp.source_file, ) @@ -186,7 +186,7 @@ def parse_llm_response(self, message: BaseMessage, language: str) -> _llm_respon return _llm_response( reasoning=reasoning, source_file=source_file, - addional_information=additional_details, + additional_information=additional_details, ) diff --git a/kai/reactive_codeplanner/agent/reflection_agent.py b/kai/reactive_codeplanner/agent/reflection_agent.py index 3f617e5ff..5a497bc0a 100644 --- a/kai/reactive_codeplanner/agent/reflection_agent.py +++ b/kai/reactive_codeplanner/agent/reflection_agent.py @@ -468,7 +468,7 @@ def _parse_llm_response( if isinstance(content, list): return None match_updated_file = re.search( - r"[##|\*\*] [U|u]pdated [F|f]ile\s+.*?```\w+\n([\s\S]*?)```", + r"[##|\*\*] [U|u]pdated [F|f]ile\s+.*?```\w+\n([\s\S]*?)```", # trunk-ignore(cspell) content, re.DOTALL, ) diff --git a/kai/reactive_codeplanner/task_runner/analyzer_lsp/task_runner.py b/kai/reactive_codeplanner/task_runner/analyzer_lsp/task_runner.py index 4744c012c..2ed80210e 100644 --- a/kai/reactive_codeplanner/task_runner/analyzer_lsp/task_runner.py +++ b/kai/reactive_codeplanner/task_runner/analyzer_lsp/task_runner.py @@ -21,10 +21,12 @@ class AnalyzerTaskRunner(TaskRunner): - """This agent is reponsible for taking a given Incident and determining a fix for that incident. + """ + This agent is responsible for taking a given Incident and determining a fix + for that incident. - For a given file it will asking LLM's for the changes that are needed for the at whole file - returning the results. + For a given file it will asking LLM's for the changes that are needed for + the at whole file returning the results. """ def __init__(self, agent: AnalyzerAgent) -> None: