@polymorphism-tech/morph-spec 11.1.1 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/morph-spec.js +9 -19
- package/docs/CHEATSHEET.md +3 -3
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +2 -0
- package/framework/MORPH.md +7 -2
- package/framework/agents.json +3 -3
- package/framework/docs/CLI.md +14 -12
- package/framework/evals/review-checklist.md +9 -16
- package/framework/hooks/README.md +15 -9
- package/framework/hooks/claude-code/core/README.md +2 -2
- package/framework/hooks/claude-code/core/chain.js +9 -25
- package/framework/hooks/claude-code/core/comment-guard.js +3 -9
- package/framework/hooks/claude-code/core/conventional-commit.js +3 -3
- package/framework/hooks/claude-code/core/graph-refresh-kick.js +4 -4
- package/framework/hooks/claude-code/core/masked-exit.js +4 -3
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +2 -2
- package/framework/hooks/claude-code/core/protect-spec-files.js +2 -4
- package/framework/hooks/claude-code/core/stack-changed.js +5 -4
- package/framework/hooks/claude-code/core/validate-completion.js +15 -12
- package/framework/hooks/shared/contract.js +22 -1
- package/framework/hooks/shared/git-paths.js +6 -0
- package/framework/hooks/shared/graph-freshness.js +3 -3
- package/framework/hooks/shared/graph-refresh.js +5 -10
- package/framework/hooks/shared/hook-response.js +1 -18
- package/framework/hooks/shared/payload-utils.js +12 -1
- package/framework/hooks/shared/phase-utils.js +4 -52
- package/framework/hooks/shared/report-progress.js +1 -1
- package/framework/mcp/registry.json +1 -17
- package/framework/rules/dotnet-templates.md +32 -33
- package/framework/rules/infrastructure-standards.md +9 -9
- package/framework/rules/neon-standards.md +4 -4
- package/framework/rules/nextjs-templates.md +10 -11
- package/framework/rules/ui-design.md +2 -2
- package/framework/schemas/config.schema.json +4 -0
- package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
- package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
- package/framework/skills/core/morph-apply/SKILL.md +5 -4
- package/framework/skills/core/morph-plan/SKILL.md +1 -1
- package/framework/skills/core/morph-uiux/SKILL.md +5 -5
- package/framework/standards/integration/mcp/mcp-tools.md +2 -2
- package/framework/templates/REGISTRY.json +1 -75
- package/framework/templates/docs/plan.md +1 -1
- package/framework/templates/dotnet/ai-kit/tests/Morph.AiKit.Tests/Morph.AiKit.Tests.csproj +1 -1
- package/framework/templates/infrastructure/docker/docker-compose.template.yml +15 -16
- package/package.json +6 -15
- package/src/commands/graph/build.js +2 -2
- package/src/commands/mcp/mcp-setup.js +6 -4
- package/src/commands/project/doctor.js +42 -126
- package/src/commands/project/env.js +2 -1
- package/src/commands/project/init.js +28 -170
- package/src/commands/project/stack-set.js +3 -1
- package/src/commands/project/update.js +49 -153
- package/src/commands/scaffold/scaffold.js +21 -4
- package/src/commands/validation/check.js +12 -10
- package/src/commands/validation/prove-red.js +61 -22
- package/src/core/paths/output-schema.js +8 -27
- package/src/core/templates/template-registry.js +8 -43
- package/src/core/templates/template-renderer.js +3 -200
- package/src/lib/ai/ai-checks.js +1 -1
- package/src/lib/ai/ai-project-scan.js +1 -1
- package/src/lib/ai/code-audit.js +2 -2
- package/src/lib/check/signals.js +25 -7
- package/src/lib/contract/defaults.js +2 -2
- package/src/lib/detectors/claude-config-detector.js +0 -52
- package/src/lib/detectors/index.js +5 -30
- package/src/lib/diff/diff-lines.js +3 -3
- package/src/lib/generators/scaffold-generator.js +5 -17
- package/src/lib/git/default-branch.js +5 -13
- package/src/lib/graph/graph-health.js +1 -1
- package/src/lib/graph/graphifyignore.js +3 -4
- package/src/lib/graph/sanitize.js +2 -2
- package/src/lib/installers/effects.js +0 -13
- package/src/lib/installers/mcp-installer.js +5 -17
- package/src/lib/installers/memory-installer.js +5 -8
- package/src/lib/installers/stack-assets.js +33 -7
- package/src/lib/installers/stack-sync.js +4 -4
- package/src/lib/plan/checks.js +1 -1
- package/src/lib/plan/media.js +3 -3
- package/src/lib/plan/plan-parser.js +1 -1
- package/src/lib/review-reports.js +8 -14
- package/src/lib/scan/worktree-dirs.js +1 -3
- package/src/lib/specs/adr-index.js +4 -4
- package/src/lib/specs/revocations.js +3 -3
- package/src/lib/stack/stack-scan.js +3 -3
- package/src/lib/standards/registry.js +1 -1
- package/src/lib/standards/verified-against.js +2 -2
- package/src/lib/tests-audit/audit.js +2 -2
- package/src/scripts/global-install.js +41 -19
- package/src/scripts/setup-infra.js +57 -165
- package/src/utils/agents-installer.js +8 -30
- package/src/utils/claude-settings-manager.js +29 -27
- package/src/utils/hooks-installer.js +30 -44
- package/src/utils/version-checker.js +2 -31
- package/CLAUDE.md +0 -118
- package/framework/commands/create-umbraco-lp.md +0 -37
- package/framework/commands/migrate-lp-to-umbraco.md +0 -35
- package/framework/commands/morph-apply.md +0 -14
- package/framework/hooks/shared/spawn-command.js +0 -23
- package/framework/templates/CLAUDE.md.core.guide.md +0 -29
- package/framework/templates/CLAUDE.md.core.template +0 -22
- package/framework/templates/context/ARCHITECTURE.md +0 -106
- package/src/commands/context/context-refresh.js +0 -63
- package/src/lib/generators/architecture-scanner.js +0 -543
- package/src/lib/generators/settings-generator.js +0 -97
- package/src/lib/graph/god-nodes.js +0 -65
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// Só nós com source_file, e nada de teste: dublês e fixtures estão no grafo para serem achados, não para
|
|
2
|
-
// disputar centralidade. Aresta com uma ponta em teste não conta, e comunidade só de teste some.
|
|
3
|
-
import { loadGraph } from './graph-loader.js';
|
|
4
|
-
import { buildIndex, resolveEdgeTarget, linksOf } from './sanitize.js';
|
|
5
|
-
import { isTestPath } from '../diff/diff-lines.js';
|
|
6
|
-
|
|
7
|
-
/** Sem `graphify label`, as comunidades se chamam Community_N — ruído puro. */
|
|
8
|
-
const PLACEHOLDER_LABEL = /^Community[_ ]?\d+$/i;
|
|
9
|
-
|
|
10
|
-
export async function scanGraph(projectPath, opts = {}) {
|
|
11
|
-
const top = opts.top ?? 10;
|
|
12
|
-
const topCommunities = opts.topCommunities ?? 10;
|
|
13
|
-
|
|
14
|
-
const loaded = loadGraph(projectPath);
|
|
15
|
-
if (!loaded.ok) return { available: false, godNodes: [], communities: [] };
|
|
16
|
-
|
|
17
|
-
const { graph } = loaded;
|
|
18
|
-
const index = buildIndex(graph);
|
|
19
|
-
|
|
20
|
-
// Grau depois do saneamento: a coalescência muda quem é central, porque as
|
|
21
|
-
// arestas que apontavam para stub passam a contar no nó real.
|
|
22
|
-
const degree = new Map();
|
|
23
|
-
const bump = (id) => {
|
|
24
|
-
if (id) degree.set(id, (degree.get(id) ?? 0) + 1);
|
|
25
|
-
};
|
|
26
|
-
const isTest = (id) => isTestPath(index.byId.get(id)?.source_file);
|
|
27
|
-
for (const link of linksOf(index, graph)) {
|
|
28
|
-
const target = resolveEdgeTarget(index, link).id;
|
|
29
|
-
if (isTest(link.source) || (target && isTest(target))) continue;
|
|
30
|
-
bump(link.source);
|
|
31
|
-
bump(target);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const godNodes = [...degree.entries()]
|
|
35
|
-
.map(([id, d]) => ({ node: index.byId.get(id), degree: d }))
|
|
36
|
-
.filter(({ node }) => node?.source_file)
|
|
37
|
-
.sort((a, b) => b.degree - a.degree || a.node.label.localeCompare(b.node.label))
|
|
38
|
-
.slice(0, top)
|
|
39
|
-
.map(({ node, degree: d }) => ({
|
|
40
|
-
label: node.label,
|
|
41
|
-
source_file: node.source_file,
|
|
42
|
-
degree: d,
|
|
43
|
-
}));
|
|
44
|
-
|
|
45
|
-
const sizes = new Map();
|
|
46
|
-
const labels = new Map();
|
|
47
|
-
for (const node of graph.nodes ?? []) {
|
|
48
|
-
if (node.community === undefined || node.community === null) continue;
|
|
49
|
-
if (isTestPath(node.source_file)) continue;
|
|
50
|
-
sizes.set(node.community, (sizes.get(node.community) ?? 0) + 1);
|
|
51
|
-
if (node.community_label && !labels.has(node.community)) {
|
|
52
|
-
labels.set(node.community, node.community_label);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const communities = [...sizes.entries()]
|
|
57
|
-
.sort((a, b) => b[1] - a[1] || a[0] - b[0])
|
|
58
|
-
.slice(0, topCommunities)
|
|
59
|
-
.map(([id, size]) => {
|
|
60
|
-
const label = labels.get(id) ?? `Community_${id}`;
|
|
61
|
-
return { id, label, size, labeled: !PLACEHOLDER_LABEL.test(label) };
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
return { available: true, godNodes, communities };
|
|
65
|
-
}
|