Skip to content

Preserve active indexing-v3 processing locks during strict-gate seeding - #162

Merged
BigSimmo merged 6 commits into
mainfrom
copilot/preserve-active-processing-locks
Jul 2, 2026
Merged

Preserve active indexing-v3 processing locks during strict-gate seeding#162
BigSimmo merged 6 commits into
mainfrom
copilot/preserve-active-processing-locks

Conversation

CopilotAI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Strict-gate repair could rewrite actively locked indexing_v3_agent_status='processing' rows to deferred/pending metadata during seeding, making them immediately claimable by another worker and duplicating enrichment work.
  • Behavior change (repair path): in repair_strict_enrichment_gate_batch, non-passed gate rows now preserve processing state when the existing indexing_v3_agent_locked_at is still within the active lock window; stale/missing locks continue to flow to deferred/pending.
  • Parity updates: applied the same logic in both migration SQL and supabase/schema.sql snapshot to prevent drift.
  • Regression guard: extended schema assertions to require the active-processing branch and enrichment_status='processing' preservation.
case
when coalesce(d.metadata->>'indexing_v3_agent_status', '') ='processing'and parsed_locked_at >= now() - v_processing_lock_timeout
then ... 'indexing_v3_agent_status', 'processing', 'enrichment_status', 'processing'
else ... 'indexing_v3_agent_status', 'deferred', 'enrichment_status', 'pending'
end

Verification

  • npm run verify:cheap
  • npm run verify:ui when UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changed
  • npm run verify:release before release or handoff confidence claims
  • npm run format:check
  • npm run check:production-readiness when clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changed
  • npm run check:deployment-readiness when deployment startup, hosting, or rollout behavior changed

Clinical Governance Preflight

Complete this section when the change touches ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Notes

  • Introduced a local timeout variable (v_processing_lock_timeout) to avoid hard-coded lock-window literals in the repaired function path.

CopilotAI changed the title [WIP] Fix active processing locks during seedingPreserve active indexing-v3 processing locks during strict-gate seedingJul 2, 2026
CopilotAI requested a review from BigSimmoJuly 2, 2026 10:10
@BigSimmo
BigSimmo marked this pull request as ready for review July 2, 2026 10:28
@BigSimmo
BigSimmo enabled auto-merge July 2, 2026 10:29

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:08fd5df4c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadsupabase/schema.sql

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:304caefa99

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

auto-merge was automatically disabled July 2, 2026 11:28

Head branch was pushed to by a user without write access

@BigSimmo
BigSimmo enabled auto-merge (squash) July 2, 2026 11:31
@BigSimmo
BigSimmo merged commit 2d203ac into mainJul 2, 2026
4 checks passed
@BigSimmo
BigSimmo deleted the copilot/preserve-active-processing-locks branch July 2, 2026 16:31
BigSimmo added a commit that referenced this pull request Aug 13, 2026
… state (#1839)
* feat(mockups): three runnable directions for the Tools search results state
`/tools?q=…` is rated an urgent redesign in the outstanding-issues ledger
(`#162`). The July 2026 study produced three static PNG comps and picked
direction A, but nothing runnable was ever built, so the pick had never been
read against live catalogue data.
Adds `/mockups/tools-search-directions`: one route, three stacked directions
for the submitted results state, each shown at phone 390 and desktop 1280.
- 01 Compact Results Instrument — query-as-h1, hero and quick-action grid
dropped on submit, filters folded onto the title row, dense rows whose
primary button launches the tool.
- 02 Ranked Clinical Brief — adopts `rankToolRecords` (already exported by the
catalogue, never called by this page) and promotes the top match into an
inline brief built from `bestFor` / `checkFirst` / `neededInput` / `output`.
- 03 Launch-First Triage Deck — no dialog at all; native `<details>` rows, and
the area filter and count fuse into one segmented band.
Frames are built from the real 13-record `src/lib/tools-catalog.ts`, so match
counts, orderings, badges and per-tool copy are genuine rather than fixtures.
Both demo queries are real: `monitoring` (3 substring matches vs 4 ranked —
today's matcher puts the exactly-named tool last) and `compare` (one match, the
reported screenshot).
Match-reason chips deliberately use categorical `--type-*` tones rather than the
`relevance.tsx` badges, whose `EvidenceRelevance` verdicts would print a
source-grounding claim where only a keyword hit exists.
Shared app chrome is suppressed for this route because every frame draws its own
top bar, composer and band; per `mockups/README.md` shared chrome is inherited or
suppressed, never forked into the page.
Scope is the results state only — no production surface changes, and the Tools
home redesign stays out per `#162`'s own stop rule.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCSWnNvh73Y3FG3oDj6rRi
* docs(ledger): record the tools search mockups review
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCSWnNvh73Y3FG3oDj6rRi
* fix(mockups): align tools search comparison evidence
* fix(mockups): update generated site map
* fix(mockups): format layout client
* fix(mockups): align tools study with submitted search
* test(mockups): pin submitted matcher and ranked filters
* style(mockups): format search direction regression test
* style(mockups): apply repository Prettier width
---------
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for freeto 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.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Preserve active processing locks during seeding**

2 participants

@BigSimmo