Skip to content

fix: close proactive follow-up decision gaps - #11873

Merged
Git-on-my-level merged 4 commits into
mainfrom
fix/proactive-followup-platonic
Aug 19, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
fix/proactive-followup-platonic

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Summary

This closes the actionable follow-ups from #11844 and #11866 without reopening their settled conclusions:

  • turn the materialization drop-rate instrument into a weekly, routed decision review;
  • improve referent supply at the extraction boundary, while leaving fact validity and the director cache prefix alone; and
  • make the preflight runner survive temporary backpressure from an inherited non-blocking output pipe.

Failure-Class: none

Issue 1 — materialization data gets a forcing function

Chosen

The existing report is now a reusable production module as well as an operator CLI. The hourly notifications-job calls it off the event loop; it does no Firestore work except during the fixed Monday 14:00 UTC slot. The classification remains the one established in #11866: delivered is acknowledged, ready/pending_kernel_receipt older than 48 hours is dropped, younger rows are in flight, and malformed undated rows are separate.

Every due run emits one content-free aggregate verdict with review=true, including a healthy zero-drop verdict. A production notifications-job deploy idempotently creates or updates a Cloud Logging metric and a Cloud Monitoring policy routed to the repository's existing SYNC_BACKFILL_ALERT_NOTIFICATION_CHANNELS contract; it fails the deploy if the channel list is empty or the resulting policy has no channel. This is intentionally a decision-review signal rather than only a failure alarm: a 0% result must reach a human too, otherwise the deferred server-materialization decision can still disappear into silence. Durable drops and monitor failures log at error; full source and block-type breakdowns remain in the explicit CLI rather than becoming dynamic log labels.

This is the long-term seam I would keep: the already-scheduled notification worker owns a related read-only operational check, the expensive collection-group scan runs weekly rather than hourly, the runtime log is bounded and content-free, and the deploy workflow reconciles the human route instead of assuming somebody created it by hand.

Rejected

  • Prometheus remains the wrong path: the in-process API counter has no production scrape/consumer path.
  • A scheduled GitHub workflow would not be autonomous. Live repository inspection showed the prod environment has required reviewers and the read-only Firestore credential, so an unattended schedule would stop at environment approval before it could produce the number.
  • Cloud Tasks supplies execution, not a human sink, and there is no request whose lifecycle owns this weekly review. A separate Cloud Run job would duplicate the notifications job's Firestore runtime, deployment, schedule, and alert plumbing without creating a better ownership boundary.
  • Alerting only on non-zero drops was rejected because it preserves the original drift failure for the healthy case.

The Cloud Monitoring resources were not applied from this branch. The next production notifications-job deployment performs and verifies that reconciliation; local gcloud production inspection was unavailable because the workstation credential could not be refreshed non-interactively.

Issue 2 — referents are supplied during extraction

Chosen

The extraction prompt and the structured-output descriptions now carry the same cross-field contract. When the screen supplies a specific person, PR/ticket and repository, thread subject, document, file/branch, or meeting name/time, extraction must copy that wording into the fact statement and evidence and mirror the same strings into identifiers. When the screen supplies no identifier, identifiers stays empty and the fact describes only supplied context; invention remains forbidden.

Both halves are deliberate. The prior director repair showed that schema descriptions and prompt instructions reinforce different parts of structured output, while the recorded 39-screen residual showed the fields were disagreeing. The regression test inspects all three schema fields so a later edit cannot quietly return to a single-field hint.

Fact validity is unchanged and still checks evidence resolution only. The director prompt and directorStablePrompt bytes are unchanged, so the cached director prefix is byte-identical. Extraction does not pass a cache key, so changing its prompt/schema does not invalidate a provider prompt-cache prefix.

Rejected

  • Carrying stored identifiersJson into the director remains a proven no-op because accepted identifiers are already substrings of emitted evidence.
  • Retuning the director was rejected because the 69-run baseline already named every supplied referent; supply, not selection, is the measured bottleneck.
  • An identifier validity gate was rejected because it previously demoted 1,083/1,085 facts on identifiers alone and would destroy evidence-backed facts again.
  • Inferring a handle absent from the capture was rejected as fabrication; the no-identifier fallback is explicit.

The committed offline benchmark contract passes, including the two guard-case mappings. I did not claim a new live-model measurement: the isolated local harness had no running container runtime or provider credentials, while the remote-dev launcher explicitly uses production-backed Firebase identity/data. The live --invoke replay was therefore not run. The focused Swift production/test build did run, and all 29 ContextBucketPromptAssemblerTests passed.

Issue 3 — checks must produce honest outcomes

Chosen in this PR

preflight_runner.py now treats BlockingIOError from stdout/stderr.flush() as temporary backpressure. On POSIX it waits for the inherited descriptor to become writable and retries the same buffered flush; the portable fallback uses the runner's bounded polling interval, and InterruptedError retries immediately. The regression test reproduces the observed Errno 35 twice before success. No gate is skipped, downgraded, or made quieter.

Deliberately not changed here: Desktop Swift runner governance

The evidence does not support a workflow code fix for a check that literally never renders. On #11844, Desktop Swift Static & Test Contracts started within seconds and ended after about 66.6 minutes (failed, after merge). On #11866 it waited about 45 minutes for a runner, then completed successfully about 39 minutes later (also after merge). Live branch-protection inspection returned required_status_checks: null for main.

That makes the durable defect repository governance: maintainers can merge before the stable aggregate Desktop Swift Build & Tests has published a verdict. Changing test commands, splitting the job, or weakening parallelism would not make anyone wait for it and would risk hiding the two suites under investigation. The long-term fix is an external GitHub ruleset/branch-protection change requiring that aggregate check once its current flaky failure class is repaired. Repository settings are not versioned by this PR, so I am explicitly leaving that operation out rather than pretending a workflow edit solves it.

Verification completed before the full gates

  • python3 .github/scripts/test_preflight_runner.py — 25 tests passed, 6 skipped.
  • Focused backend files through backend/test.sh — 12 materialization-report tests and 5 notifications-job orchestrator tests passed.
  • ./scripts/dev-feedback.py --once swift 'ContextBucketPromptAssemblerTests' — 29 tests passed after a full Swift production/test build.
  • desktop/macos/scripts/agent-logic-harness.sh --cross-surface-smoke — Swift and agent cross-surface contracts passed.
  • bash desktop/macos/tests/test-context-bucket-benchmark.sh — 34 fixture contracts and 24 director mappings passed; this is the offline contract, not a live model replay.
  • actionlint .github/workflows/gcp_notifications_job.yml — passed.
  • OMI_PR_BODY_FILE=/tmp/omi-proactive-followup-pr.md make preflight — all 40 checks selected by the current local manifest passed.
  • OMI_PR_BODY_FILE=/tmp/omi-proactive-followup-pr.md bash scripts/pre-push origin < /dev/null — the real, broader pre-push gate exited successfully.
  • cd backend && bash scripts/typecheck.sh — the final strict run completed with 0 errors and 3,667 pre-existing warnings.

🤖 Generated with Claude Code

Review in cubic

Git-on-my-level and others added 4 commits August 19, 2026 15:09
Run the existing read-only materialization report once a week inside the hourly notifications job, off the event loop. Every bounded aggregate verdict is routed through a reconciled Cloud Logging metric and Cloud Monitoring policy so even a zero-drop result reaches the existing production notification channels instead of disappearing into logs.

Keep the operator CLI as the detailed source/block-type view, alarm on durable drops and malformed undated rows, and redact record contents from the scheduled log.

Co-Authored-By: Claude Opus 5 <[email protected]>
Make referent supply a cross-field extraction contract: when the captured screen provides a specific subject, the statement, evidence text, and identifiers schema all require the same copied name or handle. Empty identifiers remain valid when the screen supplies none, and validity remains evidence-only so the retired destructive identifier gate does not return.

The director stable prompt is unchanged; only the uncached extraction prompt and extraction schema change.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
Treat an inherited full non-blocking stdout or stderr pipe as backpressure, not a failed validation. Wait for POSIX pipe capacity and retry the buffered flush, with the portable short-wait fallback where descriptors cannot be selected; interrupted flushes retry immediately.

Regression tests reproduce the observed Errno 35 twice before a successful flush.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
Declare the existing SYNC_BACKFILL_ALERT_NOTIFICATION_CHANNELS GitHub variable as deployment configuration so the notifications-job workflow can reuse the established Cloud Monitoring route without crossing the secret boundary.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 7d7157b into main Aug 19, 2026
44 of 47 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/proactive-followup-platonic branch August 19, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant