Files
msd-core/src/clusters.cts
Tom Boucher a375c4b354 feat(#956): add MemPalace memory capability (ADR-857 feature plug-in) (#1201)
* feat(#956): add MemPalace memory capability (ADR-857 feature plug-in)

Adds an opt-in, default-resilient ADR-857 feature capability that wires
MemPalace (local-first memory: MCP server + CLI) into the GSD loop:
deliberate recall before discuss/plan and verbatim + temporal-KG capture
at phase boundaries. Three memory modes (augment default; kg_backend and
replace forward-declared). Master gate mempalace.enabled (default off);
every hook onError:skip, zero gates; absent/disabled MemPalace => loop
unchanged. Transport is rendered-markdown only — MemPalace runs
out-of-process, no third-party code in gsd-core (ADR-857 §7).

Capability: capabilities/mempalace/ (manifest + 2 fragments), skills
commands/gsd/mempalace-{recall,capture}.md, agent
agents/gsd-mempalace-curator.md. Registration: ns-context router,
utility cluster, KNOWN_SKILLS, help full.md, model-catalog, copilot
install list, size baselines; regenerated capability-registry +
inventory manifest. ship:post wired into ship.md (wire-on-demand).

HELD on #1196: this capability also declares hooks at discuss:pre and
discuss:post, which are structurally un-wireable until the host-loop
conformance model covers the discuss phase (discuss-phase.md is not in
HOST_LOOP_FILES). The phase6-capstone-conformance gate therefore fails
on exactly those two orphaned points by design — see #1196. Once #1196
lands, rebase onto next and the gate goes green with no further change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(#956): backfill changeset PR number (#1201)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 02:09:10 -04:00

151 lines
3.0 KiB
TypeScript

/**
* Skill cluster definitions for the runtime surface module (ADR-457
* build-at-publish: the hand-written bin/lib/clusters.cjs collapsed to a
* TypeScript source of truth). Behaviour is preserved byte-for-behaviour from
* the prior hand-written .cjs; only types are added.
*
* Each cluster is a named group of skill stems. Clusters are used by /gsd:surface
* to enable/disable a cohesive group of skills without reinstall.
*
* Cluster membership may overlap (a skill can live in two clusters). The union
* of all clusters should cover every installed skill stem; uncategorized stems
* are flagged by surface-clusters.test.cjs.
*
* Source: docs/research/2026-05-12-skill-surface-budget.md §3.2 (verified
* against commands/gsd/ listing in surface-clusters.test.cjs).
*/
export type ClusterName =
| 'core_loop'
| 'audit_review'
| 'milestone'
| 'research_ideate'
| 'workspace_state'
| 'docs'
| 'ui'
| 'ai_eval'
| 'ns_meta'
| 'utility';
export type ClusterMap = Readonly<Record<ClusterName, ReadonlyArray<string>>>;
export const CLUSTERS: ClusterMap = Object.freeze({
core_loop: Object.freeze([
'new-project',
'discuss-phase',
'plan-phase',
'execute-phase',
'help',
'update',
]),
audit_review: Object.freeze([
'code-review',
'review',
'audit-fix',
'audit-milestone',
'audit-uat',
'verify-work',
'validate-phase',
'plan-review-convergence',
'eval-review',
'add-tests',
'secure-phase',
]),
milestone: Object.freeze([
'new-milestone',
'complete-milestone',
'milestone-summary',
'health',
]),
research_ideate: Object.freeze([
'sketch',
'spike',
'forensics',
'explore',
'graphify',
'ns-ideate',
]),
workspace_state: Object.freeze([
'pause-work',
'resume-work',
'workspace',
'workstreams',
'thread',
'capture',
'inbox',
]),
docs: Object.freeze([
'docs-update',
'ingest-docs',
]),
ui: Object.freeze([
'ui-phase',
'ui-review',
]),
ai_eval: Object.freeze([
'ai-integration-phase',
'eval-review',
]),
ns_meta: Object.freeze([
'ns-context',
'ns-ideate',
'ns-manage',
'ns-project',
'ns-review',
'ns-workflow',
]),
utility: Object.freeze([
'health',
'stats',
'settings',
'cleanup',
'pr-branch',
'ship',
'undo',
'fast',
'quick',
'autonomous',
'config',
'progress',
'phase',
'review',
'update',
'help',
'code-review',
'import',
'manager',
'map-codebase',
'profile-user',
'spec-phase',
'ultraplan-phase',
'mvp-phase',
'execute-phase',
'review-backlog',
'debug',
'extract-learnings',
'mempalace-recall',
'mempalace-capture',
'surface',
]),
});
/**
* Build a Set of all skill stems covered by at least one cluster.
*/
export function allClusteredSkills(): Set<string> {
const result = new Set<string>();
for (const skills of Object.values(CLUSTERS)) {
for (const s of skills) result.add(s);
}
return result;
}