For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Upgrade DataOps data research into a tested, evidence-backed ingestion, data-element governance, and multi-domain ontology platform through V60-V65.
Architecture: PostgreSQL is the control-plane source of truth for jobs, evidence, candidates, reviews, immutable versions, and publication state. MinIO stores source artifacts, while Neo4j stores the active semantic projection; existing Outbox processing provides idempotent cross-store publication. A new /api/development/v1 boundary orchestrates existing datasource, metadata, business-domain, knowledge, and graph capabilities without removing legacy APIs.
Tech Stack: Python 3.11, Flask, Flask-SQLAlchemy, Alembic, PostgreSQL JSONB, Neo4j, MinIO, SQLAlchemy inspector/catalog queries, pandas/openpyxl, python-docx, pdfplumber, pluggable OCR, Vue 2/Vuetify, pytest.
/api/meta, /api/bd, /api/datasource, DataMeta, and BusinessDomain-[:INCLUDES]->DataMeta during compatibility migration.DataSourceConnectionManager.connect(uid, "metadata_collection"); never accept arbitrary metadata SQL from the client.app/ is primary source. Update deployment/app/ only through deployment/sync_release.sh at V65 release preparation.git diff --check.Files:
migrations/versions/20260722_100_data_research_ingestion.pyapp/models/data_research.pyapp/models/__init__.pytests/test_database_migrations.pytests/data_research/test_ingestion_models.pyInterfaces:
IngestionSource, IngestionJob, SourceArtifact, EvidenceFragment, ExtractionCandidate SQLAlchemy models.Produces: job statuses created, queued, extracting, normalizing, matching, awaiting_review, published, partial, failed, cancelled.
[x] Write migration contract tests asserting the five tables, UUID foreign keys, content-hash/parser-version idempotency key, JSONB evidence locator, status checks, and non-destructive downgrade.
[x] Run PYTHONPATH=. .venv/bin/pytest -q tests/test_database_migrations.py tests/data_research/test_ingestion_models.py and verify failure because the migration and models do not exist.
[x] Implement the additive migration and SQLAlchemy models with to_dict() methods that never serialize storage credentials or internal MinIO secrets.
[x] Rerun the focused tests and verify they pass.
Files:
app/core/data_research/__init__.pyapp/core/data_research/errors.pyapp/core/data_research/models.pyapp/core/data_research/repository.pyapp/core/data_research/ingestion.pytests/data_research/test_ingestion_service.pyInterfaces:
IngestionService.create_job(payload, actor_uid), transition(job_uid, target_status, statistics=None, error=None), retry(job_uid), and cancel(job_uid).Produces: IngestionJobSpec, JobTransition, and typed errors InvalidJobTransition, IngestionJobNotFound, IngestionPayloadInvalid.
[x] Write tests for deterministic idempotency keys, same-input job reuse, force-rerun behavior, allowed/forbidden transitions, retry from failed, cancellation, and redacted error serialization.
[x] Run PYTHONPATH=. .venv/bin/pytest -q tests/data_research/test_ingestion_service.py and verify failure because the service is absent.
[x] Implement pure transition rules and repository-injected orchestration; keep Flask globals out of the core service.
[x] Rerun the focused tests and verify they pass.
Files:
app/api/data_development/__init__.pyapp/api/data_development/routes.pyapp/__init__.pyapp/core/system/permissions.pyfrontend/src/api/dataDevelopment.jstests/data_research/test_development_api.pytests/data_research/test_development_frontend_contract.pytests/test_permission_matrix.pyInterfaces:
POST/GET /api/development/v1/ingestion-jobs, GET /ingestion-jobs/<uid>, POST /<uid>/retry, and POST /<uid>/cancel.Produces: permissions ingestion:run, ingestion:admin, evidence:download, data-elements:edit, data-elements:publish, ontologies:edit, ontologies:publish.
[x] Write API and permission tests for 401, 403, editor create/list, owner cancellation, admin retry, stable response envelopes, and secret-free payloads.
[x] Run the focused API/permission tests and verify missing blueprint/permissions failures.
[x] Register the blueprint, add monotonic role permissions, inject the service through a testable factory, and add frontend API wrappers.
[x] Run focused tests, regenerate docs/architecture/OPENAPI.yaml, then rerun architecture artifact tests.
PYTHONPATH=. .venv/bin/pytest -q tests/data_research tests/test_database_migrations.py tests/test_permission_matrix.py tests/test_architecture_artifacts.py.PYTHONPATH=. .venv/bin/pytest -q and git diff --check.docs/validation/data-research-v60.md and commit V60.Files:
app/core/data_research/extractors/base.pyapp/core/data_research/extractors/sql.pyapp/core/data_research/extractors/csv.pyapp/core/data_research/extractors/excel.pyapp/core/data_research/extractors/registry.pytests/data_research/test_structured_extractors.pyInterfaces:
Extractor.can_handle(media_type, filename), extract(stream, context) -> ExtractionBatch, and evidence locators sql.statement, csv.header, excel.sheet/cell_range.Consumes: existing DDLParser only as SQL fallback; deterministic extraction runs first.
[x] Write tests for dialect-preserving DDL, multi-table SQL, BOM/delimiter CSV, empty/header-only CSV, multi-sheet Excel, parser version, content hash, and exact evidence positions.
[x] Run the extractor tests and verify missing-registry failures.
[x] Implement bounded streaming extractors and registry selection without reading arbitrary large files into unbounded memory.
[x] Rerun focused tests and existing tests/test_ddl_parser_view.py.
Files:
app/core/data_research/catalog/base.pyapp/core/data_research/catalog/postgresql.pyapp/core/data_research/catalog/mysql.pyapp/core/data_research/catalog/service.pytests/data_research/test_catalog_collectors.pytests/integration/test_data_research_catalog.pyInterfaces:
CatalogCollectionService.collect(data_source_uid, scope) -> CatalogSnapshot and diff(previous, current) -> CatalogDiff.Consumes: DataSourceConnectionManager.connect(uid, "metadata_collection") and allowlisted schema/table filters.
[x] Write unit tests for generated allowlisted catalog statements, schema/table exclusions, stable field keys, no business-row reads, add/remove/type/rename diffs, and query timeout propagation.
[x] Run unit tests and verify missing collector failures.
[x] Implement dialect collectors and pure snapshot differ; never concatenate untrusted identifiers into SQL.
[x] Run unit tests and, when source containers are available, the integration catalog test.
Files:
app/core/data_research/data_elements.pyapp/core/data_research/candidate_decisions.pyapp/core/data_research/graph_projection.pyapp/api/data_development/routes.pyapp/models/data_research.pytests/data_research/test_data_element_lifecycle.pytests/data_research/test_candidate_decisions.pyInterfaces:
candidate -> draft -> in_review -> published -> deprecated -> retired.Produces: batch decisions reuse, create, map, ignore, and outbox event data_element.version_published.
[x] Write tests for required definitions, stable UID/version increments, optimistic concurrency, invalid lifecycle moves, batch decision atomicity, evidence retention, and no direct candidate publication.
[x] Run focused tests and verify missing service failures.
[x] Implement lifecycle/version services, extend API endpoints, and emit outbox events within the PostgreSQL transaction.
[x] Rerun focused tests plus outbox and cross-store consistency tests.
tests/core/data_source.git diff --check.docs/validation/data-research-v61.md and commit V61.Files:
app/core/data_research/extractors/docx.pyapp/core/data_research/extractors/pdf.pyapp/core/data_research/extractors/registry.pytests/data_research/test_document_extractors.pyInterfaces:
Produces evidence locators docx.paragraph/table/row/cell and pdf.page/table/bbox.
[x] Write in-memory fixture tests for paragraphs, tables, repeated headers, empty documents, page ordering, and exact evidence locations.
[x] Run focused tests and verify missing extractors.
[x] Implement structured extraction using python-docx and pdfplumber; return OCR-required classification when a PDF page has no usable text.
[x] Rerun focused tests and existing DDL document parser tests.
Files:
app/core/data_research/ocr/base.pyapp/core/data_research/ocr/http_provider.pyapp/core/data_research/ocr/service.pyapp/core/data_research/extractors/image.pytests/data_research/test_ocr_service.pytests/data_research/test_image_extractor.pyInterfaces:
OcrProvider.extract(image_bytes) -> list[OcrBlock] with text, normalized bounding box, page, and confidence.Produces: a fail-closed HTTP provider with configured endpoint, timeout, TLS verification, response-size limit, and no implicit external default.
[x] Write tests with a local fake provider for PNG/JPEG, multi-page scanned PDF page ordering, normalized boxes, low-confidence review flags, provider timeout, malformed response, and disabled-provider failure.
[x] Run tests and verify missing OCR interfaces.
[x] Implement provider abstraction, fail-closed configuration, image extractor, and scanned-PDF page handoff.
[x] Rerun focused tests and verify no source bytes or tokens appear in errors/logs.
Files:
app/core/data_research/file_policy.pyapp/core/data_research/artifacts.pyapp/api/data_development/routes.pyapp/config/config.pytests/data_research/test_file_policy.pytests/data_research/test_evidence_api.pyInterfaces:
Produces: POST /sources/files and permission-filtered GET /evidence/<uid>; full download requires evidence:download.
[x] Write tests for extension/MIME/magic agreement, size/page limits, legacy DOC rejection, hash deduplication, unsafe filenames, evidence redaction, and download permissions.
[x] Run focused tests and verify failures against current split policies.
[x] Implement the unified policy, MinIO gateway abstraction, artifact hash reuse, and redacted preview endpoint.
[x] Rerun focused tests plus datasource/file security regression tests.
git diff --check.docs/validation/data-research-v62.md and commit V62.Files:
migrations/versions/20260722_110_data_research_ontology.pyapp/models/data_research.pyapp/core/data_research/ontology/models.pyapp/core/data_research/ontology/repository.pytests/data_research/test_ontology_schema.pytests/data_research/test_ontology_repository.pyInterfaces:
Ontology, immutable OntologyVersion, OntologyChangeSet, and OntologyPublishRun.Produces graph document fields classes, properties, relations, constraints, domain_links, and element_mappings.
[x] Write schema and repository tests for unique ontology codes, immutable published versions, parent version, content hash, many-domain role links, and optimistic draft revisions.
[x] Run focused tests and verify missing schema/repository failures.
[x] Implement additive migration, dataclasses, canonical graph hashing, and repository operations.
[x] Rerun focused and migration tests.
Files:
app/core/data_research/ontology/validation.pyapp/core/data_research/ontology/publication.pyapp/core/data_research/ontology/projection.pytests/data_research/test_ontology_validation.pytests/data_research/test_ontology_publication.pyInterfaces:
Produces events ontology.version_published and ontology.rollback_version_created.
[x] Write tests for every validation code, publish idempotency, outbox atomicity, active-version projection, retryable Neo4j failure, version diff, and rollback-as-new-version behavior.
[x] Run focused tests and verify missing service failures.
[x] Implement pure validation, publish transaction, UID-based Neo4j projection, diff, and rollback version creation.
[x] Rerun focused tests plus cross-store/outbox tests.
Files:
app/api/data_development/routes.pyfrontend/src/api/dataDevelopment.jsfrontend/src/views/dataGovernance/ontology/index.vuefrontend/src/views/dataGovernance/ontology/workbench.vuefrontend/src/router/routes.jstests/data_research/test_ontology_api.pytests/data_research/test_ontology_frontend_contract.pyInterfaces:
/api/development/v1.Produces permission-gated ontology list and workbench routes.
[x] Write API tests for editor drafts, publisher release, multi-domain roles, ETag conflicts, validation errors, and viewer read-only behavior; write source contract tests for routes and secret-free rendering.
[x] Run focused tests and verify missing endpoints/pages.
[x] Implement API handlers and Vue pages with graph JSON editing/preview, validation panel, version diff, and publish confirmation.
[x] Run focused tests and frontend production build.
git diff --check.docs/validation/data-research-v63.md and commit V63.Files:
app/core/data_research/ontology/suggestions.pyapp/core/data_research/ontology/change_sets.pyapp/api/data_development/routes.pytests/data_research/test_ontology_suggestions.pytests/data_research/test_ontology_change_sets.pyInterfaces:
Produces decisions accept, reject, edit with actor, reason, evidence UIDs, confidence, and model/prompt version.
[x] Write tests for deterministic class/property/relation proposals, evidence-required AI proposals, confidence ordering, conflict detection, partial decisions, and the guarantee that undecided suggestions never publish.
[x] Run focused tests and verify missing services.
[x] Implement rule suggestions, injected AI suggestion port, immutable decision audit, and accepted-change application to a draft version.
[x] Rerun focused tests and ontology publication regressions.
Files:
app/core/data_research/ontology/exchange.pyapp/core/data_research/ontology/knowledge_sync.pyapp/api/data_development/routes.pytests/data_research/test_ontology_exchange.pytests/data_research/test_ontology_knowledge_sync.pyInterfaces:
Consumes: app/core/knowledge/document_builder.py; produces versioned governance documents only for published ontology versions.
[x] Write round-trip tests for classes/properties/relations/domain links, unsafe XML rejection, import size limits, deterministic hashes, secret redaction, and knowledge-document version/hash behavior.
[x] Run focused tests and verify missing exchange/sync modules.
[x] Implement bounded import/export, canonical namespaces, publication-triggered knowledge documents, and idempotent chunk sync.
[x] Rerun focused tests plus governance document builder tests.
Files:
app/core/data_research/ontology/query.pyapp/api/data_development/routes.pyapp/core/mcp/context.pytests/data_research/test_semantic_query.pytests/mcp/test_data_research_context.pyInterfaces:
Produces MCP context tools that return published data only and enforce permission scope.
[x] Write tests for bounded traversal, unpublished exclusion, permission filtering, stable pagination, no arbitrary Cypher input, and MCP result redaction.
[x] Run focused tests and verify missing query/tool behavior.
[x] Implement allowlisted query methods and MCP context adapters.
[x] Rerun focused tests and existing MCP security/runtime suites.
docs/validation/data-research-v64.md and commit V64.Files:
app/core/data_research/operations.pyapp/commands/reconcile_data_research.pyapp/core/system/health.pytests/data_research/test_operations.pytests/integration/test_data_research_reconciliation.pyInterfaces:
Produces reconciliation reports for PostgreSQL versions, Neo4j active projections, MinIO artifacts, and governance documents.
[ ] Write tests for concurrency/resource limits, stale-job recovery, dead-letter reporting, projection mismatch repair plans, artifact-missing detection, and secret-free health output.
[ ] Run focused tests and verify missing operations module.
[ ] Implement bounded counters, recovery transitions, read-only audit, explicit repair mode, and health component.
[ ] Rerun focused tests plus health/outbox tests.
Files:
frontend/src/views/dataGovernance/development/index.vuefrontend/src/views/dataGovernance/development/ingestion.vuefrontend/src/views/dataGovernance/development/tasks.vuefrontend/src/views/dataGovernance/development/review.vuefrontend/src/views/dataGovernance/metadata/index.vuefrontend/src/router/routes.jstests/data_research/test_data_research_frontend_contract.pyInterfaces:
Produces source selection, scope configuration, upload, progress, evidence preview, batch decisions, data-element lifecycle, ontology generation, validation, publish, and rollback navigation.
[ ] Write frontend source-contract tests for every required route/API/permission, supported format copy, evidence navigation, status labels, no credential fields, and viewer read-only controls.
[ ] Run focused tests and verify missing pages/contracts.
[ ] Implement Vue 2 pages using existing list/dialog/form patterns and permission metadata.
[ ] Run focused tests and npm --prefix frontend run build with Node 24.
Files:
tests/acceptance/test_data_research_v60_v65.pydocs/validation/data-research-v60-v65-acceptance.mddocs/architecture/ARCHITECTURE_OVERVIEW.mddocs/architecture/DATA_MODEL.mddocs/architecture/NEXT_ITERATION_ROADMAP.mddocs/architecture/OPENAPI.yamldeployment/app/ via deployment/sync_release.shInterfaces:
Produces one acceptance entry point covering source ingestion, evidence, data-element publication, two-domain ontology, dynamic change set, publish, rollback, knowledge sync, RBAC, reconciliation, and redaction.
[ ] Write acceptance tests that initially fail on any missing V60-V65 capability and use deterministic fixtures/fake OCR/AI ports while exercising real Flask services and persistence contracts.
[ ] Run PYTHONPATH=. .venv/bin/pytest -q tests/acceptance/test_data_research_v60_v65.py and verify requirement-specific failures before final wiring.
[ ] Complete release wiring, regenerate OpenAPI, run deployment/sync_release.sh, and verify diff -qr app deployment/app is empty for application source.
[ ] Run the final acceptance matrix below and record exact commands, counts, skips, build output, and environment-limited checks in the acceptance document.
PYTHONPATH=. .venv/bin/pytest -q tests/data_research tests/acceptance/test_data_research_v60_v65.pyPYTHONPATH=. .venv/bin/pytest -qnpm --prefix frontend run buildpython scripts/generate_openapi.py --output docs/architecture/OPENAPI.yaml followed by PYTHONPATH=. .venv/bin/pytest -q tests/test_architecture_artifacts.py.diff -qr app deployment/app and git diff --check.deploy/docker/docker-compose.yml.