From 6561ccca7e5f25ebbf1c0871e998f41e6c2ad3ae Mon Sep 17 00:00:00 2001 From: jmpaz <30947643+jmpaz@users.noreply.github.com> Date: Wed, 8 Jul 2026 07:26:12 -0400 Subject: [PATCH 1/6] feat(manifest): make comments and order durable in the manifest source Adds an outline pass over the authored manifest text: components, groups, and files/repos/manifests members are walked in authored order with source line spans, block/end-of-line comments, and commented-out list items recognized as disabled members. Disabled members produce no payload and are never resolved (they were already invisible to the YAML parser); what's new is that they're now surfaced in index.json instead of silently discarded. Verbatim source preservation (58e0ee3) is extended to keep disabled members and their comments in hydrated `manifest.yaml` copies rather than stripping them, since they're deliberate authored curation. --- src/contextualize/manifest/hydrate.py | 2 + src/contextualize/manifest/source.py | 488 +++++++++++++++++++++++--- tests/test_hydrate_plugins.py | 67 ++++ tests/test_manifest_source.py | 27 +- 4 files changed, 539 insertions(+), 45 deletions(-) diff --git a/src/contextualize/manifest/hydrate.py b/src/contextualize/manifest/hydrate.py index dd3f06c..a5687cd 100644 --- a/src/contextualize/manifest/hydrate.py +++ b/src/contextualize/manifest/hydrate.py @@ -1006,6 +1006,8 @@ def build_hydration_plan_data( ) if manifest_source is not None: index_data["manifest_source"] = manifest_source + if manifest_format is not None and manifest_format.outline: + index_data["outline"] = manifest_format.outline index_text = _dump_index(index_data) files_to_write.append((context_dir / "index.json", index_text)) diff --git a/src/contextualize/manifest/source.py b/src/contextualize/manifest/source.py index 6e39400..4f8a3dc 100644 --- a/src/contextualize/manifest/source.py +++ b/src/contextualize/manifest/source.py @@ -8,7 +8,7 @@ import subprocess from dataclasses import dataclass from pathlib import Path -from typing import Any +from typing import Any, Iterator import yaml @@ -25,6 +25,7 @@ class ManifestFormat: line: int source_path: str | None group_slices: dict[tuple[str, ...], ManifestSlice] + outline: list[dict[str, Any]] @dataclass(frozen=True) @@ -39,6 +40,11 @@ class ManifestSource: r"(?ms)^```(?P