You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "ggbdpq (via GitHub)" <gi...@apache.org> on 2026/10/18 20:23:14 UTC
[PR] fix(runtime-host): name the authoritative Skill creation directory in prompts [maka]
ggbdpq opened a new pull request, #6157:
URL: https://github.com/apache/maka/pull/6157
## Summary
Fixes #5012.
The catalog repository already scans `<Host data root>/skills`, but nothing told the model where that is: the canonical snapshot did not expose the directory, and the interactive prompt rendered no location guidance at all when the catalog was empty. A model asked to create a local Skill had to guess a Maka data directory and could write into another installation's root while reporting success (the exact reproduction in the issue).
This change:
- carries the Host-authoritative `<root>/skills` path into `CanonicalSkillInventorySnapshot` as `workspaceSkillDirectory` (same lease root the scan uses, `canonicalDataRoot`-validated);
- renders a short creation-guidance fragment in **both** the main-session and child-agent prompt paths, independent of catalog contents, directing the model to write `<directory>/<skill-id>/SKILL.md`, read that exact file back before reporting success, and defer to an explicitly requested project/user/managed-source scope.
It is prompt guidance only, per the issue's boundaries: no new tool, no write redirect, no migration, no discovery/UI changes, no `isPackaged` branch, no hard-coded development path.
Note: #5013 addressed the same issue but was closed by the stale bot on 2026-10-16 without a quality verdict. This PR is an independent implementation against current `main`; no code was taken from it.
## Verification
| Claim | Command | Result |
| --- | --- | --- |
| Snapshot exposes the workspace Skill directory | `node --test --test-name-pattern="Host-authoritative workspace Skill directory" packages/runtime-host/dist/__tests__/skill-catalog-repository.test.js` | pass (red before: field absent → TS2339) |
| Empty-catalog main prompt names the directory | `node --test --test-name-pattern="Host Skill directory even with an empty catalog" packages/runtime-host/dist/__tests__/interactive-run-composer.test.js` | pass (red before: fragment missing) |
| Child-agent prompt carries the guidance | `node --test --test-name-pattern="Skill creation guidance" packages/runtime-host/dist/__tests__/interactive-run-composer.test.js` | pass (red before) |
| Composer + repository suites | `node --test` on `interactive-run-composer`, `skill-catalog-repository`, `skill-catalog-coordinator` test files | 54 pass / 0 fail |
| Adjacent catalog protocol suites | `node --test` on `skill-catalog-protocol`, `skill-catalog-transaction` | 58 pass / 0 fail |
| Runtime `skills` suite | `node --test packages/runtime/dist/__tests__/skills.test.js` | 31 pass / 0 fail |
| `execution-model-composition` suite | `node --test` | 41/41 after re-run; one unrelated timing flake on first run ("Hosted real-model Turn did not become terminal"), passes in isolation — pre-existing, untouched paths |
| Format | `npx biome check` on the four touched files | Clean |
| Pre-commit gates locally | `biome-staged-check`, `asf-license-headers check-staged`, `protocol-epoch-check --staged` | All pass; no protocol changes |
Not verified end to end with a real model, and not reproduced in a packaged Desktop build — the tests prove the snapshot and prompt text are correct, not that a model will comply (the issue itself notes this boundary).
## AI use
Implemented with GLM-5.3-Flash (ZCode): code, tests, and this PR drafted by the model, reviewed and pushed by @ggbdpq.
## Checklist
- [x] Commit message follows `<type>(<scope>): <summary>`
- [x] Tests included; the three new tests fail before the change
- [x] No protocol epoch change (`protocol-epoch-check --staged` clean)
- [x] Refs #5012
--
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: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): name the authoritative Skill creation directory in prompts [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #6157:
URL: https://github.com/apache/maka/pull/6157#discussion_r4308756660
##########
packages/runtime-host/src/server/interactive-run-composer.ts:
##########
@@ -99,6 +99,24 @@ const CHILD_INSTRUCTION_BOUNDARY = [
'The child does not implicitly inherit local Memory or personalization context; required background must be included explicitly in the task.',
].join(' ');
+/**
+ * Host-authoritative creation guidance. The catalog may be empty (or every
+ * entry may be filtered out), so this fragment must not depend on catalog
+ * contents; otherwise the model has to guess a data directory.
+ */
+function buildSkillCreationPromptFragment(
+ workspaceSkillDirectory: string | undefined,
+): string | undefined {
+ if (!workspaceSkillDirectory) return undefined;
+ return [
+ '## Local Skill creation',
+ `The Host installs a default workspace Skill at \`${workspaceSkillDirectory}/<skill-id>/SKILL.md\`.`,
+ `- Write the new Skill directly to \`${workspaceSkillDirectory}/<skill-id>/SKILL.md\`; do not guess another Maka data directory.`,
+ '- Read that exact SKILL.md back and verify its content before reporting success.',
+ '- If the user explicitly asks for a project-level, user-level, or managed-source Skill, follow that scope and its authoritative path instead.',
Review Comment:
P3 (optional): this defers to project/user/managed-source scope but does not name those paths (`<project>/.maka/skills`, `<project>/.agents/skills`, `~/.maka/skills`, `~/.agents/skills`), so the model still has to guess when the user asks for one of them. Consider listing them from `STANDARD_SKILL_LOCATIONS`.
##########
packages/runtime-host/src/server/interactive-run-composer.ts:
##########
@@ -99,6 +99,24 @@ const CHILD_INSTRUCTION_BOUNDARY = [
'The child does not implicitly inherit local Memory or personalization context; required background must be included explicitly in the task.',
].join(' ');
+/**
+ * Host-authoritative creation guidance. The catalog may be empty (or every
+ * entry may be filtered out), so this fragment must not depend on catalog
+ * contents; otherwise the model has to guess a data directory.
+ */
+function buildSkillCreationPromptFragment(
+ workspaceSkillDirectory: string | undefined,
+): string | undefined {
+ if (!workspaceSkillDirectory) return undefined;
+ return [
+ '## Local Skill creation',
+ `The Host installs a default workspace Skill at \`${workspaceSkillDirectory}/<skill-id>/SKILL.md\`.`,
Review Comment:
P3 (cosmetic): on Windows this renders as `C:\...\skills/<skill-id>/SKILL.md` with mixed separators. It works, but rendering with the platform separator would be cleaner.
--
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: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): name the authoritative Skill creation directory in prompts [maka]
Posted by "ggbdpq (via GitHub)" <gi...@apache.org>.
ggbdpq commented on code in PR #6157:
URL: https://github.com/apache/maka/pull/6157#discussion_r4326940413
##########
packages/runtime-host/src/server/interactive-run-composer.ts:
##########
@@ -99,6 +99,24 @@ const CHILD_INSTRUCTION_BOUNDARY = [
'The child does not implicitly inherit local Memory or personalization context; required background must be included explicitly in the task.',
].join(' ');
+/**
+ * Host-authoritative creation guidance. The catalog may be empty (or every
+ * entry may be filtered out), so this fragment must not depend on catalog
+ * contents; otherwise the model has to guess a data directory.
+ */
+function buildSkillCreationPromptFragment(
+ workspaceSkillDirectory: string | undefined,
+): string | undefined {
+ if (!workspaceSkillDirectory) return undefined;
+ return [
+ '## Local Skill creation',
+ `The Host installs a default workspace Skill at \`${workspaceSkillDirectory}/<skill-id>/SKILL.md\`.`,
+ `- Write the new Skill directly to \`${workspaceSkillDirectory}/<skill-id>/SKILL.md\`; do not guess another Maka data directory.`,
+ '- Read that exact SKILL.md back and verify its content before reporting success.',
+ '- If the user explicitly asks for a project-level, user-level, or managed-source Skill, follow that scope and its authoritative path instead.',
Review Comment:
Done in `f26548266`: the fragment now lists all standard discovery locations rendered from `STANDARD_SKILL_LOCATIONS` (scope label + joined segments), right under the scope fallback line, so the model no longer has to guess where a project- or user-scoped Skill lives:
```
- project: `<project>/.maka/skills`
- project: `<project>/.agents/skills`
- workspace: `<workspace>/skills`
- user: `~/.maka/skills`
- user: `~/.agents/skills`
```
A regression assertion covers the rendered paths (platform-separator agnostic).
##########
packages/runtime-host/src/server/interactive-run-composer.ts:
##########
@@ -99,6 +99,24 @@ const CHILD_INSTRUCTION_BOUNDARY = [
'The child does not implicitly inherit local Memory or personalization context; required background must be included explicitly in the task.',
].join(' ');
+/**
+ * Host-authoritative creation guidance. The catalog may be empty (or every
+ * entry may be filtered out), so this fragment must not depend on catalog
+ * contents; otherwise the model has to guess a data directory.
+ */
+function buildSkillCreationPromptFragment(
+ workspaceSkillDirectory: string | undefined,
+): string | undefined {
+ if (!workspaceSkillDirectory) return undefined;
+ return [
+ '## Local Skill creation',
+ `The Host installs a default workspace Skill at \`${workspaceSkillDirectory}/<skill-id>/SKILL.md\`.`,
Review Comment:
Done in `f26548266`: the placeholder path is now built with `node:path` `join(workspaceSkillDirectory, '<skill-id>', 'SKILL.md')`, so Windows renders `C:\...\skills\<skill-id>\SKILL.md` with one consistent separator. Test assertions are separator-agnostic.
--
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: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): name the authoritative Skill creation directory in prompts [maka]
Posted by "ggbdpq (via GitHub)" <gi...@apache.org>.
ggbdpq commented on PR #6157:
URL: https://github.com/apache/maka/pull/6157#issuecomment-6254859725
The first CI round failed the `Windows recovery` workflow's Skill catalog gate: it pins the five catalog suites to an exact pass count (so a dropped test cannot pass unnoticed), and the new `workspaceSkillDirectory` snapshot test legitimately moved that count from 94 to 95. `d7408282b` re-registers the gate at 95; locally the same five files run tests 95 / pass 95 / skipped 0 / fail 0.
--
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: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): name the authoritative Skill creation directory in prompts [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #6157:
URL: https://github.com/apache/maka/pull/6157#issuecomment-6312491273
Thanks for making Skill creation paths and scopes explicit and for the regression coverage. The reviewed head `f265482663f3e3e0f0f96d0f61caf80534525ed9` is unchanged, its test checks pass, and it merges cleanly with current main. I am proceeding with the merge at Astro-Han's explicit request.
> **Automated review notice:** This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
--
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: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(runtime-host): name the authoritative Skill creation directory in prompts [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #6157:
URL: https://github.com/apache/maka/pull/6157
--
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: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org