fix(codegen): internal floors render from the FLEXT line, never from the consumer (D14)

Merged
MA
3mo ago
+707-150

Summary

  • u.Infra.flext_integration_line: the FLEXT line (provider base URL + ref) is detected from the infrastructure checkout's own origin + integration branch, else from the single source every declared flext-* direct dependency shares, else from the owning workspace manifest member on that workspace's integration branch. Members declared from two lines in one document fail loud.
  • context_render renders flext_git_base_url/flext_git_branch from that line; repository_provider stays the repository's own identity only.
  • Reuses the unconsumed WorkspaceIntegrationSpec as the typed line (no new model, no catalog, no fallback).
  • ruff 0.16.8 format fixed point on 8 modules; docs wrap in search-first procedure.

Fixes the mixed-organization render that breaks make setup in ai-hub (datacosmos-br/dev) and algar-oud-mig (run 35465043047): floors rendered from the consumer's org while declared lines pointed at flext-sh, so uv rejected conflicting URLs and a corrected line was re-cemented on every gen.

Evidence

  • ruff check = 0 on the three touched files.
  • pytest tests/unit/codegen/test_codegen_catalog_extensions.py: 9 passed; test_local_manifest_conforms_without_global_repository_rows fails on the integration base itself (deps/phases/ensure_ruff.py:58 โ†’ detector manifest-vs-Git identity), no D14 frame on the stack โ€” routed to the identity-manifest owner on the coordination channel.

Bead: flext-itpd1.3

๐Ÿค– Generated with Claude Code


Summary by cubic

Fixes internal flext-* floors so they render from the FLEXT line of the infrastructure dependency instead of the consumer's own org and branch, which was producing mixed-organization sources that uv rejects. It also reads packaged Mise launcher seeds as immutable resources, makes mod repair report detection-only findings instead of failing, fixes the gitlink guard's diagnostic, and repairs two defects in the in-flight exports-manifest work.

FLEXT line and packaged seeds

  • u.Infra.flext_integration_line detects the line from the infra checkout's origin and integration branch, a declared direct flext-* Git source, or the owning workspace manifest; conflicting declarations fail loudly.
  • context_render uses that line for flext_git_base_url and flext_git_branch; repository_provider stays the repository's own identity.
  • Packaged launcher seeds are read with u.Cli.files_read_binary and staged as bytes; alias rejection stays intact for real write destinations.

Codegen, codemod, and setup

  • The exports manifest is read through u.Cli.files_read_yaml instead of a bare try/except around a local yaml import.
  • The lazy-init retry now checks the failure's error text, so concurrent input changes actually retry.
  • Adds codemod rules for the 2026-09-19 hand-edits: relative-fixture-import-depth rewrites parent fixture imports, packaged-resource-not-atomic-state flags atomic reads of package resources, and runtime-abc-needs-runtime-import flags isinstance ABCs without a runtime import; ast-grep rules can now declare a finding-count receipt in metadata.expected, so a rule that stops matching or over-matches fails loudly.
  • mod repair loops on actionable work only, reports detection-only residue for owner repair, and exits zero; the post-apply validation gate is unchanged.
  • The gitlink guard now names the checked-out branch and HEAD and tells the user to merge the superproject gitlink into it, so a lane on its stabilization branch no longer reads as if the integration branch were required.

Also in this PR (second theme, own commit 103edefc3)

fix(codegen): read packaged Mise launcher seeds as resources, not as uniquely owned atomic state โ€” root cause of the fleet-wide red gen fixed point in clean CI: uv hard-links installed package files to its cache (nlink 2), and the seed loader used u.Cli.atomic_read_binary_file_state, whose alias rejection exists for guarded-write preconditions. Package resources are immutable data: the receiver now reads them with u.Cli.files_read_binary and stages bytes; the destination keeps its atomic publication. flext-cli's alias rejection stays intact for real write destinations. Test proves the resource reader accepts a hard-linked file. Evidence: ruff 0, pyrefly 0, test_codegen_mise_artifacts.py 13 passed.