Skip to content

A human phrase decision materializes ahead of queued model work - #1358

Open
Aschenbath wants to merge 1 commit into
deeplethe:devfrom
Aschenbath:feat/materialize-intake-1351
Open

Aschenbath wants to merge 1 commit into
deeplethe:devfrom
Aschenbath:feat/materialize-intake-1351

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Why

A person’s phrase decision queues materialize_typed, but that store-only job currently waits behind extraction and cannot use the two worker slots reserved for intake.

Closes #1351.

What changes

  • Classify materialize_typed as intake and rebuild the priority index so existing queued jobs receive the new priority.
  • Keep the CLI schema count in sync. Migration 0118 avoids 0117 already used by open PR feat: let bases opt into grounded mapping confirmation #1332.
  • Extend claim-order and saturated-worker coverage, and test upgrading an index that already contains queued materialization. The other registered job kinds were checked against their handlers.

How it was checked

On Linux x86_64 with Rust 1.99.1 and PostgreSQL 16.15, for commit 0f90734:

  • cargo fmt --all --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo test --locked --workspace: 1,653 passed, 0 failed, 6 existing ignored tests, with UTOPIA_DATABASE_URL, UTOPIA_TEST_REQUIRE_DB=1, UTOPIA_TEST_REQUIRE_PDFTOTEXT=1 and RUST_TEST_THREADS=1 set against a freshly migrated UTF-8 database.
  • Verified the upgrade regression’s index scan separately: removing REINDEX returned no eligible queued materialization; the complete migration returned materialize_typed.

Before review

  • Every commit is signed off.
  • Formatting, strict workspace clippy and workspace tests pass.
  • Database-backed SQL tests ran with a database and the required-database guard enabled.
  • The migration uses the next free number and the CLI schema version equals the 105 migration files.

Signed-off-by: Aschenbath <Aschenbath@users.noreply.github.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change itself is right: CREATE OR REPLACE on the immutable function leaves stale index keys, REINDEX INDEX rebuilds them and is safe inside the migration transaction, and the handler makes no model call. Two things:

  • Migration number: 0118 is also claimed by #1334, which is older and about to land. Renumber this to 0119 and update the two include_str! paths in jobs_claim_tests.rs (lines ~44 and ~66) that name the file; the CLI schema count follows whatever the file count is at merge time.
  • Commit message: one English sentence, no fix: prefix, and the same sentence as the PR title. The test file tests/a_sync_runs_while_model_work_holds_every_slot.rs now holds intake_runs_while_…; rename the file to match.

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.

2 participants