@brainervirus/workit-core 0.8.3 → 0.8.4
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/package.json +1 -1
- package/src/core/flow-state.ts +14 -3
- package/src/core/reminder.ts +4 -2
package/package.json
CHANGED
package/src/core/flow-state.ts
CHANGED
|
@@ -1271,9 +1271,20 @@ export class HostReceiptStore {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
|
-
/** Menu labels compare
|
|
1275
|
-
*
|
|
1276
|
-
|
|
1274
|
+
/** Menu labels compare semantically: hosts decorate choices with
|
|
1275
|
+
* parenthesized qualifiers ("Handoff (new session only)") that the enum does
|
|
1276
|
+
* not carry, so we strip them, trim, collapse whitespace, and lowercase both
|
|
1277
|
+
* sides before comparing. Only the comparison normalizes — the stored label
|
|
1278
|
+
* and evidence bytes are preserved verbatim. */
|
|
1279
|
+
const sameChoiceLabel = (a: string, b: string): boolean => normalizeLabel(a) === normalizeLabel(b);
|
|
1280
|
+
|
|
1281
|
+
const normalizeLabel = (s: string): string =>
|
|
1282
|
+
s
|
|
1283
|
+
.replace(/\s*\([^)]*\)/g, " ")
|
|
1284
|
+
.replace(/\s*\bfirst\b\s*$/i, " ")
|
|
1285
|
+
.replace(/[^a-z0-9]+/gi, " ")
|
|
1286
|
+
.trim()
|
|
1287
|
+
.toLowerCase();
|
|
1277
1288
|
|
|
1278
1289
|
/** Derive the evidence record from a consumed host receipt (AR-12). */
|
|
1279
1290
|
export const createOpenCodeEvidence = (receipt: HostReceipt): OpenCodeChoiceEvidence => ({
|
package/src/core/reminder.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { DESTINATION_MENU_LABELS, HANDOFF_DESTINATION_MARKER, SOURCE_MENU_LABELS
|
|
|
4
4
|
// the reminder PROSE like the other source surfaces (bootstrap.ts, session-start,
|
|
5
5
|
// superpowers-doc-contract.md, ask-question-only.mdc), never in the machine
|
|
6
6
|
// label tuple `SOURCE_MENU_LABELS` — the receipt label must stay exactly
|
|
7
|
-
// `Handoff` for the native-question match (AR-12).
|
|
8
|
-
|
|
7
|
+
// `Handoff` for the native-question match (AR-12). Exported so contract tests
|
|
8
|
+
// assert the rendered reminder against this single source of truth instead of
|
|
9
|
+
// re-deriving the mapping.
|
|
10
|
+
export const SOURCE_MENU_LABELS_DISPLAY = SOURCE_MENU_LABELS.map((label) =>
|
|
9
11
|
label === "Handoff" ? "Handoff (new session only)" : label,
|
|
10
12
|
);
|
|
11
13
|
|