@decantr/cli 3.7.0 → 3.8.1
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 +30 -30
- package/dist/bin.js +5 -5
- package/dist/{chunk-24JR4ZNG.js → chunk-2UC6YYVZ.js} +25 -11
- package/dist/{chunk-O7N4CCWS.js → chunk-CI2R5W36.js} +477 -604
- package/dist/{chunk-NDH3BDXY.js → chunk-JK3DYOHA.js} +49 -34
- package/dist/{chunk-WAGVDMJV.js → chunk-PFFNEN7L.js} +19 -19
- package/dist/{chunk-56HUEUO3.js → chunk-W242I6CS.js} +1 -1
- package/dist/{content-health-4KP2EGTI.js → content-health-PYGEZZOV.js} +4 -4
- package/dist/{heal-2FK63EQE.js → heal-AEMYO7T2.js} +1 -1
- package/dist/{health-KUPBUU3B.js → health-WZ562PRA.js} +2 -2
- package/dist/index.js +5 -5
- package/dist/{studio-J6Z3AUAR.js → studio-6Q2G4PTT.js} +3 -3
- package/dist/{upgrade-4BUQAYBU.js → upgrade-5ZE4VR3R.js} +1 -1
- package/dist/{workspace-QAZ3F4VT.js → workspace-EDP7QG7T.js} +3 -3
- package/package.json +7 -6
- package/src/bundled/blueprints/default.json +1 -1
- package/src/templates/DECANTR.md.template +1 -1
|
@@ -87,7 +87,7 @@ var RegistryClient = class {
|
|
|
87
87
|
constructor(options = {}) {
|
|
88
88
|
this.projectRoot = options.projectRoot || process.cwd();
|
|
89
89
|
this.cacheDir = options.cacheDir || join(this.projectRoot, ".decantr", "cache");
|
|
90
|
-
this.apiUrl = options.apiUrl || process.env.DECANTR_API_URL || DEFAULT_API_URL;
|
|
90
|
+
this.apiUrl = options.apiUrl || process.env.DECANTR_API_URL || process.env.REGISTRY_URL || DEFAULT_API_URL;
|
|
91
91
|
this.offline = options.offline || false;
|
|
92
92
|
this.apiClient = new RegistryAPIClient({
|
|
93
93
|
baseUrl: this.apiUrl,
|
|
@@ -3827,17 +3827,17 @@ Read \`.decantr/analysis.json\` first for the detected framework, routes, stylin
|
|
|
3827
3827
|
Then read \`.decantr/doctrine-map.json\`, \`.decantr/ambient-context.json\`, and \`.decantr/brownfield-report.md\` for ranked source precedence, existing assistant rules, docs, design-system evidence, and unresolved doctrine risks.
|
|
3828
3828
|
Then read \`.decantr/context/scaffold-pack.md\` and \`.decantr/context/scaffold.md\` to understand the accepted Decantr contract.
|
|
3829
3829
|
|
|
3830
|
-
Treat Decantr as the reconciled contract layer and the original docs/rules as cited evidence. Preserve the current framework, package manager, router, styling system, data boundaries, and working runtime structure unless the contract gives you a reviewed reason to change them.
|
|
3830
|
+
Treat Decantr as the reconciled contract layer and the original docs/rules as cited evidence. Preserve the current framework, package manager, router, styling system, data boundaries, and working runtime structure unless the contract gives you a reviewed reason to change them. Official corpus content is optional in this workflow unless the task explicitly asks for it.` : `This project is using Decantr in **brownfield attach** mode with **${params.adoptionMode || "contract-only"}** adoption.
|
|
3831
3831
|
|
|
3832
3832
|
No \`.decantr/analysis.json\` or \`.decantr/init-seed.json\` was present when this context was generated. Inventory the current framework, routes, styling, layout, package manager, and rule files before changing runtime code. Then read \`.decantr/context/scaffold-pack.md\` and \`.decantr/context/scaffold.md\` to understand the Decantr contract you are layering onto the existing app.
|
|
3833
3833
|
|
|
3834
|
-
Preserve the current framework, package manager, router, and working runtime structure unless the contract gives you a reviewed reason to change them.
|
|
3834
|
+
Preserve the current framework, package manager, router, and working runtime structure unless the contract gives you a reviewed reason to change them. Official corpus content is optional in this workflow unless the task explicitly asks for it.` : params.workflowMode === "greenfield-contract-only" ? `This project is using Decantr in **greenfield contract-only** mode with **${params.adoptionMode || "contract-only"}** adoption.
|
|
3835
3835
|
|
|
3836
3836
|
Treat the compiled execution-pack files as the primary source of truth for the app contract, but do not assume Decantr owns the runtime or styling system. Use narrative docs only as secondary explanation when the compiled packs are not enough.
|
|
3837
3837
|
Use only files present in this workspace as the source of truth. If local scaffold files disagree, stop and report the mismatch instead of relying on external Decantr assumptions or prior examples.
|
|
3838
3838
|
|
|
3839
3839
|
Read \`.decantr/context/scaffold-pack.md\` first for the compact compiled shell, theme, feature, and route contract.
|
|
3840
|
-
Then read \`.decantr/context/scaffold.md\` for the fuller app overview, topology, route map, and voice guidance.` : `This project is using Decantr in **greenfield scaffold** mode with **${params.adoptionMode || "
|
|
3840
|
+
Then read \`.decantr/context/scaffold.md\` for the fuller app overview, topology, route map, and voice guidance.` : `This project is using Decantr in **greenfield scaffold** mode with **${params.adoptionMode || "contract-only"}** adoption.
|
|
3841
3841
|
|
|
3842
3842
|
Treat the compiled execution-pack files as the primary source of truth.
|
|
3843
3843
|
Use narrative docs only as secondary explanation when the compiled packs are not enough.
|
|
@@ -3854,7 +3854,7 @@ Start implementation from the shell layouts and shared route structure before fi
|
|
|
3854
3854
|
const themeDesc = `${params.themeName || "default"} (${params.themeMode || "dark"} mode${params.themeShape ? `, ${params.themeShape} shape` : ""})`;
|
|
3855
3855
|
briefLines.push(`- **Theme:** ${themeDesc}`);
|
|
3856
3856
|
briefLines.push(`- **Workflow:** ${params.workflowMode || "greenfield-scaffold"}`);
|
|
3857
|
-
briefLines.push(`- **Adoption mode:** ${params.adoptionMode || "
|
|
3857
|
+
briefLines.push(`- **Adoption mode:** ${params.adoptionMode || "contract-only"}`);
|
|
3858
3858
|
if (params.personality && params.personality.length > 0) {
|
|
3859
3859
|
briefLines.push(`- **Personality:** ${params.personality.join(". ")}`);
|
|
3860
3860
|
}
|
|
@@ -3974,7 +3974,7 @@ function generateProjectJson(detected, options, registrySource) {
|
|
|
3974
3974
|
version: CLI_VERSION,
|
|
3975
3975
|
flags: buildFlagsString(options),
|
|
3976
3976
|
workflowMode: options.workflowMode || "greenfield-scaffold",
|
|
3977
|
-
adoptionMode: options.adoptionMode || "
|
|
3977
|
+
adoptionMode: options.adoptionMode || "contract-only",
|
|
3978
3978
|
contentSource: options.contentSource || "none",
|
|
3979
3979
|
assistantBridge: options.assistantBridge || "none",
|
|
3980
3980
|
projectScope: options.projectScope || "single-app",
|
|
@@ -4196,7 +4196,7 @@ ${renderPackReferenceList("Page Packs", pageRefs, "No page packs were generated
|
|
|
4196
4196
|
|
|
4197
4197
|
- [error] Theme identity remains \`${scaffoldPack.data.theme.id}\` until the essence changes.
|
|
4198
4198
|
- [error] The new page exists in the essence before code generation begins.
|
|
4199
|
-
- [error] New layouts only use
|
|
4199
|
+
- [error] New layouts only use official-corpus or accepted local patterns.
|
|
4200
4200
|
- [warn] New routes should fit the current shell and section topology instead of creating off-contract filler pages.
|
|
4201
4201
|
|
|
4202
4202
|
---
|
|
@@ -4449,7 +4449,7 @@ function scaffoldMinimal(projectRoot, options = {}) {
|
|
|
4449
4449
|
const decantrMdContent = `# DECANTR.md
|
|
4450
4450
|
|
|
4451
4451
|
> This file was generated by \`decantr init\` in offline/minimal mode.
|
|
4452
|
-
> Run \`decantr upgrade\` when online to pull
|
|
4452
|
+
> Run \`decantr upgrade\` when online to pull the latest official content.
|
|
4453
4453
|
|
|
4454
4454
|
## Two-Layer Model
|
|
4455
4455
|
|
|
@@ -4478,16 +4478,20 @@ Blueprint defines pages, shells, and patterns. Blueprint deviations are **warnin
|
|
|
4478
4478
|
|
|
4479
4479
|
## MCP Tools
|
|
4480
4480
|
|
|
4481
|
-
When available, use
|
|
4482
|
-
- \`
|
|
4483
|
-
- \`
|
|
4484
|
-
- \`
|
|
4485
|
-
- \`
|
|
4481
|
+
When available, use the eight consolidated Decantr tools:
|
|
4482
|
+
- \`decantr_project\` \u2014 Read project state and workspace health
|
|
4483
|
+
- \`decantr_contract\` \u2014 Read, validate, generate, and drift-check the contract
|
|
4484
|
+
- \`decantr_context\` \u2014 Read scaffold, section, page, task, and pack context
|
|
4485
|
+
- \`decantr_graph\` \u2014 Query local typed Contract graph artifacts
|
|
4486
|
+
- \`decantr_registry\` \u2014 Compatibility content-corpus and execution-pack helper
|
|
4487
|
+
- \`decantr_verify\` \u2014 Run local verification and evidence reads
|
|
4488
|
+
- \`decantr_repair\` \u2014 Read findings, plans, prompts, and health-loop guidance
|
|
4489
|
+
- \`decantr_contract_write\` \u2014 Explicitly accept drift or update Essence v4
|
|
4486
4490
|
|
|
4487
4491
|
## Quick Start
|
|
4488
4492
|
|
|
4489
4493
|
1. Edit \`decantr.essence.json\` to define your project structure.
|
|
4490
|
-
2. Run \`decantr sync\` when online to fetch
|
|
4494
|
+
2. Run \`decantr sync\` when online to fetch official content.
|
|
4491
4495
|
3. Use \`decantr create <type> <name>\` to create custom content.
|
|
4492
4496
|
4. Use \`decantr validate\` to check your essence file.
|
|
4493
4497
|
|
|
@@ -4495,21 +4499,20 @@ When available, use these tools:
|
|
|
4495
4499
|
|
|
4496
4500
|
- \`decantr init\` \u2014 Initialize a new Decantr project
|
|
4497
4501
|
- \`decantr status\` \u2014 Project health and DNA/Blueprint overview
|
|
4498
|
-
- \`decantr sync\` \u2014 Sync
|
|
4502
|
+
- \`decantr sync\` \u2014 Sync official content
|
|
4499
4503
|
- \`decantr audit\` \u2014 Audit project for issues
|
|
4500
4504
|
- \`decantr migrate --to v4\` \u2014 Migrate older essence files to v4
|
|
4501
4505
|
- \`decantr check\` \u2014 Detect drift issues
|
|
4502
4506
|
- \`decantr sync-drift\` \u2014 Review and resolve drift entries
|
|
4503
4507
|
- \`decantr validate\` \u2014 Validate essence file
|
|
4504
|
-
- \`decantr search\` \u2014 Search
|
|
4508
|
+
- \`decantr search\` \u2014 Search official content
|
|
4505
4509
|
- \`decantr suggest\` \u2014 Suggest patterns or alternatives
|
|
4506
|
-
- \`decantr get\` \u2014 Get full details of a
|
|
4510
|
+
- \`decantr get\` \u2014 Get full details of a content item
|
|
4507
4511
|
- \`decantr list\` \u2014 List items by type
|
|
4508
4512
|
- \`decantr theme\` \u2014 Manage custom themes
|
|
4509
4513
|
- \`decantr create\` \u2014 Create custom content items
|
|
4510
|
-
- \`decantr
|
|
4511
|
-
- \`decantr
|
|
4512
|
-
- \`decantr logout\` \u2014 Remove stored credentials
|
|
4514
|
+
- \`decantr content\` \u2014 Inspect and compile the official corpus
|
|
4515
|
+
- \`decantr registry\` \u2014 Legacy compatibility alias for content helpers
|
|
4513
4516
|
- \`decantr upgrade\` \u2014 Check for content updates
|
|
4514
4517
|
|
|
4515
4518
|
---
|
|
@@ -4703,7 +4706,7 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
|
|
|
4703
4706
|
}
|
|
4704
4707
|
}
|
|
4705
4708
|
const effectiveWorkflowMode = options?.workflowMode || storedWorkflowMode || "greenfield-scaffold";
|
|
4706
|
-
const effectiveAdoptionMode = options?.adoptionMode || storedAdoptionMode || "
|
|
4709
|
+
const effectiveAdoptionMode = options?.adoptionMode || storedAdoptionMode || "contract-only";
|
|
4707
4710
|
const effectiveAnalysisArtifacts = options?.analysisArtifacts ?? storedAnalysisArtifacts ?? false;
|
|
4708
4711
|
if (!storedVoice && storedBlueprintId) {
|
|
4709
4712
|
try {
|
|
@@ -4813,7 +4816,7 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
|
|
|
4813
4816
|
`${YELLOW} but the theme's personality may not land. Consider picking a different theme or adding`
|
|
4814
4817
|
);
|
|
4815
4818
|
console.warn(
|
|
4816
|
-
`${YELLOW} "${mode}" keys to the theme's palette in decantr
|
|
4819
|
+
`${YELLOW} "${mode}" keys to the theme's palette in @decantr/content.${RESET}`
|
|
4817
4820
|
);
|
|
4818
4821
|
}
|
|
4819
4822
|
}
|
|
@@ -5214,8 +5217,9 @@ function mapRegistryShellToShellInfo(shell) {
|
|
|
5214
5217
|
internal_layout: isRecord(shell.internal_layout) ? shell.internal_layout : void 0
|
|
5215
5218
|
};
|
|
5216
5219
|
}
|
|
5217
|
-
function generateShellImplementation(shellId, shellInfo) {
|
|
5220
|
+
function generateShellImplementation(shellId, shellInfo, adoptionMode = "contract-only") {
|
|
5218
5221
|
const lines = [];
|
|
5222
|
+
const usesDecantrCss = adoptionMode === "decantr-css";
|
|
5219
5223
|
lines.push(`## Shell Implementation (${shellId})`);
|
|
5220
5224
|
lines.push("");
|
|
5221
5225
|
if (shellInfo.internal_layout && Object.keys(shellInfo.internal_layout).length > 0) {
|
|
@@ -5224,9 +5228,11 @@ function generateShellImplementation(shellId, shellInfo) {
|
|
|
5224
5228
|
lines.push("");
|
|
5225
5229
|
if (isRecord(props)) {
|
|
5226
5230
|
for (const [key, value] of Object.entries(props)) {
|
|
5231
|
+
if (key === "atoms" && !usesDecantrCss) continue;
|
|
5227
5232
|
if (isRecord(value)) {
|
|
5228
5233
|
lines.push(`- **${key}:**`);
|
|
5229
5234
|
for (const [subKey, subValue] of Object.entries(value)) {
|
|
5235
|
+
if (subKey === "atoms" && !usesDecantrCss) continue;
|
|
5230
5236
|
lines.push(` - ${subKey}: ${subValue}`);
|
|
5231
5237
|
}
|
|
5232
5238
|
} else {
|
|
@@ -5240,12 +5246,12 @@ function generateShellImplementation(shellId, shellInfo) {
|
|
|
5240
5246
|
}
|
|
5241
5247
|
lines.push("### Anti-patterns");
|
|
5242
5248
|
lines.push("");
|
|
5243
|
-
lines.push(
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
+
lines.push("- Do NOT nest scrolling regions \u2014 one scroll container per shell region.");
|
|
5250
|
+
if (usesDecantrCss) {
|
|
5251
|
+
lines.push(
|
|
5252
|
+
"- Do NOT apply `d-surface` to shell frame regions (sidebar, header). Use `var(--d-surface)` or `var(--d-bg)` directly."
|
|
5253
|
+
);
|
|
5254
|
+
}
|
|
5249
5255
|
lines.push(
|
|
5250
5256
|
"- Do NOT add wrapper `<div>` elements around shell regions \u2014 the grid areas handle placement."
|
|
5251
5257
|
);
|
|
@@ -5255,7 +5261,7 @@ function generateShellImplementation(shellId, shellInfo) {
|
|
|
5255
5261
|
lines.push(`**Layout:** ${shellInfo.layout}`);
|
|
5256
5262
|
lines.push("");
|
|
5257
5263
|
}
|
|
5258
|
-
if (shellInfo.atoms) {
|
|
5264
|
+
if (shellInfo.atoms && usesDecantrCss) {
|
|
5259
5265
|
lines.push(`**Atoms:** \`${shellInfo.atoms}\``);
|
|
5260
5266
|
lines.push("");
|
|
5261
5267
|
}
|
|
@@ -5295,6 +5301,7 @@ function generateShellImplementation(shellId, shellInfo) {
|
|
|
5295
5301
|
function generateQuickStart(input) {
|
|
5296
5302
|
const { section, shellInfo, decorators, personality, voiceTone } = input;
|
|
5297
5303
|
const lines = [];
|
|
5304
|
+
const usesDecantrCss = input.adoptionMode === "decantr-css";
|
|
5298
5305
|
lines.push("## Quick Start");
|
|
5299
5306
|
lines.push("");
|
|
5300
5307
|
const shellDesc = shellInfo?.description || `${section.shell} shell`;
|
|
@@ -5317,8 +5324,10 @@ function generateQuickStart(input) {
|
|
|
5317
5324
|
}
|
|
5318
5325
|
if (decorators.length > 0) {
|
|
5319
5326
|
const count = decorators.length;
|
|
5327
|
+
const label = usesDecantrCss ? "Theme decorators" : "Theme intent references";
|
|
5328
|
+
const noun = usesDecantrCss ? `class${count === 1 ? "" : "es"}` : `reference${count === 1 ? "" : "s"}`;
|
|
5320
5329
|
lines.push(
|
|
5321
|
-
|
|
5330
|
+
`**${label}:** ${count} ${noun} \u2014 see \`section-${section.id}-pack.md\` for the intent and apply-to contract`
|
|
5322
5331
|
);
|
|
5323
5332
|
}
|
|
5324
5333
|
const pLower = personality.join(" ").toLowerCase();
|
|
@@ -5416,7 +5425,13 @@ function generateSectionContext(input) {
|
|
|
5416
5425
|
lines.push("");
|
|
5417
5426
|
lines.push(...generateQuickStart(input));
|
|
5418
5427
|
if (shellInfo) {
|
|
5419
|
-
lines.push(
|
|
5428
|
+
lines.push(
|
|
5429
|
+
...generateShellImplementation(
|
|
5430
|
+
section.shell,
|
|
5431
|
+
shellInfo,
|
|
5432
|
+
adoptionMode ?? "contract-only"
|
|
5433
|
+
)
|
|
5434
|
+
);
|
|
5420
5435
|
}
|
|
5421
5436
|
if (shellInfo?.guidance && Object.keys(shellInfo.guidance).length > 0) {
|
|
5422
5437
|
const labelTreatment = shellInfo.guidance.section_label_treatment;
|
|
@@ -5480,7 +5495,7 @@ function generateSectionContext(input) {
|
|
|
5480
5495
|
const decoratorDefs = input.themeData?.decorator_definitions;
|
|
5481
5496
|
const totalDecoratorCount = decoratorDefs && Object.keys(decoratorDefs).length || decorators.length;
|
|
5482
5497
|
if (totalDecoratorCount > 0) {
|
|
5483
|
-
if (adoptionMode
|
|
5498
|
+
if (adoptionMode !== "decantr-css") {
|
|
5484
5499
|
lines.push(
|
|
5485
5500
|
`**Theme intent:** ${totalDecoratorCount} \`${themeName}-*\` decorator reference(s) exist, but this project is contract-only. Translate the intent into the app's current styling system instead of applying Decantr decorator classes directly.`
|
|
5486
5501
|
);
|
|
@@ -5511,7 +5526,7 @@ function generateSectionContext(input) {
|
|
|
5511
5526
|
}
|
|
5512
5527
|
const themePrefix = themeName.split("-")[0] || themeName;
|
|
5513
5528
|
lines.push("");
|
|
5514
|
-
if (adoptionMode
|
|
5529
|
+
if (adoptionMode !== "decantr-css") {
|
|
5515
5530
|
lines.push(
|
|
5516
5531
|
"Usage: implement this section through the app's existing styling authority (design-system components, Tailwind/Sass/theme tokens, CVA variants, or accepted local rules). Do not add `@decantr/css`, `css(...)`, `d-*` treatments, or Decantr token CSS unless adoption mode changes."
|
|
5517
5532
|
);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
sendProjectHealthCiFailedTelemetry,
|
|
4
4
|
sendProjectHealthPromptTelemetry,
|
|
5
5
|
sendProjectHealthReportTelemetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2UC6YYVZ.js";
|
|
7
7
|
|
|
8
8
|
// src/commands/health.ts
|
|
9
9
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
@@ -421,9 +421,9 @@ function createBrownfieldCodifyProposal(input) {
|
|
|
421
421
|
"existing production source",
|
|
422
422
|
"accepted local patterns and rules",
|
|
423
423
|
"Decantr Essence V4 contract",
|
|
424
|
-
"
|
|
424
|
+
"official corpus patterns and execution packs as optional guidance"
|
|
425
425
|
],
|
|
426
|
-
hostedPatternMapping: "Use
|
|
426
|
+
hostedPatternMapping: "Use official corpus patterns as vocabulary and review guidance. Before enforcing one, map it to a project-owned component path, class recipe, token recipe, or explicit exception here."
|
|
427
427
|
},
|
|
428
428
|
patterns: [
|
|
429
429
|
{
|
|
@@ -708,9 +708,9 @@ function writeHostedPatternMappingProposal(input) {
|
|
|
708
708
|
"existing production source",
|
|
709
709
|
"accepted local patterns and rules",
|
|
710
710
|
"Decantr Essence V4 contract",
|
|
711
|
-
"
|
|
711
|
+
"official corpus patterns and execution packs as optional guidance"
|
|
712
712
|
],
|
|
713
|
-
hostedPatternMapping: "
|
|
713
|
+
hostedPatternMapping: "Official corpus patterns are advisory until mapped to project-owned component paths, token recipes, class recipes, and explicit exceptions."
|
|
714
714
|
},
|
|
715
715
|
patterns: Array.isArray(existing?.patterns) ? [...existing.patterns] : [],
|
|
716
716
|
starterRules: Array.isArray(existing?.starterRules) ? existing.starterRules : [],
|
|
@@ -728,8 +728,8 @@ function writeHostedPatternMappingProposal(input) {
|
|
|
728
728
|
const localPatternId = existingIds.has(slug) ? `${slug}-registry-map` : slug;
|
|
729
729
|
const mappedPattern = {
|
|
730
730
|
id: localPatternId,
|
|
731
|
-
label: input.hostedPattern.name ? `${input.hostedPattern.name}
|
|
732
|
-
role: "
|
|
731
|
+
label: input.hostedPattern.name ? `${input.hostedPattern.name} content mapping` : `${slug} content mapping`,
|
|
732
|
+
role: "Official corpus guidance mapped into project-owned Hybrid law",
|
|
733
733
|
appliesTo: [
|
|
734
734
|
...input.hostedPattern.components ?? [],
|
|
735
735
|
...input.hostedPattern.interactions ?? [],
|
|
@@ -738,13 +738,13 @@ function writeHostedPatternMappingProposal(input) {
|
|
|
738
738
|
componentPaths: [],
|
|
739
739
|
tokenHints: [],
|
|
740
740
|
classHints: [],
|
|
741
|
-
decide: `Map
|
|
741
|
+
decide: `Map official corpus pattern "${slug}" into this app's existing components, tokens, classes, and exceptions before treating it as enforceable.`,
|
|
742
742
|
hostedPatternRefs: [input.hostedPattern],
|
|
743
743
|
confidence: {
|
|
744
744
|
tier: "low",
|
|
745
745
|
score: 0.25,
|
|
746
746
|
rationale: [
|
|
747
|
-
"
|
|
747
|
+
"An official corpus pattern was selected intentionally.",
|
|
748
748
|
"No project-owned component path or token recipe has been mapped yet."
|
|
749
749
|
]
|
|
750
750
|
},
|
|
@@ -753,23 +753,23 @@ function writeHostedPatternMappingProposal(input) {
|
|
|
753
753
|
status: "needs-mapping",
|
|
754
754
|
notes: [
|
|
755
755
|
"This proposal does not change source files.",
|
|
756
|
-
"Do not enforce this
|
|
756
|
+
"Do not enforce this corpus pattern until project-owned implementation details are filled in.",
|
|
757
757
|
"Use accepted local rules, ESLint, Biome, Storybook, or visual regression for deterministic blocking checks."
|
|
758
758
|
]
|
|
759
759
|
},
|
|
760
760
|
evidence: [
|
|
761
|
-
`
|
|
762
|
-
input.hostedPattern.visualBrief ? `Visual brief: ${input.hostedPattern.visualBrief}` : "Visual brief not provided by the
|
|
761
|
+
`Corpus pattern ${input.hostedPattern.source}/${slug}${input.hostedPattern.description ? `: ${input.hostedPattern.description}` : ""}`,
|
|
762
|
+
input.hostedPattern.visualBrief ? `Visual brief: ${input.hostedPattern.visualBrief}` : "Visual brief not provided by the corpus pattern."
|
|
763
763
|
],
|
|
764
764
|
evidenceToCollect: [
|
|
765
765
|
"Project-owned component path(s) that implement this pattern.",
|
|
766
766
|
"Allowed token/class recipe(s) for this app.",
|
|
767
767
|
"Variant names and states that are legal in this project.",
|
|
768
|
-
"Explicit exceptions where this
|
|
768
|
+
"Explicit exceptions where this corpus pattern should not apply."
|
|
769
769
|
],
|
|
770
770
|
forbiddenAlternatives: [
|
|
771
|
-
"Replacing existing app components solely because a
|
|
772
|
-
"Treating
|
|
771
|
+
"Replacing existing app components solely because a corpus pattern exists.",
|
|
772
|
+
"Treating official corpus guidance as enforceable without accepted local law."
|
|
773
773
|
]
|
|
774
774
|
};
|
|
775
775
|
const index = (patternPack.patterns ?? []).findIndex((pattern) => pattern.id === localPatternId);
|
|
@@ -782,7 +782,7 @@ function writeHostedPatternMappingProposal(input) {
|
|
|
782
782
|
patternPack.nextSteps = [
|
|
783
783
|
.../* @__PURE__ */ new Set([
|
|
784
784
|
...patternPack.nextSteps ?? [],
|
|
785
|
-
"Fill the
|
|
785
|
+
"Fill the corpus mapping with project-owned component paths, token/class recipes, variants, and exceptions.",
|
|
786
786
|
"Run decantr codify --accept only after the mapping reflects the existing app.",
|
|
787
787
|
"Use decantr verify --brownfield --local-patterns after edits to keep mapped local law visible."
|
|
788
788
|
])
|
|
@@ -842,7 +842,7 @@ function validateLocalLaw(projectRoot) {
|
|
|
842
842
|
}
|
|
843
843
|
if (id && hostedRefs.length > 0 && paths.length === 0) {
|
|
844
844
|
warnings.push(
|
|
845
|
-
`Local pattern ${id} maps
|
|
845
|
+
`Local pattern ${id} maps official corpus guidance but has no project-owned component path yet.`
|
|
846
846
|
);
|
|
847
847
|
}
|
|
848
848
|
if (pattern.behavior_obligations && (typeof pattern.behavior_obligations !== "object" || Array.isArray(pattern.behavior_obligations))) {
|
|
@@ -1393,7 +1393,7 @@ function createStyleBridgeProposal(input) {
|
|
|
1393
1393
|
"accepted style bridge",
|
|
1394
1394
|
"accepted local patterns and rules",
|
|
1395
1395
|
"Essence V4 contract",
|
|
1396
|
-
"
|
|
1396
|
+
"official corpus patterns and execution packs as optional guidance"
|
|
1397
1397
|
]
|
|
1398
1398
|
},
|
|
1399
1399
|
project: {
|
|
@@ -1541,7 +1541,7 @@ function createStyleBridgeProposal(input) {
|
|
|
1541
1541
|
],
|
|
1542
1542
|
rules: [
|
|
1543
1543
|
"The bridge is advisory until accepted; after acceptance, task/doctor/CI should surface it as Hybrid authority.",
|
|
1544
|
-
"The bridge does not make
|
|
1544
|
+
"The bridge does not make official corpus patterns enforceable. Map corpus concepts into local law first.",
|
|
1545
1545
|
"Keep deterministic blocking checks in .decantr/rules.json, ESLint, Biome, tests, or visual regression."
|
|
1546
1546
|
],
|
|
1547
1547
|
nextSteps: [
|
|
@@ -99,9 +99,9 @@ function commandsForFinding(source) {
|
|
|
99
99
|
}
|
|
100
100
|
function buildRemediationPrompt(input) {
|
|
101
101
|
return [
|
|
102
|
-
"You are fixing one Decantr Content Health finding in
|
|
102
|
+
"You are fixing one Decantr Content Health finding in the official content corpus.",
|
|
103
103
|
"",
|
|
104
|
-
"Read the referenced JSON content file and the matching Decantr schema before editing. Preserve the item id, published intent, and
|
|
104
|
+
"Read the referenced JSON content file and the matching Decantr schema before editing. Preserve the item id, published intent, and content type unless the finding explicitly says the id or type is wrong.",
|
|
105
105
|
"",
|
|
106
106
|
`Finding: ${input.id}`,
|
|
107
107
|
`Source: ${input.source}`,
|
|
@@ -729,12 +729,12 @@ async function createContentHealthReport(contentRoot = process.cwd(), options =
|
|
|
729
729
|
source: "content",
|
|
730
730
|
category: "Content Root",
|
|
731
731
|
severity: "error",
|
|
732
|
-
message: "No Decantr
|
|
732
|
+
message: "No Decantr content corpus files were found in this directory.",
|
|
733
733
|
evidence: [
|
|
734
734
|
"Expected one or more of patterns/, themes/, blueprints/, archetypes/, shells/."
|
|
735
735
|
],
|
|
736
736
|
rule: "content-root-empty",
|
|
737
|
-
suggestedFix: "Run this command from
|
|
737
|
+
suggestedFix: "Run this command from packages/content or another Decantr content corpus directory.",
|
|
738
738
|
baseId: "content-root-empty"
|
|
739
739
|
})
|
|
740
740
|
);
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
renderProjectHealthCiWorkflow,
|
|
14
14
|
shouldFailHealth,
|
|
15
15
|
writeProjectHealthCiWorkflow
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-PFFNEN7L.js";
|
|
17
|
+
import "./chunk-2UC6YYVZ.js";
|
|
18
18
|
export {
|
|
19
19
|
cmdHealth,
|
|
20
20
|
collectDesignTokenEvidence,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
3
|
-
import "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-CI2R5W36.js";
|
|
2
|
+
import "./chunk-JK3DYOHA.js";
|
|
3
|
+
import "./chunk-W242I6CS.js";
|
|
4
|
+
import "./chunk-PFFNEN7L.js";
|
|
5
|
+
import "./chunk-2UC6YYVZ.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkspaceHealthReport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W242I6CS.js";
|
|
4
4
|
import {
|
|
5
5
|
createProjectHealthReport
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PFFNEN7L.js";
|
|
7
7
|
import {
|
|
8
8
|
sendStudioHealthRefreshedTelemetry,
|
|
9
9
|
sendStudioStartedTelemetry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2UC6YYVZ.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/studio.ts
|
|
13
13
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
listWorkspaceProjects,
|
|
8
8
|
parseWorkspaceArgs,
|
|
9
9
|
shouldFailWorkspaceHealth
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-W242I6CS.js";
|
|
11
|
+
import "./chunk-PFFNEN7L.js";
|
|
12
|
+
import "./chunk-2UC6YYVZ.js";
|
|
13
13
|
export {
|
|
14
14
|
cmdWorkspace,
|
|
15
15
|
createWorkspaceHealthReport,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decantr/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "Decantr CLI - adopt, verify, graph, and govern frontend codebases touched by AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"decantr",
|
|
@@ -49,11 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"ajv": "^8.20.0",
|
|
52
|
-
"@decantr/
|
|
53
|
-
"@decantr/essence-spec": "3.
|
|
54
|
-
"@decantr/
|
|
55
|
-
"@decantr/
|
|
56
|
-
"@decantr/
|
|
52
|
+
"@decantr/content": "3.8.1",
|
|
53
|
+
"@decantr/essence-spec": "3.8.1",
|
|
54
|
+
"@decantr/telemetry": "3.8.1",
|
|
55
|
+
"@decantr/registry": "3.8.1",
|
|
56
|
+
"@decantr/core": "3.8.1",
|
|
57
|
+
"@decantr/verifier": "3.8.1"
|
|
57
58
|
},
|
|
58
59
|
"scripts": {
|
|
59
60
|
"build": "tsup",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"decantr_compat": ">=1.0.0",
|
|
6
6
|
"name": "Decantr Default",
|
|
7
|
-
"description": "Minimal starter blueprint for offline scaffolding.
|
|
7
|
+
"description": "Minimal starter blueprint for offline scaffolding. Use decantr search or @decantr/content for more options.",
|
|
8
8
|
"tags": ["starter", "minimal", "offline"],
|
|
9
9
|
"compose": [],
|
|
10
10
|
"theme": {
|
|
@@ -89,7 +89,7 @@ Authority order for this project:
|
|
|
89
89
|
1. In Brownfield and Hybrid workflows, the existing production source is the observed implementation truth.
|
|
90
90
|
2. Accepted `.decantr/local-patterns.json`, `.decantr/rules.json`, and `.decantr/style-bridge.json` are project-owned local law where present.
|
|
91
91
|
3. `decantr.essence.json` is the structural contract for routes, sections, DNA, guard mode, and intended product shape.
|
|
92
|
-
4.
|
|
92
|
+
4. Official corpus patterns and execution packs are guidance unless the project maps them into accepted local law.
|
|
93
93
|
|
|
94
94
|
When runtime source and Decantr context disagree, report the drift and run `decantr doctor` or `decantr verify --brownfield --local-patterns`; do not guess which side wins.
|
|
95
95
|
|