@polymorphism-tech/morph-spec 10.12.1 → 11.1.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/CLAUDE.md +27 -57
- package/README.md +53 -338
- package/bin/morph-spec.js +22 -373
- package/docs/CHEATSHEET.md +37 -166
- package/docs/QUICKSTART.md +14 -74
- package/framework/CLAUDE.md +15 -26
- package/framework/MORPH.md +34 -101
- package/framework/agents.json +12 -9
- package/framework/commands/morph-apply.md +5 -5
- package/framework/commands/morph-infra.md +1 -1
- package/framework/docs/CLI.md +74 -886
- package/framework/evals/review-checklist.md +14 -14
- package/framework/hooks/README.md +21 -189
- package/framework/hooks/claude-code/core/README.md +2 -5
- package/framework/hooks/claude-code/core/conventional-commit.js +2 -2
- package/framework/hooks/claude-code/core/denylist.json +3 -3
- package/framework/hooks/claude-code/core/graph-refresh-kick.js +2 -2
- package/framework/hooks/claude-code/core/masked-exit.js +6 -6
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +2 -2
- package/framework/hooks/claude-code/core/protect-spec-files.js +17 -61
- package/framework/hooks/claude-code/core/stack-changed.js +35 -0
- package/framework/hooks/claude-code/core/validate-completion.js +32 -87
- package/framework/hooks/shared/{heavy-command.js → command-kind.js} +6 -79
- package/framework/hooks/shared/command-tokens.js +0 -139
- package/framework/hooks/shared/contract.js +14 -0
- package/framework/hooks/shared/feature-slug.js +21 -0
- package/framework/hooks/shared/frontend-locations.js +0 -1
- package/framework/hooks/shared/git-paths.js +0 -15
- package/framework/hooks/shared/graph-freshness.js +0 -19
- package/framework/hooks/shared/hook-response.js +0 -7
- package/framework/hooks/shared/morph-cli.js +2 -81
- package/framework/hooks/shared/owner-words.js +2 -120
- package/framework/hooks/shared/payload-utils.js +0 -39
- package/framework/hooks/shared/report-progress.js +7 -101
- package/framework/hooks/statusline.js +16 -60
- package/framework/mcp/registry.json +2 -2
- package/framework/rules/ai-agents-standards.md +1 -1
- package/framework/rules/asaas-standards.md +1 -1
- package/framework/rules/ef-standards.md +1 -1
- package/framework/rules/gsap-standards.md +1 -1
- package/framework/rules/hangfire-standards.md +1 -1
- package/framework/rules/implement-report.md +3 -3
- package/framework/rules/neon-auth-standards.md +1 -1
- package/framework/rules/nextjs-standards.md +1 -1
- package/framework/rules/plan-grammar.md +15 -13
- package/framework/rules/resend-standards.md +1 -1
- package/framework/rules/ui-design.md +5 -1
- package/framework/schemas/config.schema.json +95 -310
- package/framework/skills/README.md +12 -32
- 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 +21 -46
- package/framework/skills/core/morph-plan/SKILL.md +28 -63
- package/framework/skills/core/morph-uiux/SKILL.md +23 -25
- package/framework/{templates/docs/ui-mockups.md → skills/core/morph-uiux/references/mockups.md} +4 -4
- package/framework/standards/STANDARDS.json +10 -11
- package/framework/standards/STANDARDS.meta.json +1 -1
- package/framework/standards/ai-agents/evals-with-cache.md +18 -32
- package/framework/standards/ai-agents/observability-patterns.md +2 -2
- package/framework/standards/architecture/code-comments.md +2 -5
- package/framework/standards/architecture/engineering-lens.md +1 -1
- package/framework/standards/backend/dotnet/testing.md +4 -4
- package/framework/standards/frontend/nextjs/lint.md +24 -10
- package/framework/standards/frontend/nextjs/testing.md +2 -2
- package/framework/standards/infrastructure/docker/local-compose-isolation.md +14 -30
- package/framework/templates/CLAUDE.md.core.guide.md +2 -2
- package/framework/templates/README.md +1 -1
- package/framework/templates/REGISTRY.json +3 -33
- package/framework/templates/docs/plan.md +3 -2
- package/framework/templates/dotnet/ai-kit/README.md +2 -4
- package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalCacheMissException.cs +1 -1
- package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalFixture.cs +1 -1
- package/package.json +1 -2
- package/src/commands/graph/explain.js +2 -1
- package/src/commands/graph/status.js +2 -1
- package/src/commands/mcp/mcp-setup.js +1 -2
- package/src/commands/project/doctor.js +13 -342
- package/src/commands/project/env.js +21 -52
- package/src/commands/project/init-contract.js +47 -0
- package/src/commands/project/init.js +36 -66
- package/src/commands/project/stack-scan.js +1 -1
- package/src/commands/project/update.js +16 -53
- package/src/commands/validation/check.js +128 -0
- package/src/commands/validation/plan-check.js +41 -64
- package/src/commands/validation/prove-red.js +1 -1
- package/src/core/paths/output-schema.js +0 -22
- package/src/core/templates/template-renderer.js +0 -14
- package/src/lib/ai/ai-project-scan.js +1 -6
- package/src/lib/check/attempts.js +38 -0
- package/src/lib/check/signals.js +145 -0
- package/src/lib/config/project-config.js +13 -0
- package/src/lib/contract/apply.js +62 -0
- package/src/lib/contract/defaults.js +96 -0
- package/src/lib/contract/merge.js +79 -0
- package/src/lib/contract/ports.js +43 -0
- package/src/lib/contract/scan.js +102 -0
- package/src/lib/detectors/claude-config-detector.js +7 -0
- package/src/lib/{procs → detectors}/mcp-config.js +1 -37
- package/src/lib/diff/diff-lines.js +64 -0
- package/src/lib/generators/architecture-scanner.js +1 -1
- package/src/lib/generators/scaffold-generator.js +0 -7
- package/src/lib/git/default-branch.js +0 -122
- package/src/lib/graph/diff-tree.js +2 -1
- package/src/lib/graph/god-nodes.js +2 -1
- package/src/lib/graph/graphify-runtime.js +0 -1
- package/src/lib/graph/graphifyignore.js +1 -1
- package/src/lib/graph/sanitize.js +2 -8
- package/src/lib/installers/memory-installer.js +15 -30
- package/src/lib/installers/stack-sync.js +16 -9
- package/src/lib/plan/checks.js +20 -64
- package/src/lib/plan/media.js +1 -1
- package/src/lib/plan/plan-parser.js +5 -5
- package/src/lib/review-reports.js +3 -77
- package/src/lib/scan/worktree-dirs.js +3 -0
- package/src/lib/specs/adr-index.js +2 -2
- package/src/lib/stack/dotnet-build-ignores.js +10 -2
- package/src/lib/stack/stack-scan.js +2 -2
- package/src/lib/stack-filter.js +3 -2
- package/src/lib/tests-audit/audit.js +1 -1
- package/src/scripts/setup-infra.js +6 -59
- package/src/utils/agents-installer.js +13 -37
- package/src/utils/atomic-json.js +27 -0
- package/src/utils/file-copier.js +24 -24
- package/src/utils/hooks-installer.js +9 -107
- package/claude-plugin.json +0 -14
- package/framework/commands/morph-archive.md +0 -46
- package/framework/commands/morph-hotfix.md +0 -17
- package/framework/commands/morph-preflight.md +0 -180
- package/framework/commands/morph-review.md +0 -15
- package/framework/commands/morph-status.md +0 -37
- package/framework/hooks/claude-code/core/block-destructive-worktree-removal.js +0 -80
- package/framework/hooks/claude-code/core/block-raw-worktree-add.js +0 -72
- package/framework/hooks/claude-code/core/enforce-phase-writes.js +0 -100
- package/framework/hooks/claude-code/core/gate-guard.js +0 -148
- package/framework/hooks/claude-code/core/heavy-gate.js +0 -78
- package/framework/hooks/claude-code/core/heavy-release.js +0 -23
- package/framework/hooks/claude-code/core/loop-detect.js +0 -79
- package/framework/hooks/claude-code/core/state-sync.js +0 -214
- package/framework/hooks/claude-code/core/telemetry-log.js +0 -259
- package/framework/hooks/claude-code/core/test-budget.js +0 -29
- package/framework/hooks/claude-code/core/worktree-context.js +0 -249
- package/framework/hooks/claude-code/core/worktree-create.js +0 -119
- package/framework/hooks/claude-code/core/worktree-env-inject.js +0 -68
- package/framework/hooks/claude-code/core/worktree-remove.js +0 -55
- package/framework/hooks/shared/build-check.js +0 -120
- package/framework/hooks/shared/claim-registry.js +0 -125
- package/framework/hooks/shared/e2e-check.js +0 -1022
- package/framework/hooks/shared/feature-locator.js +0 -82
- package/framework/hooks/shared/gate-event.js +0 -18
- package/framework/hooks/shared/gate-question.js +0 -20
- package/framework/hooks/shared/heavy-config.js +0 -113
- package/framework/hooks/shared/heavy-holders.js +0 -85
- package/framework/hooks/shared/heavy-slots.js +0 -280
- package/framework/hooks/shared/host-services.js +0 -440
- package/framework/hooks/shared/next-step.js +0 -181
- package/framework/hooks/shared/redact-secrets.js +0 -44
- package/framework/hooks/shared/reparse-scan.js +0 -40
- package/framework/hooks/shared/state-reader.js +0 -220
- package/framework/hooks/shared/state-writer.js +0 -112
- package/framework/hooks/shared/telemetry-logger.js +0 -101
- package/framework/hooks/shared/transcript-usage.js +0 -58
- package/framework/hooks/shared/worktree-root.js +0 -71
- package/framework/phases.json +0 -92
- package/framework/schemas/feature.schema.json +0 -242
- package/framework/skills/core/morph-apply/references/hotfix.md +0 -46
- package/framework/skills/core/morph-apply/references/machine.md +0 -30
- package/framework/skills/core/morph-apply/references/review.md +0 -77
- package/framework/skills/core/morph-plan/references/critique.md +0 -51
- package/framework/skills/core/morph-plan/references/interview.md +0 -37
- package/framework/templates/state.template.json +0 -17
- package/src/commands/dashboard/dashboard.js +0 -74
- package/src/commands/e2e/e2e.js +0 -400
- package/src/commands/observability/cost.js +0 -283
- package/src/commands/project/branch.js +0 -129
- package/src/commands/project/claim.js +0 -132
- package/src/commands/project/doctor-procs.js +0 -162
- package/src/commands/project/fleet.js +0 -66
- package/src/commands/project/heavy.js +0 -81
- package/src/commands/project/install-plugin-cmd.js +0 -27
- package/src/commands/project/status.js +0 -61
- package/src/commands/project/worktree.js +0 -1234
- package/src/commands/state/advance.js +0 -248
- package/src/commands/state/approve.js +0 -303
- package/src/commands/state/archive.js +0 -231
- package/src/commands/state/auto-approval.js +0 -67
- package/src/commands/state/create.js +0 -274
- package/src/commands/state/delete.js +0 -192
- package/src/commands/state/finish.js +0 -1247
- package/src/commands/state/gate-check.js +0 -244
- package/src/commands/state/gate-decision.js +0 -122
- package/src/commands/state/list.js +0 -244
- package/src/commands/state/next.js +0 -24
- package/src/commands/state/recap.js +0 -80
- package/src/commands/state/report-check.js +0 -244
- package/src/commands/state/retype.js +0 -110
- package/src/commands/validation/verify.js +0 -421
- package/src/core/state/feature-identity.js +0 -10
- package/src/core/state/gate-order.js +0 -23
- package/src/core/state/lifecycle-audit.js +0 -171
- package/src/core/state/state-manager.js +0 -523
- package/src/core/templates/template-seed.js +0 -21
- package/src/core/work-types.js +0 -44
- package/src/dashboard/app/App.jsx +0 -84
- package/src/dashboard/app/components/ActivityFeed.jsx +0 -166
- package/src/dashboard/app/components/CommandPalette.jsx +0 -144
- package/src/dashboard/app/components/DetailPanel.jsx +0 -43
- package/src/dashboard/app/components/EntityLink.jsx +0 -42
- package/src/dashboard/app/components/ErrorBoundary.jsx +0 -47
- package/src/dashboard/app/components/FlowGraph.jsx +0 -19
- package/src/dashboard/app/components/GatePauses.jsx +0 -116
- package/src/dashboard/app/components/KnowledgeMarkdown.jsx +0 -42
- package/src/dashboard/app/components/Markdown.jsx +0 -38
- package/src/dashboard/app/components/PhaseRail.jsx +0 -100
- package/src/dashboard/app/components/SearchFilter.jsx +0 -36
- package/src/dashboard/app/components/SessionMap.jsx +0 -77
- package/src/dashboard/app/components/Sidebar.jsx +0 -147
- package/src/dashboard/app/hooks/useMorphQuery.js +0 -44
- package/src/dashboard/app/hooks/usePref.js +0 -34
- package/src/dashboard/app/lib/format.js +0 -69
- package/src/dashboard/app/lib/phases.js +0 -75
- package/src/dashboard/app/lib/project.js +0 -38
- package/src/dashboard/app/main.jsx +0 -13
- package/src/dashboard/app/pages/Activity.jsx +0 -28
- package/src/dashboard/app/pages/AgentMap.jsx +0 -363
- package/src/dashboard/app/pages/FeatureDetail.jsx +0 -579
- package/src/dashboard/app/pages/Features.jsx +0 -393
- package/src/dashboard/app/pages/Guide.jsx +0 -145
- package/src/dashboard/app/pages/HookInspector.jsx +0 -444
- package/src/dashboard/app/pages/PhasePipeline.jsx +0 -273
- package/src/dashboard/app/pages/Portfolio.jsx +0 -190
- package/src/dashboard/app/pages/RulesMap.jsx +0 -285
- package/src/dashboard/app/pages/SkillsLibrary.jsx +0 -468
- package/src/dashboard/app/pages/Standards.jsx +0 -392
- package/src/dashboard/app/styles/index.css +0 -187
- package/src/dashboard/index.html +0 -14
- package/src/dashboard/package.json +0 -32
- package/src/dashboard/scanner/activity-scanner.js +0 -321
- package/src/dashboard/scanner/agents-scanner.js +0 -67
- package/src/dashboard/scanner/docs-scanner.js +0 -34
- package/src/dashboard/scanner/feature-status.js +0 -7
- package/src/dashboard/scanner/features-scanner.js +0 -397
- package/src/dashboard/scanner/hooks-scanner.js +0 -96
- package/src/dashboard/scanner/index.js +0 -21
- package/src/dashboard/scanner/phases-scanner.js +0 -14
- package/src/dashboard/scanner/portfolio.js +0 -129
- package/src/dashboard/scanner/project-api.js +0 -160
- package/src/dashboard/scanner/rules-scanner.js +0 -46
- package/src/dashboard/scanner/skills-scanner.js +0 -104
- package/src/dashboard/scanner/standards-scanner.js +0 -38
- package/src/dashboard/vite-plugin-morph-data.js +0 -120
- package/src/dashboard/vite.config.js +0 -26
- package/src/lib/ci/ci-verify.js +0 -30
- package/src/lib/ci/github-ci.js +0 -52
- package/src/lib/ci/pr-checks.js +0 -76
- package/src/lib/e2e/applicability.js +0 -39
- package/src/lib/e2e/compose-env.js +0 -80
- package/src/lib/e2e/stack-teardown.js +0 -96
- package/src/lib/git/branch-classifier.js +0 -104
- package/src/lib/git/evidence-staleness.js +0 -40
- package/src/lib/git/gh.js +0 -15
- package/src/lib/git/pending-prs.js +0 -58
- package/src/lib/git/pr-files.js +0 -31
- package/src/lib/git/pr-index.js +0 -39
- package/src/lib/git/tree-fingerprint.js +0 -58
- package/src/lib/git/tree-state.js +0 -125
- package/src/lib/heavy/cleanup.js +0 -72
- package/src/lib/heavy/gate.js +0 -168
- package/src/lib/heavy/live-stacks.js +0 -64
- package/src/lib/heavy/reclaim.js +0 -107
- package/src/lib/heavy/watchdog.js +0 -46
- package/src/lib/next-step.js +0 -12
- package/src/lib/plan/critique.js +0 -67
- package/src/lib/plan/plan-template.js +0 -18
- package/src/lib/procs/classify.js +0 -91
- package/src/lib/procs/list.js +0 -124
- package/src/lib/procs/prune.js +0 -47
- package/src/lib/procs/wslconfig.js +0 -70
- package/src/lib/projects/registry.js +0 -121
- package/src/lib/recap/piper.js +0 -36
- package/src/lib/recap/recap.js +0 -259
- package/src/lib/review-confirmation.js +0 -66
- package/src/lib/risk/diff-risk.js +0 -137
- package/src/lib/risk-detector.js +0 -638
- package/src/lib/specs/design-seed.js +0 -18
- package/src/lib/specs/screen-checklist.js +0 -315
- package/src/lib/stack/stack-profile.js +0 -69
- package/src/lib/tasks/eval-node.js +0 -293
- package/src/lib/tasks/linux-runner.js +0 -200
- package/src/lib/tasks/test-nodes.js +0 -414
- package/src/lib/tasks/test-runner.js +0 -569
- package/src/lib/telemetry/metrics.js +0 -384
- package/src/lib/telemetry/telemetry-reader.js +0 -276
- package/src/lib/telemetry/verify-event.js +0 -57
- package/src/lib/validators/code-budget/code-budget-validator.js +0 -170
- package/src/lib/validators/contracts/contract-compliance-validator.js +0 -219
- package/src/lib/validators/nextjs/next-component-validator.js +0 -142
- package/src/lib/validators/packages/package-validator.js +0 -310
- package/src/lib/validators/reuse/reuse-validator.js +0 -202
- package/src/lib/validators/reuse/symbol-scanner.js +0 -64
- package/src/lib/validators/validation-runner.js +0 -188
- package/src/lib/validators/verify-cache.js +0 -63
- package/src/lib/validators/verify-runner.js +0 -971
- package/src/lib/verify/affected.js +0 -143
- package/src/lib/verify/detached.js +0 -159
- package/src/lib/view/feature-html.js +0 -480
- package/src/lib/view/feature-page.client.js +0 -109
- package/src/lib/view/feature-page.css +0 -278
- package/src/lib/view/feature-view.js +0 -113
- package/src/lib/view/flow-layers.js +0 -79
- package/src/lib/view/flow-svg.js +0 -63
- package/src/lib/view/tokens.css +0 -18
- package/src/lib/work-type-detector.js +0 -81
- package/src/lib/worktree/dirs.js +0 -3
- package/src/lib/worktree/docker-audit.js +0 -175
- package/src/lib/worktree/env-allocator.js +0 -177
- package/src/lib/worktree/feature-truth.js +0 -145
- package/src/lib/worktree/finish-backup.js +0 -529
- package/src/lib/worktree/fleet-scanner.js +0 -223
- package/src/lib/worktree/ignored-triage.js +0 -136
- package/src/lib/worktree/vscode-settings.js +0 -112
- package/src/lib/worktree/worktree-audit.js +0 -323
- package/src/lib/worktree/worktree-include.js +0 -44
- package/src/scripts/install-plugin.js +0 -114
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
* { box-sizing:border-box; }
|
|
2
|
-
html { scroll-padding-top:72px; }
|
|
3
|
-
body { margin:0; background:var(--paper); color:var(--ink); font:17px/1.6 var(--text); -webkit-font-smoothing:antialiased; }
|
|
4
|
-
a { color:var(--route); text-underline-offset:3px; }
|
|
5
|
-
:focus-visible { outline:2px solid var(--route); outline-offset:2px; border-radius:4px; }
|
|
6
|
-
code { font:.86em var(--code); color:var(--dim); background:color-mix(in srgb, var(--ink) 6%, transparent); padding:.1em .34em; border-radius:4px; overflow-wrap:anywhere; }
|
|
7
|
-
.plain code { font:inherit; color:inherit; background:none; padding:0; }
|
|
8
|
-
pre { background:var(--panel); border:1px solid var(--rule); border-radius:6px; padding:14px; overflow-x:auto; }
|
|
9
|
-
pre code { background:none; padding:0; }
|
|
10
|
-
h1, h2, h3, h4 { font-family:var(--display); font-weight:600; font-stretch:82%; line-height:1.15; margin:0; }
|
|
11
|
-
button { font:inherit; color:inherit; cursor:pointer; }
|
|
12
|
-
p { margin:0; }
|
|
13
|
-
ul, ol { list-style:none; margin:0; padding:0; }
|
|
14
|
-
small { color:var(--faint); font-size:14px; }
|
|
15
|
-
|
|
16
|
-
.top, .tabs > div, main { max-width:880px; margin:0 auto; padding-left:24px; padding-right:24px; }
|
|
17
|
-
|
|
18
|
-
.top { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 400px); gap:20px 40px; align-items:end; padding-top:32px; padding-bottom:22px; }
|
|
19
|
-
.kind { grid-column:1; align-self:end; color:var(--faint); font-size:14px; margin-bottom:-18px; }
|
|
20
|
-
h1 { grid-column:1; font-size:26px; font-stretch:88%; overflow-wrap:anywhere; }
|
|
21
|
-
|
|
22
|
-
.route { grid-column:2; grid-row:1 / span 2; display:flex; }
|
|
23
|
-
.route li { flex:1; position:relative; display:flex; flex-direction:column; align-items:center; gap:7px; text-align:center; font-size:13px; line-height:1.25; color:var(--faint); min-width:0; }
|
|
24
|
-
.route li + li::before { content:""; position:absolute; top:7px; right:50%; width:100%; height:4px; background:var(--rule); }
|
|
25
|
-
.route li.done + li::before { background:var(--route); }
|
|
26
|
-
.route i { position:relative; z-index:1; width:18px; height:18px; border-radius:50%; background:var(--paper); border:4px solid var(--rule); }
|
|
27
|
-
.route .done i { background:var(--route); border-color:var(--route); }
|
|
28
|
-
.route .now i { border-color:var(--route); box-shadow:0 0 0 5px color-mix(in srgb, var(--route) 22%, transparent); }
|
|
29
|
-
.route .done { color:var(--dim); }
|
|
30
|
-
.route .now { color:var(--ink); font-weight:600; }
|
|
31
|
-
.route small { display:block; font-weight:400; font-size:12px; }
|
|
32
|
-
|
|
33
|
-
.tabs { position:sticky; top:0; z-index:10; background:color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter:blur(8px); border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); }
|
|
34
|
-
.tabs > div { display:flex; gap:26px; overflow-x:auto; scrollbar-width:none; }
|
|
35
|
-
.tabs a { padding:13px 0 10px; color:var(--dim); text-decoration:none; font:600 18px/1.2 var(--display); font-stretch:82%; white-space:nowrap; border-bottom:4px solid transparent; }
|
|
36
|
-
.tabs a:hover { color:var(--ink); }
|
|
37
|
-
.tabs a.on { color:var(--ink); border-bottom-color:var(--route); }
|
|
38
|
-
.tabs a b { margin-left:7px; background:var(--ink); color:var(--paper); border-radius:999px; padding:1px 8px; font:600 13px/1.5 var(--text); vertical-align:2px; }
|
|
39
|
-
|
|
40
|
-
main { padding-top:36px; padding-bottom:140px; }
|
|
41
|
-
.js .panel:not(.on) { display:none; }
|
|
42
|
-
.panel + .panel { margin-top:56px; }
|
|
43
|
-
.js .panel + .panel { margin-top:0; }
|
|
44
|
-
.panel > h2 { font-size:28px; margin:52px 0 14px; scroll-margin-top:72px; }
|
|
45
|
-
.panel > h2:first-child { margin-top:0; }
|
|
46
|
-
.sub { color:var(--dim); font-size:16px; max-width:62ch; margin:-6px 0 18px; }
|
|
47
|
-
.tip { color:var(--faint); font-size:14px; margin-top:12px; }
|
|
48
|
-
.calm { display:flex; gap:12px; align-items:center; color:var(--dim); border-left:4px solid var(--ok); padding:4px 0 4px 16px; }
|
|
49
|
-
.prose { max-width:66ch; }
|
|
50
|
-
.prose p, .prose ul, .prose pre, .prose .scroll-x { margin:0 0 12px; }
|
|
51
|
-
.prose ul { list-style:disc; padding-left:22px; }
|
|
52
|
-
.prose li { margin:6px 0; }
|
|
53
|
-
.prose h4 { font-size:19px; margin:18px 0 6px; }
|
|
54
|
-
.prose code { background:none; padding:0; font-size:.88em; }
|
|
55
|
-
.prose ul.sentences { list-style:none; padding:0; }
|
|
56
|
-
.sentences li { margin:0 0 12px; padding-left:16px; border-left:2px solid var(--rule); line-height:1.6; }
|
|
57
|
-
.sentences li:first-child { border-left-color:var(--route); color:var(--ink); }
|
|
58
|
-
.settled .toggle, .settled .tip { display:none; }
|
|
59
|
-
.settled .live .toggle { display:inline-block; }
|
|
60
|
-
|
|
61
|
-
.origin { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:4px 24px; font-size:14px; color:var(--faint); }
|
|
62
|
-
.origin code { background:none; padding:0; }
|
|
63
|
-
.kind code { background:none; padding:0; margin-left:8px; }
|
|
64
|
-
.status { display:flex; flex-wrap:wrap; gap:14px 24px; align-items:center; justify-content:space-between; }
|
|
65
|
-
.act { flex:none; background:var(--on-sign); color:var(--sign); border:0; border-radius:6px; padding:10px 18px; min-height:44px; font:600 17px var(--display); font-stretch:86%; }
|
|
66
|
-
.act:hover { filter:brightness(1.25); }
|
|
67
|
-
.facts { margin-top:8px; padding-top:12px; border-top:1px solid var(--rule); }
|
|
68
|
-
#andamento > h2 { font-size:28px; margin:52px 0 14px; }
|
|
69
|
-
#andamento > h3 { font-size:20px; margin:24px 0 8px; }
|
|
70
|
-
|
|
71
|
-
article.adr { border-top:1px solid var(--rule); padding:16px 0 6px; scroll-margin-top:72px; }
|
|
72
|
-
article.adr:last-of-type { border-bottom:1px solid var(--rule); }
|
|
73
|
-
article.adr h3 { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:baseline; font-family:var(--text); font-stretch:100%; }
|
|
74
|
-
article.adr dl { display:grid; grid-template-columns:7em minmax(0, 1fr); gap:8px 16px; margin:14px 0 12px; max-width:68ch; }
|
|
75
|
-
article.adr dt { font:600 16px/1.6 var(--display); font-stretch:82%; color:var(--faint); }
|
|
76
|
-
article.adr dd { margin:0; font-size:17px; line-height:1.5; }
|
|
77
|
-
article.adr dd:first-of-type { font-weight:600; }
|
|
78
|
-
article.adr .fold { border:0; }
|
|
79
|
-
article.adr .fold summary { font-weight:400; font-size:15px; color:var(--route); padding:4px 0 10px; }
|
|
80
|
-
.scroll-x { overflow-x:auto; }
|
|
81
|
-
table { border-collapse:collapse; width:100%; font-size:15px; }
|
|
82
|
-
th { text-align:left; font-weight:600; color:var(--dim); border-bottom:2px solid var(--ink); padding:8px 14px 8px 0; }
|
|
83
|
-
td { border-bottom:1px solid var(--rule); padding:10px 14px 10px 0; vertical-align:top; }
|
|
84
|
-
|
|
85
|
-
.ico { flex:none; width:24px; height:24px; border-radius:50%; display:inline-grid; place-items:center; font:700 13px/1 var(--text); font-style:normal; background:var(--rule); color:var(--dim); }
|
|
86
|
-
.ico.ok { background:var(--ok); color:var(--paper); }
|
|
87
|
-
.ico.warn { background:var(--warn); color:var(--paper); }
|
|
88
|
-
.ico.bad { background:var(--bad); color:var(--paper); }
|
|
89
|
-
.ico.info { background:var(--route); color:var(--paper); }
|
|
90
|
-
.ico.todo { background:var(--paper); border:4px solid var(--route); }
|
|
91
|
-
.pill { display:inline-block; font:600 13px/1.5 var(--text); padding:2px 10px; border-radius:999px; background:color-mix(in srgb, var(--ink) 8%, transparent); color:var(--dim); white-space:nowrap; }
|
|
92
|
-
.pill.ok { background:color-mix(in srgb, var(--ok) 14%, transparent); color:var(--ok); }
|
|
93
|
-
.pill.warn { background:color-mix(in srgb, var(--warn) 16%, transparent); color:var(--warn); }
|
|
94
|
-
.pill.bad { background:var(--bad); color:var(--paper); }
|
|
95
|
-
.pill.todo { background:none; padding-left:0; padding-right:0; color:var(--faint); font-weight:400; }
|
|
96
|
-
.id { font:600 14px var(--display); color:var(--faint); text-decoration:none; }
|
|
97
|
-
a.id { color:var(--route); }
|
|
98
|
-
|
|
99
|
-
.shift { display:grid; gap:0; margin-bottom:32px; }
|
|
100
|
-
.shift > div { display:grid; grid-template-columns:5.2em minmax(0, 1fr); position:relative; }
|
|
101
|
-
.shift .tag { position:relative; padding-left:26px; font:600 16px/1.6 var(--display); font-stretch:82%; color:var(--faint); }
|
|
102
|
-
.shift .tag::before { content:""; position:absolute; left:0; top:.36em; width:14px; height:14px; border-radius:50%; background:var(--paper); border:4px solid var(--rule); z-index:1; }
|
|
103
|
-
.shift .before { padding-bottom:22px; }
|
|
104
|
-
.shift .before::after { content:""; position:absolute; left:5px; top:.9em; bottom:-.9em; width:4px; background:linear-gradient(var(--rule), var(--route)); }
|
|
105
|
-
.shift .before p { color:var(--dim); font-size:18px; line-height:1.5; max-width:52ch; }
|
|
106
|
-
.shift .after .tag { color:var(--route); }
|
|
107
|
-
.shift .after .tag::before { background:var(--route); border-color:var(--route); }
|
|
108
|
-
.shift .after p { font-size:19px; line-height:1.5; font-weight:600; max-width:56ch; }
|
|
109
|
-
.shift.plain .before p { font-size:20px; }
|
|
110
|
-
.shift.plain .after .tag { padding-top:.5em; }
|
|
111
|
-
.shift.plain .after .tag::before { top:calc(.5em + .36em); }
|
|
112
|
-
.shift.plain .after p { font:600 clamp(31px, 5.4vw, 54px)/1.04 var(--display); font-stretch:78%; letter-spacing:-.005em; text-wrap:balance; max-width:17em; animation:arrive .7s cubic-bezier(.2,.7,.2,1) both; }
|
|
113
|
-
@keyframes arrive { from { opacity:0; transform:translateY(10px); } }
|
|
114
|
-
|
|
115
|
-
.status { border-left:4px solid var(--route); padding:2px 0 2px 16px; }
|
|
116
|
-
.status h2 { font-size:21px; }
|
|
117
|
-
.status p { color:var(--dim); font-size:16px; max-width:60ch; }
|
|
118
|
-
.status.ok { border-left-color:var(--ok); }
|
|
119
|
-
.status.wait { background:var(--sign); color:var(--on-sign); border:0; border-radius:6px; padding:20px 24px; outline:2px solid var(--on-sign); outline-offset:-7px; }
|
|
120
|
-
.status.wait h2 { font-size:27px; }
|
|
121
|
-
.status.wait p { color:inherit; font-size:17px; }
|
|
122
|
-
.status.wait .hint { font-weight:600; }
|
|
123
|
-
.status.wait a { color:inherit; }
|
|
124
|
-
.status.wait code { color:inherit; background:rgba(0,0,0,.1); }
|
|
125
|
-
|
|
126
|
-
.board { margin-top:36px; }
|
|
127
|
-
.stops { display:flex; padding-top:20px; overflow-x:auto; scrollbar-width:none; }
|
|
128
|
-
.stop { flex:1 0 44px; position:relative; display:flex; flex-direction:column; align-items:center; gap:8px; color:var(--dim); text-decoration:none; font:600 14px var(--display); }
|
|
129
|
-
.stop + .stop::after { content:""; position:absolute; top:9px; right:50%; width:100%; height:4px; background:color-mix(in srgb, var(--route) 40%, var(--rule)); }
|
|
130
|
-
.stop i { position:relative; z-index:1; width:22px; height:22px; border-radius:50%; background:var(--paper); border:4px solid var(--route); transition:transform .15s; animation:pop .35s cubic-bezier(.3,1.5,.5,1) both; animation-delay:calc(var(--i) * 55ms + 250ms); }
|
|
131
|
-
@keyframes pop { from { transform:scale(0); } }
|
|
132
|
-
.stop:hover i, .stop:focus-visible i { transform:scale(1.25); }
|
|
133
|
-
.stop.ok i { background:var(--ok); border-color:var(--ok); }
|
|
134
|
-
.stop.bad i { background:var(--bad); border-color:var(--bad); }
|
|
135
|
-
.stop.warn i { background:var(--warn); border-color:var(--warn); }
|
|
136
|
-
.stop.rung::before, .legend .rung i { content:""; width:11px; height:11px; background:var(--bad); border-radius:2px; transform:rotate(45deg); }
|
|
137
|
-
.stop.rung::before { position:absolute; top:-18px; }
|
|
138
|
-
.legend { display:flex; flex-wrap:wrap; gap:6px 28px; margin-top:16px; font-size:15px; color:var(--dim); }
|
|
139
|
-
.legend b { font:600 19px var(--display); color:var(--ink); }
|
|
140
|
-
.legend a { color:inherit; }
|
|
141
|
-
.legend .rung { display:flex; align-items:center; gap:8px; }
|
|
142
|
-
.legend .rung i { display:inline-block; }
|
|
143
|
-
.legend .rung b { color:var(--bad); }
|
|
144
|
-
|
|
145
|
-
.groups { display:grid; gap:26px; }
|
|
146
|
-
.group { border-left:4px solid var(--warn); padding-left:18px; }
|
|
147
|
-
.group.bad { border-left-color:var(--bad); }
|
|
148
|
-
.group-head { display:flex; gap:12px; align-items:center; margin-bottom:6px; }
|
|
149
|
-
.group .ico { background:none; position:relative; z-index:0; color:var(--paper); }
|
|
150
|
-
.group .ico::before { content:""; position:absolute; inset:2px; z-index:-1; border-radius:3px; transform:rotate(45deg); background:var(--warn); }
|
|
151
|
-
.group .ico.bad::before { background:var(--bad); }
|
|
152
|
-
.group h3 { font-size:22px; }
|
|
153
|
-
.group h3 .n { margin-left:8px; font:600 13px/1.5 var(--text); font-stretch:100%; background:var(--ink); color:var(--paper); border-radius:999px; padding:1px 8px; vertical-align:3px; }
|
|
154
|
-
.group .why { color:var(--dim); font-size:15px; }
|
|
155
|
-
.items > li { display:grid; grid-template-columns:auto minmax(0, 1fr) auto; gap:4px 12px; align-items:center; padding:9px 0; border-top:1px solid var(--rule); scroll-margin-top:72px; }
|
|
156
|
-
.items .id { min-width:2.2em; }
|
|
157
|
-
.items p { font-size:17px; line-height:1.4; }
|
|
158
|
-
.items > li > p:first-child { grid-column:1 / 3; }
|
|
159
|
-
|
|
160
|
-
.out { columns:2; column-gap:36px; }
|
|
161
|
-
.out li { display:flex; gap:10px; break-inside:avoid; padding:9px 0; border-top:1px solid var(--rule); font-size:15px; line-height:1.45; color:var(--dim); }
|
|
162
|
-
.out li::before { content:"✕"; flex:none; font-weight:700; color:var(--faint); }
|
|
163
|
-
|
|
164
|
-
.fold { border-top:1px solid var(--rule); }
|
|
165
|
-
.fold:last-of-type { border-bottom:1px solid var(--rule); }
|
|
166
|
-
.fold summary { cursor:pointer; padding:12px 0; font-weight:600; color:var(--dim); }
|
|
167
|
-
.fold summary:hover { color:var(--ink); }
|
|
168
|
-
.fold .prose { padding-bottom:12px; font-size:16px; color:var(--dim); }
|
|
169
|
-
|
|
170
|
-
.tally { display:flex; flex-wrap:wrap; gap:8px 22px; margin-bottom:22px; font-size:15px; color:var(--dim); }
|
|
171
|
-
.tally li { display:flex; align-items:center; gap:8px; }
|
|
172
|
-
.tally .ico { width:18px; height:18px; font-size:10px; }
|
|
173
|
-
.line { margin-left:11px; border-left:4px solid color-mix(in srgb, var(--route) 40%, var(--rule)); }
|
|
174
|
-
.line > li { position:relative; padding-left:30px; }
|
|
175
|
-
.row { scroll-margin-top:72px; border-bottom:1px solid var(--rule); }
|
|
176
|
-
.line > li:last-child .row { border-bottom:0; }
|
|
177
|
-
.row summary { display:flex; align-items:center; gap:12px; padding:15px 0; cursor:pointer; list-style:none; }
|
|
178
|
-
.row summary::-webkit-details-marker { display:none; }
|
|
179
|
-
.row summary::after { content:"+"; width:1em; text-align:center; font:400 24px/1 var(--text); color:var(--faint); }
|
|
180
|
-
.row[open] summary::after { content:"−"; }
|
|
181
|
-
.row summary > .ico { position:absolute; left:-14px; top:15px; box-shadow:0 0 0 4px var(--paper); }
|
|
182
|
-
.row .t { flex:1; min-width:0; font-weight:600; font-size:18px; line-height:1.35; }
|
|
183
|
-
.row summary:hover .t { color:var(--route); }
|
|
184
|
-
.row-body { padding:0 0 20px; }
|
|
185
|
-
.steps { display:grid; grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr); gap:12px; align-items:stretch; }
|
|
186
|
-
.steps > div { border-top:4px solid var(--rule); padding-top:10px; font-size:15px; line-height:1.5; color:var(--dim); }
|
|
187
|
-
.steps > i { align-self:start; margin-top:10px; font-style:normal; font-weight:700; color:var(--faint); }
|
|
188
|
-
.steps b { display:block; font:600 15px var(--display); color:var(--faint); margin-bottom:2px; }
|
|
189
|
-
.steps .res { border-top-color:var(--route); color:var(--ink); }
|
|
190
|
-
.steps .res b { color:var(--route); }
|
|
191
|
-
.meta { display:flex; flex-wrap:wrap; gap:8px 28px; margin-top:16px; font-size:14px; color:var(--dim); }
|
|
192
|
-
.meta li { max-width:30ch; }
|
|
193
|
-
.meta b, .evidence b { display:block; font-weight:400; color:var(--faint); font-size:13px; }
|
|
194
|
-
.evidence { margin-top:14px; font-size:14px; color:var(--dim); max-width:70ch; }
|
|
195
|
-
|
|
196
|
-
.choices li { display:grid; grid-template-columns:auto minmax(0, 1fr) auto; gap:4px 14px; align-items:center; padding:12px 0; border-top:1px solid var(--rule); scroll-margin-top:72px; }
|
|
197
|
-
.choices li:last-child { border-bottom:1px solid var(--rule); }
|
|
198
|
-
.choices .n { font:600 16px var(--display); width:30px; height:30px; border-radius:50%; display:grid; place-items:center; border:3px solid var(--route); color:var(--route); }
|
|
199
|
-
.choices p { font-size:16px; line-height:1.45; }
|
|
200
|
-
.toggle { background:transparent; border:1px solid var(--rule); border-radius:6px; padding:4px 12px; min-height:34px; font-size:14px; color:var(--dim); white-space:nowrap; }
|
|
201
|
-
.toggle:hover { border-color:var(--ink); color:var(--ink); }
|
|
202
|
-
.toggle[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:var(--paper); }
|
|
203
|
-
.note { display:block; grid-column:1 / -1; width:100%; min-height:66px; margin-top:8px; font:inherit; font-size:16px; color:var(--ink); background:var(--panel); border:1px solid var(--rule); border-radius:6px; padding:10px; }
|
|
204
|
-
|
|
205
|
-
details.adr { border-top:1px solid var(--rule); scroll-margin-top:72px; }
|
|
206
|
-
details.adr:last-of-type { border-bottom:1px solid var(--rule); }
|
|
207
|
-
details.adr summary { cursor:pointer; padding:14px 0; display:flex; flex-wrap:wrap; gap:6px 12px; align-items:baseline; list-style:none; }
|
|
208
|
-
details.adr summary::-webkit-details-marker { display:none; }
|
|
209
|
-
details.adr .t { flex:1; font-weight:600; font-size:18px; line-height:1.35; }
|
|
210
|
-
details.adr summary:hover .t { color:var(--route); }
|
|
211
|
-
details.adr summary::after { content:"+"; font:400 24px/1 var(--text); color:var(--faint); }
|
|
212
|
-
details.adr[open] summary::after { content:"−"; }
|
|
213
|
-
details.adr .prose { padding:0 0 4px; font-size:16px; color:var(--dim); }
|
|
214
|
-
.holds { padding:0 0 14px; font-size:14px; color:var(--faint); }
|
|
215
|
-
|
|
216
|
-
.diagram { background:var(--panel); border:1px solid var(--rule); border-radius:6px; padding:14px; overflow-x:auto; }
|
|
217
|
-
.machine .state rect { fill:var(--paper); stroke:var(--route); stroke-width:2; }
|
|
218
|
-
.machine .state text { fill:var(--ink); font:600 13px var(--text); }
|
|
219
|
-
.machine .edge { fill:none; stroke:var(--faint); stroke-width:1.5; }
|
|
220
|
-
.machine .arrow-head { fill:var(--faint); }
|
|
221
|
-
.machine .edge-label { fill:var(--dim); font:12px var(--text); paint-order:stroke; stroke:var(--panel); stroke-width:4px; }
|
|
222
|
-
|
|
223
|
-
.timeline { margin-left:11px; border-left:4px solid color-mix(in srgb, var(--route) 40%, var(--rule)); }
|
|
224
|
-
.timeline li { position:relative; padding:0 0 22px 30px; }
|
|
225
|
-
.timeline li:last-child { padding-bottom:0; }
|
|
226
|
-
.timeline .ico { position:absolute; left:-14px; top:1px; box-shadow:0 0 0 4px var(--paper); }
|
|
227
|
-
.timeline b { display:block; font:600 19px var(--display); font-stretch:82%; }
|
|
228
|
-
.timeline span { color:var(--dim); }
|
|
229
|
-
.timeline small { display:block; }
|
|
230
|
-
|
|
231
|
-
.shots { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:14px; }
|
|
232
|
-
.shots a { display:block; color:var(--ink); text-decoration:none; font-weight:600; font-size:15px; }
|
|
233
|
-
.shots img { display:block; width:100%; aspect-ratio:16/10; object-fit:cover; object-position:top; border:1px solid var(--rule); border-radius:6px; margin-bottom:6px; background:var(--panel); }
|
|
234
|
-
iframe.recap { width:100%; height:620px; border:1px solid var(--rule); border-radius:6px; background:var(--panel); }
|
|
235
|
-
|
|
236
|
-
.flash { animation:flash 1.6s ease-out; }
|
|
237
|
-
@keyframes flash { from { background:color-mix(in srgb, var(--sign) 50%, transparent); } }
|
|
238
|
-
|
|
239
|
-
#peek { position:fixed; z-index:20; max-width:340px; background:var(--ink); color:var(--paper); font-size:14px; line-height:1.4; padding:8px 10px; border-radius:6px; pointer-events:none; opacity:0; transition:opacity .12s; }
|
|
240
|
-
#peek.on { opacity:1; }
|
|
241
|
-
|
|
242
|
-
#tray { position:fixed; left:0; right:0; bottom:0; z-index:15; background:var(--ink); color:var(--paper); padding:12px 24px; display:flex; gap:16px; align-items:center; justify-content:center; flex-wrap:wrap; transform:translateY(110%); visibility:hidden; transition:transform .25s ease-out, visibility .25s; }
|
|
243
|
-
#tray.on { transform:none; visibility:visible; }
|
|
244
|
-
#tray button { background:var(--sign); color:var(--on-sign); border:0; border-radius:6px; padding:8px 16px; font-weight:600; min-height:40px; }
|
|
245
|
-
#tray .clear { background:transparent; color:var(--paper); border:1px solid currentColor; font-weight:400; }
|
|
246
|
-
|
|
247
|
-
.source { color:var(--faint); font-size:14px; margin-top:64px; }
|
|
248
|
-
|
|
249
|
-
@media (max-width:680px) {
|
|
250
|
-
body { font-size:16px; }
|
|
251
|
-
.top, .tabs > div, main { padding-left:16px; padding-right:16px; }
|
|
252
|
-
.top { grid-template-columns:1fr; padding-top:22px; }
|
|
253
|
-
.route { grid-column:1; grid-row:auto; }
|
|
254
|
-
.route small { display:none; }
|
|
255
|
-
.shift > div { grid-template-columns:1fr; padding-left:26px; }
|
|
256
|
-
.shift .tag { position:static; padding-left:0; }
|
|
257
|
-
.shift .tag::before { left:0; top:.36em; }
|
|
258
|
-
.shift.plain .after .tag { padding-top:0; }
|
|
259
|
-
.shift.plain .after .tag::before { top:.36em; }
|
|
260
|
-
article.adr dl { grid-template-columns:1fr; gap:0; }
|
|
261
|
-
article.adr dd { margin-bottom:10px; }
|
|
262
|
-
.steps { grid-template-columns:1fr; }
|
|
263
|
-
.steps > i { display:none; }
|
|
264
|
-
.out { columns:1; }
|
|
265
|
-
.row summary { flex-wrap:wrap; }
|
|
266
|
-
.row .t { flex-basis:70%; }
|
|
267
|
-
.items > li, .choices li { grid-template-columns:auto minmax(0, 1fr); }
|
|
268
|
-
.items .toggle, .choices .toggle { grid-column:2; justify-self:start; }
|
|
269
|
-
iframe.recap { height:560px; }
|
|
270
|
-
}
|
|
271
|
-
@media (prefers-reduced-motion: reduce) {
|
|
272
|
-
*, *::before, *::after { animation:none !important; transition:none !important; }
|
|
273
|
-
}
|
|
274
|
-
@media print {
|
|
275
|
-
.tabs, #tray, .toggle { display:none; }
|
|
276
|
-
.js .panel:not(.on) { display:block; }
|
|
277
|
-
.js .panel + .panel { margin-top:56px; }
|
|
278
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { FEATURE_VIEW_FILE } from '../../core/paths/output-schema.js';
|
|
4
|
-
import { parsePlan } from '../plan/plan-parser.js';
|
|
5
|
-
import { planHash } from '../plan/checks.js';
|
|
6
|
-
import { reviewReportsFromDir } from '../review-reports.js';
|
|
7
|
-
import { implementProgressFrom } from '../../../framework/hooks/shared/report-progress.js';
|
|
8
|
-
import { changeSummary } from '../recap/recap.js';
|
|
9
|
-
import { renderFeatureHtml } from './feature-html.js';
|
|
10
|
-
import { GATE_NAME, PHASE_NAME } from '../../../framework/hooks/shared/owner-words.js';
|
|
11
|
-
|
|
12
|
-
const readText = (path) => { try { return readFileSync(path, 'utf8'); } catch { return null; } };
|
|
13
|
-
const readJson = (path) => { try { return JSON.parse(readFileSync(path, 'utf8')); } catch { return null; } };
|
|
14
|
-
const listDir = (path) => { try { return readdirSync(path); } catch { return []; } };
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function collectDesign(featureDir) {
|
|
18
|
-
const screens = (sub) => listDir(join(featureDir, '1-design', sub))
|
|
19
|
-
.filter((f) => f.endsWith('.html'))
|
|
20
|
-
.map((f) => {
|
|
21
|
-
const name = f.replace(/\.html$/, '');
|
|
22
|
-
const shot = `${name}-1280.png`;
|
|
23
|
-
return { name, kind: sub, href: `1-design/${sub}/${f}`, shot: existsSync(join(featureDir, '1-design', sub, shot)) ? `1-design/${sub}/${shot}` : null };
|
|
24
|
-
});
|
|
25
|
-
return [...screens('prototipos'), ...screens('opcoes')];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function stations({ gates, design, progress, reviews, archived }) {
|
|
29
|
-
const approved = (g) => gates[g]?.approved === true || gates[g] === true;
|
|
30
|
-
const hasReview = Object.values(reviews).some((r) => r.status !== 'missing');
|
|
31
|
-
const built = hasReview || (progress?.total > 0 && progress.done === progress.total);
|
|
32
|
-
const reached = [
|
|
33
|
-
{ id: 'plan', label: PHASE_NAME.plan, done: approved('plan') },
|
|
34
|
-
...(design ? [{ id: 'uiux', label: PHASE_NAME.uiux, done: approved('uiux') }] : []),
|
|
35
|
-
{ id: 'implement', label: PHASE_NAME.implement, done: built, note: progress?.total ? `${progress.done} de ${progress.total}` : null },
|
|
36
|
-
{ id: 'review', label: PHASE_NAME.review, done: approved('review') },
|
|
37
|
-
{ id: 'ship', label: 'Entrega', done: archived },
|
|
38
|
-
];
|
|
39
|
-
// The archive keeps neither the report nor the reviews: a later station done proves the earlier ones.
|
|
40
|
-
const list = reached.map((s, i) => ({ ...s, done: s.done || reached.slice(i + 1).some((later) => later.done) }));
|
|
41
|
-
const now = list.findIndex((s) => !s.done);
|
|
42
|
-
return list.map((s, i) => ({ ...s, state: s.done ? 'done' : i === now ? 'now' : 'next' }));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function currentGate(fj) {
|
|
46
|
-
const pending = ['plan', 'uiux', 'review'].find((g) => fj.gateDecisions?.[g] && !(fj.approvalGates?.[g]?.approved === true));
|
|
47
|
-
if (!pending) return null;
|
|
48
|
-
const d = fj.gateDecisions[pending];
|
|
49
|
-
return { gate: pending, label: GATE_NAME[pending], pause: d.pause === true, resolver: d.resolver ?? null, reason: d.reason ?? null };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Everything the page shows, read from the feature folder; a missing file only drops its part. */
|
|
53
|
-
export function collectFeatureView(featureDir, feature, { changes = null, archived = false } = {}) {
|
|
54
|
-
const fj = readJson(join(featureDir, 'feature.json')) ?? {};
|
|
55
|
-
const planText = readText(join(featureDir, '2-plan', 'plan.md'));
|
|
56
|
-
const plan = parsePlan(planText ?? '');
|
|
57
|
-
const recap = readJson(join(featureDir, 'recap.json'));
|
|
58
|
-
const reviews = reviewReportsFromDir(featureDir);
|
|
59
|
-
const progress = implementProgressFrom(readText(join(featureDir, '2-plan', 'checks.json')), readText(join(featureDir, '3-implement', 'report.md')));
|
|
60
|
-
const design = collectDesign(featureDir);
|
|
61
|
-
const hasDesign = design.length > 0 || fj.approvalGates?.uiux?.approved === true || existsSync(join(featureDir, '1-design'));
|
|
62
|
-
const proved = new Map([
|
|
63
|
-
...(recap?.scenarios ?? []).filter((c) => c.status).map((c) => [c.id, c]),
|
|
64
|
-
...(reviews.verifier?.checks ?? []).map((c) => [c.id, c]),
|
|
65
|
-
]);
|
|
66
|
-
const scenarios = plan.scenarios.map((c) => {
|
|
67
|
-
const row = progress?.checks.find((p) => p.id === c.id);
|
|
68
|
-
return { ...c, status: row?.status ?? 'pendente', evidence: row?.evidence ?? '', proved: proved.get(c.id)?.status ?? null, proof_note: proved.get(c.id)?.evidence ?? '' };
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
feature,
|
|
72
|
-
description: fj.description ?? null,
|
|
73
|
-
workType: fj.workType ?? null,
|
|
74
|
-
origin: {
|
|
75
|
-
link: /https?:\/\/[^\s)>\]]+/.exec(fj.description ?? '')?.[0] ?? null,
|
|
76
|
-
branch: fj.branch ?? fj.worktree?.branch ?? null,
|
|
77
|
-
startedAt: fj.createdAt ?? null,
|
|
78
|
-
endedAt: fj.archivedAt ?? null,
|
|
79
|
-
},
|
|
80
|
-
tokens: recap?.tokens ?? null,
|
|
81
|
-
plan: { ...plan, scenarios },
|
|
82
|
-
planHash: planText ? planHash(planText) : null,
|
|
83
|
-
gate: currentGate(fj),
|
|
84
|
-
gates: fj.approvalGates ?? {},
|
|
85
|
-
stations: stations({ gates: fj.approvalGates ?? {}, design: hasDesign, progress, reviews, archived: archived || fj.status === 'completed' }),
|
|
86
|
-
progress,
|
|
87
|
-
verification: fj.verification ?? null,
|
|
88
|
-
reviews,
|
|
89
|
-
critique: readText(join(featureDir, '2-plan', 'critica.md')),
|
|
90
|
-
design: archived ? [] : design,
|
|
91
|
-
changes: changes ?? recap?.changes ?? null,
|
|
92
|
-
recap,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** Rewrites `feature.html` in place. Never throws: the page must not fail the command that refreshed it. */
|
|
97
|
-
export function writeFeatureView(featureDir, feature, { cwd = null, archived = false, changes } = {}) {
|
|
98
|
-
try {
|
|
99
|
-
const stat = changes !== undefined ? changes : (cwd && changeSummary(cwd, { statOnly: true }));
|
|
100
|
-
const path = join(featureDir, FEATURE_VIEW_FILE);
|
|
101
|
-
writeFileSync(path, renderFeatureHtml(collectFeatureView(featureDir, feature, { changes: stat ?? null, archived })));
|
|
102
|
-
return { ok: true, path };
|
|
103
|
-
} catch (err) {
|
|
104
|
-
return { ok: false, reason: err.message };
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** The page exists once the plan passed `plan-check`; before that there is nothing to decide on. */
|
|
109
|
-
export function refreshFeatureView(cwd, feature) {
|
|
110
|
-
const dir = join(cwd, '.morph', 'features', feature);
|
|
111
|
-
if (!existsSync(join(dir, '2-plan', 'checks.json'))) return null;
|
|
112
|
-
return writeFeatureView(dir, feature, { cwd });
|
|
113
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
2
|
-
|
|
3
|
-
const CHAR_W = 7.2;
|
|
4
|
-
const LABEL_CHAR_W = 6.1;
|
|
5
|
-
const NODE_H = 38;
|
|
6
|
-
const ROW = 62;
|
|
7
|
-
const PAD = 16;
|
|
8
|
-
const MIN_NODE_W = 110;
|
|
9
|
-
const MAX_NODE_W = 280;
|
|
10
|
-
const MAX_LABEL = 46;
|
|
11
|
-
const MIN_GAP = 70;
|
|
12
|
-
|
|
13
|
-
const clip = (text, max) => (text.length > max ? `${text.slice(0, max - 1).trimEnd()}…` : text);
|
|
14
|
-
|
|
15
|
-
/** Column of each node: how many steps it is from where the flow starts; a step back never moves a node. */
|
|
16
|
-
export function flowLayers(transitions) {
|
|
17
|
-
const depth = new Map();
|
|
18
|
-
const queue = [];
|
|
19
|
-
const reach = (node, d) => { if (!depth.has(node)) { depth.set(node, d); queue.push(node); } };
|
|
20
|
-
for (const start of transitions.flatMap((t) => [t.from, t.to])) {
|
|
21
|
-
reach(start, 0);
|
|
22
|
-
while (queue.length) {
|
|
23
|
-
const node = queue.shift();
|
|
24
|
-
for (const t of transitions) if (t.from === node) reach(t.to, depth.get(node) + 1);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const layers = [];
|
|
28
|
-
for (const [node, d] of depth) (layers[d] ??= []).push(node);
|
|
29
|
-
return layers;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Left to right by step, nodes of one step stacked: a fan-out opens downwards instead of running off the page.
|
|
33
|
-
export function layeredFlowSvg(transitions, label = 'Fluxo', id = 'flow') {
|
|
34
|
-
if (!transitions.length) return '';
|
|
35
|
-
const layers = flowLayers(transitions);
|
|
36
|
-
const column = new Map(layers.flatMap((nodes, i) => nodes.map((n) => [n, i])));
|
|
37
|
-
const widths = layers.map((nodes) => Math.min(MAX_NODE_W, Math.max(MIN_NODE_W, ...nodes.map((n) => Math.ceil(n.length * CHAR_W) + 28))));
|
|
38
|
-
const gaps = layers.slice(1).map((_, i) => {
|
|
39
|
-
const labels = transitions.filter((t) => column.get(t.from) === i && column.get(t.to) === i + 1).map((t) => clip(t.trigger, MAX_LABEL).length);
|
|
40
|
-
return Math.max(MIN_GAP, Math.ceil(Math.max(0, ...labels) * LABEL_CHAR_W) + 44);
|
|
41
|
-
});
|
|
42
|
-
const xs = layers.map((_, i) => PAD + widths.slice(0, i).reduce((a, b) => a + b, 0) + gaps.slice(0, i).reduce((a, b) => a + b, 0));
|
|
43
|
-
const tallest = Math.max(...layers.map((nodes) => nodes.length));
|
|
44
|
-
const backward = transitions.filter((t) => column.get(t.to) <= column.get(t.from) && t.to !== t.from);
|
|
45
|
-
const bodyH = tallest * ROW;
|
|
46
|
-
const height = PAD + bodyH + backward.length * 30 + PAD;
|
|
47
|
-
const width = xs[xs.length - 1] + widths[widths.length - 1] + PAD;
|
|
48
|
-
const box = new Map(layers.flatMap((nodes, i) => nodes.map((n, k) => {
|
|
49
|
-
const top = PAD + (bodyH - nodes.length * ROW) / 2 + k * ROW + (ROW - NODE_H) / 2;
|
|
50
|
-
return [n, { x: xs[i], y: top, w: widths[i], cy: top + NODE_H / 2 }];
|
|
51
|
-
})));
|
|
52
|
-
|
|
53
|
-
const forward = transitions.filter((t) => column.get(t.to) > column.get(t.from)).map((t) => {
|
|
54
|
-
const a = box.get(t.from);
|
|
55
|
-
const b = box.get(t.to);
|
|
56
|
-
const x1 = a.x + a.w;
|
|
57
|
-
const x2 = b.x - 4;
|
|
58
|
-
const bend = (x2 - x1) * 0.45;
|
|
59
|
-
return `<path class="edge" d="M${x1} ${a.cy} C${x1 + bend} ${a.cy} ${x2 - bend} ${b.cy} ${x2} ${b.cy}" marker-end="url(#${id})"/>`
|
|
60
|
-
+ `<text class="edge-label" x="${x2 - 12}" y="${b.cy - 7}" text-anchor="end"><title>${esc(t.trigger)}</title>${esc(clip(t.trigger, MAX_LABEL))}</text>`;
|
|
61
|
-
});
|
|
62
|
-
const back = backward.map((t, i) => {
|
|
63
|
-
const a = box.get(t.from);
|
|
64
|
-
const b = box.get(t.to);
|
|
65
|
-
const y = PAD + bodyH + (i + 1) * 30 - 8;
|
|
66
|
-
const x1 = a.x + a.w / 2;
|
|
67
|
-
const x2 = b.x + b.w / 2;
|
|
68
|
-
return `<path class="edge" d="M${x1} ${a.y + NODE_H} C${x1} ${y} ${x2} ${y} ${x2} ${b.y + NODE_H + 4}" marker-end="url(#${id})"/>`
|
|
69
|
-
+ `<text class="edge-label" x="${(x1 + x2) / 2}" y="${y - 2}" text-anchor="middle"><title>${esc(t.trigger)}</title>${esc(clip(t.trigger, MAX_LABEL))}</text>`;
|
|
70
|
-
});
|
|
71
|
-
const nodes = [...box].map(([name, b]) => `<g class="state"><rect x="${b.x}" y="${b.y}" width="${b.w}" height="${NODE_H}" rx="6"/><text x="${b.x + b.w / 2}" y="${b.cy + 5}" text-anchor="middle"><title>${esc(name)}</title>${esc(clip(name, Math.floor((b.w - 20) / CHAR_W)))}</text></g>`);
|
|
72
|
-
|
|
73
|
-
return `<svg class="machine" viewBox="0 0 ${width} ${height}" style="width:${width}px;max-width:100%" role="img" aria-label="${esc(label)}: ${esc([...box.keys()].join(', '))}">
|
|
74
|
-
<defs><marker id="${id}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" class="arrow-head"/></marker></defs>
|
|
75
|
-
${forward.join('\n')}
|
|
76
|
-
${back.join('\n')}
|
|
77
|
-
${nodes.join('\n')}
|
|
78
|
-
</svg>`;
|
|
79
|
-
}
|
package/src/lib/view/flow-svg.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
2
|
-
|
|
3
|
-
const MIN_NODE_W = 132;
|
|
4
|
-
const CHAR_W = 7.4;
|
|
5
|
-
const NODE_H = 40;
|
|
6
|
-
const GAP = 84;
|
|
7
|
-
const LANE = 38;
|
|
8
|
-
|
|
9
|
-
/** States in the order a reader meets them: breadth-first from the first transition's origin. */
|
|
10
|
-
export function stateOrder(transitions) {
|
|
11
|
-
const order = [];
|
|
12
|
-
const seen = new Set();
|
|
13
|
-
const queue = transitions.length ? [transitions[0].from] : [];
|
|
14
|
-
const visit = (s) => { if (!seen.has(s)) { seen.add(s); queue.push(s); } };
|
|
15
|
-
if (queue.length) seen.add(queue[0]);
|
|
16
|
-
while (queue.length) {
|
|
17
|
-
const s = queue.shift();
|
|
18
|
-
order.push(s);
|
|
19
|
-
for (const t of transitions) if (t.from === s) visit(t.to);
|
|
20
|
-
}
|
|
21
|
-
for (const t of transitions) for (const s of [t.from, t.to]) if (!seen.has(s)) { seen.add(s); order.push(s); }
|
|
22
|
-
return order;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// One row of states; a forward transition arcs above, a backward one below, each in its own lane so
|
|
26
|
-
// labels never stack; a self-transition loops over its node.
|
|
27
|
-
export function stateMachineSvg(transitions, label = 'Máquina de estados', id = 'arrow') {
|
|
28
|
-
if (!transitions.length) return '';
|
|
29
|
-
const order = stateOrder(transitions);
|
|
30
|
-
const NODE_W = Math.max(MIN_NODE_W, Math.ceil(Math.max(...order.map((s) => s.length)) * CHAR_W) + 24);
|
|
31
|
-
const x = (s) => 24 + order.indexOf(s) * (NODE_W + GAP);
|
|
32
|
-
const span = (t) => Math.abs(order.indexOf(t.to) - order.indexOf(t.from));
|
|
33
|
-
const forward = transitions.filter((t) => order.indexOf(t.to) > order.indexOf(t.from)).sort((a, b) => span(a) - span(b));
|
|
34
|
-
const backward = transitions.filter((t) => order.indexOf(t.to) < order.indexOf(t.from)).sort((a, b) => span(a) - span(b));
|
|
35
|
-
const loops = transitions.filter((t) => t.to === t.from);
|
|
36
|
-
const top = 24 + (forward.length + (loops.length ? 1 : 0)) * LANE;
|
|
37
|
-
const height = top + NODE_H + 24 + backward.length * LANE;
|
|
38
|
-
const width = 48 + order.length * NODE_W + (order.length - 1) * GAP;
|
|
39
|
-
const mid = (s) => x(s) + NODE_W / 2;
|
|
40
|
-
|
|
41
|
-
const edge = (t, i, above) => {
|
|
42
|
-
const x1 = mid(t.from) + (above ? 18 : -18);
|
|
43
|
-
const x2 = mid(t.to) + (above ? -18 : 18);
|
|
44
|
-
const y0 = above ? top : top + NODE_H;
|
|
45
|
-
const y = above ? top - (i + 1) * LANE : top + NODE_H + (i + 1) * LANE;
|
|
46
|
-
const lx = (x1 + x2) / 2;
|
|
47
|
-
return `<path class="edge" d="M${x1} ${y0} C${x1} ${y} ${x2} ${y} ${x2} ${y0}" marker-end="url(#${id})"/>`
|
|
48
|
-
+ `<text class="edge-label" x="${lx}" y="${y + (above ? 0 : 14)}" text-anchor="middle"><title>${esc(t.trigger)}</title>${esc(t.trigger)}</text>`;
|
|
49
|
-
};
|
|
50
|
-
const loop = (t) => {
|
|
51
|
-
const cx = mid(t.from);
|
|
52
|
-
return `<path class="edge" d="M${cx - 14} ${top} C${cx - 30} ${top - LANE} ${cx + 30} ${top - LANE} ${cx + 14} ${top}" marker-end="url(#${id})"/>`
|
|
53
|
-
+ `<text class="edge-label" x="${cx}" y="${top - LANE + 4}" text-anchor="middle">${esc(t.trigger)}</text>`;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
return `<svg class="machine" viewBox="0 0 ${width} ${height}" style="width:100%;min-width:${Math.round(width * 0.85)}px" role="img" aria-label="${esc(label)}: ${esc(order.join(', '))}">
|
|
57
|
-
<defs><marker id="${id}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" class="arrow-head"/></marker></defs>
|
|
58
|
-
${forward.map((t, i) => edge(t, i, true)).join('\n')}
|
|
59
|
-
${backward.map((t, i) => edge(t, i, false)).join('\n')}
|
|
60
|
-
${loops.map(loop).join('\n')}
|
|
61
|
-
${order.map((s) => `<g class="state"><rect x="${x(s)}" y="${top}" width="${NODE_W}" height="${NODE_H}" rx="10"/><text x="${mid(s)}" y="${top + NODE_H / 2 + 5}" text-anchor="middle">${esc(s)}</text></g>`).join('\n')}
|
|
62
|
-
</svg>`;
|
|
63
|
-
}
|
package/src/lib/view/tokens.css
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
color-scheme: light dark;
|
|
3
|
-
--paper:#eef2f0; --panel:#fbfcfb; --ink:#12282b; --dim:#3f5558; --faint:#5a6e70; --rule:#cfdad7;
|
|
4
|
-
--route:#0b6e75; --sign:#ffc629; --on-sign:#1c1a0a;
|
|
5
|
-
--ok:#1f7a4d; --warn:#935500; --bad:#b4232f;
|
|
6
|
-
--s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100; --s5:#e87ba4;
|
|
7
|
-
--display:"Bahnschrift","DIN Alternate","DIN Next","Avenir Next",system-ui,sans-serif;
|
|
8
|
-
--text:"Segoe UI Variable Text","Segoe UI",-apple-system,"Helvetica Neue",system-ui,sans-serif;
|
|
9
|
-
--code:"Cascadia Code",ui-monospace,Menlo,Consolas,monospace;
|
|
10
|
-
}
|
|
11
|
-
@media (prefers-color-scheme: dark) {
|
|
12
|
-
:root {
|
|
13
|
-
--paper:#0e1c1e; --panel:#152729; --ink:#e6efee; --dim:#adc1c0; --faint:#8ba1a2; --rule:#2a4144;
|
|
14
|
-
--route:#45c4c9;
|
|
15
|
-
--ok:#5cc28a; --warn:#e2a54b; --bad:#f07178;
|
|
16
|
-
--s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Testable mirror of the classification rules in MORPH.md: the two must stay in sync.
|
|
2
|
-
// Hotfix wins outright; a bug/chore tie is returned to the caller, never guessed.
|
|
3
|
-
|
|
4
|
-
// Plural/inflected forms are listed EXPLICITLY: matching is whole-word, so
|
|
5
|
-
// "incidentes" is not "incidente". Recall lives here, in a list that is visible
|
|
6
|
-
// and tested, rather than in a matcher that would fire on fragments.
|
|
7
|
-
const HOTFIX_KEYWORDS = [
|
|
8
|
-
'hotfix', 'produção quebrada', 'prod down', 'produção caiu', 'incident',
|
|
9
|
-
'incidents', 'incidente', 'incidentes', 'urgente', 'urgência', 'p0', 'outage',
|
|
10
|
-
'caiu em produção',
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const BUG_KEYWORDS = [
|
|
14
|
-
'bug', 'bugs', 'fix', 'corrigir', 'corrige', 'broken', 'quebrado', 'quebrada',
|
|
15
|
-
'regressão', 'regressao', 'exception', 'exceptions', 'stack trace',
|
|
16
|
-
'não funciona', 'nao funciona', 'erro', 'erros',
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
const CHORE_KEYWORDS = [
|
|
20
|
-
'chore', 'typo', 'typos', 'rename', 'renomear', 'bump', 'dependência',
|
|
21
|
-
'dependencia', 'dependências', 'dependencias', 'config', 'configs', 'cleanup',
|
|
22
|
-
'limpeza', 'docs', 'documentação', 'lint', 'formatação',
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
// Whole words only: a false positive silently skips approval gates (`p0` in "group0", `fix` in
|
|
26
|
-
// "prefix"). `\b` is ASCII-only in JS and breaks on pt-BR letters, hence the Unicode lookarounds.
|
|
27
|
-
function matchKeywords(haystack, keywords) {
|
|
28
|
-
return keywords.filter((kw) => {
|
|
29
|
-
const escaped = kw.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
30
|
-
return new RegExp(`(?<![\\p{L}\\p{N}])${escaped}(?![\\p{L}\\p{N}])`, 'u').test(haystack);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function wordCount(str) {
|
|
35
|
-
const trimmed = str.trim();
|
|
36
|
-
return trimmed.length === 0 ? 0 : trimmed.split(/\s+/).length;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function detectWorkType({ text = '', declaredScope = '', estimatedFiles } = {}) {
|
|
40
|
-
const haystack = `${text} ${declaredScope}`.toLowerCase();
|
|
41
|
-
|
|
42
|
-
const hotfixMatched = matchKeywords(haystack, HOTFIX_KEYWORDS);
|
|
43
|
-
const bugMatched = matchKeywords(haystack, BUG_KEYWORDS);
|
|
44
|
-
const choreMatched = matchKeywords(haystack, CHORE_KEYWORDS);
|
|
45
|
-
|
|
46
|
-
const matched = {
|
|
47
|
-
hotfix: hotfixMatched,
|
|
48
|
-
bug: bugMatched,
|
|
49
|
-
chore: choreMatched,
|
|
50
|
-
feature: [], // no keywords of its own — the catch-all default
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
if (hotfixMatched.length > 0) {
|
|
54
|
-
return { workType: 'hotfix', confidence: 'high', matched, candidates: ['hotfix'] };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (bugMatched.length === 0 && choreMatched.length === 0) {
|
|
58
|
-
return { workType: null, confidence: 'none', matched, candidates: [] };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
let bugScore = bugMatched.length;
|
|
62
|
-
let choreScore = choreMatched.length;
|
|
63
|
-
|
|
64
|
-
// Weak nudges only break ties: applied otherwise, they drag a clean single-keyword match into a tie.
|
|
65
|
-
if (bugMatched.length === choreMatched.length) {
|
|
66
|
-
if (typeof estimatedFiles === 'number' && estimatedFiles <= 2) {
|
|
67
|
-
bugScore += 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (wordCount(declaredScope) > 0 && wordCount(declaredScope) <= 6) {
|
|
71
|
-
choreScore += 1;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (bugScore === choreScore) {
|
|
76
|
-
return { workType: null, confidence: 'tie', matched, candidates: ['bug', 'chore'] };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const workType = bugScore > choreScore ? 'bug' : 'chore';
|
|
80
|
-
return { workType, confidence: 'high', matched, candidates: [workType] };
|
|
81
|
-
}
|
package/src/lib/worktree/dirs.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// The names live in framework/hooks/shared/worktree-root.js (a hook cannot import `src/`, and the
|
|
2
|
-
// `worktree.root` resolver needs them); every convention-based reader still imports them from here.
|
|
3
|
-
export { WORKTREES_DIR, LEGACY_WORKTREES_DIR, WORKTREE_DIR_NAMES } from '../../../framework/hooks/shared/worktree-root.js';
|