WI-6 (#833): constrained recovery command + mosaic-context-refresh skill wrapper (#846)
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful

This commit was merged in pull request #846.
This commit is contained in:
2026-07-20 03:33:00 +00:00
parent 07553ead33
commit 2509eb7646
23 changed files with 1847 additions and 43 deletions

View File

@@ -8,6 +8,7 @@ import {
mkdirSync,
mkdtempSync,
readlinkSync,
readFileSync,
rmSync,
symlinkSync,
writeFileSync,
@@ -26,6 +27,9 @@ import {
const LEGACY_SYNC_SCRIPT = fileURLToPath(
new URL('../../framework/tools/_scripts/mosaic-sync-skills', import.meta.url),
);
const CONTEXT_REFRESH_SOURCE_SKILL = fileURLToPath(
new URL('../../framework/skills/mosaic-context-refresh/SKILL.md', import.meta.url),
);
describe('Claude skill bridge', () => {
let root: string;
@@ -360,6 +364,25 @@ describe('Claude skill bridge', () => {
});
describe('syncClaudeSkills', () => {
it('projects the durable context-refresh skill through the #824 bridge in a tmp root', () => {
expect(existsSync(CONTEXT_REFRESH_SOURCE_SKILL)).toBe(true);
const source = readFileSync(CONTEXT_REFRESH_SOURCE_SKILL, 'utf8');
expect(source).toContain('recover-context.py');
expect(source).toContain('middle drop is not represented as receipt-detectable');
const skillDir = createSkill('mosaic-context-refresh');
writeFileSync(join(skillDir, 'SKILL.md'), source);
const result = syncClaudeSkills(paths);
expect(result).toEqual({
registered: ['mosaic-context-refresh'],
repaired: [],
unchanged: [],
conflicts: [],
});
expectCorrectLink('mosaic-context-refresh');
});
it('generically creates every missing canonical link and repairs managed broken links', () => {
createSkill('added-after-setup');
createSkill('another-new-skill');