@hasna/recordings 0.2.14 → 0.3.2

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 (123) hide show
  1. package/Dockerfile.package +4 -5
  2. package/README.md +113 -8
  3. package/bun.lock +2 -2
  4. package/dist/__tests__/helpers/installer-guard-execution.d.ts +22 -0
  5. package/dist/__tests__/helpers/installer-guard-execution.d.ts.map +1 -0
  6. package/dist/__tests__/helpers/installer-preflight.d.ts +22 -0
  7. package/dist/__tests__/helpers/installer-preflight.d.ts.map +1 -0
  8. package/dist/__tests__/helpers/native-fs-guard.d.ts.map +1 -1
  9. package/dist/__tests__/helpers/source-assertions.d.ts +169 -0
  10. package/dist/__tests__/helpers/source-assertions.d.ts.map +1 -0
  11. package/dist/__tests__/preload.d.ts +1 -4
  12. package/dist/__tests__/preload.d.ts.map +1 -1
  13. package/dist/cli/desktop-snapshot.d.ts +20 -0
  14. package/dist/cli/desktop-snapshot.d.ts.map +1 -0
  15. package/dist/cli/index.js +2094 -280
  16. package/dist/cli/macos-permissions.d.ts +72 -0
  17. package/dist/cli/macos-permissions.d.ts.map +1 -1
  18. package/dist/cli/macos-shortcut.d.ts +139 -0
  19. package/dist/cli/macos-shortcut.d.ts.map +1 -0
  20. package/dist/cli/trigger-probe.d.ts +172 -0
  21. package/dist/cli/trigger-probe.d.ts.map +1 -0
  22. package/dist/db/database.d.ts +9 -0
  23. package/dist/db/database.d.ts.map +1 -1
  24. package/dist/http/client.d.ts +19 -7
  25. package/dist/http/client.d.ts.map +1 -1
  26. package/dist/index.d.ts +3 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +635 -50
  29. package/dist/lib/capture-probe.d.ts +216 -0
  30. package/dist/lib/capture-probe.d.ts.map +1 -0
  31. package/dist/lib/config.d.ts.map +1 -1
  32. package/dist/lib/macos-bundle.d.ts +50 -0
  33. package/dist/lib/macos-bundle.d.ts.map +1 -0
  34. package/dist/lib/persistence-probe.d.ts +208 -0
  35. package/dist/lib/persistence-probe.d.ts.map +1 -0
  36. package/dist/lib/recorder.d.ts.map +1 -1
  37. package/dist/lib/retired-deployment-modes.d.ts +24 -0
  38. package/dist/lib/retired-deployment-modes.d.ts.map +1 -0
  39. package/dist/lib/transcriber.d.ts +60 -0
  40. package/dist/lib/transcriber.d.ts.map +1 -1
  41. package/dist/mcp/index.js +141 -57
  42. package/dist/server/cloud-config.d.ts +25 -3
  43. package/dist/server/cloud-config.d.ts.map +1 -1
  44. package/dist/server/cloud-readiness.d.ts.map +1 -1
  45. package/dist/server/cloud.d.ts +8 -7
  46. package/dist/server/cloud.d.ts.map +1 -1
  47. package/dist/server/index.js +188 -80
  48. package/dist/server/migrate-command.d.ts.map +1 -1
  49. package/dist/server/serve.d.ts.map +1 -1
  50. package/dist/storage.d.ts +2 -2
  51. package/dist/storage.d.ts.map +1 -1
  52. package/dist/storage.js +109 -50
  53. package/dist/store.d.ts +1 -1
  54. package/dist/store.d.ts.map +1 -1
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.d.ts.map +1 -1
  57. package/package.json +25 -6
  58. package/scripts/ci-linux-suite.ts +403 -0
  59. package/scripts/ci-native-build.ts +402 -0
  60. package/scripts/enforce_identity_migration.sh +110 -0
  61. package/scripts/generate-sdk.ts +1 -1
  62. package/scripts/install_macos_app.sh +192 -31
  63. package/scripts/macos_artifact.ts +323 -43
  64. package/scripts/native/realtime-settle-probe/README.md +39 -0
  65. package/scripts/native/realtime-settle-probe/main.swift +135 -0
  66. package/scripts/policy/local-only-approved-targets.txt +21 -0
  67. package/scripts/read_local_only_targets.sh +203 -0
  68. package/scripts/scan-artifact.ts +40 -0
  69. package/scripts/set-version.ts +145 -0
  70. package/scripts/smoke_macos_app.sh +62 -16
  71. package/scripts/vacuity-manifest-gen.ts +96 -0
  72. package/scripts/vacuity-manifests/enhancement-screen-mirror.tsv +44 -0
  73. package/scripts/vacuity-manifests/install-chain.tsv +13 -0
  74. package/scripts/vacuity-manifests/must-survive-controls.tsv +10 -0
  75. package/scripts/vacuity-manifests/reorder.tsv +4 -0
  76. package/scripts/vacuity-manifests/source-side.tsv +15 -0
  77. package/scripts/vacuity-manifests/variable-operands.tsv +16 -0
  78. package/scripts/vacuity-manifests/version-sites.tsv +61 -0
  79. package/scripts/vacuity-mutation-battery.ts +266 -0
  80. package/src/native/Recordings/App/MenuBarStatusView.swift +23 -11
  81. package/src/native/Recordings/App/RecordingsApp.swift +37 -1
  82. package/src/native/Recordings/App/RuntimeSmoke.swift +5 -1
  83. package/src/native/Recordings/App/SidebarView.swift +1 -1
  84. package/src/native/Recordings/Package.swift +24 -5
  85. package/src/native/Recordings/RecordingsLib/EnhancementScreen.swift +91 -0
  86. package/src/native/Recordings/RecordingsLib/FnKeyMonitor.swift +27 -4
  87. package/src/native/Recordings/RecordingsLib/Info.plist +2 -2
  88. package/src/native/Recordings/RecordingsLib/MenuBarPresentation.swift +56 -3
  89. package/src/native/Recordings/RecordingsLib/NativePCMRecorder.swift +13 -0
  90. package/src/native/Recordings/RecordingsLib/PasteDeliveryVerification.swift +460 -0
  91. package/src/native/Recordings/RecordingsLib/PermissionRequestLaunchPlan.swift +21 -1
  92. package/src/native/Recordings/RecordingsLib/RealtimeTranscriptionClient.swift +41 -7
  93. package/src/native/Recordings/RecordingsLib/RecordingAttemptAlert.swift +36 -0
  94. package/src/native/Recordings/RecordingsLib/RecordingEngine.swift +1071 -75
  95. package/src/native/Recordings/RecordingsLib/SettingsView.swift +47 -3
  96. package/src/native/Recordings/RecordingsLib/VoiceShortcuts.swift +11 -6
  97. package/src/native/Recordings/RecordingsTests/BarOnlyLaunchPlanTests.swift +99 -0
  98. package/src/native/Recordings/RecordingsTests/CLIRunnerTests.swift +3 -3
  99. package/src/native/Recordings/RecordingsTests/EnhancementScreenTests.swift +191 -0
  100. package/src/native/Recordings/RecordingsTests/MenuBarPresentationTests.swift +144 -4
  101. package/src/native/Recordings/RecordingsTests/PasteDeliveryVerificationTests.swift +463 -0
  102. package/src/native/Recordings/RecordingsTests/PasteTargetTests.swift +33 -20
  103. package/src/native/Recordings/RecordingsTests/ProjectStoreTests.swift +1 -1
  104. package/src/native/Recordings/RecordingsTests/RealtimeSettleBenchmark.swift +200 -0
  105. package/src/native/Recordings/RecordingsTests/RealtimeSettleBudgetTests.swift +80 -0
  106. package/src/native/Recordings/RecordingsTests/RealtimeTranscriptionTests.swift +22 -4
  107. package/src/native/Recordings/RecordingsTests/RecordingEngineDeliveryTests.swift +12 -6
  108. package/src/native/Recordings/RecordingsTests/RecordingEngineHomeIsolationTests.swift +67 -0
  109. package/src/native/Recordings/RecordingsTests/RecordingStartGateTests.swift +12 -3
  110. package/src/native/Recordings/RecordingsTests/RecordingStartTimingTests.swift +207 -11
  111. package/src/native/Recordings/RecordingsTests/SpeechIntentTests.swift +17 -6
  112. package/src/native/Recordings/RecordingsTests/TestHomeDirectory.swift +23 -0
  113. package/src/native/Recordings/Updater/Broker/ApplicationProcessQuiescence.swift +7 -1
  114. package/src/native/Recordings/Updater/Broker/AtomicActivation.swift +10 -10
  115. package/src/native/Recordings/Updater/Broker/BrokerMain.swift +5 -1
  116. package/src/native/Recordings/Updater/Broker/HostOSProductVersion.swift +1 -0
  117. package/src/native/Recordings/Updater/Broker/PeerIdentity.swift +59 -3
  118. package/src/native/Recordings/Updater/Protocol/UpdateProtocol.swift +21 -2
  119. package/src/native/Recordings/Updater/ProtocolTests/ExpectationIntegrityTests.swift +60 -0
  120. package/src/native/Recordings/Updater/ProtocolTests/UpdateXPCInterfaceTests.swift +113 -0
  121. package/src/native/Recordings/Updater/VerifierLauncher/RecordingsVerifierLauncher.c +106 -5
  122. package/src/native/Recordings/build.sh +226 -20
  123. package/scripts/native/prebuilds/darwin-universal/recordings_fs_guard.node +0 -0
@@ -2,10 +2,26 @@
2
2
  set -euo pipefail
3
3
  umask 077
4
4
 
5
- if [ "$#" -ne 2 ]; then
6
- echo "Usage: $0 <Recordings.app> <explicit absolute Bun executable path>" >&2
7
- exit 2
5
+ SMOKE_VARIANT="full"
6
+ if [ "$#" -ge 3 ]; then
7
+ case "$3" in
8
+ --variant)
9
+ SMOKE_VARIANT="${4:-full}"
10
+ ;;
11
+ *)
12
+ echo "Usage: $0 <Recordings.app> <explicit absolute Bun executable path> [--variant full|bar]" >&2
13
+ exit 2
14
+ ;;
15
+ esac
16
+ case "$SMOKE_VARIANT" in
17
+ full|bar) ;;
18
+ *)
19
+ echo "SMOKE_VARIANT must be full or bar; got: $SMOKE_VARIANT" >&2
20
+ exit 2
21
+ ;;
22
+ esac
8
23
  fi
24
+ readonly SMOKE_VARIANT
9
25
 
10
26
  HOST_UNAME_EXECUTABLE="/usr/bin/uname"
11
27
  SYSTEM_DIRNAME_EXECUTABLE="/usr/bin/dirname"
@@ -345,6 +361,12 @@ run_smoke() {
345
361
  if [ "$mode" = "permission-helper" ]; then
346
362
  arguments=(--request-permissions "${arguments[@]}")
347
363
  fi
364
+ if [ "$SMOKE_VARIANT" = "bar" ]; then
365
+ # Bar builds are bar-only by construction (compile-time RECORDINGS_BAR_ONLY); the
366
+ # explicit argument is a belt-and-suspenders self-describing launch record so the
367
+ # launch is attributable to the variant even without the build define.
368
+ arguments=(--bar-only "${arguments[@]}")
369
+ fi
348
370
 
349
371
  SMOKE_PID=""
350
372
  SMOKE_PID_START_IDENTITY=""
@@ -428,6 +450,7 @@ run_smoke() {
428
450
  PATH="$SANITIZED_PATH" \
429
451
  TMPDIR="$WORK_DIR" \
430
452
  SMOKE_MODE="$mode" \
453
+ SMOKE_VARIANT="$SMOKE_VARIANT" \
431
454
  SMOKE_FOCUS_EVIDENCE="$SMOKE_FOCUS_EVIDENCE" \
432
455
  EXPECTED_HELPER="$APP_PATH/Contents/Helpers/recordings" \
433
456
  "$BUN_EXECUTABLE" -e '
@@ -454,19 +477,38 @@ run_smoke() {
454
477
  if (JSON.stringify(result.renderedStatusLabels) !== JSON.stringify(expected)) {
455
478
  fail(`unexpected status labels ${JSON.stringify(result.renderedStatusLabels)}`);
456
479
  }
457
- if (result.windowCreationCount !== 1 || result.windowActivationCount !== 2) {
458
- fail("retained-window activation path was not exercised twice");
459
- }
460
- if (result.retainedWindowReused !== true) fail("main window was not retained");
461
- if (result.applicationActivationPolicy !== 0) fail("main window did not set regular activation policy");
462
- if (!result.mainWindowIsVisible || !result.mainWindowCanBecomeKey) {
463
- fail("retained main window was not visible and capable of becoming key");
464
- }
465
- if (!result.applicationIsActive || !result.mainWindowIsKey) {
466
- if (process.env.SMOKE_FOCUS_EVIDENCE !== "ssh-unavailable") {
467
- fail("Open Recordings did not make the retained window active and key");
480
+ if (process.env.SMOKE_VARIANT === "bar") {
481
+ // The bar variant launches windowless by construction: no workspace window is
482
+ // ever created, activated, or reused, the app stays an accessory (LSUIElement),
483
+ // and no window is exposed. This is the runtime half of the P1 #2 regression —
484
+ // the full-build smoke below must keep creating the window.
485
+ if (result.windowCreationCount !== 0 || result.windowActivationCount !== 0) {
486
+ fail("bar-only launch created or activated a workspace window");
487
+ }
488
+ if (result.retainedWindowReused !== false) {
489
+ fail("bar-only launch reused a workspace window");
490
+ }
491
+ if (result.mainWindowIsVisible || result.mainWindowCanBecomeKey || result.mainWindowIsKey) {
492
+ fail("bar-only launch exposed a main window");
493
+ }
494
+ if (result.applicationActivationPolicy !== 1) {
495
+ fail("bar-only launch did not stay an accessory activation policy");
496
+ }
497
+ } else {
498
+ if (result.windowCreationCount !== 1 || result.windowActivationCount !== 2) {
499
+ fail("retained-window activation path was not exercised twice");
500
+ }
501
+ if (result.retainedWindowReused !== true) fail("main window was not retained");
502
+ if (result.applicationActivationPolicy !== 0) fail("main window did not set regular activation policy");
503
+ if (!result.mainWindowIsVisible || !result.mainWindowCanBecomeKey) {
504
+ fail("retained main window was not visible and capable of becoming key");
505
+ }
506
+ if (!result.applicationIsActive || !result.mainWindowIsKey) {
507
+ if (process.env.SMOKE_FOCUS_EVIDENCE !== "ssh-unavailable") {
508
+ fail("Open Recordings did not make the retained window active and key");
509
+ }
510
+ focusEvidenceStatus = "ssh-unavailable";
468
511
  }
469
- focusEvidenceStatus = "ssh-unavailable";
470
512
  }
471
513
  } else if (mode === "resolver") {
472
514
  if (result.menuBarSurfaceCount !== 0 || result.globalHandlersInstalled !== false) {
@@ -570,4 +612,8 @@ run_smoke() {
570
612
  run_smoke normal
571
613
  run_smoke permission-helper
572
614
  run_smoke resolver
573
- echo "Recordings.app runtime smoke passed: menu bar, retained window, helper isolation, and packaged resolver."
615
+ if [ "$SMOKE_VARIANT" = "bar" ]; then
616
+ echo "Recordings.app runtime smoke passed (bar variant): menu bar, windowless launch, helper isolation, and packaged resolver."
617
+ else
618
+ echo "Recordings.app runtime smoke passed: menu bar, retained window, helper isolation, and packaged resolver."
619
+ fi
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Generates the test-literal mutation manifest for the vacuity battery (OPE41-00029).
3
+ *
4
+ * This exists instead of a committed manifest of byte offsets. Offsets are correct for exactly one
5
+ * revision of the test files: the first commit that adds a comment above a converted site shifts
6
+ * every offset below it, and the battery then reports MUTATION-NOT-APPLIED for rows that were fine.
7
+ * That happened — 66 of 176 rows went stale in one commit — and while the driver refuses to score a
8
+ * mutation it could not apply, a stale manifest still costs a full run and reads like a coverage
9
+ * hole. Generating from the current tree removes the failure mode rather than documenting it.
10
+ *
11
+ * For every `expectOrder` / `sliceBetween` / `sliceBetweenUnique` call site it emits one `corrupt`
12
+ * row per string-literal operand: append a sentinel to that literal in the test file, which is
13
+ * equivalent — from the assertion's point of view — to deleting the needle from the source, but
14
+ * needs no map from haystack variable to source path and leaves the script under test byte-identical
15
+ * so the run still succeeds and only the converted assertion can fail.
16
+ *
17
+ * Operands that are `const` variables rather than literals are NOT emitted here; those are covered
18
+ * by the source-side rows in scripts/vacuity-manifests/variable-operands.tsv.
19
+ *
20
+ * Usage: bun scripts/vacuity-manifest-gen.ts > /tmp/corrupt-sites.tsv
21
+ */
22
+ import { readFileSync } from "node:fs";
23
+ import { Glob } from "bun";
24
+
25
+ const HELPERS = /\b(expectOrder|sliceBetweenUnique|sliceBetween)\s*\(/g;
26
+
27
+ /** The nearest enclosing `it(...)` / `test(...)` name, used as the `-t` filter. */
28
+ function enclosingTest(source: string, position: number): string | undefined {
29
+ let best: string | undefined;
30
+ const pattern = /\b(?:it|test)\s*\(\s*(["'`])((?:\\.|(?!\1).)*)\1/g;
31
+ let match: RegExpExecArray | null;
32
+ while ((match = pattern.exec(source))) {
33
+ if (match.index >= position) break;
34
+ best = match[2];
35
+ }
36
+ return best;
37
+ }
38
+
39
+ /** Top-level string-literal arguments of a call, as [offset-of-inner-text, raw-inner-text]. */
40
+ function literalArguments(source: string, openParen: number): Array<[number, string]> {
41
+ const found: Array<[number, string]> = [];
42
+ let index = openParen + 1;
43
+ let depth = 1;
44
+ while (index < source.length && depth > 0) {
45
+ const character = source[index];
46
+ if (character === "(") depth++;
47
+ else if (character === ")") depth--;
48
+ else if (character === '"' || character === "'" || character === "`") {
49
+ const quote = character;
50
+ const start = ++index;
51
+ while (index < source.length && source[index] !== quote) {
52
+ if (source[index] === "\\") index++;
53
+ index++;
54
+ }
55
+ if (depth === 1) found.push([start, source.slice(start, index)]);
56
+ }
57
+ index++;
58
+ }
59
+ return found;
60
+ }
61
+
62
+ /** TSV cannot carry a real tab or newline. Backslash sequences pass through untouched, because the
63
+ * mutation compares the file's RAW bytes and `\n` inside a TS literal is two of them. */
64
+ function escapeForTsv(text: string): string {
65
+ return text.replace(/\t/g, "\\t").replace(/\n/g, "\\n");
66
+ }
67
+
68
+ const emitted = new Set<string>();
69
+ const lines: string[] = [
70
+ "# GENERATED by scripts/vacuity-manifest-gen.ts - do not hand-edit, regenerate.",
71
+ "# kind\ttestFile\ttestName\ttargetFile\toffset\tliteral",
72
+ ];
73
+
74
+ for (const path of new Glob("src/**/*.test.ts").scanSync(".")) {
75
+ // The guards suite calls the helpers on hand-built strings to prove they THROW. Its literals are
76
+ // fixtures, not needles into a real source file, so corrupting them measures nothing about the
77
+ // repo and only adds noise to the tally.
78
+ if (path.endsWith("source-assertions-guards.test.ts")) continue;
79
+ const source = readFileSync(path, "utf8");
80
+ HELPERS.lastIndex = 0;
81
+ let call: RegExpExecArray | null;
82
+ while ((call = HELPERS.exec(source))) {
83
+ const testName = enclosingTest(source, call.index);
84
+ if (!testName) continue;
85
+ for (const [offset, raw] of literalArguments(source, call.index + call[0].length - 1).slice(0, 2)) {
86
+ if (raw.length < 3) continue;
87
+ const key = `${path}:${offset}`;
88
+ if (emitted.has(key)) continue;
89
+ emitted.add(key);
90
+ lines.push(`corrupt\t${path}\t${testName}\t${path}\t${offset}\t${escapeForTsv(raw)}`);
91
+ }
92
+ }
93
+ }
94
+
95
+ console.log(lines.join("\n"));
96
+ console.error(`generated ${emitted.size} corrupt rows`);
@@ -0,0 +1,44 @@
1
+ # Re-derivation battery for the guards PR #35 introduces (todos 96546cc7).
2
+ #
3
+ # Scope: enhancer.test.ts (the PR's cross-language fixture twins) and
4
+ # enhancement-screen-mirror-contract.test.ts (added because the three claims below were
5
+ # enforced by nothing runnable on Linux). The three station-contended suites are NOT in scope;
6
+ # an already-red target makes every mutation look caught. The Swift suites cannot run here at
7
+ # all -- no Swift toolchain exists on this machine -- so every row below is a TEXT-level check.
8
+ #
9
+ # Rows marked MUST-SURVIVE are controls in the sense of must-survive-controls.tsv, so this
10
+ # manifest exits 1 by design and is not wired into a package.json aggregate script.
11
+ #
12
+ # --- TS side of the cross-language twin. Bound before this task; kept as regression coverage.
13
+ delete src/__tests__/enhancer.test.ts enhances: make this sound more professional src/lib/enhancer.ts professional| 1
14
+ delete src/__tests__/enhancer.test.ts passes through: draft beer is better than bottled in my opinion src/lib/enhancer.ts (?:email|message|response|reply|letter|note|text|slack|dm) 1
15
+ # --- SWIFT regex mirror drift. SURVIVED before enhancement-screen-mirror-contract existed:
16
+ # nothing on Linux read EnhancementScreen.swift, so the 'byte-identical' claim was unenforced.
17
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts the instruction pattern sources are byte-identical in the CLI and the Swift mirror src/native/Recordings/RecordingsLib/EnhancementScreen.swift professional| 1
18
+ # --- and the same drift introduced on the CLI side must break identity too, not just behaviour.
19
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts the instruction pattern sources are byte-identical in the CLI and the Swift mirror src/lib/enhancer.ts professional| 1
20
+ # --- 'shared verbatim fixture table'. SURVIVED before: the tables were the same text only by
21
+ # convention, and the TS fixtures exercised the TS implementation alone.
22
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts the cross-language fixture table is the same text in both suites src/native/Recordings/RecordingsTests/EnhancementScreenTests.swift "draft beer is better than bottled in my opinion" 1
23
+ # --- review F2's fail-closed contract at the PRODUCTION call site. SURVIVED before.
24
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts every Swift call site of shouldPasteBeforePersistence states enhanceTriggersJSON src/native/Recordings/RecordingsLib/RecordingEngine.swift ,\n enhanceTriggersJSON: processingConfiguration.enhanceTriggersJSON\n 1
25
+ # --- and at a test call site: these five were shipped without the argument at all, which does
26
+ # not compile. Swift catches that on macOS; this row makes Linux catch it too.
27
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts every Swift call site of shouldPasteBeforePersistence states enhanceTriggersJSON src/native/Recordings/RecordingsTests/SpeechIntentTests.swift ,\n enhanceTriggersJSON: "[]" 1
28
+ # --- MUST-SURVIVE: a neutral comment deletion in the CLI must not trip the fixture twins.
29
+ delete src/__tests__/enhancer.test.ts enhances: make this sound more professional src/lib/enhancer.ts // Check instruction patterns\n 1
30
+ # --- MUST-SURVIVE: nor may a comment deletion in the Swift mirror trip the identity guard --
31
+ # otherwise the guard is a whole-file checksum rather than an assertion about the patterns.
32
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts the instruction pattern sources are byte-identical in the CLI and the Swift mirror src/native/Recordings/RecordingsLib/EnhancementScreen.swift /// Deterministic local pre-screen for the CLI's enhancement decision.\n 1
33
+
34
+ # --- ADVERSARIAL REVIEW ADDITION (todos 96546cc7). The one place the mirror was LESS
35
+ # conservative than the CLI: `needsEnhancement` tests `lower.includes(trigger.toLowerCase())` and
36
+ # JS `includes("")` is true for every string, so one empty row in enhance_triggers makes the
37
+ # helper rewrite every transcript. Foundation's `contains("")` is FALSE, so the mirror has to
38
+ # special-case the row. It skipped it instead, and deleting the skip SURVIVED all three guards --
39
+ # the fixture twins pin transcript text, never trigger lists. Deleting the fail-closed branch now
40
+ # breaks the new guard's source assertion.
41
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts an empty configured trigger makes both implementations fail closed src/native/Recordings/RecordingsLib/EnhancementScreen.swift guard !loweredTrigger.isEmpty else { return true }\n 1
42
+ # --- and the CLI half of the same claim: deleting the trigger scan makes needsEnhancement stop
43
+ # treating an empty row as a match.
44
+ delete src/__tests__/enhancement-screen-mirror-contract.test.ts an empty configured trigger makes both implementations fail closed src/lib/enhancer.ts if (lower.includes(trigger.toLowerCase())) { 1
@@ -0,0 +1,13 @@
1
+ # The "not TSV-expressible" chain markers, expressed via occurrence index instead of a line delete.
2
+ # A bare identifier's FIRST occurrence is the shell function DEFINITION (`name() {`), which is why a
3
+ # newline-free needle appeared unusable; the CALL site is simply a later occurrence.
4
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh acquire_maintenance_marker 2
5
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh drain_store_reader_leases 2
6
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh acquire_sqlite_barrier 3
7
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh acquire_sqlite_barrier 5
8
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh acquire_sqlite_barrier 6
9
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh stop_old_processes 3
10
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh stop_old_processes 4
11
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh stop_old_processes 5
12
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh trap cleanup_install_coordination_and_work EXIT 1
13
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh write_journal processes-stopped 1
@@ -0,0 +1,10 @@
1
+ # DELIBERATE MUST-SURVIVE CONTROL. `options: .atomic` occurs twice in RecordingsApp.swift and only
2
+ # the SECOND is inside the region under test. Deleting the FIRST (the runtimeSmokeOutput evidence
3
+ # write, outside the region) MUST leave the test green. A battery that reports KILLED here is
4
+ # over-matching, and would send someone to "fix" a guard that is working correctly.
5
+ delete src/__tests__/macos-smoke-process-identity.test.ts uses challenge-bound completion with identity-verified failure cleanup src/native/Recordings/App/RecordingsApp.swift options: .atomic 1
6
+ # Deleting one of FOUR legitimate `run_swift build` invocations must NOT fail: "tests precede any
7
+ # build" is still true with three left. The reorder in reorder.tsv is the mutation that proves that
8
+ # ordering claim is live. A harness that flagged this as a survivor would be over-matching.
9
+ delete src/__tests__/native-release-build-hardening-contract.test.ts pins a clean full source revision before native compilation src/native/Recordings/build.sh run_swift build -c "$BUILD_CONFIGURATION" 1
10
+ delete src/__tests__/macos-artifact-binding.test.ts verification and durability gates precede final manifest publication scripts/macos_artifact.ts fsyncSync(descriptor) 1
@@ -0,0 +1,4 @@
1
+ # The semantically meaningful mutation for a 1-of-4 needle: REORDER, not delete. Deleting one of the
2
+ # four legitimate `run_swift build` invocations correctly survives, because "tests precede any build"
3
+ # is still true. Swapping the test past the first build is the mutation the assertion exists for.
4
+ swap src/__tests__/native-release-build-hardening-contract.test.ts pins a clean full source revision before native compilation src/native/Recordings/build.sh run_swift test -c "$BUILD_CONFIGURATION" run_swift build -c "$BUILD_CONFIGURATION"
@@ -0,0 +1,15 @@
1
+ # Source-side mutations for sites whose expectOrder operands are VARIABLES, so the offset-precise
2
+ # test-literal corruption cannot reach them. Occurrence indices are load-bearing.
3
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh SUBMITTED_PKG_SHA256="$(sha256_file "$PKG")" 1
4
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh "$STAGED_VERIFIER" assert-notary-log 1
5
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh --submitted-archive-sha256 "$SUBMITTED_PKG_SHA256" 1
6
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh /usr/bin/xcrun stapler staple 1
7
+ swap src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh --submission-id --submitted-archive-sha256
8
+ delete src/__tests__/macos-smoke-process-identity.test.ts uses challenge-bound completion with identity-verified failure cleanup src/native/Recordings/App/RecordingsApp.swift options: .atomic 2
9
+ duplicate src/__tests__/macos-smoke-process-identity.test.ts uses challenge-bound completion with identity-verified failure cleanup src/native/Recordings/App/RecordingsApp.swift Darwin._exit(0) 1
10
+ delete src/__tests__/macos-smoke-process-identity.test.ts uses challenge-bound completion with identity-verified failure cleanup scripts/smoke_macos_app.sh cleanup() 1
11
+ delete src/__tests__/macos-artifact-command-pinning.test.ts production requirement digests use the Darwin-pinned codesign executable scripts/macos_artifact.ts function assertFilesystemTree( 1
12
+ # The two residual vacuities the semantics reviewer found. Both PASSED before the fix; both must
13
+ # now be KILLED. Occurrence 1 is the authoritative site in each case.
14
+ delete src/__tests__/install-maintenance.test.ts orders exclusivity before recovery and the authoritative stopped-state copy scripts/install_macos_app.sh write_journal processes-stopped 1
15
+ delete src/__tests__/tailscale-cli-resolution.test.ts keeps all test app and tool overrides after the real Darwin branch scripts/resolve_tailscale_cli.sh codesign_executable="${RECORDINGS_TEST_TAILSCALE_CODESIGN_EXECUTABLE:-/usr/bin/codesign}" 1
@@ -0,0 +1,16 @@
1
+ delete src/__tests__/native-release-build-hardening-contract.test.ts normalizes umask-077 staging before nested signing and finalizes data before app signing src/native/Recordings/build.sh normalize_unsigned_app_bundle_modes "$APP_DIR" 1
2
+ delete src/__tests__/native-release-build-hardening-contract.test.ts normalizes umask-077 staging before nested signing and finalizes data before app signing src/native/Recordings/build.sh run_bun "$SOURCE_PACKAGE_ROOT/scripts/macos_artifact.ts" provenance 1
3
+ delete src/__tests__/native-release-build-hardening-contract.test.ts normalizes umask-077 staging before nested signing and finalizes data before app signing src/native/Recordings/build.sh run_codesign "${APP_SIGN_ARGUMENTS[@]}" 1
4
+ delete src/__tests__/native-release-build-hardening-contract.test.ts normalizes umask-077 staging before nested signing and finalizes data before app signing src/native/Recordings/build.sh run_codesign "${HELPER_SIGN_ARGUMENTS[@]}" 1
5
+ delete src/__tests__/native-release-build-hardening-contract.test.ts normalizes umask-077 staging before nested signing and finalizes data before app signing src/native/Recordings/build.sh run_sensitive_tool "$DITTO_EXECUTABLE" "$APP_DIR" "$OUTPUT_APP_DIR" 1
6
+ delete src/__tests__/native-release-build-hardening-contract.test.ts pins a clean full source revision before native compilation src/native/Recordings/build.sh run_swift build -c "$BUILD_CONFIGURATION" 1
7
+ delete src/__tests__/native-release-build-hardening-contract.test.ts pins a clean full source revision before native compilation src/native/Recordings/build.sh run_swift test -c "$BUILD_CONFIGURATION" 1
8
+ delete src/__tests__/native-release-build-hardening-contract.test.ts pins a validated macOS SDK sysroot before compiling the descriptor guard scripts/build_native_fs_guard.sh "$CLANG" "${COMMON[@]}" -arch arm64 1
9
+ delete src/__tests__/native-release-build-hardening-contract.test.ts pins bootstrap path tools before deriving the source tree src/native/Recordings/build.sh HOST_UNAME_EXECUTABLE="/usr/bin/uname" 1
10
+ delete src/__tests__/native-release-build-hardening-contract.test.ts pins bootstrap path tools before deriving the source tree src/native/Recordings/build.sh SYSTEM_DIRNAME_EXECUTABLE="/usr/bin/dirname" 1
11
+ delete src/__tests__/native-release-build-hardening-contract.test.ts pins bootstrap path tools before deriving the source tree src/native/Recordings/build.sh SYSTEM_PWD_EXECUTABLE="/bin/pwd" 1
12
+ delete src/__tests__/native-release-build-hardening-contract.test.ts ships a pinned universal descriptor guard and fails closed before installer mutation scripts/install_macos_app.sh "$BUN_EXECUTABLE" "$ARTIFACT_TOOL" native-fs-guard-check 1
13
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh "$STAGED_VERIFIER" assert-notary-log 1
14
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh --submitted-archive-sha256 "$SUBMITTED_PKG_SHA256" 1
15
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh SUBMITTED_PKG_SHA256="$(sha256_file "$PKG")" 1
16
+ delete src/__tests__/release-output-publication-contract.test.ts package notarization also verifies the log digest before stapling packaging/macos/build_release_pkg.sh /usr/bin/xcrun stapler staple 1
@@ -0,0 +1,61 @@
1
+ # Re-derivation battery for the version-site guards (todos 96546cc7), measured on 15303a6.
2
+ #
3
+ # Scope is named explicitly and EXCLUDES the three permanently-red files on this tree
4
+ # (macos-app-lifecycle.test.ts, native-app-companion-contract.test.ts, config.test.ts). An
5
+ # already-red target makes every mutation look caught -- the inverse trap. The driver's
6
+ # RED-ON-CLEAN control enforces that mechanically; the scope is written down so a reader can
7
+ # check it without running anything.
8
+ #
9
+ # Expected verdict for every row below is a kill, EXCEPT the rows explicitly marked
10
+ # MUST-SURVIVE or EXPECTED-SURVIVOR. The driver reports these kills as
11
+ # KILLED-UNATTRIBUTED because these guards assert with `expect` rather than emitting one of the
12
+ # GUARD_SIGNAL messages; attribution was completed by confirming each failure lands on the
13
+ # guard's own assertion line, not on an early throw. GUARD_SIGNAL was deliberately NOT widened
14
+ # to make this file exit 0 -- and, for the same reason must-survive-controls.tsv is not, this
15
+ # manifest is not wired into a package.json aggregate script.
16
+ #
17
+ # --- every version site agrees with package.json. Models 8de7068: one site bumped, the rest not.
18
+ duplicate src/__tests__/version-site-guard.test.ts agree in the working tree, on the version package.json declares src/version.ts .15 1
19
+ duplicate src/__tests__/version-site-guard.test.ts agree in the working tree, on the version package.json declares src/native/Recordings/RecordingsLib/Info.plist 0.2.15 1
20
+ duplicate src/__tests__/version-site-guard.test.ts agree in the working tree, on the version package.json declares src/native/Recordings/RecordingsLib/Info.plist 0.2.15 2
21
+ # --- a stale site is reported, not silently accepted: the mismatch filter removed.
22
+ delete src/__tests__/version-site-guard.test.ts a single stale site is reported rather than silently accepted scripts/set-version.ts .filter((reading) => reading.version !== expected) 1
23
+ # --- applyVersion writes every site in one pass: the per-file grouping removed.
24
+ delete src/__tests__/version-site-guard.test.ts applyVersion rewrites every site in one pass scripts/set-version.ts .filter((candidate) => candidate.file === file) 1
25
+ # --- A DROPPED SITE. The writer silently stops writing a plist key the release path reads, and
26
+ # every site that remains still agrees. Both rows SURVIVED the original assertions
27
+ # (`readings).toHaveLength(versionSites.length)` compares the array to its own source, and
28
+ # `not.toContain("0.0.1")` is satisfied by a key that was never written at all). They are the
29
+ # reason both assertions were re-pointed to independent literal expectations.
30
+ delete src/__tests__/version-site-guard.test.ts applyVersion rewrites every site in one pass scripts/set-version.ts {\n file: "src/native/Recordings/RecordingsLib/Info.plist",\n label: "Info.plist CFBundleVersion",\n pattern: /(<key>CFBundleVersion<\/key>\s*<string>)([^<]+)(<\/string>)/,\n },\n 1
31
+ delete src/__tests__/version-site-guard.test.ts agree in the working tree, on the version package.json declares scripts/set-version.ts {\n file: "src/native/Recordings/RecordingsLib/Info.plist",\n label: "Info.plist CFBundleVersion",\n pattern: /(<key>CFBundleVersion<\/key>\s*<string>)([^<]+)(<\/string>)/,\n },\n 1
32
+ # --- version-format rejection, one anchor at a time. Occurrence 5 of "^" and occurrence 1 of "$"
33
+ # are the two anchors in assertReleaseVersion; the indices are load-bearing. The "$" row SURVIVED
34
+ # until a junk-suffixed case was added, because `v1.2.3` binds only the leading anchor.
35
+ delete src/__tests__/version-site-guard.test.ts rejects versions the release path already refuses scripts/set-version.ts ^ 5
36
+ delete src/__tests__/version-site-guard.test.ts rejects versions the release path already refuses scripts/set-version.ts $ 1
37
+ # --- prepack wiring. Nothing asserted version:check was in prepack at all; the one prepack needle
38
+ # in the repo (native-release-build-hardening-contract's toStartWith) was broken outright by
39
+ # putting version:check ahead of the fail-closed macOS gate.
40
+ delete src/__tests__/version-site-guard.test.ts prepack checks the version sites after the platform gate and before the build package.json bun run version:check && 1
41
+ # --- MUST-SURVIVE CONTROL. A semantically neutral edit to the same file must NOT trip the guard.
42
+ # A battery with no surviving control cannot distinguish a guard from a checksum.
43
+ delete src/__tests__/version-site-guard.test.ts agree in the working tree, on the version package.json declares scripts/set-version.ts /** Label used in check output. */\n 1
44
+
45
+ # --- ADVERSARIAL REVIEW ADDITIONS (todos 96546cc7).
46
+ #
47
+ # The writer's OWN validation call. Deleting it left this whole file at 5 pass / 0 fail while
48
+ # `bun run version:set v9.9.9` exited 0 and wrote `v9.9.9` into all four sites, after which
49
+ # `version:check` reported them in agreement -- nothing else in the repo pins the version's
50
+ # FORMAT. The first row is the guard added to catch it; the two EXPECTED-SURVIVOR rows are the
51
+ # same mutation against the two pre-existing tests, kept because they are the measurement that
52
+ # neither one ever bound the writer.
53
+ delete src/__tests__/version-site-guard.test.ts the writer refuses a version the release path refuses, and writes nothing scripts/set-version.ts assertReleaseVersion(version);\n 1
54
+ # EXPECTED-SURVIVOR
55
+ delete src/__tests__/version-site-guard.test.ts rejects versions the release path already refuses scripts/set-version.ts assertReleaseVersion(version);\n 1
56
+ # EXPECTED-SURVIVOR
57
+ delete src/__tests__/version-site-guard.test.ts applyVersion rewrites every site in one pass scripts/set-version.ts assertReleaseVersion(version);\n 1
58
+ #
59
+ # The generated SDK's version stamp -- a fifth copy of the release version that `versionSites`
60
+ # deliberately does not write -- goes stale again.
61
+ delete src/__tests__/version-site-guard.test.ts the generated SDK header carries the version package.json declares src/sdk/v1.generated.ts .15 1