@contentful/experience-design-system-cli 2.12.2-dev-build-4dc32df.0 → 2.12.2-dev-build-e72ea10.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.12.2-dev-build-4dc32df.0",
3
+ "version": "2.12.2-dev-build-e72ea10.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,7 +49,7 @@ import { checkAgentAuth } from '../../generate/agent-runner.js';
49
49
  import { normalizePath } from '../path-utils.js';
50
50
  import { DEFAULT_CONFIGURED_HOST, toConfiguredHost } from '../../host-utils.js';
51
51
  import { writeExperiencesCredentials } from '../../credentials-store.js';
52
- import { nextStepAfterScopeGate, nextStepAfterCredentialsValidated, shouldBypassPreview, buildSkippedPreviewTransition, shouldRefusePush, buildSkippedPushTransition, shouldSkipFinalReviewAfterCredentials, } from './wizard-state-transitions.js';
52
+ import { nextStepAfterScopeGate, nextStepAfterCredentialsValidated, shouldBypassPreview, buildSkippedPreviewTransition, shouldRefusePush, buildSkippedPushTransition, resolveNoCacheForGenerate, } from './wizard-state-transitions.js';
53
53
  function findCliPath() {
54
54
  return join(fileURLToPath(import.meta.url), '..', '..', '..', '..', '..', 'bin', 'cli.js');
55
55
  }
@@ -197,6 +197,13 @@ export function WizardApp({ initialSpaceId = '', initialEnvironmentId = 'master'
197
197
  // `generating-tokens` step which already drives the token-classification
198
198
  // subprocess off `state.rawTokensPath`. Modify-entry wins if both are set.
199
199
  const rawTokensEntryReady = !modifyEntryReady && !pushFromPickerReady && !!initialRawTokensPath;
200
+ // Fresh session = the wizard is going to create its own extract session via
201
+ // `analyze extract` rather than pick one up from `--modify` / `--push-from-run`.
202
+ // For fresh sessions we force `--no-cache` on the spawned `generate components`
203
+ // so operators aren't silently served classifications cached from a prior
204
+ // session (the generation_cache table is project-wide, not session-scoped).
205
+ const isFreshSession = !seedExtractSessionId;
206
+ const effectiveNoCache = resolveNoCacheForGenerate({ isFreshSession, cliNoCache: noCache });
200
207
  const initialStepResolved = modifyEntryReady
201
208
  ? 'final-review'
202
209
  : pushFromPickerReady
@@ -263,7 +270,6 @@ export function WizardApp({ initialSpaceId = '', initialEnvironmentId = 'master'
263
270
  credentialsSkipped: false,
264
271
  lastRunId: null,
265
272
  finalizeErrorBanner: null,
266
- finalReviewPassed: false,
267
273
  });
268
274
  useEffect(() => {
269
275
  sessionRef.current = {
@@ -607,7 +613,7 @@ export function WizardApp({ initialSpaceId = '', initialEnvironmentId = 'master'
607
613
  tokensPath,
608
614
  agent: state.agent,
609
615
  ...(state.agentModel ? { model: state.agentModel } : {}),
610
- noCache,
616
+ noCache: effectiveNoCache,
611
617
  }),
612
618
  ];
613
619
  let progressCursor = null;
@@ -682,7 +688,7 @@ export function WizardApp({ initialSpaceId = '', initialEnvironmentId = 'master'
682
688
  tokensPath,
683
689
  agent: state.agent,
684
690
  ...(state.agentModel ? { model: state.agentModel } : {}),
685
- noCache,
691
+ noCache: effectiveNoCache,
686
692
  generatePromptPath,
687
693
  }),
688
694
  ];
@@ -807,15 +813,10 @@ export function WizardApp({ initialSpaceId = '', initialEnvironmentId = 'master'
807
813
  // accepted components) or jumps straight to push-decision-gate (if scope
808
814
  // rejected everything but tokens/removals still need to be pushed).
809
815
  const advanceAfterCredentialsValidated = async () => {
810
- // If the operator already went through final-review once (re-entering
811
- // credentials from a late 401/403 raised by runPreview), skip back to
812
- // push-decision-gate rather than making them review again. We gate on
813
- // `finalReviewPassed` specifically — NOT `generateSessionId` alone —
814
- // because the scope-gate background prefetch also populates
815
- // `generateSessionId` as soon as its LLM finishes, and if that lands
816
- // while the operator is still typing credentials it would otherwise
817
- // trip this shortcut and skip past `final-review` entirely.
818
- if (shouldSkipFinalReviewAfterCredentials(state)) {
816
+ // If we already ran the generator (re-entering credentials from a late
817
+ // 401/403 raised by runPreview), skip back to push-decision-gate rather
818
+ // than re-running the LLM.
819
+ if (state.generateSessionId) {
819
820
  update({ step: 'push-decision-gate' });
820
821
  return;
821
822
  }
@@ -1510,10 +1511,6 @@ export function WizardApp({ initialSpaceId = '', initialEnvironmentId = 'master'
1510
1511
  case 'final-review': {
1511
1512
  return (_jsx(FinalReviewHost, { extractSessionId: state.extractSessionId, generatedCount: state.generatedCount, autoAccept: autoAcceptScope, livePreview: livePreview, spaceId: state.spaceId, environmentId: state.environmentId, cmaToken: state.cmaToken, host: state.host, tokensPath: state.tokensPath, initialFinalizeError: state.finalizeErrorBanner, onFinalize: (accepted, rejected, unresolved) => {
1512
1513
  process.stderr.write(`Accepted: ${accepted} Rejected: ${rejected} Unresolved: ${unresolved}\n`);
1513
- // Mark the review as passed so a later re-entry to credentials
1514
- // (e.g. late 401 raised by runPreview) short-circuits back to
1515
- // push-decision-gate instead of re-rendering final-review.
1516
- update({ finalReviewPassed: true });
1517
1514
  // INTEG-4411 refined: no `accepted === 0` up-front block here.
1518
1515
  // A zero-accepted finalize can still be a valid push when the
1519
1516
  // operator explicitly rejected component(s) that exist server-
@@ -44,24 +44,23 @@ export declare function nextStepAfterCredentialsValidated(opts: {
44
44
  acceptedCount: number;
45
45
  }): WizardStepAfterCredentials;
46
46
  /**
47
- * Bug fix (2026-07): the "skip generator, jump to push-decision-gate" shortcut
48
- * on the credentials post-credentials edge was originally guarded by
49
- * `state.generateSessionId != null`. That signal is ALSO set by the scope-gate
50
- * background prefetch as soon as the LLM finishes so when a fast prefetch
51
- * completed while the operator was still typing credentials, submitting them
52
- * skipped `final-review` entirely and jumped straight to `push-decision-gate`.
47
+ * Bug fix (2026-07): the `generation_cache` table in pipeline.db is keyed by
48
+ * `(input_hash, prompt_hash, entity_type, component_id)` with no session
49
+ * scoping. `component_id` is a deterministic hash of `(name, source)`, so a
50
+ * fresh new session on an unchanged codebase always hits the cache and
51
+ * silently skips the LLM. That's the intended behavior for continued sessions
52
+ * (modify / push-from-run) but is surprising for a fresh `experiences import`
53
+ * run: the operator expects a re-classify pass, not cached output from a
54
+ * prior session.
53
55
  *
54
- * The real invariant the guard wants is: has the operator already been through
55
- * the final-review screen and finalized once? That's what `finalReviewPassed`
56
- * captures it flips true in `onFinalize` on the GenerateReviewStep, not on
57
- * mere prefetch completion.
58
- *
59
- * Retained (and required) is `generateSessionId != null`, so we don't jump to
60
- * push-decision-gate before generation is even complete.
56
+ * Resolution: for a fresh session (no `seedExtractSessionId`), force
57
+ * `--no-cache` on the spawned `generate components` subprocess. For a
58
+ * continued session (modify / push-from-run / picker-seeded), honor the
59
+ * operator's `--no-cache` flag as before.
61
60
  */
62
- export declare function shouldSkipFinalReviewAfterCredentials(state: {
63
- generateSessionId: string | null;
64
- finalReviewPassed: boolean;
61
+ export declare function resolveNoCacheForGenerate(opts: {
62
+ isFreshSession: boolean;
63
+ cliNoCache: boolean;
65
64
  }): boolean;
66
65
  /**
67
66
  * Skip-credentials spec — Task 2. When the operator pressed `s` on the
@@ -44,23 +44,24 @@ export function nextStepAfterCredentialsValidated(opts) {
44
44
  return opts.acceptedCount > 0 ? 'generating' : 'push-decision-gate';
45
45
  }
46
46
  /**
47
- * Bug fix (2026-07): the "skip generator, jump to push-decision-gate" shortcut
48
- * on the credentials post-credentials edge was originally guarded by
49
- * `state.generateSessionId != null`. That signal is ALSO set by the scope-gate
50
- * background prefetch as soon as the LLM finishes so when a fast prefetch
51
- * completed while the operator was still typing credentials, submitting them
52
- * skipped `final-review` entirely and jumped straight to `push-decision-gate`.
47
+ * Bug fix (2026-07): the `generation_cache` table in pipeline.db is keyed by
48
+ * `(input_hash, prompt_hash, entity_type, component_id)` with no session
49
+ * scoping. `component_id` is a deterministic hash of `(name, source)`, so a
50
+ * fresh new session on an unchanged codebase always hits the cache and
51
+ * silently skips the LLM. That's the intended behavior for continued sessions
52
+ * (modify / push-from-run) but is surprising for a fresh `experiences import`
53
+ * run: the operator expects a re-classify pass, not cached output from a
54
+ * prior session.
53
55
  *
54
- * The real invariant the guard wants is: has the operator already been through
55
- * the final-review screen and finalized once? That's what `finalReviewPassed`
56
- * captures it flips true in `onFinalize` on the GenerateReviewStep, not on
57
- * mere prefetch completion.
58
- *
59
- * Retained (and required) is `generateSessionId != null`, so we don't jump to
60
- * push-decision-gate before generation is even complete.
56
+ * Resolution: for a fresh session (no `seedExtractSessionId`), force
57
+ * `--no-cache` on the spawned `generate components` subprocess. For a
58
+ * continued session (modify / push-from-run / picker-seeded), honor the
59
+ * operator's `--no-cache` flag as before.
61
60
  */
62
- export function shouldSkipFinalReviewAfterCredentials(state) {
63
- return state.finalReviewPassed && state.generateSessionId != null;
61
+ export function resolveNoCacheForGenerate(opts) {
62
+ if (opts.isFreshSession)
63
+ return true;
64
+ return opts.cliNoCache;
64
65
  }
65
66
  /**
66
67
  * Skip-credentials spec — Task 2. When the operator pressed `s` on the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.12.2-dev-build-4dc32df.0",
3
+ "version": "2.12.2-dev-build-e72ea10.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "svelte": "^5.56.4",
38
38
  "ts-morph": "^27.0.2",
39
39
  "typescript": "^5.9.3",
40
- "@contentful/experience-design-system-types": "2.12.2-dev-build-4dc32df.0"
40
+ "@contentful/experience-design-system-types": "2.12.2-dev-build-e72ea10.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@tsconfig/node24": "^24.0.3",