Skip to content

Commit 0055e7a

Browse files
committed
fix: pass real source attribution in _register_command_from_path
Instead of hardcoding source_id='reconciled', pass through the actual layer source (e.g., 'core', 'project override', 'extension:<id>') from collect_all_layers() so rendered command files show accurate provenance.
1 parent 506d9c3 commit 0055e7a

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/specify_cli/presets.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,8 @@ def _reconcile_composed_commands(self, command_names: List[str]) -> None:
661661
# Top layer is a non-preset source (extension, core, or
662662
# project override). Register directly from the layer path.
663663
self._register_command_from_path(
664-
registrar, cmd_name, top_path
664+
registrar, cmd_name, top_path,
665+
source_id=layers[0]["source"],
665666
)
666667
else:
667668
# Composed command — resolve from full stack
@@ -704,19 +705,27 @@ def _reconcile_composed_commands(self, command_names: List[str]) -> None:
704705
composed_file = shared_composed / f"{cmd_name}.md"
705706
composed_file.write_text(composed, encoding="utf-8")
706707
self._register_command_from_path(
707-
registrar, cmd_name, composed_file
708+
registrar, cmd_name, composed_file,
709+
source_id=layers[0]["source"],
708710
)
709711

710712
def _register_command_from_path(
711713
self,
712714
registrar: Any,
713715
cmd_name: str,
714716
cmd_path: Path,
717+
source_id: str = "reconciled",
715718
) -> None:
716719
"""Register a single command from a file path (non-preset source).
717720
718721
Used by reconciliation when the winning layer is an extension,
719722
core template, or project override rather than a preset.
723+
724+
Args:
725+
registrar: CommandRegistrar instance
726+
cmd_name: Command name
727+
cmd_path: Path to the command file
728+
source_id: Source attribution for rendered output
720729
"""
721730
if not cmd_path.exists():
722731
return
@@ -726,7 +735,7 @@ def _register_command_from_path(
726735
"file": cmd_path.name,
727736
}
728737
self._register_for_non_skill_agents(
729-
registrar, [cmd_tmpl], "reconciled", cmd_path.parent
738+
registrar, [cmd_tmpl], source_id, cmd_path.parent
730739
)
731740

732741
def _register_for_non_skill_agents(

0 commit comments

Comments
 (0)