Skip to content

feat: implement artifact processing supervisors - #1523

Merged
Teingi merged 15 commits into
oceanbase:masterfrom
frf12:feat/rfc-1515-supervisor
Sep 9, 2026
Merged

Teingi merged 15 commits into
oceanbase:masterfrom
frf12:feat/rfc-1515-supervisor

Conversation

@frf12

@frf12 frf12 commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Implements the Artifact Processing Supervisor RFC in #1515, building on #1512.

Rationale for this change

Memory, Topic Memory, Experience, and Profile use separate background execution paths. A shared supervisor gives all four families durable requests, bounded scheduling, isolated Scope workers, and transactional completion so accepted work can recover after interruption.

What changes are included in this PR?

  • Persist processing intents, source dirtiness, scan checkpoints, and acknowledgments. Each family has independent concurrency limits, timeouts, bounded queues, and fair discovery. Support a global lease or dedicated leases per family.
  • Freeze finite Topic Memory targets at worker creation and preserve the cumulative budgets and retrieval integrity from fix(topic-memory): guard runtime profiles and reuse worker indexes #1512 through partial completion and replay.
  • Reconstruct worker identity and supported custom prompts; commit ownership, attestation, and processing completion atomically. Record Memory embedding usage.
  • Check enabled Profile Policy before automatic admission and authorization. Missing or disabled policies retain dirty Sources without creating automatic requests, retries, or Worker slot consumption; enabling Policy makes retained Sources eligible.
  • Keep Server authorization optional for SDK Topic workers. Validate unsupported custom Source registries before database bootstrap, so rejecting startup does not persist a deployment manifest that prevents a corrected restart. Preserve synchronous/API and custom-binding paths.
  • Add resumable maintenance migration, metrics, lifecycle tracing, regression coverage, and English/Chinese documentation.
  • Make processing regressions reliable under CI terminal formatting and asynchronous scan completion while preserving generation and checkpoint assertions.

Are there any user-facing changes?

Existing databases require offline migration through powercontext server processing-migrate plan/apply/verify. Stop old workers and pause writes and explicit triggers first. Switching supervisor mode also requires maintenance; mixed-mode rolling deployment is unsupported.

Family-specific concurrency and timeout settings replace shared settings. Legacy aliases remain supported; conflicting explicit values fail startup. SQLite and embedded SeekDB require a single-host all process; OceanBase supports separate API/background roles.

Built-in workers require reconstructible model configuration. Workers with Server security configured also require reconstructible authorization configuration. Built-in background workers require the supported built-in Source Definitions; unsupported custom registries fail at startup. Synchronous/API roles and fully custom processing bindings retain custom registry support. Synchronous API contracts, explicit Profile requests, and Profile/Experience review requirements are preserved. Configuration and migration documentation follows the current operate/ layout with redirects from old migration URLs.

How was this change tested?

Current HEAD: 2d3da2047714d77d722af4e2483a5336237dd49c. Local and real-backend checks ran directly on this revision; GitHub Actions tested its merge with master at 4043710abc5410f17c50d7e2a11d889732fbccd9.

  • make test: 1,983 passed, 60 optional tests skipped; make check: passed.
  • Startup registry/configuration regressions: 33 passed. Across four families and both supervisor modes, an unsupported registry leaves no database behind, and a corrected configuration opens the same path and reads/writes custom Sources. Successful deployment manifest changes still require maintenance.
  • Required real storage matrix: 80 passed, zero skipped (18 OceanBase, 16 embedded SeekDB, 26 SQLite, 20 composition contracts).
  • All 16 GitHub Actions checks and CLA passed, including Python 3.11–3.14, packages, native services, 47 contract tests, and documentation covering 777 public pages. Main CI, native services.
  • Real generation/embedding used deepseek-v4-flash-0731 and text-embedding-v4 with the supplied credentials:
Backend / mode Fresh four-family processing Confirmed-request replay
SQLite / global PASS 110.40s PASS 118.55s
embedded SeekDB / global PASS 163.65s PASS 128.34s
OceanBase / dedicated PASS 175.89s PASS 115.56s

All six runs verified persistent artifacts/candidates, custom prompts, ownership, Cursor/G acknowledgment, hybrid retrieval, and two Profile cron fires with missing/disabled Policy controls. Replays left all five recorded processing-purpose counters unchanged; explicit retrieval performs a separate recall embedding. Optional skips do not count toward required real-backend/provider acceptance. All 1,377 tracked files remained frozen during local validation.

Real-provider checks use reconstructible static-admin identity; enforced authorization ordering is covered by deterministic security regressions. Existing databases already initialized by an older failed startup retain the maintenance recovery requirement; this fix prevents unsupported registries from initializing new databases.

AI usage statement

OpenAI Codex (GPT-6) assisted with implementation, tests, documentation, and preparation of this PR.

@CLAassistant

CLAassistant commented Sep 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@frf12
frf12 force-pushed the feat/rfc-1515-supervisor branch from fe39d05 to 8f8bdb2 Compare September 9, 2026 06:00
@frf12 frf12 changed the title feat: implement artifact processing supervisors (POWE-113) feat: implement artifact processing supervisors Sep 9, 2026
@frf12
frf12 force-pushed the feat/rfc-1515-supervisor branch from dd87aa1 to dec1c55 Compare September 9, 2026 07:34
@frf12
frf12 force-pushed the feat/rfc-1515-supervisor branch from b350231 to b5cf4f6 Compare September 9, 2026 08:33
@Teingi
Teingi merged commit d46cb88 into oceanbase:master Sep 9, 2026
17 checks passed
@frf12
frf12 deleted the feat/rfc-1515-supervisor branch October 19, 2026 07:25
AlexStocks pushed a commit that referenced this pull request Nov 14, 2026
The Artifact Processing Supervisor replaced in-process APScheduler activation
in #1523, which also removed the only `start_scheduler` call. The scheduler
module, `BuiltinRuntime.start_scheduler`, the scheduled Source and Experience
processors, the access-scoped runners the Server factory built for them, and
the Scope enumeration helpers that only fed them were left without production
callers.

Remove that path and its tests. APScheduler stays a dependency because cron
bindings still parse expressions with `CronTrigger`.

`scheduler_path` on `open_builtin_runtime` and `create_server_app` is now
deprecated: it is ignored and emits a DeprecationWarning. The
`default_scheduler_path` helper and the `ScheduledSourceProcessor` and
`ScheduledExperienceProcessor` exports are removed. In-repository callers,
examples, and docs no longer pass or describe the scheduler sidecar.

The enforced-mode startup test now checks the background-principal guard
through the supervisor's worker security, where it applies, and separately
checks that a schedule without a runnable family is rejected at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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