test(tangle-cli): guard tangle-deploy pipeline-compile compat surface#31
Conversation
Extend the tangle-deploy import-compat guard to cover the compile driver migrated into OSS: the python_pipeline DSL submodules, schema_validation, and pipeline_compiler (compile_pipeline, CompileResult, and the PipelineCompiler(TangleCliHandler) executor). These are the exact tangle_cli.* symbols the internal `tangle-deploy pipeline compile from-python` command will import once it delegates here. Also guard the ZONE_ROOT_MARKERS seam: OSS ships it empty and it must be a mutable list so a downstream distribution (tangle-deploy) can append its own zone-root marker, mirroring the existing mutable-CI-vars provider-override contract. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Volv-G
left a comment
There was a problem hiding this comment.
(AI-assisted) Reviewed — clean, test-only PR that hardens the Phase-3 migration seam.
It pins the exact tangle_cli.* compile surface tangle-deploy will import once pipeline compile from-python delegates to the OSS driver, plus the key structural contracts (PipelineCompiler subclasses TangleCliHandler + exposes compile_file; ZONE_ROOT_MARKERS is an empty-in-OSS mutable list). The seam test appends/asserts/restores cleanly (try/finally + [:] = original), leaving no global state. Good safety net so an OSS refactor breaks here rather than downstream at the submodule bump.
Two non-blocking notes: it guards several private underscore symbols (intentional, but formalizes a downstream dependency on OSS internals — they can't be renamed without a coordinated bump), and it's an existence/callability guard rather than a signature-level one (a param change to compile_pipeline/compile_file wouldn't trip it). Both fine for the stated purpose.
LGTM.
What
Extends
tests/test_tangle_deploy_compat_imports.pyto guard the pipeline-compile surface that the internaltangle-deploypackage will consume fromtangle_clionce itspipeline compile from-pythoncommand delegates to the OSS driver (merged in #28).This is the OSS-side of Phase 3 of the compile migration. The compat file already pins the general
tangle_cli.*surface TD imports; this adds the compile symbols so any future OSS refactor that would break TD's delegation fails here, in this repo, rather than downstream at the submodule bump.Guarded surface (all import + assert)
python_pipelineDSL:cfg(Cfg,load_cfg,_coerce_override),compiler_context(BroadcastLayer,CompileContext,PipelineCompileKey,canonical_repo_path,overrides_fingerprint),emit(emit_pipeline,_TASK_URL_PLACEHOLDER),errors.CompileError,pipeline.PipelineFn,ref.CallableRef,registered._REGISTERED_URL_PLACEHOLDER,subpipeline(SubpipelineRef,_SUBPIPELINE_URL_PLACEHOLDER),trace.trace_pipeline,types.Inschema_validation:SchemaValidationError,validate_dehydrated_pipelinepipeline_compiler:compile_pipeline,CompileResult,PipelineCompiler(asserts it subclassesTangleCliHandlerand exposescompile_file),ZONE_ROOT_MARKERSSeam test
test_zone_root_markers_seam_is_empty_and_mutable_for_downstreampins the contract the discovery-side delegation depends on: OSS shipsZONE_ROOT_MARKERS == [], and it's a mutable module-level list a downstream distribution appends its own zone-root marker to (e.g. the oasis component-root marker) — mirroring the existing mutable-CI-vars provider-override contract already guarded in this file. The test appends/asserts/restores so it leaves no global state behind.Testing
uv run pytest tests/test_tangle_deploy_compat_imports.py→ 4 passed (2 existing + 2 new)uv lock --checkclean,git diff --checkclean🤖 Generated with Claude Code