feat(gstack2): infer execution profiles

This commit is contained in:
Sinabina
2026-07-20 16:22:43 -07:00
parent 9b5ae4071d
commit a1b2b05a18
20 changed files with 329 additions and 30 deletions
+15
View File
@@ -45,6 +45,21 @@ describe('GStack 2 canonical skill UX', () => {
}
});
test('packages one binding inferred execution-profile contract in every dispatcher', () => {
for (const tree of TREE_NAMES) {
const dispatcher = fs.readFileSync(path.join(ROOT, 'skills', tree, 'SKILL.md'), 'utf8');
const profiles = fs.readFileSync(path.join(ROOT, 'skills', tree, 'references', 'EXECUTION-PROFILES.md'), 'utf8');
expect(dispatcher, tree).toContain('Depth: <readiness, standard, or deep>');
expect(dispatcher, tree).toContain('Read `references/EXECUTION-PROFILES.md`');
expect(profiles, tree).toContain('## Smoke/readiness');
expect(profiles, tree).toContain('Readiness profile — not a complete review.');
expect(profiles, tree).toContain('Every selected specialist module remains mandatory.');
expect(profiles, tree).toContain('## Standard');
expect(profiles, tree).toContain('## Deep');
expect(profiles, tree).toContain('never overrides a specialists binding question order');
}
});
test('resolves retired user-facing recommendations without rewriting package paths', () => {
for (const assignment of SOURCE_ASSIGNMENTS) {
const body = fs.readFileSync(ownerModule(assignment.source), 'utf8');
+35
View File
@@ -24,6 +24,41 @@ describe('GStack 2 structured dispatch', () => {
expect(routeStructured({ ...scenario.signals })).toEqual(original);
});
test('infers readiness only from bounded structured operating conditions', () => {
const readiness = routeStructured({
surface: 'web',
implementation_exists: true,
evidence_need: 'readiness',
scope: 'narrow',
deployment_state: 'pre-deployment',
});
expect(readiness.depth).toBe('readiness');
expect(readiness.active_modules).toEqual(['qa-only']);
expect(routeStructured({
surface: 'web',
implementation_exists: true,
evidence_need: 'readiness',
scope: 'broad',
}).depth).not.toBe('readiness');
});
test('risk and deployment evidence promote work to deep', () => {
expect(routeStructured({ surface: 'web', implementation_exists: true, risk: 'high' }).depth)
.toBe('deep');
expect(routeStructured({ surface: 'web', implementation_exists: true, deployment_state: 'production' }).depth)
.toBe('deep');
expect(routeStructured({ surface: 'web', implementation_exists: true, mutation_scope: 'consequential' }).depth)
.toBe('deep');
expect(routeStructured({
surface: 'web',
implementation_exists: true,
evidence_need: 'readiness',
scope: 'narrow',
irreversible: true,
}).depth).toBe('deep');
});
test('explicit mutation denials override otherwise mutating modes', () => {
const review = routeStructured({ audit_focus: 'broad', mutation_authorized: false });
expect(review.mode).toBe('Normal');