Skip to content

refactor(pipeline): step 5 — build-plane passes - #602

Merged
zaebee merged 4 commits into
mainfrom
feat/language-packs-step5
Oct 14, 2026
Merged

zaebee merged 4 commits into
mainfrom
feat/language-packs-step5

Conversation

@zaebee

@zaebee zaebee commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Step 5 of the language-packs migration (spec docs/specs/2026-10-14-language-packs-design.md "Build plane", plan docs/plans/2026-10-14-language-packs-step5.md, part of #146). The post-write passes live in the pipeline; the resolver no longer touches storage. No graph changes.

What moved

from to
src/cgis/pipeline.py src/cgis/pipeline/__init__.py — module stays cgis.pipeline, so all 32 importers are unchanged (no re-export; ruling P1)
src/cgis/resolver/uplift.py src/cgis/pipeline/uplift.py — 100% rename

refresh_dispatch was already the pipeline's; its pure half dispatch_edges(methods, inheritance) stays in the resolver (P2). The resolver-storage allowlist is empty (spec acceptance): no cgis.resolver module imports cgis.storage, TYPE_CHECKING included.

Identity

  • graph_identity.py diff, main 261cee3 vs this branch: cgis src/ @715cd9a identical (2019 / 7858), owner-api @8de2245 identical (19115 / 96258), ui/ identical (286 / 497).
  • The final reviewer ran old (261cee3) and new code on the same tree with --domains and dumped every node and edge column (domains, ontology_class, metadata, DOMAIN_DEPENDS_ON): identical. Wheel and sdist contain the new package.
  • A new test pins the post-write order (dispatch, then uplift), mutation-checked.

Self-graph ontology (fixed after review)

docs/ontology/domains.yaml still described the old layout: on the documented self-ingest the cgis.pipeline FILE node lost its domain, and every uplift node was tagged Pipeline and SemanticEngine (a false SemanticEngine → Pipeline domain edge). Pipeline now matches the package and owns the post-write passes; SemanticEngine drops its uplift patterns. Against main the only change is uplift's tag (SemanticEngine → Pipeline) and the SemanticEngine → StorageLayer domain edge disappearing — which is now true. Pinned by tests/self_parsing/test_domains_ontology.py.

Measurements and one re-baseline

  • pipeline drift 0.072 → 0.106, unresolved 0.402 → 0.398 (lock 0.25 / 0.43).
  • resolution drift 0.180 → 0.179, unresolved 0.440 → 0.452: uplift moved unchanged (28 unresolved of 70 calls, 0.40) out of a domain at 0.44, leaving 108/239 with no unresolved edge added. The plan stopped there; by decision the hygiene baseline went 0.45 → 0.46, with the arithmetic in patterns.yaml (the reviewer recounted it exactly). Nothing else was loosened.

Left for a follow-up (ruling P3)

Language knowledge still in cgis.resolver's text — the Python __init__ root rule in strip_layout_prefixes, the JS-builtins root in classify_fqn's generic tail, _is_dunder in DISPATCHES, and the language-named project state threaded through IndexBuilder.build. Removing them changes behaviour, so it should be its own measured change.

Deferred minors

  • The order test pins dispatch-before-uplift, not "after persist/record" — that half is guarded by test_cli::test_ingest_full_db_with_domains_runs_uplift.
  • Autodoc-owned HOW_IT_WORKS.md / pipeline_flow.mermaid and the demo ui/public/graph.json still name the old paths; they regenerate.

Gate: format, lint, mypy strict, 3231 passed, docstring 99%.

🤖 Generated with Claude Code

zaebee and others added 4 commits October 14, 2026 14:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ves into it

src/cgis/pipeline.py -> src/cgis/pipeline/__init__.py (the module stays
cgis.pipeline, so no importer changes; ruling P1) and resolver/uplift.py ->
pipeline/uplift.py. Uplift was the resolver's only reader and writer of the
store: the resolver-storage allowlist is empty (spec acceptance). A new test
pins the post-write order — refresh_dispatch, then uplift — mutation-checked.

Measured on a fresh ingest of src/: pipeline drift 0.072 -> 0.106, unresolved
0.402 -> 0.398 (lock 0.25/0.43); resolution drift 0.180 -> 0.179, unresolved
0.440 -> 0.452. The latter is a denominator effect — uplift moved unchanged
(28 unresolved of 70 calls, 0.40, under the domain's 0.44), leaving 108/239 with
no unresolved edge added — so resolution's hygiene baseline is re-baselined
0.45 -> 0.46 (user decision; reasoning in patterns.yaml).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… move

The documented self-ingest (`cgis ingest ./src --domains docs/ontology/domains.yaml`)
left the `cgis.pipeline` FILE node untagged — "*pipeline.py" no longer matches
pipeline/__init__.py, and "*pipeline.*" never matched the bare id — and tagged
every uplift node Pipeline *and* SemanticEngine, minting a
SemanticEngine -> Pipeline domain edge (final review, Important).

Pipeline now matches "*pipeline/*" and the bare `*pipeline` id, and owns the
post-write passes; SemanticEngine drops its uplift patterns. Against main the
only tag change is uplift: SemanticEngine -> Pipeline; the only domain edge
change is SemanticEngine -> StorageLayer disappearing, which is true — the
resolver no longer touches storage. Pinned by test_domains_ontology.py (RED
before). ONTOLOGY.md's live rule points at pipeline/uplift.py (minor).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request implements Step 5 of the Language Packs plan, refactoring the cgis.pipeline module into a package (cgis/pipeline/) and moving the semantic uplift module (uplift.py) from cgis/resolver/ to cgis/pipeline/. This change successfully decouples the resolver from storage operations, emptying the resolver-storage forbidden-edges allowlist. The PR also updates relevant documentation, domain configurations, and tests, including a new test to verify the order of post-write passes and a test suite for domain ontology tagging. No review comments were provided for this pull request.

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant