@context-forge/core 0.19.19 → 0.19.20

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.
Files changed (130) hide show
  1. package/dist/adoption/adoptionInputs.d.ts +34 -0
  2. package/dist/adoption/adoptionInputs.d.ts.map +1 -0
  3. package/dist/adoption/adoptionInputs.js +62 -0
  4. package/dist/adoption/adoptionInputs.js.map +1 -0
  5. package/dist/adoption/adoptionLines.d.ts +16 -0
  6. package/dist/adoption/adoptionLines.d.ts.map +1 -0
  7. package/dist/adoption/adoptionLines.js +77 -0
  8. package/dist/adoption/adoptionLines.js.map +1 -0
  9. package/dist/adoption/adoptionOutcome.d.ts +29 -17
  10. package/dist/adoption/adoptionOutcome.d.ts.map +1 -1
  11. package/dist/adoption/adoptionOutcome.js +23 -15
  12. package/dist/adoption/adoptionOutcome.js.map +1 -1
  13. package/dist/adoption/adoptionState.d.ts +13 -6
  14. package/dist/adoption/adoptionState.d.ts.map +1 -1
  15. package/dist/adoption/adoptionState.js +22 -15
  16. package/dist/adoption/adoptionState.js.map +1 -1
  17. package/dist/adoption/contracts.d.ts +6 -18
  18. package/dist/adoption/contracts.d.ts.map +1 -1
  19. package/dist/adoption/contracts.js +8 -5
  20. package/dist/adoption/contracts.js.map +1 -1
  21. package/dist/adoption/detectionReport.d.ts +71 -0
  22. package/dist/adoption/detectionReport.d.ts.map +1 -0
  23. package/dist/adoption/detectionReport.js +63 -0
  24. package/dist/adoption/detectionReport.js.map +1 -0
  25. package/dist/adoption/index.d.ts +5 -3
  26. package/dist/adoption/index.d.ts.map +1 -1
  27. package/dist/adoption/index.js +5 -3
  28. package/dist/adoption/index.js.map +1 -1
  29. package/dist/adoption/planningFacts.d.ts +15 -0
  30. package/dist/adoption/planningFacts.d.ts.map +1 -0
  31. package/dist/adoption/planningFacts.js +24 -0
  32. package/dist/adoption/planningFacts.js.map +1 -0
  33. package/dist/adoption/projectDetection.d.ts +5 -0
  34. package/dist/adoption/projectDetection.d.ts.map +1 -0
  35. package/dist/adoption/projectDetection.js +94 -0
  36. package/dist/adoption/projectDetection.js.map +1 -0
  37. package/dist/config/ConfigKeys.d.ts +6 -2
  38. package/dist/config/ConfigKeys.d.ts.map +1 -1
  39. package/dist/config/ConfigKeys.js +9 -6
  40. package/dist/config/ConfigKeys.js.map +1 -1
  41. package/dist/config/index.d.ts +1 -1
  42. package/dist/config/index.d.ts.map +1 -1
  43. package/dist/config/index.js +1 -1
  44. package/dist/config/index.js.map +1 -1
  45. package/dist/detection/index.d.ts +2 -4
  46. package/dist/detection/index.d.ts.map +1 -1
  47. package/dist/detection/index.js +2 -4
  48. package/dist/detection/index.js.map +1 -1
  49. package/dist/detection/planningArtifacts.d.ts.map +1 -1
  50. package/dist/detection/planningArtifacts.js +1 -2
  51. package/dist/detection/planningArtifacts.js.map +1 -1
  52. package/dist/detection/presentPaths.d.ts.map +1 -1
  53. package/dist/detection/presentPaths.js +4 -3
  54. package/dist/detection/presentPaths.js.map +1 -1
  55. package/dist/detection/sourceVolume.d.ts.map +1 -1
  56. package/dist/detection/sourceVolume.js +1 -3
  57. package/dist/detection/sourceVolume.js.map +1 -1
  58. package/dist/guides/GuideManager.d.ts +4 -0
  59. package/dist/guides/GuideManager.d.ts.map +1 -1
  60. package/dist/guides/GuideManager.js +8 -1
  61. package/dist/guides/GuideManager.js.map +1 -1
  62. package/dist/guides/guideMinimum.d.ts +1 -1
  63. package/dist/guides/guideMinimum.js +1 -1
  64. package/dist/guides/index.d.ts +1 -1
  65. package/dist/guides/index.d.ts.map +1 -1
  66. package/dist/guides/index.js +1 -1
  67. package/dist/guides/index.js.map +1 -1
  68. package/dist/introspection/ArtifactIntrospector.d.ts +2 -6
  69. package/dist/introspection/ArtifactIntrospector.d.ts.map +1 -1
  70. package/dist/introspection/ArtifactIntrospector.js +3 -22
  71. package/dist/introspection/ArtifactIntrospector.js.map +1 -1
  72. package/dist/introspection/WorkflowNavigator.d.ts +1 -8
  73. package/dist/introspection/WorkflowNavigator.d.ts.map +1 -1
  74. package/dist/introspection/WorkflowNavigator.js +7 -44
  75. package/dist/introspection/WorkflowNavigator.js.map +1 -1
  76. package/dist/introspection/adoptionNavigation.d.ts +8 -10
  77. package/dist/introspection/adoptionNavigation.d.ts.map +1 -1
  78. package/dist/introspection/adoptionNavigation.js +67 -71
  79. package/dist/introspection/adoptionNavigation.js.map +1 -1
  80. package/dist/introspection/parsers/projectGuideFile.d.ts +9 -0
  81. package/dist/introspection/parsers/projectGuideFile.d.ts.map +1 -0
  82. package/dist/introspection/parsers/projectGuideFile.js +24 -0
  83. package/dist/introspection/parsers/projectGuideFile.js.map +1 -0
  84. package/dist/node.js +1 -1
  85. package/dist/node.js.map +1 -1
  86. package/dist/onboarding/onboardRecipe.d.ts +4 -2
  87. package/dist/onboarding/onboardRecipe.d.ts.map +1 -1
  88. package/dist/onboarding/onboardRecipe.js +7 -2
  89. package/dist/onboarding/onboardRecipe.js.map +1 -1
  90. package/dist/schema/frontmatterSchema.d.ts +2 -0
  91. package/dist/schema/frontmatterSchema.d.ts.map +1 -1
  92. package/dist/schema/frontmatterSchema.js +4 -2
  93. package/dist/schema/frontmatterSchema.js.map +1 -1
  94. package/dist/services/ContextIntegrator.d.ts +1 -4
  95. package/dist/services/ContextIntegrator.d.ts.map +1 -1
  96. package/dist/services/ContextIntegrator.js +2 -20
  97. package/dist/services/ContextIntegrator.js.map +1 -1
  98. package/dist/services/ContextTemplateEngine.d.ts.map +1 -1
  99. package/dist/services/ContextTemplateEngine.js +0 -10
  100. package/dist/services/ContextTemplateEngine.js.map +1 -1
  101. package/dist/services/CoreServiceFactory.d.ts +1 -10
  102. package/dist/services/CoreServiceFactory.d.ts.map +1 -1
  103. package/dist/services/CoreServiceFactory.js +2 -11
  104. package/dist/services/CoreServiceFactory.js.map +1 -1
  105. package/dist/services/SectionBuilder.d.ts.map +1 -1
  106. package/dist/services/SectionBuilder.js +0 -3
  107. package/dist/services/SectionBuilder.js.map +1 -1
  108. package/dist/services/SystemPromptParser.d.ts +5 -0
  109. package/dist/services/SystemPromptParser.d.ts.map +1 -1
  110. package/dist/services/SystemPromptParser.js +19 -0
  111. package/dist/services/SystemPromptParser.js.map +1 -1
  112. package/dist/types/context.d.ts +0 -4
  113. package/dist/types/context.d.ts.map +1 -1
  114. package/package.json +1 -1
  115. package/dist/adoption/adoptionCompletion.d.ts +0 -16
  116. package/dist/adoption/adoptionCompletion.d.ts.map +0 -1
  117. package/dist/adoption/adoptionCompletion.js +0 -37
  118. package/dist/adoption/adoptionCompletion.js.map +0 -1
  119. package/dist/adoption/adoptionFacts.d.ts +0 -25
  120. package/dist/adoption/adoptionFacts.d.ts.map +0 -1
  121. package/dist/adoption/adoptionFacts.js +0 -149
  122. package/dist/adoption/adoptionFacts.js.map +0 -1
  123. package/dist/adoption/adoptionResolver.d.ts +0 -8
  124. package/dist/adoption/adoptionResolver.d.ts.map +0 -1
  125. package/dist/adoption/adoptionResolver.js +0 -152
  126. package/dist/adoption/adoptionResolver.js.map +0 -1
  127. package/dist/detection/squadronProbe.d.ts +0 -56
  128. package/dist/detection/squadronProbe.d.ts.map +0 -1
  129. package/dist/detection/squadronProbe.js +0 -103
  130. package/dist/detection/squadronProbe.js.map +0 -1
@@ -0,0 +1,34 @@
1
+ import { type PlanningFacts } from './planningFacts.js';
2
+ export interface AdoptionArtifacts {
3
+ concept: string | null;
4
+ derivedArchitectures: string[];
5
+ existingStatePlan: string | null;
6
+ }
7
+ /**
8
+ * A path relative to `root` with `/` separators (D3). A path outside the root keeps its climbing
9
+ * `../` segments, which is how a monorepo's root-level CI file is reported (D2).
10
+ */
11
+ export declare function toRootRelative(root: string, absolutePath: string): string;
12
+ /**
13
+ * The concept, derived architectures and existing-state plan under `root`. Planning-file read
14
+ * errors (`AdoptionError`) propagate unchanged; the caller attaches the error code. Pass `facts`
15
+ * when the caller has already read them, so one call never reads the planning files twice.
16
+ */
17
+ export declare function readAdoptionArtifacts(root: string, facts?: PlanningFacts): Promise<AdoptionArtifacts>;
18
+ /** The guide's context-profile variable that marks a prompt as taking a comprehension doc (D10: the guide's name). */
19
+ export declare const COMPREHENSION_PROFILE_VARIABLE = "fileComprehension";
20
+ export declare const ADOPTION_INPUTS_HEADING = "## Adoption Inputs";
21
+ export declare const ADOPTION_INPUT_LABELS: {
22
+ readonly comprehension: "Codebase comprehension";
23
+ readonly concept: "Concept";
24
+ readonly derivedArchitecture: "Derived architecture";
25
+ readonly existingStatePlan: "Existing-state slice plan";
26
+ };
27
+ export declare const NO_COMPREHENSION_SENTENCE = "No codebase comprehension analysis was provided.";
28
+ export declare const ABSENT_ARTIFACT = "none";
29
+ /**
30
+ * The `## Adoption Inputs` section appended to a prompt whose profile lists the comprehension
31
+ * variable (D7). `comprehensionPath` is absolute, or null when none was passed.
32
+ */
33
+ export declare function renderAdoptionInputs(root: string, comprehensionPath: string | null, artifacts: AdoptionArtifacts): string;
34
+ //# sourceMappingURL=adoptionInputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoptionInputs.d.ts","sourceRoot":"","sources":["../../src/adoption/adoptionInputs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAQ3G;AAED,sHAAsH;AACtH,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAElE,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AACX,eAAO,MAAM,yBAAyB,qDAAqD,CAAC;AAC5F,eAAO,MAAM,eAAe,SAAS,CAAC;AAStC;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,SAAS,EAAE,iBAAiB,GAC3B,MAAM,CAcR"}
@@ -0,0 +1,62 @@
1
+ // Adoption artifacts (slice 271, D3): the three planning files `sq onboard` needs to resume an
2
+ // adoption, reported as root-relative paths so consumers need not know cf's file names. Read-only.
3
+ import { isAbsolute, relative, sep } from 'node:path';
4
+ import { resolveConceptPath } from '../introspection/parsers/projectGuideFile.js';
5
+ import { readPlanningFacts } from './planningFacts.js';
6
+ /**
7
+ * A path relative to `root` with `/` separators (D3). A path outside the root keeps its climbing
8
+ * `../` segments, which is how a monorepo's root-level CI file is reported (D2).
9
+ */
10
+ export function toRootRelative(root, absolutePath) {
11
+ return relative(root, absolutePath).split(sep).join('/');
12
+ }
13
+ /**
14
+ * The concept, derived architectures and existing-state plan under `root`. Planning-file read
15
+ * errors (`AdoptionError`) propagate unchanged; the caller attaches the error code. Pass `facts`
16
+ * when the caller has already read them, so one call never reads the planning files twice.
17
+ */
18
+ export async function readAdoptionArtifacts(root, facts) {
19
+ const [conceptPath, planning] = await Promise.all([resolveConceptPath(root), facts ?? readPlanningFacts(root)]);
20
+ const relativeToRoot = (path) => toRootRelative(root, path);
21
+ return {
22
+ concept: conceptPath === null ? null : relativeToRoot(conceptPath),
23
+ derivedArchitectures: planning.derivedArchitectures.map(relativeToRoot),
24
+ existingStatePlan: planning.existingStatePlan === null ? null : relativeToRoot(planning.existingStatePlan),
25
+ };
26
+ }
27
+ /** The guide's context-profile variable that marks a prompt as taking a comprehension doc (D10: the guide's name). */
28
+ export const COMPREHENSION_PROFILE_VARIABLE = 'fileComprehension';
29
+ export const ADOPTION_INPUTS_HEADING = '## Adoption Inputs';
30
+ export const ADOPTION_INPUT_LABELS = {
31
+ comprehension: 'Codebase comprehension',
32
+ concept: 'Concept',
33
+ derivedArchitecture: 'Derived architecture',
34
+ existingStatePlan: 'Existing-state slice plan',
35
+ };
36
+ export const NO_COMPREHENSION_SENTENCE = 'No codebase comprehension analysis was provided.';
37
+ export const ABSENT_ARTIFACT = 'none';
38
+ /** Root-relative with `/` when inside `root`, the absolute path otherwise (D7 item 3). */
39
+ function displayPath(root, absolutePath) {
40
+ const fromRoot = relative(root, absolutePath);
41
+ const outside = fromRoot === '..' || fromRoot.startsWith(`..${sep}`) || isAbsolute(fromRoot);
42
+ return outside ? absolutePath : fromRoot.split(sep).join('/');
43
+ }
44
+ /**
45
+ * The `## Adoption Inputs` section appended to a prompt whose profile lists the comprehension
46
+ * variable (D7). `comprehensionPath` is absolute, or null when none was passed.
47
+ */
48
+ export function renderAdoptionInputs(root, comprehensionPath, artifacts) {
49
+ const labeled = (label, value) => `- ${label}: ${value ?? ABSENT_ARTIFACT}`;
50
+ const comprehension = comprehensionPath === null
51
+ ? `- ${NO_COMPREHENSION_SENTENCE}`
52
+ : labeled(ADOPTION_INPUT_LABELS.comprehension, displayPath(root, comprehensionPath));
53
+ const derived = artifacts.derivedArchitectures.length > 0 ? artifacts.derivedArchitectures.join(', ') : null;
54
+ return [
55
+ ADOPTION_INPUTS_HEADING,
56
+ comprehension,
57
+ labeled(ADOPTION_INPUT_LABELS.concept, artifacts.concept),
58
+ labeled(ADOPTION_INPUT_LABELS.derivedArchitecture, derived),
59
+ labeled(ADOPTION_INPUT_LABELS.existingStatePlan, artifacts.existingStatePlan),
60
+ ].join('\n');
61
+ }
62
+ //# sourceMappingURL=adoptionInputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoptionInputs.js","sourceRoot":"","sources":["../../src/adoption/adoptionInputs.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,mGAAmG;AACnG,OAAO,EAAE,UAAU,EAAE,QAAQ,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SAAS,CAAC,OAAO,CAAC;QACzD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,EAAE,OAAO,CAAC;QAC3D,OAAO,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,CAAC;KAC9E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type SourceVolume } from '../detection/sourceVolume.js';
2
+ import { type AdoptionOutcome } from './adoptionOutcome.js';
3
+ export declare const BROWNFIELD_LINE: string;
4
+ export declare const INCOMPLETE_ADOPTION_LINE: string;
5
+ export declare function inconclusiveDetectionLine(reason: string): string;
6
+ /** The one outcome-to-line mapping (slice 271 D9): navigation, `cf detect` and `cf init` all use it. */
7
+ export declare function outcomeLine(outcome: AdoptionOutcome): string | null;
8
+ export interface AdoptionNavLines {
9
+ warnings: string[];
10
+ /** True for an adopted project: first-run logic must not treat it as fresh. */
11
+ skipFirstRun: boolean;
12
+ }
13
+ export type SourceVolumeMeasurer = (root: string) => Promise<SourceVolume>;
14
+ /** The warnings navigation adds for adoption, and whether first-run logic is skipped (D6). */
15
+ export declare function adoptionNavLines(projectPath: string, measure?: SourceVolumeMeasurer): Promise<AdoptionNavLines>;
16
+ //# sourceMappingURL=adoptionLines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoptionLines.d.ts","sourceRoot":"","sources":["../../src/adoption/adoptionLines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAA8B,KAAK,eAAe,EAAsB,MAAM,sBAAsB,CAAC;AAQ5G,eAAO,MAAM,eAAe,QAEqD,CAAC;AAElF,eAAO,MAAM,wBAAwB,QAEoB,CAAC;AAE1D,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAenE;AAMD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,+EAA+E;IAC/E,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE3E,8FAA8F;AAC9F,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,oBAA0C,GAClD,OAAO,CAAC,gBAAgB,CAAC,CAsB3B"}
@@ -0,0 +1,77 @@
1
+ // Adoption warnings for navigation (slice 269 D6): one line for an unadopted brownfield repo and
2
+ // one for an incomplete adoption. Navigation never returns an adoption step.
3
+ import { measureSourceVolume } from '../detection/sourceVolume.js';
4
+ import { decideOutcome, decideStage } from './adoptionOutcome.js';
5
+ import { legacyAdoptionStateNotice, readAdoptionOptOut } from './adoptionState.js';
6
+ import { AdoptionError, OPT_OUT_COMMAND } from './contracts.js';
7
+ import { readPlanningFacts } from './planningFacts.js';
8
+ const OPT_OUT_SENTENCE = `To treat the project as new: ${OPT_OUT_COMMAND}`;
9
+ const SQ_ONBOARD = 'sq onboard';
10
+ export const BROWNFIELD_LINE = 'This project has existing code and no planning artifacts. ' +
11
+ `Adopting an existing codebase arrives with ${SQ_ONBOARD}. ${OPT_OUT_SENTENCE}`;
12
+ export const INCOMPLETE_ADOPTION_LINE = 'A derived architecture exists, but no slice plan has retroactive entries, so adoption is incomplete. ' +
13
+ `It resumes through ${SQ_ONBOARD}. ${OPT_OUT_SENTENCE}`;
14
+ export function inconclusiveDetectionLine(reason) {
15
+ return `cf could not tell whether this project holds existing code: ${reason}. ${OPT_OUT_SENTENCE}`;
16
+ }
17
+ /** The one outcome-to-line mapping (slice 271 D9): navigation, `cf detect` and `cf init` all use it. */
18
+ export function outcomeLine(outcome) {
19
+ switch (outcome.kind) {
20
+ case 'brownfield':
21
+ return BROWNFIELD_LINE;
22
+ case 'adoption-incomplete':
23
+ return INCOMPLETE_ADOPTION_LINE;
24
+ case 'opted-out':
25
+ case 'already-planned':
26
+ case 'greenfield':
27
+ return null;
28
+ default: {
29
+ const unhandled = outcome;
30
+ throw new Error(`Unhandled adoption outcome: ${JSON.stringify(unhandled)}`);
31
+ }
32
+ }
33
+ }
34
+ function withLine(warnings, line) {
35
+ return line === null ? warnings : [...warnings, line];
36
+ }
37
+ /** The warnings navigation adds for adoption, and whether first-run logic is skipped (D6). */
38
+ export async function adoptionNavLines(projectPath, measure = measureSourceVolume) {
39
+ const optOut = await readAdoptionOptOut(projectPath);
40
+ const warnings = optOut.ignoredLegacyValue === null ? [] : [legacyAdoptionStateNotice(optOut.ignoredLegacyValue)];
41
+ if (optOut.optedOut)
42
+ return { warnings, skipFirstRun: false };
43
+ // Planning-file read errors propagate (264 D7): an unreadable planning directory is a real
44
+ // problem to fix, unlike a source walk that can't finish, which only weakens a hint.
45
+ const stage = decideStage({ optedOut: false, facts: await readPlanningFacts(projectPath) });
46
+ switch (stage.kind) {
47
+ case 'opted-out':
48
+ throw new Error('adoptionNavLines: the opt-out returned before the planning facts were read');
49
+ case 'adoption-incomplete':
50
+ return { warnings: withLine(warnings, outcomeLine(stage)), skipFirstRun: false };
51
+ case 'already-planned':
52
+ return { warnings, skipFirstRun: stage.existingStatePlan !== null };
53
+ case 'unplanned':
54
+ return codeSignalLines(projectPath, stage, warnings, measure);
55
+ default: {
56
+ const unhandled = stage;
57
+ throw new Error(`Unhandled adoption stage: ${JSON.stringify(unhandled)}`);
58
+ }
59
+ }
60
+ }
61
+ /** The brownfield/greenfield step for an unplanned project; a failed walk is advisory (D6). */
62
+ async function codeSignalLines(projectPath, stage, warnings, measure) {
63
+ let source;
64
+ try {
65
+ source = await measure(projectPath);
66
+ }
67
+ catch (error) {
68
+ // The warning is advisory and must not block cf next: a failed walk becomes a visible line
69
+ // naming the cause, not a silent greenfield. Other errors are bugs and propagate.
70
+ if (!(error instanceof AdoptionError))
71
+ throw error;
72
+ return { warnings: [...warnings, inconclusiveDetectionLine(error.message)], skipFirstRun: false };
73
+ }
74
+ const outcome = decideOutcome({ stage, source });
75
+ return { warnings: withLine(warnings, outcomeLine(outcome)), skipFirstRun: false };
76
+ }
77
+ //# sourceMappingURL=adoptionLines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoptionLines.js","sourceRoot":"","sources":["../../src/adoption/adoptionLines.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,6EAA6E;AAC7E,OAAO,EAAE,mBAAmB,EAAqB,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,WAAW,EAA4C,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,gBAAgB,GAAG,gCAAgC,eAAe,EAAE,CAAC;AAC3E,MAAM,UAAU,GAAG,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,eAAe,GAC1B,4DAA4D;IAC5D,8CAA8C,UAAU,KAAK,gBAAgB,EAAE,CAAC;AAElF,MAAM,CAAC,MAAM,wBAAwB,GACnC,uGAAuG;IACvG,sBAAsB,UAAU,KAAK,gBAAgB,EAAE,CAAC;AAE1D,MAAM,UAAU,yBAAyB,CAAC,MAAc;IACtD,OAAO,+DAA+D,MAAM,KAAK,gBAAgB,EAAE,CAAC;AACtG,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,WAAW,CAAC,OAAwB;IAClD,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,YAAY;YACf,OAAO,eAAe,CAAC;QACzB,KAAK,qBAAqB;YACxB,OAAO,wBAAwB,CAAC;QAClC,KAAK,WAAW,CAAC;QACjB,KAAK,iBAAiB,C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QACnF,KAAK,iBAAiB;YACpB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;QACtE,KAAK,WAAW;YACd,OAAO,eAAe,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChE,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,SAAS,GAAU,KAAK,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;AACH,CAAC;AAED,+FAA+F;AAC/F,KAAK,UAAU,eAAe,CAC5B,WAAmB,EACnB,KAAoD,EACpD,QAAkB,EAClB,OAA6B;IAE7B,IAAI,MAAoB,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,2FAA2F;QAC3F,kFAAkF;QAClF,IAAI,CAAC,CAAC,KAAK,YAAY,aAAa,CAAC;YAAE,MAAM,KAAK,CAAC;QACnD,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,yBAAyB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IACpG,CAAC;IACD,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AACrF,CAAC"}
@@ -1,40 +1,52 @@
1
- import type { AdoptionState } from '../config/ConfigKeys.js';
2
1
  import type { SourceVolume } from '../detection/sourceVolume.js';
2
+ import type { PlanningFacts } from './planningFacts.js';
3
3
  /**
4
4
  * Brownfield iff the project folder holds at least this many non-blank source lines (D1).
5
5
  * The one place the threshold is written; deliberately not configurable (the
6
- * `adoption.state` override is the safety valve).
6
+ * `adoption.state = "declined"` opt-out is the safety valve).
7
7
  */
8
8
  export declare const BROWNFIELD_MIN_SOURCE_LINES = 2000;
9
- export type AdoptionOutcome = {
10
- kind: 'adoption-in-progress';
9
+ /** What the opt-out and the planning files decide, before any source walk (slice 269 D5). */
10
+ export type AdoptionStage = {
11
+ kind: 'opted-out';
11
12
  } | {
12
- kind: 'adoption-completed';
13
- planPath: string;
14
- } | {
15
- kind: 'adoption-closed';
16
- state: 'complete' | 'declined';
13
+ kind: 'adoption-incomplete';
14
+ derivedArchitectures: string[];
17
15
  } | {
18
16
  kind: 'already-planned';
19
17
  artifacts: string[];
18
+ existingStatePlan: string | null;
20
19
  } | {
20
+ kind: 'unplanned';
21
+ };
22
+ export type AdoptionOutcome = Exclude<AdoptionStage, {
23
+ kind: 'unplanned';
24
+ }> | {
21
25
  kind: 'brownfield';
22
26
  source: SourceVolume;
23
27
  } | {
24
28
  kind: 'greenfield';
25
29
  source: SourceVolume;
26
30
  };
31
+ export interface StageInput {
32
+ optedOut: boolean;
33
+ facts: PlanningFacts;
34
+ }
27
35
  export interface OutcomeInput {
28
- state: AdoptionState;
29
- /** Planning artifacts found; read only when `state` is unset. */
30
- artifacts?: string[];
31
- /** Source volume; read only when `state` is unset and nothing is planned. */
36
+ stage: AdoptionStage;
37
+ /** Source volume; read only when the stage is `unplanned`. */
32
38
  source?: SourceVolume;
33
39
  }
34
40
  /**
35
- * The outcome order (D1): persisted state → already planned → source volume.
36
- * Pure. The caller supplies each fact only when the previous one did not decide;
37
- * a fact the order needs but the caller left out is a programming error.
41
+ * The stage order (D5): opted out → adoption incomplete → already planned → unplanned. Pure.
42
+ * A derived architecture with no existing-state plan is mid-adoption; any other planning
43
+ * artifact means the project is planned.
44
+ */
45
+ export declare function decideStage({ optedOut, facts }: StageInput): AdoptionStage;
46
+ /**
47
+ * The outcome (D5): a decided stage passes through; `unplanned` becomes brownfield or greenfield
48
+ * by source volume. Pure. The caller measures source volume only for `unplanned`; leaving it out
49
+ * then is a programming error.
38
50
  */
39
- export declare function decideOutcome(input: OutcomeInput): AdoptionOutcome;
51
+ export declare function decideOutcome({ stage, source }: OutcomeInput): AdoptionOutcome;
40
52
  //# sourceMappingURL=adoptionOutcome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adoptionOutcome.d.ts","sourceRoot":"","sources":["../../src/adoption/adoptionOutcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,GAEhC;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAgBlE"}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,GAAG,eAAe,CAQ9E"}
@@ -1,27 +1,35 @@
1
1
  /**
2
2
  * Brownfield iff the project folder holds at least this many non-blank source lines (D1).
3
3
  * The one place the threshold is written; deliberately not configurable (the
4
- * `adoption.state` override is the safety valve).
4
+ * `adoption.state = "declined"` opt-out is the safety valve).
5
5
  */
6
6
  export const BROWNFIELD_MIN_SOURCE_LINES = 2000;
7
7
  /**
8
- * The outcome order (D1): persisted state → already planned → source volume.
9
- * Pure. The caller supplies each fact only when the previous one did not decide;
10
- * a fact the order needs but the caller left out is a programming error.
8
+ * The stage order (D5): opted out → adoption incomplete → already planned → unplanned. Pure.
9
+ * A derived architecture with no existing-state plan is mid-adoption; any other planning
10
+ * artifact means the project is planned.
11
11
  */
12
- export function decideOutcome(input) {
13
- const { state, artifacts, source } = input;
14
- if (state === 'in_progress')
15
- return { kind: 'adoption-in-progress' };
16
- if (state === 'complete' || state === 'declined')
17
- return { kind: 'adoption-closed', state };
18
- if (artifacts === undefined) {
19
- throw new Error('decideOutcome: state is unset, so `artifacts` is required');
12
+ export function decideStage({ optedOut, facts }) {
13
+ if (optedOut)
14
+ return { kind: 'opted-out' };
15
+ if (facts.derivedArchitectures.length > 0 && facts.existingStatePlan === null) {
16
+ return { kind: 'adoption-incomplete', derivedArchitectures: facts.derivedArchitectures };
20
17
  }
21
- if (artifacts.length > 0)
22
- return { kind: 'already-planned', artifacts };
18
+ if (facts.artifacts.length > 0) {
19
+ return { kind: 'already-planned', artifacts: facts.artifacts, existingStatePlan: facts.existingStatePlan };
20
+ }
21
+ return { kind: 'unplanned' };
22
+ }
23
+ /**
24
+ * The outcome (D5): a decided stage passes through; `unplanned` becomes brownfield or greenfield
25
+ * by source volume. Pure. The caller measures source volume only for `unplanned`; leaving it out
26
+ * then is a programming error.
27
+ */
28
+ export function decideOutcome({ stage, source }) {
29
+ if (stage.kind !== 'unplanned')
30
+ return stage;
23
31
  if (source === undefined) {
24
- throw new Error('decideOutcome: state is unset and nothing is planned, so `source` is required');
32
+ throw new Error('decideOutcome: the stage is unplanned, so `source` is required');
25
33
  }
26
34
  return source.lines >= BROWNFIELD_MIN_SOURCE_LINES
27
35
  ? { kind: 'brownfield', source }
@@ -1 +1 @@
1
- {"version":3,"file":"adoptionOutcome.js","sourceRoot":"","sources":["../../src/adoption/adoptionOutcome.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAmBhD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB;IAC/C,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC3C,IAAI,KAAK,KAAK,aAAa;QAAE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC;IACrE,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,UAAU;QAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC;IAE5F,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC;IAExE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IACnG,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,IAAI,2BAA2B;QAChD,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE;QAChC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AACrC,CAAC"}
1
+ {"version":3,"file":"adoptionOutcome.js","sourceRoot":"","sources":["../../src/adoption/adoptionOutcome.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAyBhD;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAc;IACzD,IAAI,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC3C,IAAI,KAAK,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC;QAC9E,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,KAAK,CAAC,oBAAoB,EAAE,CAAC;IAC3F,CAAC;IACD,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC7G,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAgB;IAC3D,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,IAAI,2BAA2B;QAChD,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE;QAChC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AACrC,CAAC"}
@@ -1,7 +1,14 @@
1
- import { ADOPTION_STATES, type AdoptionState } from '../config/ConfigKeys.js';
2
- export { ADOPTION_STATES, type AdoptionState };
3
- /** Reads the persisted adoption state. A malformed TOML file propagates the parser's error. */
4
- export declare function readAdoptionState(root: string): Promise<AdoptionState>;
5
- /** Persists the state to the shared project file. Does not catch: callers own the failure message. */
6
- export declare function writeAdoptionState(root: string, state: AdoptionState): Promise<void>;
1
+ import { type LegacyAdoptionState } from '../config/ConfigKeys.js';
2
+ export interface AdoptionOptOut {
3
+ optedOut: boolean;
4
+ /** A pre-269 value found in config and ignored (D2), or null. */
5
+ ignoredLegacyValue: LegacyAdoptionState | null;
6
+ }
7
+ /**
8
+ * Reads the adoption opt-out (D2). `declined` opts out; absent or empty does not; a legacy value
9
+ * does not and is reported. Any other value throws. A malformed TOML file propagates the parser's error.
10
+ */
11
+ export declare function readAdoptionOptOut(root: string): Promise<AdoptionOptOut>;
12
+ /** The notice shown while a legacy value is stored (D3). The only place this text is built. */
13
+ export declare function legacyAdoptionStateNotice(value: LegacyAdoptionState): string;
7
14
  //# sourceMappingURL=adoptionState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adoptionState.d.ts","sourceRoot":"","sources":["../../src/adoption/adoptionState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAI9E,OAAO,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,CAAC;AAS/C,+FAA+F;AAC/F,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAU5E;AAED,sGAAsG;AACtG,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1F"}
1
+ {"version":3,"file":"adoptionState.d.ts","sourceRoot":"","sources":["../../src/adoption/adoptionState.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAmBjC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,kBAAkB,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAChD;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAK9E;AAED,+FAA+F;AAC/F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM,CAK5E"}
@@ -1,24 +1,31 @@
1
- import { ADOPTION_STATES } from '../config/ConfigKeys.js';
1
+ import { ADOPTION_OPT_OUT, ADOPTION_STATES, LEGACY_ADOPTION_STATES, } from '../config/ConfigKeys.js';
2
2
  import { ConfigManager } from '../config/ConfigManager.js';
3
3
  import { AdoptionError } from './contracts.js';
4
- export { ADOPTION_STATES };
5
4
  const ADOPTION_STATE_KEY = 'adoption.state';
6
5
  const PROJECT_CONFIG_FILE = '.context-forge.toml';
7
- function isAdoptionState(value) {
8
- return ADOPTION_STATES.some((state) => state === value);
6
+ function isLegacyAdoptionState(value) {
7
+ return LEGACY_ADOPTION_STATES.some((state) => state === value);
9
8
  }
10
- /** Reads the persisted adoption state. A malformed TOML file propagates the parser's error. */
11
- export async function readAdoptionState(root) {
9
+ function outOfEnumError(value) {
10
+ const allowed = ADOPTION_STATES.map((state) => JSON.stringify(state)).join(', ');
11
+ return new AdoptionError(`adoption.state is ${JSON.stringify(value)}, which is not one of [${allowed}]. ` +
12
+ `Fix or remove the [adoption] section in ${PROJECT_CONFIG_FILE}.`);
13
+ }
14
+ /**
15
+ * Reads the adoption opt-out (D2). `declined` opts out; absent or empty does not; a legacy value
16
+ * does not and is reported. Any other value throws. A malformed TOML file propagates the parser's error.
17
+ */
18
+ export async function readAdoptionOptOut(root) {
12
19
  const { value } = await new ConfigManager(root).get(ADOPTION_STATE_KEY);
13
- if (!isAdoptionState(value)) {
14
- const allowed = ADOPTION_STATES.map((state) => JSON.stringify(state)).join(', ');
15
- throw new AdoptionError(`adoption.state is ${JSON.stringify(value)}, which is not one of [${allowed}]. ` +
16
- `Fix or remove the [adoption] section in ${PROJECT_CONFIG_FILE}.`);
17
- }
18
- return value;
20
+ if (isLegacyAdoptionState(value))
21
+ return { optedOut: false, ignoredLegacyValue: value };
22
+ if (!ADOPTION_STATES.some((state) => state === value))
23
+ throw outOfEnumError(value);
24
+ return { optedOut: value === ADOPTION_OPT_OUT, ignoredLegacyValue: null };
19
25
  }
20
- /** Persists the state to the shared project file. Does not catch: callers own the failure message. */
21
- export async function writeAdoptionState(root, state) {
22
- await new ConfigManager(root).set(ADOPTION_STATE_KEY, state, 'project');
26
+ /** The notice shown while a legacy value is stored (D3). The only place this text is built. */
27
+ export function legacyAdoptionStateNotice(value) {
28
+ return (`adoption.state is "${value}", which is no longer used and is ignored: adoption progress now comes ` +
29
+ `from the project's files. Remove it with: cf config unset adoption.state`);
23
30
  }
24
31
  //# sourceMappingURL=adoptionState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"adoptionState.js","sourceRoot":"","sources":["../../src/adoption/adoptionState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAsB,CAAC;AAE/C,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAC5C,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAElD,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAY;IAClD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACxE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAA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AI,aAAa,CACtB,qBAAqB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,0BAA0B,OAAO,KAAK;QAC9E,2CAA2C,mBAAmB,GAAG,CACpE,CAAC;AACJ,CAAC;AAQD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY;IACnD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACxE,IAAI,qBAAqB,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;IACxF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC;QAAE,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IACnF,OAAO,EAAE,QAAQ,EAAE,KAAK,KAAK,gBAAgB,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;AAC5E,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,yBAAyB,CAAC,KAA0B;IAClE,OAAO,CACL,sBAAsB,KAAK,yEAAyE;QACpG,0EAA0E,CAC3E,CAAC;AACJ,CAAC"}
@@ -1,24 +1,12 @@
1
- import type { ProbeOutcome } from '../detection/squadronProbe.js';
2
- /** The context profile / prompt instruction selected for a brownfield build. */
3
- export declare const BROWNFIELD_ADOPTION_INSTRUCTION = "brownfield-adoption";
4
- /** Runs the squadron capability probe in a checkout; injected so tests never spawn `sq`. */
5
- export type SquadronProbe = (checkoutPath: string) => Promise<ProbeOutcome>;
6
- export type AdoptionSelection = {
7
- selected: false;
8
- } | {
9
- selected: true;
10
- instruction: typeof BROWNFIELD_ADOPTION_INSTRUCTION;
11
- facts: string;
12
- /** Newest squadron comprehension document, relative to project-documents/. Absent when none. */
13
- fileComprehension?: string;
14
- };
15
- export type AdoptionResolver = (projectPath: string, checkoutPath: string, instruction: string) => Promise<AdoptionSelection>;
16
1
  /**
17
- * Raised when adoption cannot be decided or applied (guide without the profile or
18
- * prompt, failed state write, unfinishable walk). The message carries the remedy.
19
- * The build rethrows it instead of falling back to the concept prompt.
2
+ * Raised when adoption state or detection cannot be read or decided (for example an
3
+ * `adoption.state` value outside the allowed set). The message carries the remedy.
20
4
  */
21
5
  export declare class AdoptionError extends Error {
22
6
  constructor(message: string, options?: ErrorOptions);
23
7
  }
8
+ /** The command that opts a project out of adoption detection. */
9
+ export declare const OPT_OUT_COMMAND = "cf config set adoption.state declined";
10
+ /** Remedy appended to detection errors: the opt-out that skips detection. */
11
+ export declare const OVERRIDE_REMEDY = "To treat the project as new and skip detection: cf config set adoption.state declined";
24
12
  //# sourceMappingURL=contracts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/adoption/contracts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAErE,4FAA4F;AAC5F,MAAM,MAAM,aAAa,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE5E,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,EAAE,KAAK,CAAA;CAAE,GACnB;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,WAAW,EAAE,OAAO,+BAA+B,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEN,MAAM,MAAM,gBAAgB,GAAG,CAC7B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,KAChB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhC;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/adoption/contracts.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD;AAED,iEAAiE;AACjE,eAAO,MAAM,eAAe,0CAAqD,CAAC;AAElF,6EAA6E;AAC7E,eAAO,MAAM,eAAe,0FAAuE,CAAC"}
@@ -1,9 +1,8 @@
1
- /** The context profile / prompt instruction selected for a brownfield build. */
2
- export const BROWNFIELD_ADOPTION_INSTRUCTION = 'brownfield-adoption';
1
+ // Errors and texts shared by the adoption and detection modules.
2
+ import { ADOPTION_OPT_OUT } from '../config/ConfigKeys.js';
3
3
  /**
4
- * Raised when adoption cannot be decided or applied (guide without the profile or
5
- * prompt, failed state write, unfinishable walk). The message carries the remedy.
6
- * The build rethrows it instead of falling back to the concept prompt.
4
+ * Raised when adoption state or detection cannot be read or decided (for example an
5
+ * `adoption.state` value outside the allowed set). The message carries the remedy.
7
6
  */
8
7
  export class AdoptionError extends Error {
9
8
  constructor(message, options) {
@@ -11,4 +10,8 @@ export class AdoptionError extends Error {
11
10
  this.name = 'AdoptionError';
12
11
  }
13
12
  }
13
+ /** The command that opts a project out of adoption detection. */
14
+ export const OPT_OUT_COMMAND = `cf config set adoption.state ${ADOPTION_OPT_OUT}`;
15
+ /** Remedy appended to detection errors: the opt-out that skips detection. */
16
+ export const OVERRIDE_REMEDY = `To treat the project as new and skip detection: ${OPT_OUT_COMMAND}`;
14
17
  //# sourceMappingURL=contracts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/adoption/contracts.ts"],"names":[],"mappings":"AAKA,gFAAgF;AAChF,MAAM,CAAC,MAAM,+BAA+B,GAAG,qBAAqB,CAAC;AAqBrE;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF"}
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/adoption/contracts.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe,EAAE,OAAsB;QACjD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,iEAAiE;AACjE,MAAM,CAAC,MAAM,eAAe,GAAG,gCAAgC,gBAAgB,EAAE,CAAC;AAElF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAAG,mDAAmD,eAAe,EAAE,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { HistoryFact } from '../detection/history.js';
2
+ import type { AdoptionArtifacts } from './adoptionInputs.js';
3
+ import type { AdoptionOutcome } from './adoptionOutcome.js';
4
+ export declare const REPORT_VERSION = 1;
5
+ export declare const INIT_REPORT_VERSION = 1;
6
+ /** The one place the error codes are written (D5). */
7
+ export declare const DETECTION_ERROR_CODES: readonly ["path-not-found", "invalid-config", "unreadable-planning", "source-unmeasurable", "worktree-of-registered-project", "internal"];
8
+ export type DetectionErrorCode = (typeof DETECTION_ERROR_CODES)[number];
9
+ export declare class DetectionError extends Error {
10
+ readonly code: DetectionErrorCode;
11
+ constructor(code: DetectionErrorCode, message: string, options?: {
12
+ cause?: unknown;
13
+ });
14
+ }
15
+ export type SourceFact = {
16
+ measured: true;
17
+ lines: number;
18
+ files: number;
19
+ capped: boolean;
20
+ } | {
21
+ measured: false;
22
+ reason: string;
23
+ };
24
+ export type HistoryReportFact = {
25
+ known: true;
26
+ commits: number;
27
+ shallow: boolean;
28
+ } | {
29
+ known: false;
30
+ reason: string;
31
+ };
32
+ /** What `detectProject` returns: every fact, gathered on every call (D4). Paths are root-relative. */
33
+ export interface ProjectDetection {
34
+ /** Absolute. */
35
+ projectRoot: string;
36
+ outcome: AdoptionOutcome;
37
+ source: SourceFact;
38
+ history: HistoryFact;
39
+ docs: string[];
40
+ adrs: string[];
41
+ ci: string[];
42
+ ruleFiles: string[];
43
+ artifacts: AdoptionArtifacts;
44
+ notices: string[];
45
+ }
46
+ /** The D3 JSON shape. */
47
+ export interface DetectionReport {
48
+ reportVersion: typeof REPORT_VERSION;
49
+ projectRoot: string;
50
+ outcome: AdoptionOutcome['kind'];
51
+ facts: {
52
+ source: SourceFact;
53
+ history: HistoryReportFact;
54
+ docs: string[];
55
+ adrs: string[];
56
+ ci: string[];
57
+ ruleFiles: string[];
58
+ };
59
+ artifacts: AdoptionArtifacts;
60
+ notices: string[];
61
+ }
62
+ export declare function toDetectionReport(detection: ProjectDetection): DetectionReport;
63
+ export declare function serializeDetectionReport(report: DetectionReport): string;
64
+ /** The D5 envelope: `{ reportVersion, error: { code, message } }`. */
65
+ export declare function serializeErrorEnvelope(reportVersion: number, code: DetectionErrorCode, message: string): string;
66
+ /**
67
+ * The envelope for any thrown value. A `DetectionError` keeps its code; anything else is `internal`
68
+ * (D5: applied only at a process boundary, with the original message, and the exit stays non-zero).
69
+ */
70
+ export declare function toErrorEnvelope(reportVersion: number, error: unknown): string;
71
+ //# sourceMappingURL=detectionReport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detectionReport.d.ts","sourceRoot":"","sources":["../../src/adoption/detectionReport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,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