@polymorphism-tech/morph-spec 10.8.1 → 10.9.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 CHANGED
@@ -3,7 +3,7 @@
3
3
  > Spec-driven development framework for multi-stack projects. Turns feature requests into implementation-ready code through structured, AI-orchestrated phases.
4
4
 
5
5
  **Package:** `@polymorphism-tech/morph-spec`
6
- **Version:** 10.8.1
6
+ **Version:** 10.9.0
7
7
  **Requires:** Node.js 22+, Claude Code
8
8
 
9
9
  ---
@@ -376,4 +376,4 @@ Code generated by morph-spec (contracts, templates, implementation output) belon
376
376
 
377
377
  ---
378
378
 
379
- *morph-spec v10.8.1 by [Polymorphism Tech](https://polymorphism.tech)*
379
+ *morph-spec v10.9.0 by [Polymorphism Tech](https://polymorphism.tech)*
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morph-spec",
3
- "version": "10.8.1",
3
+ "version": "10.9.0",
4
4
  "displayName": "MORPH-SPEC Framework",
5
5
  "description": "Spec-driven development with 38 agents and 8-phase workflow for .NET/Blazor/Next.js/Azure",
6
6
  "publisher": "polymorphism-tech",
@@ -174,4 +174,4 @@ Never edited directly — go through CLI commands or `morph-spec update` instead
174
174
 
175
175
  ---
176
176
 
177
- *morph-spec v10.8.1 by Polymorphism Tech*
177
+ *morph-spec v10.9.0 by Polymorphism Tech*
@@ -89,4 +89,4 @@ morph-spec doctor
89
89
 
90
90
  ---
91
91
 
92
- *morph-spec v10.8.1 by Polymorphism Tech*
92
+ *morph-spec v10.9.0 by Polymorphism Tech*
@@ -97,6 +97,8 @@ A tabela é a mesma régua que `shouldPauseGate` aplica e que o `gate-check` imp
97
97
 
98
98
  **Toda feature nasce numa branch `morph/{f}`** (ramificada da default) mesmo sem `--worktree` — por isso o fechamento por `morph-spec finish` é idêntico nos dois fluxos.
99
99
 
100
+ **Branch base declarada (integração longa).** A "default" é, nesta ordem: `MORPH_BASE_BRANCH`, `project.baseBranch` no `.morph/config/config.json` da árvore onde o comando roda, `origin/HEAD`, `main` local, `master` local. Com uma base declarada, tudo que mede ou fecha contra a default usa ela: a feature nasce dela, o risco do diff, o `code-budget` e o `verify --affected` medem do merge-base com ela, e o `finish --pr|--merge` volta para ela. Uso: a branch de integração commita `"baseBranch": "<branch>"` no `config.json` (o worktree lê a própria cópia) e o `create` rodado na raiz, que continua na default antiga, leva `MORPH_BASE_BRANCH=<branch>`. Valor vazio, não-texto ou `config.json` ilegível são ignorados.
101
+
100
102
  **E sem `--worktree` o checkout PRINCIPAL se move para essa branch**: o comando avisa em amarelo, nomeando a branch anterior e a nova (sob `--json` o aviso vai para **stderr**, para sobreviver ao redirecionamento do stdout), porque trabalho não commitado vai junto e todo commit seguinte naquela árvore cai na branch da feature. `--no-checkout` cria a branch **sem** mover a árvore (a branch existe de todo jeito, para o `finish --pr|--merge` continuar simétrico); a saída estruturada distingue os dois casos em `branch.checkedOut` (+ `branch.movedFrom` / `branch.stayedOn`).
101
103
 
102
104
  **Roteador (`--request`).** sinais determinísticos primeiro — `morph-spec create --request "<texto>"` roda o detector por keywords (hotfix: "produção caiu/urgente/incident/p0"; bug: "bug/corrigir/exception/regressão"; chore: "typo/rename/bump/config/docs/cleanup"). Confiança `high` → usa o tipo. Empate (`tie`) ou nenhum sinal (`none`) → o comando sai com código 2 e os candidatos; **você decide como roteador** e re-roda com `--type`. Só vale uma `AskUserQuestion` quando o pedido é genuinamente indeterminado.
@@ -4,7 +4,7 @@ description: Guia a criação de uma landing page nova ponta-a-ponta a partir do
4
4
  version: core
5
5
  when_to_use: Use quando for iniciar um novo projeto de LP com o template Umbraco genérico
6
6
  user-invocable: true
7
- cliVersion: "10.8.1"
7
+ cliVersion: "10.9.0"
8
8
  stacks:
9
9
  - umbraco
10
10
  ---
@@ -4,7 +4,7 @@ description: Migra uma landing page existente (React/Vite, Next.js estático ou
4
4
  version: core
5
5
  when_to_use: Use quando o usuário pedir "use /migrate-lp-to-umbraco {projeto}" ou descrever a necessidade de migrar uma LP para Umbraco
6
6
  user-invocable: true
7
- cliVersion: "10.8.1"
7
+ cliVersion: "10.9.0"
8
8
  stacks:
9
9
  - umbraco
10
10
  ---
@@ -4,7 +4,7 @@ description: Implementa o plano aprovado de uma feature morph-spec inteiro nesta
4
4
  version: core
5
5
  when_to_use: Use com o gate do plano aprovado ("/morph-apply {feature}", "implementar feature"), em "/morph-review {feature}" (entra no §5), em "/morph-hotfix {feature}" ou incidente de produção (references/hotfix.md), ou quando `morph-spec next` mandar implement, verify, fix, review ou finish
6
6
  user-invocable: true
7
- cliVersion: "10.8.1"
7
+ cliVersion: "10.9.0"
8
8
  ---
9
9
 
10
10
  # morph-apply
@@ -4,7 +4,7 @@ description: Leva um pedido ou o link de uma issue ao plano aprovado — roteia
4
4
  version: core
5
5
  when_to_use: Use quando uma feature, bug ou chore começar ("/morph-plan {feature}", "/morph-plan <link da issue>", "vamos planejar X"), ou ao retomar uma feature cujo gate plan ainda não foi aprovado
6
6
  user-invocable: true
7
- cliVersion: "10.8.1"
7
+ cliVersion: "10.9.0"
8
8
  ---
9
9
 
10
10
  # morph-plan
@@ -4,7 +4,7 @@ description: Conduz a fase de UI/UX de uma feature com plano aprovado — render
4
4
  version: core
5
5
  when_to_use: Use quando o ramo de design for tomado (morph-spec advance {feature} --design), antes de /morph-apply
6
6
  user-invocable: true
7
- cliVersion: "10.8.1"
7
+ cliVersion: "10.9.0"
8
8
  ---
9
9
 
10
10
  # morph-uiux
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymorphism-tech/morph-spec",
3
- "version": "10.8.1",
3
+ "version": "10.9.0",
4
4
  "description": "MORPH-SPEC: NLH (Natural Language Harness) for spec-driven development with Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,4 +1,6 @@
1
1
  import { execFileSync } from 'child_process';
2
+ import { readFileSync } from 'fs';
3
+ import { join } from 'path';
2
4
 
3
5
  function localBranchExists(branch, cwd) {
4
6
  try {
@@ -10,10 +12,32 @@ function localBranchExists(branch, cwd) {
10
12
  }
11
13
 
12
14
  /**
13
- * `origin/HEAD` first, then a local `main`, then `master`.
15
+ * The base branch the project declared, for a long-lived integration branch: features start
16
+ * from it, measure against it and close back into it. `MORPH_BASE_BRANCH` first (the root
17
+ * checkout stays on the old default, so `create` run there needs it), then `project.baseBranch`
18
+ * in the `.morph/config/config.json` of the repo `cwd` is in (a worktree reads its own copy).
19
+ * @returns {string|null} null when nothing is declared.
20
+ */
21
+ export function configuredBaseBranch(cwd = process.cwd()) {
22
+ const env = process.env.MORPH_BASE_BRANCH?.trim();
23
+ if (env) return env;
24
+ try {
25
+ const root = execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, stdio: 'pipe' }).toString().trim();
26
+ const branch = JSON.parse(readFileSync(join(root, '.morph', 'config', 'config.json'), 'utf8'))?.project?.baseBranch;
27
+ return typeof branch === 'string' && branch.trim() ? branch.trim() : null;
28
+ } catch {
29
+ return null;
30
+ }
31
+ }
32
+
33
+ /**
34
+ * The declared base branch (`configuredBaseBranch`) first, then `origin/HEAD`, then a local
35
+ * `main`, then `master`.
14
36
  * @returns {string|null} null when none resolves; the caller decides.
15
37
  */
16
38
  export function detectDefaultBranch(cwd = process.cwd()) {
39
+ const configured = configuredBaseBranch(cwd);
40
+ if (configured) return configured;
17
41
  try {
18
42
  const ref = execFileSync('git', ['symbolic-ref', '--quiet', 'refs/remotes/origin/HEAD'], { cwd, stdio: 'pipe' })
19
43
  .toString()