feat(#972): graphify command cutover — first capability owning a command family (ADR-857 phase 4d-impl-2) (#975)
Migrate graphify into a Capability that owns its `graphify` command family, dispatched via the registry (#961 mechanism) instead of a hardcoded case. graphify is now an enable/disable plug-in. - src/graphify-command-router.cts: routeGraphifyCommand (standard route*Command), reproduces the removed case EXACTLY (query +--budget, status, diff, build, hidden build snapshot, usage/unknown errors); injectable _graphify test seam. - capabilities/graphify/capability.json: role feature, tier:full, skills:[graphify], config:{graphify.enabled default false}, commands:[{family:graphify, module, router:routeGraphifyCommand}]. - removed case 'graphify' from gsd-tools.cjs; graphify now flows default -> dispatchCapabilityCommand -> commandFamilies.graphify -> router. - regenerated registry (commandFamilies/bySkill/configSchema/profileMembership/ capabilityClusters for graphify); tier:full keeps 4c install/surface a no-op. Equivalence-proven: 8 recording-mock unit tests assert the exact fn+args per subcommand (budget, snapshot-vs-build); 9 subprocess tests assert distinguishing output shapes; existing graphify tests pass unchanged through the new path. Surfaced (not silently accepted): the pre-existing --budget-no-value NaN no-op quirk, preserved for equivalence, filed separately. Closes #972 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -741,16 +741,22 @@ describe('dispatchCapabilityCommand — async router returns a Promise → struc
|
||||
});
|
||||
});
|
||||
|
||||
// ─── 9. Behavior-preservation: real registry has empty commandFamilies ────────
|
||||
// ─── 9. Behavior-preservation: real registry commandFamilies ────────────────
|
||||
|
||||
describe('dispatchCapabilityCommand — real registry behavior-preservation', () => {
|
||||
test('real capability-registry.cjs commandFamilies is {} (no capability declares commands)', () => {
|
||||
test('real capability-registry.cjs commandFamilies is exported and is an object', () => {
|
||||
// Phase 4d-impl-2: graphify was the first capability to declare a command family.
|
||||
// This test was originally written as "commandFamilies must be empty today" but
|
||||
// now asserts the structural contract instead (exported, object) since the graphify
|
||||
// cutover populates it.
|
||||
const realRegistry = require('../gsd-core/bin/lib/capability-registry.cjs');
|
||||
assert.ok(realRegistry.commandFamilies, 'commandFamilies must be exported');
|
||||
assert.deepEqual(
|
||||
Object.keys(realRegistry.commandFamilies),
|
||||
[],
|
||||
'real registry commandFamilies must be empty today',
|
||||
assert.strictEqual(typeof realRegistry.commandFamilies, 'object',
|
||||
'commandFamilies must be an object');
|
||||
// graphify is the first (and currently only) real capability command family
|
||||
assert.ok(
|
||||
Object.prototype.hasOwnProperty.call(realRegistry.commandFamilies, 'graphify'),
|
||||
'real registry commandFamilies must include graphify after 4d-impl-2 cutover',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user