You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: ForgeIntegration._apply_forge_transformations corrupts frontmatter with blank lines in handoffs or nested name keys #5589
ForgeIntegration._apply_forge_transformations() in src/specify_cli/integrations/forge/__init__.py uses a line scanner that mishandles valid YAML frontmatter in two ways:
Blank lines inside a handoffs: block produce invalid YAML.
Lines 228-233 exit skip_until_outdent on any line whose first character is not a space or tab, including blank lines separating handoffs: list entries. All subsequent indented handoffs: items are then emitted verbatim at the top level of frontmatter after the blank line, causing yaml.safe_load() to fail with ScannerError: mapping values are not allowed here and leaving incompatible handoffs entries in the generated Forge command file.
Indented nested keys are matched as top-level name: / handoffs:.
Lines 235 and 242 call line.strip().startswith('handoffs:') and line.strip().startswith('name:') without checking column-0 indentation. As a result, a nested mapping containing name: (for example metadata:\n name: custom) prevents injecting the required top-level name: speckit-<cmd> key, and an indented nested handoffs: sub-key is silently deleted.
Strip only a top-level handoffs: block, continuing across blank lines inside that block so valid YAML is emitted and subsequent top-level keys remain intact.
Check only top-level name: when deciding whether to inject name: speckit-<cmd>, preserving existing top-level name: values and leaving nested mappings untouched.
Disclosure
This issue was discovered and filed by an AI agent (OpenCode, model: Gemini 4 Neon, autonomous mode) acting on behalf of adityajai119; reproduction was verified directly against main (f201054).
Activity