Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .qwen/review-context.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
},
{
"paths": ["packages/core/src/skills/**"],
"relatedPaths": ["packages/core/src/skills/**"],
"relatedPaths": [
"packages/core/src/skills/*.ts",
"packages/core/src/skills/bundled/*/SKILL.md"
],
"domains": ["core-skills"]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ const expectedManifest = {
},
{
paths: ['packages/core/src/skills/**'],
relatedPaths: ['packages/core/src/skills/**'],
// Keep every bundled skill entrypoint, but deliberately leave nested
// implementations, tests, references, and scripts to the changed-file
// diff. Including bundled/*/** makes the all-rule union 129 files and
// violates the 128-item repository-context wire contract.
relatedPaths: [
'packages/core/src/skills/*.ts',
'packages/core/src/skills/bundled/*/SKILL.md',
],
domains: ['core-skills'],
},
{
Expand Down Expand Up @@ -95,7 +102,8 @@ const expectedManifest = {

const relatedPathSentinels: Readonly<Record<string, string>> = {
'packages/core/src/config/**': 'packages/core/src/config/config.ts',
'packages/core/src/skills/**':
'packages/core/src/skills/*.ts': 'packages/core/src/skills/skill-manager.ts',
'packages/core/src/skills/bundled/*/SKILL.md':
'packages/core/src/skills/bundled/review/SKILL.md',
'packages/web-shell/client/adapters/**':
'packages/web-shell/client/adapters/types.ts',
Expand Down Expand Up @@ -187,12 +195,54 @@ describe('committed review context manifest', () => {
}
});

it('stays under the resolved-file bound when every rule co-matches', () => {
const probes = expectedManifest.rules.flatMap((rule) =>
rule.paths.map(probeFor),
it('keeps nested bundled-skill material out of automatic related context', () => {
const context = provideForRepo([
'packages/core/src/skills/bundled/dataviz/scripts/validate_palette.js',
]);

expect(context).not.toBeNull();
expect(context?.domains).toContain('core-skills');
expect(context?.relatedPaths).toContain(
'packages/core/src/skills/bundled/dataviz/SKILL.md',
);
expect(context?.relatedPaths).not.toContain(
'packages/core/src/skills/bundled/dataviz/references/palette.md',
);
expect(context?.relatedPaths).not.toContain(
'packages/core/src/skills/bundled/dataviz/scripts/validate_palette.js',
);
expect(context?.relatedPaths).not.toContain(
'packages/core/src/skills/bundled/loop/autonomous-loop.ts',
);
});

it('stays under the resolved-file bound when every rule co-matches', () => {
const probes = expectedManifest.rules.map((rule) => {
const wildcardPattern = rule.paths.find((pattern) =>
/[?*]/.test(pattern),
);
expect(
wildcardPattern,
'every rule needs a synthetic wildcard probe for the union test',
).toBeDefined();
const probe = probeFor(wildcardPattern as string);
expect(
existsSync(join(repoRoot, probe)),
'union probes must not be real changed files excluded from relatedPaths',
).toBe(false);
return probe;
});
const context = provideForRepo(probes);
expect(context).not.toBeNull();

// The reviewed tree resolved 115/128 files, leaving 13 slots. Do not pin
// that exact count: the real provider intentionally scans the working tree,
// so harmless untracked files and normal source growth can change it. The
// synthetic, nonexistent changed paths above prevent changed-file exclusion
// from understating the union. The manifest grammar has no negation globs,
// and hooks/** is the fastest-growing remaining group, so this bound is the
// deliberate alarm for future rebalancing rather than permission to
// truncate the result.
expect(context?.relatedPaths.length).toBeLessThanOrEqual(MAX_ARRAY_ITEMS);
});

Expand Down
Loading