Repository navigation
feat(desktop): pool workstream context across buckets and drop the base dwell to 2s - #11634
Conversation
…se dwell to 2s WORKSTREAM POOLING (flag-gated): extraction now labels each fact with a "workstream" — the durable project its content belongs to, judged by content rather than app, biased toward reusing the active label vocabulary quoted into the prompt. Labels survive ContextWorkstreamTag.sanitize (kebab-case, bounded, "unknown" abstains to nil) into a new bucket_facts.workstreamTag column. When the director evaluates a visit whose live tag resolves (own facts first, else an >=80% bucket majority of >=3 tagged facts), quality-gated validated facts from sibling buckets of that workstream (worthiness >= 0.3, scaffolding filtered, worthiness + 6h-half-life recency, max 3 per source bucket, top 8) are quoted into the volatile prompt as a non-citable RELATED WORKSTREAM CONTEXT section — pooled facts carry no refs, so delivery grounding stays own-bucket by construction. Delivery dedup widens to the workstream's sibling buckets under the same prompt cap. Flag ON for non-production (OMI_FORCE_BUCKET_WORKSTREAMS=0 to disable), OFF for production/beta until dogfood validates it. BASE DWELL 8s -> 2s: replayed against 2.5 days of live dogfood visits (2,127 visits, 200 buckets), 2s settle raises buckets that ever become notify-eligible from 77 to 141 and director runs with context from 458 to 814; budget gates bound the added volume. With the base equal to ContextDwellPolicy's shortened floor the cumulative-engagement policy became a no-op, so the policy, its store query, and its tests are removed rather than left as a dead layer. Verification: xcrun swift build -c debug clean; focused suites ContextWorkstreamPoolingTests (5), ContextProactivityEngineTests (22), ContextDepartureEvaluationStoreTests (2, incl. new cross-bucket integration test), ContextBucketSchemaTests (8) all pass. Full preflight and broader suites deliberately skipped per operator instruction. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
…dogfood flow Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
7 issues found across 11 files
Confidence score: 2/5
- In
desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextWorkstreamPooling.swift, pooled fact/app-name values can carry newlines into the related-workstream prompt block, which could forge header/instruction-like lines and steer model behavior unexpectedly — flatten/sanitize both fields before interpolation. - In
desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketsFeature.swift, external-preview bundles using production backend still enable pooling viaAppBuild.isNonProduction, so sibling facts can bleed into production-backed preview prompts — gate pooling on backend/environment so external previews are excluded unless explicitly allowed. - In
desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift, dedup/live-tag queries can include deliveries from the wrong workstream and select expired own-visit tags, which risks stale or cross-workstream context influencing outputs — filter by delivery provenance and add the live-fact expiry predicate withnowbinding. - In
desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swiftanddesktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextProactivityEngine.swift, generation is dropped across reads and pooled evaluations without sibling facts omit provenance, whiledesktop/macos/e2e/flows/context-buckets-dogfood.yamldoes not cover pooling paths — thread pool generation through reads, always record emptypooled_fact_ids, and add cross-app pooling assertions in dogfood e2e.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/e2e/flows/context-buckets-dogfood.yaml">
<violation number="1" location="desktop/macos/e2e/flows/context-buckets-dogfood.yaml:20">
P3: This dogfood flow's steps (S1–S7) exercise context identity, rollup, unified director delivery, task binding, privacy purge, and chat lookup, but none set up or validate cross-app workstream pooling — the RELATED WORKSTREAM CONTEXT director section, sibling-bucket tag gating, and pooled-fact dedup that ContextWorkstreamPooling implements. S1/S2 in fact assert the numbered documents stay context-separated, the opposite of pooling. Listing the file in covers claims e2e coverage the flow does not deliver, so operators trusting covers would believe pooling's director behavior was dogfooded when it wasn't. Add a step that creates facts in two sibling buckets of one workstream (across two apps) and verifies the pooling section appears, or drop the covers entry; the hermetic ContextWorkstreamPoolingTests cover the selection policy but not this live-tag/cross-bucket integration path.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextProactivityEngine.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextProactivityEngine.swift:267">
P3: When a live tag has no eligible sibling facts, provenance is omitted even though sibling dedup still runs. Record the tag with an empty `pooled_fact_ids` for every pooled evaluation.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextWorkstreamPooling.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextWorkstreamPooling.swift:133">
P2: A pooled fact or app name containing a newline can forge prompt headers or instruction-like lines in the related-workstream section. Flatten both values before interpolation so pooled context cannot alter the prompt structure.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketsFeature.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketsFeature.swift:116">
P2: When an external-preview bundle uses the production backend, `AppBuild.isNonProduction` is still true, so pooling defaults on and sibling facts reach production-backed preview prompts. Exclude external previews or require a development preview backend before enabling this flag.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift:464">
P2: When an own-visit tagged fact has expired, `liveWorkstreamTag` still selects its workstream because this query omits the expiry check. Add the live-fact predicate and bind `now`, otherwise an old tag can pull stale sibling context instead of using the current bucket state.</violation>
<violation number="2" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift:493">
P2: workstreamPool and recentDeliveredForWorkstream discard the pool generation (`(pool, _)`) and fetch from whatever pool is current at call time, while liveWorkstreamTag — the read that decides which owner's data to quote — is correctly gated with `generation == fence.poolEpoch`. These helper reads are called right after liveWorkstreamTag returns a tag, and a pool swap (account switch / database reopen, which increments poolEpoch) between the two calls can resolve the tag against a different owner's bucket_facts/proactive_deliveries, pulling that user's validated facts or delivery text into this visit's prompt. The downstream fenceFreshness/authorization guards mitigate the worst case, but the identity-bearing gate should be applied at the same read layer that resolves the data rather than relying on a later abort. Pass the fence (or its poolEpoch) into these reads and guard with `generation == fence.poolEpoch`, mirroring liveWorkstreamTag.</violation>
<violation number="3" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift:548">
P2: When a sibling bucket contains multiple workstream tags, this subquery causes deliveries from every workstream in that bucket to enter the requested tag's dedup context. Filter deliveries by their workstream provenance (or persist the tag on the delivery) before merging them, so a delivery for another workstream cannot displace or suppress relevant context.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| static func promptSection(tag: String, items: [ContextWorkstreamPoolItem], now: Date) -> String? { | ||
| guard !items.isEmpty else { return nil } | ||
| let lines = items.map { item in | ||
| "- [\(String(item.appName.prefix(24))), \(relativeAge(from: item.createdAt, now: now))] " |
There was a problem hiding this comment.
P2: A pooled fact or app name containing a newline can forge prompt headers or instruction-like lines in the related-workstream section. Flatten both values before interpolation so pooled context cannot alter the prompt structure.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextWorkstreamPooling.swift, line 133:
<comment>A pooled fact or app name containing a newline can forge prompt headers or instruction-like lines in the related-workstream section. Flatten both values before interpolation so pooled context cannot alter the prompt structure.</comment>
<file context>
@@ -0,0 +1,155 @@
+ static func promptSection(tag: String, items: [ContextWorkstreamPoolItem], now: Date) -> String? {
+ guard !items.isEmpty else { return nil }
+ let lines = items.map { item in
+ "- [\(String(item.appName.prefix(24))), \(relativeAge(from: item.createdAt, now: now))] "
+ + String(item.statement.prefix(300))
+ }
</file context>
| /// nothing ships dark to users this way. | ||
| @MainActor static var isWorkstreamPoolingEnabled: Bool { | ||
| guard isEnabled else { return false } | ||
| if AppBuild.isNonProduction { |
There was a problem hiding this comment.
P2: When an external-preview bundle uses the production backend, AppBuild.isNonProduction is still true, so pooling defaults on and sibling facts reach production-backed preview prompts. Exclude external previews or require a development preview backend before enabling this flag.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketsFeature.swift, line 116:
<comment>When an external-preview bundle uses the production backend, `AppBuild.isNonProduction` is still true, so pooling defaults on and sibling facts reach production-backed preview prompts. Exclude external previews or require a development preview backend before enabling this flag.</comment>
<file context>
@@ -101,4 +101,23 @@ enum ContextBucketsFeature {
+ /// nothing ships dark to users this way.
+ @MainActor static var isWorkstreamPoolingEnabled: Bool {
+ guard isEnabled else { return false }
+ if AppBuild.isNonProduction {
+ return ProcessInfo.processInfo.environment[localWorkstreamPoolingOverrideName] != "0"
+ }
</file context>
| if AppBuild.isNonProduction { | |
| if AppBuild.isNonProduction && (!AppBuild.isExternalPreview || AppBuild.externalPreviewBackend == .development) { |
| sql: """ | ||
| SELECT decisionType, message, deliveredAt FROM proactive_deliveries | ||
| WHERE bucketID <> ? | ||
| AND bucketID IN (SELECT DISTINCT bucketID FROM bucket_facts WHERE workstreamTag = ?) |
There was a problem hiding this comment.
P2: When a sibling bucket contains multiple workstream tags, this subquery causes deliveries from every workstream in that bucket to enter the requested tag's dedup context. Filter deliveries by their workstream provenance (or persist the tag on the delivery) before merging them, so a delivery for another workstream cannot displace or suppress relevant context.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift, line 548:
<comment>When a sibling bucket contains multiple workstream tags, this subquery causes deliveries from every workstream in that bucket to enter the requested tag's dedup context. Filter deliveries by their workstream provenance (or persist the tag on the delivery) before merging them, so a delivery for another workstream cannot displace or suppress relevant context.</comment>
<file context>
@@ -427,31 +427,133 @@ actor ContextBucketStore {
+ sql: """
+ SELECT decisionType, message, deliveredAt FROM proactive_deliveries
+ WHERE bucketID <> ?
+ AND bucketID IN (SELECT DISTINCT bucketID FROM bucket_facts WHERE workstreamTag = ?)
+ AND lifecycleState = 'delivered'
+ AND deliveredAt IS NOT NULL
</file context>
| SELECT f.workstreamTag AS tag, COUNT(*) AS n FROM bucket_facts f | ||
| JOIN bucket_entries e ON f.entryID = e.id | ||
| WHERE e.visitID = ? AND f.bucketID = ? AND f.validityState = 'validated' | ||
| AND f.workstreamTag IS NOT NULL |
There was a problem hiding this comment.
P2: When an own-visit tagged fact has expired, liveWorkstreamTag still selects its workstream because this query omits the expiry check. Add the live-fact predicate and bind now, otherwise an old tag can pull stale sibling context instead of using the current bucket state.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift, line 464:
<comment>When an own-visit tagged fact has expired, `liveWorkstreamTag` still selects its workstream because this query omits the expiry check. Add the live-fact predicate and bind `now`, otherwise an old tag can pull stale sibling context instead of using the current bucket state.</comment>
<file context>
@@ -427,31 +427,133 @@ actor ContextBucketStore {
+ SELECT f.workstreamTag AS tag, COUNT(*) AS n FROM bucket_facts f
+ JOIN bucket_entries e ON f.entryID = e.id
+ WHERE e.visitID = ? AND f.bucketID = ? AND f.validityState = 'validated'
+ AND f.workstreamTag IS NOT NULL
+ GROUP BY f.workstreamTag
+ """,
</file context>
| func workstreamPool( | ||
| tag: String, excludingBucketID: String, now: Date = Date() | ||
| ) async -> [ContextWorkstreamPoolItem] { | ||
| let (pool, _) = await RewindDatabase.shared.getDatabaseQueueWithGeneration() |
There was a problem hiding this comment.
P2: workstreamPool and recentDeliveredForWorkstream discard the pool generation ((pool, _)) and fetch from whatever pool is current at call time, while liveWorkstreamTag — the read that decides which owner's data to quote — is correctly gated with generation == fence.poolEpoch. These helper reads are called right after liveWorkstreamTag returns a tag, and a pool swap (account switch / database reopen, which increments poolEpoch) between the two calls can resolve the tag against a different owner's bucket_facts/proactive_deliveries, pulling that user's validated facts or delivery text into this visit's prompt. The downstream fenceFreshness/authorization guards mitigate the worst case, but the identity-bearing gate should be applied at the same read layer that resolves the data rather than relying on a later abort. Pass the fence (or its poolEpoch) into these reads and guard with generation == fence.poolEpoch, mirroring liveWorkstreamTag.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift, line 493:
<comment>workstreamPool and recentDeliveredForWorkstream discard the pool generation (`(pool, _)`) and fetch from whatever pool is current at call time, while liveWorkstreamTag — the read that decides which owner's data to quote — is correctly gated with `generation == fence.poolEpoch`. These helper reads are called right after liveWorkstreamTag returns a tag, and a pool swap (account switch / database reopen, which increments poolEpoch) between the two calls can resolve the tag against a different owner's bucket_facts/proactive_deliveries, pulling that user's validated facts or delivery text into this visit's prompt. The downstream fenceFreshness/authorization guards mitigate the worst case, but the identity-bearing gate should be applied at the same read layer that resolves the data rather than relying on a later abort. Pass the fence (or its poolEpoch) into these reads and guard with `generation == fence.poolEpoch`, mirroring liveWorkstreamTag.</comment>
<file context>
@@ -427,31 +427,133 @@ actor ContextBucketStore {
+ func workstreamPool(
+ tag: String, excludingBucketID: String, now: Date = Date()
+ ) async -> [ContextWorkstreamPoolItem] {
+ let (pool, _) = await RewindDatabase.shared.getDatabaseQueueWithGeneration()
+ guard let pool else { return [] }
+ return
</file context>
| - desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketRollup.swift | ||
| - desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketSchema.swift | ||
| - desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift | ||
| - desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextWorkstreamPooling.swift |
There was a problem hiding this comment.
P3: This dogfood flow's steps (S1–S7) exercise context identity, rollup, unified director delivery, task binding, privacy purge, and chat lookup, but none set up or validate cross-app workstream pooling — the RELATED WORKSTREAM CONTEXT director section, sibling-bucket tag gating, and pooled-fact dedup that ContextWorkstreamPooling implements. S1/S2 in fact assert the numbered documents stay context-separated, the opposite of pooling. Listing the file in covers claims e2e coverage the flow does not deliver, so operators trusting covers would believe pooling's director behavior was dogfooded when it wasn't. Add a step that creates facts in two sibling buckets of one workstream (across two apps) and verifies the pooling section appears, or drop the covers entry; the hermetic ContextWorkstreamPoolingTests cover the selection policy but not this live-tag/cross-bucket integration path.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/e2e/flows/context-buckets-dogfood.yaml, line 20:
<comment>This dogfood flow's steps (S1–S7) exercise context identity, rollup, unified director delivery, task binding, privacy purge, and chat lookup, but none set up or validate cross-app workstream pooling — the RELATED WORKSTREAM CONTEXT director section, sibling-bucket tag gating, and pooled-fact dedup that ContextWorkstreamPooling implements. S1/S2 in fact assert the numbered documents stay context-separated, the opposite of pooling. Listing the file in covers claims e2e coverage the flow does not deliver, so operators trusting covers would believe pooling's director behavior was dogfooded when it wasn't. Add a step that creates facts in two sibling buckets of one workstream (across two apps) and verifies the pooling section appears, or drop the covers entry; the hermetic ContextWorkstreamPoolingTests cover the selection policy but not this live-tag/cross-bucket integration path.</comment>
<file context>
@@ -17,6 +17,7 @@ covers:
- desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketRollup.swift
- desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketSchema.swift
- desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketStore.swift
+ - desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextWorkstreamPooling.swift
- desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextBucketsFeature.swift
- desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextDeliveryAuthority.swift
</file context>
| if !selected.isEmpty { | ||
| workstreamSection = ContextWorkstreamPooling.promptSection( | ||
| tag: liveTag, items: selected, now: currentFrame.captureTime) | ||
| workstreamProvenance = [ | ||
| "tag": liveTag, | ||
| "pooled_fact_ids": selected.map(\.factID), | ||
| ] | ||
| } |
There was a problem hiding this comment.
P3: When a live tag has no eligible sibling facts, provenance is omitted even though sibling dedup still runs. Record the tag with an empty pooled_fact_ids for every pooled evaluation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextProactivityEngine.swift, line 267:
<comment>When a live tag has no eligible sibling facts, provenance is omitted even though sibling dedup still runs. Record the tag with an empty `pooled_fact_ids` for every pooled evaluation.</comment>
<file context>
@@ -257,18 +246,54 @@ actor ContextProactivityEngine {
+ await store.workstreamPool(
+ tag: liveTag, excludingBucketID: snapshot.bucketID, now: currentFrame.captureTime),
+ now: currentFrame.captureTime)
+ if !selected.isEmpty {
+ workstreamSection = ContextWorkstreamPooling.promptSection(
+ tag: liveTag, items: selected, now: currentFrame.captureTime)
</file context>
| if !selected.isEmpty { | |
| workstreamSection = ContextWorkstreamPooling.promptSection( | |
| tag: liveTag, items: selected, now: currentFrame.captureTime) | |
| workstreamProvenance = [ | |
| "tag": liveTag, | |
| "pooled_fact_ids": selected.map(\.factID), | |
| ] | |
| } | |
| workstreamProvenance = [ | |
| "tag": liveTag, | |
| "pooled_fact_ids": selected.map(\.factID), | |
| ] | |
| if !selected.isEmpty { | |
| workstreamSection = ContextWorkstreamPooling.promptSection( | |
| tag: liveTag, items: selected, now: currentFrame.captureTime) | |
| } |
…truction (#11637) Unblocks the release train: #11634 changed the extraction prompt (workstream labeling block) but its focused test run missed this strict-equality golden, so `Desktop Swift Build & Tests` is red on main and the auto-release planner cannot tag a candidate. The golden now mirrors the new prompt exactly (empty-vocabulary `none yet` rendering included) and adds an assertion that a supplied vocabulary renders as `of the active labels: omi, spudpay.` Verification: `xcrun swift test --filter 'Context'` — all Context suites pass locally including the previously failing test. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/11637?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
…truction PR BasedHardware#11634 added the workstream-labeling block to the extraction prompt but missed this strict-equality golden in its focused test run, turning main's Desktop Swift Build & Tests red and blocking the release train's candidate tag. The golden now mirrors the new prompt (including the empty-vocabulary 'none yet' rendering) and additionally asserts the active-label list renders when a vocabulary is supplied. Verification: xcrun swift test --filter 'Context' — all suites pass locally, including the previously failing testExtractionPromptPreservesSafetyPreambleAndScreenshotEvidenceRef. Co-Authored-By: Claude Fable 5 <[email protected]>
What
Two locked-in outcomes from the context-buckets dogfood review (offline replay against 2.5 days of live data, 2,127 visits / 200 buckets / 2,945 validated facts):
1. Workstream pooling (flag-gated, non-prod on / prod+beta off). Extraction labels every fact with a
workstream— the durable project its content belongs to, judged by content rather than app, biased toward reusing the active label vocabulary quoted into the prompt. Labels surviveContextWorkstreamTag.sanitizeinto a newbucket_facts.workstreamTagcolumn (migrationaddBucketFactWorkstreamTag). At director time, the visit's live tag (own facts first, else a ≥80% bucket majority of ≥3 tagged facts) pulls quality-gated validated facts from sibling buckets of the same workstream into a non-citableRELATED WORKSTREAM CONTEXTsection of the volatile prompt: worthiness ≥ 0.3, scaffolding filtered, ranked by worthiness + 6h-half-life recency, max 3 per source bucket, top 8 (~300 tokens median in replay). Pooled facts carry no refs, so delivery grounding stays own-bucket by construction. Delivery dedup widens to the workstream's sibling buckets under the same prompt cap, and provenance records the tag plus pooled fact ids.2. Base dwell 8s → 2s. Replay: buckets that ever become notify-eligible 77 → 141; director runs with context 458 → 814; budget gates bound the added volume. With the base now equal to
ContextDwellPolicy's shortened floor, the cumulative-engagement policy became a no-op, so the policy, its store query, and its tests are removed rather than left as a dead layer.Deliberately not in this PR: browser destination-identity migration (rewrites stored identities; separate change).
Why
A single research task fragments across apps — in the replay corpus, one project (omi) spanned ~30 buckets in 6 apps, and each fragment had to independently earn its own second dwell before it could ever notify. Pooling makes the cross-app context collide: in the replayed real sequence (Telegram
omi pr reviews→ GitHub PR list → 26s read of PR #11613), the director's section would have carried the email question about the last Omi macOS release from one minute earlier plus the CI-watch work from the Claude session.Verification
xcrun swift build -c debug --package-path Desktopclean.ContextWorkstreamPoolingTests(5: sanitization, live-tag fallback, floor/scaffold/diversity gates, deterministic ranking, non-citable section),ContextProactivityEngineTests(22),ContextDepartureEvaluationStoreTests(2, incl. a new integration test proving tags persist throughwriteExtraction, resolve as the live tag, and pool across buckets with the weak/scaffolding facts dropped),ContextBucketSchemaTests(8, incl. new migration/column/index assertion).make preflightand broader suites were deliberately skipped; local pre-push gates (changelog, flow coverage, format/lint, test-quality) all passed on push.🤖 Generated with Claude Code