/oracle-ai-data-platform-workbench-databricks-migrator:aidp-acceptance-contractfrom oracle-ai-data-platform-workbench-databricks-migrator
Declares acceptance contracts for batch/streaming pipelines requiring convergence verification. Passes only after K consecutive zero-result windows, useful for streaming jobs or slowly-draining backfills.
Ships in oracle-ai-data-platform-workbench-databricks-migrator. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
aidp-acceptance-contract — convergence verification for batch/streaming jobsA "no exception" pass is not enough for streaming or backfill pipelines. They might still be processing rows that haven't drained yet. This skill wires up a manifest-declared contract: PASS only after K consecutive empty-pending windows.
Not needed for plain ETL where success = "the saveAsTable finished".
1. Migrator runs the task's cells to completion (all PASS).
2. The task's acceptance contract then probes periodically (every `sleep_between_s` seconds).
3. Each probe runs `pending_count_sql` and checks `pending = 0`.
4. After `zero_window` consecutive zero-probes → the task keeps its PASS.
5. If we hit `max_attempts` without convergence → the task's status is demoted
from PASS to ACCEPTANCE_CONTRACT_VIOLATED (non-PASS; runner exits non-zero).
There is no --acceptance-contract CLI flag, and the migrator does not auto-load a YAML that happens to sit next to the manifest. The contract is read from the manifest itself: an acceptance_contract dict on the task entry (or on the job entry, as a fallback for every task) — see engine/scripts/acceptance_contract.py and its loading in job_migrate.py.
Edit reports/<MyJob>_manifest.json and add the key to the task that needs convergence:
{
"job_name": "<MyJob>",
"tasks": [
{
"task_key": "<task_key>",
"notebook_path": "...",
"acceptance_contract": {
"pending_count_sql": "SELECT COUNT(*) AS pending FROM <sandbox_schema>.<retry_queue_table> WHERE status = 'PENDING'",
"zero_window": 3,
"sleep_between_s": 30,
"max_attempts": 60
}
}
]
}
Recognized fields (anything else is ignored; a missing/empty pending_count_sql is a parse error):
| Field | Required | Default | Meaning |
|---|---|---|---|
pending_count_sql | yes | — | Query returning the pending count |
zero_window | no | 1 | K consecutive zero readings required |
sleep_between_s | no | 30 | Seconds between probes |
max_attempts | no | 10 | Give up after N probes → VIOLATED |
There is no task_key, cluster_id, or on_violation_log_path field — the contract is scoped by WHERE it sits in the manifest, probes run on the migrator's existing kernel session, and each attempt's count + the verdict land in JOB_REPORT.md.
Nothing extra to pass — run the migration normally and the contract on each task entry is picked up:
python3 ${CLAUDE_PLUGIN_ROOT}/engine/scripts/job_migrate_from_workflow.py \
--config <customer>.yaml \
--manifest reports/<MyJob>_manifest.json
Tasks without an acceptance_contract key are unaffected (default behavior — PASS = cells all green). The contract runs only if the task's cells all passed; it demotes, never promotes.
Put the key on a task entry to scope it to that task. A job-level acceptance_contract (on the job object) acts as the fallback for tasks that don't declare their own. Multiple tasks needing different convergence rules each carry their own acceptance_contract dict; contracts run after their respective tasks complete.
The verdict surfaces in two places:
[acceptance] attempt K/N: pending_count = ... lines, a reason + diagnostic on finish (e.g. "count stable at 42 across last 5 attempts — pipeline is stuck, not slow"), and an | acceptance: PASSED (K attempts) suffix on the task's RESULT: line.JOB_REPORT.md — the task's Status column in the Task Results table reads ACCEPTANCE_CONTRACT_VIOLATED when the contract did not converge (there is no separate acceptance table section).A contract result is PASSED / VIOLATED / ERROR (probe SQL itself failed — treated like a violation, with the error quoted). A VIOLATED or ERROR contract demotes that task's status from PASS to ACCEPTANCE_CONTRACT_VIOLATED regardless of cell-level success, and the runner exits non-zero.
pending_count_sqlSome rules of thumb for the query:
sleep_between_s. Add appropriate filters / partitions.Example shapes:
-- Streaming retry queue
SELECT COUNT(*) AS pending
FROM <sandbox_schema>.<retry_queue_table>
WHERE status IN ('PENDING','RETRYING')
AND ingest_ts > current_date - INTERVAL 1 DAY
-- Backfill progress
SELECT (target_count - processed_count) AS pending
FROM <sandbox_schema>.backfill_progress
WHERE backfill_id = '<id>'
-- Streaming watermark gap
SELECT GREATEST(
0,
CAST((unix_timestamp(current_timestamp()) - unix_timestamp(max(event_ts))) / 60 AS INT)
) AS pending
FROM <sandbox_schema>.<streaming_output_table>
pending_count_sql.aidp-fixup-cell.max_attempts), (b) the queue is genuinely stuck (data issue, scheduler issue), or (c) the contract is wrong (check the SQL).What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (oracle-samples/oracle-aidp-samples) — no native marketplace selected
npx claudepluginhub p/oracle-samples-oracle-ai-data-platform-workbench-databricks-migrator-ai-claude-code-plugins-oracle-ai-data-platform-workbench-databricks-migratorNone: SKILL.md is the whole skill.
11 skills in this plugin
/aidp-bucket-mappingConfigure the s3:// → oci:// bucket / namespace mapping the migrator uses to rewrite paths during notebook + catalog migration. Use when (a) the user has external tables / files at s3:// paths that need to land on OCI Object Storage, OR (b) check_data_availability reports s3:// paths as NOT FOUND because the bucket isn't mapped, OR (c) the DDL rewriter logs an R02_BUCKET_UNMAPPED warning./aidp-build-dagBuild a migration manifest (the execution DAG) from an AIDP workflow (exported from Databricks by dbx_export). Walks %run dependency chains, captures dbutils.notebook.run invocations, and emits reports/<job>_manifest.json — the input every other execute-skill consumes. Use when the user wants to see what would migrate, or before invoking aidp-migrate-job for the first time on a new workload./aidp-check-dataPre-migration data-availability scan. Reads every notebook in a migration manifest, extracts every spark.read.table / spark.read.parquet / saveAsTable reference, and probes whether each target schema/table/path exists on the AIDP cluster BEFORE you spend Pass-2 cluster time. Use after aidp-build-dag and before aidp-migrate-job, especially the first time you migrate against a target environment.Other plugins' skills for the same job