@muggleai/works 5.39.0-staging.367 → 5.39.0-staging.369

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.
@@ -10,7 +10,7 @@
10
10
  "name": "muggleai",
11
11
  "source": "./plugin",
12
12
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
13
- "version": "5.39.0-staging.367"
13
+ "version": "5.39.0-staging.369"
14
14
  }
15
15
  ]
16
16
  }
@@ -1,4 +1,4 @@
1
- import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, initTelemetry, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, e2e_exports, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, local_exports, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, isTelemetryEnabled, isInitialized, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, WatchQosSignal, WatchQosDetector, AgentHost, getInstallId } from './chunk-KVOQUMGB.js';
1
+ import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, initTelemetry, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, e2e_exports, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, local_exports, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, isTelemetryEnabled, isInitialized, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, WatchQosSignal, WatchQosDetector, AgentHost, getInstallId } from './chunk-RDWWFNP3.js';
2
2
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
3
  import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema } from '@modelcontextprotocol/sdk/types.js';
4
4
  import { v4 } from 'uuid';
@@ -1375,7 +1375,7 @@ async function resolveGsScreenshotUrls(report, opts) {
1375
1375
  if (gsUrls.length === 0) {
1376
1376
  return report;
1377
1377
  }
1378
- const mcps = await import('./src-TO2HGAQY.js');
1378
+ const mcps = await import('./src-BE2BL6CX.js');
1379
1379
  const credentials = await mcps.getCallerCredentialsAsync();
1380
1380
  if (!credentials.bearerToken && !credentials.apiKey) {
1381
1381
  stderrWrite(
@@ -4,7 +4,7 @@ import * as path17 from 'path';
4
4
  import { join, dirname } from 'path';
5
5
  import { fileURLToPath } from 'url';
6
6
  import * as crypto from 'crypto';
7
- import { randomUUID } from 'crypto';
7
+ import { randomUUID, createHash } from 'crypto';
8
8
  import * as os4 from 'os';
9
9
  import { platform } from 'os';
10
10
  import winston from 'winston';
@@ -5060,9 +5060,9 @@ function isValid2(value) {
5060
5060
  function readReleaseManifest2() {
5061
5061
  if (cachedManifest2 !== void 0)
5062
5062
  return cachedManifest2;
5063
- const path29 = MANIFEST_PATH2;
5063
+ const path31 = MANIFEST_PATH2;
5064
5064
  try {
5065
- const raw = readFileSync(path29, "utf8");
5065
+ const raw = readFileSync(path31, "utf8");
5066
5066
  const parsed = JSON.parse(raw);
5067
5067
  cachedManifest2 = isValid2(parsed) ? parsed : DEV_MANIFEST2;
5068
5068
  return cachedManifest2;
@@ -8069,17 +8069,17 @@ var PromptServiceClient = class {
8069
8069
  * @param path - Path to validate.
8070
8070
  * @throws GatewayError if path is not allowed.
8071
8071
  */
8072
- validatePath(path29) {
8073
- const isAllowed = PUBLIC_UPSTREAM_PATHS.includes(path29) || ALLOWED_UPSTREAM_PREFIXES.some((prefix) => path29.startsWith(prefix));
8072
+ validatePath(path31) {
8073
+ const isAllowed = PUBLIC_UPSTREAM_PATHS.includes(path31) || ALLOWED_UPSTREAM_PREFIXES.some((prefix) => path31.startsWith(prefix));
8074
8074
  if (!isAllowed) {
8075
8075
  const logger7 = getLogger();
8076
8076
  logger7.error("Path not in allowlist", {
8077
- path: path29,
8077
+ path: path31,
8078
8078
  allowedPrefixes: ALLOWED_UPSTREAM_PREFIXES
8079
8079
  });
8080
8080
  throw new GatewayError({
8081
8081
  code: "FORBIDDEN" /* FORBIDDEN */,
8082
- message: `Path '${path29}' is not allowed`
8082
+ message: `Path '${path31}' is not allowed`
8083
8083
  });
8084
8084
  }
8085
8085
  }
@@ -9073,10 +9073,50 @@ function mapTestScriptsSummary(response) {
9073
9073
  };
9074
9074
  }
9075
9075
 
9076
+ // packages/mcps/src/shared/taste-profile/types.ts
9077
+ var TasteCategory = /* @__PURE__ */ ((TasteCategory2) => {
9078
+ TasteCategory2["Naming"] = "Naming";
9079
+ TasteCategory2["VisualDesign"] = "VisualDesign";
9080
+ TasteCategory2["Interaction"] = "Interaction";
9081
+ TasteCategory2["Copy"] = "Copy";
9082
+ TasteCategory2["Workflow"] = "Workflow";
9083
+ TasteCategory2["QualityBar"] = "QualityBar";
9084
+ return TasteCategory2;
9085
+ })(TasteCategory || {});
9086
+ var TasteSignalKind = /* @__PURE__ */ ((TasteSignalKind2) => {
9087
+ TasteSignalKind2["ReviewComment"] = "ReviewComment";
9088
+ TasteSignalKind2["E2eFeedback"] = "E2eFeedback";
9089
+ TasteSignalKind2["ApprovedRequest"] = "ApprovedRequest";
9090
+ return TasteSignalKind2;
9091
+ })(TasteSignalKind || {});
9092
+ var TasteDiscipline = /* @__PURE__ */ ((TasteDiscipline2) => {
9093
+ TasteDiscipline2["WebUi"] = "WebUi";
9094
+ TasteDiscipline2["MobileApp"] = "MobileApp";
9095
+ TasteDiscipline2["VideoEditing"] = "VideoEditing";
9096
+ TasteDiscipline2["ImageGeneration"] = "ImageGeneration";
9097
+ TasteDiscipline2["General"] = "General";
9098
+ return TasteDiscipline2;
9099
+ })(TasteDiscipline || {});
9100
+
9076
9101
  // packages/mcps/src/shared/taste-profile/constants.ts
9077
9102
  var TASTE_DIR_NAME = "taste";
9078
9103
  var TASTE_SIGNAL_JOURNAL_FILE_NAME = "signals.jsonl";
9079
9104
  var TASTE_PROFILE_FILE_NAME = "profile.json";
9105
+ var TASTE_PROFILE_VIEW_FILE_NAME = "profile.md";
9106
+ var TASTE_UPLOAD_STATE_FILE_NAME = "upload-state.json";
9107
+ var TASTE_DEFAULT_DISCIPLINE = "WebUi" /* WebUi */;
9108
+ var TASTE_DISCIPLINE_LABELS = {
9109
+ ["WebUi" /* WebUi */]: "Web UI",
9110
+ ["MobileApp" /* MobileApp */]: "Mobile app",
9111
+ ["VideoEditing" /* VideoEditing */]: "Video editing",
9112
+ ["ImageGeneration" /* ImageGeneration */]: "Image generation",
9113
+ ["General" /* General */]: "General"
9114
+ };
9115
+ var TASTE_SECTION_UPLOAD_STATUS_LABELS = {
9116
+ ["never-uploaded" /* NeverUploaded */]: "never uploaded",
9117
+ ["matches-uploaded-copy" /* MatchesUploadedCopy */]: "matches uploaded copy",
9118
+ ["changed-since-upload" /* ChangedSinceUpload */]: "changed since upload"
9119
+ };
9080
9120
  var TASTE_SECTION_CHARACTER_BUDGET = 8e3;
9081
9121
  var TASTE_EVIDENCE_MAX_PER_PREFERENCE = 3;
9082
9122
  var TASTE_EVIDENCE_EXCERPT_MAX_CHARACTERS = 300;
@@ -9099,23 +9139,6 @@ var TASTE_REDACTION_PATTERNS = [
9099
9139
  /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,
9100
9140
  /\b(?=[A-Za-z0-9_-]*\d)(?=[A-Za-z0-9_-]*[A-Za-z])[A-Za-z0-9_-]{32,}\b/g
9101
9141
  ];
9102
-
9103
- // packages/mcps/src/shared/taste-profile/types.ts
9104
- var TasteCategory = /* @__PURE__ */ ((TasteCategory2) => {
9105
- TasteCategory2["Naming"] = "Naming";
9106
- TasteCategory2["VisualDesign"] = "VisualDesign";
9107
- TasteCategory2["Interaction"] = "Interaction";
9108
- TasteCategory2["Copy"] = "Copy";
9109
- TasteCategory2["Workflow"] = "Workflow";
9110
- TasteCategory2["QualityBar"] = "QualityBar";
9111
- return TasteCategory2;
9112
- })(TasteCategory || {});
9113
- var TasteSignalKind = /* @__PURE__ */ ((TasteSignalKind2) => {
9114
- TasteSignalKind2["ReviewComment"] = "ReviewComment";
9115
- TasteSignalKind2["E2eFeedback"] = "E2eFeedback";
9116
- TasteSignalKind2["ApprovedRequest"] = "ApprovedRequest";
9117
- return TasteSignalKind2;
9118
- })(TasteSignalKind || {});
9119
9142
  function getTasteDir(dataDirOverride2) {
9120
9143
  return path17.join(dataDirOverride2 ?? getDataDir(), TASTE_DIR_NAME);
9121
9144
  }
@@ -9125,6 +9148,12 @@ function getTasteSignalJournalPath(dataDirOverride2) {
9125
9148
  function getTasteProfilePath(dataDirOverride2) {
9126
9149
  return path17.join(getTasteDir(dataDirOverride2), TASTE_PROFILE_FILE_NAME);
9127
9150
  }
9151
+ function getTasteProfileViewPath(dataDirOverride2) {
9152
+ return path17.join(getTasteDir(dataDirOverride2), TASTE_PROFILE_VIEW_FILE_NAME);
9153
+ }
9154
+ function getTasteUploadStatePath(dataDirOverride2) {
9155
+ return path17.join(getTasteDir(dataDirOverride2), TASTE_UPLOAD_STATE_FILE_NAME);
9156
+ }
9128
9157
  var knownSignalKinds = new Set(Object.values(TasteSignalKind));
9129
9158
  function isTasteSignal(candidate) {
9130
9159
  if (typeof candidate !== "object" || candidate === null) {
@@ -9154,7 +9183,7 @@ function listTasteSignals(listFilter = {}, dataDirOverride2) {
9154
9183
  try {
9155
9184
  const parsedLine = JSON.parse(journalLine);
9156
9185
  if (isTasteSignal(parsedLine)) {
9157
- signals.push(parsedLine);
9186
+ signals.push({ ...parsedLine, discipline: parsedLine.discipline ?? TASTE_DEFAULT_DISCIPLINE });
9158
9187
  }
9159
9188
  } catch {
9160
9189
  }
@@ -9170,6 +9199,15 @@ function createEmptyTasteProfile() {
9170
9199
  function isTasteProfileEmpty(tasteProfile) {
9171
9200
  return tasteProfile.userSection === null && Object.keys(tasteProfile.projectSections).length === 0;
9172
9201
  }
9202
+ function resolveSectionDisciplines(storedSection) {
9203
+ return {
9204
+ ...storedSection,
9205
+ preferences: storedSection.preferences.map((storedPreference) => ({
9206
+ ...storedPreference,
9207
+ discipline: storedPreference.discipline ?? TASTE_DEFAULT_DISCIPLINE
9208
+ }))
9209
+ };
9210
+ }
9173
9211
  function readTasteProfile(dataDirOverride2) {
9174
9212
  const profilePath = getTasteProfilePath(dataDirOverride2);
9175
9213
  try {
@@ -9178,8 +9216,13 @@ function readTasteProfile(dataDirOverride2) {
9178
9216
  }
9179
9217
  const storedProfile = JSON.parse(fs4.readFileSync(profilePath, "utf-8"));
9180
9218
  return {
9181
- userSection: storedProfile.userSection ?? null,
9182
- projectSections: storedProfile.projectSections ?? {}
9219
+ userSection: storedProfile.userSection ? resolveSectionDisciplines(storedProfile.userSection) : null,
9220
+ projectSections: Object.fromEntries(
9221
+ Object.entries(storedProfile.projectSections ?? {}).map(([projectId, projectSection]) => [
9222
+ projectId,
9223
+ resolveSectionDisciplines(projectSection)
9224
+ ])
9225
+ )
9183
9226
  };
9184
9227
  } catch {
9185
9228
  return createEmptyTasteProfile();
@@ -9216,6 +9259,14 @@ function clearTasteProfile(projectId, dataDirOverride2) {
9216
9259
  return remainingProfile;
9217
9260
  }
9218
9261
 
9262
+ // packages/mcps/src/shared/taste-profile/taste-named-sections.ts
9263
+ function listNamedTasteSections(tasteSections) {
9264
+ return [
9265
+ ...tasteSections.userSection ? [[TASTE_USER_SECTION_NAME, tasteSections.userSection]] : [],
9266
+ ...Object.entries(tasteSections.projectSections ?? {})
9267
+ ];
9268
+ }
9269
+
9219
9270
  // packages/mcps/src/shared/taste-profile/taste-profile-budget.ts
9220
9271
  function countPreferenceCharacters(preference) {
9221
9272
  return preference.statement.length + preference.appliesWhen.length + preference.evidence.reduce((characterCount, evidence) => characterCount + evidence.excerpt.length, 0);
@@ -9227,18 +9278,14 @@ function countSectionCharacters(tasteSection) {
9227
9278
  );
9228
9279
  }
9229
9280
  function findOverBudgetSections(sectionUpdate) {
9230
- const namedSections = [
9231
- ...sectionUpdate.userSection ? [[TASTE_USER_SECTION_NAME, sectionUpdate.userSection]] : [],
9232
- ...Object.entries(sectionUpdate.projectSections ?? {})
9233
- ];
9234
- return namedSections.map(([sectionName, tasteSection]) => ({
9281
+ return listNamedTasteSections(sectionUpdate).map(([sectionName, tasteSection]) => ({
9235
9282
  sectionName,
9236
9283
  characterCount: countSectionCharacters(tasteSection)
9237
9284
  })).filter((sectionMeasure) => sectionMeasure.characterCount > TASTE_SECTION_CHARACTER_BUDGET);
9238
9285
  }
9239
9286
 
9240
9287
  // packages/mcps/src/shared/taste-profile/taste-profile-screen.ts
9241
- function screenSection(tasteSection) {
9288
+ function screenTasteSection(tasteSection) {
9242
9289
  let sectionRedactionCount = 0;
9243
9290
  const redactText = (uploadedText) => {
9244
9291
  let redactedText = uploadedText;
@@ -9269,13 +9316,13 @@ function screenTasteProfile(tasteProfile) {
9269
9316
  let redactionCount = 0;
9270
9317
  let screenedUserSection = null;
9271
9318
  if (tasteProfile.userSection) {
9272
- const userSectionScreen = screenSection(tasteProfile.userSection);
9319
+ const userSectionScreen = screenTasteSection(tasteProfile.userSection);
9273
9320
  screenedUserSection = userSectionScreen.screenedSection;
9274
9321
  redactionCount += userSectionScreen.redactionCount;
9275
9322
  }
9276
9323
  const screenedProjectSections = {};
9277
9324
  for (const [projectId, projectSection] of Object.entries(tasteProfile.projectSections)) {
9278
- const projectSectionScreen = screenSection(projectSection);
9325
+ const projectSectionScreen = screenTasteSection(projectSection);
9279
9326
  screenedProjectSections[projectId] = projectSectionScreen.screenedSection;
9280
9327
  redactionCount += projectSectionScreen.redactionCount;
9281
9328
  }
@@ -9296,9 +9343,170 @@ function resolveTasteProfileUploadDecision(tasteProfileUploadPreference, hasUser
9296
9343
  return "needs-consent" /* NeedsConsent */;
9297
9344
  }
9298
9345
 
9346
+ // packages/mcps/src/shared/taste-profile/taste-profile-view-renderer.ts
9347
+ function toSingleLine(multilineText) {
9348
+ return multilineText.replace(/\s+/g, " ").trim();
9349
+ }
9350
+ function renderUploadLine(uploadReport) {
9351
+ if (uploadReport === void 0 || uploadReport.status === "never-uploaded" /* NeverUploaded */) {
9352
+ return `Last uploaded: ${TASTE_SECTION_UPLOAD_STATUS_LABELS["never-uploaded" /* NeverUploaded */]}`;
9353
+ }
9354
+ return `Last uploaded: ${uploadReport.uploadedAt} \u2014 ${TASTE_SECTION_UPLOAD_STATUS_LABELS[uploadReport.status]}`;
9355
+ }
9356
+ function renderEvidenceLine(evidence) {
9357
+ const sourceSuffix = evidence.sourceRef === void 0 ? "" : `, ${toSingleLine(evidence.sourceRef)}`;
9358
+ return ` - "${toSingleLine(evidence.excerpt)}" (${evidence.kind}, ${evidence.recordedAt}${sourceSuffix})`;
9359
+ }
9360
+ function renderPreference(preference) {
9361
+ return [
9362
+ `#### ${toSingleLine(preference.statement)}`,
9363
+ "",
9364
+ `- Applies when: ${toSingleLine(preference.appliesWhen)}`,
9365
+ `- Category: ${preference.category}`,
9366
+ `- Signals: ${preference.signalCount}`,
9367
+ `- Last seen: ${preference.lastSeenAt}`,
9368
+ "- Evidence:",
9369
+ ...preference.evidence.map((evidence) => renderEvidenceLine(evidence)),
9370
+ ""
9371
+ ];
9372
+ }
9373
+ function renderSection(sectionName, tasteSection, uploadReport) {
9374
+ const sectionHeading = sectionName === TASTE_USER_SECTION_NAME ? "User-wide" : `Project ${sectionName}`;
9375
+ const sectionLines = [`## ${sectionHeading}`, "", renderUploadLine(uploadReport), `Distilled: ${tasteSection.distilledAt}`, ""];
9376
+ if (tasteSection.preferences.length === 0) {
9377
+ return [...sectionLines, "No preferences.", ""];
9378
+ }
9379
+ for (const [discipline, disciplineLabel] of Object.entries(TASTE_DISCIPLINE_LABELS)) {
9380
+ const disciplinePreferences = tasteSection.preferences.filter((preference) => preference.discipline === discipline);
9381
+ if (disciplinePreferences.length === 0) {
9382
+ continue;
9383
+ }
9384
+ sectionLines.push(`### ${disciplineLabel}`, "");
9385
+ for (const preference of disciplinePreferences) {
9386
+ sectionLines.push(...renderPreference(preference));
9387
+ }
9388
+ }
9389
+ return sectionLines;
9390
+ }
9391
+ function renderTasteProfileView(tasteProfile, uploadReports) {
9392
+ const viewLines = [
9393
+ "# Muggle taste profile",
9394
+ "",
9395
+ "Readable copy of `profile.json`, rewritten on every change. Edit the profile with /muggle-taste-profile; changes made here are not read back.",
9396
+ ""
9397
+ ];
9398
+ const namedSections = listNamedTasteSections(tasteProfile);
9399
+ if (namedSections.length === 0) {
9400
+ viewLines.push("No sections yet. Build the profile with /muggle-taste-profile.", "");
9401
+ }
9402
+ for (const [sectionName, tasteSection] of namedSections) {
9403
+ viewLines.push(...renderSection(sectionName, tasteSection, uploadReports[sectionName]));
9404
+ }
9405
+ return `${viewLines.join("\n").trimEnd()}
9406
+ `;
9407
+ }
9408
+ function readTasteUploadState(dataDirOverride2) {
9409
+ const uploadStatePath = getTasteUploadStatePath(dataDirOverride2);
9410
+ try {
9411
+ if (!fs4.existsSync(uploadStatePath)) {
9412
+ return {};
9413
+ }
9414
+ const storedUploadState = JSON.parse(fs4.readFileSync(uploadStatePath, "utf-8"));
9415
+ return typeof storedUploadState === "object" && storedUploadState !== null ? storedUploadState : {};
9416
+ } catch {
9417
+ return {};
9418
+ }
9419
+ }
9420
+ function recordTasteSectionUploads(uploadedSectionStates, dataDirOverride2) {
9421
+ const updatedUploadState = { ...readTasteUploadState(dataDirOverride2), ...uploadedSectionStates };
9422
+ const uploadStatePath = getTasteUploadStatePath(dataDirOverride2);
9423
+ fs4.mkdirSync(path17.dirname(uploadStatePath), { recursive: true });
9424
+ fs4.writeFileSync(uploadStatePath, `${JSON.stringify(updatedUploadState, null, 2)}
9425
+ `, "utf-8");
9426
+ return updatedUploadState;
9427
+ }
9428
+ function clearTasteUploadState(dataDirOverride2) {
9429
+ fs4.rmSync(getTasteUploadStatePath(dataDirOverride2), { force: true });
9430
+ }
9431
+ function toCanonicalJson(serializable) {
9432
+ if (Array.isArray(serializable)) {
9433
+ return `[${serializable.map((element) => toCanonicalJson(element)).join(",")}]`;
9434
+ }
9435
+ if (typeof serializable === "object" && serializable !== null) {
9436
+ const sortedEntries = Object.entries(serializable).filter(([, fieldValue]) => fieldValue !== void 0).sort(([leftKey], [rightKey]) => leftKey < rightKey ? -1 : leftKey > rightKey ? 1 : 0);
9437
+ return `{${sortedEntries.map(([fieldKey, fieldValue]) => `${JSON.stringify(fieldKey)}:${toCanonicalJson(fieldValue)}`).join(",")}}`;
9438
+ }
9439
+ return JSON.stringify(serializable);
9440
+ }
9441
+ function hashScreenedTasteSection(screenedSection) {
9442
+ return createHash("sha256").update(toCanonicalJson(screenedSection.preferences)).digest("hex");
9443
+ }
9444
+ function buildTasteSectionUploadStates(screenedProfile, uploadedAt) {
9445
+ return Object.fromEntries(
9446
+ listNamedTasteSections(screenedProfile).map(([sectionName, screenedSection]) => [
9447
+ sectionName,
9448
+ { uploadedAt, screenedSectionHash: hashScreenedTasteSection(screenedSection) }
9449
+ ])
9450
+ );
9451
+ }
9452
+ function resolveTasteSectionUploadReport(tasteSection, sectionUploadState) {
9453
+ if (sectionUploadState === void 0) {
9454
+ return { status: "never-uploaded" /* NeverUploaded */ };
9455
+ }
9456
+ const currentHash = hashScreenedTasteSection(screenTasteSection(tasteSection).screenedSection);
9457
+ return {
9458
+ status: currentHash === sectionUploadState.screenedSectionHash ? "matches-uploaded-copy" /* MatchesUploadedCopy */ : "changed-since-upload" /* ChangedSinceUpload */,
9459
+ uploadedAt: sectionUploadState.uploadedAt
9460
+ };
9461
+ }
9462
+ function resolveTasteProfileUploadReports(tasteProfile, uploadState) {
9463
+ return Object.fromEntries(
9464
+ listNamedTasteSections(tasteProfile).map(([sectionName, tasteSection]) => [
9465
+ sectionName,
9466
+ resolveTasteSectionUploadReport(tasteSection, uploadState[sectionName])
9467
+ ])
9468
+ );
9469
+ }
9470
+ function renderTasteProfileViewFile(tasteProfile, dataDirOverride2) {
9471
+ const sectionUploadReports = resolveTasteProfileUploadReports(tasteProfile, readTasteUploadState(dataDirOverride2));
9472
+ const viewPath = getTasteProfileViewPath(dataDirOverride2);
9473
+ fs4.mkdirSync(path17.dirname(viewPath), { recursive: true });
9474
+ fs4.writeFileSync(viewPath, renderTasteProfileView(tasteProfile, sectionUploadReports), "utf-8");
9475
+ }
9476
+ function readLocalTasteProfile(dataDirOverride2) {
9477
+ return readTasteProfile(dataDirOverride2);
9478
+ }
9479
+ function getLocalTasteProfileOverview(dataDirOverride2) {
9480
+ const tasteProfile = readTasteProfile(dataDirOverride2);
9481
+ return {
9482
+ tasteProfile,
9483
+ sectionUploadReports: resolveTasteProfileUploadReports(tasteProfile, readTasteUploadState(dataDirOverride2)),
9484
+ viewPath: getTasteProfileViewPath(dataDirOverride2)
9485
+ };
9486
+ }
9487
+ function setLocalTasteProfileSections(sectionUpdate, dataDirOverride2) {
9488
+ const writtenProfile = writeTasteProfileSections(sectionUpdate, dataDirOverride2);
9489
+ renderTasteProfileViewFile(writtenProfile, dataDirOverride2);
9490
+ return writtenProfile;
9491
+ }
9492
+ function recordTasteProfileUploadAndRender(screenedProfile, uploadedAt, dataDirOverride2) {
9493
+ recordTasteSectionUploads(buildTasteSectionUploadStates(screenedProfile, uploadedAt), dataDirOverride2);
9494
+ renderTasteProfileViewFile(readTasteProfile(dataDirOverride2), dataDirOverride2);
9495
+ }
9496
+ function clearLocalTasteProfile(projectId, dataDirOverride2) {
9497
+ const remainingProfile = clearTasteProfile(projectId, dataDirOverride2);
9498
+ if (projectId === void 0) {
9499
+ clearTasteUploadState(dataDirOverride2);
9500
+ fs4.rmSync(getTasteProfileViewPath(dataDirOverride2), { force: true });
9501
+ return remainingProfile;
9502
+ }
9503
+ renderTasteProfileViewFile(remainingProfile, dataDirOverride2);
9504
+ return remainingProfile;
9505
+ }
9506
+
9299
9507
  // packages/mcps/src/mcp/tools/e2e/taste-profile-upload.ts
9300
9508
  async function uploadTasteProfileAsync(uploadRequest) {
9301
- const localProfile = readTasteProfile(uploadRequest.dataDirOverride);
9509
+ const localProfile = readLocalTasteProfile(uploadRequest.dataDirOverride);
9302
9510
  if (isTasteProfileEmpty(localProfile)) {
9303
9511
  return {
9304
9512
  outcome: "nothing-to-upload" /* NothingToUpload */,
@@ -9330,7 +9538,7 @@ async function uploadTasteProfileAsync(uploadRequest) {
9330
9538
  if (overBudgetSections.length > 0) {
9331
9539
  return {
9332
9540
  outcome: "over-budget" /* OverBudget */,
9333
- message: "Some sections exceed the 4,000-character budget. Rebuild them shorter, then upload again.",
9541
+ message: `Some sections exceed the ${TASTE_SECTION_CHARACTER_BUDGET.toLocaleString("en-US")}-character budget. Rebuild them shorter, then upload again.`,
9334
9542
  redactionCount: screenResult.redactionCount,
9335
9543
  overBudgetSections
9336
9544
  };
@@ -9341,6 +9549,7 @@ async function uploadTasteProfileAsync(uploadRequest) {
9341
9549
  credentials,
9342
9550
  uploadRequest.correlationId
9343
9551
  );
9552
+ recordTasteProfileUploadAndRender(screenResult.screenedProfile, (/* @__PURE__ */ new Date()).toISOString(), uploadRequest.dataDirOverride);
9344
9553
  return {
9345
9554
  outcome: "uploaded" /* Uploaded */,
9346
9555
  message: "Uploaded the screened taste profile. Muggle Test runs now use it as guidance.",
@@ -11183,7 +11392,7 @@ var userFeedbackTools = [
11183
11392
  var tasteProfileTools = [
11184
11393
  {
11185
11394
  name: "muggle-remote-taste-profile-upload",
11186
- description: "Upload the local taste profile (from muggle-local-taste-profile-set) so Muggle Test runs use it as guidance. Screens every statement, context and evidence excerpt first, redacting API keys, tokens, JWTs, private keys, emails and password-like key=value pairs; the raw signal journal is never sent, only the short excerpts the profile cites as evidence. Honors the tasteProfileUpload preference: 'never' refuses, 'ask' returns outcome 'needs-consent' with the screened profile until called with hasUserApprovedThisUpload: true, 'always' uploads. Replaces each uploaded section remotely and keeps the rest. Returns { outcome, message, redactionCount, hasUploadedUserSection, uploadedProjectIds, remoteProfile }.",
11395
+ description: "Upload the local taste profile (from muggle-local-taste-profile-set) so Muggle Test runs use it as guidance. Screens every statement, context and evidence excerpt first, redacting API keys, tokens, JWTs, private keys, emails and password-like key=value pairs; the raw signal journal is never sent, only the short excerpts the profile cites as evidence. Honors the tasteProfileUpload preference: 'never' refuses, 'ask' returns outcome 'needs-consent' with the screened profile until called with hasUserApprovedThisUpload: true, 'always' uploads. Replaces each uploaded section remotely and keeps the rest; records each section's upload state and re-renders the readable ~/.muggle-ai/taste/profile.md. Returns { outcome, message, redactionCount, hasUploadedUserSection, uploadedProjectIds, remoteProfile }.",
11187
11396
  inputSchema: TasteProfileUploadInputSchema,
11188
11397
  mapToUpstream: () => {
11189
11398
  throw new Error("LOCAL_HANDLER_ONLY");
@@ -11798,17 +12007,19 @@ var TasteEvidenceSchema = z.object({
11798
12007
  var TastePreferenceSchema = z.object({
11799
12008
  statement: z.string().trim().min(1).describe("The conclusion."),
11800
12009
  appliesWhen: z.string().trim().min(1).describe("Where it holds; runs apply it only there."),
11801
- evidence: z.array(TasteEvidenceSchema).min(1).max(TASTE_EVIDENCE_MAX_PER_PREFERENCE).describe("Newest first."),
12010
+ evidence: z.array(TasteEvidenceSchema).min(1).max(TASTE_EVIDENCE_MAX_PER_PREFERENCE),
11802
12011
  category: z.nativeEnum(TasteCategory),
12012
+ discipline: z.nativeEnum(TasteDiscipline),
11803
12013
  signalCount: z.number().int().min(1),
11804
12014
  lastSeenAt: isoDateTimeSchema
11805
12015
  });
11806
12016
  var TasteSectionSchema = z.object({
11807
- preferences: z.array(TastePreferenceSchema).describe("Ranked by support, then recency."),
12017
+ preferences: z.array(TastePreferenceSchema),
11808
12018
  distilledAt: isoDateTimeSchema
11809
12019
  });
11810
12020
  var TasteSignalAppendInputSchema = z.object({
11811
12021
  kind: z.nativeEnum(TasteSignalKind).describe("Flow the signal came from."),
12022
+ discipline: z.nativeEnum(TasteDiscipline).optional().describe("Kind of work the signal came from; omitted counts as WebUi."),
11812
12023
  text: z.string().trim().min(1).describe("The user's own words, or the approved goal and criteria."),
11813
12024
  projectId: z.string().min(1).optional().describe("Muggle Test project the signal belongs to; omit when none."),
11814
12025
  classification: z.string().min(1).optional().describe("How the flow classified it, e.g. actionable or ambiguous."),
@@ -12675,9 +12886,13 @@ var telemetryEventEmitTool = {
12675
12886
  };
12676
12887
  var TASTE_JOURNAL_DISPLAY_PATH = `${MUGGLE_HOME_DISPLAY_DIR}/${TASTE_DIR_NAME}/${TASTE_SIGNAL_JOURNAL_FILE_NAME}`;
12677
12888
  var TASTE_PROFILE_DISPLAY_PATH = `${MUGGLE_HOME_DISPLAY_DIR}/${TASTE_DIR_NAME}/${TASTE_PROFILE_FILE_NAME}`;
12678
- function describeTasteProfile(tasteProfile) {
12889
+ var TASTE_PROFILE_VIEW_DISPLAY_PATH = `${MUGGLE_HOME_DISPLAY_DIR}/${TASTE_DIR_NAME}/${TASTE_PROFILE_VIEW_FILE_NAME}`;
12890
+ function describeTasteProfile(tasteProfileOverview) {
12891
+ const tasteProfile = tasteProfileOverview.tasteProfile;
12679
12892
  return {
12680
12893
  path: getTasteProfilePath(),
12894
+ viewPath: tasteProfileOverview.viewPath,
12895
+ sectionUploadStatus: tasteProfileOverview.sectionUploadReports,
12681
12896
  characterBudget: TASTE_SECTION_CHARACTER_BUDGET,
12682
12897
  userSectionCharacters: tasteProfile.userSection ? countSectionCharacters(tasteProfile.userSection) : 0,
12683
12898
  projectSectionCharacters: Object.fromEntries(
@@ -12691,7 +12906,7 @@ function describeTasteProfile(tasteProfile) {
12691
12906
  }
12692
12907
  var tasteSignalAppendTool = {
12693
12908
  name: "muggle-local-taste-signal-append",
12694
- description: `Append one taste signal to the local, append-only journal (${TASTE_JOURNAL_DISPLAY_PATH}). Call it when a Muggle flow sees the user's taste: a review comment a muggle-do cycle addressed (kind ReviewComment, with its classification), E2E feedback the user submitted (E2eFeedback), or the goal and criteria of a request the user approved (ApprovedRequest). The journal never leaves the machine; /muggle-taste-profile distills it into the profile, and only the short screened excerpts it picks as evidence are uploaded.`,
12909
+ description: `Append one taste signal to the local, append-only journal (${TASTE_JOURNAL_DISPLAY_PATH}). Call it when a Muggle flow sees the user's taste: a review comment a muggle-do cycle addressed (kind ReviewComment, with its classification), E2E feedback the user submitted (E2eFeedback), or the goal and criteria of a request the user approved (ApprovedRequest). Pass the discipline of the work (WebUi for web app work). The journal never leaves the machine; /muggle-taste-profile distills it into the profile, and only the short screened excerpts it picks as evidence are uploaded.`,
12695
12910
  inputSchema: TasteSignalAppendInputSchema,
12696
12911
  execute: async (ctx) => {
12697
12912
  const logger7 = createChildLogger2(ctx.correlationId);
@@ -12699,6 +12914,7 @@ var tasteSignalAppendTool = {
12699
12914
  const input = TasteSignalAppendInputSchema.parse(ctx.input);
12700
12915
  const appendedSignal = appendTasteSignal({
12701
12916
  kind: input.kind,
12917
+ discipline: input.discipline,
12702
12918
  text: input.text,
12703
12919
  projectId: input.projectId,
12704
12920
  classification: input.classification,
@@ -12712,7 +12928,7 @@ var tasteSignalAppendTool = {
12712
12928
  };
12713
12929
  var tasteSignalListTool = {
12714
12930
  name: "muggle-local-taste-signal-list",
12715
- description: `List taste signals from the local journal (${TASTE_JOURNAL_DISPLAY_PATH}), oldest first, optionally narrowed by projectId, kind, or the newest N. Returns JSON { count, signals: [{ kind, text, projectId, classification, sourceRef, recordedAt }] }.`,
12931
+ description: `List taste signals from the local journal (${TASTE_JOURNAL_DISPLAY_PATH}), oldest first, optionally narrowed by projectId, kind, or the newest N. Returns JSON { count, signals: [{ kind, discipline, text, projectId, classification, sourceRef, recordedAt }] }; a signal recorded without a discipline reads as WebUi.`,
12716
12932
  inputSchema: TasteSignalListInputSchema,
12717
12933
  execute: async (ctx) => {
12718
12934
  const logger7 = createChildLogger2(ctx.correlationId);
@@ -12727,20 +12943,20 @@ var tasteSignalListTool = {
12727
12943
  };
12728
12944
  var tasteProfileGetTool = {
12729
12945
  name: "muggle-local-taste-profile-get",
12730
- description: `Get the local taste profile (${TASTE_PROFILE_DISPLAY_PATH}) with each section's character count (statements, contexts and evidence excerpts) against the budget. Returns JSON { path, characterBudget, userSectionCharacters, projectSectionCharacters, profile: { userSection, projectSections } }; an unbuilt profile has a null userSection and no projectSections.`,
12946
+ description: `Get the local taste profile (${TASTE_PROFILE_DISPLAY_PATH}) with each section's character count (statements, contexts and evidence excerpts) against the budget. Returns JSON { path, viewPath (readable profile.md), sectionUploadStatus: { <user|projectId>: { status: never-uploaded|matches-uploaded-copy|changed-since-upload, uploadedAt } }, characterBudget, userSectionCharacters, projectSectionCharacters, profile: { userSection, projectSections } }; an unbuilt profile has a null userSection and no projectSections.`,
12731
12947
  inputSchema: EmptyInputSchema2,
12732
12948
  execute: async (ctx) => {
12733
12949
  const logger7 = createChildLogger2(ctx.correlationId);
12734
12950
  logger7.info("Executing muggle-local-taste-profile-get");
12735
12951
  return {
12736
- content: JSON.stringify(describeTasteProfile(readTasteProfile()), null, 2),
12952
+ content: JSON.stringify(describeTasteProfile(getLocalTasteProfileOverview()), null, 2),
12737
12953
  isError: false
12738
12954
  };
12739
12955
  }
12740
12956
  };
12741
12957
  var tasteProfileSetTool = {
12742
12958
  name: "muggle-local-taste-profile-set",
12743
- description: `Write distilled sections to the local taste profile (${TASTE_PROFILE_DISPLAY_PATH}). Each named section replaces the stored one; others are kept. Each preference carries its conclusion (statement), the context it applies in (appliesWhen), its category, signalCount (supporting journal signals) and lastSeenAt (ISO-8601 time of the newest one), and 1\u20133 evidence entries, newest first, each { kind, excerpt (the user's own words, at most ${TASTE_EVIDENCE_EXCERPT_MAX_CHARACTERS} characters, screened before upload), sourceRef, recordedAt } copied from the journal. Rank preferences by signalCount, then lastSeenAt; distilledAt is the ISO-8601 time the section was distilled. Refuses a section whose statements, contexts and evidence excerpts total more than ${TASTE_SECTION_CHARACTER_BUDGET} characters. Nothing is uploaded; that is muggle-remote-taste-profile-upload.`,
12959
+ description: `Write distilled sections to the local taste profile (${TASTE_PROFILE_DISPLAY_PATH}). Each named section replaces the stored one; others are kept. Each preference carries its conclusion (statement), the context it applies in (appliesWhen), its category, discipline (WebUi, MobileApp, VideoEditing, ImageGeneration, or General only when its signals span two or more disciplines), signalCount (supporting journal signals) and lastSeenAt (ISO-8601 time of the newest one), and 1\u20133 evidence entries, newest first, each { kind, excerpt (the user's own words, at most ${TASTE_EVIDENCE_EXCERPT_MAX_CHARACTERS} characters, screened before upload), sourceRef, recordedAt } copied from the journal. Rank preferences by signalCount, then lastSeenAt; distilledAt is the ISO-8601 time the section was distilled. Refuses a section whose statements, contexts and evidence excerpts total more than ${TASTE_SECTION_CHARACTER_BUDGET} characters. Re-renders the readable ${TASTE_PROFILE_VIEW_DISPLAY_PATH}. Nothing is uploaded; that is muggle-remote-taste-profile-upload.`,
12744
12960
  inputSchema: TasteProfileSetInputSchema,
12745
12961
  execute: async (ctx) => {
12746
12962
  const logger7 = createChildLogger2(ctx.correlationId);
@@ -12761,22 +12977,22 @@ var tasteProfileSetTool = {
12761
12977
  isError: true
12762
12978
  };
12763
12979
  }
12764
- const writtenProfile = writeTasteProfileSections(input);
12980
+ setLocalTasteProfileSections(input);
12765
12981
  return {
12766
- content: JSON.stringify(describeTasteProfile(writtenProfile), null, 2),
12982
+ content: JSON.stringify(describeTasteProfile(getLocalTasteProfileOverview()), null, 2),
12767
12983
  isError: false
12768
12984
  };
12769
12985
  }
12770
12986
  };
12771
12987
  var tasteProfileClearTool = {
12772
12988
  name: "muggle-local-taste-profile-clear",
12773
- description: `Clear the local taste profile (${TASTE_PROFILE_DISPLAY_PATH}), or only one project's section when projectId is given. The signal journal and any uploaded profile are untouched; delete the uploaded one with muggle-remote-taste-profile-delete.`,
12989
+ description: `Clear the local taste profile (${TASTE_PROFILE_DISPLAY_PATH}), or only one project's section when projectId is given. A full clear also removes ${TASTE_PROFILE_VIEW_DISPLAY_PATH} and the upload state. The signal journal and any uploaded profile are untouched; delete the uploaded one with muggle-remote-taste-profile-delete.`,
12774
12990
  inputSchema: TasteProfileClearInputSchema,
12775
12991
  execute: async (ctx) => {
12776
12992
  const logger7 = createChildLogger2(ctx.correlationId);
12777
12993
  logger7.info("Executing muggle-local-taste-profile-clear");
12778
12994
  const input = TasteProfileClearInputSchema.parse(ctx.input);
12779
- clearTasteProfile(input.projectId);
12995
+ clearLocalTasteProfile(input.projectId);
12780
12996
  return {
12781
12997
  content: input.projectId ? `Cleared the local taste section for project ${input.projectId}.` : "Cleared the local taste profile.",
12782
12998
  isError: false
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-QB4WZI2I.js';
3
- import './chunk-KVOQUMGB.js';
2
+ import { runCli } from './chunk-33TLSQ37.js';
3
+ import './chunk-RDWWFNP3.js';
4
4
 
5
5
  // src/cli/main.ts
6
6
  runCli().catch((error) => {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-QB4WZI2I.js';
2
- export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-KVOQUMGB.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-33TLSQ37.js';
2
+ export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-RDWWFNP3.js';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
4
- "version": "5.39.0-staging.367",
4
+ "version": "5.39.0-staging.369",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.39.0-staging.367",
7
+ "@muggleai/works@5.39.0-staging.369",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.39.0-staging.367",
3
+ "version": "5.39.0-staging.369",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
- "version": "5.39.0-staging.367",
5
+ "version": "5.39.0-staging.369",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.39.0-staging.367",
7
+ "@muggleai/works@5.39.0-staging.369",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -119,7 +119,7 @@ Invoke [`open-prs/update.md`](open-prs/update.md) (pass the PR URL + slug + exis
119
119
  #### 4g. Post per-comment inline replies
120
120
 
121
121
  Invoke [`per-comment-replies.md`](per-comment-replies.md) with the actionable reviews (`gitlab`: discussions), the actionable conversation comments, and the new SHA. One reply per comment, in its own thread, describing what was done for it; a conversation comment, which has no thread, gets one signed top-level comment that names it. The reply is the whole of it — neither provider's threads get resolved by the loop.
122
- After the replies, record each addressed comment as a taste signal: `muggle-local-taste-signal-append` with `kind: "ReviewComment"`, the comment's text, `classification` from Step 2, `sourceRef` the comment URL, and the session's Muggle Test `projectId` when known. A failed append never blocks the round.
122
+ After the replies, record each addressed comment as a taste signal: `muggle-local-taste-signal-append` with `kind: "ReviewComment"`, `discipline: "WebUi"`, the comment's text, `classification` from Step 2, `sourceRef` the comment URL, and the session's Muggle Test `projectId` when known. A failed append never blocks the round.
123
123
  (The resolve-reminder runs once per round in Step 5.5 below — not only after a push — so a round that pushed nothing still nudges addressed-but-unresolved threads.)
124
124
 
125
125
  ### Step 5 — Update session state
@@ -48,6 +48,6 @@ Write the findings to `~/.muggle-ai/muggle-do/sessions/<slug>/requirements.md`.
48
48
 
49
49
  Then append this stage's marker to `iterations/<NNN>.md`, citing the file written and its criteria count.
50
50
 
51
- Record the approved request as a taste signal: `muggle-local-taste-signal-append` with `kind: "ApprovedRequest"`, `text` the goal and criteria, and the session's Muggle Test `projectId` when known. A failed append never blocks the stage.
51
+ Record the approved request as a taste signal: `muggle-local-taste-signal-append` with `kind: "ApprovedRequest"`, `discipline: "WebUi"`, `text` the goal and criteria, and the session's Muggle Test `projectId` when known. A failed append never blocks the stage.
52
52
 
53
53
  Do NOT ask the user questions. Make reasonable inferences and flag assumptions in Notes.
@@ -111,7 +111,7 @@ Always pass `projectId` and `feedbackText`. Capture each response — note `feed
111
111
 
112
112
  If a single create call fails, log the error, continue with the rest, and report the failure at the end. Do not abort the batch.
113
113
 
114
- For each piece that saved, record a taste signal: `muggle-local-taste-signal-append` with `kind: "E2eFeedback"`, `text` the `feedbackText`, `projectId`, and `sourceRef` the `feedback.id`. A failed append never blocks the batch.
114
+ For each piece that saved, record a taste signal: `muggle-local-taste-signal-append` with `kind: "E2eFeedback"`, `discipline: "WebUi"`, `text` the `feedbackText`, `projectId`, and `sourceRef` the `feedback.id`. A failed append never blocks the batch.
115
115
 
116
116
  ## 5. Wait for the analysis
117
117
 
@@ -10,7 +10,7 @@ description: "Build, view, upload or clear the user's taste profile, which test
10
10
 
11
11
  > Running outside Claude Code (in Codex, for one)? Read [`../_shared/host-tool-equivalents.md`](../_shared/host-tool-equivalents.md) first — it maps the tools and paths this skill names to your host's.
12
12
 
13
- Muggle flows append **signals** to a local journal (`~/.muggle-ai/taste/signals.jsonl`): review comments a `/muggle-do` cycle addressed, E2E feedback, approved requests. This skill distills them into the **profile** (`~/.muggle-ai/taste/profile.json`): one user-wide section plus one section per Muggle Test project. Each preference keeps its conclusion together with its context and the evidence behind it, so a wrong summary can be caught and a preference is applied only where it holds. Once uploaded, Muggle Test runs read it as guidance; a test case's steps and assertions always win over it. The journal never leaves the machine; only the short screened excerpts a preference cites as evidence do.
13
+ Muggle flows append **signals** to a local journal (`~/.muggle-ai/taste/signals.jsonl`): review comments a `/muggle-do` cycle addressed, E2E feedback, approved requests. This skill distills them into the **profile** (`~/.muggle-ai/taste/profile.json`): one user-wide section plus one section per Muggle Test project, rendered for reading as `~/.muggle-ai/taste/profile.md` on every change. Each preference names the **discipline** it belongs to (`WebUi`, `MobileApp`, `VideoEditing`, `ImageGeneration`, `General`), so each consumer applies only its own discipline's taste plus `General`. Each preference keeps its conclusion together with its context and the evidence behind it, so a wrong summary can be caught and a preference is applied only where it holds. Once uploaded, Muggle Test runs read it as guidance; a test case's steps and assertions always win over it. The journal never leaves the machine; only the short screened excerpts a preference cites as evidence do.
14
14
 
15
15
  ## Preferences
16
16
 
@@ -38,29 +38,30 @@ If intent is ambiguous, use `AskUserQuestion` once with **Build / View / Clear**
38
38
  - `appliesWhen`: the situation the signals came from and where the conclusion holds — the screen, component, flow or kind of change ("Toolbar and navigation buttons in the dashboard", not "Everywhere"). State it no wider than the signals show; when signals from different situations disagree, keep them as separate preferences with their own contexts.
39
39
  - `evidence`: the newest 1–3 supporting signals, newest first, each `{ kind, excerpt, sourceRef, recordedAt }` copied from the journal. `excerpt` is the part of the signal's `text` that shows the taste, in the user's words, at most 300 characters; drop names, addresses and credentials from it.
40
40
  - `category`: one of `Naming`, `VisualDesign`, `Interaction`, `Copy`, `Workflow`, `QualityBar`.
41
+ - `discipline`: the `discipline` of its supporting signals (a signal with none counts as `WebUi`). Tag it `General` only when those signals span two or more disciplines, never from how general the wording sounds; otherwise keep signals from different disciplines in separate preferences.
41
42
  - `signalCount`: how many signals support it. `lastSeenAt`: the newest supporting signal's `recordedAt`.
42
43
  - Drop one-off fixes that state no reusable taste (a typo, a single bug).
43
44
  - Rank by `signalCount`, then `lastSeenAt`, newest first. Where two preferences conflict, keep the one with more and newer support.
44
45
  - Keep each section's statements, contexts and evidence excerpts within 8,000 characters; trim evidence to fewer entries first, then cut preferences from the bottom of the ranking.
45
46
  - `distilledAt`: now, ISO-8601.
46
47
  3. **Write.** `muggle-local-taste-profile-set` with `userSection` and `projectSections`. A rebuild sends every section, which replaces the old ones; clear a project that no longer has signals with `muggle-local-taste-profile-clear` and its `projectId`.
47
- 4. **Show.** Print each section as a table: statement, applies when, category, signals, last seen; under each row, its evidence excerpts with their source. Invite the user to correct any preference whose statement or context misreads its evidence, then go back to step 3 with the fix.
48
+ 4. **Show.** `muggle-local-taste-profile-get`. Tell the user the readable copy is at its `viewPath` (`profile.md`), and for each section its `sectionUploadStatus`: never uploaded, matches the uploaded copy, or changed since the upload at `uploadedAt`. Print each section, grouped by discipline, as a table: statement, applies when, category, signals, last seen; under each row, its evidence excerpts with their source. Invite the user to correct any preference whose statement, context or discipline misreads its evidence, then go back to step 3 with the fix.
48
49
  5. **Upload.** Gate `tasteProfileUpload`:
49
50
  - `never` → silent footer; stop.
50
51
  - `always` → `muggle-remote-taste-profile-upload`.
51
52
  - `ask` → `muggle-remote-taste-profile-upload` first: it returns `needs-consent` with the screened profile. Show what will be sent, evidence excerpts included, then run Picker 1 and Picker 2. On `Upload it` or `Ask me next time`, call it again with `hasUserApprovedThisUpload: true`.
52
- 6. **Report.** The tool's `message`; when `redactionCount` > 0, say how many spans were redacted. `UNAUTHORIZED` → hand off to the `muggle-login` skill, then retry step 5. `over-budget` → shorten the named sections and go back to step 3.
53
+ 6. **Report.** The tool's `message`; when `redactionCount` > 0, say how many spans were redacted. After an upload, `profile.md` shows each uploaded section as matching the uploaded copy. `UNAUTHORIZED` → hand off to the `muggle-login` skill, then retry step 5. `over-budget` → shorten the named sections and go back to step 3.
53
54
 
54
55
  ## View
55
56
 
56
- 1. `muggle-local-taste-profile-get`; print each section as in Build step 4, with its character count against the budget. Empty → offer Build.
57
- 2. When signed in, `muggle-remote-taste-profile-get`, and say whether the uploaded copy matches the local one (same statements, contexts and evidence per section) or is older.
57
+ 1. Show as in Build step 4, with each section's character count against the budget. Empty → offer Build.
58
+ 2. When the user asks what the server holds and is signed in, `muggle-remote-taste-profile-get` and print it.
58
59
 
59
60
  ## Clear
60
61
 
61
62
  `AskUserQuestion`: **Local profile / Uploaded profile / Both**, then whether to clear one project (`projectId`) or everything.
62
63
 
63
- - Local → `muggle-local-taste-profile-clear`.
64
+ - Local → `muggle-local-taste-profile-clear`. Clearing everything also removes `profile.md` and the record of what was uploaded.
64
65
  - Uploaded → `muggle-remote-taste-profile-delete`. Future runs stop using what was deleted.
65
66
 
66
67
  The journal is kept, so a later Build can restore the profile. To forget the signals too, the user deletes `~/.muggle-ai/taste/signals.jsonl` themselves; say so, never delete it for them.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release": "5.39.0-staging.367",
3
- "buildId": "run-367-1",
4
- "commitSha": "d58d735d7723b911d10777aac8e60ac9372602e8",
5
- "buildTime": "2026-11-12T07:45:22Z",
2
+ "release": "5.39.0-staging.369",
3
+ "buildId": "run-369-1",
4
+ "commitSha": "a682abfb8b3597f6e7a891ecc991039cd2eecf4e",
5
+ "buildTime": "2026-11-19T13:13:32Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
@@ -1 +1 @@
1
- export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_CHECKSUMS_ASSET_NAME, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, StudioJobPriorityEnum, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-KVOQUMGB.js';
1
+ export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_CHECKSUMS_ASSET_NAME, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, StudioJobPriorityEnum, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-RDWWFNP3.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@muggleai/works",
3
3
  "mcpName": "io.github.multiplex-ai/muggleai",
4
- "version": "5.39.0-staging.367",
4
+ "version": "5.39.0-staging.369",
5
5
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
4
- "version": "5.39.0-staging.367",
4
+ "version": "5.39.0-staging.369",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.39.0-staging.367",
7
+ "@muggleai/works@5.39.0-staging.369",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.39.0-staging.367",
3
+ "version": "5.39.0-staging.369",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
- "version": "5.39.0-staging.367",
5
+ "version": "5.39.0-staging.369",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
package/plugin/.mcp.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.39.0-staging.367",
7
+ "@muggleai/works@5.39.0-staging.369",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -119,7 +119,7 @@ Invoke [`open-prs/update.md`](open-prs/update.md) (pass the PR URL + slug + exis
119
119
  #### 4g. Post per-comment inline replies
120
120
 
121
121
  Invoke [`per-comment-replies.md`](per-comment-replies.md) with the actionable reviews (`gitlab`: discussions), the actionable conversation comments, and the new SHA. One reply per comment, in its own thread, describing what was done for it; a conversation comment, which has no thread, gets one signed top-level comment that names it. The reply is the whole of it — neither provider's threads get resolved by the loop.
122
- After the replies, record each addressed comment as a taste signal: `muggle-local-taste-signal-append` with `kind: "ReviewComment"`, the comment's text, `classification` from Step 2, `sourceRef` the comment URL, and the session's Muggle Test `projectId` when known. A failed append never blocks the round.
122
+ After the replies, record each addressed comment as a taste signal: `muggle-local-taste-signal-append` with `kind: "ReviewComment"`, `discipline: "WebUi"`, the comment's text, `classification` from Step 2, `sourceRef` the comment URL, and the session's Muggle Test `projectId` when known. A failed append never blocks the round.
123
123
  (The resolve-reminder runs once per round in Step 5.5 below — not only after a push — so a round that pushed nothing still nudges addressed-but-unresolved threads.)
124
124
 
125
125
  ### Step 5 — Update session state
@@ -48,6 +48,6 @@ Write the findings to `~/.muggle-ai/muggle-do/sessions/<slug>/requirements.md`.
48
48
 
49
49
  Then append this stage's marker to `iterations/<NNN>.md`, citing the file written and its criteria count.
50
50
 
51
- Record the approved request as a taste signal: `muggle-local-taste-signal-append` with `kind: "ApprovedRequest"`, `text` the goal and criteria, and the session's Muggle Test `projectId` when known. A failed append never blocks the stage.
51
+ Record the approved request as a taste signal: `muggle-local-taste-signal-append` with `kind: "ApprovedRequest"`, `discipline: "WebUi"`, `text` the goal and criteria, and the session's Muggle Test `projectId` when known. A failed append never blocks the stage.
52
52
 
53
53
  Do NOT ask the user questions. Make reasonable inferences and flag assumptions in Notes.
@@ -111,7 +111,7 @@ Always pass `projectId` and `feedbackText`. Capture each response — note `feed
111
111
 
112
112
  If a single create call fails, log the error, continue with the rest, and report the failure at the end. Do not abort the batch.
113
113
 
114
- For each piece that saved, record a taste signal: `muggle-local-taste-signal-append` with `kind: "E2eFeedback"`, `text` the `feedbackText`, `projectId`, and `sourceRef` the `feedback.id`. A failed append never blocks the batch.
114
+ For each piece that saved, record a taste signal: `muggle-local-taste-signal-append` with `kind: "E2eFeedback"`, `discipline: "WebUi"`, `text` the `feedbackText`, `projectId`, and `sourceRef` the `feedback.id`. A failed append never blocks the batch.
115
115
 
116
116
  ## 5. Wait for the analysis
117
117
 
@@ -10,7 +10,7 @@ description: "Build, view, upload or clear the user's taste profile, which test
10
10
 
11
11
  > Running outside Claude Code (in Codex, for one)? Read [`../_shared/host-tool-equivalents.md`](../_shared/host-tool-equivalents.md) first — it maps the tools and paths this skill names to your host's.
12
12
 
13
- Muggle flows append **signals** to a local journal (`~/.muggle-ai/taste/signals.jsonl`): review comments a `/muggle-do` cycle addressed, E2E feedback, approved requests. This skill distills them into the **profile** (`~/.muggle-ai/taste/profile.json`): one user-wide section plus one section per Muggle Test project. Each preference keeps its conclusion together with its context and the evidence behind it, so a wrong summary can be caught and a preference is applied only where it holds. Once uploaded, Muggle Test runs read it as guidance; a test case's steps and assertions always win over it. The journal never leaves the machine; only the short screened excerpts a preference cites as evidence do.
13
+ Muggle flows append **signals** to a local journal (`~/.muggle-ai/taste/signals.jsonl`): review comments a `/muggle-do` cycle addressed, E2E feedback, approved requests. This skill distills them into the **profile** (`~/.muggle-ai/taste/profile.json`): one user-wide section plus one section per Muggle Test project, rendered for reading as `~/.muggle-ai/taste/profile.md` on every change. Each preference names the **discipline** it belongs to (`WebUi`, `MobileApp`, `VideoEditing`, `ImageGeneration`, `General`), so each consumer applies only its own discipline's taste plus `General`. Each preference keeps its conclusion together with its context and the evidence behind it, so a wrong summary can be caught and a preference is applied only where it holds. Once uploaded, Muggle Test runs read it as guidance; a test case's steps and assertions always win over it. The journal never leaves the machine; only the short screened excerpts a preference cites as evidence do.
14
14
 
15
15
  ## Preferences
16
16
 
@@ -38,29 +38,30 @@ If intent is ambiguous, use `AskUserQuestion` once with **Build / View / Clear**
38
38
  - `appliesWhen`: the situation the signals came from and where the conclusion holds — the screen, component, flow or kind of change ("Toolbar and navigation buttons in the dashboard", not "Everywhere"). State it no wider than the signals show; when signals from different situations disagree, keep them as separate preferences with their own contexts.
39
39
  - `evidence`: the newest 1–3 supporting signals, newest first, each `{ kind, excerpt, sourceRef, recordedAt }` copied from the journal. `excerpt` is the part of the signal's `text` that shows the taste, in the user's words, at most 300 characters; drop names, addresses and credentials from it.
40
40
  - `category`: one of `Naming`, `VisualDesign`, `Interaction`, `Copy`, `Workflow`, `QualityBar`.
41
+ - `discipline`: the `discipline` of its supporting signals (a signal with none counts as `WebUi`). Tag it `General` only when those signals span two or more disciplines, never from how general the wording sounds; otherwise keep signals from different disciplines in separate preferences.
41
42
  - `signalCount`: how many signals support it. `lastSeenAt`: the newest supporting signal's `recordedAt`.
42
43
  - Drop one-off fixes that state no reusable taste (a typo, a single bug).
43
44
  - Rank by `signalCount`, then `lastSeenAt`, newest first. Where two preferences conflict, keep the one with more and newer support.
44
45
  - Keep each section's statements, contexts and evidence excerpts within 8,000 characters; trim evidence to fewer entries first, then cut preferences from the bottom of the ranking.
45
46
  - `distilledAt`: now, ISO-8601.
46
47
  3. **Write.** `muggle-local-taste-profile-set` with `userSection` and `projectSections`. A rebuild sends every section, which replaces the old ones; clear a project that no longer has signals with `muggle-local-taste-profile-clear` and its `projectId`.
47
- 4. **Show.** Print each section as a table: statement, applies when, category, signals, last seen; under each row, its evidence excerpts with their source. Invite the user to correct any preference whose statement or context misreads its evidence, then go back to step 3 with the fix.
48
+ 4. **Show.** `muggle-local-taste-profile-get`. Tell the user the readable copy is at its `viewPath` (`profile.md`), and for each section its `sectionUploadStatus`: never uploaded, matches the uploaded copy, or changed since the upload at `uploadedAt`. Print each section, grouped by discipline, as a table: statement, applies when, category, signals, last seen; under each row, its evidence excerpts with their source. Invite the user to correct any preference whose statement, context or discipline misreads its evidence, then go back to step 3 with the fix.
48
49
  5. **Upload.** Gate `tasteProfileUpload`:
49
50
  - `never` → silent footer; stop.
50
51
  - `always` → `muggle-remote-taste-profile-upload`.
51
52
  - `ask` → `muggle-remote-taste-profile-upload` first: it returns `needs-consent` with the screened profile. Show what will be sent, evidence excerpts included, then run Picker 1 and Picker 2. On `Upload it` or `Ask me next time`, call it again with `hasUserApprovedThisUpload: true`.
52
- 6. **Report.** The tool's `message`; when `redactionCount` > 0, say how many spans were redacted. `UNAUTHORIZED` → hand off to the `muggle-login` skill, then retry step 5. `over-budget` → shorten the named sections and go back to step 3.
53
+ 6. **Report.** The tool's `message`; when `redactionCount` > 0, say how many spans were redacted. After an upload, `profile.md` shows each uploaded section as matching the uploaded copy. `UNAUTHORIZED` → hand off to the `muggle-login` skill, then retry step 5. `over-budget` → shorten the named sections and go back to step 3.
53
54
 
54
55
  ## View
55
56
 
56
- 1. `muggle-local-taste-profile-get`; print each section as in Build step 4, with its character count against the budget. Empty → offer Build.
57
- 2. When signed in, `muggle-remote-taste-profile-get`, and say whether the uploaded copy matches the local one (same statements, contexts and evidence per section) or is older.
57
+ 1. Show as in Build step 4, with each section's character count against the budget. Empty → offer Build.
58
+ 2. When the user asks what the server holds and is signed in, `muggle-remote-taste-profile-get` and print it.
58
59
 
59
60
  ## Clear
60
61
 
61
62
  `AskUserQuestion`: **Local profile / Uploaded profile / Both**, then whether to clear one project (`projectId`) or everything.
62
63
 
63
- - Local → `muggle-local-taste-profile-clear`.
64
+ - Local → `muggle-local-taste-profile-clear`. Clearing everything also removes `profile.md` and the record of what was uploaded.
64
65
  - Uploaded → `muggle-remote-taste-profile-delete`. Future runs stop using what was deleted.
65
66
 
66
67
  The journal is kept, so a later Build can restore the profile. To forget the signals too, the user deletes `~/.muggle-ai/taste/signals.jsonl` themselves; say so, never delete it for them.