luigidemasi commented on code in PR #151:
URL: https://github.com/apache/camel-kit/pull/151#discussion_r4437644944


##########
kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ResourceConsistencyTest.java:
##########
@@ -1278,6 +1278,19 @@ void 
planningContractsAreRuntimeAwareAndHaveSingleArtifactOwners() throws IOExce
         assertTrue(implement.contains("`guides/maven-dependencies.md` | Spring 
Boot/Quarkus only"));
     }
 
+    @Test
+    void mainRunScriptPinsTheProjectCamelVersion() throws IOException {
+        Path root = 
repositoryRoot().resolve("kit/camel-kit-core/src/main/resources/skills");
+        String runScript = 
Files.readString(root.resolve("camel-implement/guides/run-script.md"));
+        String orchestrator = 
Files.readString(root.resolve("camel-implement/guides/orchestrator.md"));
+        String greenfield = 
Files.readString(root.resolve("camel-plan/guides/task-template-greenfield.md"));
+
+        assertTrue(runScript.contains("--camel-version={CAMEL_VERSION}"));

Review Comment:
   [P2] Check the version argument inside the executable Bash template
   
   This assertion also matches the mandatory-rules table. I removed only the 
`--camel-version={CAMEL_VERSION}` line from the `run.sh` Bash block, restoring 
the original unpinned command, and all 39 tests in 
`ResourceConsistencyTest,ShippedAssetStructureTest` still passed. The mutation 
was then restored byte-for-byte.
   
   Please extract/assert the actual command block instead of searching the 
entire guide, and cover the installed guide too. Deleting the executable 
argument must fail the regression test even while the explanatory table still 
mentions it.
   
   _AI-generated by Codex on behalf of @luigidemasi._



##########
kit/camel-kit-core/src/main/resources/skills/camel-implement/guides/run-script.md:
##########
@@ -40,9 +42,13 @@ echo "Starting {MODULE_NAME} integration..."
 jbang camel@apache/camel run \
   {route-file-1}.camel.yaml {route-file-N}.camel.yaml \
   {xslt-file-1}.xsl {xslt-file-N}.xsl \
+  --camel-version={CAMEL_VERSION} \

Review Comment:
   [P2] Preserve a project-context placeholder through installation
   
   `SkillResourceInstaller` runs `VersionPlaceholderResolver` over this guide, 
and `{CAMEL_VERSION}` is bound to `DistributionConfig.camelMainVersion()`, not 
`.camel-kit/config.properties`. With the supported project version `4.18.4`, 
all eight production generators install a mandatory rule and Bash template 
containing `--camel-version=4.22.1`. Reinitialization preserves that output.
   
   The following instruction also becomes “Replace `4.22.1` with the literal 
version read from ...”. That asks the agent to undo the version demanded by the 
mandatory rule, leaving conflicting instructions in the installed guide. This 
is an installed-resource defect; I have not claimed every live agent 
necessarily chooses the wrong version.
   
   Please use a token that survives installation, such as 
`{project.camelVersion}` (the existing convention in 
`skills/shared/mcp-setup.md`) or consistently `[CAMEL_VERSION]`, and cover the 
installed output with a project version different from the distribution 
default. The shared resolver can stay unchanged.
   
   _AI-generated by Codex on behalf of @luigidemasi._



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to